@loopingai/core 0.4.0 → 0.5.1
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/a2a/agent-stub.d.ts +0 -1
- package/dist/a2a/agent-stub.js +0 -1
- package/dist/a2a/caller.d.ts +0 -1
- package/dist/a2a/caller.js +0 -1
- package/dist/a2a/card.d.ts +0 -1
- package/dist/a2a/card.js +0 -1
- package/dist/a2a/context.d.ts +0 -1
- package/dist/a2a/context.js +0 -1
- package/dist/a2a/executor.d.ts +0 -1
- package/dist/a2a/executor.js +0 -1
- package/dist/a2a/index.d.ts +0 -1
- package/dist/a2a/index.js +0 -1
- package/dist/a2a/notify.d.ts +0 -1
- package/dist/a2a/notify.js +0 -1
- package/dist/a2a/parts.d.ts +0 -1
- package/dist/a2a/parts.js +0 -1
- package/dist/a2a/push.d.ts +0 -1
- package/dist/a2a/push.js +0 -1
- package/dist/a2a/task-store.d.ts +0 -1
- package/dist/a2a/task-store.js +0 -1
- package/dist/a2a/task.d.ts +0 -1
- package/dist/a2a/task.js +0 -1
- package/dist/a2a/verify.d.ts +0 -1
- package/dist/a2a/verify.js +0 -1
- package/dist/agent/budget.d.ts +0 -1
- package/dist/agent/budget.js +0 -1
- package/dist/agent/control.d.ts +0 -1
- package/dist/agent/control.js +0 -1
- package/dist/agent/final-reply.d.ts +0 -1
- package/dist/agent/final-reply.js +0 -1
- package/dist/agent/history.d.ts +0 -1
- package/dist/agent/history.js +0 -1
- package/dist/agent/index.d.ts +0 -1
- package/dist/agent/index.js +0 -1
- package/dist/agent/inference.d.ts +0 -1
- package/dist/agent/inference.js +0 -1
- package/dist/agent/model.d.ts +0 -1
- package/dist/agent/model.js +0 -1
- package/dist/agent/session.d.ts +0 -1
- package/dist/agent/session.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/contract/index.d.ts +0 -1
- package/dist/contract/index.js +0 -1
- package/dist/contract/plugin.d.ts +0 -1
- package/dist/contract/plugin.js +0 -1
- package/dist/contract/recipe.d.ts +14 -3
- package/dist/contract/recipe.js +0 -1
- package/dist/contract/validation.d.ts +22 -19
- package/dist/contract/validation.js +19 -11
- package/dist/db/db.d.ts +0 -1
- package/dist/db/db.js +0 -1
- package/dist/db/index.d.ts +0 -1
- package/dist/db/index.js +0 -1
- package/dist/db/migrations/index.d.ts +0 -1
- package/dist/db/migrations/index.js +0 -1
- package/dist/db/models/subtasks.d.ts +0 -1
- package/dist/db/models/subtasks.js +0 -1
- package/dist/db/models/tasks.d.ts +0 -1
- package/dist/db/models/tasks.js +0 -1
- package/dist/db/schema.d.ts +0 -1
- package/dist/db/schema.js +0 -1
- package/dist/env.d.ts +0 -1
- package/dist/env.js +0 -1
- package/dist/host/agent.d.ts +3 -4
- package/dist/host/agent.js +3 -6
- package/dist/host/index.d.ts +0 -1
- package/dist/host/index.js +0 -1
- package/dist/host/plugin-host.d.ts +5 -10
- package/dist/host/plugin-host.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/platform.d.ts +0 -1
- package/dist/platform.js +0 -1
- package/dist/round/agent.d.ts +0 -1
- package/dist/round/agent.js +0 -1
- package/dist/round/index.d.ts +0 -1
- package/dist/round/index.js +0 -1
- package/dist/round/policy.d.ts +0 -1
- package/dist/round/policy.js +0 -1
- package/dist/round/subagent.d.ts +0 -1
- package/dist/round/subagent.js +0 -3
- package/dist/round/turn.d.ts +0 -1
- package/dist/round/turn.js +0 -1
- package/dist/round/workflow.d.ts +7 -2
- package/dist/round/workflow.js +22 -21
- package/dist/runtime/index.d.ts +0 -1
- package/dist/runtime/index.js +2 -7
- package/dist/runtime/tool-families.d.ts +0 -1
- package/dist/runtime/tool-families.js +0 -1
- package/dist/subagent/fingerprint.d.ts +0 -1
- package/dist/subagent/fingerprint.js +7 -3
- package/dist/subagent/index.d.ts +0 -1
- package/dist/subagent/index.js +0 -1
- package/dist/subagent/prompt.d.ts +0 -1
- package/dist/subagent/prompt.js +0 -1
- package/dist/subagent/run.d.ts +0 -1
- package/dist/subagent/run.js +0 -1
- package/dist/subagent/workspace.d.ts +0 -1
- package/dist/subagent/workspace.js +0 -1
- package/dist/subtasks/catalog.d.ts +0 -1
- package/dist/subtasks/catalog.js +0 -1
- package/dist/subtasks/decomposition.d.ts +0 -1
- package/dist/subtasks/decomposition.js +0 -1
- package/dist/subtasks/delegate.d.ts +0 -1
- package/dist/subtasks/delegate.js +0 -1
- package/dist/subtasks/index.d.ts +0 -1
- package/dist/subtasks/index.js +0 -1
- package/dist/subtasks/scheduler.d.ts +0 -1
- package/dist/subtasks/scheduler.js +0 -1
- package/dist/subtasks/subtask-types.d.ts +0 -1
- package/dist/subtasks/subtask-types.js +0 -1
- package/dist/subtasks/types.d.ts +0 -1
- package/dist/subtasks/types.js +0 -1
- package/dist/testing/auth.d.ts +0 -1
- package/dist/testing/auth.js +0 -1
- package/dist/testing/do.d.ts +0 -1
- package/dist/testing/do.js +0 -1
- package/dist/testing/fake-session.d.ts +0 -1
- package/dist/testing/fake-session.js +0 -1
- package/dist/testing/fixtures.d.ts +0 -1
- package/dist/testing/fixtures.js +0 -1
- package/dist/testing/harness.d.ts +0 -1
- package/dist/testing/harness.js +0 -1
- package/dist/testing/index.d.ts +0 -1
- package/dist/testing/index.js +0 -1
- package/dist/testing/mock-model.d.ts +0 -1
- package/dist/testing/mock-model.js +0 -1
- package/dist/testing/node.d.ts +0 -1
- package/dist/testing/node.js +0 -1
- package/dist/testing/vcr-global-setup.d.ts +0 -1
- package/dist/testing/vcr-global-setup.js +0 -1
- package/dist/testing/vcr-shared.d.ts +0 -1
- package/dist/testing/vcr-shared.js +0 -1
- package/dist/testing/vcr-spec.d.ts +0 -1
- package/dist/testing/vcr-spec.js +0 -1
- package/dist/testing/vcr-store.d.ts +0 -1
- package/dist/testing/vcr-store.js +0 -1
- package/dist/testing/vcr.d.ts +0 -1
- package/dist/testing/vcr.js +0 -1
- package/dist/worker/define-agent.d.ts +0 -1
- package/dist/worker/define-agent.js +0 -1
- package/dist/worker/index.d.ts +0 -1
- package/dist/worker/index.js +0 -1
- package/package.json +2 -2
- package/dist/a2a/agent-stub.d.ts.map +0 -1
- package/dist/a2a/agent-stub.js.map +0 -1
- package/dist/a2a/caller.d.ts.map +0 -1
- package/dist/a2a/caller.js.map +0 -1
- package/dist/a2a/card.d.ts.map +0 -1
- package/dist/a2a/card.js.map +0 -1
- package/dist/a2a/context.d.ts.map +0 -1
- package/dist/a2a/context.js.map +0 -1
- package/dist/a2a/executor.d.ts.map +0 -1
- package/dist/a2a/executor.js.map +0 -1
- package/dist/a2a/index.d.ts.map +0 -1
- package/dist/a2a/index.js.map +0 -1
- package/dist/a2a/notify.d.ts.map +0 -1
- package/dist/a2a/notify.js.map +0 -1
- package/dist/a2a/parts.d.ts.map +0 -1
- package/dist/a2a/parts.js.map +0 -1
- package/dist/a2a/push.d.ts.map +0 -1
- package/dist/a2a/push.js.map +0 -1
- package/dist/a2a/task-store.d.ts.map +0 -1
- package/dist/a2a/task-store.js.map +0 -1
- package/dist/a2a/task.d.ts.map +0 -1
- package/dist/a2a/task.js.map +0 -1
- package/dist/a2a/verify.d.ts.map +0 -1
- package/dist/a2a/verify.js.map +0 -1
- package/dist/agent/budget.d.ts.map +0 -1
- package/dist/agent/budget.js.map +0 -1
- package/dist/agent/control.d.ts.map +0 -1
- package/dist/agent/control.js.map +0 -1
- package/dist/agent/final-reply.d.ts.map +0 -1
- package/dist/agent/final-reply.js.map +0 -1
- package/dist/agent/history.d.ts.map +0 -1
- package/dist/agent/history.js.map +0 -1
- package/dist/agent/index.d.ts.map +0 -1
- package/dist/agent/index.js.map +0 -1
- package/dist/agent/inference.d.ts.map +0 -1
- package/dist/agent/inference.js.map +0 -1
- package/dist/agent/model.d.ts.map +0 -1
- package/dist/agent/model.js.map +0 -1
- package/dist/agent/session.d.ts.map +0 -1
- package/dist/agent/session.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/contract/index.d.ts.map +0 -1
- package/dist/contract/index.js.map +0 -1
- package/dist/contract/plugin.d.ts.map +0 -1
- package/dist/contract/plugin.js.map +0 -1
- package/dist/contract/recipe.d.ts.map +0 -1
- package/dist/contract/recipe.js.map +0 -1
- package/dist/contract/validation.d.ts.map +0 -1
- package/dist/contract/validation.js.map +0 -1
- package/dist/db/db.d.ts.map +0 -1
- package/dist/db/db.js.map +0 -1
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/index.js.map +0 -1
- package/dist/db/migrations/index.d.ts.map +0 -1
- package/dist/db/migrations/index.js.map +0 -1
- package/dist/db/models/subtasks.d.ts.map +0 -1
- package/dist/db/models/subtasks.js.map +0 -1
- package/dist/db/models/tasks.d.ts.map +0 -1
- package/dist/db/models/tasks.js.map +0 -1
- package/dist/db/schema.d.ts.map +0 -1
- package/dist/db/schema.js.map +0 -1
- package/dist/env.d.ts.map +0 -1
- package/dist/env.js.map +0 -1
- package/dist/host/agent.d.ts.map +0 -1
- package/dist/host/agent.js.map +0 -1
- package/dist/host/index.d.ts.map +0 -1
- package/dist/host/index.js.map +0 -1
- package/dist/host/plugin-host.d.ts.map +0 -1
- package/dist/host/plugin-host.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/platform.d.ts.map +0 -1
- package/dist/platform.js.map +0 -1
- package/dist/round/agent.d.ts.map +0 -1
- package/dist/round/agent.js.map +0 -1
- package/dist/round/index.d.ts.map +0 -1
- package/dist/round/index.js.map +0 -1
- package/dist/round/policy.d.ts.map +0 -1
- package/dist/round/policy.js.map +0 -1
- package/dist/round/subagent.d.ts.map +0 -1
- package/dist/round/subagent.js.map +0 -1
- package/dist/round/turn.d.ts.map +0 -1
- package/dist/round/turn.js.map +0 -1
- package/dist/round/workflow.d.ts.map +0 -1
- package/dist/round/workflow.js.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/tool-families.d.ts.map +0 -1
- package/dist/runtime/tool-families.js.map +0 -1
- package/dist/subagent/fingerprint.d.ts.map +0 -1
- package/dist/subagent/fingerprint.js.map +0 -1
- package/dist/subagent/index.d.ts.map +0 -1
- package/dist/subagent/index.js.map +0 -1
- package/dist/subagent/prompt.d.ts.map +0 -1
- package/dist/subagent/prompt.js.map +0 -1
- package/dist/subagent/run.d.ts.map +0 -1
- package/dist/subagent/run.js.map +0 -1
- package/dist/subagent/workspace.d.ts.map +0 -1
- package/dist/subagent/workspace.js.map +0 -1
- package/dist/subtasks/catalog.d.ts.map +0 -1
- package/dist/subtasks/catalog.js.map +0 -1
- package/dist/subtasks/decomposition.d.ts.map +0 -1
- package/dist/subtasks/decomposition.js.map +0 -1
- package/dist/subtasks/delegate.d.ts.map +0 -1
- package/dist/subtasks/delegate.js.map +0 -1
- package/dist/subtasks/index.d.ts.map +0 -1
- package/dist/subtasks/index.js.map +0 -1
- package/dist/subtasks/scheduler.d.ts.map +0 -1
- package/dist/subtasks/scheduler.js.map +0 -1
- package/dist/subtasks/subtask-types.d.ts.map +0 -1
- package/dist/subtasks/subtask-types.js.map +0 -1
- package/dist/subtasks/types.d.ts.map +0 -1
- package/dist/subtasks/types.js.map +0 -1
- package/dist/testing/auth.d.ts.map +0 -1
- package/dist/testing/auth.js.map +0 -1
- package/dist/testing/do.d.ts.map +0 -1
- package/dist/testing/do.js.map +0 -1
- package/dist/testing/fake-session.d.ts.map +0 -1
- package/dist/testing/fake-session.js.map +0 -1
- package/dist/testing/fixtures.d.ts.map +0 -1
- package/dist/testing/fixtures.js.map +0 -1
- package/dist/testing/harness.d.ts.map +0 -1
- package/dist/testing/harness.js.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js.map +0 -1
- package/dist/testing/mock-model.d.ts.map +0 -1
- package/dist/testing/mock-model.js.map +0 -1
- package/dist/testing/node.d.ts.map +0 -1
- package/dist/testing/node.js.map +0 -1
- package/dist/testing/vcr-global-setup.d.ts.map +0 -1
- package/dist/testing/vcr-global-setup.js.map +0 -1
- package/dist/testing/vcr-shared.d.ts.map +0 -1
- package/dist/testing/vcr-shared.js.map +0 -1
- package/dist/testing/vcr-spec.d.ts.map +0 -1
- package/dist/testing/vcr-spec.js.map +0 -1
- package/dist/testing/vcr-store.d.ts.map +0 -1
- package/dist/testing/vcr-store.js.map +0 -1
- package/dist/testing/vcr.d.ts.map +0 -1
- package/dist/testing/vcr.js.map +0 -1
- package/dist/worker/define-agent.d.ts.map +0 -1
- package/dist/worker/define-agent.js.map +0 -1
- package/dist/worker/index.d.ts.map +0 -1
- package/dist/worker/index.js.map +0 -1
|
@@ -23,25 +23,20 @@
|
|
|
23
23
|
* known; a thunk is what lets the host supply it late while every hook reads
|
|
24
24
|
* the same one. On a subagent facet there is no caller at all, and the honest
|
|
25
25
|
* encoding is a thunk that throws.
|
|
26
|
-
* - the model ids — what a locally-declared recipe runs on. A recipe may only
|
|
27
|
-
* name models in the host's allowlist, so a plugin that ships one is handed the
|
|
28
|
-
* host's pair rather than guessing.
|
|
29
26
|
* - `aiGatewayId` — the **resolved** AI Gateway slug, so a plugin making its own
|
|
30
27
|
* model calls is correlated with the agent's. Resolved, not read off the
|
|
31
28
|
* overrides object: reaching into `MY_CONFIG.model?.aiGatewayId` at a call site
|
|
32
29
|
* silently yields `undefined` the moment that override is dropped in favour of
|
|
33
|
-
* core's
|
|
30
|
+
* core's baseline, and the plugin's calls quietly stop being correlated.
|
|
31
|
+
*
|
|
32
|
+
* Deliberately **not** here: the agent's model pair. See the note on the
|
|
33
|
+
* interface below.
|
|
34
34
|
*/
|
|
35
35
|
export interface PluginHost<TEnv extends object = object> {
|
|
36
36
|
env: TEnv;
|
|
37
37
|
storage: DurableObjectStorage;
|
|
38
38
|
/** The verified caller. A thunk — it does not exist when `onStart` runs. */
|
|
39
39
|
callerKey: () => string;
|
|
40
|
-
/** `config.model.
|
|
41
|
-
primaryModelId: string;
|
|
42
|
-
/** `config.model.fallbackChatModelId`. */
|
|
43
|
-
fallbackModelId: string;
|
|
44
|
-
/** `config.model.aiGatewayId`, already resolved over core's defaults. */
|
|
40
|
+
/** `config.model.aiGatewayId`, already resolved over core's baseline. */
|
|
45
41
|
aiGatewayId: string;
|
|
46
42
|
}
|
|
47
|
-
//# sourceMappingURL=plugin-host.d.ts.map
|
package/dist/host/plugin-host.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -17,4 +17,3 @@ export { parseGatewayOrigins, type A2ASecretsEnv, type AiEnv, type CoreEnv } fro
|
|
|
17
17
|
export { CHUNK_SOFT_MS, MAX_CHUNKS_PER_BRANCH, STEP_TIMEOUT_MS, STEPS_PER_INSTANCE } from "./platform.js";
|
|
18
18
|
export type { PluginStore } from "./db/db.js";
|
|
19
19
|
export { makeWorkspaceHandle, memoryWorkspaceBacking, WorkspaceLimitError, WORKSPACE_MAX_FILES, WORKSPACE_MAX_FILE_BYTES, type WorkspaceBacking, type WorkspaceEntry, type WorkspaceHandle } from "./subagent/workspace.js";
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -15,4 +15,3 @@ export { ConfigError, DEFAULT_CORE_CONFIG, resolveConfig } from "./config.js";
|
|
|
15
15
|
export { parseGatewayOrigins } from "./env.js";
|
|
16
16
|
export { CHUNK_SOFT_MS, MAX_CHUNKS_PER_BRANCH, STEP_TIMEOUT_MS, STEPS_PER_INSTANCE } from "./platform.js";
|
|
17
17
|
export { makeWorkspaceHandle, memoryWorkspaceBacking, WorkspaceLimitError, WORKSPACE_MAX_FILES, WORKSPACE_MAX_FILE_BYTES } from "./subagent/workspace.js";
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/dist/platform.d.ts
CHANGED
package/dist/platform.js
CHANGED
package/dist/round/agent.d.ts
CHANGED
package/dist/round/agent.js
CHANGED
package/dist/round/index.d.ts
CHANGED
|
@@ -22,4 +22,3 @@ export { RoundAgentBase } from "./agent.js";
|
|
|
22
22
|
export { RecipeSubagentHost, type SubagentClass } from "./subagent.js";
|
|
23
23
|
export { runHandleTask, type HandleTaskDeps, type HandleTaskParams } from "./workflow.js";
|
|
24
24
|
export { buildTurnInstructions, joinSuccessfulBranches, renderTurnMessages, runTurn, type RoundMode, type RunTurnArgs, type RunTurnOutcome, type TurnInstructions } from "./turn.js";
|
|
25
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/round/index.js
CHANGED
|
@@ -21,4 +21,3 @@ export { RoundAgentBase } from "./agent.js";
|
|
|
21
21
|
export { RecipeSubagentHost } from "./subagent.js";
|
|
22
22
|
export { runHandleTask } from "./workflow.js";
|
|
23
23
|
export { buildTurnInstructions, joinSuccessfulBranches, renderTurnMessages, runTurn } from "./turn.js";
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
package/dist/round/policy.d.ts
CHANGED
package/dist/round/policy.js
CHANGED
package/dist/round/subagent.d.ts
CHANGED
|
@@ -64,4 +64,3 @@ export declare abstract class RecipeSubagentHost<TEnv extends Cloudflare.Env & A
|
|
|
64
64
|
* typed as this: any named subclass below it.
|
|
65
65
|
*/
|
|
66
66
|
export type SubagentClass = new (...args: ConstructorParameters<typeof RecipeSubagentBase>) => RecipeSubagentBase;
|
|
67
|
-
//# sourceMappingURL=subagent.d.ts.map
|
package/dist/round/subagent.js
CHANGED
|
@@ -66,8 +66,6 @@ export class RecipeSubagentHost extends RecipeSubagentBase {
|
|
|
66
66
|
throw new Error("a subagent execution has no caller identity — this plugin reads " +
|
|
67
67
|
"per-caller state on a path where none exists");
|
|
68
68
|
},
|
|
69
|
-
primaryModelId: config.model?.chatModelId ?? "",
|
|
70
|
-
fallbackModelId: config.model?.fallbackChatModelId ?? "",
|
|
71
69
|
aiGatewayId: config.model?.aiGatewayId ?? ""
|
|
72
70
|
}),
|
|
73
71
|
env: this.env
|
|
@@ -88,4 +86,3 @@ export class RecipeSubagentHost extends RecipeSubagentBase {
|
|
|
88
86
|
};
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
|
-
//# sourceMappingURL=subagent.js.map
|
package/dist/round/turn.d.ts
CHANGED
package/dist/round/turn.js
CHANGED
package/dist/round/workflow.d.ts
CHANGED
|
@@ -66,7 +66,13 @@ export interface HandleTaskParams {
|
|
|
66
66
|
* 250-line orchestration.
|
|
67
67
|
*/
|
|
68
68
|
export interface HandleTaskDeps {
|
|
69
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Route to the right DO class for the verified caller.
|
|
71
|
+
*
|
|
72
|
+
* Called **once per step body**, not once per run, so it must stay a cheap
|
|
73
|
+
* pure lookup — a namespace `get`, nothing cached and nothing awaited. See
|
|
74
|
+
* {@link ResolveAgent} for why the result must never be hoisted.
|
|
75
|
+
*/
|
|
70
76
|
resolveAgent: (identity: GatewayIdentity) => AgentStub;
|
|
71
77
|
/** Resolved config — the loop reads `mainAgentLimits` and `maxSubtasks`. */
|
|
72
78
|
config: CoreConfig;
|
|
@@ -106,4 +112,3 @@ type AgentStub = DurableObjectStub<RoundAgentBase>;
|
|
|
106
112
|
*/
|
|
107
113
|
export declare function runHandleTask(p: HandleTaskParams, step: WorkflowStep, deps: HandleTaskDeps): Promise<void>;
|
|
108
114
|
export {};
|
|
109
|
-
//# sourceMappingURL=workflow.d.ts.map
|
package/dist/round/workflow.js
CHANGED
|
@@ -20,8 +20,10 @@ import { selectWave } from "../subtasks/scheduler.js";
|
|
|
20
20
|
*/
|
|
21
21
|
export async function runHandleTask(p, step, deps) {
|
|
22
22
|
const limits = deps.config.mainAgentLimits;
|
|
23
|
-
// Pre-work. Routing is pure, so it needs no step of its own
|
|
24
|
-
|
|
23
|
+
// Pre-work. Routing is pure, so it needs no step of its own — but it is
|
|
24
|
+
// deliberately *not* resolved here into a value the steps below close over.
|
|
25
|
+
// See {@link ResolveAgent}.
|
|
26
|
+
const agent = () => deps.resolveAgent(p.identity);
|
|
25
27
|
const push = {
|
|
26
28
|
taskId: p.taskId,
|
|
27
29
|
contextId: p.contextId,
|
|
@@ -29,7 +31,7 @@ export async function runHandleTask(p, step, deps) {
|
|
|
29
31
|
pushToken: p.pushToken,
|
|
30
32
|
jku: p.jku
|
|
31
33
|
};
|
|
32
|
-
const started = await step.do("working", async () => (await
|
|
34
|
+
const started = await step.do("working", async () => (await agent().markWorking(p.taskId)) === "ok");
|
|
33
35
|
if (!started)
|
|
34
36
|
return;
|
|
35
37
|
// Main-agent turns spent so far, across every round. Summed from cached step
|
|
@@ -82,7 +84,7 @@ export async function runHandleTask(p, step, deps) {
|
|
|
82
84
|
// Projected to a plain object: an RPC return carries a `Disposable` brand a
|
|
83
85
|
// step result cannot serialize. Every branch must carry `turns` — a field
|
|
84
86
|
// this projection drops is a field the budget never sees.
|
|
85
|
-
const result = await
|
|
87
|
+
const result = await agent().runTaskTurn({
|
|
86
88
|
taskId: p.taskId,
|
|
87
89
|
text: p.text,
|
|
88
90
|
identity: p.identity,
|
|
@@ -114,19 +116,19 @@ export async function runHandleTask(p, step, deps) {
|
|
|
114
116
|
round,
|
|
115
117
|
error: turn.error
|
|
116
118
|
});
|
|
117
|
-
await deliver(p, step,
|
|
119
|
+
await deliver(p, step, agent, null, deps);
|
|
118
120
|
return;
|
|
119
121
|
}
|
|
120
122
|
if (turn.status === "replied") {
|
|
121
|
-
await deliver(p, step,
|
|
123
|
+
await deliver(p, step, agent, turn.reply, deps);
|
|
122
124
|
return;
|
|
123
125
|
}
|
|
124
126
|
// Delegated: run this round's DAG, then loop and let the model decide again.
|
|
125
|
-
const executed = await executeDag(p, step,
|
|
127
|
+
const executed = await executeDag(p, step, agent, round, push, deps);
|
|
126
128
|
if (executed === "canceled")
|
|
127
129
|
return;
|
|
128
130
|
if (executed === "stuck") {
|
|
129
|
-
await deliver(p, step,
|
|
131
|
+
await deliver(p, step, agent, null, deps);
|
|
130
132
|
return;
|
|
131
133
|
}
|
|
132
134
|
}
|
|
@@ -136,7 +138,7 @@ export async function runHandleTask(p, step, deps) {
|
|
|
136
138
|
console.error("[handle-task] round budget exhausted without a reply", {
|
|
137
139
|
taskId: p.taskId
|
|
138
140
|
});
|
|
139
|
-
await deliver(p, step,
|
|
141
|
+
await deliver(p, step, agent, null, deps);
|
|
140
142
|
}
|
|
141
143
|
/**
|
|
142
144
|
* Drive one round's Subtask DAG to termination, one wave at a time.
|
|
@@ -151,20 +153,20 @@ export async function runHandleTask(p, step, deps) {
|
|
|
151
153
|
* two rounds of the same Task reusing `scan:0` would replay the first round's
|
|
152
154
|
* cached answer into the second.
|
|
153
155
|
*/
|
|
154
|
-
async function executeDag(p, step,
|
|
156
|
+
async function executeDag(p, step, agent, round, push, deps) {
|
|
155
157
|
for (let wave = 0; wave <= deps.config.maxSubtasks; wave++) {
|
|
156
158
|
// One durable step per wave: `skipBlockedSubtasks` reports cancellation,
|
|
157
159
|
// propagates skips past any branch that just failed, and returns the
|
|
158
160
|
// refreshed DAG projection — one round trip, one consistent answer.
|
|
159
161
|
const scan = await step.do(`scan:${round}:${wave}`, async () => {
|
|
160
|
-
const result = await
|
|
162
|
+
const result = await agent().skipBlockedSubtasks(p.taskId, round);
|
|
161
163
|
return result.canceled
|
|
162
164
|
? { canceled: true, nodes: [] }
|
|
163
165
|
: { canceled: false, nodes: result.nodes };
|
|
164
166
|
});
|
|
165
167
|
if (scan.canceled) {
|
|
166
168
|
await step.do(`cancel:${round}:${wave}`, async () => {
|
|
167
|
-
await
|
|
169
|
+
await agent().cancelPendingSubtasks(p.taskId);
|
|
168
170
|
});
|
|
169
171
|
return "canceled";
|
|
170
172
|
}
|
|
@@ -184,7 +186,7 @@ async function executeDag(p, step, stub, round, push, deps) {
|
|
|
184
186
|
// maximum is the only fan-out bound. `runBranch` never rejects, so a single
|
|
185
187
|
// branch cannot fast-fail `Promise.all` and strand its siblings' durable
|
|
186
188
|
// results.
|
|
187
|
-
await Promise.all(decision.ids.map((id) => runBranch(p, step,
|
|
189
|
+
await Promise.all(decision.ids.map((id) => runBranch(p, step, agent, id, push)));
|
|
188
190
|
}
|
|
189
191
|
console.error("[handle-task] subtask DAG exceeded its wave budget", {
|
|
190
192
|
taskId: p.taskId,
|
|
@@ -218,7 +220,7 @@ async function executeDag(p, step, stub, round, push, deps) {
|
|
|
218
220
|
* Step ids are unique across rounds (SQLite assigns them), so these names need no
|
|
219
221
|
* round prefix.
|
|
220
222
|
*/
|
|
221
|
-
async function runBranch(p, step,
|
|
223
|
+
async function runBranch(p, step, agent, id, push) {
|
|
222
224
|
try {
|
|
223
225
|
for (let chunk = 0; chunk < MAX_CHUNKS_PER_BRANCH; chunk++) {
|
|
224
226
|
// Chunk 0 keeps the plain `execute:<id>` step name so single-chunk branches
|
|
@@ -226,7 +228,7 @@ async function runBranch(p, step, stub, id, push) {
|
|
|
226
228
|
const stepName = chunk === 0 ? `execute:${id}` : `execute:${id}:chunk:${chunk}`;
|
|
227
229
|
const done = await step.do(stepName, async () => {
|
|
228
230
|
// The DO posts any progress itself; the step returns only the verdict.
|
|
229
|
-
const outcome = await
|
|
231
|
+
const outcome = await agent().executeSubtaskChunk(id, chunk, push);
|
|
230
232
|
return outcome.done;
|
|
231
233
|
});
|
|
232
234
|
if (done)
|
|
@@ -239,7 +241,7 @@ async function runBranch(p, step, stub, id, push) {
|
|
|
239
241
|
subtaskId: id
|
|
240
242
|
});
|
|
241
243
|
await step.do(`fail:${id}`, async () => {
|
|
242
|
-
await
|
|
244
|
+
await agent().failSubtask(id, `execution exceeded ${MAX_CHUNKS_PER_BRANCH} chunks`);
|
|
243
245
|
});
|
|
244
246
|
}
|
|
245
247
|
catch (err) {
|
|
@@ -249,7 +251,7 @@ async function runBranch(p, step, stub, id, push) {
|
|
|
249
251
|
err: String(err)
|
|
250
252
|
});
|
|
251
253
|
await step.do(`fail:${id}`, async () => {
|
|
252
|
-
await
|
|
254
|
+
await agent().failSubtask(id, `execution exhausted retries: ${String(err)}`);
|
|
253
255
|
});
|
|
254
256
|
}
|
|
255
257
|
}
|
|
@@ -269,12 +271,12 @@ async function runBranch(p, step, stub, id, push) {
|
|
|
269
271
|
* `notify` — in which a `tasks/cancel` lands and the gateway still receives a
|
|
270
272
|
* `completed` callback. Keying the notify on "did the write apply" closes it.
|
|
271
273
|
*/
|
|
272
|
-
async function deliver(p, step,
|
|
274
|
+
async function deliver(p, step, agent, reply, deps) {
|
|
273
275
|
const task = await step.do("complete", async () => {
|
|
274
276
|
const terminal = reply !== null
|
|
275
277
|
? buildCompletedTask(p.taskId, p.contextId, reply)
|
|
276
278
|
: buildFailedTask(p.taskId, p.contextId, deps.policy.copy.taskFailed);
|
|
277
|
-
return (await
|
|
279
|
+
return (await agent().saveTask(terminal)) ? terminal : null;
|
|
278
280
|
});
|
|
279
281
|
if (!task)
|
|
280
282
|
return;
|
|
@@ -290,7 +292,7 @@ async function deliver(p, step, stub, reply, deps) {
|
|
|
290
292
|
// this Task's children were reclaimed.
|
|
291
293
|
try {
|
|
292
294
|
await step.do("sweep", async () => {
|
|
293
|
-
await
|
|
295
|
+
await agent().sweepTaskChildren(p.taskId);
|
|
294
296
|
});
|
|
295
297
|
}
|
|
296
298
|
catch (err) {
|
|
@@ -313,4 +315,3 @@ async function deliver(p, step, stub, reply, deps) {
|
|
|
313
315
|
}).deliver(task);
|
|
314
316
|
});
|
|
315
317
|
}
|
|
316
|
-
//# sourceMappingURL=workflow.js.map
|
package/dist/runtime/index.d.ts
CHANGED
package/dist/runtime/index.js
CHANGED
|
@@ -79,12 +79,8 @@ export function createAgentRuntime(options) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
const policy = {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
config.model.fallbackChatModelId
|
|
85
|
-
]),
|
|
86
|
-
defaultPrimaryModelId: config.model.chatModelId,
|
|
87
|
-
defaultFallbackModelId: config.model.fallbackChatModelId,
|
|
82
|
+
primaryModelId: config.model.chatModelId,
|
|
83
|
+
fallbackModelId: config.model.fallbackChatModelId,
|
|
88
84
|
knownToolFamilies: new Set(toolFamilies.keys()),
|
|
89
85
|
baselineLimits: config.subagentLimits
|
|
90
86
|
};
|
|
@@ -182,4 +178,3 @@ export function createAgentRuntime(options) {
|
|
|
182
178
|
}
|
|
183
179
|
};
|
|
184
180
|
}
|
|
185
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -35,4 +35,3 @@ export declare function canonicalRequest(request: RecipeExecutionRequest): strin
|
|
|
35
35
|
* fingerprinted, so the key matches exactly what the parent re-sends on retry.
|
|
36
36
|
*/
|
|
37
37
|
export declare function fingerprintRequest(request: RecipeExecutionRequest): Promise<string>;
|
|
38
|
-
//# sourceMappingURL=fingerprint.d.ts.map
|
|
@@ -36,8 +36,13 @@ export function canonicalRequest(request) {
|
|
|
36
36
|
recipe: {
|
|
37
37
|
key: request.recipe.key,
|
|
38
38
|
version: request.recipe.version,
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
// No model ids. They used to be hashed because a recipe declared them;
|
|
40
|
+
// it no longer can, and their absence here is the same trade this file
|
|
41
|
+
// already makes for `limits`: the host's own configuration stays out of
|
|
42
|
+
// the fingerprint, so changing it does not invalidate every checkpoint at
|
|
43
|
+
// once and restart every in-flight run from turn zero with its budget
|
|
44
|
+
// already spent. A run that resumes on a newly configured model resumes
|
|
45
|
+
// from conversation state, which is model-independent.
|
|
41
46
|
soul: request.recipe.soul,
|
|
42
47
|
toolFamilies: request.recipe.toolFamilies,
|
|
43
48
|
enabled: request.recipe.enabled,
|
|
@@ -94,4 +99,3 @@ export async function fingerprintRequest(request) {
|
|
|
94
99
|
.map((b) => b.toString(16).padStart(2, "0"))
|
|
95
100
|
.join("");
|
|
96
101
|
}
|
|
97
|
-
//# sourceMappingURL=fingerprint.js.map
|
package/dist/subagent/index.d.ts
CHANGED
package/dist/subagent/index.js
CHANGED
package/dist/subagent/prompt.js
CHANGED
package/dist/subagent/run.d.ts
CHANGED
|
@@ -148,4 +148,3 @@ export interface RecipeRunDeps {
|
|
|
148
148
|
* Throws only on a transient platform fault (as {@link runResumableChunk} does).
|
|
149
149
|
*/
|
|
150
150
|
export declare function runRecipeExecution(request: RecipeExecutionRequest, deps: RecipeRunDeps): Promise<RecipeExecutionResult>;
|
|
151
|
-
//# sourceMappingURL=run.d.ts.map
|
package/dist/subagent/run.js
CHANGED
package/dist/subtasks/catalog.js
CHANGED
|
@@ -75,4 +75,3 @@ export type DelegateSubtaskOutcome = {
|
|
|
75
75
|
export declare function delegateCallInput(reply: string, branches: CompositionBranch[]): DecompositionProposal;
|
|
76
76
|
/** Rebuild one round's call result from its durable rows, in stable ordinal order. */
|
|
77
77
|
export declare function delegateCallOutput(branches: CompositionBranch[]): DelegateSubtaskOutcome[];
|
|
78
|
-
//# sourceMappingURL=delegate.d.ts.map
|
package/dist/subtasks/index.d.ts
CHANGED
|
@@ -8,4 +8,3 @@ export { DELEGATE_TOOL_NAME, makeDelegateTool, delegateToolCallId, delegateCallI
|
|
|
8
8
|
export { selectWave, type WaveDecision } from "./scheduler.js";
|
|
9
9
|
export { isCatalogEligible, type ReferenceCatalogEntry } from "./catalog.js";
|
|
10
10
|
export * from "./types.js";
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/subtasks/index.js
CHANGED
package/dist/subtasks/types.d.ts
CHANGED
package/dist/subtasks/types.js
CHANGED
package/dist/testing/auth.d.ts
CHANGED
|
@@ -32,4 +32,3 @@ export interface GatewayTokenOptions {
|
|
|
32
32
|
export declare const TEST_TENANT = "main";
|
|
33
33
|
/** Sign a short-lived EdDSA gateway JWT using the test gateway key. */
|
|
34
34
|
export declare function makeGatewayToken(options?: GatewayTokenOptions): Promise<string>;
|
|
35
|
-
//# sourceMappingURL=auth.d.ts.map
|
package/dist/testing/auth.js
CHANGED
package/dist/testing/do.d.ts
CHANGED
package/dist/testing/do.js
CHANGED
|
@@ -62,4 +62,3 @@ export declare function testStatus(state: TaskState, message?: Message): NonNull
|
|
|
62
62
|
export declare function testAgentMessage(messageId: string, text: string, contextId?: string, taskId?: string): Message;
|
|
63
63
|
/** A complete v1.0 `Task` in the given state. */
|
|
64
64
|
export declare function testTask(id: string, contextId: string, state: TaskState, message?: Message): Task;
|
|
65
|
-
//# sourceMappingURL=fixtures.d.ts.map
|
package/dist/testing/fixtures.js
CHANGED
package/dist/testing/harness.js
CHANGED
package/dist/testing/index.d.ts
CHANGED
|
@@ -29,4 +29,3 @@ export { makeGatewayToken, type GatewayTokenOptions } from "./auth.js";
|
|
|
29
29
|
export { AGENT_ORIGIN, GATEWAY_ORIGIN, TEST_AGENT_PRIVATE_JWK, TEST_GATEWAY_PRIVATE_JWK, TEST_MODELS, gatewayPublicJwks, testAgentMessage, testStatus, testTask } from "./fixtures.js";
|
|
30
30
|
export { doStorage, makeDoHelpers, type DoTestHelpers } from "./do.js";
|
|
31
31
|
export { createAgentHarness, type AgentHarness, type AgentHarnessOptions, type CapturedCallback, type HarnessWorker } from "./harness.js";
|
|
32
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/testing/index.js
CHANGED
|
@@ -29,4 +29,3 @@ export { makeGatewayToken } from "./auth.js";
|
|
|
29
29
|
export { AGENT_ORIGIN, GATEWAY_ORIGIN, TEST_AGENT_PRIVATE_JWK, TEST_GATEWAY_PRIVATE_JWK, TEST_MODELS, gatewayPublicJwks, testAgentMessage, testStatus, testTask } from "./fixtures.js";
|
|
30
30
|
export { doStorage, makeDoHelpers } from "./do.js";
|
|
31
31
|
export { createAgentHarness } from "./harness.js";
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
package/dist/testing/node.d.ts
CHANGED
|
@@ -54,4 +54,3 @@
|
|
|
54
54
|
export { createVcr, recordFromEnv, closeVcr, type Vcr, type VcrOptions, type VcrRequest, type VcrRequestHeaders, type VcrOutboundService } from "./vcr.js";
|
|
55
55
|
export { Cassette, requestKey, replayable, type CassetteEntry, type CassetteOptions, type RecordedRequest, type RecordedResponse, type ReplayableResponse } from "./vcr-store.js";
|
|
56
56
|
export { VCR_CONTROL_ORIGIN, VCR_MARKER_HEADER, CASSETTE_NAME_RE, type VcrReleaseResult } from "./vcr-shared.js";
|
|
57
|
-
//# sourceMappingURL=node.d.ts.map
|
package/dist/testing/node.js
CHANGED