@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
package/dist/a2a/agent-stub.d.ts
CHANGED
package/dist/a2a/agent-stub.js
CHANGED
package/dist/a2a/caller.d.ts
CHANGED
package/dist/a2a/caller.js
CHANGED
package/dist/a2a/card.d.ts
CHANGED
package/dist/a2a/card.js
CHANGED
package/dist/a2a/context.d.ts
CHANGED
|
@@ -17,4 +17,3 @@ import type { GatewayIdentity } from "./verify.js";
|
|
|
17
17
|
export declare function buildCallContext(request: Request, identity: GatewayIdentity, tenant: string): ServerCallContext;
|
|
18
18
|
/** Echo back the extensions the handler actually activated (spec §14.2.2). */
|
|
19
19
|
export declare function extensionHeaders(context: ServerCallContext): HeadersInit;
|
|
20
|
-
//# sourceMappingURL=context.d.ts.map
|
package/dist/a2a/context.js
CHANGED
package/dist/a2a/executor.d.ts
CHANGED
package/dist/a2a/executor.js
CHANGED
package/dist/a2a/index.d.ts
CHANGED
|
@@ -30,4 +30,3 @@ export { buildCallContext, extensionHeaders } from "./context.js";
|
|
|
30
30
|
export { DurableTaskStore } from "./task-store.js";
|
|
31
31
|
export { A2AExecutor, workflowIdForMessage, ignoreAlreadyExists, type AcceptedTurn, type ExecutorConfig, type TurnStarter } from "./executor.js";
|
|
32
32
|
export type { AgentResolver, TaskAgent, TaskListPage, TaskListQuery } from "./agent-stub.js";
|
|
33
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/a2a/index.js
CHANGED
|
@@ -29,4 +29,3 @@ export { textPart, partsText, textOf, agentTextMessage, inboundText, InboundPart
|
|
|
29
29
|
export { buildCallContext, extensionHeaders } from "./context.js";
|
|
30
30
|
export { DurableTaskStore } from "./task-store.js";
|
|
31
31
|
export { A2AExecutor, workflowIdForMessage, ignoreAlreadyExists } from "./executor.js";
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
package/dist/a2a/notify.d.ts
CHANGED
|
@@ -103,4 +103,3 @@ export declare function signCallbackJwt(privateJwk: JWK & {
|
|
|
103
103
|
* workflow's `notify` step) can decide whether a non-2xx warrants a retry.
|
|
104
104
|
*/
|
|
105
105
|
export declare function postNotification(url: string, token: string, jwt: string, task: Task): Promise<Response>;
|
|
106
|
-
//# sourceMappingURL=notify.d.ts.map
|
package/dist/a2a/notify.js
CHANGED
package/dist/a2a/parts.d.ts
CHANGED
package/dist/a2a/parts.js
CHANGED
package/dist/a2a/push.d.ts
CHANGED
package/dist/a2a/push.js
CHANGED
package/dist/a2a/task-store.d.ts
CHANGED
package/dist/a2a/task-store.js
CHANGED
package/dist/a2a/task.d.ts
CHANGED
package/dist/a2a/task.js
CHANGED
package/dist/a2a/verify.d.ts
CHANGED
package/dist/a2a/verify.js
CHANGED
package/dist/agent/budget.d.ts
CHANGED
package/dist/agent/budget.js
CHANGED
package/dist/agent/control.d.ts
CHANGED
package/dist/agent/control.js
CHANGED
|
@@ -49,4 +49,3 @@ export const finalReplyTool = tool({
|
|
|
49
49
|
description: "Answer the user and end this round. Use this whenever the request is yours to answer — anything about this conversation, your own history, memory, or tools, and anything you can settle with the tools available to you here, including work that has already come back to you.",
|
|
50
50
|
inputSchema: finalReplyInputSchema
|
|
51
51
|
});
|
|
52
|
-
//# sourceMappingURL=final-reply.js.map
|
package/dist/agent/history.d.ts
CHANGED
|
@@ -95,4 +95,3 @@ export declare function sessionMessage(role: "user" | "assistant", text: string)
|
|
|
95
95
|
export declare function sessionText(m: SessionMessage): string;
|
|
96
96
|
/** Convert stored history to AI-SDK model messages (user/assistant text only). */
|
|
97
97
|
export declare function toModelMessages(history: SessionMessage[]): ModelMessage[];
|
|
98
|
-
//# sourceMappingURL=history.d.ts.map
|
package/dist/agent/history.js
CHANGED
package/dist/agent/index.d.ts
CHANGED
|
@@ -25,4 +25,3 @@ export { deterministicSessionMessage, finalReplyMessageId, parseRoundAckMessageI
|
|
|
25
25
|
export { buildIntermediateContentHandler, isTransientAiError, type OnContent } from "./inference.js";
|
|
26
26
|
export { ControlCallError, controlTools, controlToolSet, type ControlTool, type TurnDecision } from "./control.js";
|
|
27
27
|
export { FINAL_REPLY_TOOL_NAME, finalReplyInputSchema, finalReplyTool } from "./final-reply.js";
|
|
28
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/agent/index.js
CHANGED
|
@@ -25,4 +25,3 @@ export { deterministicSessionMessage, finalReplyMessageId, parseRoundAckMessageI
|
|
|
25
25
|
export { buildIntermediateContentHandler, isTransientAiError } from "./inference.js";
|
|
26
26
|
export { ControlCallError, controlTools, controlToolSet } from "./control.js";
|
|
27
27
|
export { FINAL_REPLY_TOOL_NAME, finalReplyInputSchema, finalReplyTool } from "./final-reply.js";
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -49,4 +49,3 @@ export declare function isTransientAiError(err: unknown): boolean;
|
|
|
49
49
|
* steps are skipped. Default `[]` (the subagent loop has no control tools).
|
|
50
50
|
*/
|
|
51
51
|
export declare function buildIntermediateContentHandler(onContent: OnContent, terminalToolNames?: string[]): (step: StepResult<ToolSet>) => Promise<void>;
|
|
52
|
-
//# sourceMappingURL=inference.d.ts.map
|
package/dist/agent/inference.js
CHANGED
package/dist/agent/model.d.ts
CHANGED
package/dist/agent/model.js
CHANGED
package/dist/agent/session.d.ts
CHANGED
package/dist/agent/session.js
CHANGED
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
package/dist/contract/index.d.ts
CHANGED
|
@@ -7,4 +7,3 @@
|
|
|
7
7
|
export { PLUGIN_CONTRACT_VERSION, definePlugin, type AgentPlugin, type EmitProgress, type EnrichResultContext, type MainAgentToolContext, type PluginRequirements, type RecipeToolSet, type ResolveRuntimeContext, type ToolFamilyBuilder, type ToolFamilyContext, type TurnGateContext } from "./plugin.js";
|
|
8
8
|
export type { DelegationNames, RecipeLimits, ResolvedRecipe, SubtaskParams, SubtaskParamsSchema, SubtaskParamsShape, SubtaskTypeSpec, ValidatedRecipe } from "./recipe.js";
|
|
9
9
|
export { RecipeValidationError, resolveLimits, validateRecipe, type RecipePolicy } from "./validation.js";
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/contract/index.js
CHANGED
|
@@ -262,4 +262,3 @@ export interface AgentPlugin<TRuntime = SubtaskRuntime> {
|
|
|
262
262
|
export declare function definePlugin<TRuntime = SubtaskRuntime>(plugin: Omit<AgentPlugin<TRuntime>, "contractVersion"> & {
|
|
263
263
|
contractVersion?: number;
|
|
264
264
|
}): AgentPlugin<TRuntime>;
|
|
265
|
-
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/contract/plugin.js
CHANGED
|
@@ -76,8 +76,6 @@ export type RecipeLimits = AgentLimits;
|
|
|
76
76
|
export interface ResolvedRecipe {
|
|
77
77
|
key: string;
|
|
78
78
|
version: number;
|
|
79
|
-
primaryModelId: string;
|
|
80
|
-
fallbackModelId: string;
|
|
81
79
|
/** Required, never defaulted — see `validateRecipe`. */
|
|
82
80
|
soul: string;
|
|
83
81
|
toolFamilies: string[];
|
|
@@ -104,6 +102,20 @@ export interface ResolvedRecipe {
|
|
|
104
102
|
*/
|
|
105
103
|
export interface ValidatedRecipe extends ResolvedRecipe {
|
|
106
104
|
limits: RecipeLimits;
|
|
105
|
+
/**
|
|
106
|
+
* The pair this recipe will actually run on — **the host's, always**.
|
|
107
|
+
*
|
|
108
|
+
* These exist only here, never on {@link ResolvedRecipe}, and that asymmetry
|
|
109
|
+
* is the design: a recipe cannot state a model, so the only way to hold one is
|
|
110
|
+
* to have been through {@link validateRecipe}, which copies the host's. Recipe
|
|
111
|
+
* data has no path to influence them.
|
|
112
|
+
*
|
|
113
|
+
* Guaranteed non-empty and guaranteed distinct, because `resolveConfig`
|
|
114
|
+
* refuses a config that is either — so the fallback is always a genuinely
|
|
115
|
+
* different model from the primary, which is the entire point of having one.
|
|
116
|
+
*/
|
|
117
|
+
primaryModelId: string;
|
|
118
|
+
fallbackModelId: string;
|
|
107
119
|
}
|
|
108
120
|
/**
|
|
109
121
|
* One entry in the closed set of Subtask types the main agent may delegate,
|
|
@@ -167,4 +179,3 @@ export interface SubtaskTypeSpec {
|
|
|
167
179
|
/** The execution configuration this type runs under. */
|
|
168
180
|
recipe: ResolvedRecipe;
|
|
169
181
|
}
|
|
170
|
-
//# sourceMappingURL=recipe.d.ts.map
|
package/dist/contract/recipe.js
CHANGED
|
@@ -4,12 +4,12 @@ import type { ResolvedRecipe, ValidatedRecipe } from "./recipe.js";
|
|
|
4
4
|
* The capability boundary every recipe passes through, whatever declared it.
|
|
5
5
|
*
|
|
6
6
|
* This module imports no domain. It owns only what code must be able to say
|
|
7
|
-
* about *any* recipe: which
|
|
8
|
-
* malformed one is made safe or refused. A domain cannot widen
|
|
9
|
-
* *capabilities* by declaring them
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* exception; see {@link resolveLimits}.
|
|
7
|
+
* about *any* recipe: which tool families it may select, which models it runs
|
|
8
|
+
* on, and how a malformed one is made safe or refused. A domain cannot widen
|
|
9
|
+
* its *capabilities* by declaring them — the legal tool families come from
|
|
10
|
+
* {@link RecipePolicy}, which the host builds from its installed plugins, and
|
|
11
|
+
* the model pair comes from the host's config with no declaration involved at
|
|
12
|
+
* all. Its budget is the deliberate exception; see {@link resolveLimits}.
|
|
13
13
|
*
|
|
14
14
|
* In the predecessor repo the two allowlists were module constants, and one of
|
|
15
15
|
* them hardcoded a domain key (`"arc-game"`) inside otherwise generic code. That
|
|
@@ -18,15 +18,19 @@ import type { ResolvedRecipe, ValidatedRecipe } from "./recipe.js";
|
|
|
18
18
|
*/
|
|
19
19
|
export interface RecipePolicy {
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* The pair every recipe runs on: the host agent's own, copied verbatim onto
|
|
22
|
+
* each {@link ValidatedRecipe}.
|
|
23
|
+
*
|
|
24
|
+
* There is no allowlist any more, because there is nothing to check against
|
|
25
|
+
* it — a recipe cannot state a model. `modelAllowlist` existed to police
|
|
26
|
+
* recipe-stated preferences, and it could only ever contain these same two
|
|
27
|
+
* ids, so the "preference" it policed could never reach a third model. It
|
|
28
|
+
* could only swap the primary for the fallback, which is not a capability
|
|
29
|
+
* anyone wants and which broke the pair's distinctness.
|
|
24
30
|
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
/** Substituted when a recipe names a fallback model outside the allowlist. */
|
|
29
|
-
defaultFallbackModelId: string;
|
|
31
|
+
primaryModelId: string;
|
|
32
|
+
/** See {@link primaryModelId}. Guaranteed distinct from it by `resolveConfig`. */
|
|
33
|
+
fallbackModelId: string;
|
|
30
34
|
/**
|
|
31
35
|
* Tool-family keys the runtime recognizes — derived from the installed
|
|
32
36
|
* plugins, never hardcoded.
|
|
@@ -69,12 +73,12 @@ export declare class RecipeValidationError extends Error {
|
|
|
69
73
|
}
|
|
70
74
|
/**
|
|
71
75
|
* Code-owned defensive validation of an already-resolved recipe. Returns a
|
|
72
|
-
* normalized copy (never mutates the input):
|
|
73
|
-
*
|
|
74
|
-
* slot — and unknown tool families are dropped (deduped, order-preserving).
|
|
76
|
+
* normalized copy (never mutates the input): the host's model pair is stamped
|
|
77
|
+
* on, and unknown tool families are dropped (deduped, order-preserving).
|
|
75
78
|
* Applied by the parent when it resolves a recipe and re-applied by the subagent
|
|
76
79
|
* on its inbound request, so recipe data can never select arbitrary models or
|
|
77
|
-
* tools
|
|
80
|
+
* tools — models because there is no field to select one with, tools because
|
|
81
|
+
* the legal set comes from the installed plugins rather than the declaration.
|
|
78
82
|
*
|
|
79
83
|
* The split between what is normalized and what is refused follows one rule:
|
|
80
84
|
* **the host declares a baseline ⇒ merge; it does not ⇒ require.** `limits`
|
|
@@ -85,4 +89,3 @@ export declare class RecipeValidationError extends Error {
|
|
|
85
89
|
* house default can guess. Both fail the recipe outright.
|
|
86
90
|
*/
|
|
87
91
|
export declare function validateRecipe(recipe: ResolvedRecipe, policy: RecipePolicy): ValidatedRecipe;
|
|
88
|
-
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -34,12 +34,12 @@ export class RecipeValidationError extends Error {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Code-owned defensive validation of an already-resolved recipe. Returns a
|
|
37
|
-
* normalized copy (never mutates the input):
|
|
38
|
-
*
|
|
39
|
-
* slot — and unknown tool families are dropped (deduped, order-preserving).
|
|
37
|
+
* normalized copy (never mutates the input): the host's model pair is stamped
|
|
38
|
+
* on, and unknown tool families are dropped (deduped, order-preserving).
|
|
40
39
|
* Applied by the parent when it resolves a recipe and re-applied by the subagent
|
|
41
40
|
* on its inbound request, so recipe data can never select arbitrary models or
|
|
42
|
-
* tools
|
|
41
|
+
* tools — models because there is no field to select one with, tools because
|
|
42
|
+
* the legal set comes from the installed plugins rather than the declaration.
|
|
43
43
|
*
|
|
44
44
|
* The split between what is normalized and what is refused follows one rule:
|
|
45
45
|
* **the host declares a baseline ⇒ merge; it does not ⇒ require.** `limits`
|
|
@@ -63,14 +63,22 @@ export function validateRecipe(recipe, policy) {
|
|
|
63
63
|
const toolFamilies = [...new Set(recipe.toolFamilies)].filter((family) => policy.knownToolFamilies.has(family));
|
|
64
64
|
return {
|
|
65
65
|
...recipe,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
// The host's pair, copied. Not selected, not substituted, not merged —
|
|
67
|
+
// there is nothing on a `ResolvedRecipe` to select *from*.
|
|
68
|
+
//
|
|
69
|
+
// This used to substitute a recipe's stated preference against
|
|
70
|
+
// an allowlist, per slot and independently. That produced a real defect:
|
|
71
|
+
// a recipe preferring the host's *fallback* as its primary, and stating no
|
|
72
|
+
// fallback of its own, resolved to the same id in both slots — so the
|
|
73
|
+
// fallback retried the model that had just failed, defeating the distinct-
|
|
74
|
+
// pair invariant `resolveConfig` enforces one layer up.
|
|
75
|
+
//
|
|
76
|
+
// Copying wholesale makes that unrepresentable: the pair here is exactly the
|
|
77
|
+
// pair the agent configured, which `resolveConfig` has already guaranteed is
|
|
78
|
+
// non-empty and distinct.
|
|
79
|
+
primaryModelId: policy.primaryModelId,
|
|
80
|
+
fallbackModelId: policy.fallbackModelId,
|
|
72
81
|
toolFamilies,
|
|
73
82
|
limits: resolveLimits(recipe.limits, policy.baselineLimits)
|
|
74
83
|
};
|
|
75
84
|
}
|
|
76
|
-
//# sourceMappingURL=validation.js.map
|
package/dist/db/db.d.ts
CHANGED
package/dist/db/db.js
CHANGED
package/dist/db/index.d.ts
CHANGED
|
@@ -6,4 +6,3 @@ export { AgentDB, PLUGIN_MIGRATIONS_TABLE, type AgentDBOptions, type DB, type Pl
|
|
|
6
6
|
export { notifyTasks, subtasks } from "./schema.js";
|
|
7
7
|
export { makeTasks, stateOf, type TaskListQuery } from "./models/tasks.js";
|
|
8
8
|
export { makeSubtasks, type SubtaskModelOptions } from "./models/subtasks.js";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/db/index.js
CHANGED
package/dist/db/models/tasks.js
CHANGED
package/dist/db/schema.d.ts
CHANGED
package/dist/db/schema.js
CHANGED
package/dist/env.d.ts
CHANGED
package/dist/env.js
CHANGED
package/dist/host/agent.d.ts
CHANGED
|
@@ -108,9 +108,9 @@ export declare abstract class LoopingAgent<TEnv extends Cloudflare.Env & AiEnv &
|
|
|
108
108
|
* runtime exists.
|
|
109
109
|
*
|
|
110
110
|
* Deliberately not `this.config` — that would be a cycle. `resolveConfig` is
|
|
111
|
-
* cheap and pure and fills in core's
|
|
112
|
-
* runtime lands on; that matters because
|
|
113
|
-
* `
|
|
111
|
+
* cheap and pure and fills in core's baseline, so this is the same result the
|
|
112
|
+
* runtime lands on; that matters because every recipe runs on exactly this
|
|
113
|
+
* pair — `RecipePolicy` carries it and `validateRecipe` stamps it on.
|
|
114
114
|
*/
|
|
115
115
|
private resolvedModelIds;
|
|
116
116
|
onStart(): Promise<void>;
|
|
@@ -214,4 +214,3 @@ export declare abstract class LoopingAgent<TEnv extends Cloudflare.Env & AiEnv &
|
|
|
214
214
|
*/
|
|
215
215
|
protected onTaskCanceled(_taskId: string): Promise<void>;
|
|
216
216
|
}
|
|
217
|
-
//# sourceMappingURL=agent.d.ts.map
|
package/dist/host/agent.js
CHANGED
|
@@ -120,8 +120,6 @@ export class LoopingAgent extends Agent {
|
|
|
120
120
|
storage: this.ctx.storage,
|
|
121
121
|
// A thunk, not a value — see `identityKey`.
|
|
122
122
|
callerKey: () => this.requireIdentityKey(),
|
|
123
|
-
primaryModelId: model.chatModelId,
|
|
124
|
-
fallbackModelId: model.fallbackChatModelId,
|
|
125
123
|
aiGatewayId: model.aiGatewayId
|
|
126
124
|
};
|
|
127
125
|
}
|
|
@@ -130,9 +128,9 @@ export class LoopingAgent extends Agent {
|
|
|
130
128
|
* runtime exists.
|
|
131
129
|
*
|
|
132
130
|
* Deliberately not `this.config` — that would be a cycle. `resolveConfig` is
|
|
133
|
-
* cheap and pure and fills in core's
|
|
134
|
-
* runtime lands on; that matters because
|
|
135
|
-
* `
|
|
131
|
+
* cheap and pure and fills in core's baseline, so this is the same result the
|
|
132
|
+
* runtime lands on; that matters because every recipe runs on exactly this
|
|
133
|
+
* pair — `RecipePolicy` carries it and `validateRecipe` stamps it on.
|
|
136
134
|
*/
|
|
137
135
|
resolvedModelIds() {
|
|
138
136
|
return resolveConfig(this.agentConfig()).model;
|
|
@@ -303,4 +301,3 @@ export class LoopingAgent extends Agent {
|
|
|
303
301
|
*/
|
|
304
302
|
async onTaskCanceled(_taskId) { }
|
|
305
303
|
}
|
|
306
|
-
//# sourceMappingURL=agent.js.map
|
package/dist/host/index.d.ts
CHANGED
package/dist/host/index.js
CHANGED