@agent-os-sdk/client 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/client/AgentOsClient.d.ts +57 -38
  2. package/dist/client/AgentOsClient.d.ts.map +1 -1
  3. package/dist/client/AgentOsClient.js +192 -37
  4. package/dist/client/auth.d.ts +102 -0
  5. package/dist/client/auth.d.ts.map +1 -0
  6. package/dist/client/auth.js +44 -0
  7. package/dist/generated/openapi.d.ts +1009 -204
  8. package/dist/generated/openapi.d.ts.map +1 -1
  9. package/dist/index.d.ts +12 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +12 -0
  12. package/dist/modules/approvals.d.ts +64 -0
  13. package/dist/modules/approvals.d.ts.map +1 -0
  14. package/dist/modules/approvals.js +54 -0
  15. package/dist/modules/artifacts.d.ts +49 -0
  16. package/dist/modules/artifacts.d.ts.map +1 -0
  17. package/dist/modules/artifacts.js +50 -0
  18. package/dist/modules/budgets.d.ts +81 -0
  19. package/dist/modules/budgets.d.ts.map +1 -0
  20. package/dist/modules/budgets.js +50 -0
  21. package/dist/modules/builder.d.ts +23 -3
  22. package/dist/modules/builder.d.ts.map +1 -1
  23. package/dist/modules/builder.js +28 -6
  24. package/dist/modules/capabilities.d.ts +57 -0
  25. package/dist/modules/capabilities.d.ts.map +1 -0
  26. package/dist/modules/capabilities.js +50 -0
  27. package/dist/modules/deployments.d.ts +67 -0
  28. package/dist/modules/deployments.d.ts.map +1 -0
  29. package/dist/modules/deployments.js +58 -0
  30. package/dist/modules/flows.d.ts +84 -0
  31. package/dist/modules/flows.d.ts.map +1 -0
  32. package/dist/modules/flows.js +66 -0
  33. package/dist/modules/handoff.d.ts +91 -0
  34. package/dist/modules/handoff.d.ts.map +1 -0
  35. package/dist/modules/handoff.js +65 -0
  36. package/dist/modules/incidents.d.ts +72 -0
  37. package/dist/modules/incidents.d.ts.map +1 -0
  38. package/dist/modules/incidents.js +54 -0
  39. package/dist/modules/members.d.ts +5 -0
  40. package/dist/modules/members.d.ts.map +1 -1
  41. package/dist/modules/members.js +10 -0
  42. package/dist/modules/policies.d.ts +76 -0
  43. package/dist/modules/policies.d.ts.map +1 -0
  44. package/dist/modules/policies.js +46 -0
  45. package/dist/modules/runs.d.ts +89 -3
  46. package/dist/modules/runs.d.ts.map +1 -1
  47. package/dist/modules/runs.js +75 -4
  48. package/dist/modules/tenants.d.ts +4 -0
  49. package/dist/modules/tenants.d.ts.map +1 -1
  50. package/dist/modules/tenants.js +8 -0
  51. package/package.json +49 -48
  52. package/src/client/AgentOsClient.ts +217 -61
  53. package/src/client/auth.ts +148 -0
  54. package/src/generated/openapi.ts +1009 -204
  55. package/src/generated/swagger.json +947 -700
  56. package/src/index.ts +25 -2
  57. package/src/modules/approvals.ts +109 -0
  58. package/src/modules/artifacts.ts +83 -0
  59. package/src/modules/budgets.ts +120 -0
  60. package/src/modules/builder.ts +26 -4
  61. package/src/modules/capabilities.ts +95 -0
  62. package/src/modules/deployments.ts +111 -0
  63. package/src/modules/flows.ts +133 -0
  64. package/src/modules/handoff.ts +140 -0
  65. package/src/modules/incidents.ts +113 -0
  66. package/src/modules/members.ts +11 -0
  67. package/src/modules/policies.ts +112 -0
  68. package/src/modules/runs.ts +123 -5
  69. package/src/modules/tenants.ts +9 -0
package/src/index.ts CHANGED
@@ -38,7 +38,19 @@
38
38
  // ============================================================================
39
39
  // Main Client
40
40
  // ============================================================================
