docs(go): audit README and AGENTS
Align the README API reference with the exported surface, add the upgrade note, document the shared modules and Linux test setup in AGENTS.md, and scope the Grok expandable-path assertion to Windows. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
This commit is contained in:
1 parent
96489cd051
commit
301210ff25
3 files changed
+63
-27
No files matched your search
@@ -10,6 +10,8 @@ go get github.com/Elydora-Infrastructure/Elydora-Go-SDK/v2
|
||||
|
||||
Requires Go 1.21+. The CLI uses focused TOML and JSONC parsers to preserve user-owned agent configuration.
|
||||
|
||||
Upgrading from 2.0.x: run `elydora install` again for every agent. The generated runtimes changed, and `elydora status` does not detect stale runtimes for every adapter.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```go
|
||||
@@ -23,18 +25,12 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Authenticate
|
||||
auth, err := elydora.Login("https://api.elydora.com", "user@example.com", "password")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Create client
|
||||
// Create client with an API token issued in the Console
|
||||
client, err := elydora.NewClient(&elydora.Config{
|
||||
OrgID: auth.User.OrgID,
|
||||
OrgID: "org-123",
|
||||
AgentID: "my-agent-id",
|
||||
PrivateKey: "<base64url-encoded-ed25519-seed>",
|
||||
Token: auth.Token,
|
||||
Token: "<api-token>",
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -113,8 +109,9 @@ Qwen Code `0.20.0` installation writes native user hooks to `$QWEN_HOME/settings
|
||||
|---------|-------------|
|
||||
| `elydora install` | Install Elydora audit hook for a coding agent |
|
||||
| `elydora uninstall` | Remove Elydora audit hook for a coding agent |
|
||||
| `elydora status` | Show installation status for all agents |
|
||||
| `elydora status` | Show installation status for one agent or all agents |
|
||||
| `elydora agents` | List supported coding agents |
|
||||
| `elydora version` | Print the CLI version |
|
||||
|
||||
### Supported Agents
|
||||
|
||||
@@ -162,24 +159,23 @@ client.SetToken("new-api-token")
|
||||
### Authentication
|
||||
|
||||
```go
|
||||
// Register a new user and organization
|
||||
reg, err := elydora.Register(baseURL, email, password,
|
||||
elydora.WithDisplayName("Alice"),
|
||||
elydora.WithOrgName("Acme Corp"),
|
||||
)
|
||||
|
||||
// Login and receive a session token
|
||||
auth, err := elydora.Login(baseURL, email, password)
|
||||
|
||||
// Get current authenticated user profile
|
||||
// Get the authenticated user and current organization
|
||||
me, err := client.GetMe()
|
||||
// me.User.Email, me.User.Role, me.CurrentOrganization.OrgID
|
||||
|
||||
// Issue a new API token (with optional TTL)
|
||||
// Issue an API token; this call needs a client whose Token is a Console session token
|
||||
tokenResp, err := client.IssueApiToken(&elydora.IssueApiTokenRequest{
|
||||
TTLSeconds: &ttlSeconds,
|
||||
})
|
||||
client.SetToken(tokenResp.Token)
|
||||
|
||||
// Rotate the installed API token; the response carries the replacement
|
||||
rotated, err := client.RotateApiToken()
|
||||
client.SetToken(rotated.Token)
|
||||
```
|
||||
|
||||
`elydora.Register` and `elydora.Login` remain for password accounts and are deprecated; use the Console sign-in flow.
|
||||
|
||||
### Operations
|
||||
|
||||
```go
|
||||
@@ -219,8 +215,11 @@ agent, err := client.RegisterAgent(&elydora.RegisterAgentRequest{
|
||||
// Get agent details
|
||||
details, err := client.GetAgent(agentID)
|
||||
|
||||
// Change the integration type
|
||||
updated, err := client.UpdateAgent(agentID, elydora.IntegrationTypeClaudecode)
|
||||
|
||||
// Freeze an agent
|
||||
err := client.FreezeAgent(agentID, "security review")
|
||||
frozen, err := client.FreezeAgent(agentID, "security review")
|
||||
|
||||
// Revoke a key
|
||||
err := client.RevokeKey(agentID, kid, "key rotation")
|
||||
@@ -229,7 +228,7 @@ err := client.RevokeKey(agentID, kid, "key rotation")
|
||||
agents, err := client.ListAgents()
|
||||
|
||||
// Unfreeze a previously frozen agent
|
||||
err := client.UnfreezeAgent(agentID, "review complete")
|
||||
unfrozen, err := client.UnfreezeAgent(agentID, "review complete")
|
||||
|
||||
// Delete an agent permanently
|
||||
deleted, err := client.DeleteAgent(agentID)
|
||||
@@ -270,6 +269,25 @@ detail, err := client.GetExport(exportID)
|
||||
data, err := client.DownloadExport(exportID)
|
||||
```
|
||||
|
||||
### Webhooks
|
||||
|
||||
```go
|
||||
webhook, err := client.RegisterWebhook(&elydora.RegisterWebhookRequest{
|
||||
EndpointURL: "https://example.com/elydora",
|
||||
Events: []string{"operation.accepted"},
|
||||
Secret: "<signing-secret>",
|
||||
})
|
||||
webhooks, err := client.ListWebhooks()
|
||||
err = client.DeleteWebhook(webhook.Webhook.WebhookID)
|
||||
```
|
||||
|
||||
### Organization
|
||||
|
||||
```go
|
||||
members, err := client.ListMembers()
|
||||
events, err := client.ListAdminEvents(50)
|
||||
```
|
||||
|
||||
### JWKS
|
||||
|
||||
```go
|
||||
@@ -281,7 +299,11 @@ jwks, err := client.GetJWKS()
|
||||
```go
|
||||
// Check API health (no authentication required, does not need a client)
|
||||
health, err := elydora.Health("https://api.elydora.com")
|
||||
// health.Status, health.Version, health.ProtocolVersion, health.Timestamp
|
||||
// health.Status, health.Version, health.ProtocolVersion, health.Capabilities, health.Timestamp
|
||||
|
||||
// Check dependency health (D1, auth storage, R2, KV)
|
||||
deep, err := elydora.DeepHealth("https://api.elydora.com")
|
||||
// deep.Dependencies.D1.Status, deep.Dependencies.KV.LatencyMs
|
||||
```
|
||||
|
||||
### Constants
|
||||
@@ -299,8 +321,11 @@ elydora.GenesisChainHash // "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
||||
| `KeyStatus` | `KeyStatusActive`, `KeyStatusRetired`, `KeyStatusRevoked` |
|
||||
| `ExportStatus` | `ExportStatusQueued`, `ExportStatusRunning`, `ExportStatusDone`, `ExportStatusFailed` |
|
||||
| `ExportFormat` | `ExportFormatJSON`, `ExportFormatPDF` |
|
||||
| `WebhookStatus` | `WebhookStatusActive`, `WebhookStatusDisabled` |
|
||||
| `IntegrationType` | One constant per supported agent key plus `IntegrationTypeEnterprise`, `IntegrationTypeGUI`, `IntegrationTypeSDK`, `IntegrationTypeOther` |
|
||||
| `AdminAction` | One constant per admin event action, for example `AdminActionAgentFreeze` |
|
||||
| `RbacRole` | `RbacRoleOrgOwner`, `RbacRoleSecurityAdmin`, `RbacRoleComplianceAuditor`, `RbacRoleReadonlyInvestigator`, `RbacRoleIntegrationEngineer` |
|
||||
| `ErrorCode` | `ErrorCodeInvalidSignature`, `ErrorCodeUnknownAgent`, `ErrorCodeKeyRevoked`, `ErrorCodeAgentFrozen`, `ErrorCodeTTLExpired`, `ErrorCodeReplayDetected`, `ErrorCodePrevHashMismatch`, `ErrorCodePayloadTooLarge`, `ErrorCodeRateLimited`, `ErrorCodeInternalError`, `ErrorCodeUnauthorized`, `ErrorCodeForbidden`, `ErrorCodeNotFound`, `ErrorCodeValidationError` |
|
||||
| `ErrorCode` | `ErrorCodeInvalidSignature`, `ErrorCodeUnknownAgent`, `ErrorCodeKeyRevoked`, `ErrorCodeKeyRetired`, `ErrorCodeAgentFrozen`, `ErrorCodeAgentRevoked`, `ErrorCodeTTLExpired`, `ErrorCodeReplayDetected`, `ErrorCodePrevHashMismatch`, `ErrorCodePayloadTooLarge`, `ErrorCodeRateLimited`, `ErrorCodeInternalError`, `ErrorCodeUnauthorized`, `ErrorCodeForbidden`, `ErrorCodeNotFound`, `ErrorCodeValidationError` |
|
||||
|
||||
## Error Handling
|
||||
|
||||
|
||||
Reference in new issue
Block a user