@agent-os-sdk/client 0.1.0

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 (147) hide show
  1. package/README.md +71 -0
  2. package/dist/client/AgentOsClient.d.ts +161 -0
  3. package/dist/client/AgentOsClient.d.ts.map +1 -0
  4. package/dist/client/AgentOsClient.js +217 -0
  5. package/dist/client/helpers.d.ts +63 -0
  6. package/dist/client/helpers.d.ts.map +1 -0
  7. package/dist/client/helpers.js +55 -0
  8. package/dist/client/raw.d.ts +138 -0
  9. package/dist/client/raw.d.ts.map +1 -0
  10. package/dist/client/raw.js +97 -0
  11. package/dist/generated/index.d.ts +2 -0
  12. package/dist/generated/index.d.ts.map +1 -0
  13. package/dist/generated/index.js +1 -0
  14. package/dist/generated/openapi.d.ts +6810 -0
  15. package/dist/generated/openapi.d.ts.map +1 -0
  16. package/dist/generated/openapi.js +5 -0
  17. package/dist/index.d.ts +72 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +86 -0
  20. package/dist/modules/a2a.d.ts +48 -0
  21. package/dist/modules/a2a.d.ts.map +1 -0
  22. package/dist/modules/a2a.js +37 -0
  23. package/dist/modules/agents.d.ts +137 -0
  24. package/dist/modules/agents.d.ts.map +1 -0
  25. package/dist/modules/agents.js +154 -0
  26. package/dist/modules/audit.d.ts +55 -0
  27. package/dist/modules/audit.d.ts.map +1 -0
  28. package/dist/modules/audit.js +38 -0
  29. package/dist/modules/builder.d.ts +65 -0
  30. package/dist/modules/builder.d.ts.map +1 -0
  31. package/dist/modules/builder.js +119 -0
  32. package/dist/modules/checkpoints.d.ts +53 -0
  33. package/dist/modules/checkpoints.d.ts.map +1 -0
  34. package/dist/modules/checkpoints.js +39 -0
  35. package/dist/modules/credentials.d.ts +89 -0
  36. package/dist/modules/credentials.d.ts.map +1 -0
  37. package/dist/modules/credentials.js +79 -0
  38. package/dist/modules/crons.d.ts +72 -0
  39. package/dist/modules/crons.d.ts.map +1 -0
  40. package/dist/modules/crons.js +66 -0
  41. package/dist/modules/dlq.d.ts +60 -0
  42. package/dist/modules/dlq.d.ts.map +1 -0
  43. package/dist/modules/dlq.js +56 -0
  44. package/dist/modules/evaluation.d.ts +119 -0
  45. package/dist/modules/evaluation.d.ts.map +1 -0
  46. package/dist/modules/evaluation.js +96 -0
  47. package/dist/modules/files.d.ts +68 -0
  48. package/dist/modules/files.d.ts.map +1 -0
  49. package/dist/modules/files.js +66 -0
  50. package/dist/modules/graphs.d.ts +51 -0
  51. package/dist/modules/graphs.d.ts.map +1 -0
  52. package/dist/modules/graphs.js +29 -0
  53. package/dist/modules/info.d.ts +27 -0
  54. package/dist/modules/info.d.ts.map +1 -0
  55. package/dist/modules/info.js +27 -0
  56. package/dist/modules/knowledge.d.ts +91 -0
  57. package/dist/modules/knowledge.d.ts.map +1 -0
  58. package/dist/modules/knowledge.js +80 -0
  59. package/dist/modules/mcp.d.ts +39 -0
  60. package/dist/modules/mcp.d.ts.map +1 -0
  61. package/dist/modules/mcp.js +38 -0
  62. package/dist/modules/me.d.ts +27 -0
  63. package/dist/modules/me.d.ts.map +1 -0
  64. package/dist/modules/me.js +19 -0
  65. package/dist/modules/members.d.ts +77 -0
  66. package/dist/modules/members.d.ts.map +1 -0
  67. package/dist/modules/members.js +77 -0
  68. package/dist/modules/metrics.d.ts +16 -0
  69. package/dist/modules/metrics.d.ts.map +1 -0
  70. package/dist/modules/metrics.js +24 -0
  71. package/dist/modules/playground.d.ts +42 -0
  72. package/dist/modules/playground.d.ts.map +1 -0
  73. package/dist/modules/playground.js +48 -0
  74. package/dist/modules/prompts.d.ts +87 -0
  75. package/dist/modules/prompts.d.ts.map +1 -0
  76. package/dist/modules/prompts.js +87 -0
  77. package/dist/modules/runs.d.ts +181 -0
  78. package/dist/modules/runs.d.ts.map +1 -0
  79. package/dist/modules/runs.js +187 -0
  80. package/dist/modules/store.d.ts +37 -0
  81. package/dist/modules/store.d.ts.map +1 -0
  82. package/dist/modules/store.js +48 -0
  83. package/dist/modules/tenants.d.ts +42 -0
  84. package/dist/modules/tenants.d.ts.map +1 -0
  85. package/dist/modules/tenants.js +45 -0
  86. package/dist/modules/threads.d.ts +181 -0
  87. package/dist/modules/threads.d.ts.map +1 -0
  88. package/dist/modules/threads.js +178 -0
  89. package/dist/modules/tools.d.ts +44 -0
  90. package/dist/modules/tools.d.ts.map +1 -0
  91. package/dist/modules/tools.js +39 -0
  92. package/dist/modules/traces.d.ts +79 -0
  93. package/dist/modules/traces.d.ts.map +1 -0
  94. package/dist/modules/traces.js +56 -0
  95. package/dist/modules/triggers.d.ts +71 -0
  96. package/dist/modules/triggers.d.ts.map +1 -0
  97. package/dist/modules/triggers.js +67 -0
  98. package/dist/modules/usage.d.ts +26 -0
  99. package/dist/modules/usage.d.ts.map +1 -0
  100. package/dist/modules/usage.js +19 -0
  101. package/dist/modules/vectorStores.d.ts +97 -0
  102. package/dist/modules/vectorStores.d.ts.map +1 -0
  103. package/dist/modules/vectorStores.js +87 -0
  104. package/dist/modules/workspaces.d.ts +52 -0
  105. package/dist/modules/workspaces.d.ts.map +1 -0
  106. package/dist/modules/workspaces.js +59 -0
  107. package/dist/sse/client.d.ts +62 -0
  108. package/dist/sse/client.d.ts.map +1 -0
  109. package/dist/sse/client.js +66 -0
  110. package/package.json +50 -0
  111. package/src/client/AgentOsClient.ts +269 -0
  112. package/src/client/helpers.ts +98 -0
  113. package/src/client/raw.ts +241 -0
  114. package/src/generated/index.ts +2 -0
  115. package/src/generated/openapi.ts +6810 -0
  116. package/src/generated/swagger.json +8549 -0
  117. package/src/index.ts +161 -0
  118. package/src/modules/a2a.ts +64 -0
  119. package/src/modules/agents.ts +229 -0
  120. package/src/modules/audit.ts +74 -0
  121. package/src/modules/builder.ts +166 -0
  122. package/src/modules/checkpoints.ts +78 -0
  123. package/src/modules/credentials.ts +144 -0
  124. package/src/modules/crons.ts +114 -0
  125. package/src/modules/dlq.ts +93 -0
  126. package/src/modules/evaluation.ts +189 -0
  127. package/src/modules/files.ts +112 -0
  128. package/src/modules/graphs.ts +50 -0
  129. package/src/modules/info.ts +35 -0
  130. package/src/modules/knowledge.ts +147 -0
  131. package/src/modules/mcp.ts +59 -0
  132. package/src/modules/me.ts +32 -0
  133. package/src/modules/members.ts +117 -0
  134. package/src/modules/metrics.ts +27 -0
  135. package/src/modules/playground.ts +68 -0
  136. package/src/modules/prompts.ts +147 -0
  137. package/src/modules/runs.ts +277 -0
  138. package/src/modules/store.ts +65 -0
  139. package/src/modules/tenants.ts +67 -0
  140. package/src/modules/threads.ts +287 -0
  141. package/src/modules/tools.ts +65 -0
  142. package/src/modules/traces.ts +117 -0
  143. package/src/modules/triggers.ts +113 -0
  144. package/src/modules/usage.ts +32 -0
  145. package/src/modules/vectorStores.ts +160 -0
  146. package/src/modules/workspaces.ts +89 -0
  147. package/src/sse/client.ts +100 -0
