@rowan-agent/agent 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +19 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3947,6 +3947,12 @@ var AgentRuntime = class _AgentRuntime {
|
|
|
3947
3947
|
});
|
|
3948
3948
|
void task;
|
|
3949
3949
|
}
|
|
3950
|
+
} catch (error) {
|
|
3951
|
+
if (error instanceof RuntimeError && error.code === "runtime_ownership_lost") {
|
|
3952
|
+
for (const execution of this.executions.values()) execution.controller.abort();
|
|
3953
|
+
return;
|
|
3954
|
+
}
|
|
3955
|
+
throw error;
|
|
3950
3956
|
} finally {
|
|
3951
3957
|
this.pumping = false;
|
|
3952
3958
|
}
|
|
@@ -3995,10 +4001,7 @@ var AgentRuntime = class _AgentRuntime {
|
|
|
3995
4001
|
const executionContext = projectModelContext({
|
|
3996
4002
|
context: {
|
|
3997
4003
|
...executionConfig.context,
|
|
3998
|
-
phases: executionConfig.context.phases
|
|
3999
|
-
phases: /* @__PURE__ */ new Map([[DEFAULT_PHASE_ID, createDefaultPhase()]]),
|
|
4000
|
-
entryPhaseId: DEFAULT_PHASE_ID
|
|
4001
|
-
}
|
|
4004
|
+
phases: normalizePhaseRegistry(executionConfig.context.phases)
|
|
4002
4005
|
},
|
|
4003
4006
|
messages: claim.history,
|
|
4004
4007
|
agentId: run.agentId,
|
|
@@ -4355,6 +4358,18 @@ function boundaryFromSnapshot(snapshot) {
|
|
|
4355
4358
|
function delay(ms) {
|
|
4356
4359
|
return new Promise((resolve6) => setTimeout(resolve6, ms));
|
|
4357
4360
|
}
|
|
4361
|
+
function normalizePhaseRegistry(registry) {
|
|
4362
|
+
if (registry?.phases.has(DEFAULT_PHASE_ID)) {
|
|
4363
|
+
throw new TypeError(`Configured Phase collides with Rowan built-in Phase "${DEFAULT_PHASE_ID}".`);
|
|
4364
|
+
}
|
|
4365
|
+
return {
|
|
4366
|
+
phases: new Map([
|
|
4367
|
+
[DEFAULT_PHASE_ID, createDefaultPhase()],
|
|
4368
|
+
...registry?.phases ?? []
|
|
4369
|
+
]),
|
|
4370
|
+
entryPhaseId: registry?.entryPhaseId ?? DEFAULT_PHASE_ID
|
|
4371
|
+
};
|
|
4372
|
+
}
|
|
4358
4373
|
function cursorSequence(cursor) {
|
|
4359
4374
|
return Number(String(cursor).split(":").at(-1) ?? 0);
|
|
4360
4375
|
}
|