@agent-os-sdk/client 0.5.0 → 0.5.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.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/modules/agents.d.ts +0 -21
- package/dist/modules/agents.d.ts.map +1 -1
- package/dist/modules/agents.js +1 -37
- package/dist/modules/graphs.d.ts +103 -48
- package/dist/modules/graphs.d.ts.map +1 -1
- package/dist/modules/graphs.js +42 -4
- package/package.json +2 -2
- package/src/index.ts +15 -1
- package/src/modules/agents.ts +1 -57
- package/src/modules/graphs.ts +161 -37
package/dist/index.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export { CronsModule, type CronJob, type CronJobListResponse } from "./modules/c
|
|
|
64
64
|
export { DlqModule, type DlqListResponse, type DlqMessage } from "./modules/dlq.js";
|
|
65
65
|
export { EvaluationModule, type EvalDataset, type ExampleData, type Experiment } from "./modules/evaluation.js";
|
|
66
66
|
export { FilesModule, type FileListResponse, type PresignedUpload, type StoredFile } from "./modules/files.js";
|
|
67
|
-
export { GraphsModule, type
|
|
67
|
+
export { GraphsModule, type GraphsGetResponse, type GraphsCommitRequest, type GraphsCommitResponse, type GraphsConflictPayload, type GraphsRevisionsListResponse, type GraphsRevisionResponse, type GraphsValidateRequest, type GraphsValidateResponse, type GraphsIntrospectRequest, type GraphsIntrospectResponse, type GraphsValidationMessage, type GraphsValidationResult } from "./modules/graphs.js";
|
|
68
68
|
export { InfoModule, type ServerCapabilities, type ServerInfo } from "./modules/info.js";
|
|
69
69
|
export { McpModule, type McpServer } from "./modules/mcp.js";
|
|
70
70
|
export { MeModule, type MeResponse } from "./modules/me.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AA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GvI,OAAO,EAAE,eAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAE5K,OAAO,EAAE,eAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAChJ,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAKpH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,IAAI,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKjK,YAAY,EACR,iBAAiB,EAAE,WAAW,EAE9B,KAAK,IAAI,WAAW,EAAE,gBAAgB,EACtC,iBAAiB,EAEjB,gBAAgB,EAChB,sBAAsB,EAAE,kBAAkB,EAE1C,uBAAuB,EAEvB,oBAAoB,EAEpB,oBAAoB,EACpB,uBAAuB,EAEvB,4BAA4B,EAE5B,mBAAmB,EACnB,0BAA0B,EAE1B,mBAAmB,EAAE,uBAAuB,EAE5C,cAAc,EAAE,aAAa,EAAE,iBAAiB,EAEhD,WAAW,EAEX,aAAa,EACb,mBAAmB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,kBAAkB,EAC/H,mBAAmB,EAEnB,mBAAmB,EAAE,eAAe,EACvC,MAAM,iBAAiB,CAAC"}
|
package/dist/modules/agents.d.ts
CHANGED
|
@@ -26,11 +26,6 @@ export interface ImportAgentResponse {
|
|
|
26
26
|
message: string;
|
|
27
27
|
versions_imported: number;
|
|
28
28
|
}
|
|
29
|
-
export interface ImportAgentResponse {
|
|
30
|
-
agent_id: string;
|
|
31
|
-
message: string;
|
|
32
|
-
versions_imported: number;
|
|
33
|
-
}
|
|
34
29
|
export interface AgentGraphResponse {
|
|
35
30
|
mermaid?: string;
|
|
36
31
|
json?: unknown;
|
|
@@ -41,8 +36,6 @@ export interface GraphValidationResponse {
|
|
|
41
36
|
warnings?: string[];
|
|
42
37
|
}
|
|
43
38
|
export type AgentListResponse = PaginatedResponse<Agent>;
|
|
44
|
-
export type AgentDraftResponse = components["schemas"]["AgentDraftResponse"];
|
|
45
|
-
export type UpdateDraftGraphRequest = components["schemas"]["UpdateDraftGraphRequest"];
|
|
46
39
|
export declare class AgentsModule {
|
|
47
40
|
private client;
|
|
48
41
|
private headers;
|
|
@@ -111,20 +104,6 @@ export declare class AgentsModule {
|
|
|
111
104
|
* Validate the graph configuration.
|
|
112
105
|
*/
|
|
113
106
|
validateGraph(agentId: string): Promise<APIResponse<GraphValidationResponse>>;
|
|
114
|
-
/**
|
|
115
|
-
* Get the draft graph for an agent (source of truth).
|
|
116
|
-
* Studio should use this instead of generating graphs locally.
|
|
117
|
-
* @param agentId The agent UUID
|
|
118
|
-
* @returns Draft response with graph_json and ETag for subsequent updates
|
|
119
|
-
*/
|
|
120
|
-
getDraftGraph(agentId: string): Promise<APIResponse<components["schemas"]["AgentDraftResponse"]>>;
|
|
121
|
-
/**
|
|
122
|
-
* Update the draft graph for an agent (autosave).
|
|
123
|
-
* @param agentId The agent UUID
|
|
124
|
-
* @param graph_json The graph specification
|
|
125
|
-
* @param expected_ticks The expected ticks for optimistic concurrency (from If-Match)
|
|
126
|
-
*/
|
|
127
|
-
updateDraftGraph(agentId: string, graph_json: Record<string, unknown>, expected_ticks: number | null): Promise<APIResponse<components["schemas"]["AgentDraftResponse"]>>;
|
|
128
107
|
/**
|
|
129
108
|
* Publish a new version (bundle) of the agent.
|
|
130
109
|
* @param agentId The agent UUID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/modules/agents.ts"],"names":[],"mappings":"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,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAQ/B;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IASzD;;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,mBAAmB,CAAC,CAAC;IAS5E;;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;;;;;;OAMG;IACG,OAAO,CACT,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,GACnE,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;CAYnE"}
|
package/dist/modules/agents.js
CHANGED
|
@@ -116,43 +116,7 @@ export class AgentsModule {
|
|
|
116
116
|
headers: this.headers(),
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
* Get the draft graph for an agent (source of truth).
|
|
121
|
-
* Studio should use this instead of generating graphs locally.
|
|
122
|
-
* @param agentId The agent UUID
|
|
123
|
-
* @returns Draft response with graph_json and ETag for subsequent updates
|
|
124
|
-
*/
|
|
125
|
-
async getDraftGraph(agentId) {
|
|
126
|
-
return this.client.GET("/v1/api/agents/{id}/draft/graph", {
|
|
127
|
-
params: { path: { id: agentId } },
|
|
128
|
-
headers: this.headers(),
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Update the draft graph for an agent (autosave).
|
|
133
|
-
* @param agentId The agent UUID
|
|
134
|
-
* @param graph_json The graph specification
|
|
135
|
-
* @param expected_ticks The expected ticks for optimistic concurrency (from If-Match)
|
|
136
|
-
*/
|
|
137
|
-
async updateDraftGraph(agentId, graph_json, expected_ticks) {
|
|
138
|
-
// Construct If-Match header
|
|
139
|
-
// If expected_ticks is null, we don't send header (or send something else? Logic says If-Match required if strictly following docs)
|
|
140
|
-
// But docs say: "Requires If-Match header with ETag from previous GET/PUT".
|
|
141
|
-
// If client passes 0, we send "agentId:0".
|
|
142
|
-
// If client passes null, maybe it's a force overwrite or initial save? UseCase handles logic.
|
|
143
|
-
// We will strictly set If-Match if expected_ticks is number.
|
|
144
|
-
const headers = this.headers();
|
|
145
|
-
if (expected_ticks !== null && expected_ticks !== undefined) {
|
|
146
|
-
headers["If-Match"] = `"${agentId}:${expected_ticks}"`;
|
|
147
|
-
}
|
|
148
|
-
return this.client.PUT("/v1/api/agents/{id}/draft/graph", {
|
|
149
|
-
params: { path: { id: agentId } },
|
|
150
|
-
body: {
|
|
151
|
-
graph_json
|
|
152
|
-
},
|
|
153
|
-
headers
|
|
154
|
-
});
|
|
155
|
-
}
|
|
119
|
+
// ======================== Publishing ========================
|
|
156
120
|
/**
|
|
157
121
|
* Publish a new version (bundle) of the agent.
|
|
158
122
|
* @param agentId The agent UUID
|
package/dist/modules/graphs.d.ts
CHANGED
|
@@ -1,65 +1,120 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Graphs Module -
|
|
2
|
+
* Graphs Module - V2 Graph Specification Management
|
|
3
|
+
*
|
|
4
|
+
* Pure V2 contract - no legacy. All types namespaced with "Graphs" prefix.
|
|
3
5
|
*/
|
|
4
6
|
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
5
|
-
export interface
|
|
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
|
+
proposed_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 {
|
|
6
70
|
valid: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
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>;
|
|
9
82
|
}
|
|
10
|
-
export interface
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}>;
|
|
16
|
-
edges: Array<{
|
|
17
|
-
from: string;
|
|
18
|
-
to: string;
|
|
19
|
-
}>;
|
|
20
|
-
entrypoints?: string[];
|
|
83
|
+
export interface GraphsIntrospectResponse {
|
|
84
|
+
mermaid: string;
|
|
85
|
+
nodes: string[];
|
|
86
|
+
edges: [string, string][];
|
|
87
|
+
graph_type?: string;
|
|
21
88
|
}
|
|
22
89
|
export declare class GraphsModule {
|
|
23
90
|
private client;
|
|
24
91
|
private headers;
|
|
25
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>>;
|
|
26
111
|
/**
|
|
27
112
|
* Validate a graph specification.
|
|
28
|
-
* Uses canonical GraphValidator for deep validation.
|
|
29
113
|
*/
|
|
30
|
-
validate(body:
|
|
31
|
-
graph_spec: {
|
|
32
|
-
type: string;
|
|
33
|
-
nodes: Array<{
|
|
34
|
-
id: string;
|
|
35
|
-
type: string;
|
|
36
|
-
label?: string;
|
|
37
|
-
}>;
|
|
38
|
-
edges: Array<{
|
|
39
|
-
from: string;
|
|
40
|
-
to: string;
|
|
41
|
-
}>;
|
|
42
|
-
};
|
|
43
|
-
/** Catalog versions for referential integrity checks */
|
|
44
|
-
catalog_versions?: {
|
|
45
|
-
nodes: string;
|
|
46
|
-
tools: string;
|
|
47
|
-
triggers: string;
|
|
48
|
-
};
|
|
49
|
-
}): Promise<APIResponse<GraphValidationResult>>;
|
|
114
|
+
validate(body: GraphsValidateRequest): Promise<APIResponse<GraphsValidateResponse>>;
|
|
50
115
|
/**
|
|
51
|
-
* Introspect a graph
|
|
52
|
-
* Uses canonical GraphValidator with world-fixed context.
|
|
116
|
+
* Introspect a graph structure.
|
|
53
117
|
*/
|
|
54
|
-
introspect(body:
|
|
55
|
-
agent_id?: string;
|
|
56
|
-
graph_spec?: Record<string, unknown>;
|
|
57
|
-
/** Catalog versions for deterministic introspection */
|
|
58
|
-
catalog_versions?: {
|
|
59
|
-
nodes: string;
|
|
60
|
-
tools: string;
|
|
61
|
-
triggers: string;
|
|
62
|
-
};
|
|
63
|
-
}): Promise<APIResponse<GraphIntrospectionResult>>;
|
|
118
|
+
introspect(body: GraphsIntrospectRequest): Promise<APIResponse<GraphsIntrospectResponse>>;
|
|
64
119
|
}
|
|
65
120
|
//# sourceMappingURL=graphs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphs.d.ts","sourceRoot":"","sources":["../../src/modules/graphs.ts"],"names":[],"mappings":"AAAA
|
|
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,aAAa,EAAE,OAAO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CAAC,CAAC;IAQlG;;OAEG;IACG,QAAQ,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAOzF;;OAEG;IACG,UAAU,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;CAMlG"}
|
package/dist/modules/graphs.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Graphs Module -
|
|
2
|
+
* Graphs Module - V2 Graph Specification Management
|
|
3
|
+
*
|
|
4
|
+
* Pure V2 contract - no legacy. All types namespaced with "Graphs" prefix.
|
|
3
5
|
*/
|
|
6
|
+
// ============ Module ============
|
|
4
7
|
export class GraphsModule {
|
|
5
8
|
client;
|
|
6
9
|
headers;
|
|
@@ -8,9 +11,45 @@ export class GraphsModule {
|
|
|
8
11
|
this.client = client;
|
|
9
12
|
this.headers = headers;
|
|
10
13
|
}
|
|
14
|
+
// ============ V2 Graph Spec (CP) ============
|
|
15
|
+
/**
|
|
16
|
+
* Get current graph spec by revision.
|
|
17
|
+
* @returns 200 with graph spec, or 404 if not initialized
|
|
18
|
+
*/
|
|
19
|
+
async get(agentId) {
|
|
20
|
+
return this.client.GET(`/v2/api/graph/${agentId}`, {
|
|
21
|
+
headers: this.headers(),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Commit graph spec atomically.
|
|
26
|
+
* @returns 200 (committed/no_change), or 409 on conflict
|
|
27
|
+
*/
|
|
28
|
+
async commit(request) {
|
|
29
|
+
return this.client.POST("/v2/api/graph/commit", {
|
|
30
|
+
body: request,
|
|
31
|
+
headers: this.headers(),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* List revision history for an agent.
|
|
36
|
+
*/
|
|
37
|
+
async listRevisions(agentId) {
|
|
38
|
+
return this.client.GET(`/v2/api/graph/${agentId}/revisions`, {
|
|
39
|
+
headers: this.headers(),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get a specific revision.
|
|
44
|
+
*/
|
|
45
|
+
async getRevision(agentId, revision) {
|
|
46
|
+
return this.client.GET(`/v2/api/graph/${agentId}/revisions/${revision}`, {
|
|
47
|
+
headers: this.headers(),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// ============ Validation (DP proxy) ============
|
|
11
51
|
/**
|
|
12
52
|
* Validate a graph specification.
|
|
13
|
-
* Uses canonical GraphValidator for deep validation.
|
|
14
53
|
*/
|
|
15
54
|
async validate(body) {
|
|
16
55
|
return this.client.POST("/v1/api/graphs/validate", {
|
|
@@ -19,8 +58,7 @@ export class GraphsModule {
|
|
|
19
58
|
});
|
|
20
59
|
}
|
|
21
60
|
/**
|
|
22
|
-
* Introspect a graph
|
|
23
|
-
* Uses canonical GraphValidator with world-fixed context.
|
|
61
|
+
* Introspect a graph structure.
|
|
24
62
|
*/
|
|
25
63
|
async introspect(body) {
|
|
26
64
|
return this.client.POST("/v1/api/graphs/introspect", {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -135,7 +135,21 @@ export { CronsModule, type CronJob, type CronJobListResponse } from "./modules/c
|
|
|
135
135
|
export { DlqModule, type DlqListResponse, type DlqMessage } from "./modules/dlq.js";
|
|
136
136
|
export { EvaluationModule, type EvalDataset, type ExampleData, type Experiment } from "./modules/evaluation.js";
|
|
137
137
|
export { FilesModule, type FileListResponse, type PresignedUpload, type StoredFile } from "./modules/files.js";
|
|
138
|
-
export {
|
|
138
|
+
export {
|
|
139
|
+
GraphsModule,
|
|
140
|
+
type GraphsGetResponse,
|
|
141
|
+
type GraphsCommitRequest,
|
|
142
|
+
type GraphsCommitResponse,
|
|
143
|
+
type GraphsConflictPayload,
|
|
144
|
+
type GraphsRevisionsListResponse,
|
|
145
|
+
type GraphsRevisionResponse,
|
|
146
|
+
type GraphsValidateRequest,
|
|
147
|
+
type GraphsValidateResponse,
|
|
148
|
+
type GraphsIntrospectRequest,
|
|
149
|
+
type GraphsIntrospectResponse,
|
|
150
|
+
type GraphsValidationMessage,
|
|
151
|
+
type GraphsValidationResult
|
|
152
|
+
} from "./modules/graphs.js";
|
|
139
153
|
export { InfoModule, type ServerCapabilities, type ServerInfo } from "./modules/info.js";
|
|
140
154
|
export { McpModule, type McpServer } from "./modules/mcp.js";
|
|
141
155
|
export { MeModule, type MeResponse } from "./modules/me.js";
|
package/src/modules/agents.ts
CHANGED
|
@@ -28,8 +28,6 @@ export interface Agent {
|
|
|
28
28
|
live_bundle_id?: string | null;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
31
|
export interface AgentBundle extends AgentBundleSchema { }
|
|
34
32
|
|
|
35
33
|
export interface ImportAgentResponse {
|
|
@@ -38,13 +36,6 @@ export interface ImportAgentResponse {
|
|
|
38
36
|
versions_imported: number;
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
export interface ImportAgentResponse {
|
|
42
|
-
agent_id: string;
|
|
43
|
-
message: string;
|
|
44
|
-
versions_imported: number;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
39
|
export interface AgentGraphResponse {
|
|
49
40
|
mermaid?: string;
|
|
50
41
|
json?: unknown;
|
|
@@ -58,10 +49,6 @@ export interface GraphValidationResponse {
|
|
|
58
49
|
|
|
59
50
|
export type AgentListResponse = PaginatedResponse<Agent>;
|
|
60
51
|
|
|
61
|
-
// Draft types
|
|
62
|
-
export type AgentDraftResponse = components["schemas"]["AgentDraftResponse"];
|
|
63
|
-
export type UpdateDraftGraphRequest = components["schemas"]["UpdateDraftGraphRequest"];
|
|
64
|
-
|
|
65
52
|
export class AgentsModule {
|
|
66
53
|
constructor(private client: RawClient, private headers: () => Record<string, string>) { }
|
|
67
54
|
|
|
@@ -191,50 +178,7 @@ export class AgentsModule {
|
|
|
191
178
|
});
|
|
192
179
|
}
|
|
193
180
|
|
|
194
|
-
|
|
195
|
-
* Get the draft graph for an agent (source of truth).
|
|
196
|
-
* Studio should use this instead of generating graphs locally.
|
|
197
|
-
* @param agentId The agent UUID
|
|
198
|
-
* @returns Draft response with graph_json and ETag for subsequent updates
|
|
199
|
-
*/
|
|
200
|
-
async getDraftGraph(agentId: string): Promise<APIResponse<components["schemas"]["AgentDraftResponse"]>> {
|
|
201
|
-
return this.client.GET<components["schemas"]["AgentDraftResponse"]>("/v1/api/agents/{id}/draft/graph", {
|
|
202
|
-
params: { path: { id: agentId } },
|
|
203
|
-
headers: this.headers(),
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Update the draft graph for an agent (autosave).
|
|
209
|
-
* @param agentId The agent UUID
|
|
210
|
-
* @param graph_json The graph specification
|
|
211
|
-
* @param expected_ticks The expected ticks for optimistic concurrency (from If-Match)
|
|
212
|
-
*/
|
|
213
|
-
async updateDraftGraph(
|
|
214
|
-
agentId: string,
|
|
215
|
-
graph_json: Record<string, unknown>,
|
|
216
|
-
expected_ticks: number | null
|
|
217
|
-
): Promise<APIResponse<components["schemas"]["AgentDraftResponse"]>> {
|
|
218
|
-
// Construct If-Match header
|
|
219
|
-
// If expected_ticks is null, we don't send header (or send something else? Logic says If-Match required if strictly following docs)
|
|
220
|
-
// But docs say: "Requires If-Match header with ETag from previous GET/PUT".
|
|
221
|
-
// If client passes 0, we send "agentId:0".
|
|
222
|
-
// If client passes null, maybe it's a force overwrite or initial save? UseCase handles logic.
|
|
223
|
-
// We will strictly set If-Match if expected_ticks is number.
|
|
224
|
-
|
|
225
|
-
const headers = this.headers();
|
|
226
|
-
if (expected_ticks !== null && expected_ticks !== undefined) {
|
|
227
|
-
headers["If-Match"] = `"${agentId}:${expected_ticks}"`;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
return this.client.PUT<components["schemas"]["AgentDraftResponse"]>("/v1/api/agents/{id}/draft/graph", {
|
|
231
|
-
params: { path: { id: agentId } },
|
|
232
|
-
body: {
|
|
233
|
-
graph_json
|
|
234
|
-
} as components["schemas"]["UpdateDraftGraphRequest"],
|
|
235
|
-
headers
|
|
236
|
-
});
|
|
237
|
-
}
|
|
181
|
+
// ======================== Publishing ========================
|
|
238
182
|
|
|
239
183
|
/**
|
|
240
184
|
* Publish a new version (bundle) of the agent.
|
package/src/modules/graphs.ts
CHANGED
|
@@ -1,62 +1,186 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Graphs Module -
|
|
2
|
+
* Graphs Module - V2 Graph Specification Management
|
|
3
|
+
*
|
|
4
|
+
* Pure V2 contract - no legacy. All types namespaced with "Graphs" prefix.
|
|
3
5
|
*/
|
|
4
6
|
|
|
5
|
-
import type { RawClient, APIResponse
|
|
7
|
+
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
// ============ Shared Types ============
|
|
10
|
+
|
|
11
|
+
export interface GraphsValidationMessage {
|
|
12
|
+
code: string;
|
|
13
|
+
message: string;
|
|
14
|
+
path?: string;
|
|
15
|
+
node_id?: string;
|
|
16
|
+
severity?: "error" | "warning";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface GraphsValidationResult {
|
|
8
20
|
valid: boolean;
|
|
9
|
-
errors?:
|
|
10
|
-
|
|
21
|
+
errors?: GraphsValidationMessage[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// ============ GET /v2/api/graph/{agentId} ============
|
|
25
|
+
|
|
26
|
+
export interface GraphsGetResponse {
|
|
27
|
+
agent_id: string;
|
|
28
|
+
revision: string;
|
|
29
|
+
canonical_spec: unknown;
|
|
30
|
+
committed_at: string;
|
|
31
|
+
warnings?: GraphsValidationMessage[];
|
|
32
|
+
validation?: GraphsValidationResult;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ============ POST /v2/api/graph/commit ============
|
|
36
|
+
|
|
37
|
+
export interface GraphsCommitRequest {
|
|
38
|
+
agent_id: string;
|
|
39
|
+
proposed_spec: unknown;
|
|
40
|
+
expected_revision?: string;
|
|
41
|
+
source?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type GraphsCommitStatus = "committed" | "no_change";
|
|
45
|
+
|
|
46
|
+
export interface GraphsCommitResponse {
|
|
47
|
+
status: GraphsCommitStatus;
|
|
48
|
+
agent_id: string;
|
|
49
|
+
revision: string;
|
|
50
|
+
canonical_spec: unknown;
|
|
51
|
+
committed_at: string;
|
|
52
|
+
warnings?: GraphsValidationMessage[];
|
|
53
|
+
validation?: GraphsValidationResult;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 409 Conflict body (ProblemDetails.Extensions)
|
|
57
|
+
// Envelope around GET response - agent_id lives in current.agent_id
|
|
58
|
+
export interface GraphsConflictPayload {
|
|
59
|
+
hint: "reload_and_retry";
|
|
60
|
+
expected_revision: string;
|
|
61
|
+
current: GraphsGetResponse;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ============ GET /v2/api/graph/{agentId}/revisions ============
|
|
65
|
+
|
|
66
|
+
export interface GraphsRevisionSummary {
|
|
67
|
+
revision: string;
|
|
68
|
+
created_at: string;
|
|
69
|
+
source?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface GraphsRevisionsListResponse {
|
|
73
|
+
agent_id: string;
|
|
74
|
+
revisions: GraphsRevisionSummary[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// ============ GET /v2/api/graph/{agentId}/revisions/{revision} ============
|
|
78
|
+
|
|
79
|
+
export interface GraphsRevisionResponse {
|
|
80
|
+
revision: string;
|
|
81
|
+
canonical_spec: unknown;
|
|
82
|
+
created_at: string;
|
|
83
|
+
source?: string;
|
|
84
|
+
warnings?: GraphsValidationMessage[];
|
|
85
|
+
validation?: GraphsValidationResult;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ============ Validation (DP) ============
|
|
89
|
+
|
|
90
|
+
export interface GraphsValidateRequest {
|
|
91
|
+
graph_spec: unknown;
|
|
92
|
+
normalize?: boolean;
|
|
93
|
+
catalog_versions?: Record<string, string>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface GraphsValidateResponse {
|
|
97
|
+
valid: boolean;
|
|
98
|
+
canonical_spec_json?: string;
|
|
99
|
+
mermaid?: string;
|
|
100
|
+
nodes?: string[];
|
|
101
|
+
edges?: [string, string][];
|
|
102
|
+
errors?: GraphsValidationMessage[];
|
|
103
|
+
warnings?: GraphsValidationMessage[];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ============ Introspection (DP) ============
|
|
107
|
+
|
|
108
|
+
export interface GraphsIntrospectRequest {
|
|
109
|
+
agent_id?: string;
|
|
110
|
+
graph_spec?: unknown;
|
|
111
|
+
catalog_versions?: Record<string, string>;
|
|
11
112
|
}
|
|
12
113
|
|
|
13
|
-
export interface
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
114
|
+
export interface GraphsIntrospectResponse {
|
|
115
|
+
mermaid: string;
|
|
116
|
+
nodes: string[];
|
|
117
|
+
edges: [string, string][];
|
|
118
|
+
graph_type?: string;
|
|
17
119
|
}
|
|
18
120
|
|
|
121
|
+
// ============ Module ============
|
|
122
|
+
|
|
19
123
|
export class GraphsModule {
|
|
20
124
|
constructor(private client: RawClient, private headers: () => Record<string, string>) { }
|
|
21
125
|
|
|
126
|
+
// ============ V2 Graph Spec (CP) ============
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get current graph spec by revision.
|
|
130
|
+
* @returns 200 with graph spec, or 404 if not initialized
|
|
131
|
+
*/
|
|
132
|
+
async get(agentId: string): Promise<APIResponse<GraphsGetResponse>> {
|
|
133
|
+
return this.client.GET<GraphsGetResponse>(`/v2/api/graph/${agentId}`, {
|
|
134
|
+
headers: this.headers(),
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Commit graph spec atomically.
|
|
140
|
+
* @returns 200 (committed/no_change), or 409 on conflict
|
|
141
|
+
*/
|
|
142
|
+
async commit(request: GraphsCommitRequest): Promise<APIResponse<GraphsCommitResponse>> {
|
|
143
|
+
return this.client.POST<GraphsCommitResponse>("/v2/api/graph/commit", {
|
|
144
|
+
body: request,
|
|
145
|
+
headers: this.headers(),
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* List revision history for an agent.
|
|
151
|
+
*/
|
|
152
|
+
async listRevisions(agentId: string): Promise<APIResponse<GraphsRevisionsListResponse>> {
|
|
153
|
+
return this.client.GET<GraphsRevisionsListResponse>(`/v2/api/graph/${agentId}/revisions`, {
|
|
154
|
+
headers: this.headers(),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Get a specific revision.
|
|
160
|
+
*/
|
|
161
|
+
async getRevision(agentId: string, revision: string): Promise<APIResponse<GraphsRevisionResponse>> {
|
|
162
|
+
return this.client.GET<GraphsRevisionResponse>(`/v2/api/graph/${agentId}/revisions/${revision}`, {
|
|
163
|
+
headers: this.headers(),
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// ============ Validation (DP proxy) ============
|
|
168
|
+
|
|
22
169
|
/**
|
|
23
170
|
* Validate a graph specification.
|
|
24
|
-
* Uses canonical GraphValidator for deep validation.
|
|
25
171
|
*/
|
|
26
|
-
async validate(body: {
|
|
27
|
-
|
|
28
|
-
type: string;
|
|
29
|
-
nodes: Array<{ id: string; type: string; label?: string }>;
|
|
30
|
-
edges: Array<{ from: string; to: string }>;
|
|
31
|
-
};
|
|
32
|
-
/** Catalog versions for referential integrity checks */
|
|
33
|
-
catalog_versions?: {
|
|
34
|
-
nodes: string;
|
|
35
|
-
tools: string;
|
|
36
|
-
triggers: string;
|
|
37
|
-
};
|
|
38
|
-
}): Promise<APIResponse<GraphValidationResult>> {
|
|
39
|
-
return this.client.POST<GraphValidationResult>("/v1/api/graphs/validate", {
|
|
172
|
+
async validate(body: GraphsValidateRequest): Promise<APIResponse<GraphsValidateResponse>> {
|
|
173
|
+
return this.client.POST<GraphsValidateResponse>("/v1/api/graphs/validate", {
|
|
40
174
|
body,
|
|
41
175
|
headers: this.headers(),
|
|
42
176
|
});
|
|
43
177
|
}
|
|
44
178
|
|
|
45
179
|
/**
|
|
46
|
-
* Introspect a graph
|
|
47
|
-
* Uses canonical GraphValidator with world-fixed context.
|
|
180
|
+
* Introspect a graph structure.
|
|
48
181
|
*/
|
|
49
|
-
async introspect(body: {
|
|
50
|
-
|
|
51
|
-
graph_spec?: Record<string, unknown>;
|
|
52
|
-
/** Catalog versions for deterministic introspection */
|
|
53
|
-
catalog_versions?: {
|
|
54
|
-
nodes: string;
|
|
55
|
-
tools: string;
|
|
56
|
-
triggers: string;
|
|
57
|
-
};
|
|
58
|
-
}): Promise<APIResponse<GraphIntrospectionResult>> {
|
|
59
|
-
return this.client.POST<GraphIntrospectionResult>("/v1/api/graphs/introspect", {
|
|
182
|
+
async introspect(body: GraphsIntrospectRequest): Promise<APIResponse<GraphsIntrospectResponse>> {
|
|
183
|
+
return this.client.POST<GraphsIntrospectResponse>("/v1/api/graphs/introspect", {
|
|
60
184
|
body,
|
|
61
185
|
headers: this.headers(),
|
|
62
186
|
});
|