41
- export { AgentOsClient, type AgentOsClientOptions } from "./client/AgentOsClient.js";
41
+ export { AgentOsClient, type AgentOsClientOptions, type AgentOsClientOptionsLegacy, type AuthProvider } from "./client/AgentOsClient.js";
42
+
43
+ // Auth Provider Types
44
+ export {
45
+ type ApiTokenAuth,
46
+ type JwtAuth,
47
+ isApiTokenAuth,
48
+ isJwtAuth,
49
+ isNewAuthOptions,
50
+ isBrowser,
51
+ isApiToken,
52
+ isJwtToken,
53
+ } from "./client/auth.js";
42
54
 
43
55
  // ============================================================================
44
56
  // Helpers & Utilities
@@ -74,7 +86,7 @@ export type { paths, components } from "./client/raw.js";
74
86
 
75
87
  // Core modules
76
88
  export { AgentsModule, type Agent, type AgentVersion, type AgentListResponse, type AgentGraphResponse } from "./modules/agents.js";
77
- export { RunsModule, type Run, type RunEvent, type RunListResponse, type RunEventsResponse, type CreateRunResponse } from "./modules/runs.js";
89
+ export { RunsModule, type Run, type RunStatus, type RunEvent, type RunListResponse, type RunEventsResponse, type CreateRunResponse, type RunEventsPollResponse, type RunEventDto } from "./modules/runs.js";
78
90
  export { ThreadsModule, type Thread, type ThreadState, type ThreadMessage, type ThreadRun, type ThreadListResponse, type ThreadMessagesResponse } from "./modules/threads.js";
79
91
  export { ToolsModule, type Tool, type ToolListResponse } from "./modules/tools.js";
80
92
  export { KnowledgeModule, type KnowledgeDataset, type KnowledgeSearchResponse } from "./modules/knowledge.js";
@@ -105,6 +117,17 @@ export { InfoModule, type ServerInfo } from "./modules/info.js";
105
117
  export { MetricsModule, type MetricsResponse } from "./modules/metrics.js";
106
118
  export { GraphsModule, type GraphValidationResult, type GraphIntrospectionResult } from "./modules/graphs.js";
107
119
 
120
+ // FUTURE modules - All return 501 Not Implemented. When backend is ready, implement real calls.
121
+ export { HandoffModule, type HandoffOptions, type HandoffResult, type ForkOptions, type ForkResult, type RunChain, type RunChainNode, type HandoffMode, type HandoffConstraints } from "./modules/handoff.js";
122
+ export { FlowsModule, type Flow, type FlowStep, type FlowRun, type FlowVisualization, type FlowSimulationResult, type FlowStatus, type FlowListResponse } from "./modules/flows.js";
123
+ export { CapabilitiesModule, type Capability, type CapabilityType, type CapabilityTest, type CapabilityMatrix } from "./modules/capabilities.js";
124
+ export { PoliciesModule, type Policy, type PolicyScope, type PolicyEnforcement, type PolicyRule, type PolicyEvaluation, type PolicyEvaluationResult } from "./modules/policies.js";
125
+ export { ApprovalsModule, type Approval, type ApprovalStatus, type ApprovalRequest, type ApprovalDecision, type ApprovalListResponse } from "./modules/approvals.js";
126
+ export { BudgetsModule, type Budget, type BudgetPeriod, type BudgetScope, type BudgetResourceType, type BudgetUsage, type BudgetAlert, type BudgetBreakdownItem } from "./modules/budgets.js";
127
+ export { DeploymentsModule, type Environment, type Deployment, type DeploymentStatus, type DeploymentConfig, type DeploymentHealth } from "./modules/deployments.js";
128
+ export { IncidentsModule, type Incident, type IncidentSeverity, type IncidentStatus, type IncidentUpdate, type IncidentMetrics } from "./modules/incidents.js";
129
+ export { ArtifactsModule, type Artifact, type ArtifactType, type ArtifactUploadUrl } from "./modules/artifacts.js";
130
+
108
131
  // ============================================================================
109
132
  // SSE Streaming
