@abyss-project/runtime 1.0.0 → 2.0.0
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/README.md +6 -3
- package/dist/cost/execution-cost.d.ts +45 -0
- package/dist/cost/execution-cost.js +114 -0
- package/dist/cost/execution-cost.js.map +1 -0
- package/dist/definition/definition.limits.d.ts +4 -0
- package/dist/definition/definition.limits.js +8 -0
- package/dist/definition/definition.limits.js.map +1 -0
- package/dist/definition/definition.schema.d.ts +2 -2
- package/dist/definition/definition.schema.js +20 -4
- package/dist/definition/definition.schema.js.map +1 -1
- package/dist/definition/definition.types.d.ts +20 -1
- package/dist/definition/definition.types.js +9 -1
- package/dist/definition/definition.types.js.map +1 -1
- package/dist/engine/engine-entry.d.ts +1 -0
- package/dist/engine/engine-entry.js +6 -0
- package/dist/engine/engine-entry.js.map +1 -0
- package/dist/engine/engine-global.d.ts +1 -0
- package/dist/engine/engine-global.js +5 -0
- package/dist/engine/engine-global.js.map +1 -0
- package/dist/engine/engine-source.d.ts +2 -0
- package/dist/engine/engine-source.js +3 -0
- package/dist/engine/run-in-isolate.d.ts +34 -0
- package/dist/engine/run-in-isolate.js +267 -0
- package/dist/engine/run-in-isolate.js.map +1 -0
- package/dist/errors/runtime-error-code.enum.d.ts +2 -2
- package/dist/errors/runtime-error-code.enum.js +1 -1
- package/dist/errors/runtime-error-code.enum.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/interpreter/interpreter.d.ts +27 -1
- package/dist/interpreter/interpreter.js +114 -42
- package/dist/interpreter/interpreter.js.map +1 -1
- package/dist/interpreter/interpreter.types.d.ts +35 -4
- package/dist/interpreter/interpreter.types.js +7 -1
- package/dist/interpreter/interpreter.types.js.map +1 -1
- package/dist/interpreter/test-host.d.ts +4 -2
- package/dist/interpreter/test-host.js +6 -0
- package/dist/interpreter/test-host.js.map +1 -1
- package/dist/runner-protocol/evaluation.types.d.ts +20 -0
- package/dist/runner-protocol/evaluation.types.js +10 -0
- package/dist/runner-protocol/evaluation.types.js.map +1 -0
- package/dist/runner-protocol/execution-protocol.types.d.ts +132 -0
- package/dist/runner-protocol/execution-protocol.types.js +48 -0
- package/dist/runner-protocol/execution-protocol.types.js.map +1 -0
- package/dist/server/code-runner-session.d.ts +28 -0
- package/dist/server/code-runner-session.js +208 -0
- package/dist/server/code-runner-session.js.map +1 -0
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +5 -3
- package/dist/server/index.js.map +1 -1
- package/dist/steps/execute-step.d.ts +12 -2
- package/dist/steps/execute-step.js +37 -0
- package/dist/steps/execute-step.js.map +1 -1
- package/dist/steps/global-references.d.ts +2 -0
- package/dist/steps/global-references.js +28 -0
- package/dist/steps/global-references.js.map +1 -0
- package/dist/steps/step-fields.d.ts +1 -1
- package/dist/steps/step-fields.js +10 -2
- package/dist/steps/step-fields.js.map +1 -1
- package/dist/steps/value-source.d.ts +1 -1
- package/dist/steps/value-source.js +3 -3
- package/dist/steps/value-source.js.map +1 -1
- package/package.json +10 -2
- package/scripts/build-engine.cjs +70 -0
- package/src/__tests__/engine-bundle.test.ts +121 -0
- package/src/cost/__tests__/execution-cost.test.ts +200 -0
- package/src/cost/execution-cost.ts +192 -0
- package/src/definition/__tests__/validate-definition.test.ts +354 -303
- package/src/definition/definition.limits.ts +9 -0
- package/src/definition/definition.schema.ts +172 -139
- package/src/definition/definition.types.ts +171 -143
- package/src/engine/__tests__/run-in-isolate.test.ts +468 -0
- package/src/engine/engine-entry.ts +3 -0
- package/src/engine/engine-global.ts +2 -0
- package/src/engine/run-in-isolate.ts +404 -0
- package/src/errors/runtime-error-code.enum.ts +37 -37
- package/src/index.ts +30 -18
- package/src/interpreter/__tests__/interpreter.test.ts +854 -854
- package/src/interpreter/__tests__/log-respond-resume.test.ts +223 -0
- package/src/interpreter/interpreter.ts +461 -342
- package/src/interpreter/interpreter.types.ts +192 -140
- package/src/interpreter/test-host.ts +85 -74
- package/src/runner-protocol/evaluation.types.ts +21 -0
- package/src/runner-protocol/execution-protocol.types.ts +221 -0
- package/src/server/__tests__/code-runner-session.test.ts +311 -0
- package/src/server/code-runner-error.ts +12 -12
- package/src/server/code-runner-session.ts +310 -0
- package/src/server/index.ts +11 -4
- package/src/steps/__tests__/global-references.test.ts +113 -0
- package/src/steps/execute-step.ts +186 -132
- package/src/steps/global-references.ts +48 -0
- package/src/steps/step-access.ts +56 -56
- package/src/steps/step-fields.ts +87 -79
- package/src/steps/value-source.ts +69 -69
- package/dist/runner-protocol/runner-protocol.types.d.ts +0 -92
- package/dist/runner-protocol/runner-protocol.types.js +0 -26
- package/dist/runner-protocol/runner-protocol.types.js.map +0 -1
- package/dist/server/code-runner-client.d.ts +0 -13
- package/dist/server/code-runner-client.js +0 -155
- package/dist/server/code-runner-client.js.map +0 -1
- package/src/runner-protocol/runner-protocol.types.ts +0 -117
- package/src/server/__tests__/code-runner-client.test.ts +0 -262
- package/src/server/code-runner-client.ts +0 -201
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runInIsolate = exports.EngineResultKind = void 0;
|
|
4
|
+
const runtime_error_code_enum_1 = require("../errors/runtime-error-code.enum");
|
|
5
|
+
const access_types_1 = require("../access/access.types");
|
|
6
|
+
const definition_limits_1 = require("../definition/definition.limits");
|
|
7
|
+
const interpreter_error_1 = require("../interpreter/interpreter-error");
|
|
8
|
+
const interpreter_1 = require("../interpreter/interpreter");
|
|
9
|
+
const interpreter_types_1 = require("../interpreter/interpreter.types");
|
|
10
|
+
const definition_types_1 = require("../definition/definition.types");
|
|
11
|
+
const step_access_1 = require("../steps/step-access");
|
|
12
|
+
const execution_protocol_types_1 = require("../runner-protocol/execution-protocol.types");
|
|
13
|
+
var EngineResultKind;
|
|
14
|
+
(function (EngineResultKind) {
|
|
15
|
+
EngineResultKind["FINISHED"] = "FINISHED";
|
|
16
|
+
EngineResultKind["REJECTED"] = "REJECTED";
|
|
17
|
+
})(EngineResultKind || (exports.EngineResultKind = EngineResultKind = {}));
|
|
18
|
+
const RUNTIME_ERROR_CODES = new Set(Object.values(runtime_error_code_enum_1.RuntimeErrorCode));
|
|
19
|
+
const rejected = (code, message) => ({
|
|
20
|
+
kind: EngineResultKind.REJECTED,
|
|
21
|
+
code,
|
|
22
|
+
message,
|
|
23
|
+
});
|
|
24
|
+
const finished = (outcome) => ({
|
|
25
|
+
kind: EngineResultKind.FINISHED,
|
|
26
|
+
outcome,
|
|
27
|
+
});
|
|
28
|
+
const isolatePolicy = (request) => {
|
|
29
|
+
const exposed = new Set(request.capabilities);
|
|
30
|
+
const declared = (action) => request.definition.accesses.some((access) => access.kind === access_types_1.AccessKind.HOST_ACTION && access.action === action);
|
|
31
|
+
return {
|
|
32
|
+
budget: { ...request.budget, maxWaitMs: definition_limits_1.MAX_WAIT_DURATION_MS },
|
|
33
|
+
httpAccess: () => exposed.has(execution_protocol_types_1.CoreCapability.HTTP_FETCH) ? step_access_1.AccessVerdict.ALLOWED : step_access_1.AccessVerdict.NOT_GRANTED,
|
|
34
|
+
hostActionAccess: (action) => {
|
|
35
|
+
if (!declared(action)) {
|
|
36
|
+
return step_access_1.AccessVerdict.NOT_DECLARED;
|
|
37
|
+
}
|
|
38
|
+
return exposed.has(action) ? step_access_1.AccessVerdict.ALLOWED : step_access_1.AccessVerdict.NOT_GRANTED;
|
|
39
|
+
},
|
|
40
|
+
hostInput: (_action, input) => ({ input }),
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const outputPreview = (output) => {
|
|
44
|
+
let json;
|
|
45
|
+
try {
|
|
46
|
+
json = JSON.stringify(output);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return { outputTruncated: true };
|
|
50
|
+
}
|
|
51
|
+
if (json === undefined) {
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
if (json.length <= execution_protocol_types_1.MAX_PROGRESS_OUTPUT_CHARS) {
|
|
55
|
+
return { output };
|
|
56
|
+
}
|
|
57
|
+
return { output: json.slice(0, execution_protocol_types_1.MAX_PROGRESS_OUTPUT_CHARS), outputTruncated: true };
|
|
58
|
+
};
|
|
59
|
+
const progressObserver = (host) => {
|
|
60
|
+
const startedAt = new Map();
|
|
61
|
+
const durationOf = (stepId) => {
|
|
62
|
+
const start = startedAt.get(stepId);
|
|
63
|
+
startedAt.delete(stepId);
|
|
64
|
+
return start === undefined ? 0 : Math.max(0, host.now() - start);
|
|
65
|
+
};
|
|
66
|
+
const observer = {
|
|
67
|
+
stepStarted: (stepId) => {
|
|
68
|
+
startedAt.set(stepId, host.now());
|
|
69
|
+
host.onProgress({ stepId, phase: execution_protocol_types_1.StepPhase.STARTED });
|
|
70
|
+
},
|
|
71
|
+
stepFinished: (stepId, finish) => {
|
|
72
|
+
const durationMs = durationOf(stepId);
|
|
73
|
+
host.onProgress(finish.ok
|
|
74
|
+
? {
|
|
75
|
+
stepId,
|
|
76
|
+
phase: execution_protocol_types_1.StepPhase.FINISHED,
|
|
77
|
+
status: execution_protocol_types_1.StepStatus.SUCCEEDED,
|
|
78
|
+
durationMs,
|
|
79
|
+
...outputPreview(finish.output),
|
|
80
|
+
}
|
|
81
|
+
: {
|
|
82
|
+
stepId,
|
|
83
|
+
phase: execution_protocol_types_1.StepPhase.FINISHED,
|
|
84
|
+
status: execution_protocol_types_1.StepStatus.FAILED,
|
|
85
|
+
durationMs,
|
|
86
|
+
errorCode: finish.error.code,
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
const suspended = (stepId) => host.onProgress({
|
|
91
|
+
stepId,
|
|
92
|
+
phase: execution_protocol_types_1.StepPhase.FINISHED,
|
|
93
|
+
status: execution_protocol_types_1.StepStatus.SUSPENDED,
|
|
94
|
+
durationMs: durationOf(stepId),
|
|
95
|
+
});
|
|
96
|
+
return { observer, suspended };
|
|
97
|
+
};
|
|
98
|
+
const callOf = (effect) => {
|
|
99
|
+
switch (effect.type) {
|
|
100
|
+
case interpreter_types_1.EffectType.HTTP:
|
|
101
|
+
return { capability: execution_protocol_types_1.CoreCapability.HTTP_FETCH, args: effect.request };
|
|
102
|
+
case interpreter_types_1.EffectType.HOST:
|
|
103
|
+
return { capability: effect.action, args: effect.input };
|
|
104
|
+
case interpreter_types_1.EffectType.WAIT:
|
|
105
|
+
return {
|
|
106
|
+
capability: execution_protocol_types_1.CoreCapability.WAIT,
|
|
107
|
+
args: effect.durationMs !== undefined
|
|
108
|
+
? { durationMs: effect.durationMs }
|
|
109
|
+
: { until: effect.until },
|
|
110
|
+
};
|
|
111
|
+
case interpreter_types_1.EffectType.LOG: {
|
|
112
|
+
const args = { level: effect.level, message: effect.message };
|
|
113
|
+
if ('data' in effect) {
|
|
114
|
+
args.data = effect.data;
|
|
115
|
+
}
|
|
116
|
+
return { capability: execution_protocol_types_1.CoreCapability.LOG_WRITE, args };
|
|
117
|
+
}
|
|
118
|
+
case interpreter_types_1.EffectType.RESPOND:
|
|
119
|
+
return { capability: execution_protocol_types_1.CoreCapability.HTTP_RESPOND, args: effect.response };
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const completionOf = (effect, value) => {
|
|
123
|
+
switch (effect.type) {
|
|
124
|
+
case interpreter_types_1.EffectType.HTTP:
|
|
125
|
+
return { type: interpreter_types_1.RunEventType.HTTP_COMPLETED, response: value };
|
|
126
|
+
case interpreter_types_1.EffectType.HOST:
|
|
127
|
+
return { type: interpreter_types_1.RunEventType.HOST_COMPLETED, output: value };
|
|
128
|
+
case interpreter_types_1.EffectType.WAIT:
|
|
129
|
+
return { type: interpreter_types_1.RunEventType.WAIT_ELAPSED };
|
|
130
|
+
case interpreter_types_1.EffectType.LOG:
|
|
131
|
+
return { type: interpreter_types_1.RunEventType.LOG_WRITTEN };
|
|
132
|
+
case interpreter_types_1.EffectType.RESPOND:
|
|
133
|
+
return { type: interpreter_types_1.RunEventType.RESPONSE_SENT };
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const callFailure = (effect, error) => {
|
|
137
|
+
const fallback = effect.type === interpreter_types_1.EffectType.HTTP ? runtime_error_code_enum_1.RuntimeErrorCode.HTTP_ERROR : runtime_error_code_enum_1.RuntimeErrorCode.HOST_ERROR;
|
|
138
|
+
const detail = {
|
|
139
|
+
code: error.code !== undefined && RUNTIME_ERROR_CODES.has(error.code) ? error.code : fallback,
|
|
140
|
+
message: error.message,
|
|
141
|
+
};
|
|
142
|
+
return { type: interpreter_types_1.RunEventType.EFFECT_FAILED, error: detail };
|
|
143
|
+
};
|
|
144
|
+
const waitsAboveThreshold = (effect, request, now) => {
|
|
145
|
+
const threshold = request.suspendWaitAboveMs;
|
|
146
|
+
if (threshold === undefined) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
if (effect.durationMs !== undefined) {
|
|
150
|
+
return effect.durationMs > threshold;
|
|
151
|
+
}
|
|
152
|
+
return effect.until !== undefined && Date.parse(effect.until) - now > threshold;
|
|
153
|
+
};
|
|
154
|
+
const outcomeOf = (state) => {
|
|
155
|
+
const outcome = state.outcome;
|
|
156
|
+
if (state.status === interpreter_types_1.RunStatus.SUCCEEDED) {
|
|
157
|
+
return outcome?.output === undefined
|
|
158
|
+
? { status: execution_protocol_types_1.ExecutionStatus.SUCCEEDED }
|
|
159
|
+
: { status: execution_protocol_types_1.ExecutionStatus.SUCCEEDED, output: outcome.output };
|
|
160
|
+
}
|
|
161
|
+
if (outcome?.error) {
|
|
162
|
+
const failure = {
|
|
163
|
+
status: execution_protocol_types_1.ExecutionStatus.FAILED,
|
|
164
|
+
errorCode: outcome.error.code,
|
|
165
|
+
errorMessage: outcome.error.message,
|
|
166
|
+
};
|
|
167
|
+
if (outcome.error.stepId !== undefined) {
|
|
168
|
+
failure.stepId = outcome.error.stepId;
|
|
169
|
+
}
|
|
170
|
+
return failure;
|
|
171
|
+
}
|
|
172
|
+
return outcome?.status === definition_types_1.StopStatus.FAILED && outcome.output !== undefined
|
|
173
|
+
? { status: execution_protocol_types_1.ExecutionStatus.FAILED, output: outcome.output }
|
|
174
|
+
: { status: execution_protocol_types_1.ExecutionStatus.FAILED };
|
|
175
|
+
};
|
|
176
|
+
const resumeRefusal = (state) => {
|
|
177
|
+
if (state.stateVersion !== interpreter_types_1.CURRENT_STATE_VERSION) {
|
|
178
|
+
return rejected(runtime_error_code_enum_1.RuntimeErrorCode.STATE_VERSION_UNSUPPORTED, `Run state version ${String(state.stateVersion)} is not supported ` +
|
|
179
|
+
`(this core reads version ${interpreter_types_1.CURRENT_STATE_VERSION})`);
|
|
180
|
+
}
|
|
181
|
+
if (state.status !== interpreter_types_1.RunStatus.WAITING || !state.pending) {
|
|
182
|
+
return rejected(runtime_error_code_enum_1.RuntimeErrorCode.INVALID_REQUEST, 'The state to resume is not suspended');
|
|
183
|
+
}
|
|
184
|
+
if (state.pending.type === interpreter_types_1.EffectType.EVALUATE) {
|
|
185
|
+
return rejected(runtime_error_code_enum_1.RuntimeErrorCode.INVALID_REQUEST, 'The state to resume waits for an evaluation, which never suspends');
|
|
186
|
+
}
|
|
187
|
+
return null;
|
|
188
|
+
};
|
|
189
|
+
const runInIsolate = async (request, host) => {
|
|
190
|
+
const { definition, state } = request;
|
|
191
|
+
if (state !== undefined) {
|
|
192
|
+
const refusal = resumeRefusal(state);
|
|
193
|
+
if (refusal) {
|
|
194
|
+
return refusal;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const policy = isolatePolicy(request);
|
|
198
|
+
const exposed = new Set(request.capabilities);
|
|
199
|
+
const progress = progressObserver(host);
|
|
200
|
+
const suspend = (stepId, suspendedState) => {
|
|
201
|
+
progress.suspended(stepId);
|
|
202
|
+
return finished({ status: execution_protocol_types_1.ExecutionStatus.SUSPENDED, state: suspendedState });
|
|
203
|
+
};
|
|
204
|
+
try {
|
|
205
|
+
let result;
|
|
206
|
+
if (state === undefined) {
|
|
207
|
+
result = (0, interpreter_1.startRun)(definition, request.input, policy, progress.observer);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
progress.observer.stepStarted(state.pending.stepId);
|
|
211
|
+
result = (0, interpreter_1.stepRun)(definition, state, { type: interpreter_types_1.RunEventType.RESUMED, output: request.resumeInput ?? null }, policy, progress.observer);
|
|
212
|
+
}
|
|
213
|
+
while (result.status === interpreter_types_1.RunStatus.WAITING) {
|
|
214
|
+
const effect = result.state.pending;
|
|
215
|
+
if (!effect) {
|
|
216
|
+
throw new interpreter_error_1.InterpreterError(runtime_error_code_enum_1.RuntimeErrorCode.INVALID_REQUEST, 'Run waits for no effect');
|
|
217
|
+
}
|
|
218
|
+
let event;
|
|
219
|
+
if (effect.type === interpreter_types_1.EffectType.EVALUATE) {
|
|
220
|
+
const results = await host.evaluate(effect.items, effect.context, effect.stepId, request.globals);
|
|
221
|
+
event = { type: interpreter_types_1.RunEventType.EVALUATED, results };
|
|
222
|
+
}
|
|
223
|
+
else if (effect.type === interpreter_types_1.EffectType.WAIT &&
|
|
224
|
+
waitsAboveThreshold(effect, request, host.now())) {
|
|
225
|
+
return suspend(effect.stepId, result.state);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
const { capability, args } = callOf(effect);
|
|
229
|
+
if (!exposed.has(capability)) {
|
|
230
|
+
event = {
|
|
231
|
+
type: interpreter_types_1.RunEventType.EFFECT_FAILED,
|
|
232
|
+
error: {
|
|
233
|
+
code: runtime_error_code_enum_1.RuntimeErrorCode.ACCESS_DENIED,
|
|
234
|
+
message: `Capability "${capability}" is not granted to the execution`,
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
const answer = await host.callHost(effect.stepId, capability, args);
|
|
240
|
+
if (!answer.ok) {
|
|
241
|
+
event = callFailure(effect, answer.error);
|
|
242
|
+
}
|
|
243
|
+
else if ('suspend' in answer) {
|
|
244
|
+
return suspend(effect.stepId, result.state);
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
event = completionOf(effect, answer.value);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
result = (0, interpreter_1.stepRun)(definition, result.state, event, policy, progress.observer);
|
|
252
|
+
}
|
|
253
|
+
return finished(outcomeOf(result.state));
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
if (error instanceof interpreter_error_1.InterpreterError) {
|
|
257
|
+
return finished({
|
|
258
|
+
status: execution_protocol_types_1.ExecutionStatus.FAILED,
|
|
259
|
+
errorCode: error.code,
|
|
260
|
+
errorMessage: error.message,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
throw error;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
exports.runInIsolate = runInIsolate;
|
|
267
|
+
//# sourceMappingURL=run-in-isolate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-in-isolate.js","sourceRoot":"","sources":["../../src/engine/run-in-isolate.ts"],"names":[],"mappings":";;;AAUA,+EAAqE;AAErE,yDAAoD;AACpD,uEAAuE;AACvE,wEAAoE;AACpE,4DAA+D;AAE/D,wEAK0C;AAU1C,qEAA4D;AAC5D,sDAAqD;AAErD,0FAMqD;AAkDrD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,yCAAqB,CAAA;IACrB,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAMD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS,MAAM,CAAC,MAAM,CAAC,0CAAgB,CAAC,CAAC,CAAC;AAE7E,MAAM,QAAQ,GAAG,CAAC,IAA4B,EAAE,OAAe,EAAgB,EAAE,CAAC,CAAC;IACjF,IAAI,EAAE,gBAAgB,CAAC,QAAQ;IAC/B,IAAI;IACJ,OAAO;CACR,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,CAAC,OAAyB,EAAgB,EAAE,CAAC,CAAC;IAC7D,IAAI,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;QACL,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAxFW,QAAA,YAAY,gBAwFvB"}
|
|
@@ -3,14 +3,14 @@ export declare enum RuntimeErrorCode {
|
|
|
3
3
|
CODE_ERROR = "CODE_ERROR",
|
|
4
4
|
TIMEOUT = "TIMEOUT",
|
|
5
5
|
MEMORY_LIMIT = "MEMORY_LIMIT",
|
|
6
|
-
HOST_FUNCTION_ERROR = "HOST_FUNCTION_ERROR",
|
|
7
6
|
ACCESS_DENIED = "ACCESS_DENIED",
|
|
8
7
|
BUDGET_EXCEEDED = "BUDGET_EXCEEDED",
|
|
9
8
|
HOST_ERROR = "HOST_ERROR",
|
|
10
9
|
HTTP_ERROR = "HTTP_ERROR",
|
|
11
10
|
RUNNER_UNAVAILABLE = "RUNNER_UNAVAILABLE",
|
|
12
11
|
RUNNER_SATURATED = "RUNNER_SATURATED",
|
|
13
|
-
INVALID_REQUEST = "INVALID_REQUEST"
|
|
12
|
+
INVALID_REQUEST = "INVALID_REQUEST",
|
|
13
|
+
STATE_VERSION_UNSUPPORTED = "STATE_VERSION_UNSUPPORTED"
|
|
14
14
|
}
|
|
15
15
|
export interface RuntimeErrorDetail {
|
|
16
16
|
code: RuntimeErrorCode;
|
|
@@ -7,7 +7,6 @@ var RuntimeErrorCode;
|
|
|
7
7
|
RuntimeErrorCode["CODE_ERROR"] = "CODE_ERROR";
|
|
8
8
|
RuntimeErrorCode["TIMEOUT"] = "TIMEOUT";
|
|
9
9
|
RuntimeErrorCode["MEMORY_LIMIT"] = "MEMORY_LIMIT";
|
|
10
|
-
RuntimeErrorCode["HOST_FUNCTION_ERROR"] = "HOST_FUNCTION_ERROR";
|
|
11
10
|
RuntimeErrorCode["ACCESS_DENIED"] = "ACCESS_DENIED";
|
|
12
11
|
RuntimeErrorCode["BUDGET_EXCEEDED"] = "BUDGET_EXCEEDED";
|
|
13
12
|
RuntimeErrorCode["HOST_ERROR"] = "HOST_ERROR";
|
|
@@ -15,5 +14,6 @@ var RuntimeErrorCode;
|
|
|
15
14
|
RuntimeErrorCode["RUNNER_UNAVAILABLE"] = "RUNNER_UNAVAILABLE";
|
|
16
15
|
RuntimeErrorCode["RUNNER_SATURATED"] = "RUNNER_SATURATED";
|
|
17
16
|
RuntimeErrorCode["INVALID_REQUEST"] = "INVALID_REQUEST";
|
|
17
|
+
RuntimeErrorCode["STATE_VERSION_UNSUPPORTED"] = "STATE_VERSION_UNSUPPORTED";
|
|
18
18
|
})(RuntimeErrorCode || (exports.RuntimeErrorCode = RuntimeErrorCode = {}));
|
|
19
19
|
//# sourceMappingURL=runtime-error-code.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-error-code.enum.js","sourceRoot":"","sources":["../../src/errors/runtime-error-code.enum.ts"],"names":[],"mappings":";;;AAKA,IAAY,gBAyBX;AAzBD,WAAY,gBAAgB;IAE1B,yDAAqC,CAAA;IAErC,6CAAyB,CAAA;IAEzB,uCAAmB,CAAA;IAEnB,iDAA6B,CAAA;IAE7B
|
|
1
|
+
{"version":3,"file":"runtime-error-code.enum.js","sourceRoot":"","sources":["../../src/errors/runtime-error-code.enum.ts"],"names":[],"mappings":";;;AAKA,IAAY,gBAyBX;AAzBD,WAAY,gBAAgB;IAE1B,yDAAqC,CAAA;IAErC,6CAAyB,CAAA;IAEzB,uCAAmB,CAAA;IAEnB,iDAA6B,CAAA;IAE7B,mDAA+B,CAAA;IAE/B,uDAAmC,CAAA;IAEnC,6CAAyB,CAAA;IAEzB,6CAAyB,CAAA;IAEzB,6DAAyC,CAAA;IAEzC,yDAAqC,CAAA;IAErC,uDAAmC,CAAA;IAEnC,2EAAuD,CAAA;AACzD,CAAC,EAzBW,gBAAgB,gCAAhB,gBAAgB,QAyB3B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { hostMatches } from './access/host-match';
|
|
|
4
4
|
export * from './definition/definition.types';
|
|
5
5
|
export { validateDefinition } from './definition/validate-definition';
|
|
6
6
|
export type { ValidationResult } from './definition/validate-definition';
|
|
7
|
-
export { MAX_WAIT_DURATION_MS } from './definition/definition.
|
|
7
|
+
export { MAX_WAIT_DURATION_MS } from './definition/definition.limits';
|
|
8
8
|
export { walkSteps } from './definition/walk-steps';
|
|
9
9
|
export type { StepVisitor } from './definition/walk-steps';
|
|
10
10
|
export * from './interpreter/interpreter.types';
|
|
@@ -12,4 +12,10 @@ export { start, step } from './interpreter/interpreter';
|
|
|
12
12
|
export { InterpreterError } from './interpreter/interpreter-error';
|
|
13
13
|
export { runToCompletion } from './interpreter/test-host';
|
|
14
14
|
export type { TestHostHandlers, TestRunResult } from './interpreter/test-host';
|
|
15
|
-
export * from './runner-protocol/
|
|
15
|
+
export * from './runner-protocol/evaluation.types';
|
|
16
|
+
export * from './runner-protocol/execution-protocol.types';
|
|
17
|
+
export { runInIsolate, EngineResultKind } from './engine/run-in-isolate';
|
|
18
|
+
export type { EngineHost, EngineProgress, EngineRequest, EngineResult, HostCallAnswer, } from './engine/run-in-isolate';
|
|
19
|
+
export { ENGINE_GLOBAL_NAME } from './engine/engine-global';
|
|
20
|
+
export { collectGlobalReferences } from './steps/global-references';
|
|
21
|
+
export * from './cost/execution-cost';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.runToCompletion = exports.InterpreterError = exports.step = exports.start = exports.walkSteps = exports.MAX_WAIT_DURATION_MS = exports.validateDefinition = exports.hostMatches = void 0;
|
|
17
|
+
exports.collectGlobalReferences = exports.ENGINE_GLOBAL_NAME = exports.EngineResultKind = exports.runInIsolate = exports.runToCompletion = exports.InterpreterError = exports.step = exports.start = exports.walkSteps = exports.MAX_WAIT_DURATION_MS = exports.validateDefinition = exports.hostMatches = void 0;
|
|
18
18
|
__exportStar(require("./errors/runtime-error-code.enum"), exports);
|
|
19
19
|
__exportStar(require("./access/access.types"), exports);
|
|
20
20
|
var host_match_1 = require("./access/host-match");
|
|
@@ -22,8 +22,8 @@ Object.defineProperty(exports, "hostMatches", { enumerable: true, get: function
|
|
|
22
22
|
__exportStar(require("./definition/definition.types"), exports);
|
|
23
23
|
var validate_definition_1 = require("./definition/validate-definition");
|
|
24
24
|
Object.defineProperty(exports, "validateDefinition", { enumerable: true, get: function () { return validate_definition_1.validateDefinition; } });
|
|
25
|
-
var
|
|
26
|
-
Object.defineProperty(exports, "MAX_WAIT_DURATION_MS", { enumerable: true, get: function () { return
|
|
25
|
+
var definition_limits_1 = require("./definition/definition.limits");
|
|
26
|
+
Object.defineProperty(exports, "MAX_WAIT_DURATION_MS", { enumerable: true, get: function () { return definition_limits_1.MAX_WAIT_DURATION_MS; } });
|
|
27
27
|
var walk_steps_1 = require("./definition/walk-steps");
|
|
28
28
|
Object.defineProperty(exports, "walkSteps", { enumerable: true, get: function () { return walk_steps_1.walkSteps; } });
|
|
29
29
|
__exportStar(require("./interpreter/interpreter.types"), exports);
|
|
@@ -34,5 +34,14 @@ var interpreter_error_1 = require("./interpreter/interpreter-error");
|
|
|
34
34
|
Object.defineProperty(exports, "InterpreterError", { enumerable: true, get: function () { return interpreter_error_1.InterpreterError; } });
|
|
35
35
|
var test_host_1 = require("./interpreter/test-host");
|
|
36
36
|
Object.defineProperty(exports, "runToCompletion", { enumerable: true, get: function () { return test_host_1.runToCompletion; } });
|
|
37
|
-
__exportStar(require("./runner-protocol/
|
|
37
|
+
__exportStar(require("./runner-protocol/evaluation.types"), exports);
|
|
38
|
+
__exportStar(require("./runner-protocol/execution-protocol.types"), exports);
|
|
39
|
+
var run_in_isolate_1 = require("./engine/run-in-isolate");
|
|
40
|
+
Object.defineProperty(exports, "runInIsolate", { enumerable: true, get: function () { return run_in_isolate_1.runInIsolate; } });
|
|
41
|
+
Object.defineProperty(exports, "EngineResultKind", { enumerable: true, get: function () { return run_in_isolate_1.EngineResultKind; } });
|
|
42
|
+
var engine_global_1 = require("./engine/engine-global");
|
|
43
|
+
Object.defineProperty(exports, "ENGINE_GLOBAL_NAME", { enumerable: true, get: function () { return engine_global_1.ENGINE_GLOBAL_NAME; } });
|
|
44
|
+
var global_references_1 = require("./steps/global-references");
|
|
45
|
+
Object.defineProperty(exports, "collectGlobalReferences", { enumerable: true, get: function () { return global_references_1.collectGlobalReferences; } });
|
|
46
|
+
__exportStar(require("./cost/execution-cost"), exports);
|
|
38
47
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGA,mEAAiD;AACjD,wDAAsC;AACtC,kDAAkD;AAAzC,yGAAA,WAAW,OAAA;AACpB,gEAA8C;AAC9C,wEAAsE;AAA7D,yHAAA,kBAAkB,OAAA;AAE3B,oEAAsE;AAA7D,yHAAA,oBAAoB,OAAA;AAC7B,sDAAoD;AAA3C,uGAAA,SAAS,OAAA;AAElB,kEAAgD;AAChD,yDAAwD;AAA/C,oGAAA,KAAK,OAAA;AAAE,mGAAA,IAAI,OAAA;AACpB,qEAAmE;AAA1D,qHAAA,gBAAgB,OAAA;AACzB,qDAA0D;AAAjD,4GAAA,eAAe,OAAA;AAExB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGA,mEAAiD;AACjD,wDAAsC;AACtC,kDAAkD;AAAzC,yGAAA,WAAW,OAAA;AACpB,gEAA8C;AAC9C,wEAAsE;AAA7D,yHAAA,kBAAkB,OAAA;AAE3B,oEAAsE;AAA7D,yHAAA,oBAAoB,OAAA;AAC7B,sDAAoD;AAA3C,uGAAA,SAAS,OAAA;AAElB,kEAAgD;AAChD,yDAAwD;AAA/C,oGAAA,KAAK,OAAA;AAAE,mGAAA,IAAI,OAAA;AACpB,qEAAmE;AAA1D,qHAAA,gBAAgB,OAAA;AACzB,qDAA0D;AAAjD,4GAAA,eAAe,OAAA;AAExB,qEAAmD;AACnD,6EAA2D;AAC3D,0DAAyE;AAAhE,8GAAA,YAAY,OAAA;AAAE,kHAAA,gBAAgB,OAAA;AAQvC,wDAA4D;AAAnD,mHAAA,kBAAkB,OAAA;AAC3B,+DAAoE;AAA3D,4HAAA,uBAAuB,OAAA;AAChC,wDAAsC"}
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
+
import type { RuntimeErrorDetail } from '../errors/runtime-error-code.enum';
|
|
1
2
|
import type { RuntimeDefinition } from '../definition/definition.types';
|
|
2
|
-
import
|
|
3
|
+
import { AccessVerdict } from '../steps/step-access';
|
|
4
|
+
import type { RunBudget, RunEvent, RunOptions, RunState, StepResult } from './interpreter.types';
|
|
5
|
+
export type HostInputCheck = {
|
|
6
|
+
input: Record<string, unknown>;
|
|
7
|
+
} | {
|
|
8
|
+
error: RuntimeErrorDetail;
|
|
9
|
+
};
|
|
10
|
+
export interface RunPolicy {
|
|
11
|
+
budget: RunBudget;
|
|
12
|
+
httpAccess: (url: string) => AccessVerdict;
|
|
13
|
+
hostActionAccess: (action: string) => AccessVerdict;
|
|
14
|
+
hostInput: (action: string, input: Record<string, unknown>) => HostInputCheck;
|
|
15
|
+
}
|
|
16
|
+
export type StepFinish = {
|
|
17
|
+
ok: true;
|
|
18
|
+
output: unknown;
|
|
19
|
+
} | {
|
|
20
|
+
ok: false;
|
|
21
|
+
error: RuntimeErrorDetail;
|
|
22
|
+
};
|
|
23
|
+
export interface StepObserver {
|
|
24
|
+
stepStarted: (stepId: string) => void;
|
|
25
|
+
stepFinished: (stepId: string, finish: StepFinish) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const startRun: (definition: RuntimeDefinition, input: unknown, policy: RunPolicy, observer?: StepObserver) => StepResult;
|
|
3
28
|
export declare const start: (definition: RuntimeDefinition, input: unknown, options: RunOptions) => StepResult;
|
|
29
|
+
export declare const stepRun: (definition: RuntimeDefinition, state: RunState, event: RunEvent, policy: RunPolicy, observer?: StepObserver) => StepResult;
|
|
4
30
|
export declare const step: (definition: RuntimeDefinition, state: RunState, event: RunEvent, options: RunOptions) => StepResult;
|