@@ -0,0 +1,37 @@
1
+ /**
2
+ * A2A Module - Fully Typed (Agent-to-Agent Protocol)
3
+ */
4
+ export class A2aModule {
5
+ client;
6
+ headers;
7
+ constructor(client, headers) {
8
+ this.client = client;
9
+ this.headers = headers;
10
+ }
11
+ /**
12
+ * Send a JSON-RPC request to an agent.
13
+ */
14
+ async call(request) {
15
+ return this.client.POST("/v1/api/a2a", {
16
+ body: request,
17
+ headers: this.headers(),
18
+ });
19
+ }
20
+ /**
21
+ * Get agent card (discovery).
22
+ */
23
+ async getAgentCard(agentId) {
24
+ return this.client.GET("/v1/api/a2a/agents/{id}/card", {
25
+ params: { path: { id: agentId } },
26
+ headers: this.headers(),
27
+ });
28
+ }
29
+ /**
30
+ * List available A2A agents.
31
+ */
32
+ async listAgents() {
33
+ return this.client.GET("/v1/api/a2a/agents", {
34
+ headers: this.headers(),
35
+ });
36
+ }
37
+ }
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Agents Module - Fully Typed
3
+ *
4
+ * Naming conventions:
5
+ * - get* for singular items: getAgent(id)
6
+ * - list* for collections: listAgents()
7
+ * - create*, update*, delete* for mutations
8
+ */
9
+ import type { RawClient, APIResponse, components } from "../client/raw.js";
10
+ import type { PaginationParams, PaginatedResponse } from "../client/helpers.js";
11
+ type AgentBundle = components["schemas"]["AgentBundle"];
12
+ export interface Agent {
13
+ id: string;
14
+ name: string;
15
+ description?: string;
16
+ workspace_id: string;
17
+ tenant_id: string;
18
+ created_at: string;
19
+ updated_at: string;
20
+ live_version_id?: string | null;
21
+ }
22
+ export interface AgentVersion {
23
+ id: string;
24
+ agent_id: string;
25
+ version_tag: string;
26
+ artifact_uri?: string;
27
+ artifact_hash?: string;
28
+ format?: string;
29
+ graph_spec?: unknown;
30
+ created_at: string;
31
+ }
32
+ export interface AgentGraphResponse {
33
+ mermaid?: string;
34
+ json?: unknown;
35
+ }
36
+ export interface GraphValidationResponse {
37
+ valid: boolean;
38
+ errors?: string[];
39
+ warnings?: string[];
40
+ }
41
+ export type AgentListResponse = PaginatedResponse<Agent>;
42
+ export type AgentVersionListResponse = PaginatedResponse<AgentVersion>;
43
+ export declare class AgentsModule {
44
+ private client;
45
+ private headers;
46
+ constructor(client: RawClient, headers: () => Record<string, string>);
47
+ /**
48
+ * List all agents in the workspace.
49
+ * @example
50
+ * ```ts
51
+ * const { data } = await client.agents.list({ limit: 10 });
52
+ * data?.items.forEach(agent => console.log(agent.name));
53
+ * ```
54
+ */
55
+ list(params?: PaginationParams & {
56
+ workspace_id?: string;
57
+ }): Promise<APIResponse<AgentListResponse>>;
58
+ /**
59
+ * Get a single agent by ID.
60
+ * @example
61
+ * ```ts
62
+ * const { data: agent } = await client.agents.get("agent-uuid");
63
+ * ```
64
+ */
65
+ get(agentId: string): Promise<APIResponse<Agent>>;
66
+ /**
67
+ * Create a new agent.
68
+ * @example
69
+ * ```ts
70
+ * const { data: agent } = await client.agents.create({
71
+ * name: "My Agent",
72
+ * description: "Does cool stuff"
73
+ * });
74
+ * ```
75
+ */
76
+ create(body: {
77
+ name: string;
78
+ description?: string;
79
+ graph_json?: unknown;
80
+ }): Promise<APIResponse<Agent>>;
81
+ /**
82
+ * Update an existing agent.
83
+ */
84
+ update(agentId: string, body: {
85
+ name?: string;
86
+ description?: string;
87
+ live_version_id?: string;
88
+ }): Promise<APIResponse<Agent>>;
89
+ /**
90
+ * Delete an agent.
91
+ */
92
+ delete(agentId: string): Promise<APIResponse<void>>;
93
+ /**
94
+ * List all versions of an agent.
95
+ * @example
96
+ * ```ts
97
+ * const { data } = await client.agents.listVersions("agent-uuid");
98
+ * ```
99
+ */
100
+ listVersions(agentId: string): Promise<APIResponse<AgentVersion[]>>;
101
+ /** Alias for listVersions (convenience) */
102
+ versions: (agentId: string) => Promise<APIResponse<AgentVersion[]>>;
103
+ /**
104
+ * Create a new version of an agent.
105
+ */
106
+ createVersion(agentId: string, body: {
107
+ version_tag: string;
108
+ artifact_uri?: string;
109
+ artifact_hash?: string;
110
+ format?: string;
111
+ graph_spec?: unknown;
112
+ }): Promise<APIResponse<AgentVersion>>;
113
+ /**
114
+ * Get a specific version of an agent.
115
+ */
116
+ getVersion(agentId: string, versionId: string): Promise<APIResponse<AgentVersion>>;
117
+ /**
118
+ * Get the graph for an agent (Mermaid or JSON).
119
+ */
120
+ getGraph(agentId: string, format?: "mermaid" | "json"): Promise<APIResponse<AgentGraphResponse>>;
121
+ /** Alias for getGraph (convenience) */
122
+ graph: (agentId: string, format?: "mermaid" | "json") => Promise<APIResponse<AgentGraphResponse>>;
123
+ /**
124
+ * Validate the graph configuration.
125
+ */
126
+ validateGraph(agentId: string): Promise<APIResponse<GraphValidationResponse>>;
127
+ /**
128
+ * Export an agent with all its versions.
129
+ */
130
+ export(agentId: string): Promise<APIResponse<AgentBundle>>;
131
+ /**
132
+ * Import an agent bundle.
133
+ */
134
+ import(bundle: AgentBundle): Promise<APIResponse<Agent>>;
135
+ }
136
+ export {};
137
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/modules/agents.ts"],"names":[],"mappings":"AAA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,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,OAAO,CAAC;KACxB,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAQtC;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IASxF;;OAEG;IACG,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAOtG,uCAAuC;IACvC,KAAK,GAAI,SAAS,MAAM,EAAE,SAAS,SAAS,GAAG,MAAM,8CAAoC;IAEzF;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;IASnF;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAOhE;;OAEG;IACG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;CAMjE"}
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Agents Module - Fully Typed
3
+ *
4
+ * Naming conventions:
5
+ * - get* for singular items: getAgent(id)
6
+ * - list* for collections: listAgents()
7
+ * - create*, update*, delete* for mutations
8
+ */
9
+ export class AgentsModule {
10
+ client;
11
+ headers;
12
+ constructor(client, headers) {
13
+ this.client = client;
14
+ this.headers = headers;
15
+ }
16
+ // ======================== CRUD ========================
17
+ /**
18
+ * List all agents in the workspace.
19
+ * @example
20
+ * ```ts
21
+ * const { data } = await client.agents.list({ limit: 10 });
22
+ * data?.items.forEach(agent => console.log(agent.name));
23
+ * ```
24
+ */
25
+ async list(params) {
26
+ return this.client.GET("/v1/api/agents", {
27
+ params: { query: params },
28
+ headers: this.headers(),
29
+ });
30
+ }
31
+ /**
32
+ * Get a single agent by ID.
33
+ * @example
34
+ * ```ts
35
+ * const { data: agent } = await client.agents.get("agent-uuid");
36
+ * ```
37
+ */
38
+ async get(agentId) {
39
+ return this.client.GET("/v1/api/agents/{agentId}", {
40
+ params: { path: { agentId } },
41
+ headers: this.headers(),
42
+ });
43
+ }
44
+ /**
45
+ * Create a new agent.
46
+ * @example
47
+ * ```ts
48
+ * const { data: agent } = await client.agents.create({
49
+ * name: "My Agent",
50
+ * description: "Does cool stuff"
51
+ * });
52
+ * ```
53
+ */
54
+ async create(body) {
55
+ return this.client.POST("/v1/api/agents", {
56
+ body,
57
+ headers: this.headers(),
58
+ });
59
+ }
60
+ /**
61
+ * Update an existing agent.
62
+ */
63
+ async update(agentId, body) {
64
+ return this.client.PUT("/v1/api/agents/{agentId}", {
65
+ params: { path: { agentId } },
66
+ body,
67
+ headers: this.headers(),
68
+ });
69
+ }
70
+ /**
71
+ * Delete an agent.
72
+ */
73
+ async delete(agentId) {
74
+ return this.client.DELETE("/v1/api/agents/{agentId}", {
75
+ params: { path: { agentId } },
76
+ headers: this.headers(),
77
+ });
78
+ }
79
+ // ======================== Versions ========================
80
+ /**
81
+ * List all versions of an agent.
82
+ * @example
83
+ * ```ts
84
+ * const { data } = await client.agents.listVersions("agent-uuid");
85
+ * ```
86
+ */
87
+ async listVersions(agentId) {
88
+ return this.client.GET("/v1/api/agents/{agentId}/versions", {
89
+ params: { path: { agentId } },
90
+ headers: this.headers(),
91
+ });
92
+ }
93
+ /** Alias for listVersions (convenience) */
94
+ versions = (agentId) => this.listVersions(agentId);
95
+ /**
96
+ * Create a new version of an agent.
97
+ */
98
+ async createVersion(agentId, body) {
99
+ return this.client.POST("/v1/api/agents/{agentId}/versions", {
100
+ params: { path: { agentId } },
101
+ body,
102
+ headers: this.headers(),
103
+ });
104
+ }
105
+ /**
106
+ * Get a specific version of an agent.
107
+ */
108
+ async getVersion(agentId, versionId) {
109
+ return this.client.GET("/v1/api/agents/{agentId}/versions/{versionId}", {
110
+ params: { path: { agentId, versionId } },
111
+ headers: this.headers(),
112
+ });
113
+ }
114
+ // ======================== Graph ========================
115
+ /**
116
+ * Get the graph for an agent (Mermaid or JSON).
117
+ */
118
+ async getGraph(agentId, format) {
119
+ return this.client.GET("/v1/api/agents/{agentId}/graph", {
120
+ params: { path: { agentId }, query: { format } },
121
+ headers: this.headers(),
122
+ });
123
+ }
124
+ /** Alias for getGraph (convenience) */
125
+ graph = (agentId, format) => this.getGraph(agentId, format);
126
+ /**
127
+ * Validate the graph configuration.
128
+ */
129
+ async validateGraph(agentId) {
130
+ return this.client.POST("/v1/api/agents/{agentId}/graph/validate", {
131
+ params: { path: { agentId } },
132
+ headers: this.headers(),
133
+ });
134
+ }
135
+ // ======================== Import/Export ========================
136
+ /**
137
+ * Export an agent with all its versions.
138
+ */
139
+ async export(agentId) {
140
+ return this.client.GET("/v1/api/agents/{id}/export", {
141
+ params: { path: { id: agentId } },
142
+ headers: this.headers(),
143
+ });
144
+ }
145
+ /**
146
+ * Import an agent bundle.
147
+ */
148
+ async import(bundle) {
149
+ return this.client.POST("/v1/api/agents/import", {
150
+ body: bundle,
151
+ headers: this.headers(),
152
+ });
153
+ }
154
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Audit Module - Fully Typed
3
+ */
4
+ import type { RawClient, APIResponse } from "../client/raw.js";
5
+ export interface AuditLogEntry {
6
+ id: string;
7
+ tenant_id: string;
8
+ workspace_id?: string;
9
+ actor: string;
10
+ actor_type: "user" | "system" | "api_token";
11
+ action: string;
12
+ resource: string;
13
+ resource_id?: string;
14
+ metadata?: Record<string, unknown>;
15
+ ip_address?: string;
16
+ user_agent?: string;
17
+ created_at: string;
18
+ }
19
+ export interface AuditListResponse {
20
+ items: AuditLogEntry[];
21
+ total: number;
22
+ }
23
+ export declare class AuditModule {
24
+ private client;
25
+ private headers;
26
+ constructor(client: RawClient, headers: () => Record<string, string>);
27
+ /**
28
+ * List audit log entries.
29
+ */
30
+ list(params?: {
31
+ actor?: string;
32
+ action?: string;
33
+ resource?: string;
34
+ workspace_id?: string;
35
+ from?: string;
36
+ to?: string;
37
+ skip?: number;
38
+ take?: number;
39
+ }): Promise<APIResponse<AuditListResponse>>;
40
+ /**
41
+ * Get a specific audit log entry.
42
+ */
43
+ get(auditId: string): Promise<APIResponse<AuditLogEntry>>;
44
+ /**
45
+ * Search audit logs by action pattern.
46
+ */
47
+ search(params?: {
48
+ query?: string;
49
+ from?: string;
50
+ to?: string;
51
+ skip?: number;
52
+ take?: number;
53
+ }): Promise<APIResponse<AuditListResponse>>;
54
+ }
55
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/modules/audit.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,WAAW;IACR,OAAO,CAAC,MAAM;IAAa,OAAO,CAAC,OAAO;gBAAlC,MAAM,EAAE,SAAS,EAAU,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAEpF;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAO3C;;OAEG;IACG,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAO/D;;OAEG;IACG,MAAM,CAAC,MAAM,CAAC,EAAE;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;CAM9C"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Audit Module - Fully Typed
3
+ */
4
+ export class AuditModule {
5
+ client;
6
+ headers;
7
+ constructor(client, headers) {
8
+ this.client = client;
9
+ this.headers = headers;
10
+ }
11
+ /**
12
+ * List audit log entries.
13
+ */
14
+ async list(params) {
15
+ return this.client.GET("/v1/api/audit", {
16
+ params: { query: params },
17
+ headers: this.headers(),
18
+ });
19
+ }
20
+ /**
21
+ * Get a specific audit log entry.
22
+ */
23
+ async get(auditId) {
24
+ return this.client.GET("/v1/api/audit/{id}", {
25
+ params: { path: { id: auditId } },
26
+ headers: this.headers(),
27
+ });
28
+ }
29
+ /**
30
+ * Search audit logs by action pattern.
31
+ */
32
+ async search(params) {
33
+ return this.client.GET("/v1/api/audit/search", {
34
+ params: { query: params },
35
+ headers: this.headers(),
36
+ });
37
+ }
38
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Builder Module - Meta-Agent for Agent Building
3
+ *
4
+ * Connects to the kernel's meta-agent for AI-assisted agent creation.
5
+ * Uses SSE streaming for real-time responses and graph updates.
6
+ */
7
+ import { type SSEOptions } from "../sse/client.js";
8
+ export type BuilderChatRequest = {
9
+ message: string;
10
+ current_graph_spec?: Record<string, unknown>;
11
+ thread_id?: string;
12
+ };
13
+ export type GraphUpdateAction = {
14
+ action: string;
15
+ node_name?: string;
16
+ node_type?: string;
17
+ properties?: Record<string, unknown>;
18
+ edge_from?: string;
19
+ edge_to?: string;
20
+ };
21
+ export type BuilderStreamEvent = {
22
+ type: "message";
23
+ data: {
24
+ text: string;
25
+ };
26
+ } | {
27
+ type: "graph_update";
28
+ data: GraphUpdateAction;
29
+ } | {
30
+ type: "done";
31
+ data: {
32
+ response: string;
33
+ actions: GraphUpdateAction[];
34
+ thread_id: string;
35
+ };
36
+ } | {
37
+ type: "error";
38
+ data: {
39
+ error: string;
40
+ };
41
+ };
42
+ export type BuilderChatResponse = {
43
+ response: string;
44
+ actions: GraphUpdateAction[];
45
+ thread_id: string;
46
+ };
47
+ export declare class BuilderModule {
48
+ private kernelBaseUrl;
49
+ private headers;
50
+ constructor(kernelBaseUrl: string, headers: () => Record<string, string>);
51
+ /**
52
+ * Stream chat with meta-agent (SSE).
53
+ * Returns async generator of events.
54
+ */
55
+ chat(agentId: string, request: BuilderChatRequest, options?: SSEOptions): AsyncGenerator<BuilderStreamEvent>;
56
+ /**
57
+ * Sync chat with meta-agent (no streaming).
58
+ */
59
+ chatSync(agentId: string, request: BuilderChatRequest): Promise<BuilderChatResponse>;
60
+ /**
61
+ * Convenience method: chat and collect all events.
62
+ */
63
+ chatCollect(agentId: string, request: BuilderChatRequest): Promise<BuilderChatResponse>;
64
+ }
65
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/modules/builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE7E,MAAM,MAAM,kBAAkB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GACxB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,iBAAiB,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAC7F;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,qBAAa,aAAa;IAElB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,OAAO;gBADP,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGjD;;;OAGG;IACI,IAAI,CACP,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,kBAAkB,EAC3B,OAAO,CAAC,EAAE,UAAU,GACrB,cAAc,CAAC,kBAAkB,CAAC;IA8DrC;;OAEG;IACG,QAAQ,CACV,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,mBAAmB,CAAC;IAoB/B;;OAEG;IACG,WAAW,CACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,mBAAmB,CAAC;CAqBlC"}
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Builder Module - Meta-Agent for Agent Building
3
+ *
4
+ * Connects to the kernel's meta-agent for AI-assisted agent creation.
5
+ * Uses SSE streaming for real-time responses and graph updates.
6
+ */
7
+ import { streamSSE } from "../sse/client.js";
8
+ export class BuilderModule {
9
+ kernelBaseUrl;
10
+ headers;
11
+ constructor(kernelBaseUrl, headers) {
12
+ this.kernelBaseUrl = kernelBaseUrl;
13
+ this.headers = headers;
14
+ }
15
+ /**
16
+ * Stream chat with meta-agent (SSE).
17
+ * Returns async generator of events.
18
+ */
19
+ async *chat(agentId, request, options) {
20
+ const url = `${this.kernelBaseUrl}/v1/internal/builder/${agentId}/chat`;
21
+ const response = await fetch(url, {
22
+ method: "POST",
23
+ headers: {
24
+ "Content-Type": "application/json",
25
+ Accept: "text/event-stream",
26
+ ...this.headers(),
27
+ },
28
+ body: JSON.stringify(request),
29
+ signal: options?.signal,
30
+ });
31
+ if (!response.ok) {
32
+ throw new Error(`Builder chat failed: ${response.status}`);
33
+ }
34
+ if (!response.body) {
35
+ throw new Error("No response body");
36
+ }
37
+ options?.onOpen?.();
38
+ const reader = response.body.getReader();
39
+ const decoder = new TextDecoder();
40
+ let buffer = "";
41
+ try {
42
+ while (true) {
43
+ const { done, value } = await reader.read();
44
+ if (done)
45
+ break;
46
+ buffer += decoder.decode(value, { stream: true });
47
+ const lines = buffer.split("\n");
48
+ buffer = lines.pop() ?? "";
49
+ let eventType = "message";
50
+ let eventData = "";
51
+ for (const line of lines) {
52
+ if (line.startsWith("event:")) {
53
+ eventType = line.slice(6).trim();
54
+ }
55
+ else if (line.startsWith("data:")) {
56
+ eventData = line.slice(5).trim();
57
+ }
58
+ else if (line === "" && eventData) {
59
+ try {
60
+ const parsed = JSON.parse(eventData);
61
+ yield { type: eventType, data: parsed };
62
+ }
63
+ catch {
64
+ // Skip invalid JSON
65
+ }
66
+ eventData = "";
67
+ eventType = "message";
68
+ }
69
+ }
70
+ }
71
+ }
72
+ finally {
73
+ reader.releaseLock();
74
+ }
75
+ }
76
+ /**
77
+ * Sync chat with meta-agent (no streaming).
78
+ */
79
+ async chatSync(agentId, request) {
80
+ const url = `${this.kernelBaseUrl}/v1/internal/builder/${agentId}/chat/sync`;
81
+ const response = await fetch(url, {
82
+ method: "POST",
83
+ headers: {
84
+ "Content-Type": "application/json",
85
+ ...this.headers(),
86
+ },
87
+ body: JSON.stringify(request),
88
+ });
89
+ if (!response.ok) {
90
+ const error = await response.text();
91
+ throw new Error(`Builder chat failed: ${response.status} - ${error}`);
92
+ }
93
+ return response.json();
94
+ }
95
+ /**
96
+ * Convenience method: chat and collect all events.
97
+ */
98
+ async chatCollect(agentId, request) {
99
+ let fullResponse = "";
100
+ const allActions = [];
101
+ let threadId = request.thread_id ?? "";
102
+ for await (const event of this.chat(agentId, request)) {
103
+ if (event.type === "message") {
104
+ fullResponse += event.data.text;
105
+ }
106
+ else if (event.type === "graph_update") {
107
+ allActions.push(event.data);
108
+ }
109
+ else if (event.type === "done") {
110
+ threadId = event.data.thread_id;
111
+ }
112
+ }
113
+ return {
114
+ response: fullResponse,
115
+ actions: allActions,
116
+ thread_id: threadId,
117
+ };
118
+ }
119
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Checkpoints Module - Fully Typed
3
+ */
4
+ import type { RawClient, APIResponse } from "../client/raw.js";
5
+ export interface Checkpoint {
6
+ id: string;
7
+ run_id: string;
8
+ thread_id: string;
9
+ step_name: string;
10
+ checkpoint_id: string;
11
+ parent_checkpoint_id?: string;
12
+ has_state_snapshot: boolean;
13
+ created_at: string;
14
+ }
15
+ export interface CheckpointNode {
16
+ id: string;
17
+ step_name: string;
18
+ checkpoint_id: string;
19
+ parent_checkpoint_id?: string;
20
+ created_at: string;
21
+ children?: CheckpointNode[];
22
+ }
23
+ export interface CheckpointsResponse {
24
+ run_id: string;
25
+ total_checkpoints: number;
26
+ checkpoints: CheckpointNode[];
27
+ }
28
+ export interface ReplayResponse {
29
+ run_id: string;
30
+ status: string;
31
+ replayed_from_checkpoint_id: string;
32
+ }
33
+ export declare class CheckpointsModule {
34
+ private client;
35
+ private headers;
36
+ constructor(client: RawClient, headers: () => Record<string, string>);
37
+ /**
38
+ * List checkpoints for a run.
39
+ */
40
+ list(runId: string): Promise<APIResponse<CheckpointsResponse>>;
41
+ /**
42
+ * Get a specific checkpoint.
43
+ */
44
+ get(checkpointId: string): Promise<APIResponse<Checkpoint>>;
45
+ /**
46
+ * Replay from a checkpoint.
47
+ */
48
+ replay(checkpointId: string, options?: {
49
+ mode?: "best_effort" | "deterministic";
50
+ modified_state?: unknown;
51
+ }): Promise<APIResponse<ReplayResponse>>;
52
+ }
53
+ //# sourceMappingURL=checkpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoints.d.ts","sourceRoot":"","sources":["../../src/modules/checkpoints.ts"],"names":[],"mappings":"AAAA;;GAE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