@agent-os-sdk/client 0.9.14 → 0.9.16
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/client/AgentOsClient.d.ts +8 -4
- package/dist/client/AgentOsClient.d.ts.map +1 -1
- package/dist/client/AgentOsClient.js +12 -6
- package/dist/errors/factory.d.ts +2 -0
- package/dist/errors/factory.d.ts.map +1 -1
- package/dist/errors/factory.js +5 -1
- package/dist/generated/openapi.d.ts +544 -744
- package/dist/generated/openapi.d.ts.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/modules/agents.d.ts +25 -7
- package/dist/modules/agents.d.ts.map +1 -1
- package/dist/modules/agents.js +36 -7
- package/dist/modules/catalog.d.ts +63 -0
- package/dist/modules/catalog.d.ts.map +1 -1
- package/dist/modules/catalog.js +5 -0
- package/dist/modules/contracts.d.ts +48 -0
- package/dist/modules/contracts.d.ts.map +1 -0
- package/dist/modules/contracts.js +25 -0
- package/dist/modules/evaluation.d.ts +64 -0
- package/dist/modules/evaluation.d.ts.map +1 -1
- package/dist/modules/evaluation.js +12 -0
- package/dist/modules/improvements.d.ts +52 -0
- package/dist/modules/improvements.d.ts.map +1 -0
- package/dist/modules/improvements.js +27 -0
- package/dist/modules/metaAgent.d.ts +62 -0
- package/dist/modules/metaAgent.d.ts.map +1 -0
- package/dist/modules/metaAgent.js +25 -0
- package/dist/modules/presets.d.ts.map +1 -1
- package/dist/modules/presets.js +113 -44
- package/dist/modules/runs.d.ts +9 -0
- package/dist/modules/runs.d.ts.map +1 -1
- package/dist/modules/runs.js +14 -1
- package/dist/modules/templates.d.ts +28 -0
- package/dist/modules/templates.d.ts.map +1 -0
- package/dist/modules/templates.js +19 -0
- package/dist/modules/tools.d.ts +15 -0
- package/dist/modules/tools.d.ts.map +1 -1
- package/dist/modules/tools.js +6 -0
- package/package.json +51 -52
- package/src/client/AgentOsClient.ts +12 -6
- package/src/errors/factory.ts +7 -2
- package/src/generated/openapi.ts +544 -744
- package/src/generated/swagger.json +551 -924
- package/src/index.ts +22 -2
- package/src/modules/agents.ts +62 -8
- package/src/modules/catalog.ts +73 -0
- package/src/modules/contracts.ts +80 -0
- package/src/modules/evaluation.ts +80 -0
- package/src/modules/improvements.ts +71 -0
- package/src/modules/metaAgent.ts +87 -0
- package/src/modules/presets.ts +118 -50
- package/src/modules/runs.ts +20 -1
- package/src/modules/templates.ts +40 -0
- package/src/modules/tools.ts +23 -0
- package/src/modules/builder.ts +0 -456
- package/src/modules/graphs.ts +0 -188
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class ImprovementsModule {
|
|
2
|
+
client;
|
|
3
|
+
headers;
|
|
4
|
+
constructor(client, headers) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.headers = headers;
|
|
7
|
+
}
|
|
8
|
+
async list(params) {
|
|
9
|
+
return this.client.GET("/v1/api/improvements/cases", {
|
|
10
|
+
params: {
|
|
11
|
+
query: {
|
|
12
|
+
agentId: params?.agentId,
|
|
13
|
+
status: params?.status,
|
|
14
|
+
skip: params?.skip,
|
|
15
|
+
take: params?.take,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
headers: this.headers(),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async get(caseId) {
|
|
22
|
+
return this.client.GET("/v1/api/improvements/cases/{caseId}", {
|
|
23
|
+
params: { path: { caseId } },
|
|
24
|
+
headers: this.headers(),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { APIResponse, RawClient } from "../client/raw.js";
|
|
2
|
+
export interface MetaAgentPatchValidationIssue {
|
|
3
|
+
code: string;
|
|
4
|
+
message: string;
|
|
5
|
+
node_id?: string | null;
|
|
6
|
+
path?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface MetaAgentPreviewValidationIssue {
|
|
9
|
+
code: string;
|
|
10
|
+
message: string;
|
|
11
|
+
path?: string | null;
|
|
12
|
+
severity?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface MetaAgentPatchOp {
|
|
15
|
+
op: string;
|
|
16
|
+
node_id?: string | null;
|
|
17
|
+
kind?: string | null;
|
|
18
|
+
label?: string | null;
|
|
19
|
+
data?: Record<string, unknown> | null;
|
|
20
|
+
set?: Record<string, unknown> | null;
|
|
21
|
+
from?: string | null;
|
|
22
|
+
to?: string | null;
|
|
23
|
+
entrypoint?: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface MetaAgentPatchProposal {
|
|
26
|
+
patch_id: string;
|
|
27
|
+
description?: string | null;
|
|
28
|
+
ops: MetaAgentPatchOp[];
|
|
29
|
+
}
|
|
30
|
+
export interface MetaAgentPatchProposalResponse {
|
|
31
|
+
agent_id: string;
|
|
32
|
+
draft_revision?: string | null;
|
|
33
|
+
draft_etag: string;
|
|
34
|
+
source_contract: "agent_ir.v1";
|
|
35
|
+
patch?: MetaAgentPatchProposal | null;
|
|
36
|
+
preview_draft_ir?: Record<string, unknown> | null;
|
|
37
|
+
preview_valid: boolean;
|
|
38
|
+
preview_errors: MetaAgentPreviewValidationIssue[];
|
|
39
|
+
preview_warnings: MetaAgentPreviewValidationIssue[];
|
|
40
|
+
valid: boolean;
|
|
41
|
+
errors: MetaAgentPatchValidationIssue[];
|
|
42
|
+
message: string;
|
|
43
|
+
}
|
|
44
|
+
export interface MetaAgentApplyPatchResponse {
|
|
45
|
+
agent_id: string;
|
|
46
|
+
draft_revision?: string | null;
|
|
47
|
+
draft_etag_before: string;
|
|
48
|
+
draft_etag_after: string;
|
|
49
|
+
patch_id: string;
|
|
50
|
+
source_contract: "agent_ir.v1";
|
|
51
|
+
applied_at: string;
|
|
52
|
+
applied_by?: string | null;
|
|
53
|
+
draft_ir: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
export declare class MetaAgentModule {
|
|
56
|
+
private client;
|
|
57
|
+
private headers;
|
|
58
|
+
constructor(client: RawClient, headers: () => Record<string, string>);
|
|
59
|
+
propose(agentId: string, instruction: string): Promise<APIResponse<MetaAgentPatchProposalResponse>>;
|
|
60
|
+
apply(agentId: string, draftEtag: string, patch: MetaAgentPatchProposal): Promise<APIResponse<MetaAgentApplyPatchResponse>>;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=metaAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metaAgent.d.ts","sourceRoot":"","sources":["../../src/modules/metaAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,WAAW,6BAA6B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,+BAA+B;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,EAAE,CAAC,EAAE,MAA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MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAE9E,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAC;IAQnG,KAAK,CACP,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,sBAAsB,GAC9B,OAAO,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC;CAUvD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class MetaAgentModule {
|
|
2
|
+
client;
|
|
3
|
+
headers;
|
|
4
|
+
constructor(client, headers) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.headers = headers;
|
|
7
|
+
}
|
|
8
|
+
async propose(agentId, instruction) {
|
|
9
|
+
return this.client.POST("/v1/api/agents/{id}/meta-agent/proposals", {
|
|
10
|
+
params: { path: { id: agentId } },
|
|
11
|
+
headers: this.headers(),
|
|
12
|
+
body: { instruction },
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async apply(agentId, draftEtag, patch) {
|
|
16
|
+
return this.client.POST("/v1/api/agents/{id}/meta-agent/proposals/apply", {
|
|
17
|
+
params: { path: { id: agentId } },
|
|
18
|
+
headers: this.headers(),
|
|
19
|
+
body: {
|
|
20
|
+
draft_etag: draftEtag,
|
|
21
|
+
patch,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/modules/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;IAClD,WAAW,EAAE,UAAU,GAAG,MAAM,CAAC;IACjC,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,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AA+HD,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAY;IAC3B,OAAO,CAAC,QAAQ,CAA+B;IAG/C,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,SAAS,CAAiB;gBAEtB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAOjE,WAAW,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;CA2EnF"}
|
package/dist/modules/presets.js
CHANGED
|
@@ -5,52 +5,109 @@ const TRIGGER_TYPE_MAP = {
|
|
|
5
5
|
webhook: { type: "webhook", template_slug: "generic" },
|
|
6
6
|
schedule: { type: "schedule", template_slug: "cron" },
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
8
|
+
function buildAgentDefinitionId(name) {
|
|
9
|
+
const normalized = name
|
|
10
|
+
.trim()
|
|
11
|
+
.toLowerCase()
|
|
12
|
+
.replace(/[^a-z0-9]+/g, ".")
|
|
13
|
+
.replace(/\.{2,}/g, ".")
|
|
14
|
+
.replace(/^\.|\.$/g, "");
|
|
15
|
+
return `agent.${normalized || "untitled"}`;
|
|
16
|
+
}
|
|
17
|
+
function generateAgentIr(config) {
|
|
18
|
+
const agentDefinitionId = buildAgentDefinitionId(config.name);
|
|
19
|
+
const triggerLabel = config.trigger_type === "schedule" ? "Scheduled Trigger" : "Incoming Trigger";
|
|
20
|
+
const outputLabel = config.output_type === "chatwoot" ? "Chatwoot Output" : "HTTP Output";
|
|
21
|
+
return {
|
|
22
|
+
ir_version: "1.0",
|
|
23
|
+
agent_definition_id: agentDefinitionId,
|
|
24
|
+
version: "1.0.0",
|
|
25
|
+
metadata: {
|
|
26
|
+
name: config.name,
|
|
27
|
+
description: "Preset-generated agent_ir.v1 draft",
|
|
28
|
+
},
|
|
29
|
+
state_schema: {
|
|
30
|
+
type: "object",
|
|
31
|
+
properties: {
|
|
32
|
+
global: {
|
|
33
|
+
type: "object",
|
|
34
|
+
},
|
|
29
35
|
},
|
|
30
|
-
ui: { x: 300, y: 200 },
|
|
31
36
|
},
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
inputs_schema: {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {
|
|
40
|
+
message: {
|
|
41
|
+
type: "string",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
required: ["message"],
|
|
37
45
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{ from: "node-llm", to: "node-output" },
|
|
41
|
-
];
|
|
42
|
-
const triggers = [
|
|
43
|
-
{
|
|
44
|
-
type: `${triggerMapping.template_slug}.${triggerMapping.type}`,
|
|
45
|
-
config: { events: ["message_created"] },
|
|
46
|
+
outputs_schema: {
|
|
47
|
+
type: "object",
|
|
46
48
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
outcome_schema: {
|
|
50
|
+
type: "object",
|
|
51
|
+
properties: {
|
|
52
|
+
preset_ready: {
|
|
53
|
+
type: "boolean",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
required: ["preset_ready"],
|
|
57
|
+
},
|
|
58
|
+
kpi_bindings: [
|
|
59
|
+
{
|
|
60
|
+
kpi_ref: `${agentDefinitionId}.preset_ready`,
|
|
61
|
+
source_scope: "outcome",
|
|
62
|
+
source_path: "preset_ready",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
evaluation_policy: {
|
|
66
|
+
execution_mode: "async",
|
|
67
|
+
evaluators: [
|
|
68
|
+
{
|
|
69
|
+
evaluator_ref: `eval.${agentDefinitionId}.preset_shape_v1`,
|
|
70
|
+
kind: "rule",
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
sampling_policy: {
|
|
74
|
+
mode: "all",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
improvement_policy_ref: null,
|
|
78
|
+
nodes: [
|
|
79
|
+
{
|
|
80
|
+
id: "start",
|
|
81
|
+
kind: "start",
|
|
82
|
+
label: triggerLabel,
|
|
83
|
+
config: {},
|
|
84
|
+
bindings: {},
|
|
85
|
+
editability: { mode: "read_only" },
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "draft_output",
|
|
89
|
+
kind: "end",
|
|
90
|
+
label: outputLabel,
|
|
91
|
+
config: {},
|
|
92
|
+
bindings: {},
|
|
93
|
+
editability: { mode: "full" },
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
edges: [
|
|
97
|
+
{
|
|
98
|
+
id: "edge_start_to_output",
|
|
99
|
+
from: "start",
|
|
100
|
+
to: "draft_output",
|
|
101
|
+
kind: "default",
|
|
102
|
+
priority: 0,
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
capability_registry_refs: [],
|
|
106
|
+
policies: {},
|
|
107
|
+
editability: {
|
|
108
|
+
mode: "full",
|
|
109
|
+
},
|
|
110
|
+
entrypoints: ["start"],
|
|
54
111
|
};
|
|
55
112
|
}
|
|
56
113
|
function generateUUID() {
|
|
@@ -89,8 +146,20 @@ export class PresetsModule {
|
|
|
89
146
|
console.error("[AgentOS SDK] Failed to create agent:", createError);
|
|
90
147
|
return null;
|
|
91
148
|
}
|
|
92
|
-
const
|
|
93
|
-
|
|
149
|
+
const { error: draftError } = await this._agents.updateDraftIr(agent.id, generateAgentIr(config), { if_match: `"${agent.id}:0"` });
|
|
150
|
+
if (draftError) {
|
|
151
|
+
console.error("[AgentOS SDK] Failed to save agent_ir.v1 draft:", draftError);
|
|
152
|
+
return {
|
|
153
|
+
agent_id: agent.id,
|
|
154
|
+
agent_name: agent.name,
|
|
155
|
+
status: "draft",
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
const { data: bundle, error: publishError } = await this._agents.publish(agent.id, {
|
|
159
|
+
set_as_live: true,
|
|
160
|
+
required_tools: [],
|
|
161
|
+
idempotency_key: generateUUID(),
|
|
162
|
+
});
|
|
94
163
|
if (publishError) {
|
|
95
164
|
console.error("[AgentOS SDK] Failed to publish bundle:", publishError);
|
|
96
165
|
return {
|
package/dist/modules/runs.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { RawClient, APIResponse, components } from "../client/raw.js";
|
|
10
10
|
import type { PaginationParams, PaginatedResponse } from "../client/helpers.js";
|
|
11
|
+
import { type SSEEvent } from "../sse/client.js";
|
|
11
12
|
type WaitRunResponse = components["schemas"]["WaitRunResponse"];
|
|
12
13
|
type BatchRunResponse = components["schemas"]["BatchRunResponse"];
|
|
13
14
|
type CancelRunResponse = components["schemas"]["CancelRunResponse"];
|
|
@@ -60,6 +61,9 @@ export interface RunEventDto {
|
|
|
60
61
|
timestamp: string;
|
|
61
62
|
attempt_id: string;
|
|
62
63
|
payload: Record<string, unknown> | null;
|
|
64
|
+
operation_id: string;
|
|
65
|
+
parent_operation_id?: string | null;
|
|
66
|
+
root_operation_id: string;
|
|
63
67
|
}
|
|
64
68
|
export declare class RunsModule {
|
|
65
69
|
private client;
|
|
@@ -326,8 +330,13 @@ export interface FollowEvent {
|
|
|
326
330
|
seq: number;
|
|
327
331
|
timestamp: string;
|
|
328
332
|
payload?: Record<string, unknown> | null;
|
|
333
|
+
operation_id?: string;
|
|
334
|
+
parent_operation_id?: string | null;
|
|
335
|
+
root_operation_id?: string;
|
|
329
336
|
/** For run_event: the node that emitted this event */
|
|
330
337
|
node?: string;
|
|
331
338
|
}
|
|
339
|
+
/** Narrow raw SSE event to FollowEvent */
|
|
340
|
+
export declare function narrowFollowEvent(raw: SSEEvent<unknown>): FollowEvent | null;
|
|
332
341
|
export {};
|
|
333
342
|
//# sourceMappingURL=runs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/modules/runs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/modules/runs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG3D,KAAK,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,iBAAiB,CAAC,CAAC;AAChE,KAAK,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAClE,KAAK,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACpE,KAAK,uBAAuB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,yBAAyB,CAAC,CAAC;AAChF,KAAK,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,mBAAmB,CAAC,CAAC;AAGpE,MAAM,WAAW,GAAG;IAChB,MAAM,EAAE,MAAM,CAAC;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AM,KAAK,IAAI,CAAC;IACxC,6CAA6C;IAC7C,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,GAAG,OAAO,KAAK,IAAI,CAAC;CACpD;AAED,qCAAqC;AACrC,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,0CAA0C;AAC1C,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,WAAW,GAAG,IAAI,CAoD5E"}
|
package/dist/modules/runs.js
CHANGED
|
@@ -439,7 +439,7 @@ export class RunsModule {
|
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
/** Narrow raw SSE event to FollowEvent */
|
|
442
|
-
function narrowFollowEvent(raw) {
|
|
442
|
+
export function narrowFollowEvent(raw) {
|
|
443
443
|
const eventType = raw.event ?? "message";
|
|
444
444
|
const validTypes = ["run_event", "heartbeat", "close", "error"];
|
|
445
445
|
if (!validTypes.includes(eventType)) {
|
|
@@ -454,6 +454,13 @@ function narrowFollowEvent(raw) {
|
|
|
454
454
|
const innerPayload = (typeof data.payload === "object" && data.payload !== null)
|
|
455
455
|
? data.payload
|
|
456
456
|
: null;
|
|
457
|
+
const operationId = typeof data.operation_id === "string" ? data.operation_id : undefined;
|
|
458
|
+
const parentOperationId = typeof data.parent_operation_id === "string"
|
|
459
|
+
? data.parent_operation_id
|
|
460
|
+
: data.parent_operation_id === null
|
|
461
|
+
? null
|
|
462
|
+
: undefined;
|
|
463
|
+
const rootOperationId = typeof data.root_operation_id === "string" ? data.root_operation_id : undefined;
|
|
457
464
|
return {
|
|
458
465
|
type: "run_event",
|
|
459
466
|
seq,
|
|
@@ -462,7 +469,13 @@ function narrowFollowEvent(raw) {
|
|
|
462
469
|
...(innerPayload ?? {}),
|
|
463
470
|
type: typeof data.type === "string" ? data.type : "UNKNOWN",
|
|
464
471
|
attempt_id: typeof data.attempt_id === "string" ? data.attempt_id : undefined,
|
|
472
|
+
operation_id: operationId,
|
|
473
|
+
parent_operation_id: parentOperationId,
|
|
474
|
+
root_operation_id: rootOperationId,
|
|
465
475
|
},
|
|
476
|
+
operation_id: operationId,
|
|
477
|
+
parent_operation_id: parentOperationId,
|
|
478
|
+
root_operation_id: rootOperationId,
|
|
466
479
|
node: typeof innerPayload?.node === "string" ? innerPayload.node : undefined,
|
|
467
480
|
};
|
|
468
481
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { APIResponse, RawClient } from "../client/raw.js";
|
|
2
|
+
export interface AuthoringTemplateSummary {
|
|
3
|
+
template_ref: string;
|
|
4
|
+
version: string;
|
|
5
|
+
display_name: string;
|
|
6
|
+
description?: string | null;
|
|
7
|
+
template_kind: string;
|
|
8
|
+
category: string;
|
|
9
|
+
editability_mode: string;
|
|
10
|
+
required_capability_refs: string[];
|
|
11
|
+
default_policy_refs?: Record<string, unknown> | null;
|
|
12
|
+
default_runtime_config_refs?: Record<string, unknown> | null;
|
|
13
|
+
}
|
|
14
|
+
export interface AuthoringTemplateDetail extends AuthoringTemplateSummary {
|
|
15
|
+
base_agent_ir: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface AuthoringTemplateListResponse {
|
|
18
|
+
items: AuthoringTemplateSummary[];
|
|
19
|
+
total: number;
|
|
20
|
+
}
|
|
21
|
+
export declare class TemplatesModule {
|
|
22
|
+
private client;
|
|
23
|
+
private headers;
|
|
24
|
+
constructor(client: RawClient, headers: () => Record<string, string>);
|
|
25
|
+
list(): Promise<APIResponse<AuthoringTemplateListResponse>>;
|
|
26
|
+
get(templateRef: string): Promise<APIResponse<AuthoringTemplateDetail>>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/modules/templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,WAAW,wBAAwB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrD,2BAA2B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAChE;AAED,MAAM,WAAW,uBAAwB,SAAQ,wBAAwB;IACrE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,6BAA6B;IAC1C,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,eAAe;IACZ,OAAO,CAAC,MAAM;IAAa,OAAO,CAAC,OAAO;gBAAlC,MAAM,EAAE,SAAS,EAAU,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAE9E,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,6BAA6B,CAAC,CAAC;IAM3D,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;CAMhF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class TemplatesModule {
|
|
2
|
+
client;
|
|
3
|
+
headers;
|
|
4
|
+
constructor(client, headers) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.headers = headers;
|
|
7
|
+
}
|
|
8
|
+
async list() {
|
|
9
|
+
return this.client.GET("/v1/api/templates", {
|
|
10
|
+
headers: this.headers(),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
async get(templateRef) {
|
|
14
|
+
return this.client.GET("/v1/api/templates/{templateRef}", {
|
|
15
|
+
params: { path: { templateRef } },
|
|
16
|
+
headers: this.headers(),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
package/dist/modules/tools.d.ts
CHANGED
|
@@ -15,6 +15,20 @@ export interface ToolListResponse {
|
|
|
15
15
|
items: Tool[];
|
|
16
16
|
total: number;
|
|
17
17
|
}
|
|
18
|
+
export interface ToolDefinitionCatalogItem {
|
|
19
|
+
slug: string;
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
type: string;
|
|
23
|
+
version?: number;
|
|
24
|
+
input_schema?: Record<string, unknown>;
|
|
25
|
+
output_schema?: Record<string, unknown>;
|
|
26
|
+
credential_requirements?: unknown[];
|
|
27
|
+
}
|
|
28
|
+
export interface ToolDefinitionCatalogResponse {
|
|
29
|
+
version: string;
|
|
30
|
+
tools: ToolDefinitionCatalogItem[];
|
|
31
|
+
}
|
|
18
32
|
export interface ToolCallResult {
|
|
19
33
|
success: boolean;
|
|
20
34
|
output?: unknown;
|
|
@@ -36,6 +50,7 @@ export declare class ToolsModule {
|
|
|
36
50
|
* Get a tool by name.
|
|
37
51
|
*/
|
|
38
52
|
get(toolName: string): Promise<APIResponse<Tool>>;
|
|
53
|
+
getDefinitions(version?: string): Promise<APIResponse<ToolDefinitionCatalogResponse>>;
|
|
39
54
|
/**
|
|
40
55
|
* Call a tool directly (testing).
|
|
41
56
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/modules/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;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,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAO1C;;OAEG;IACG,GAAG,CAAC,QAAQ,EAAE,MAAM,GA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W;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,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAO1C;;OAEG;IACG,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAOjD,cAAc,CAAC,OAAO,GAAE,MAAY,GAAG,OAAO,CAAC,WAAW,CAAC,6BAA6B,CAAC,CAAC;IAOhG;;OAEG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;CAOpF"}
|
package/dist/modules/tools.js
CHANGED
|
@@ -26,6 +26,12 @@ export class ToolsModule {
|
|
|
26
26
|
headers: this.headers(),
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
async getDefinitions(version = "1") {
|
|
30
|
+
return this.client.GET("/v1/api/tools/definitions", {
|
|
31
|
+
params: { query: { version } },
|
|
32
|
+
headers: this.headers(),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
29
35
|
/**
|
|
30
36
|
* Call a tool directly (testing).
|
|
31
37
|
*/
|
package/package.json
CHANGED
|
@@ -1,53 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
2
|
+
"name": "@agent-os-sdk/client",
|
|
3
|
+
"version": "0.9.16",
|
|
4
|
+
"description": "Official TypeScript SDK for Agent OS platform",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"agent-os",
|
|
17
|
+
"sdk",
|
|
18
|
+
"ai",
|
|
19
|
+
"agents",
|
|
20
|
+
"typescript"
|
|
21
|
+
],
|
|
22
|
+
"author": "Agent OS Team",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/yuri12344/agent-os.git"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"openapi-fetch": "^0.13.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^25.2.1",
|
|
36
|
+
"openapi-typescript": "^7.4.0",
|
|
37
|
+
"tsx": "^4.19.0",
|
|
38
|
+
"typescript": "^5.5.0",
|
|
39
|
+
"vitest": "^4.0.18"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"src"
|
|
44
|
+
],
|
|
45
|
+
"scripts": {
|
|
46
|
+
"generate": "tsx scripts/generate.ts",
|
|
47
|
+
"build": "tsc",
|
|
48
|
+
"dev": "tsc --watch",
|
|
49
|
+
"test": "vitest run",
|
|
50
|
+
"typecheck": "tsc --noEmit"
|
|
51
|
+
}
|
|
52
|
+
}
|