@lloyal-labs/lloyal-agents 1.2.2 → 1.3.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/dist/Agent.d.ts +165 -0
- package/dist/Agent.d.ts.map +1 -0
- package/dist/Agent.js +160 -0
- package/dist/Agent.js.map +1 -0
- package/dist/AgentPolicy.d.ts +125 -0
- package/dist/AgentPolicy.d.ts.map +1 -0
- package/dist/AgentPolicy.js +109 -0
- package/dist/AgentPolicy.js.map +1 -0
- package/dist/agent-pool.d.ts.map +1 -1
- package/dist/agent-pool.js +184 -117
- package/dist/agent-pool.js.map +1 -1
- package/dist/context.d.ts +15 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +15 -1
- package/dist/context.js.map +1 -1
- package/dist/diverge.js +1 -1
- package/dist/diverge.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/prompt.d.ts +77 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +55 -0
- package/dist/prompt.js.map +1 -0
- package/dist/shared-root.d.ts +22 -25
- package/dist/shared-root.d.ts.map +1 -1
- package/dist/shared-root.js +32 -31
- package/dist/shared-root.js.map +1 -1
- package/dist/types.d.ts +31 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
package/dist/context.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ScratchpadParent = exports.TraceParent = exports.Trace = exports.Events = exports.Store = exports.Ctx = void 0;
|
|
3
|
+
exports.CallingAgent = exports.ScratchpadParent = exports.TraceParent = exports.Trace = exports.Events = exports.Store = exports.Ctx = void 0;
|
|
4
4
|
const effection_1 = require("effection");
|
|
5
5
|
/**
|
|
6
6
|
* Effection context holding the active {@link SessionContext}
|
|
@@ -60,4 +60,18 @@ exports.TraceParent = (0, effection_1.createContext)('lloyal.traceParent');
|
|
|
60
60
|
* @category Agents
|
|
61
61
|
*/
|
|
62
62
|
exports.ScratchpadParent = (0, effection_1.createContext)('lloyal.scratchpadParent');
|
|
63
|
+
/**
|
|
64
|
+
* Effection context holding the calling agent during DISPATCH
|
|
65
|
+
*
|
|
66
|
+
* Set by the pool before each tool execution in `scoped()`. Tools and
|
|
67
|
+
* recursive `withSharedRoot` calls read this to access the calling
|
|
68
|
+
* agent's branch (for Continuous Context forking) and tool history
|
|
69
|
+
* (for deduplication guards).
|
|
70
|
+
*
|
|
71
|
+
* Scope-isolated: each `scoped()` DISPATCH sees only its own agent.
|
|
72
|
+
* Nested pools (web_research) shadow the parent's context correctly.
|
|
73
|
+
*
|
|
74
|
+
* @category Agents
|
|
75
|
+
*/
|
|
76
|
+
exports.CallingAgent = (0, effection_1.createContext)('lloyal.callingAgent');
|
|
63
77
|
//# sourceMappingURL=context.js.map
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;AAAA,yCAA0C;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;AAAA,yCAA0C;AAS1C;;;;;;;;GAQG;AACU,QAAA,GAAG,GAAG,IAAA,yBAAa,EAAiB,YAAY,CAAC,CAAC;AAE/D;;;;;;;GAOG;AACU,QAAA,KAAK,GAAG,IAAA,yBAAa,EAAc,cAAc,CAAC,CAAC;AAEhE;;;;;;;GAOG;AACU,QAAA,MAAM,GAAG,IAAA,yBAAa,EAA4B,eAAe,CAAC,CAAC;AAEhF;;;;;;;GAOG;AACU,QAAA,KAAK,GAAG,IAAA,yBAAa,EAAc,cAAc,CAAC,CAAC;AAEhE;;;;;;;;GAQG;AACU,QAAA,WAAW,GAAG,IAAA,yBAAa,EAAU,oBAAoB,CAAC,CAAC;AAExE;;;;;;;;;GASG;AACU,QAAA,gBAAgB,GAAG,IAAA,yBAAa,EAAS,yBAAyB,CAAC,CAAC;AAEjF;;;;;;;;;;;;GAYG;AACU,QAAA,YAAY,GAAG,IAAA,yBAAa,EAAQ,qBAAqB,CAAC,CAAC"}
|
package/dist/diverge.js
CHANGED
|
@@ -81,7 +81,7 @@ function* diverge(opts) {
|
|
|
81
81
|
catch { /* already gone */ }
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
branch.reseedSampler(2000 + i);
|
|
84
|
+
branch.reseedSampler((opts.seedBase ?? 2000) + i);
|
|
85
85
|
live.push({ branch, output: '', done: false, tokenCount: 0, ppl: Infinity });
|
|
86
86
|
}
|
|
87
87
|
// Batched generation — produceSync/commit loop
|
package/dist/diverge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diverge.js","sourceRoot":"","sources":["../src/diverge.ts"],"names":[],"mappings":";;AA0CA,0BAsGC;AAhJD,yCAAyC;AAEzC,0CAA0C;AAC1C,uCAAuC;AACvC,6CAA+C;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,QAAe,CAAC,CAAC,OAAO,CAAC,IAAoB;IAC3C,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,aAAG,CAAC,MAAM,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,eAAK,CAAC,MAAM,EAAE,CAAC;IAEpC,mEAAmE;IACnE,IAAI,IAAY,CAAC;IACjB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,YAAoB,CAAC;IAEzB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;QACnB,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAA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EAAE,CAAC;QACrC,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YAC9C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,8DAA8D;IAC9D,sDAAsD;IACtD,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAqB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAChD,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,GAAG,EAAE,CAAC,CAAC,GAAG;KACX,CAAC,CAAC,CAAC;IAEJ,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM;QAC1B,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM;QAChC,QAAQ;QACR,WAAW;QACX,KAAK;QACL,YAAY;KACb,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export { Ctx, Store, Events, Trace, TraceParent, ScratchpadParent } from './context';
|
|
2
2
|
export { Tool } from './Tool';
|
|
3
|
+
export { Agent } from './Agent';
|
|
4
|
+
export type { AgentStatus, FindingsSource, FormatConfig, ToolHistoryEntry } from './Agent';
|
|
5
|
+
export { DefaultAgentPolicy } from './AgentPolicy';
|
|
6
|
+
export type { AgentPolicy, ProduceAction, SettleAction, IdleReason, PolicyConfig, ToolGuard, DefaultAgentPolicyOpts } from './AgentPolicy';
|
|
7
|
+
export { defaultToolGuards } from './AgentPolicy';
|
|
8
|
+
export { CallingAgent } from './context';
|
|
3
9
|
export { Source } from './source';
|
|
4
10
|
export { buildUserDelta, buildToolResultDelta } from '@lloyal-labs/sdk';
|
|
5
11
|
export { prepare, generate } from './generate';
|
|
@@ -11,6 +17,8 @@ export { initAgents } from './init';
|
|
|
11
17
|
export { withSharedRoot } from './shared-root';
|
|
12
18
|
export { NullTraceWriter, JsonlTraceWriter } from './trace-writer';
|
|
13
19
|
export { traceScope } from './trace-scope';
|
|
20
|
+
export { composePrompt, renderPrompt, renderTemplate } from './prompt';
|
|
21
|
+
export type { PromptState, PromptSection, PromptStep } from './prompt';
|
|
14
22
|
export type { Toolkit } from './toolkit';
|
|
15
23
|
export type { TraceWriter } from './trace-writer';
|
|
16
24
|
export type { TraceEvent, TraceId } from './trace-types';
|
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,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,SAAS,EA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AS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACvE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEvE,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,YAAY,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EACb,UAAU,GACX,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.traceScope = exports.JsonlTraceWriter = exports.NullTraceWriter = exports.withSharedRoot = exports.initAgents = exports.createToolkit = exports.runAgents = exports.ContextPressure = exports.useAgentPool = exports.diverge = exports.generate = exports.prepare = exports.buildToolResultDelta = exports.buildUserDelta = exports.Source = exports.Tool = exports.ScratchpadParent = exports.TraceParent = exports.Trace = exports.Events = exports.Store = exports.Ctx = void 0;
|
|
3
|
+
exports.renderTemplate = exports.renderPrompt = exports.composePrompt = exports.traceScope = exports.JsonlTraceWriter = exports.NullTraceWriter = exports.withSharedRoot = exports.initAgents = exports.createToolkit = exports.runAgents = exports.ContextPressure = exports.useAgentPool = exports.diverge = exports.generate = exports.prepare = exports.buildToolResultDelta = exports.buildUserDelta = exports.Source = exports.CallingAgent = exports.defaultToolGuards = exports.DefaultAgentPolicy = exports.Agent = exports.Tool = exports.ScratchpadParent = 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; } });
|
|
@@ -10,6 +10,14 @@ Object.defineProperty(exports, "TraceParent", { enumerable: true, get: function
|
|
|
10
10
|
Object.defineProperty(exports, "ScratchpadParent", { enumerable: true, get: function () { return context_1.ScratchpadParent; } });
|
|
11
11
|
var Tool_1 = require("./Tool");
|
|
12
12
|
Object.defineProperty(exports, "Tool", { enumerable: true, get: function () { return Tool_1.Tool; } });
|
|
13
|
+
var Agent_1 = require("./Agent");
|
|
14
|
+
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_1.Agent; } });
|
|
15
|
+
var AgentPolicy_1 = require("./AgentPolicy");
|
|
16
|
+
Object.defineProperty(exports, "DefaultAgentPolicy", { enumerable: true, get: function () { return AgentPolicy_1.DefaultAgentPolicy; } });
|
|
17
|
+
var AgentPolicy_2 = require("./AgentPolicy");
|
|
18
|
+
Object.defineProperty(exports, "defaultToolGuards", { enumerable: true, get: function () { return AgentPolicy_2.defaultToolGuards; } });
|
|
19
|
+
var context_2 = require("./context");
|
|
20
|
+
Object.defineProperty(exports, "CallingAgent", { enumerable: true, get: function () { return context_2.CallingAgent; } });
|
|
13
21
|
var source_1 = require("./source");
|
|
14
22
|
Object.defineProperty(exports, "Source", { enumerable: true, get: function () { return source_1.Source; } });
|
|
15
23
|
var sdk_1 = require("@lloyal-labs/sdk");
|
|
@@ -36,4 +44,8 @@ Object.defineProperty(exports, "NullTraceWriter", { enumerable: true, get: funct
|
|
|
36
44
|
Object.defineProperty(exports, "JsonlTraceWriter", { enumerable: true, get: function () { return trace_writer_1.JsonlTraceWriter; } });
|
|
37
45
|
var trace_scope_1 = require("./trace-scope");
|
|
38
46
|
Object.defineProperty(exports, "traceScope", { enumerable: true, get: function () { return trace_scope_1.traceScope; } });
|
|
47
|
+
var prompt_1 = require("./prompt");
|
|
48
|
+
Object.defineProperty(exports, "composePrompt", { enumerable: true, get: function () { return prompt_1.composePrompt; } });
|
|
49
|
+
Object.defineProperty(exports, "renderPrompt", { enumerable: true, get: function () { return prompt_1.renderPrompt; } });
|
|
50
|
+
Object.defineProperty(exports, "renderTemplate", { enumerable: true, get: function () { return prompt_1.renderTemplate; } });
|
|
39
51
|
//# 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,qCAAqF;AAA5E,8FAAA,GAAG,OAAA;AAAE,gGAAA,KAAK,OAAA;AAAE,iGAAA,MAAM,OAAA;AAAE,gGAAA,KAAK,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,2GAAA,gBAAgB,OAAA;AACjE,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,wCAAwE;AAA/D,qGAAA,cAAc,OAAA;AAAE,2GAAA,oBAAoB,OAAA;AAC7C,uCAA+C;AAAtC,mGAAA,OAAO,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAC1B,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,2CAA6D;AAApD,0GAAA,YAAY,OAAA;AAAE,6GAAA,eAAe,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A,gBAAgB,OAAA;AAC1C,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,mCAAuE;AAA9D,uGAAA,aAAa,OAAA;AAAE,sGAAA,YAAY,OAAA;AAAE,wGAAA,cAAc,OAAA"}
|
package/dist/prompt.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Tool } from './Tool';
|
|
2
|
+
/**
|
|
3
|
+
* A named content section in a composed prompt.
|
|
4
|
+
*
|
|
5
|
+
* @category Agents
|
|
6
|
+
*/
|
|
7
|
+
export interface PromptSection {
|
|
8
|
+
heading: string;
|
|
9
|
+
content: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Accumulated prompt state built by composing {@link PromptStep}s.
|
|
13
|
+
*
|
|
14
|
+
* - `clauses` — system prompt fragments (joined with double newline)
|
|
15
|
+
* - `sections` — user content sections (each rendered as `heading:\n\ncontent`)
|
|
16
|
+
* - `tools` — tools available to the agent (fed to {@link createToolkit})
|
|
17
|
+
*
|
|
18
|
+
* @category Agents
|
|
19
|
+
*/
|
|
20
|
+
export interface PromptState {
|
|
21
|
+
clauses: string[];
|
|
22
|
+
sections: PromptSection[];
|
|
23
|
+
tools: Tool[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A pure function that transforms prompt state. Return the state
|
|
27
|
+
* unchanged to skip, or return a new state with additional clauses,
|
|
28
|
+
* sections, or tools. Steps are composed left-to-right via
|
|
29
|
+
* {@link composePrompt}.
|
|
30
|
+
*
|
|
31
|
+
* @category Agents
|
|
32
|
+
*/
|
|
33
|
+
export type PromptStep = (state: PromptState) => PromptState;
|
|
34
|
+
/**
|
|
35
|
+
* Reduce an array of {@link PromptStep}s over a base {@link PromptState}.
|
|
36
|
+
*
|
|
37
|
+
* Each step can conditionally add system clauses, user content sections,
|
|
38
|
+
* or tools based on inference state. Steps that return the state unchanged
|
|
39
|
+
* are no-ops.
|
|
40
|
+
*
|
|
41
|
+
* @category Agents
|
|
42
|
+
*/
|
|
43
|
+
export declare const composePrompt: (base: PromptState, steps: PromptStep[]) => PromptState;
|
|
44
|
+
/**
|
|
45
|
+
* Render a {@link PromptState} into system and user content strings
|
|
46
|
+
* suitable for `formatChatSync()`.
|
|
47
|
+
*
|
|
48
|
+
* @category Agents
|
|
49
|
+
*/
|
|
50
|
+
export declare const renderPrompt: (state: PromptState, query: string) => {
|
|
51
|
+
system: string;
|
|
52
|
+
content: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Render a template string with Eta. Templates use standard Eta/EJS
|
|
56
|
+
* syntax: `<%= it.var %>` for interpolation, `<% if (it.x) { %>` for
|
|
57
|
+
* conditionals, `<% it.arr.forEach(...) %>` for loops.
|
|
58
|
+
*
|
|
59
|
+
* Auto-escaping is disabled — templates produce prompt text, not HTML.
|
|
60
|
+
*
|
|
61
|
+
* @param template - Eta template string
|
|
62
|
+
* @param data - Variables available as `it.*` in the template
|
|
63
|
+
* @returns Rendered string
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const result = renderTemplate(
|
|
68
|
+
* 'Hello <%= it.name %><% if (it.age) { %>, age <%= it.age %><% } %>',
|
|
69
|
+
* { name: 'Alice', age: 30 },
|
|
70
|
+
* );
|
|
71
|
+
* // => "Hello Alice, age 30"
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @category Agents
|
|
75
|
+
*/
|
|
76
|
+
export declare const renderTemplate: (template: string, data: Record<string, unknown>) => string;
|
|
77
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAInC;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,WAAW,CAAC;AAE7D;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,WAAW,EACjB,OAAO,UAAU,EAAE,KAClB,WAAmD,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,WAAW,EAClB,OAAO,MAAM,KACZ;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAMlC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,MAAM,EAChB,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,MAA0C,CAAC"}
|
package/dist/prompt.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderTemplate = exports.renderPrompt = exports.composePrompt = void 0;
|
|
4
|
+
const eta_1 = require("eta");
|
|
5
|
+
const eta = new eta_1.Eta({ autoEscape: false });
|
|
6
|
+
/**
|
|
7
|
+
* Reduce an array of {@link PromptStep}s over a base {@link PromptState}.
|
|
8
|
+
*
|
|
9
|
+
* Each step can conditionally add system clauses, user content sections,
|
|
10
|
+
* or tools based on inference state. Steps that return the state unchanged
|
|
11
|
+
* are no-ops.
|
|
12
|
+
*
|
|
13
|
+
* @category Agents
|
|
14
|
+
*/
|
|
15
|
+
const composePrompt = (base, steps) => steps.reduce((s, fn) => fn(s), base);
|
|
16
|
+
exports.composePrompt = composePrompt;
|
|
17
|
+
/**
|
|
18
|
+
* Render a {@link PromptState} into system and user content strings
|
|
19
|
+
* suitable for `formatChatSync()`.
|
|
20
|
+
*
|
|
21
|
+
* @category Agents
|
|
22
|
+
*/
|
|
23
|
+
const renderPrompt = (state, query) => ({
|
|
24
|
+
system: state.clauses.join('\n\n'),
|
|
25
|
+
content: [
|
|
26
|
+
...state.sections.map((s) => `${s.heading}:\n\n${s.content}`),
|
|
27
|
+
query,
|
|
28
|
+
].join('\n\n---\n\n'),
|
|
29
|
+
});
|
|
30
|
+
exports.renderPrompt = renderPrompt;
|
|
31
|
+
/**
|
|
32
|
+
* Render a template string with Eta. Templates use standard Eta/EJS
|
|
33
|
+
* syntax: `<%= it.var %>` for interpolation, `<% if (it.x) { %>` for
|
|
34
|
+
* conditionals, `<% it.arr.forEach(...) %>` for loops.
|
|
35
|
+
*
|
|
36
|
+
* Auto-escaping is disabled — templates produce prompt text, not HTML.
|
|
37
|
+
*
|
|
38
|
+
* @param template - Eta template string
|
|
39
|
+
* @param data - Variables available as `it.*` in the template
|
|
40
|
+
* @returns Rendered string
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const result = renderTemplate(
|
|
45
|
+
* 'Hello <%= it.name %><% if (it.age) { %>, age <%= it.age %><% } %>',
|
|
46
|
+
* { name: 'Alice', age: 30 },
|
|
47
|
+
* );
|
|
48
|
+
* // => "Hello Alice, age 30"
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @category Agents
|
|
52
|
+
*/
|
|
53
|
+
const renderTemplate = (template, data) => eta.renderString(template, data);
|
|
54
|
+
exports.renderTemplate = renderTemplate;
|
|
55
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AAG1B,MAAM,GAAG,GAAG,IAAI,SAAG,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AAqC3C;;;;;;;;GAQG;AACI,MAAM,aAAa,GAAG,CAC3B,IAAiB,EACjB,KAAmB,EACN,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAH1C,QAAA,aAAa,iBAG6B;AAEvD;;;;;GAKG;AACI,MAAM,YAAY,GAAG,CAC1B,KAAkB,EAClB,KAAa,EACwB,EAAE,CAAC,CAAC;IACzC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE;QACP,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC;QAC7D,KAAK;KACN,CAAC,IAAI,CAAC,aAAa,CAAC;CACtB,CAAC,CAAC;AATU,QAAA,YAAY,gBAStB;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACI,MAAM,cAAc,GAAG,CAC5B,QAAgB,EAChB,IAA6B,EACrB,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAHjC,QAAA,cAAc,kBAGmB"}
|
package/dist/shared-root.d.ts
CHANGED
|
@@ -19,42 +19,39 @@ export interface SharedRootOptions {
|
|
|
19
19
|
* @default false
|
|
20
20
|
*/
|
|
21
21
|
enableScratchpad?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Fork root from this branch instead of creating at position 0.
|
|
24
|
+
*
|
|
25
|
+
* When provided, the root inherits the parent's full KV state —
|
|
26
|
+
* every tool call, tool result, and generated token the parent
|
|
27
|
+
* accumulated. The system prompt is prefilled as a delta on top.
|
|
28
|
+
* Sub-agents forking from this root attend over the parent's
|
|
29
|
+
* complete attention state (Continuous Context).
|
|
30
|
+
*
|
|
31
|
+
* When omitted, creates a fresh root at position 0 (cold start).
|
|
32
|
+
*/
|
|
33
|
+
parent?: Branch;
|
|
22
34
|
}
|
|
23
35
|
/**
|
|
24
36
|
* Scoped shared root branch with guaranteed cleanup
|
|
25
37
|
*
|
|
26
|
-
* Creates a root branch, prefills the system prompt, and passes
|
|
27
|
-
* the body function. The root is pruned via try/finally when the body
|
|
38
|
+
* Creates (or forks) a root branch, prefills the system prompt, and passes
|
|
39
|
+
* it to the body function. The root is pruned via try/finally when the body
|
|
28
40
|
* returns or throws, regardless of whether children still exist.
|
|
29
41
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* the body enables KV savings calculation.
|
|
42
|
+
* **Cold path** (no `parent`): creates root at position 0, prefills system
|
|
43
|
+
* prompt. Use for top-level research where no prior context exists.
|
|
33
44
|
*
|
|
34
|
-
*
|
|
45
|
+
* **Warm path** (`parent` provided): forks from parent branch, prefills
|
|
46
|
+
* system prompt as a delta. Sub-agents inherit the parent's full KV state.
|
|
47
|
+
* Use for recursive tools (web_research, research) where sub-agents should
|
|
48
|
+
* attend over the calling agent's accumulated evidence.
|
|
49
|
+
*
|
|
50
|
+
* @param opts - System prompt, tools, sampling parameters, and optional parent branch
|
|
35
51
|
* @param body - Operation that receives the root branch and prefix length.
|
|
36
52
|
* Typically calls {@link runAgents} or {@link useAgentPool} inside.
|
|
37
53
|
* @returns The body's return value
|
|
38
54
|
*
|
|
39
|
-
* @example Cold-path research with shared prefix
|
|
40
|
-
* ```typescript
|
|
41
|
-
* const { result, prefixLen } = yield* withSharedRoot(
|
|
42
|
-
* { systemPrompt: RESEARCH_PROMPT, tools: toolsJson },
|
|
43
|
-
* function*(root, prefixLen) {
|
|
44
|
-
* const result = yield* runAgents({
|
|
45
|
-
* tasks: questions.map(q => ({
|
|
46
|
-
* systemPrompt: RESEARCH_PROMPT,
|
|
47
|
-
* content: q,
|
|
48
|
-
* tools: toolsJson,
|
|
49
|
-
* parent: root,
|
|
50
|
-
* })),
|
|
51
|
-
* tools: toolMap,
|
|
52
|
-
* });
|
|
53
|
-
* return { result, prefixLen };
|
|
54
|
-
* },
|
|
55
|
-
* );
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
55
|
* @category Agents
|
|
59
56
|
*/
|
|
60
57
|
export declare function withSharedRoot<T>(opts: SharedRootOptions, body: (root: Branch, sharedPrefixLength: number) => Operation<T>): Operation<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-root.d.ts","sourceRoot":"","sources":["../src/shared-root.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"shared-root.d.ts","sourceRoot":"","sources":["../src/shared-root.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAiB,cAAc,CAAC,CAAC,EAC/B,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,GAC/D,SAAS,CAAC,CAAC,CAAC,CAkGd"}
|
package/dist/shared-root.js
CHANGED
|
@@ -8,38 +8,23 @@ const trace_scope_1 = require("./trace-scope");
|
|
|
8
8
|
/**
|
|
9
9
|
* Scoped shared root branch with guaranteed cleanup
|
|
10
10
|
*
|
|
11
|
-
* Creates a root branch, prefills the system prompt, and passes
|
|
12
|
-
* the body function. The root is pruned via try/finally when the body
|
|
11
|
+
* Creates (or forks) a root branch, prefills the system prompt, and passes
|
|
12
|
+
* it to the body function. The root is pruned via try/finally when the body
|
|
13
13
|
* returns or throws, regardless of whether children still exist.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* the body enables KV savings calculation.
|
|
15
|
+
* **Cold path** (no `parent`): creates root at position 0, prefills system
|
|
16
|
+
* prompt. Use for top-level research where no prior context exists.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
18
|
+
* **Warm path** (`parent` provided): forks from parent branch, prefills
|
|
19
|
+
* system prompt as a delta. Sub-agents inherit the parent's full KV state.
|
|
20
|
+
* Use for recursive tools (web_research, research) where sub-agents should
|
|
21
|
+
* attend over the calling agent's accumulated evidence.
|
|
22
|
+
*
|
|
23
|
+
* @param opts - System prompt, tools, sampling parameters, and optional parent branch
|
|
20
24
|
* @param body - Operation that receives the root branch and prefix length.
|
|
21
25
|
* Typically calls {@link runAgents} or {@link useAgentPool} inside.
|
|
22
26
|
* @returns The body's return value
|
|
23
27
|
*
|
|
24
|
-
* @example Cold-path research with shared prefix
|
|
25
|
-
* ```typescript
|
|
26
|
-
* const { result, prefixLen } = yield* withSharedRoot(
|
|
27
|
-
* { systemPrompt: RESEARCH_PROMPT, tools: toolsJson },
|
|
28
|
-
* function*(root, prefixLen) {
|
|
29
|
-
* const result = yield* runAgents({
|
|
30
|
-
* tasks: questions.map(q => ({
|
|
31
|
-
* systemPrompt: RESEARCH_PROMPT,
|
|
32
|
-
* content: q,
|
|
33
|
-
* tools: toolsJson,
|
|
34
|
-
* parent: root,
|
|
35
|
-
* })),
|
|
36
|
-
* tools: toolMap,
|
|
37
|
-
* });
|
|
38
|
-
* return { result, prefixLen };
|
|
39
|
-
* },
|
|
40
|
-
* );
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
28
|
* @category Agents
|
|
44
29
|
*/
|
|
45
30
|
function* withSharedRoot(opts, body) {
|
|
@@ -58,6 +43,7 @@ function* withSharedRoot(opts, body) {
|
|
|
58
43
|
const scope = (0, trace_scope_1.traceScope)(tw, parentTraceId, "withSharedRoot", {
|
|
59
44
|
hasTools: !!opts.tools,
|
|
60
45
|
systemPromptLength: opts.systemPrompt.length,
|
|
46
|
+
hasParent: !!opts.parent,
|
|
61
47
|
});
|
|
62
48
|
const messages = [{ role: "system", content: opts.systemPrompt }];
|
|
63
49
|
const fmtOpts = {
|
|
@@ -80,31 +66,46 @@ function* withSharedRoot(opts, body) {
|
|
|
80
66
|
grammar: fmt.grammar || undefined,
|
|
81
67
|
role: "sharedRoot",
|
|
82
68
|
});
|
|
83
|
-
|
|
69
|
+
// Warm path: fork from parent branch (inherits full KV state)
|
|
70
|
+
// Cold path: create fresh root at position 0
|
|
71
|
+
let root;
|
|
72
|
+
let prefillTokens;
|
|
73
|
+
if (opts.parent) {
|
|
74
|
+
root = opts.parent.forkSync();
|
|
75
|
+
// Warm path: parent already has system prompt + tools in KV.
|
|
76
|
+
// Only prefill turn separator — the prompt is inherited via fork.
|
|
77
|
+
// This saves ~760 tokens per recursive fork.
|
|
78
|
+
const sep = ctx.getTurnSeparator();
|
|
79
|
+
prefillTokens = sep;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
root = sdk_1.Branch.create(ctx, 0, opts.params ?? { temperature: 0.5 });
|
|
83
|
+
prefillTokens = sharedTokens;
|
|
84
|
+
}
|
|
84
85
|
tw.write({
|
|
85
86
|
traceId: tw.nextId(),
|
|
86
87
|
parentTraceId: scope.traceId,
|
|
87
88
|
ts: performance.now(),
|
|
88
89
|
type: "branch:create",
|
|
89
90
|
branchHandle: root.handle,
|
|
90
|
-
parentHandle: null,
|
|
91
|
-
position: 0,
|
|
91
|
+
parentHandle: opts.parent?.handle ?? null,
|
|
92
|
+
position: opts.parent ? opts.parent.position : 0,
|
|
92
93
|
role: "sharedRoot",
|
|
93
94
|
});
|
|
94
|
-
yield* (0, effection_1.call)(() => root.prefill(
|
|
95
|
+
yield* (0, effection_1.call)(() => root.prefill(prefillTokens));
|
|
95
96
|
tw.write({
|
|
96
97
|
traceId: tw.nextId(),
|
|
97
98
|
parentTraceId: scope.traceId,
|
|
98
99
|
ts: performance.now(),
|
|
99
100
|
type: "branch:prefill",
|
|
100
101
|
branchHandle: root.handle,
|
|
101
|
-
tokenCount:
|
|
102
|
+
tokenCount: prefillTokens.length,
|
|
102
103
|
role: "sharedPrefix",
|
|
103
104
|
});
|
|
104
105
|
try {
|
|
105
106
|
if (opts.enableScratchpad)
|
|
106
107
|
yield* context_1.ScratchpadParent.set(root);
|
|
107
|
-
return yield* body(root,
|
|
108
|
+
return yield* body(root, prefillTokens.length);
|
|
108
109
|
}
|
|
109
110
|
finally {
|
|
110
111
|
if (!root.disposed) {
|
package/dist/shared-root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-root.js","sourceRoot":"","sources":["../src/shared-root.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"shared-root.js","sourceRoot":"","sources":["../src/shared-root.ts"],"names":[],"mappings":";;AA8DA,wCAqGC;AAnKD,yCAAiC;AAEjC,0C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CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Branch } from '@lloyal-labs/sdk';
|
|
2
|
+
import type { AgentPolicy } from './AgentPolicy';
|
|
2
3
|
/**
|
|
3
4
|
* JSON Schema definition for tool parameter validation
|
|
4
5
|
*
|
|
@@ -50,6 +51,13 @@ export interface ToolSchema {
|
|
|
50
51
|
export interface ToolContext {
|
|
51
52
|
/** Stable agent identifier — branch handle at creation time */
|
|
52
53
|
agentId: number;
|
|
54
|
+
/**
|
|
55
|
+
* The calling agent's branch — use for recursive tools that spawn
|
|
56
|
+
* sub-agents via {@link withSharedRoot} with `parent` option.
|
|
57
|
+
* Sub-agents forking from this branch inherit the agent's full
|
|
58
|
+
* KV state (Continuous Context).
|
|
59
|
+
*/
|
|
60
|
+
branch?: Branch;
|
|
53
61
|
/** Progress callback for long-running operations */
|
|
54
62
|
onProgress?: (p: {
|
|
55
63
|
filled: number;
|
|
@@ -199,6 +207,24 @@ export interface AgentPoolOptions {
|
|
|
199
207
|
* findings are pruned — hard-cut agents keep their branches for
|
|
200
208
|
* reportPass extraction. @default false */
|
|
201
209
|
pruneOnReport?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Report prompt for scratchpad extraction of agents that were killed
|
|
212
|
+
* without findings. When provided, the pool extracts findings inline
|
|
213
|
+
* (idle processing) instead of requiring the harness to call reportPass.
|
|
214
|
+
*
|
|
215
|
+
* Format: `{ system: string; user: string }` — system prompt describes
|
|
216
|
+
* the extraction task, user prompt triggers the report.
|
|
217
|
+
*/
|
|
218
|
+
reportPrompt?: {
|
|
219
|
+
system: string;
|
|
220
|
+
user: string;
|
|
221
|
+
/** Min tokens generated before scratchpad extraction is attempted. @default 100 */
|
|
222
|
+
minTokens?: number;
|
|
223
|
+
/** Min tool calls before scratchpad extraction is attempted. @default 2 */
|
|
224
|
+
minToolCalls?: number;
|
|
225
|
+
};
|
|
226
|
+
/** Custom agent policy. @default DefaultAgentPolicy with default opts */
|
|
227
|
+
policy?: AgentPolicy;
|
|
202
228
|
}
|
|
203
229
|
/**
|
|
204
230
|
* Result for a single completed agent
|
|
@@ -224,6 +250,8 @@ export interface AgentResult {
|
|
|
224
250
|
samplingPpl: number;
|
|
225
251
|
/** Per-token trace data (present only when {@link AgentPoolOptions.trace} is true) */
|
|
226
252
|
trace?: TraceToken[];
|
|
253
|
+
/** Findings collected from recursive tool results (inner sub-agent findings) */
|
|
254
|
+
childFindings: readonly string[];
|
|
227
255
|
}
|
|
228
256
|
/**
|
|
229
257
|
* Aggregate result from a completed agent pool run
|
|
@@ -298,6 +326,8 @@ export interface DivergeOptions {
|
|
|
298
326
|
parent?: Branch;
|
|
299
327
|
/** Sampling parameters for all attempts */
|
|
300
328
|
params?: SamplingParams;
|
|
329
|
+
/** Base seed for sampler diversity across attempts. @default 2000 */
|
|
330
|
+
seedBase?: number;
|
|
301
331
|
}
|
|
302
332
|
/**
|
|
303
333
|
* Single attempt result from {@link diverge}
|
|
@@ -366,6 +396,7 @@ export type AgentEvent = {
|
|
|
366
396
|
agentId: number;
|
|
367
397
|
tool: string;
|
|
368
398
|
result: string;
|
|
399
|
+
contextAvailablePercent?: number;
|
|
369
400
|
} | {
|
|
370
401
|
type: 'agent:tool_progress';
|
|
371
402
|
agentId: number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,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IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAClH;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACxE;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,uBAAuB,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9G;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7F;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lloyal-labs/lloyal-agents",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Multi-agent inference inside the decode loop — structured concurrency over shared KV state",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@lloyal-labs/sdk": "*",
|
|
35
|
-
"effection": "^4.0.2"
|
|
35
|
+
"effection": "^4.0.2",
|
|
36
|
+
"eta": "^4.5.1"
|
|
36
37
|
},
|
|
37
38
|
"files": [
|
|
38
39
|
"dist/"
|