110
133
  // ============================================================================
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Approvals Module - Human-in-the-Loop Native
3
+ *
4
+ * NOT IMPLEMENTED - Backend endpoint not available.
5
+ * All methods return 501 NotImplemented.
6
+ */
7
+
8
+ import type { RawClient, APIResponse } from "../client/raw.js";
9
+
10
+ // ============================================================================
11
+ // Types
12
+ // ============================================================================
13
+
14
+ export type ApprovalStatus = "pending" | "approved" | "rejected" | "expired" | "auto_approved";
15
+
16
+ export interface Approval {
17
+ id: string;
18
+ run_id: string;
19
+ thread_id?: string;
20
+ action: string;
21
+ payload: Record<string, unknown>;
22
+ status: ApprovalStatus;
23
+ reason?: string;
24
+ requested_at: string;
25
+ responded_at?: string;
26
+ responded_by?: string;
27
+ expires_at?: string;
28
+ auto_approve_after?: number;
29
+ }
30
+
31
+ export interface ApprovalRequest {
32
+ run_id: string;
33
+ action: string;
34
+ payload: Record<string, unknown>;
35
+ expires_in_seconds?: number;
36
+ auto_approve_after_seconds?: number;
37
+ notify_channels?: string[];
38
+ }
39
+
40
+ export interface ApprovalListResponse {
41
+ items: Approval[];
42
+ total: number;
43
+ pending_count: number;
44
+ }
45
+
46
+ export interface ApprovalDecision {
47
+ approval_id: string;
48
+ decision: "approve" | "reject";
49
+ reason?: string;
50
+ modified_payload?: Record<string, unknown>;
51
+ }
52
+
53
+ // ============================================================================
54
+ // Helper for 501 responses
55
+ // ============================================================================
56
+
57
+ function notImplemented<T>(method: string): APIResponse<T> {
58
+ return {
59
+ data: undefined,
60
+ error: {
61
+ code: "NOT_IMPLEMENTED",
62
+ message: `ApprovalsModule.${method}() is not implemented. Backend endpoint not available.`,
63
+ },
64
+ response: new Response(null, { status: 501, statusText: "Not Implemented" }),
65
+ };
66
+ }
67
+
68
+ // ============================================================================
69
+ // Module
70
+ // ============================================================================
71
+
72
+ export class ApprovalsModule {
73
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
74
+
75
+ /** @returns 501 Not Implemented */
76
+ async list(params?: {
77
+ status?: ApprovalStatus;
78
+ run_id?: string;
79
+ limit?: number;
80
+ offset?: number;
81
+ }): Promise<APIResponse<ApprovalListResponse>> {
82
+ return notImplemented<ApprovalListResponse>("list");
83
+ }
84
+
85
+ /** @returns 501 Not Implemented */
86
+ async get(approvalId: string): Promise<APIResponse<Approval>> {
87
+ return notImplemented<Approval>("get");
88
+ }
89
+
90
+ /** @returns 501 Not Implemented */
91
+ async create(request: ApprovalRequest): Promise<APIResponse<Approval>> {
92
+ return notImplemented<Approval>("create");
93
+ }
94
+
95
+ /** @returns 501 Not Implemented */
96
+ async approve(approvalId: string, reason?: string): Promise<APIResponse<Approval>> {
97
+ return notImplemented<Approval>("approve");
98
+ }
99
+
100
+ /** @returns 501 Not Implemented */
101
+ async reject(approvalId: string, reason?: string): Promise<APIResponse<Approval>> {
102
+ return notImplemented<Approval>("reject");
103
+ }
104
+
105
+ /** @returns 501 Not Implemented */
106
+ async awaitApproval(runId: string, timeoutSeconds?: number): Promise<APIResponse<Approval>> {
107
+ return notImplemented<Approval>("awaitApproval");
108
+ }
109
+ }
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Artifacts Module - Run Output Management
3
+ *
4
+ * NOT IMPLEMENTED - Backend endpoint not available.
5
+ * All methods return 501 NotImplemented.
6
+ */
7
+
8
+ import type { RawClient, APIResponse } from "../client/raw.js";
9
+
10
+ // ============================================================================
11
+ // Types
12
+ // ============================================================================
13
+
14
+ export type ArtifactType = "file" | "image" | "json" | "text" | "log" | "report";
15
+
16
+ export interface Artifact {
17
+ id: string;
18
+ run_id: string;
19
+ name: string;
20
+ type: ArtifactType;
21
+ mime_type?: string;
22
+ size_bytes: number;
23
+ checksum?: string;
24
+ download_url?: string;
25
+ preview_url?: string;
26
+ metadata?: Record<string, unknown>;
27
+ created_at: string;
28
+ expires_at?: string;
29
+ }
30
+
31
+ export interface ArtifactUploadUrl {
32
+ upload_url: string;
33
+ artifact_id: string;
34
+ expires_at: string;
35
+ }
36
+
37
+ // ============================================================================
38
+ // Helper for 501 responses
39
+ // ============================================================================
40
+
41
+ function notImplemented<T>(method: string): APIResponse<T> {
42
+ return {
43
+ data: undefined,
44
+ error: {
45
+ code: "NOT_IMPLEMENTED",
46
+ message: `ArtifactsModule.${method}() is not implemented. Backend endpoint not available.`,
47
+ },
48
+ response: new Response(null, { status: 501, statusText: "Not Implemented" }),
49
+ };
50
+ }
51
+
52
+ // ============================================================================
53
+ // Module
54
+ // ============================================================================
55
+
56
+ export class ArtifactsModule {
57
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
58
+
59
+ /** @returns 501 Not Implemented */
60
+ async list(runId: string): Promise<APIResponse<{ items: Artifact[]; total: number }>> {
61
+ return notImplemented<{ items: Artifact[]; total: number }>("list");
62
+ }
63
+
64
+ /** @returns 501 Not Implemented */
65
+ async get(artifactId: string): Promise<APIResponse<Artifact>> {
66
+ return notImplemented<Artifact>("get");
67
+ }
68
+
69
+ /** @returns 501 Not Implemented */
70
+ async getDownloadUrl(artifactId: string): Promise<APIResponse<{ url: string; expires_at: string }>> {
71
+ return notImplemented<{ url: string; expires_at: string }>("getDownloadUrl");
72
+ }
73
+
74
+ /** @returns 501 Not Implemented */
75
+ async createUploadUrl(runId: string, name: string, type: ArtifactType): Promise<APIResponse<ArtifactUploadUrl>> {
76
+ return notImplemented<ArtifactUploadUrl>("createUploadUrl");
77
+ }
78
+
79
+ /** @returns 501 Not Implemented */
80
+ async delete(artifactId: string): Promise<APIResponse<void>> {
81
+ return notImplemented<void>("delete");
82
+ }
83
+ }
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Budgets Module - Cost & Token Management
3
+ *
4
+ * NOT IMPLEMENTED - Backend endpoint not available.
5
+ * All methods return 501 NotImplemented.
6
+ */
7
+
8
+ import type { RawClient, APIResponse } from "../client/raw.js";
9
+
10
+ // ============================================================================
11
+ // Types
12
+ // ============================================================================
13
+
14
+ export type BudgetScope = "agent" | "workspace" | "tenant" | "user";
15
+ export type BudgetPeriod = "daily" | "weekly" | "monthly" | "total";
16
+ export type BudgetResourceType = "tokens" | "cost" | "api_calls";
17
+
18
+ export interface Budget {
19
+ id: string;
20
+ name: string;
21
+ scope: BudgetScope;
22
+ scope_id: string;
23
+ resource_type: BudgetResourceType;
24
+ limit_value: number;
25
+ current_value: number;
26
+ period: BudgetPeriod;
27
+ period_start: string;
28
+ period_end: string;
29
+ alert_threshold_percent?: number;
30
+ created_at: string;
31
+ }
32
+
33
+ export interface BudgetUsage {
34
+ budget_id: string;
35
+ current_value: number;
36
+ limit_value: number;
37
+ percent_used: number;
38
+ remaining: number;
39
+ period_start: string;
40
+ period_end: string;
41
+ breakdown: BudgetBreakdownItem[];
42
+ }
43
+
44
+ export interface BudgetBreakdownItem {
45
+ agent_id?: string;
46
+ agent_name?: string;
47
+ model?: string;
48
+ value: number;
49
+ percent_of_total: number;
50
+ }
51
+
52
+ export interface BudgetAlert {
53
+ id: string;
54
+ budget_id: string;
55
+ type: "threshold_warning" | "limit_reached" | "limit_exceeded";
56
+ message: string;
57
+ triggered_at: string;
58
+ acknowledged: boolean;
59
+ }
60
+
61
+ // ============================================================================
62
+ // Helper for 501 responses
63
+ // ============================================================================
64
+
65
+ function notImplemented<T>(method: string): APIResponse<T> {
66
+ return {
67
+ data: undefined,
68
+ error: {
69
+ code: "NOT_IMPLEMENTED",
70
+ message: `BudgetsModule.${method}() is not implemented. Backend endpoint not available.`,
71
+ },
72
+ response: new Response(null, { status: 501, statusText: "Not Implemented" }),
73
+ };
74
+ }
75
+
76
+ // ============================================================================
77
+ // Module
78
+ // ============================================================================
79
+
80
+ export class BudgetsModule {
81
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
82
+
83
+ /** @returns 501 Not Implemented */
84
+ async list(params?: {
85
+ scope?: BudgetScope;
86
+ scope_id?: string;
87
+ limit?: number;
88
+ offset?: number;
89
+ }): Promise<APIResponse<{ items: Budget[]; total: number }>> {
90
+ return notImplemented<{ items: Budget[]; total: number }>("list");
91
+ }
92
+
93
+ /** @returns 501 Not Implemented */
94
+ async get(budgetId: string): Promise<APIResponse<Budget>> {
95
+ return notImplemented<Budget>("get");
96
+ }
97
+
98
+ /** @returns 501 Not Implemented */
99
+ async create(body: {
100
+ name: string;
101
+ scope: BudgetScope;
102
+ scope_id: string;
103
+ resource_type: BudgetResourceType;
104
+ limit_value: number;
105
+ period: BudgetPeriod;
106
+ alert_threshold_percent?: number;
107
+ }): Promise<APIResponse<Budget>> {
108
+ return notImplemented<Budget>("create");
109
+ }
110
+
111
+ /** @returns 501 Not Implemented */
112
+ async getUsage(budgetId: string): Promise<APIResponse<BudgetUsage>> {
113
+ return notImplemented<BudgetUsage>("getUsage");
114
+ }
115
+
116
+ /** @returns 501 Not Implemented */
117
+ async getAlerts(budgetId: string): Promise<APIResponse<BudgetAlert[]>> {
118
+ return notImplemented<BudgetAlert[]>("getAlerts");
119
+ }
120
+ }
@@ -1,8 +1,28 @@
1
1
  /**
2
2
  * Builder Module - Meta-Agent for Agent Building
3
3
  *
4
- * Connects to the kernel's meta-agent for AI-assisted agent creation.
4
+ * Connects to the Control Plane's builder endpoint which proxies to the
5
+ * Data Plane's meta-agent for AI-assisted agent creation.
5
6
  * Uses SSE streaming for real-time responses and graph updates.
7
+ *
8
+ * Flow: Frontend → CP:5000/v1/api/builder/{agentId}/chat → DP:8001/v1/internal/builder/{agentId}/chat
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const client = new AgentOsClient({ ... })
13
+ *
14
+ * // SSE streaming chat
15
+ * for await (const event of client.builder.chat(agentId, {
16
+ * message: "Adicione um nó de pesquisa web",
17
+ * current_graph_spec: { nodes: [...], edges: [...] }
18
+ * })) {
19
+ * if (event.type === 'message') console.log(event.data.text)
20
+ * if (event.type === 'graph_update') applyAction(event.data)
21
+ * }
22
+ *
23
+ * // Sync chat (no streaming)
24
+ * const result = await client.builder.chatSync(agentId, { message: "Mude as instruções" })
25
+ * ```
6
26
  */
