@agent-os-sdk/client 0.9.33 → 0.9.35

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.
@@ -0,0 +1,242 @@
1
+ /**
2
+ * Builder Module - Meta-Agent for Agent Building
3
+ *
4
+ * Connects to the Control Plane's builder endpoint which proxies to the
5
+ * Data Plane's meta-agent for AI-assisted agent creation.
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
+ * ALL HTTP goes through rawClient - no direct fetch calls.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const client = new AgentOsClient({ ... })
15
+ *
16
+ * // SSE streaming chat
17
+ * for await (const event of client.builder.chat(agentId, {
18
+ * message: "Adicione um nó de pesquisa web",
19
+ * current_graph_spec: { nodes: [...], edges: [...] }
20
+ * })) {
21
+ * if (event.type === 'message') console.log(event.data.text)
22
+ * if (event.type === 'graph_update') applyAction(event.data)
23
+ * }
24
+ *
25
+ * // Sync chat (no streaming)
26
+ * const result = await client.builder.chatSync(agentId, { message: "Mude as instruções" })
27
+ * ```
28
+ */
29
+ import type { RawClient } from "../client/raw.js";
30
+ import type { SSEOptions } from "../sse/client.js";
31
+ export type CatalogVersions = {
32
+ nodes: string;
33
+ tools: string;
34
+ triggers: string;
35
+ };
36
+ export type ChatHistoryMessage = {
37
+ role: 'user' | 'assistant';
38
+ content: string;
39
+ };
40
+ /**
41
+ * Builder chat request.
42
+ *
43
+ * KERNEL-FIRST: Frontend sends INTENTION only.
44
+ * - Graph spec is loaded from artifact storage by CP
45
+ * - Catalogs are loaded from DB by CP
46
+ * - Frontend should NOT send graph_spec or catalogs
47
+ */
48
+ export type BuilderChatRequest = {
49
+ /** Chat message/intention */
50
+ message: string;
51
+ /** Thread ID for conversation continuity */
52
+ thread_id?: string;
53
+ /** Chat history for context (optional, sent from frontend) */
54
+ history?: {
55
+ role: 'user' | 'assistant';
56
+ content: string;
57
+ }[];
58
+ /** Optional ETag for concurrency control */
59
+ base_graph_etag?: string;
60
+ };
61
+ export type HintTargetModel = {
62
+ node_id?: string;
63
+ edge_id?: string;
64
+ panel?: "credentials" | "triggers" | "logs" | "validation" | "deploy" | string;
65
+ action?: "create_credential" | "save_draft" | "publish_version" | string;
66
+ };
67
+ export type HintDataModel = {
68
+ credential_slug?: string;
69
+ reason?: string;
70
+ fields?: string[];
71
+ code?: string;
72
+ path?: string;
73
+ run_id?: string;
74
+ error_code?: string;
75
+ tokens_in?: number;
76
+ tokens_out?: number;
77
+ usd_estimate?: number;
78
+ action_id?: string;
79
+ params?: Record<string, any>;
80
+ };
81
+ export type HintModel = {
82
+ id?: string;
83
+ scope: "graph" | "thread" | "run" | string;
84
+ type: "highlight_node" | "needs_credential" | "missing_config" | "error_marker" | "warning_marker" | "toast" | "run_started" | "node_running" | "node_failed" | "rate_limited" | "cost_estimate" | "action_suggested" | string;
85
+ severity: "info" | "warn" | "error" | "success";
86
+ target?: HintTargetModel;
87
+ message?: string;
88
+ ttl_ms?: number;
89
+ data?: HintDataModel;
90
+ };
91
+ export type GraphUpdateAction = {
92
+ graph_spec: Record<string, unknown>;
93
+ hints?: HintModel[];
94
+ has_errors?: boolean;
95
+ };
96
+ export type BuilderStreamEvent = {
97
+ type: "message";
98
+ data: {
99
+ text: string;
100
+ };
101
+ } | {
102
+ type: "validation";
103
+ data: {
104
+ valid: boolean;
105
+ errors: any[];
106
+ };
107
+ } | {
108
+ type: "graph_update";
109
+ data: {
110
+ graph_spec: Record<string, unknown>;
111
+ hints: HintModel[];
112
+ has_errors?: boolean;
113
+ };
114
+ } | {
115
+ type: "done";
116
+ data: {
117
+ response: string;
118
+ thread_id: string;
119
+ };
120
+ } | {
121
+ type: "error";
122
+ data: {
123
+ error: string;
124
+ };
125
+ };
126
+ export type BuilderChatResponse = {
127
+ response: string;
128
+ graph_spec?: Record<string, unknown>;
129
+ valid: boolean;
130
+ errors: any[];
131
+ thread_id: string;
132
+ hints: HintModel[];
133
+ };
134
+ /** Supported patch operation types */
135
+ export type OpType = "add_node" | "remove_node" | "update_node" | "add_edge" | "remove_edge" | "set_entrypoint" | "rename_node";
136
+ /** A single graph modification operation */
137
+ export type PatchOp = {
138
+ op: OpType;
139
+ node_id?: string;
140
+ kind?: string;
141
+ label?: string;
142
+ data?: Record<string, unknown>;
143
+ set?: Record<string, unknown>;
144
+ from?: string;
145
+ to?: string;
146
+ entrypoint?: string;
147
+ };
148
+ /** A collection of patch operations with deterministic ID */
149
+ export type GraphPatch = {
150
+ patch_id: string;
151
+ ops: PatchOp[];
152
+ description?: string;
153
+ };
154
+ /** Validation error from applying patch */
155
+ export type PatchValidationError = {
156
+ code: string;
157
+ message: string;
158
+ node_id?: string;
159
+ path?: string;
160
+ };
161
+ /** Meta-chat request */
162
+ export type MetaChatRequest = {
163
+ instruction: string;
164
+ };
165
+ /** Meta-chat stream events */
166
+ export type MetaChatStreamEvent = {
167
+ type: "assistant.delta";
168
+ data: {
169
+ text: string;
170
+ };
171
+ } | {
172
+ type: "patch.validation";
173
+ data: {
174
+ valid: boolean;
175
+ errors: PatchValidationError[];
176
+ };
177
+ } | {
178
+ type: "patch.proposed";
179
+ data: GraphPatch;
180
+ } | {
181
+ type: "final";
182
+ data: {
183
+ ok: boolean;
184
+ patch_id: string;
185
+ };
186
+ } | {
187
+ type: "error";
188
+ data: {
189
+ error: string;
190
+ };
191
+ };
192
+ /** Meta-chat sync response */
193
+ export type MetaChatResponse = {
194
+ patch: GraphPatch | null;
195
+ applied_spec: Record<string, unknown> | null;
196
+ valid: boolean;
197
+ errors: PatchValidationError[];
198
+ message: string;
199
+ };
200
+ export declare class BuilderModule {
201
+ private client;
202
+ constructor(client: RawClient);
203
+ /**
204
+ * Stream chat with meta-agent (SSE).
205
+ * Returns async generator of events.
206
+ *
207
+ * Uses rawClient.streamPost() - headers resolved asynchronously.
208
+ */
209
+ chat(agentId: string, request: BuilderChatRequest, options?: SSEOptions): AsyncGenerator<BuilderStreamEvent>;
210
+ /**
211
+ * Sync chat with meta-agent (no streaming).
212
+ *
213
+ * Uses rawClient.POST() - headers resolved asynchronously.
214
+ */
215
+ chatSync(agentId: string, request: BuilderChatRequest): Promise<BuilderChatResponse>;
216
+ /**
217
+ * Convenience method: chat and collect all events.
218
+ */
219
+ chatCollect(agentId: string, request: BuilderChatRequest): Promise<BuilderChatResponse>;
220
+ /**
221
+ * Stream meta-chat with patch-ops architecture (SSE).
222
+ * Returns GraphPatch proposals instead of full graph specs.
223
+ *
224
+ * @example
225
+ * ```ts
226
+ * for await (const event of client.builder.metaChat(agentId, {
227
+ * instruction: "Add a log node after the main agent"
228
+ * })) {
229
+ * if (event.type === 'patch.proposed') {
230
+ * const patch = event.data;
231
+ * console.log(`Proposed ${patch.ops.length} operations`);
232
+ * }
233
+ * }
234
+ * ```
235
+ */
236
+ metaChat(agentId: string, request: MetaChatRequest, options?: SSEOptions): AsyncGenerator<MetaChatStreamEvent>;
237
+ /**
238
+ * Meta-chat and collect the proposed patch.
239
+ */
240
+ metaChatCollect(agentId: string, request: MetaChatRequest): Promise<MetaChatResponse>;
241
+ }
242
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/modules/builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OA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C3B,OAAO,CAAC,EAAE,UAAU,GACrB,cAAc,CAAC,kBAAkB,CAAC;IAyDrC;;;;OAIG;IACG,QAAQ,CACV,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,mBAAmB,CAAC;IAgB/B;;OAEG;IACG,WAAW,CACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,mBAAmB,CAAC;IA0C/B;;;;;;;;;;;;;;;OAeG;IACI,QAAQ,CACX,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE,UAAU,GACrB,cAAc,CAAC,mBAAmB,CAAC;IAwDtC;;OAEG;IACG,eAAe,CACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,GACzB,OAAO,CAAC,gBAAgB,CAAC;CAyB/B"}
@@ -0,0 +1,248 @@
1
+ /**
2
+ * Builder Module - Meta-Agent for Agent Building
3
+ *
4
+ * Connects to the Control Plane's builder endpoint which proxies to the
5
+ * Data Plane's meta-agent for AI-assisted agent creation.
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
+ * ALL HTTP goes through rawClient - no direct fetch calls.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const client = new AgentOsClient({ ... })
15
+ *
16
+ * // SSE streaming chat
17
+ * for await (const event of client.builder.chat(agentId, {
18
+ * message: "Adicione um nó de pesquisa web",
19
+ * current_graph_spec: { nodes: [...], edges: [...] }
20
+ * })) {
21
+ * if (event.type === 'message') console.log(event.data.text)
22
+ * if (event.type === 'graph_update') applyAction(event.data)
23
+ * }
24
+ *
25
+ * // Sync chat (no streaming)
26
+ * const result = await client.builder.chatSync(agentId, { message: "Mude as instruções" })
27
+ * ```
28
+ */
29
+ export class BuilderModule {
30
+ client;
31
+ constructor(client) {
32
+ this.client = client;
33
+ }
34
+ /**
35
+ * Stream chat with meta-agent (SSE).
36
+ * Returns async generator of events.
37
+ *
38
+ * Uses rawClient.streamPost() - headers resolved asynchronously.
39
+ */
40
+ async *chat(agentId, request, options) {
41
+ // Use rawClient.streamPost() - ALL auth headers resolved automatically
42
+ const response = await this.client.streamPost("/v1/api/builder/{agentId}/chat", {
43
+ params: { path: { agentId } },
44
+ body: request,
45
+ signal: options?.signal,
46
+ });
47
+ if (!response.ok) {
48
+ const errorText = await response.text();
49
+ throw new Error(`Builder chat failed: ${response.status} - ${errorText}`);
50
+ }
51
+ if (!response.body) {
52
+ throw new Error("No response body");
53
+ }
54
+ options?.onOpen?.();
55
+ const reader = response.body.getReader();
56
+ const decoder = new TextDecoder();
57
+ let buffer = "";
58
+ try {
59
+ while (true) {
60
+ const { done, value } = await reader.read();
61
+ if (done)
62
+ break;
63
+ buffer += decoder.decode(value, { stream: true });
64
+ const lines = buffer.split("\n");
65
+ buffer = lines.pop() ?? "";
66
+ let eventType = "message";
67
+ let eventData = "";
68
+ for (const line of lines) {
69
+ if (line.startsWith("event:")) {
70
+ eventType = line.slice(6).trim();
71
+ }
72
+ else if (line.startsWith("data:")) {
73
+ eventData = line.slice(5).trim();
74
+ }
75
+ else if (line === "" && eventData) {
76
+ try {
77
+ const parsed = JSON.parse(eventData);
78
+ yield { type: eventType, data: parsed };
79
+ }
80
+ catch {
81
+ // Skip invalid JSON
82
+ }
83
+ eventData = "";
84
+ eventType = "message";
85
+ }
86
+ }
87
+ }
88
+ }
89
+ finally {
90
+ reader.releaseLock();
91
+ }
92
+ }
93
+ /**
94
+ * Sync chat with meta-agent (no streaming).
95
+ *
96
+ * Uses rawClient.POST() - headers resolved asynchronously.
97
+ */
98
+ async chatSync(agentId, request) {
99
+ const { data, error } = await this.client.POST("/v1/api/builder/{agentId}/chat/sync", {
100
+ params: { path: { agentId } },
101
+ body: request,
102
+ });
103
+ if (error) {
104
+ throw new Error(`Builder chat failed: ${error.code} - ${error.message}`);
105
+ }
106
+ return data;
107
+ }
108
+ /**
109
+ * Convenience method: chat and collect all events.
110
+ */
111
+ async chatCollect(agentId, request) {
112
+ let fullResponse = "";
113
+ let lastGraphSpec;
114
+ let allHints = [];
115
+ const allErrors = [];
116
+ let threadId = request.thread_id ?? "";
117
+ let isValid = true;
118
+ for await (const event of this.chat(agentId, request)) {
119
+ if (event.type === "message") {
120
+ fullResponse += event.data.text;
121
+ }
122
+ else if (event.type === "graph_update") {
123
+ if ('graph_spec' in event.data) {
124
+ lastGraphSpec = event.data.graph_spec;
125
+ if (event.data.hints) {
126
+ allHints.push(...event.data.hints);
127
+ }
128
+ }
129
+ }
130
+ else if (event.type === "validation") {
131
+ isValid = event.data.valid;
132
+ if (event.data.errors) {
133
+ allErrors.push(...event.data.errors);
134
+ }
135
+ }
136
+ else if (event.type === "done") {
137
+ threadId = event.data.thread_id;
138
+ }
139
+ }
140
+ return {
141
+ response: fullResponse,
142
+ graph_spec: lastGraphSpec,
143
+ hints: allHints,
144
+ valid: isValid,
145
+ errors: allErrors,
146
+ thread_id: threadId,
147
+ };
148
+ }
149
+ // ============================================
150
+ // META-CHAT V2 (PATCH-OPS ARCHITECTURE)
151
+ // ============================================
152
+ /**
153
+ * Stream meta-chat with patch-ops architecture (SSE).
154
+ * Returns GraphPatch proposals instead of full graph specs.
155
+ *
156
+ * @example
157
+ * ```ts
158
+ * for await (const event of client.builder.metaChat(agentId, {
159
+ * instruction: "Add a log node after the main agent"
160
+ * })) {
161
+ * if (event.type === 'patch.proposed') {
162
+ * const patch = event.data;
163
+ * console.log(`Proposed ${patch.ops.length} operations`);
164
+ * }
165
+ * }
166
+ * ```
167
+ */
168
+ async *metaChat(agentId, request, options) {
169
+ const response = await this.client.streamPost("/v1/builder/{agentId}/meta-chat", {
170
+ params: { path: { agentId } },
171
+ body: request,
172
+ signal: options?.signal,
173
+ });
174
+ if (!response.ok) {
175
+ const errorText = await response.text();
176
+ throw new Error(`Meta-chat failed: ${response.status} - ${errorText}`);
177
+ }
178
+ if (!response.body) {
179
+ throw new Error("No response body");
180
+ }
181
+ options?.onOpen?.();
182
+ const reader = response.body.getReader();
183
+ const decoder = new TextDecoder();
184
+ let buffer = "";
185
+ try {
186
+ while (true) {
187
+ const { done, value } = await reader.read();
188
+ if (done)
189
+ break;
190
+ buffer += decoder.decode(value, { stream: true });
191
+ const lines = buffer.split("\n");
192
+ buffer = lines.pop() ?? "";
193
+ let eventType = "message";
194
+ let eventData = "";
195
+ for (const line of lines) {
196
+ if (line.startsWith("event:")) {
197
+ eventType = line.slice(6).trim();
198
+ }
199
+ else if (line.startsWith("data:")) {
200
+ eventData = line.slice(5).trim();
201
+ }
202
+ else if (line === "" && eventData) {
203
+ try {
204
+ const parsed = JSON.parse(eventData);
205
+ yield { type: eventType, data: parsed };
206
+ }
207
+ catch {
208
+ // Skip invalid JSON
209
+ }
210
+ eventData = "";
211
+ eventType = "message";
212
+ }
213
+ }
214
+ }
215
+ }
216
+ finally {
217
+ reader.releaseLock();
218
+ }
219
+ }
220
+ /**
221
+ * Meta-chat and collect the proposed patch.
222
+ */
223
+ async metaChatCollect(agentId, request) {
224
+ let patch = null;
225
+ let isValid = true;
226
+ const errors = [];
227
+ let message = "";
228
+ for await (const event of this.metaChat(agentId, request)) {
229
+ if (event.type === "assistant.delta") {
230
+ message += event.data.text;
231
+ }
232
+ else if (event.type === "patch.proposed") {
233
+ patch = event.data;
234
+ }
235
+ else if (event.type === "patch.validation") {
236
+ isValid = event.data.valid;
237
+ errors.push(...event.data.errors);
238
+ }
239
+ }
240
+ return {
241
+ patch,
242
+ applied_spec: null, // Frontend should apply patch locally
243
+ valid: isValid,
244
+ errors,
245
+ message,
246
+ };
247
+ }
248
+ }
@@ -12,7 +12,7 @@ export interface Credential {
12
12
  credential_type_ref?: string;
13
13
  workspace_id?: string;
14
14
  tenant_id: string;
15
- sharing_mode: "private" | "shared";
15
+ sharing_mode: "workspace_all" | "explicit";
16
16
  status: "active" | "disabled" | "expired";
17
17
  created_at: string;
18
18
  updated_at: string;
@@ -73,7 +73,7 @@ export declare class CredentialsModule {
73
73
  workspace_id?: string;
74
74
  values?: Record<string, unknown>;
75
75
  data?: Record<string, unknown>;
76
- sharing_mode?: "private" | "shared";
76
+ sharing_mode?: "workspace_all" | "explicit";
77
77
  }): Promise<APIResponse<Credential>>;
