@lloyal-labs/lloyal-agents 2.0.0 → 3.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/LICENSE +107 -0
- package/LICENSE-FAQ.md +256 -0
- package/README.md +31 -15
- package/dist/Agent.d.ts +15 -4
- package/dist/Agent.d.ts.map +1 -1
- package/dist/Agent.js +12 -2
- package/dist/Agent.js.map +1 -1
- package/dist/AgentPolicy.d.ts +92 -15
- package/dist/AgentPolicy.d.ts.map +1 -1
- package/dist/AgentPolicy.js +42 -14
- package/dist/AgentPolicy.js.map +1 -1
- package/dist/Tool.d.ts +45 -1
- package/dist/Tool.d.ts.map +1 -1
- package/dist/Tool.js +50 -2
- package/dist/Tool.js.map +1 -1
- package/dist/agent-pool.d.ts +4 -4
- package/dist/agent-pool.d.ts.map +1 -1
- package/dist/agent-pool.js +224 -53
- package/dist/agent-pool.js.map +1 -1
- package/dist/app-config.d.ts +50 -0
- package/dist/app-config.d.ts.map +1 -0
- package/dist/app-config.js +27 -0
- package/dist/app-config.js.map +1 -0
- package/dist/app-types.d.ts +309 -0
- package/dist/app-types.d.ts.map +1 -0
- package/dist/app-types.js +28 -0
- package/dist/app-types.js.map +1 -0
- package/dist/chunk.d.ts +118 -0
- package/dist/chunk.d.ts.map +1 -0
- package/dist/chunk.js +19 -0
- package/dist/chunk.js.map +1 -0
- package/dist/context.d.ts +76 -20
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +72 -20
- package/dist/context.js.map +1 -1
- package/dist/create-agent-pool.d.ts +18 -12
- package/dist/create-agent-pool.d.ts.map +1 -1
- package/dist/create-agent-pool.js +30 -29
- package/dist/create-agent-pool.js.map +1 -1
- package/dist/grant-store.d.ts +49 -0
- package/dist/grant-store.d.ts.map +1 -0
- package/dist/grant-store.js +33 -0
- package/dist/grant-store.js.map +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/orchestrators.d.ts +15 -8
- package/dist/orchestrators.d.ts.map +1 -1
- package/dist/orchestrators.js +10 -10
- package/dist/orchestrators.js.map +1 -1
- package/dist/replay.d.ts +19 -19
- package/dist/replay.d.ts.map +1 -1
- package/dist/replay.js +29 -29
- package/dist/replay.js.map +1 -1
- package/dist/source.d.ts +31 -1
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +32 -2
- package/dist/source.js.map +1 -1
- package/dist/spine.d.ts +100 -0
- package/dist/spine.d.ts.map +1 -0
- package/dist/{shared-root.js → spine.js} +57 -38
- package/dist/spine.js.map +1 -0
- package/dist/toolkit.d.ts +44 -17
- package/dist/toolkit.d.ts.map +1 -1
- package/dist/toolkit.js +24 -14
- package/dist/toolkit.js.map +1 -1
- package/dist/trace-types.d.ts +36 -4
- package/dist/trace-types.d.ts.map +1 -1
- package/dist/types.d.ts +46 -15
- package/dist/types.d.ts.map +1 -1
- package/dist/use-agent.d.ts +10 -5
- package/dist/use-agent.d.ts.map +1 -1
- package/dist/use-agent.js +18 -15
- package/dist/use-agent.js.map +1 -1
- package/package.json +7 -5
- package/dist/shared-root.d.ts +0 -96
- package/dist/shared-root.d.ts.map +0 -1
- package/dist/shared-root.js.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GrantStore` — pluggable runtime store for protected-tool grants.
|
|
3
|
+
*
|
|
4
|
+
* A **grant** authorizes the current session to invoke a `protected` tool
|
|
5
|
+
* (see {@link Tool.protected}). The framework's authGuard denies any
|
|
6
|
+
* protected tool call whose name is not granted. Grants are obtained via
|
|
7
|
+
* consent — a harness consent prompt, or an app's {@link ConfigFlow}
|
|
8
|
+
* OAuth-style handoff — and the **credential itself never enters the
|
|
9
|
+
* model's context**: the model only triggers the call; the runtime holds
|
|
10
|
+
* the grant and the tool's `execute` uses the underlying secret.
|
|
11
|
+
*
|
|
12
|
+
* The interface lives in `@lloyal-labs/lloyal-agents` so the framework
|
|
13
|
+
* context ({@link GrantStoreCtx}) and app/harness code share one type
|
|
14
|
+
* without a dependency cycle. The concrete in-memory implementation
|
|
15
|
+
* (`createGrantStore`) and harness-supplied backends live in rig and
|
|
16
|
+
* harness packages — mirroring {@link AppConfigStore} /
|
|
17
|
+
* `createInMemoryConfigStore`.
|
|
18
|
+
*
|
|
19
|
+
* **Semantics:**
|
|
20
|
+
*
|
|
21
|
+
* - **Binary per tool.** A grant is keyed by tool name; either the session
|
|
22
|
+
* holds it or it doesn't. No scopes, no expiry in the base contract —
|
|
23
|
+
* richer policies are a harness concern.
|
|
24
|
+
* - **Fail-closed.** With no grant store on {@link GrantStoreCtx}, no grants
|
|
25
|
+
* exist: every protected tool is denied. Open (non-protected) tools are
|
|
26
|
+
* unaffected.
|
|
27
|
+
*
|
|
28
|
+
* @packageDocumentation
|
|
29
|
+
* @category Contract
|
|
30
|
+
*/
|
|
31
|
+
import type { Operation } from 'effection';
|
|
32
|
+
/**
|
|
33
|
+
* Pluggable runtime store of protected-tool grants for a session.
|
|
34
|
+
*
|
|
35
|
+
* All methods return `Operation<...>` (Effection generators) so concrete
|
|
36
|
+
* implementations can perform async IO (reading a secrets backend,
|
|
37
|
+
* checking a remote authorization service) inside the framework's scope.
|
|
38
|
+
*/
|
|
39
|
+
export interface GrantStore {
|
|
40
|
+
/** Whether the session currently holds a grant for `toolName`. */
|
|
41
|
+
has(toolName: string): Operation<boolean>;
|
|
42
|
+
/** Record consent for `toolName` (the session may now call it). Idempotent. */
|
|
43
|
+
grant(toolName: string): Operation<void>;
|
|
44
|
+
/** Revoke a previously-granted tool. Idempotent. */
|
|
45
|
+
revoke(toolName: string): Operation<void>;
|
|
46
|
+
/** Snapshot of all granted tool names — the synchronous gate the pool reads. */
|
|
47
|
+
granted(): Operation<readonly string[]>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=grant-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-store.d.ts","sourceRoot":"","sources":["../src/grant-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,kEAAkE;IAClE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1C,+EAA+E;IAC/E,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IACzC,oDAAoD;IACpD,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1C,gFAAgF;IAChF,OAAO,IAAI,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACzC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `GrantStore` — pluggable runtime store for protected-tool grants.
|
|
4
|
+
*
|
|
5
|
+
* A **grant** authorizes the current session to invoke a `protected` tool
|
|
6
|
+
* (see {@link Tool.protected}). The framework's authGuard denies any
|
|
7
|
+
* protected tool call whose name is not granted. Grants are obtained via
|
|
8
|
+
* consent — a harness consent prompt, or an app's {@link ConfigFlow}
|
|
9
|
+
* OAuth-style handoff — and the **credential itself never enters the
|
|
10
|
+
* model's context**: the model only triggers the call; the runtime holds
|
|
11
|
+
* the grant and the tool's `execute` uses the underlying secret.
|
|
12
|
+
*
|
|
13
|
+
* The interface lives in `@lloyal-labs/lloyal-agents` so the framework
|
|
14
|
+
* context ({@link GrantStoreCtx}) and app/harness code share one type
|
|
15
|
+
* without a dependency cycle. The concrete in-memory implementation
|
|
16
|
+
* (`createGrantStore`) and harness-supplied backends live in rig and
|
|
17
|
+
* harness packages — mirroring {@link AppConfigStore} /
|
|
18
|
+
* `createInMemoryConfigStore`.
|
|
19
|
+
*
|
|
20
|
+
* **Semantics:**
|
|
21
|
+
*
|
|
22
|
+
* - **Binary per tool.** A grant is keyed by tool name; either the session
|
|
23
|
+
* holds it or it doesn't. No scopes, no expiry in the base contract —
|
|
24
|
+
* richer policies are a harness concern.
|
|
25
|
+
* - **Fail-closed.** With no grant store on {@link GrantStoreCtx}, no grants
|
|
26
|
+
* exist: every protected tool is denied. Open (non-protected) tools are
|
|
27
|
+
* unaffected.
|
|
28
|
+
*
|
|
29
|
+
* @packageDocumentation
|
|
30
|
+
* @category Contract
|
|
31
|
+
*/
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
//# sourceMappingURL=grant-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-store.js","sourceRoot":"","sources":["../src/grant-store.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { Ctx, Store, Events, Trace, TraceParent,
|
|
2
|
-
export { Tool } from './Tool';
|
|
1
|
+
export { Ctx, Store, Events, Trace, TraceParent, RerankerCtx, AppRegistryCtx, AppConfigStoreCtx, GrantStoreCtx, } from './context';
|
|
2
|
+
export { Tool, ToolRetryError } from './Tool';
|
|
3
3
|
export { Agent } from './Agent';
|
|
4
4
|
export type { AgentStatus, ResultSource, FormatConfig, ToolHistoryEntry } from './Agent';
|
|
5
5
|
export { DefaultAgentPolicy } from './AgentPolicy';
|
|
6
|
-
export type { AgentPolicy, ProduceAction, SettleAction, RecoveryAction, IdleReason, PolicyConfig, ToolGuard, DefaultAgentPolicyOpts } from './AgentPolicy';
|
|
6
|
+
export type { AgentPolicy, ProduceAction, SettleAction, RecoveryAction, ToolRetryAction, IdleReason, PolicyConfig, ToolGuard, DefaultAgentPolicyOpts } from './AgentPolicy';
|
|
7
7
|
export { defaultToolGuards } from './AgentPolicy';
|
|
8
8
|
export { CallingAgent } from './context';
|
|
9
9
|
export { Source, NULL_SCORER } from './source';
|
|
@@ -17,7 +17,7 @@ export { diverge } from './diverge';
|
|
|
17
17
|
export { useAgentPool, ContextPressure } from './agent-pool';
|
|
18
18
|
export { createToolkit } from './toolkit';
|
|
19
19
|
export { initAgents } from './init';
|
|
20
|
-
export {
|
|
20
|
+
export { withSpine } from './spine';
|
|
21
21
|
export { NullTraceWriter, JsonlTraceWriter } from './trace-writer';
|
|
22
22
|
export { traceScope } from './trace-scope';
|
|
23
23
|
export { composePrompt, renderPrompt, renderTemplate } from './prompt';
|
|
@@ -25,12 +25,16 @@ export type { PromptState, PromptSection, PromptStep } from './prompt';
|
|
|
25
25
|
export { reduce } from './combinators';
|
|
26
26
|
export { parallel, chain, fanout, dag } from './orchestrators';
|
|
27
27
|
export type { SpawnSpec, ChainStep, DAGNode, Orchestrator, PoolContext } from './orchestrators';
|
|
28
|
-
export {
|
|
28
|
+
export { extractSpineSeed, extractSpineCheckpoint, reconstructBranch } from './replay';
|
|
29
29
|
export type { BranchCheckpoint } from './replay';
|
|
30
30
|
export type { Toolkit } from './toolkit';
|
|
31
31
|
export type { TraceWriter } from './trace-writer';
|
|
32
32
|
export type { TraceEvent, TraceId } from './trace-types';
|
|
33
33
|
export type { AgentHandle } from './init';
|
|
34
|
-
export type {
|
|
34
|
+
export type { SpineOptions } from './spine';
|
|
35
35
|
export type { TraceToken, JsonSchema, ToolSchema, ToolContext, PressureThresholds, AgentTaskSpec, AgentPoolOptions, AgentResult, AgentPoolResult, DivergeOptions, DivergeAttempt, DivergeResult, AgentEvent, } from './types';
|
|
36
|
+
export type { App, AppManifest, AppProtocol, AppHints, AppRegistry, AppFactory, AppState, AgentRenderCtx, ExamplesRenderCtx, SkillTemplateFn, ExamplesTemplateFn, ConfigFlow, } from './app-types';
|
|
37
|
+
export type { AppConfigStore } from './app-config';
|
|
38
|
+
export type { GrantStore } from './grant-store';
|
|
39
|
+
export type { Resource, Chunk, ScoredChunk, ScoredResult, Reranker } from './chunk';
|
|
36
40
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,KAAK,EACL,MAAM,EACN,KAAK,EACL,WAAW,EACX,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC5K,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,YAAY,E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AAW,EACX,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,UAAU,GACX,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,GAAG,EACH,WAAW,EACX,WAAW,EACX,QAAQ,EACR,WAAW,EACX,UAAU,EACV,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reconstructBranch = exports.extractSpineCheckpoint = exports.
|
|
3
|
+
exports.reconstructBranch = exports.extractSpineCheckpoint = exports.extractSpineSeed = exports.dag = exports.fanout = exports.chain = exports.parallel = exports.reduce = exports.renderTemplate = exports.renderPrompt = exports.composePrompt = exports.traceScope = exports.JsonlTraceWriter = exports.NullTraceWriter = exports.withSpine = exports.initAgents = exports.createToolkit = exports.ContextPressure = exports.useAgentPool = exports.diverge = exports.agentPool = exports.agent = exports.useAgent = exports.buildToolResultDelta = exports.buildUserDelta = exports.NULL_SCORER = exports.Source = exports.CallingAgent = exports.defaultToolGuards = exports.DefaultAgentPolicy = exports.Agent = exports.ToolRetryError = exports.Tool = exports.GrantStoreCtx = exports.AppConfigStoreCtx = exports.AppRegistryCtx = exports.RerankerCtx = exports.TraceParent = exports.Trace = exports.Events = exports.Store = exports.Ctx = void 0;
|
|
4
4
|
var context_1 = require("./context");
|
|
5
5
|
Object.defineProperty(exports, "Ctx", { enumerable: true, get: function () { return context_1.Ctx; } });
|
|
6
6
|
Object.defineProperty(exports, "Store", { enumerable: true, get: function () { return context_1.Store; } });
|
|
7
7
|
Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return context_1.Events; } });
|
|
8
8
|
Object.defineProperty(exports, "Trace", { enumerable: true, get: function () { return context_1.Trace; } });
|
|
9
9
|
Object.defineProperty(exports, "TraceParent", { enumerable: true, get: function () { return context_1.TraceParent; } });
|
|
10
|
-
Object.defineProperty(exports, "
|
|
10
|
+
Object.defineProperty(exports, "RerankerCtx", { enumerable: true, get: function () { return context_1.RerankerCtx; } });
|
|
11
|
+
Object.defineProperty(exports, "AppRegistryCtx", { enumerable: true, get: function () { return context_1.AppRegistryCtx; } });
|
|
12
|
+
Object.defineProperty(exports, "AppConfigStoreCtx", { enumerable: true, get: function () { return context_1.AppConfigStoreCtx; } });
|
|
13
|
+
Object.defineProperty(exports, "GrantStoreCtx", { enumerable: true, get: function () { return context_1.GrantStoreCtx; } });
|
|
11
14
|
var Tool_1 = require("./Tool");
|
|
12
15
|
Object.defineProperty(exports, "Tool", { enumerable: true, get: function () { return Tool_1.Tool; } });
|
|
16
|
+
Object.defineProperty(exports, "ToolRetryError", { enumerable: true, get: function () { return Tool_1.ToolRetryError; } });
|
|
13
17
|
var Agent_1 = require("./Agent");
|
|
14
18
|
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_1.Agent; } });
|
|
15
19
|
var AgentPolicy_1 = require("./AgentPolicy");
|
|
@@ -38,8 +42,8 @@ var toolkit_1 = require("./toolkit");
|
|
|
38
42
|
Object.defineProperty(exports, "createToolkit", { enumerable: true, get: function () { return toolkit_1.createToolkit; } });
|
|
39
43
|
var init_1 = require("./init");
|
|
40
44
|
Object.defineProperty(exports, "initAgents", { enumerable: true, get: function () { return init_1.initAgents; } });
|
|
41
|
-
var
|
|
42
|
-
Object.defineProperty(exports, "
|
|
45
|
+
var spine_1 = require("./spine");
|
|
46
|
+
Object.defineProperty(exports, "withSpine", { enumerable: true, get: function () { return spine_1.withSpine; } });
|
|
43
47
|
var trace_writer_1 = require("./trace-writer");
|
|
44
48
|
Object.defineProperty(exports, "NullTraceWriter", { enumerable: true, get: function () { return trace_writer_1.NullTraceWriter; } });
|
|
45
49
|
Object.defineProperty(exports, "JsonlTraceWriter", { enumerable: true, get: function () { return trace_writer_1.JsonlTraceWriter; } });
|
|
@@ -57,7 +61,7 @@ Object.defineProperty(exports, "chain", { enumerable: true, get: function () { r
|
|
|
57
61
|
Object.defineProperty(exports, "fanout", { enumerable: true, get: function () { return orchestrators_1.fanout; } });
|
|
58
62
|
Object.defineProperty(exports, "dag", { enumerable: true, get: function () { return orchestrators_1.dag; } });
|
|
59
63
|
var replay_1 = require("./replay");
|
|
60
|
-
Object.defineProperty(exports, "
|
|
64
|
+
Object.defineProperty(exports, "extractSpineSeed", { enumerable: true, get: function () { return replay_1.extractSpineSeed; } });
|
|
61
65
|
Object.defineProperty(exports, "extractSpineCheckpoint", { enumerable: true, get: function () { return replay_1.extractSpineCheckpoint; } });
|
|
62
66
|
Object.defineProperty(exports, "reconstructBranch", { enumerable: true, get: function () { return replay_1.reconstructBranch; } });
|
|
63
67
|
//# 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":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAUmB;AATjB,8FAAA,GAAG,OAAA;AACH,gGAAA,KAAK,OAAA;AACL,iGAAA,MAAM,OAAA;AACN,gGAAA,KAAK,OAAA;AACL,sGAAA,WAAW,OAAA;AACX,sGAAA,WAAW,OAAA;AACX,yGAAA,cAAc,OAAA;AACd,4GAAA,iBAAiB,OAAA;AACjB,wGAAA,aAAa,OAAA;AAEf,+BAA8C;AAArC,4FAAA,IAAI,OAAA;AAAE,sGAAA,cAAc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
|
/**
|
|
5
5
|
* Spec for spawning a single agent under a {@link PoolContext}.
|
|
6
|
-
* `parent` defaults to `ctx.
|
|
6
|
+
* `parent` defaults to `ctx.spine`.
|
|
7
7
|
*
|
|
8
8
|
* @category Agents
|
|
9
9
|
*/
|
|
@@ -14,8 +14,15 @@ export interface SpawnSpec {
|
|
|
14
14
|
systemPrompt: string;
|
|
15
15
|
/** PRNG seed for sampler diversity. */
|
|
16
16
|
seed?: number;
|
|
17
|
-
/** Parent branch to fork from. Falls back to ctx.
|
|
17
|
+
/** Parent branch to fork from. Falls back to ctx.spine. */
|
|
18
18
|
parent?: Branch;
|
|
19
|
+
/**
|
|
20
|
+
* Non-enforcing label naming the App this spawn nominally belongs to
|
|
21
|
+
* Carried for trace attribution (`tool:authReject`) and
|
|
22
|
+
* harness UI only — tool access is gated by {@link Tool.protected} +
|
|
23
|
+
* session grants (the authGuard), not by app membership.
|
|
24
|
+
*/
|
|
25
|
+
assignedApp?: string;
|
|
19
26
|
}
|
|
20
27
|
/**
|
|
21
28
|
* Orchestrator-facing API surface exposed by {@link useAgentPool}.
|
|
@@ -27,17 +34,17 @@ export interface SpawnSpec {
|
|
|
27
34
|
* @category Agents
|
|
28
35
|
*/
|
|
29
36
|
export interface PoolContext {
|
|
30
|
-
/**
|
|
31
|
-
readonly
|
|
37
|
+
/** The pool's spine branch. Orchestrator-provided spawns fork from here by default. */
|
|
38
|
+
readonly spine: Branch;
|
|
32
39
|
/** Fork an agent branch, prefill its suffix, transition to active. Tick loop picks it up. */
|
|
33
40
|
spawn(spec: SpawnSpec): Operation<Agent>;
|
|
34
41
|
/** Suspend until agent.status becomes 'idle' | 'disposed'. Returns agent for chaining. */
|
|
35
42
|
waitFor(agent: Agent): Operation<Agent>;
|
|
36
43
|
/**
|
|
37
|
-
* Serialize a user+assistant turn and prefill it into
|
|
44
|
+
* Serialize a user+assistant turn and prefill it into the spine, advancing spine.position.
|
|
38
45
|
* No-op (returns 0) when assistantContent is empty.
|
|
39
46
|
*/
|
|
40
|
-
|
|
47
|
+
extendSpine(userContent: string, assistantContent: string): Operation<number>;
|
|
41
48
|
/** Whether another spawn with this suffix size would fit under current pressure. */
|
|
42
49
|
canFit(estimatedSuffixTokens: number): boolean;
|
|
43
50
|
}
|
|
@@ -82,7 +89,7 @@ export interface ChainStep {
|
|
|
82
89
|
/** Fires BEFORE `ctx.spawn` for this step. Use for "task starting" events. */
|
|
83
90
|
beforeSpawn?: () => Operation<void>;
|
|
84
91
|
/**
|
|
85
|
-
* Fires AFTER `ctx.
|
|
92
|
+
* Fires AFTER `ctx.extendSpine` for this step (or immediately after waitFor
|
|
86
93
|
* if no extension happened). Receives the number of tokens added to the
|
|
87
94
|
* spine (0 when no extension) and the root's position after any extension.
|
|
88
95
|
* Use for "task done" events with spine telemetry.
|
|
@@ -101,7 +108,7 @@ export interface ChainStep {
|
|
|
101
108
|
* ```ts
|
|
102
109
|
* yield* agentPool({
|
|
103
110
|
* tools: [...],
|
|
104
|
-
* parent:
|
|
111
|
+
* parent: querySpine,
|
|
105
112
|
* orchestrate: chain(researchTasks, (task, i) => ({
|
|
106
113
|
* task: { content: taskToContent(task), systemPrompt: renderWorker({ taskIndex: i }) },
|
|
107
114
|
* userContent: `Research task: ${task.description}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrators.d.ts","sourceRoot":"","sources":["../src/orchestrators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAQ,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,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;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC;IACpC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC;CACpE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EACrB,OAAO,CAAC,EAAE,EACV,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,KAC5C,YAaA,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,MAAM,GAAI,WAAW,SAAS,EAAE,SAAS,SAAS,EAAE,KAAG,YAajE,CAAC;AAEJ;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,GAAG,GAAI,OAAO,OAAO,EAAE,KAAG,YA0CtC,CAAC"}
|
package/dist/orchestrators.js
CHANGED
|
@@ -18,7 +18,7 @@ const effection_1 = require("effection");
|
|
|
18
18
|
* @category Agents
|
|
19
19
|
*/
|
|
20
20
|
const parallel = (tasks) => function* (ctx) {
|
|
21
|
-
const agents = yield* (0, effection_1.all)(tasks.map(t => ctx.spawn({ ...t, parent: t.parent ?? ctx.
|
|
21
|
+
const agents = yield* (0, effection_1.all)(tasks.map(t => ctx.spawn({ ...t, parent: t.parent ?? ctx.spine })));
|
|
22
22
|
yield* (0, effection_1.all)(agents.map(a => ctx.waitFor(a)));
|
|
23
23
|
};
|
|
24
24
|
exports.parallel = parallel;
|
|
@@ -34,7 +34,7 @@ exports.parallel = parallel;
|
|
|
34
34
|
* ```ts
|
|
35
35
|
* yield* agentPool({
|
|
36
36
|
* tools: [...],
|
|
37
|
-
* parent:
|
|
37
|
+
* parent: querySpine,
|
|
38
38
|
* orchestrate: chain(researchTasks, (task, i) => ({
|
|
39
39
|
* task: { content: taskToContent(task), systemPrompt: renderWorker({ taskIndex: i }) },
|
|
40
40
|
* userContent: `Research task: ${task.description}`,
|
|
@@ -49,12 +49,12 @@ const chain = (items, toStep) => function* (ctx) {
|
|
|
49
49
|
const step = toStep(item, i);
|
|
50
50
|
if (step.beforeSpawn)
|
|
51
51
|
yield* step.beforeSpawn();
|
|
52
|
-
const agent = yield* ctx.waitFor(yield* ctx.spawn({ ...step.task, parent: step.task.parent ?? ctx.
|
|
52
|
+
const agent = yield* ctx.waitFor(yield* ctx.spawn({ ...step.task, parent: step.task.parent ?? ctx.spine }));
|
|
53
53
|
const delta = agent.result && step.userContent
|
|
54
|
-
? yield* ctx.
|
|
54
|
+
? yield* ctx.extendSpine(step.userContent, agent.result)
|
|
55
55
|
: 0;
|
|
56
56
|
if (step.afterExtend)
|
|
57
|
-
yield* step.afterExtend(delta, ctx.
|
|
57
|
+
yield* step.afterExtend(delta, ctx.spine.position);
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
exports.chain = chain;
|
|
@@ -79,11 +79,11 @@ exports.chain = chain;
|
|
|
79
79
|
* @category Agents
|
|
80
80
|
*/
|
|
81
81
|
const fanout = (landscape, domains) => function* (ctx) {
|
|
82
|
-
const l = yield* ctx.waitFor(yield* ctx.spawn({ ...landscape.task, parent: landscape.task.parent ?? ctx.
|
|
82
|
+
const l = yield* ctx.waitFor(yield* ctx.spawn({ ...landscape.task, parent: landscape.task.parent ?? ctx.spine }));
|
|
83
83
|
if (l.result && landscape.userContent) {
|
|
84
|
-
yield* ctx.
|
|
84
|
+
yield* ctx.extendSpine(landscape.userContent, l.result);
|
|
85
85
|
}
|
|
86
|
-
const agents = yield* (0, effection_1.all)(domains.map(d => ctx.spawn({ ...d, parent: d.parent ?? ctx.
|
|
86
|
+
const agents = yield* (0, effection_1.all)(domains.map(d => ctx.spawn({ ...d, parent: d.parent ?? ctx.spine })));
|
|
87
87
|
yield* (0, effection_1.all)(agents.map(a => ctx.waitFor(a)));
|
|
88
88
|
};
|
|
89
89
|
exports.fanout = fanout;
|
|
@@ -123,9 +123,9 @@ const dag = (nodes) => {
|
|
|
123
123
|
for (const depId of n.dependsOn ?? []) {
|
|
124
124
|
yield* tasks.get(depId);
|
|
125
125
|
}
|
|
126
|
-
const agent = yield* ctx.waitFor(yield* ctx.spawn({ ...n.task, parent: n.task.parent ?? ctx.
|
|
126
|
+
const agent = yield* ctx.waitFor(yield* ctx.spawn({ ...n.task, parent: n.task.parent ?? ctx.spine }));
|
|
127
127
|
if (agent.result && n.userContent) {
|
|
128
|
-
yield* ctx.
|
|
128
|
+
yield* ctx.extendSpine(n.userContent, agent.result);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
for (const n of nodes) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrators.js","sourceRoot":"","sources":["../src/orchestrators.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;
|
|
1
|
+
{"version":3,"file":"orchestrators.js","sourceRoot":"","sources":["../src/orchestrators.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAkEvC,kEAAkE;AAElE;;;;;;;;;;;;;GAaG;AACI,MAAM,QAAQ,GAAG,CAAC,KAAkB,EAAgB,EAAE,CAC3D,QAAQ,CAAC,EAAE,GAAG;IACZ,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,IAAA,eAAG,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,EA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OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,OAAO;QAC5B,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC5F,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC1B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,SAAS,IAAI,EAAE;YAAE,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QACnE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/replay.d.ts
CHANGED
|
@@ -4,48 +4,48 @@ import type { TraceEvent } from './trace-types';
|
|
|
4
4
|
/**
|
|
5
5
|
* Serialized state needed to reconstruct a Branch deterministically.
|
|
6
6
|
*
|
|
7
|
-
* `
|
|
7
|
+
* `seedPrompt` is the tokenized prompt that initialized a spine — the
|
|
8
8
|
* full formatted chat template including system prompt and any tool schemas.
|
|
9
|
-
* Captured from `prompt:format` events with `role: '
|
|
9
|
+
* Captured from `prompt:format` events with `role: 'spine'`.
|
|
10
10
|
*
|
|
11
11
|
* `turns` is an ordered list of user/assistant turn pairs that were prefilled
|
|
12
|
-
* on top of the
|
|
12
|
+
* on top of the spine via {@link extendSpine}. Empty for pool-start replay
|
|
13
13
|
* (any orchestration shape that doesn't extend the spine — e.g. `parallel`);
|
|
14
14
|
* populated for spine-extending orchestrations (`chain`, `fanout`, `dag`).
|
|
15
15
|
*
|
|
16
16
|
* @category Agents
|
|
17
17
|
*/
|
|
18
18
|
export interface BranchCheckpoint {
|
|
19
|
-
|
|
19
|
+
seedPrompt: string;
|
|
20
20
|
turns: Array<{
|
|
21
21
|
userContent: string;
|
|
22
22
|
assistantContent: string;
|
|
23
23
|
}>;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Extract the
|
|
26
|
+
* Extract the spine seed prompt from a trace, with no spine extensions.
|
|
27
27
|
*
|
|
28
28
|
* Useful for replaying parallel orchestrations, or for forking a fresh
|
|
29
29
|
* agent off the same pool-start state for A/B experiments.
|
|
30
30
|
*
|
|
31
31
|
* @param events - parsed JSONL trace events, in emission order
|
|
32
|
-
* @throws If no `prompt:format` event with `role: '
|
|
32
|
+
* @throws If no `prompt:format` event with `role: 'spine'` is found.
|
|
33
33
|
*
|
|
34
34
|
* @category Agents
|
|
35
35
|
*/
|
|
36
|
-
export declare function
|
|
36
|
+
export declare function extractSpineSeed(events: TraceEvent[]): BranchCheckpoint;
|
|
37
37
|
/**
|
|
38
|
-
* Extract a full spine checkpoint —
|
|
39
|
-
* event in emission order.
|
|
38
|
+
* Extract a full spine checkpoint — spine seed prompt plus every
|
|
39
|
+
* `spine:extend` event in emission order.
|
|
40
40
|
*
|
|
41
41
|
* When `opts.poolTraceId` is set, only spine extensions under that pool's
|
|
42
42
|
* scope are included (useful when a trace contains multiple nested or
|
|
43
43
|
* sequential pools with independent spines — typically the research pool
|
|
44
|
-
* vs. a later synthesis pool, both extending their own
|
|
44
|
+
* vs. a later synthesis pool, both extending their own spines).
|
|
45
45
|
*
|
|
46
46
|
* @param events - parsed JSONL trace events, in emission order
|
|
47
47
|
* @param opts.poolTraceId - filter extensions to this pool's scope
|
|
48
|
-
* @throws If no
|
|
48
|
+
* @throws If no spine seed prompt is found.
|
|
49
49
|
*
|
|
50
50
|
* @category Agents
|
|
51
51
|
*/
|
|
@@ -55,11 +55,11 @@ export declare function extractSpineCheckpoint(events: TraceEvent[], opts?: {
|
|
|
55
55
|
/**
|
|
56
56
|
* Materialize a Branch reflecting the checkpointed state.
|
|
57
57
|
*
|
|
58
|
-
* Creates a fresh
|
|
59
|
-
* the tokenized
|
|
58
|
+
* Creates a fresh spine at position 0 in the active `SessionContext`, prefills
|
|
59
|
+
* the tokenized seed prompt, then applies each turn delta via `buildTurnDelta`
|
|
60
60
|
* + `store.prefill`. Registers an `ensure()` so the subtree is pruned when
|
|
61
61
|
* the caller's scope exits — lifetime follows the enclosing `scoped()` or
|
|
62
|
-
* `resource()`, matching how `
|
|
62
|
+
* `resource()`, matching how `withSpine` manages its own spine.
|
|
63
63
|
*
|
|
64
64
|
* Pass the returned branch as `parent` to `agentPool` to run a replacement
|
|
65
65
|
* stage (synth re-run, single-agent replay with modified prompt, etc.) against
|
|
@@ -68,10 +68,10 @@ export declare function extractSpineCheckpoint(events: TraceEvent[], opts?: {
|
|
|
68
68
|
* @example Replay a pool-start (parallel orchestration) with a modified task
|
|
69
69
|
* ```ts
|
|
70
70
|
* const events = parseTrace(tracePath);
|
|
71
|
-
* const checkpoint =
|
|
72
|
-
* const
|
|
71
|
+
* const checkpoint = extractSpineSeed(events);
|
|
72
|
+
* const spine = yield* reconstructBranch(checkpoint);
|
|
73
73
|
* yield* agentPool({
|
|
74
|
-
* parent:
|
|
74
|
+
* parent: spine,
|
|
75
75
|
* orchestrate: parallel([{ content: modifiedTask, systemPrompt: modifiedSys }]),
|
|
76
76
|
* ...
|
|
77
77
|
* });
|
|
@@ -81,9 +81,9 @@ export declare function extractSpineCheckpoint(events: TraceEvent[], opts?: {
|
|
|
81
81
|
* ```ts
|
|
82
82
|
* const events = parseTrace(tracePath);
|
|
83
83
|
* const checkpoint = extractSpineCheckpoint(events);
|
|
84
|
-
* const
|
|
84
|
+
* const spine = yield* reconstructBranch(checkpoint);
|
|
85
85
|
* yield* agentPool({
|
|
86
|
-
* parent:
|
|
86
|
+
* parent: spine,
|
|
87
87
|
* orchestrate: parallel([{ content: SYNTHESIZE.user }]),
|
|
88
88
|
* systemPrompt: SYNTHESIZE.system,
|
|
89
89
|
* ...
|
package/dist/replay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAkB,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAkB,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAWvE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,UAAU,EAAE,EACpB,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,gBAAgB,CASlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAiB,iBAAiB,CAAC,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,CAgBlF"}
|
package/dist/replay.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.extractSpineSeed = extractSpineSeed;
|
|
4
4
|
exports.extractSpineCheckpoint = extractSpineCheckpoint;
|
|
5
5
|
exports.reconstructBranch = reconstructBranch;
|
|
6
6
|
const effection_1 = require("effection");
|
|
7
7
|
const sdk_1 = require("@lloyal-labs/sdk");
|
|
8
8
|
const context_1 = require("./context");
|
|
9
9
|
/**
|
|
10
|
-
* Extract the
|
|
10
|
+
* Extract the spine seed prompt from a trace, with no spine extensions.
|
|
11
11
|
*
|
|
12
12
|
* Useful for replaying parallel orchestrations, or for forking a fresh
|
|
13
13
|
* agent off the same pool-start state for A/B experiments.
|
|
14
14
|
*
|
|
15
15
|
* @param events - parsed JSONL trace events, in emission order
|
|
16
|
-
* @throws If no `prompt:format` event with `role: '
|
|
16
|
+
* @throws If no `prompt:format` event with `role: 'spine'` is found.
|
|
17
17
|
*
|
|
18
18
|
* @category Agents
|
|
19
19
|
*/
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
23
|
-
throw new Error('
|
|
20
|
+
function extractSpineSeed(events) {
|
|
21
|
+
const seed = events.find((e) => e.type === 'prompt:format' && e.role === 'spine');
|
|
22
|
+
if (!seed) {
|
|
23
|
+
throw new Error('extractSpineSeed: no prompt:format event with role=spine found in trace');
|
|
24
24
|
}
|
|
25
|
-
return {
|
|
25
|
+
return { seedPrompt: seed.promptText, turns: [] };
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Extract a full spine checkpoint —
|
|
29
|
-
* event in emission order.
|
|
28
|
+
* Extract a full spine checkpoint — spine seed prompt plus every
|
|
29
|
+
* `spine:extend` event in emission order.
|
|
30
30
|
*
|
|
31
31
|
* When `opts.poolTraceId` is set, only spine extensions under that pool's
|
|
32
32
|
* scope are included (useful when a trace contains multiple nested or
|
|
33
33
|
* sequential pools with independent spines — typically the research pool
|
|
34
|
-
* vs. a later synthesis pool, both extending their own
|
|
34
|
+
* vs. a later synthesis pool, both extending their own spines).
|
|
35
35
|
*
|
|
36
36
|
* @param events - parsed JSONL trace events, in emission order
|
|
37
37
|
* @param opts.poolTraceId - filter extensions to this pool's scope
|
|
38
|
-
* @throws If no
|
|
38
|
+
* @throws If no spine seed prompt is found.
|
|
39
39
|
*
|
|
40
40
|
* @category Agents
|
|
41
41
|
*/
|
|
42
42
|
function extractSpineCheckpoint(events, opts = {}) {
|
|
43
|
-
const
|
|
43
|
+
const seed = extractSpineSeed(events);
|
|
44
44
|
const turns = [];
|
|
45
45
|
for (const e of events) {
|
|
46
46
|
if (e.type !== 'spine:extend')
|
|
@@ -49,16 +49,16 @@ function extractSpineCheckpoint(events, opts = {}) {
|
|
|
49
49
|
continue;
|
|
50
50
|
turns.push({ userContent: e.userContent, assistantContent: e.assistantContent });
|
|
51
51
|
}
|
|
52
|
-
return {
|
|
52
|
+
return { seedPrompt: seed.seedPrompt, turns };
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Materialize a Branch reflecting the checkpointed state.
|
|
56
56
|
*
|
|
57
|
-
* Creates a fresh
|
|
58
|
-
* the tokenized
|
|
57
|
+
* Creates a fresh spine at position 0 in the active `SessionContext`, prefills
|
|
58
|
+
* the tokenized seed prompt, then applies each turn delta via `buildTurnDelta`
|
|
59
59
|
* + `store.prefill`. Registers an `ensure()` so the subtree is pruned when
|
|
60
60
|
* the caller's scope exits — lifetime follows the enclosing `scoped()` or
|
|
61
|
-
* `resource()`, matching how `
|
|
61
|
+
* `resource()`, matching how `withSpine` manages its own spine.
|
|
62
62
|
*
|
|
63
63
|
* Pass the returned branch as `parent` to `agentPool` to run a replacement
|
|
64
64
|
* stage (synth re-run, single-agent replay with modified prompt, etc.) against
|
|
@@ -67,10 +67,10 @@ function extractSpineCheckpoint(events, opts = {}) {
|
|
|
67
67
|
* @example Replay a pool-start (parallel orchestration) with a modified task
|
|
68
68
|
* ```ts
|
|
69
69
|
* const events = parseTrace(tracePath);
|
|
70
|
-
* const checkpoint =
|
|
71
|
-
* const
|
|
70
|
+
* const checkpoint = extractSpineSeed(events);
|
|
71
|
+
* const spine = yield* reconstructBranch(checkpoint);
|
|
72
72
|
* yield* agentPool({
|
|
73
|
-
* parent:
|
|
73
|
+
* parent: spine,
|
|
74
74
|
* orchestrate: parallel([{ content: modifiedTask, systemPrompt: modifiedSys }]),
|
|
75
75
|
* ...
|
|
76
76
|
* });
|
|
@@ -80,9 +80,9 @@ function extractSpineCheckpoint(events, opts = {}) {
|
|
|
80
80
|
* ```ts
|
|
81
81
|
* const events = parseTrace(tracePath);
|
|
82
82
|
* const checkpoint = extractSpineCheckpoint(events);
|
|
83
|
-
* const
|
|
83
|
+
* const spine = yield* reconstructBranch(checkpoint);
|
|
84
84
|
* yield* agentPool({
|
|
85
|
-
* parent:
|
|
85
|
+
* parent: spine,
|
|
86
86
|
* orchestrate: parallel([{ content: SYNTHESIZE.user }]),
|
|
87
87
|
* systemPrompt: SYNTHESIZE.system,
|
|
88
88
|
* ...
|
|
@@ -94,15 +94,15 @@ function extractSpineCheckpoint(events, opts = {}) {
|
|
|
94
94
|
function* reconstructBranch(checkpoint) {
|
|
95
95
|
const ctx = yield* context_1.Ctx.expect();
|
|
96
96
|
const store = yield* context_1.Store.expect();
|
|
97
|
-
const
|
|
98
|
-
yield* (0, effection_1.ensure)(() => { if (!
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
yield* (0, effection_1.call)(() =>
|
|
97
|
+
const spine = sdk_1.Branch.create(ctx, 0, {});
|
|
98
|
+
yield* (0, effection_1.ensure)(() => { if (!spine.disposed)
|
|
99
|
+
spine.pruneSubtreeSync(); });
|
|
100
|
+
const seedTokens = ctx.tokenizeSync(checkpoint.seedPrompt, false);
|
|
101
|
+
yield* (0, effection_1.call)(() => spine.prefill(seedTokens));
|
|
102
102
|
for (const turn of checkpoint.turns) {
|
|
103
103
|
const delta = (0, sdk_1.buildTurnDelta)(ctx, turn.userContent, turn.assistantContent);
|
|
104
|
-
yield* (0, effection_1.call)(() => store.prefill([[
|
|
104
|
+
yield* (0, effection_1.call)(() => store.prefill([[spine, delta]]));
|
|
105
105
|
}
|
|
106
|
-
return
|
|
106
|
+
return spine;
|
|
107
107
|
}
|
|
108
108
|
//# sourceMappingURL=replay.js.map
|
package/dist/replay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":";;AAoCA,
|
|
1
|
+
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":";;AAoCA,4CAWC;AAiBD,wDAYC;AA0CD,8CAgBC;AAtID,yCAAyC;AAEzC,0CAA0D;AAC1D,uCAAuC;AAsBvC;;;;;;;;;;GAUG;AACH,SAAgB,gBAAgB,CAAC,MAAoB;IACnD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CACtB,CAAC,CAAC,EAAuD,EAAE,CACzD,CAAC,CAAC,IAAI,KAAK,eAAe,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,CACnD,CAAC;IACF,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AACpD,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,sBAAsB,CACpC,MAAoB,EACpB,OAAiC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