7
27
 
8
28
  import { streamSSE, type SSEEvent, type SSEOptions } from "../sse/client.js";
@@ -36,7 +56,7 @@ export type BuilderChatResponse = {
36
56
 
37
57
  export class BuilderModule {
38
58
  constructor(
39
- private kernelBaseUrl: string,
59
+ private baseUrl: string,
40
60
  private headers: () => Record<string, string>
41
61
  ) { }
42
62
 
@@ -49,7 +69,8 @@ export class BuilderModule {
49
69
  request: BuilderChatRequest,
50
70
  options?: SSEOptions
51
71
  ): AsyncGenerator<BuilderStreamEvent> {
52
- const url = `${this.kernelBaseUrl}/v1/internal/builder/${agentId}/chat`;
72
+ // Use public API route (CP proxies to DP)
73
+ const url = `${this.baseUrl}/v1/api/builder/${agentId}/chat`;
53
74
 
54
75
  const response = await fetch(url, {
55
76
  method: "POST",
@@ -117,7 +138,8 @@ export class BuilderModule {
117
138
  agentId: string,
118
139
  request: BuilderChatRequest
119
140
  ): Promise<BuilderChatResponse> {
120
- const url = `${this.kernelBaseUrl}/v1/internal/builder/${agentId}/chat/sync`;
141
+ // Use public API route (CP proxies to DP)
142
+ const url = `${this.baseUrl}/v1/api/builder/${agentId}/chat/sync`;
121
143
 
122
144
  const response = await fetch(url, {
123
145
  method: "POST",
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Capabilities Module - Agent Capability Discovery
3
+ *
4
+ * NOT IMPLEMENTED - Backend endpoint not available.
5
+ * All methods return 501 NotImplemented.
6
+ */
7
+
8
+ import type { RawClient, APIResponse } from "../client/raw.js";
9
+
10
+ // ============================================================================
11
+ // Types
12
+ // ============================================================================
13
+
14
+ export type CapabilityType = "tool" | "skill" | "knowledge" | "integration" | "model_feature";
15
+
16
+ export interface Capability {
17
+ id: string;
18
+ name: string;
19
+ type: CapabilityType;
20
+ description?: string;
21
+ agent_id?: string;
22
+ is_available: boolean;
23
+ required_credentials?: string[];
24
+ required_permissions?: string[];
25
+ metadata?: Record<string, unknown>;
26
+ }
27
+
28
+ export interface CapabilityTest {
29
+ capability_id: string;
30
+ test_name: string;
31
+ passed: boolean;
32
+ message?: string;
33
+ duration_ms: number;
34
+ }
35
+
36
+ export interface CapabilityMatrix {
37
+ agent_id: string;
38
+ capabilities: Capability[];
39
+ total: number;
40
+ available: number;
41
+ unavailable: number;
42
+ }
43
+
44
+ // ============================================================================
45
+ // Helper for 501 responses
46
+ // ============================================================================
47
+
48
+ function notImplemented<T>(method: string): APIResponse<T> {
49
+ return {
50
+ data: undefined,
51
+ error: {
52
+ code: "NOT_IMPLEMENTED",
53
+ message: `CapabilitiesModule.${method}() is not implemented. Backend endpoint not available.`,
54
+ },
55
+ response: new Response(null, { status: 501, statusText: "Not Implemented" }),
56
+ };
57
+ }
58
+
59
+ // ============================================================================
60
+ // Module
61
+ // ============================================================================
62
+
63
+ export class CapabilitiesModule {
64
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
65
+
66
+ /** @returns 501 Not Implemented */
67
+ async list(params?: {
68
+ agent_id?: string;
69
+ type?: CapabilityType;
70
+ limit?: number;
71
+ offset?: number;
72
+ }): Promise<APIResponse<{ items: Capability[]; total: number }>> {
73
+ return notImplemented<{ items: Capability[]; total: number }>("list");
74
+ }
75
+
76
+ /** @returns 501 Not Implemented */
77
+ async get(capabilityId: string): Promise<APIResponse<Capability>> {
78
+ return notImplemented<Capability>("get");
79
+ }
80
+
81
+ /** @returns 501 Not Implemented */
82
+ async getMatrix(agentId: string): Promise<APIResponse<CapabilityMatrix>> {
83
+ return notImplemented<CapabilityMatrix>("getMatrix");
84
+ }
85
+
86
+ /** @returns 501 Not Implemented */
87
+ async test(agentId: string, capabilityId: string): Promise<APIResponse<CapabilityTest>> {
88
+ return notImplemented<CapabilityTest>("test");
89
+ }
90
+
91
+ /** @returns 501 Not Implemented */
92
+ async testAll(agentId: string): Promise<APIResponse<CapabilityTest[]>> {
93
+ return notImplemented<CapabilityTest[]>("testAll");
94
+ }
95
+ }
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Deployments Module - Agent Lifecycle
3
+ *
4
+ * NOT IMPLEMENTED - Backend endpoint not available.
5
+ * All methods return 501 NotImplemented.
6
+ */
7
+
8
+ import type { RawClient, APIResponse } from "../client/raw.js";
9
+
10
+ // ============================================================================
11
+ // Types
12
+ // ============================================================================
13
+
14
+ export type DeploymentStatus = "pending" | "building" | "deploying" | "active" | "failed" | "rolled_back" | "deactivated";
15
+ export type Environment = "development" | "staging" | "production";
16
+
17
+ export interface Deployment {
18
+ id: string;
19
+ agent_id: string;
20
+ version_id: string;
21
+ environment: Environment;
22
+ status: DeploymentStatus;
23
+ endpoint_url?: string;
24
+ deployed_at?: string;
25
+ created_at: string;
26
+ created_by: string;
27
+ rollback_version_id?: string;
28
+ }
29
+
30
+ export interface DeploymentConfig {
31
+ replicas?: number;
32
+ memory_mb?: number;
33
+ timeout_seconds?: number;
34
+ env_vars?: Record<string, string>;
35
+ auto_scale?: boolean;
36
+ min_replicas?: number;
37
+ max_replicas?: number;
38
+ }
39
+
40
+ export interface DeploymentHealth {
41
+ deployment_id: string;
42
+ healthy: boolean;
43
+ replicas_running: number;
44
+ replicas_desired: number;
45
+ last_check: string;
46
+ error?: string;
47
+ }
48
+
49
+ // ============================================================================
50
+ // Helper for 501 responses
51
+ // ============================================================================
52
+
53
+ function notImplemented<T>(method: string): APIResponse<T> {
54
+ return {
55
+ data: undefined,
56
+ error: {
57
+ code: "NOT_IMPLEMENTED",
58
+ message: `DeploymentsModule.${method}() is not implemented. Backend endpoint not available.`,
59
+ },
60
+ response: new Response(null, { status: 501, statusText: "Not Implemented" }),
61
+ };
62
+ }
63
+
64
+ // ============================================================================
65
+ // Module
66
+ // ============================================================================
67
+
68
+ export class DeploymentsModule {
69
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
70
+
71
+ /** @returns 501 Not Implemented */
72
+ async list(params?: {
73
+ agent_id?: string;
74
+ environment?: Environment;
75
+ status?: DeploymentStatus;
76
+ limit?: number;
77
+ offset?: number;
78
+ }): Promise<APIResponse<{ items: Deployment[]; total: number }>> {
79
+ return notImplemented<{ items: Deployment[]; total: number }>("list");
80
+ }
81
+
82
+ /** @returns 501 Not Implemented */
83
+ async get(deploymentId: string): Promise<APIResponse<Deployment>> {
84
+ return notImplemented<Deployment>("get");
85
+ }
86
+
87
+ /** @returns 501 Not Implemented */
88
+ async deploy(agentId: string, environment: Environment, config?: DeploymentConfig): Promise<APIResponse<Deployment>> {
89
+ return notImplemented<Deployment>("deploy");
90
+ }
91
+
92
+ /** @returns 501 Not Implemented */
93
+ async promote(deploymentId: string, toEnvironment: Environment): Promise<APIResponse<Deployment>> {
94
+ return notImplemented<Deployment>("promote");
95
+ }
96
+
97
+ /** @returns 501 Not Implemented */
98
+ async rollback(deploymentId: string): Promise<APIResponse<Deployment>> {
99
+ return notImplemented<Deployment>("rollback");
100
+ }
101
+
102
+ /** @returns 501 Not Implemented */
103
+ async health(deploymentId: string): Promise<APIResponse<DeploymentHealth>> {
104
+ return notImplemented<DeploymentHealth>("health");
105
+ }
106
+
107
+ /** @returns 501 Not Implemented */
108
+ async deactivate(deploymentId: string): Promise<APIResponse<void>> {
109
+ return notImplemented<void>("deactivate");
110
+ }
111
+ }