@oomol-lab/open-flow 0.1.0-beta.2 → 0.1.0-beta.21
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/browser/{_virtual_open-flow-twemoji-DJwKsM_w.js → _virtual_open-flow-twemoji-CpHJOEsk.js} +4028 -2
- package/dist/browser/carbon-Cn-DTyjG.js +54 -0
- package/dist/browser/createResourceDialog-CjuJryCv.js +110 -0
- package/dist/browser/dist-B_T-OpQp.js +4 -0
- package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
- package/dist/browser/{dist-CPuF50D9.js → dist-D1VYgicl.js} +426 -305
- package/dist/browser/dist-DSe6KRsr.js +1224 -0
- package/dist/browser/dist-DYjIVIZC.js +795 -0
- package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
- package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
- package/dist/browser/{dist-CJpzJrLM.js → dist-DwvhuMxw.js} +894 -895
- package/dist/browser/dist-DxahK_I8.js +2688 -0
- package/dist/browser/{dist-C46JByB-.js → dist-Dz6Nglsd.js} +61 -61
- package/dist/browser/{dist-DUzA0Ukh.js → dist-TJfrvoIQ.js} +141 -142
- package/dist/browser/{esm-B_PbUobB.js → esm-B7A42FzW.js} +68 -59
- package/dist/browser/flow-authoring-module.d.ts +2 -2
- package/dist/browser/flow-authoring-node.d.ts +20 -6
- package/dist/browser/flow-authoring.d.ts +1 -1
- package/dist/browser/flow-authoring.js +5405 -286
- package/dist/browser/flow-change-schema.d.ts +6 -0
- package/dist/browser/flow-change.d.ts +173 -14
- package/dist/browser/flow-change.js +5271 -114
- package/dist/browser/flow-notifications.d.ts +5 -0
- package/dist/browser/flowChanges-Tg1duLry.js +11081 -0
- package/dist/browser/{flowRunInputEditorStore-BeyUSWpO.js → flowRunInputEditorStore-BBqQIOCR.js} +1020 -4104
- package/dist/browser/flowWorkspace-CoK10XHY.js +148497 -0
- package/dist/browser/host-conformance.d.ts +7 -0
- package/dist/browser/host-conformance.js +33 -0
- package/dist/browser/{diagnostics-giPSzyMo.js → i18n-CVBh0Ni1.js} +3390 -5715
- package/dist/browser/inputValues-CDiBMKu8.js +43 -0
- package/dist/browser/{languages-DgJehE1g.js → languages-C0zQ4GSo.js} +5 -25
- package/dist/browser/licenses.md +149 -700
- package/dist/browser/main-BDnNHhkU.js +50 -0
- package/dist/browser/{markdownContent-DdlIRN3_.js → markdownContent-BBgH9ZIV.js} +41 -41
- package/dist/browser/theme.css +461 -34
- package/dist/browser/{typeScriptSession-mPCiA9sV.js → typeScriptSession-DnAmJCzu.js} +70 -71
- package/dist/browser/ui-input.d.ts +3 -0
- package/dist/browser/ui-label.d.ts +3 -0
- package/dist/browser/ui-textarea.d.ts +3 -0
- package/dist/browser/ui.css +2 -0
- package/dist/browser/ui.css.d.ts +1 -0
- package/dist/browser/ui.d.ts +12 -0
- package/dist/browser/ui.js +2598 -0
- package/dist/browser/useValueChanged-BY05Usw-.js +2944 -0
- package/dist/browser/workbench-contract.d.ts +8 -2
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -0
- package/dist/browser/workbench.js +2043 -1327
- package/dist/browser/workbenchSelect-DEmv7SLW.js +11666 -0
- package/dist/common/control-api-conformance.d.ts +7 -0
- package/dist/common/control-api-conformance.js +5629 -166
- package/dist/common/control-api-errors.d.ts +9 -0
- package/dist/common/control-api.d.ts +309 -38
- package/dist/common/control-api.js +5877 -575
- package/dist/common/control-requests.d.ts +68 -0
- package/dist/common/control-requests.js +4950 -0
- package/dist/common/engine-contract.d.ts +3 -1
- package/dist/common/flow-agent.d.ts +10 -0
- package/dist/common/flow-encoding.d.ts +11 -2
- package/dist/common/flow-encoding.js +4972 -66
- package/dist/common/flow-graph.d.ts +6 -0
- package/dist/common/flow-json.d.ts +2 -0
- package/dist/common/flow-modules.d.ts +20 -0
- package/dist/common/flow-notifications.d.ts +5 -0
- package/dist/common/flow-schema.d.ts +8 -0
- package/dist/common/flow-semantics.d.ts +10 -6
- package/dist/common/flow-semantics.js +10042 -1700
- package/dist/common/integration-trigger.d.ts +24 -1
- package/dist/common/integration-trigger.js +188 -52
- package/dist/common/mcp-conformance.d.ts +2 -0
- package/dist/common/mcp.d.ts +765 -0
- package/dist/common/mcp.js +6538 -0
- package/dist/common/provider-triggers.js +6057 -993
- package/dist/common/run-events.d.ts +2 -2
- package/dist/common/run-events.js +12 -17
- package/dist/common/run-lifecycle.d.ts +21 -2
- package/dist/common/run-lifecycle.js +83 -2
- package/dist/common/run-results.d.ts +57 -0
- package/dist/common/runtime-contract.d.ts +36 -3
- package/dist/common/runtime-contract.js +227 -19
- package/dist/common/scheduler.d.ts +77 -18
- package/dist/common/scheduler.js +8259 -248
- package/dist/index.d.ts +6 -5
- package/package.json +21 -1
- package/dist/browser/carbon-DMCVsjHo.js +0 -53
- package/dist/browser/createResourceDialog-BkZns-oZ.js +0 -504
- package/dist/browser/dist-BMqL-qR5.js +0 -1894
- package/dist/browser/dist-BpopSHwP.js +0 -1543
- package/dist/browser/dist-CUSrALSX.js +0 -1620
- package/dist/browser/flowWorkspace-DAMLVMcF.js +0 -47584
- package/dist/browser/getPseudoElementBounds-ESJExRFX.js +0 -7642
- package/dist/browser/main-DmjVyuWr.js +0 -76
- package/dist/browser/workbenchSelect-B2s1HV-Y.js +0 -1374
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type ProjectedRunEvent = {
|
|
2
|
-
readonly kind: 'node.
|
|
2
|
+
readonly kind: 'node.completed';
|
|
3
3
|
readonly payload: Readonly<Record<string, unknown>>;
|
|
4
4
|
readonly value: unknown;
|
|
5
5
|
} | {
|
|
6
|
-
readonly kind: 'node.artifact' | 'node.
|
|
6
|
+
readonly kind: 'node.artifact' | 'node.failed' | 'node.log' | 'node.progress' | 'node.started' | 'run.progress' | 'run.started';
|
|
7
7
|
readonly payload: Readonly<Record<string, unknown>>;
|
|
8
8
|
};
|
|
9
9
|
export declare function createEventProjector(platformRunId: string, nodeFailureCodes: ReadonlySet<string>): (event: unknown) => Promise<ProjectedRunEvent | undefined>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
//#region src/execution/common/events.ts
|
|
2
2
|
var e = new TextEncoder(), t = /* @__PURE__ */ new Set([
|
|
3
|
+
"agent",
|
|
3
4
|
"condition",
|
|
4
5
|
"connector",
|
|
5
6
|
"javascript",
|
|
6
7
|
"llm",
|
|
7
8
|
"subflow",
|
|
8
|
-
"value"
|
|
9
|
+
"value",
|
|
10
|
+
"wait"
|
|
9
11
|
]);
|
|
10
12
|
function n(e, t) {
|
|
11
13
|
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError(`${t} must be an object.`);
|
|
@@ -105,25 +107,22 @@ function f(e, t) {
|
|
|
105
107
|
}
|
|
106
108
|
});
|
|
107
109
|
}
|
|
108
|
-
if (_ == "
|
|
110
|
+
if (_ == "run.completed" || _ == "run.failed") {
|
|
109
111
|
o(g);
|
|
110
112
|
return;
|
|
111
113
|
}
|
|
112
|
-
if (_ == "node.started" || _ == "node.
|
|
113
|
-
let
|
|
114
|
+
if (_ == "node.started" || _ == "node.progress" || _ == "node.artifact" || _ == "node.log" || _ == "node.completed" || _ == "node.failed") {
|
|
115
|
+
let r = s(g, f, e), o = await r.executionId, m = {
|
|
114
116
|
executionId: o,
|
|
115
|
-
flowId:
|
|
116
|
-
nodeId:
|
|
117
|
-
scopeId: await c("scope", e,
|
|
117
|
+
flowId: r.flowId,
|
|
118
|
+
nodeId: r.nodeId,
|
|
119
|
+
scopeId: await c("scope", e, r.rawRunId)
|
|
118
120
|
};
|
|
119
121
|
switch (_) {
|
|
120
|
-
case "node.
|
|
122
|
+
case "node.completed": return {
|
|
121
123
|
kind: _,
|
|
122
|
-
payload:
|
|
123
|
-
|
|
124
|
-
handle: r(g.handle, "Runtime node.output handle")
|
|
125
|
-
},
|
|
126
|
-
value: g.value
|
|
124
|
+
payload: m,
|
|
125
|
+
value: n(g.outputs, "Runtime node.completed outputs")
|
|
127
126
|
};
|
|
128
127
|
case "node.started": {
|
|
129
128
|
let e = a(g.nodeKind), t = i(g.nodeTitle, "Runtime node.started nodeTitle"), n = i(g.operation, "Runtime node.started operation");
|
|
@@ -169,10 +168,6 @@ function f(e, t) {
|
|
|
169
168
|
message: l(g.message)
|
|
170
169
|
}
|
|
171
170
|
};
|
|
172
|
-
case "node.completed": return {
|
|
173
|
-
kind: _,
|
|
174
|
-
payload: m
|
|
175
|
-
};
|
|
176
171
|
case "node.failed": return {
|
|
177
172
|
kind: _,
|
|
178
173
|
payload: {
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
export declare const runTerminalStatuses: readonly ['canceled', 'completed', 'failed', 'indeterminate'];
|
|
2
|
-
export declare const runStatuses: readonly ["canceled", "completed", "failed", "indeterminate", "queued", "running", "starting"];
|
|
2
|
+
export declare const runStatuses: readonly ["canceled", "completed", "failed", "indeterminate", "queued", "running", "starting", "waiting"];
|
|
3
3
|
export type RunStatus = (typeof runStatuses)[number];
|
|
4
4
|
export type RunTerminalStatus = (typeof runTerminalStatuses)[number];
|
|
5
5
|
export type RunOperation = {
|
|
6
6
|
readonly kind: 'claim';
|
|
7
7
|
} | {
|
|
8
8
|
readonly kind: 'start';
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'wait';
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: 'resolve';
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: 'fail-start' | 'fail-resume';
|
|
9
15
|
} | {
|
|
10
16
|
readonly kind: 'commit';
|
|
11
17
|
readonly status: RunTerminalStatus;
|
|
@@ -16,6 +22,9 @@ export type RunTransition = {
|
|
|
16
22
|
} | {
|
|
17
23
|
readonly kind: 'running';
|
|
18
24
|
readonly status: 'running';
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'waiting';
|
|
27
|
+
readonly status: 'waiting';
|
|
19
28
|
} | {
|
|
20
29
|
readonly kind: 'terminal';
|
|
21
30
|
readonly status: RunTerminalStatus;
|
|
@@ -28,12 +37,18 @@ export type RunTransition = {
|
|
|
28
37
|
} | {
|
|
29
38
|
readonly kind: 'committed';
|
|
30
39
|
readonly status: RunTerminalStatus;
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: 'waited';
|
|
42
|
+
readonly status: 'waiting';
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'resolved';
|
|
45
|
+
readonly status: 'queued';
|
|
31
46
|
} | {
|
|
32
47
|
readonly kind: 'stale';
|
|
33
48
|
readonly status: RunStatus;
|
|
34
49
|
};
|
|
35
50
|
export type RunClaim = Extract<RunTransition, {
|
|
36
|
-
readonly kind: 'ready' | 'running' | 'terminal';
|
|
51
|
+
readonly kind: 'ready' | 'running' | 'terminal' | 'waiting';
|
|
37
52
|
}>;
|
|
38
53
|
export type RunStart = Extract<RunTransition, {
|
|
39
54
|
readonly kind: 'already-started' | 'started' | 'stale';
|
|
@@ -59,8 +74,12 @@ export interface RunLifecycleHarness {
|
|
|
59
74
|
}): Promise<RunAcceptance>;
|
|
60
75
|
claim(runId: string): Promise<RunClaim>;
|
|
61
76
|
commit(runId: string, status: RunTerminalStatus): Promise<boolean>;
|
|
77
|
+
failStarting(runId: string): Promise<boolean>;
|
|
78
|
+
failResume(runId: string): Promise<boolean>;
|
|
62
79
|
observe(runId: string): Promise<RunObservation>;
|
|
80
|
+
resolve(runId: string): Promise<boolean>;
|
|
63
81
|
start(runId: string): Promise<RunStart>;
|
|
82
|
+
wait(runId: string): Promise<boolean>;
|
|
64
83
|
}
|
|
65
84
|
export interface RunLifecycleConformanceCase {
|
|
66
85
|
readonly name: string;
|
|
@@ -28,7 +28,8 @@ var n = [
|
|
|
28
28
|
...n,
|
|
29
29
|
"queued",
|
|
30
30
|
"running",
|
|
31
|
-
"starting"
|
|
31
|
+
"starting",
|
|
32
|
+
"waiting"
|
|
32
33
|
];
|
|
33
34
|
function i(e) {
|
|
34
35
|
return e == "canceled" || e == "completed" || e == "failed" || e == "indeterminate";
|
|
@@ -45,6 +46,10 @@ function a(e, t) {
|
|
|
45
46
|
kind: "running",
|
|
46
47
|
status: e
|
|
47
48
|
};
|
|
49
|
+
case "waiting": return {
|
|
50
|
+
kind: "waiting",
|
|
51
|
+
status: e
|
|
52
|
+
};
|
|
48
53
|
case "canceled":
|
|
49
54
|
case "completed":
|
|
50
55
|
case "failed":
|
|
@@ -63,6 +68,7 @@ function a(e, t) {
|
|
|
63
68
|
status: e
|
|
64
69
|
};
|
|
65
70
|
case "queued":
|
|
71
|
+
case "waiting":
|
|
66
72
|
case "canceled":
|
|
67
73
|
case "completed":
|
|
68
74
|
case "failed":
|
|
@@ -71,10 +77,32 @@ function a(e, t) {
|
|
|
71
77
|
status: e
|
|
72
78
|
};
|
|
73
79
|
}
|
|
80
|
+
case "wait": return e == "running" ? {
|
|
81
|
+
kind: "waited",
|
|
82
|
+
status: "waiting"
|
|
83
|
+
} : {
|
|
84
|
+
kind: "stale",
|
|
85
|
+
status: e
|
|
86
|
+
};
|
|
87
|
+
case "resolve": return e == "waiting" ? {
|
|
88
|
+
kind: "resolved",
|
|
89
|
+
status: "queued"
|
|
90
|
+
} : {
|
|
91
|
+
kind: "stale",
|
|
92
|
+
status: e
|
|
93
|
+
};
|
|
94
|
+
case "fail-start":
|
|
95
|
+
case "fail-resume": return e == "starting" ? {
|
|
96
|
+
kind: "committed",
|
|
97
|
+
status: t.kind == "fail-start" ? "failed" : "indeterminate"
|
|
98
|
+
} : {
|
|
99
|
+
kind: "stale",
|
|
100
|
+
status: e
|
|
101
|
+
};
|
|
74
102
|
case "commit": return i(e) ? {
|
|
75
103
|
kind: "stale",
|
|
76
104
|
status: e
|
|
77
|
-
} : t.status == "canceled" || e == "running" ? {
|
|
105
|
+
} : t.status == "canceled" || e == "running" || t.status == "failed" && e == "waiting" ? {
|
|
78
106
|
kind: "committed",
|
|
79
107
|
status: t.status
|
|
80
108
|
} : {
|
|
@@ -95,6 +123,59 @@ async function s(e, t = "request", n = "request-a") {
|
|
|
95
123
|
return r.runId;
|
|
96
124
|
}
|
|
97
125
|
var c = [
|
|
126
|
+
{
|
|
127
|
+
name: "rejects startup failures outside the start barrier and preserves their terminal",
|
|
128
|
+
async verify(e) {
|
|
129
|
+
for (let t of ["failStarting", "failResume"]) {
|
|
130
|
+
let n = await s(e, t);
|
|
131
|
+
o(await e[t](n), !1, "Failure before claim"), await e.claim(n), o(await e.commit(n, "completed"), !1, "Completion before start"), o(await e[t](n), !0, "Startup failure");
|
|
132
|
+
let r = t == "failStarting" ? "failed" : "indeterminate";
|
|
133
|
+
o(await e.observe(n), {
|
|
134
|
+
status: r,
|
|
135
|
+
terminalEvents: [r]
|
|
136
|
+
}, "Startup terminal"), o(await e[t](n), !1, "Repeated startup failure"), o(await e.start(n), {
|
|
137
|
+
kind: "stale",
|
|
138
|
+
status: r
|
|
139
|
+
}, "Start after failure"), o(await e.commit(n, "canceled"), !1, "Cancellation after failure");
|
|
140
|
+
}
|
|
141
|
+
let t = await s(e, "running");
|
|
142
|
+
await e.claim(t), await e.start(t), o(await e.failStarting(t), !1, "Startup failure after start"), o(await e.failResume(t), !1, "Resume failure after start"), o(await e.observe(t), {
|
|
143
|
+
status: "running",
|
|
144
|
+
terminalEvents: []
|
|
145
|
+
}, "Running observation");
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "pauses and resumes the same Run through the ordinary start barrier",
|
|
150
|
+
async verify(e) {
|
|
151
|
+
let t = await s(e), n = await e.claim(t);
|
|
152
|
+
if (n.kind != "ready") throw Error("Initial Run claim was not ready.");
|
|
153
|
+
o(await e.start(t), a(n.status, { kind: "start" }), "Initial start"), o(await e.wait(t), !0, "Wait commit"), o(await e.observe(t), {
|
|
154
|
+
status: "waiting",
|
|
155
|
+
terminalEvents: []
|
|
156
|
+
}, "Waiting Run observation"), o(await e.claim(t), a("waiting", { kind: "claim" }), "Claim while waiting"), o(await e.resolve(t), !0, "Wait resolution"), o(await e.resolve(t), !1, "Repeated Wait resolution");
|
|
157
|
+
let r = await e.claim(t);
|
|
158
|
+
if (r.kind != "ready") throw Error("Resolved Run claim was not ready.");
|
|
159
|
+
o(await e.start(t), a(r.status, { kind: "start" }), "Resume start"), o(await e.commit(t, "completed"), !0, "Completion after resume"), o(await e.observe(t), {
|
|
160
|
+
status: "completed",
|
|
161
|
+
terminalEvents: ["completed"]
|
|
162
|
+
}, "Resumed Run observation");
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "allows cancellation and expiry failure while waiting",
|
|
167
|
+
async verify(e) {
|
|
168
|
+
let t = await s(e, "cancel-wait");
|
|
169
|
+
if ((await e.claim(t)).kind != "ready") throw Error("Canceled Run claim was not ready.");
|
|
170
|
+
await e.start(t), o(await e.wait(t), !0, "Canceled Run Wait commit"), o(await e.commit(t, "canceled"), !0, "Waiting cancellation"), o(await e.resolve(t), !1, "Resolution after cancellation");
|
|
171
|
+
let n = await s(e, "expire-wait");
|
|
172
|
+
if ((await e.claim(n)).kind != "ready") throw Error("Expired Run claim was not ready.");
|
|
173
|
+
await e.start(n), o(await e.wait(n), !0, "Expired Run Wait commit"), o(await e.commit(n, "failed"), !0, "Waiting expiry failure"), o(await e.observe(n), {
|
|
174
|
+
status: "failed",
|
|
175
|
+
terminalEvents: ["failed"]
|
|
176
|
+
}, "Expired Run observation");
|
|
177
|
+
}
|
|
178
|
+
},
|
|
98
179
|
{
|
|
99
180
|
name: "replays idempotent acceptance and rejects a conflicting request",
|
|
100
181
|
async verify(e) {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { JsonValue } from '../browser/flow-change.js';
|
|
2
|
+
export type ResultCall = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly kind: 'connector';
|
|
5
|
+
readonly action: string;
|
|
6
|
+
readonly connectionId?: string;
|
|
7
|
+
} | {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly kind: 'code';
|
|
10
|
+
};
|
|
11
|
+
export interface ResultInfo {
|
|
12
|
+
readonly resultId: string;
|
|
13
|
+
readonly callId: string;
|
|
14
|
+
readonly toolId: string;
|
|
15
|
+
readonly source: {
|
|
16
|
+
readonly kind: 'connector';
|
|
17
|
+
readonly action: string;
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: 'code';
|
|
20
|
+
};
|
|
21
|
+
readonly bytes: number;
|
|
22
|
+
readonly digest: string;
|
|
23
|
+
readonly createdAt: string;
|
|
24
|
+
}
|
|
25
|
+
interface ResultEntry {
|
|
26
|
+
readonly pointer: string;
|
|
27
|
+
readonly type: 'object' | 'array' | 'string' | 'number' | 'boolean' | 'null';
|
|
28
|
+
readonly length?: number;
|
|
29
|
+
readonly complete: boolean;
|
|
30
|
+
readonly value?: JsonValue;
|
|
31
|
+
}
|
|
32
|
+
export interface ResultPage extends ResultEntry {
|
|
33
|
+
readonly offset: number;
|
|
34
|
+
readonly nextOffset?: number;
|
|
35
|
+
readonly entries?: readonly ResultEntry[];
|
|
36
|
+
}
|
|
37
|
+
export interface ResultQuery {
|
|
38
|
+
readonly pointer?: string;
|
|
39
|
+
readonly offset?: number;
|
|
40
|
+
readonly limit?: number;
|
|
41
|
+
readonly maxBytes?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare function parseResultQuery(value: unknown): Required<ResultQuery>;
|
|
44
|
+
export declare function decodeResultList(value: unknown): {
|
|
45
|
+
readonly version: 1;
|
|
46
|
+
readonly runId: string;
|
|
47
|
+
readonly results: readonly ResultInfo[];
|
|
48
|
+
readonly nextAfter?: string;
|
|
49
|
+
};
|
|
50
|
+
export declare function decodeResultRead(value: unknown): {
|
|
51
|
+
readonly version: 1;
|
|
52
|
+
readonly runId: string;
|
|
53
|
+
readonly result: ResultInfo;
|
|
54
|
+
readonly page: ResultPage;
|
|
55
|
+
};
|
|
56
|
+
export declare function readResult(value: JsonValue, query?: ResultQuery): ResultPage;
|
|
57
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { CodeModule, JsonValue } from '../browser/flow-change.js';
|
|
2
|
-
export { currentEngineContract, findEngineContract, type EngineContract } from './engine-contract.js';
|
|
1
|
+
import type { CodeModule, ConnectorCapability, JsonValue } from '../browser/flow-change.js';
|
|
2
|
+
export { currentEngineContract, nodejsEngineContract, findEngineContract, type EngineContract } from './engine-contract.js';
|
|
3
3
|
export type RuntimeModule = Pick<CodeModule, 'imports' | 'source'>;
|
|
4
|
+
export declare const nodejsRuntimeConformanceCases: readonly RuntimeConformanceCase[];
|
|
4
5
|
export interface RuntimeProgram {
|
|
5
6
|
readonly engineContract: string;
|
|
6
7
|
readonly engineDigest: string;
|
|
@@ -8,6 +9,7 @@ export interface RuntimeProgram {
|
|
|
8
9
|
readonly modules: Readonly<Record<string, RuntimeModule>>;
|
|
9
10
|
}
|
|
10
11
|
export interface RuntimeCapabilityCall {
|
|
12
|
+
readonly callId: string;
|
|
11
13
|
readonly invocationId: string;
|
|
12
14
|
readonly kind: string;
|
|
13
15
|
readonly payload: JsonValue;
|
|
@@ -35,7 +37,32 @@ export type LlmTaskResult = {
|
|
|
35
37
|
readonly version: 1;
|
|
36
38
|
};
|
|
37
39
|
export type InvokeLlmTask = (invocation: LlmTaskInvocation) => Promise<LlmTaskResult>;
|
|
40
|
+
export interface AgentCheckpoint {
|
|
41
|
+
readonly state: JsonValue;
|
|
42
|
+
readonly callId: string;
|
|
43
|
+
readonly toolId: string;
|
|
44
|
+
readonly input: Readonly<Record<string, JsonValue>>;
|
|
45
|
+
readonly rounds: number;
|
|
46
|
+
readonly version: 1;
|
|
47
|
+
}
|
|
48
|
+
export type AgentResult = {
|
|
49
|
+
readonly kind: 'completed';
|
|
50
|
+
readonly output: JsonValue;
|
|
51
|
+
} | {
|
|
52
|
+
readonly kind: 'suspended';
|
|
53
|
+
readonly checkpoint: AgentCheckpoint;
|
|
54
|
+
};
|
|
55
|
+
export interface AgentInvocation {
|
|
56
|
+
readonly input: Readonly<Record<string, JsonValue>>;
|
|
57
|
+
readonly invocationId: string;
|
|
58
|
+
readonly signal: AbortSignal;
|
|
59
|
+
readonly resume?: {
|
|
60
|
+
readonly action: 'approve' | 'reject';
|
|
61
|
+
readonly checkpoint: AgentCheckpoint;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
38
64
|
export interface RuntimeInvocation {
|
|
65
|
+
readonly capabilities?: readonly ConnectorCapability[];
|
|
39
66
|
readonly capability: (call: RuntimeCapabilityCall) => Promise<RuntimeCapabilityResponse>;
|
|
40
67
|
readonly input: JsonValue;
|
|
41
68
|
readonly invocationId: string;
|
|
@@ -44,10 +71,16 @@ export interface RuntimeInvocation {
|
|
|
44
71
|
}
|
|
45
72
|
export interface RuntimeHarness {
|
|
46
73
|
readonly engineDigest: string;
|
|
47
|
-
invoke(invocation: RuntimeInvocation): Promise<JsonValue>;
|
|
74
|
+
invoke(invocation: RuntimeInvocation): Promise<JsonValue | undefined>;
|
|
48
75
|
}
|
|
49
76
|
export interface RuntimeConformanceCase {
|
|
50
77
|
readonly name: string;
|
|
51
78
|
verify(harness: RuntimeHarness): Promise<void>;
|
|
52
79
|
}
|
|
53
80
|
export declare const runtimeConformanceCases: readonly RuntimeConformanceCase[];
|
|
81
|
+
export declare function createActions(declarations: readonly ConnectorCapability[], invoke: (payload: JsonValue) => Promise<RuntimeCapabilityResponse>): Readonly<Record<string, unknown>>;
|
|
82
|
+
export declare function resolveAction(declarations: readonly ConnectorCapability[], payload: unknown): {
|
|
83
|
+
readonly action: string;
|
|
84
|
+
readonly connectionId?: string;
|
|
85
|
+
readonly input: Readonly<Record<string, JsonValue>>;
|
|
86
|
+
};
|