@agent-os-sdk/client 0.9.13 → 0.9.15
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 +55 -7
- package/dist/modules/agents.d.ts.map +1 -1
- package/dist/modules/agents.js +68 -7
- 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/package.json +52 -51
- 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 +123 -8
- 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/builder.ts +0 -456
- package/src/modules/graphs.ts +0 -188
|
@@ -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,MAA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CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,aAAa,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;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,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,GAAG,CAAC,EAAE;QACJ,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;
|
|
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,GAAG,CAAC,EAAE;QACJ,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,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,eA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AC;CAwC1B;AAMD,gCAAgC;AAChC,MAAM,WAAW,aAAa;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,qDAAqD;IACrD,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,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/package.json
CHANGED
|
@@ -1,52 +1,53 @@
|
|
|
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
|
-
|
|
2
|
+
"name": "@agent-os-sdk/client",
|
|
3
|
+
"version": "0.9.15",
|
|
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
|
+
"scripts": {
|
|
16
|
+
"generate": "tsx scripts/generate.ts",
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"dev": "tsc --watch",
|
|
19
|
+
"test": "vitest run",
|
|
20
|
+
"typecheck": "tsc --noEmit",
|
|
21
|
+
"prepublishOnly": "pnpm build"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"agent-os",
|
|
25
|
+
"sdk",
|
|
26
|
+
"ai",
|
|
27
|
+
"agents",
|
|
28
|
+
"typescript"
|
|
29
|
+
],
|
|
30
|
+
"author": "Agent OS Team",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/yuri12344/agent-os.git"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"openapi-fetch": "^0.13.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^25.2.1",
|
|
44
|
+
"openapi-typescript": "^7.4.0",
|
|
45
|
+
"tsx": "^4.19.0",
|
|
46
|
+
"typescript": "^5.5.0",
|
|
47
|
+
"vitest": "^4.0.18"
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"dist",
|
|
51
|
+
"src"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
@@ -37,7 +37,6 @@ import {
|
|
|
37
37
|
import { createRawClient, type RawClient } from "./raw.js";
|
|
38
38
|
|
|
39
39
|
import { AgentsModule } from "../modules/agents.js";
|
|
40
|
-
import { BuilderModule } from "../modules/builder.js";
|
|
41
40
|
import { ChatwootModule } from "../modules/chatwoot.js";
|
|
42
41
|
import { CredentialsModule } from "../modules/credentials.js";
|
|
43
42
|
import { DatasetsModule } from "../modules/datasets.js";
|
|
@@ -58,19 +57,22 @@ import { AuditModule } from "../modules/audit.js";
|
|
|
58
57
|
import { AuthModule } from "../modules/auth.js";
|
|
59
58
|
import { CatalogModule } from "../modules/catalog.js";
|
|
60
59
|
import { CheckpointsModule } from "../modules/checkpoints.js";
|
|
60
|
+
import { ContractsModule } from "../modules/contracts.js";
|
|
61
61
|
import { CronsModule } from "../modules/crons.js";
|
|
62
62
|
import { EvaluationModule } from "../modules/evaluation.js";
|
|
63
63
|
import { FilesModule } from "../modules/files.js";
|
|
64
|
-
import { GraphsModule } from "../modules/graphs.js";
|
|
65
64
|
import { InfoModule } from "../modules/info.js";
|
|
65
|
+
import { ImprovementsModule } from "../modules/improvements.js";
|
|
66
66
|
import { MeModule } from "../modules/me.js";
|
|
67
67
|
import { MembershipsModule } from "../modules/memberships.js";
|
|
68
|
+
import { MetaAgentModule } from "../modules/metaAgent.js";
|
|
68
69
|
import { MetricsModule } from "../modules/metrics.js";
|
|
69
70
|
import { ObservabilityModule } from "../modules/observability.js";
|
|
70
71
|
import { PlaygroundModule } from "../modules/playground.js";
|
|
71
72
|
import { PresetsModule } from "../modules/presets.js";
|
|
72
73
|
import { PromptsModule } from "../modules/prompts.js";
|
|
73
74
|
import { StoreModule } from "../modules/store.js";
|
|
75
|
+
import { TemplatesModule } from "../modules/templates.js";
|
|
74
76
|
import { TracesModule } from "../modules/traces.js";
|
|
75
77
|
import { UsageModule } from "../modules/usage.js";
|
|
76
78
|
import { VectorStoresModule } from "../modules/vectorStores.js";
|
|
@@ -94,7 +96,6 @@ export class AgentOsClient {
|
|
|
94
96
|
readonly roles: RolesModule;
|
|
95
97
|
readonly triggers: TriggersModule;
|
|
96
98
|
readonly credentials: CredentialsModule;
|
|
97
|
-
readonly builder: BuilderModule;
|
|
98
99
|
readonly members: MembersModule;
|
|
99
100
|
readonly tenants: TenantsModule;
|
|
100
101
|
readonly workspaces: WorkspacesModule;
|
|
@@ -115,12 +116,15 @@ export class AgentOsClient {
|
|
|
115
116
|
readonly a2a: A2aModule;
|
|
116
117
|
readonly me: MeModule;
|
|
117
118
|
readonly info: InfoModule;
|
|
119
|
+
readonly improvements: ImprovementsModule;
|
|
118
120
|
readonly metrics: MetricsModule;
|
|
119
|
-
readonly
|
|
121
|
+
readonly metaAgent: MetaAgentModule;
|
|
122
|
+
readonly contracts: ContractsModule;
|
|
120
123
|
readonly catalog: CatalogModule;
|
|
121
124
|
readonly approvals: ApprovalsModule;
|
|
122
125
|
readonly auth: AuthModule;
|
|
123
126
|
readonly observability: ObservabilityModule;
|
|
127
|
+
readonly templates: TemplatesModule;
|
|
124
128
|
|
|
125
129
|
// Convenience aliases
|
|
126
130
|
readonly experiments: {
|
|
@@ -166,7 +170,6 @@ export class AgentOsClient {
|
|
|
166
170
|
this.roles = new RolesModule(this._client, getHeaders);
|
|
167
171
|
this.triggers = new TriggersModule(this._client, getHeaders);
|
|
168
172
|
this.credentials = new CredentialsModule(this._client, getWorkspaceId, getHeaders);
|
|
169
|
-
this.builder = new BuilderModule(this._client);
|
|
170
173
|
this.members = new MembersModule(this._client, getHeaders);
|
|
171
174
|
this.tenants = new TenantsModule(this._client, getHeaders);
|
|
172
175
|
this.workspaces = new WorkspacesModule(this._client, getTenantId, getHeaders);
|
|
@@ -187,12 +190,15 @@ export class AgentOsClient {
|
|
|
187
190
|
this.a2a = new A2aModule(this._client, getHeaders);
|
|
188
191
|
this.me = new MeModule(this._client, getHeaders);
|
|
189
192
|
this.info = new InfoModule(this._client, getHeaders);
|
|
193
|
+
this.improvements = new ImprovementsModule(this._client, getHeaders);
|
|
190
194
|
this.metrics = new MetricsModule(this._client);
|
|
191
|
-
this.
|
|
195
|
+
this.metaAgent = new MetaAgentModule(this._client, getHeaders);
|
|
196
|
+
this.contracts = new ContractsModule(this._client, getHeaders);
|
|
192
197
|
this.catalog = new CatalogModule(this._client);
|
|
193
198
|
this.approvals = new ApprovalsModule(this._client, getHeaders);
|
|
194
199
|
this.auth = new AuthModule(this._client, getHeaders);
|
|
195
200
|
this.observability = new ObservabilityModule(this._client, getHeaders);
|
|
201
|
+
this.templates = new TemplatesModule(this._client, getHeaders);
|
|
196
202
|
|
|
197
203
|
// Initialize convenience aliases
|
|
198
204
|
this.experiments = {
|
package/src/errors/factory.ts
CHANGED
|
@@ -27,11 +27,16 @@ import {
|
|
|
27
27
|
*/
|
|
28
28
|
export function createErrorFromResponse(
|
|
29
29
|
response: Response,
|
|
30
|
-
body?: { code?: string; message?: string; details?: unknown },
|
|
30
|
+
body?: { code?: string; message?: string; detail?: string; title?: string; details?: unknown },
|
|
31
31
|
requestPath?: string
|
|
32
32
|
): AgentOsError {
|
|
33
33
|
const status = response.status;
|
|
34
|
-
const message =
|
|
34
|
+
const message =
|
|
35
|
+
body?.message ||
|
|
36
|
+
body?.detail ||
|
|
37
|
+
body?.title ||
|
|
38
|
+
response.statusText ||
|
|
39
|
+
`HTTP ${status}`;
|
|
35
40
|
const requestId = response.headers.get("x-request-id") ?? undefined;
|
|
36
41
|
const opts: ErrorOptions = {
|
|
37
42
|
requestId,
|