78
78
  /**
79
79
  * Update a credential.
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/modules/credentials.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAc,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAK3E,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,SAAS,GAAG,QAAQ,CAAC;IACnC,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,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AE,IAAI,EAAE;QACrC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAQpC;;OAEG;IACG,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAO9D;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAqDhE;;OAEG;IACG,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;IAOtF;;OAEG;IACG,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;CAMzE"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Graphs Module - V2 Graph Specification Management
3
+ *
4
+ * Pure V2 contract - no legacy. All types namespaced with "Graphs" prefix.
5
+ */
6
+ import type { RawClient, APIResponse } from "../client/raw.js";
7
+ export interface GraphsValidationMessage {
8
+ code: string;
9
+ message: string;
10
+ path?: string;
11
+ node_id?: string;
12
+ severity?: "error" | "warning";
13
+ }
14
+ export interface GraphsValidationResult {
15
+ valid: boolean;
16
+ errors?: GraphsValidationMessage[];
17
+ }
18
+ export interface GraphsGetResponse {
19
+ agent_id: string;
20
+ revision: string;
21
+ canonical_spec: unknown;
22
+ committed_at: string;
23
+ warnings?: GraphsValidationMessage[];
24
+ validation?: GraphsValidationResult;
25
+ }
26
+ export interface GraphsCommitRequest {
27
+ agent_id: string;
28
+ graph_spec: unknown;
29
+ expected_revision?: string;
30
+ source?: string;
31
+ }
32
+ export type GraphsCommitStatus = "committed" | "no_change";
33
+ export interface GraphsCommitResponse {
34
+ status: GraphsCommitStatus;
35
+ agent_id: string;
36
+ revision: string;
37
+ canonical_spec: unknown;
38
+ committed_at: string;
39
+ warnings?: GraphsValidationMessage[];
40
+ validation?: GraphsValidationResult;
41
+ }
42
+ export interface GraphsConflictPayload {
43
+ hint: "reload_and_retry";
44
+ expected_revision: string;
45
+ current: GraphsGetResponse;
46
+ }
47
+ export interface GraphsRevisionSummary {
48
+ revision: string;
49
+ created_at: string;
50
+ source?: string;
51
+ }
52
+ export interface GraphsRevisionsListResponse {
53
+ agent_id: string;
54
+ revisions: GraphsRevisionSummary[];
55
+ }
56
+ export interface GraphsRevisionResponse {
57
+ revision: string;
58
+ canonical_spec: unknown;
59
+ created_at: string;
60
+ source?: string;
61
+ warnings?: GraphsValidationMessage[];
62
+ validation?: GraphsValidationResult;
63
+ }
64
+ export interface GraphsValidateRequest {
65
+ graph_spec: unknown;
66
+ normalize?: boolean;
67
+ catalog_versions?: Record<string, string>;
68
+ }
69
+ export interface GraphsValidateResponse {
70
+ valid: boolean;
71
+ canonical_spec_json?: string;
72
+ mermaid?: string;
73
+ nodes?: string[];
74
+ edges?: [string, string][];
75
+ errors?: GraphsValidationMessage[];
76
+ warnings?: GraphsValidationMessage[];
77
+ }
78
+ export interface GraphsIntrospectRequest {
79
+ agent_id?: string;
80
+ graph_spec?: unknown;
81
+ catalog_versions?: Record<string, string>;
82
+ }
83
+ export interface GraphsIntrospectResponse {
84
+ mermaid: string;
85
+ nodes: string[];
86
+ edges: [string, string][];
87
+ type?: string;
88
+ }
89
+ export declare class GraphsModule {
90
+ private client;
91
+ private headers;
92
+ constructor(client: RawClient, headers: () => Record<string, string>);
93
+ /**
94
+ * Get current graph spec by revision.
95
+ * @returns 200 with graph spec, or 404 if not initialized
96
+ */
97
+ get(agentId: string): Promise<APIResponse<GraphsGetResponse>>;
98
+ /**
99
+ * Commit graph spec atomically.
100
+ * @returns 200 (committed/no_change), or 409 on conflict
101
+ */
102
+ commit(request: GraphsCommitRequest): Promise<APIResponse<GraphsCommitResponse>>;
103
+ /**
104
+ * List revision history for an agent.
105
+ */
106
+ listRevisions(agentId: string): Promise<APIResponse<GraphsRevisionsListResponse>>;
107
+ /**
108
+ * Get a specific revision.
109
+ */
110
+ getRevision(agentId: string, revision: string): Promise<APIResponse<GraphsRevisionResponse>>;
111
+ /**
112
+ * Validate a graph specification.
113
+ */
114
+ validate(body: GraphsValidateRequest): Promise<APIResponse<GraphsValidateResponse>>;
115
+ /**
116
+ * Introspect a graph structure.
117
+ */
118
+ introspect(body: GraphsIntrospectRequest): Promise<APIResponse<GraphsIntrospectResponse>>;
119
+ }
120
+ //# sourceMappingURL=graphs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphs.d.ts","sourceRoot":"","sources":["../../src/modules/graphs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI/D,MAAM,WAAW,uBAAuB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACtC;AAID,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACrC,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACvC;AAID,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,OAAO,CAA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