agentfootprint 4.0.0 → 6.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/dist/core/Agent.js +15 -20
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js +3 -3
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/Agent.js +15 -20
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.js +3 -3
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/index.js +21 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/factories/defineInjection.js +46 -0
- package/dist/esm/lib/injection-engine/factories/defineInjection.js.map +1 -0
- package/dist/esm/lib/injection-engine/index.js +4 -0
- package/dist/esm/lib/injection-engine/index.js.map +1 -1
- package/dist/esm/locales/index.js +4 -4
- package/dist/esm/locales/index.js.map +1 -1
- package/dist/esm/observe.js +5 -2
- package/dist/esm/observe.js.map +1 -1
- package/dist/esm/recorders/observability/{ThinkingRecorder.js → StatusRecorder.js} +4 -4
- package/dist/esm/recorders/observability/StatusRecorder.js.map +1 -0
- package/dist/esm/recorders/observability/{thinking/thinkingTemplates.js → status/statusTemplates.js} +4 -4
- package/dist/esm/recorders/observability/status/statusTemplates.js.map +1 -0
- package/dist/esm/status.js +3 -3
- package/dist/esm/status.js.map +1 -1
- package/dist/esm/strategies/attach.js +5 -5
- package/dist/esm/strategies/attach.js.map +1 -1
- package/dist/index.js +26 -58
- package/dist/index.js.map +1 -1
- package/dist/lib/injection-engine/factories/defineInjection.js +50 -0
- package/dist/lib/injection-engine/factories/defineInjection.js.map +1 -0
- package/dist/lib/injection-engine/index.js +6 -1
- package/dist/lib/injection-engine/index.js.map +1 -1
- package/dist/locales/index.js +4 -4
- package/dist/locales/index.js.map +1 -1
- package/dist/observe.js +12 -4
- package/dist/observe.js.map +1 -1
- package/dist/recorders/observability/{ThinkingRecorder.js → StatusRecorder.js} +6 -6
- package/dist/recorders/observability/StatusRecorder.js.map +1 -0
- package/dist/recorders/observability/{thinking/thinkingTemplates.js → status/statusTemplates.js} +7 -7
- package/dist/recorders/observability/status/statusTemplates.js.map +1 -0
- package/dist/status.js +7 -7
- package/dist/status.js.map +1 -1
- package/dist/strategies/attach.js +5 -5
- package/dist/strategies/attach.js.map +1 -1
- package/dist/types/core/Agent.d.ts +5 -7
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +1 -1
- package/dist/types/core/agent/types.d.ts +22 -43
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -20
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/factories/defineInjection.d.ts +42 -0
- package/dist/types/lib/injection-engine/factories/defineInjection.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/index.d.ts +1 -0
- package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
- package/dist/types/locales/index.d.ts +2 -2
- package/dist/types/locales/index.d.ts.map +1 -1
- package/dist/types/observe.d.ts +6 -3
- package/dist/types/observe.d.ts.map +1 -1
- package/dist/types/recorders/observability/{ThinkingRecorder.d.ts → StatusRecorder.d.ts} +7 -7
- package/dist/types/recorders/observability/StatusRecorder.d.ts.map +1 -0
- package/dist/types/recorders/observability/{thinking/thinkingTemplates.d.ts → status/statusTemplates.d.ts} +9 -9
- package/dist/types/recorders/observability/status/statusTemplates.d.ts.map +1 -0
- package/dist/types/status.d.ts +3 -3
- package/dist/types/status.d.ts.map +1 -1
- package/dist/types/strategies/attach.d.ts +2 -2
- package/dist/types/strategies/attach.d.ts.map +1 -1
- package/dist/types/strategies/defaults/chatBubbleLiveStatus.d.ts +2 -2
- package/dist/types/strategies/types.d.ts +3 -3
- package/dist/types/strategies/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/esm/recorders/observability/ThinkingRecorder.js.map +0 -1
- package/dist/esm/recorders/observability/thinking/thinkingTemplates.js.map +0 -1
- package/dist/recorders/observability/ThinkingRecorder.js.map +0 -1
- package/dist/recorders/observability/thinking/thinkingTemplates.js.map +0 -1
- package/dist/types/recorders/observability/ThinkingRecorder.d.ts.map +0 -1
- package/dist/types/recorders/observability/thinking/thinkingTemplates.d.ts.map +0 -1
package/dist/observe.js
CHANGED
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
* • PermissionRecorder — permission decisions + denials
|
|
27
27
|
* • SkillRecorder — skill activations
|
|
28
28
|
* • LoggingRecorder — structured log lines per event
|
|
29
|
-
* •
|
|
29
|
+
* • StatusRecorder — chat-bubble first-person status
|
|
30
30
|
*
|
|
31
31
|
* Domain-flavored consumers (Lens, Grafana, Datadog) compose Tier 1+2
|
|
32
32
|
* directly; Tier 3 dashboards are opt-in.
|
|
33
33
|
*/
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.typedEmit = exports.
|
|
35
|
+
exports.typedEmit = exports.attachStatus = exports.LoggingDomains = exports.attachLogging = exports.skillRecorder = exports.permissionRecorder = exports.memoryRecorder = exports.evalRecorder = exports.contextEvaluatedRecorder = exports.toolsRecorder = exports.costRecorder = exports.LiveAgentTurnTracker = exports.LiveToolTracker = exports.LiveLLMTracker = exports.LiveStateRecorder = exports.liveStateRecorder = exports.buildStepGraph = exports.attachFlowchart = exports.runStepRecorder = exports.RunStepRecorder = exports.buildRunSteps = exports.BoundaryRecorder = exports.boundaryRecorder = exports.agentRecorder = exports.compositionRecorder = exports.streamRecorder = exports.ContextRecorder = void 0;
|
|
36
36
|
// Tier 1 — context + stream
|
|
37
37
|
var ContextRecorder_js_1 = require("./recorders/core/ContextRecorder.js");
|
|
38
38
|
Object.defineProperty(exports, "ContextRecorder", { enumerable: true, get: function () { return ContextRecorder_js_1.ContextRecorder; } });
|
|
@@ -46,6 +46,10 @@ Object.defineProperty(exports, "agentRecorder", { enumerable: true, get: functio
|
|
|
46
46
|
var BoundaryRecorder_js_1 = require("./recorders/observability/BoundaryRecorder.js");
|
|
47
47
|
Object.defineProperty(exports, "boundaryRecorder", { enumerable: true, get: function () { return BoundaryRecorder_js_1.boundaryRecorder; } });
|
|
48
48
|
Object.defineProperty(exports, "BoundaryRecorder", { enumerable: true, get: function () { return BoundaryRecorder_js_1.BoundaryRecorder; } });
|
|
49
|
+
var RunStepRecorder_js_1 = require("./recorders/observability/RunStepRecorder.js");
|
|
50
|
+
Object.defineProperty(exports, "buildRunSteps", { enumerable: true, get: function () { return RunStepRecorder_js_1.buildRunSteps; } });
|
|
51
|
+
Object.defineProperty(exports, "RunStepRecorder", { enumerable: true, get: function () { return RunStepRecorder_js_1.RunStepRecorder; } });
|
|
52
|
+
Object.defineProperty(exports, "runStepRecorder", { enumerable: true, get: function () { return RunStepRecorder_js_1.runStepRecorder; } });
|
|
49
53
|
var FlowchartRecorder_js_1 = require("./recorders/observability/FlowchartRecorder.js");
|
|
50
54
|
Object.defineProperty(exports, "attachFlowchart", { enumerable: true, get: function () { return FlowchartRecorder_js_1.attachFlowchart; } });
|
|
51
55
|
Object.defineProperty(exports, "buildStepGraph", { enumerable: true, get: function () { return FlowchartRecorder_js_1.buildStepGraph; } });
|
|
@@ -58,6 +62,10 @@ Object.defineProperty(exports, "LiveAgentTurnTracker", { enumerable: true, get:
|
|
|
58
62
|
// Tier 3 — domain dashboards
|
|
59
63
|
var CostRecorder_js_1 = require("./recorders/core/CostRecorder.js");
|
|
60
64
|
Object.defineProperty(exports, "costRecorder", { enumerable: true, get: function () { return CostRecorder_js_1.costRecorder; } });
|
|
65
|
+
var ToolsRecorder_js_1 = require("./recorders/core/ToolsRecorder.js");
|
|
66
|
+
Object.defineProperty(exports, "toolsRecorder", { enumerable: true, get: function () { return ToolsRecorder_js_1.toolsRecorder; } });
|
|
67
|
+
var ContextEvaluatedRecorder_js_1 = require("./recorders/core/ContextEvaluatedRecorder.js");
|
|
68
|
+
Object.defineProperty(exports, "contextEvaluatedRecorder", { enumerable: true, get: function () { return ContextEvaluatedRecorder_js_1.contextEvaluatedRecorder; } });
|
|
61
69
|
var EvalRecorder_js_1 = require("./recorders/core/EvalRecorder.js");
|
|
62
70
|
Object.defineProperty(exports, "evalRecorder", { enumerable: true, get: function () { return EvalRecorder_js_1.evalRecorder; } });
|
|
63
71
|
var MemoryRecorder_js_1 = require("./recorders/core/MemoryRecorder.js");
|
|
@@ -69,8 +77,8 @@ Object.defineProperty(exports, "skillRecorder", { enumerable: true, get: functio
|
|
|
69
77
|
var LoggingRecorder_js_1 = require("./recorders/observability/LoggingRecorder.js");
|
|
70
78
|
Object.defineProperty(exports, "attachLogging", { enumerable: true, get: function () { return LoggingRecorder_js_1.attachLogging; } });
|
|
71
79
|
Object.defineProperty(exports, "LoggingDomains", { enumerable: true, get: function () { return LoggingRecorder_js_1.LoggingDomains; } });
|
|
72
|
-
var
|
|
73
|
-
Object.defineProperty(exports, "
|
|
80
|
+
var StatusRecorder_js_1 = require("./recorders/observability/StatusRecorder.js");
|
|
81
|
+
Object.defineProperty(exports, "attachStatus", { enumerable: true, get: function () { return StatusRecorder_js_1.attachStatus; } });
|
|
74
82
|
// Emit primitive — used by every Tier-3 source-domain.
|
|
75
83
|
var typedEmit_js_1 = require("./recorders/core/typedEmit.js");
|
|
76
84
|
Object.defineProperty(exports, "typedEmit", { enumerable: true, get: function () { return typedEmit_js_1.typedEmit; } });
|
package/dist/observe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe.js","sourceRoot":"","sources":["../src/observe.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;AAEH,4BAA4B;AAC5B,0EAAmG;AAA1F,qHAAA,eAAe,OAAA;AACxB,wEAAgG;AAAvF,mHAAA,cAAc,OAAA;AAEvB,+BAA+B;AAC/B,kFAGiD;AAF/C,6HAAA,mBAAmB,OAAA;AAGrB,sEAA6F;AAApF,iHAAA,aAAa,OAAA;AACtB,
|
|
1
|
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
|
|
3
|
+
* StatusRecorder — Claude Code-style live status line for Agent runs.
|
|
4
4
|
*
|
|
5
5
|
* Pattern: Facade over EventDispatcher's wildcard subscription.
|
|
6
6
|
* Role: Tier 3 observability — the low-level helper behind
|
|
7
|
-
* `
|
|
7
|
+
* `attachStatus(dispatcher, { onStatus })` (exported from
|
|
8
8
|
* `agentfootprint/observe`). For the high-level, uniform path use
|
|
9
9
|
* `agent.enable.liveStatus({ strategy: chatBubbleLiveStatus({ onLine }) })`.
|
|
10
10
|
* One callback receives a human-readable status string at every
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* `onStatus`.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
16
|
+
exports.attachStatus = void 0;
|
|
17
17
|
const RELEVANT = new Set([
|
|
18
18
|
'agentfootprint.agent.turn_start',
|
|
19
19
|
'agentfootprint.agent.turn_end',
|
|
@@ -26,7 +26,7 @@ const RELEVANT = new Set([
|
|
|
26
26
|
* Attach a thinking-status subscription to the event dispatcher.
|
|
27
27
|
* Returns an Unsubscribe — call to detach.
|
|
28
28
|
*/
|
|
29
|
-
function
|
|
29
|
+
function attachStatus(dispatcher, options) {
|
|
30
30
|
const format = options.format ?? defaultFormatter;
|
|
31
31
|
return dispatcher.on('*', (event) => {
|
|
32
32
|
if (!RELEVANT.has(event.type))
|
|
@@ -36,7 +36,7 @@ function attachThinking(dispatcher, options) {
|
|
|
36
36
|
options.onStatus(status);
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
exports.
|
|
39
|
+
exports.attachStatus = attachStatus;
|
|
40
40
|
/**
|
|
41
41
|
* Default renderer. Humanizes each supported event into a short status line.
|
|
42
42
|
*/
|
|
@@ -62,4 +62,4 @@ function defaultFormatter(event) {
|
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
//# sourceMappingURL=
|
|
65
|
+
//# sourceMappingURL=StatusRecorder.js.map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,UAAU,EAAE,CAAC;QACpD,KAAK,oCAAoC;YACvC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,OAAO;gBACrC,CAAC,CAAC,qBAAqB;gBACvB,CAAC,CAAC,+BAA+B,CAAC;QACtC,KAAK,+BAA+B;YAClC,OAAO,MAAM,CAAC;QAChB;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
|
package/dist/recorders/observability/{thinking/thinkingTemplates.js → status/statusTemplates.js}
RENAMED
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
* own first-person status without per-tool plumbing.
|
|
41
41
|
*/
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.
|
|
43
|
+
exports.renderStatusLine = exports.selectStatus = exports.defaultStatusTemplates = void 0;
|
|
44
44
|
// ── Defaults ───────────────────────────────────────────────────────
|
|
45
45
|
/**
|
|
46
46
|
* Bundled English defaults. Override in the agent config via
|
|
47
47
|
* `.thinkingTemplates({...})`. Per-tool overrides go via
|
|
48
48
|
* `tool.<toolName>` keys.
|
|
49
49
|
*/
|
|
50
|
-
exports.
|
|
50
|
+
exports.defaultStatusTemplates = {
|
|
51
51
|
idle: 'Thinking…',
|
|
52
52
|
streaming: '{{partial}}',
|
|
53
53
|
tool: 'Working on `{{toolName}}`…',
|
|
@@ -78,7 +78,7 @@ exports.defaultThinkingTemplates = {
|
|
|
78
78
|
* cancels its matching opener so a completed tool.start/tool.end
|
|
79
79
|
* pair leaves the state quiescent.
|
|
80
80
|
*/
|
|
81
|
-
function
|
|
81
|
+
function selectStatus(events) {
|
|
82
82
|
let activePause = null;
|
|
83
83
|
let activeTool = null;
|
|
84
84
|
let activeLlmStartIdx = -1; // -1 = no active LLM call
|
|
@@ -157,7 +157,7 @@ function selectThinkingState(events) {
|
|
|
157
157
|
}
|
|
158
158
|
return null;
|
|
159
159
|
}
|
|
160
|
-
exports.
|
|
160
|
+
exports.selectStatus = selectStatus;
|
|
161
161
|
// ── Renderer ───────────────────────────────────────────────────────
|
|
162
162
|
/**
|
|
163
163
|
* Resolve the matched template + substitute vars.
|
|
@@ -171,7 +171,7 @@ exports.selectThinkingState = selectThinkingState;
|
|
|
171
171
|
* keeps the contract honest (consumer can detect "no template" and
|
|
172
172
|
* fall back to its own default).
|
|
173
173
|
*/
|
|
174
|
-
function
|
|
174
|
+
function renderStatusLine(state, ctx, templates = exports.defaultStatusTemplates) {
|
|
175
175
|
if (!state)
|
|
176
176
|
return null;
|
|
177
177
|
let key = state.state;
|
|
@@ -186,5 +186,5 @@ function renderThinkingLine(state, ctx, templates = exports.defaultThinkingTempl
|
|
|
186
186
|
const vars = { appName: ctx.appName, ...state.vars };
|
|
187
187
|
return template.replace(/\{\{(\w+)\}\}/g, (_, name) => vars[name] ?? '');
|
|
188
188
|
}
|
|
189
|
-
exports.
|
|
190
|
-
//# sourceMappingURL=
|
|
189
|
+
exports.renderStatusLine = renderStatusLine;
|
|
190
|
+
//# sourceMappingURL=statusTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusTemplates.js","sourceRoot":"","sources":["../../../../src/recorders/observability/status/statusTemplates.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;;;AA+BH,sEAAsE;AAEtE;;;;GAIG;AACU,QAAA,sBAAsB,GAAoB;IACrD,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE,4BAA4B;IAClC,MAAM,EAAE,8BAA8B;CACvC,CAAC;AAEF,sEAAsE;AAEtE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,YAAY,CAAC,MAAsC;IACjE,IAAI,WAAW,GAAqD,IAAI,CAAC;IACzE,IAAI,UAAU,GAAqD,IAAI,CAAC;IACxE,IAAI,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAAC,0BAA0B;IAEtD,KAAK,IAAI,CAAC,GAAG,CAAC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AAE,OAAO,EAAE,EAAE;YAC3C,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAClC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAlFD,oCAkFC;AAED,sEAAsE;AAEtE;;;;;;;;;;;GAWG;AACH,SAAgB,gBAAgB,CAC9B,KAAyB,EACzB,GAAkB,EAClB,YAA6B,8BAAsB;IAEnD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,IAAI,GAAG,GAAW,KAAK,CAAC,KAAK,CAAC;IAC9B,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC7C,MAAM,QAAQ,GAAG,QAAQ,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC1C,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,SAAS;YAAE,GAAG,GAAG,QAAQ,CAAC;IACxD,CAAC;IACD,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAExC,MAAM,IAAI,GAA2B,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7E,OAAO,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAC3E,CAAC;AAjBD,4CAiBC"}
|
package/dist/status.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* agentfootprint/status — chat-bubble status surface.
|
|
4
4
|
*
|
|
5
|
-
* Pattern: pure projection. `
|
|
5
|
+
* Pattern: pure projection. `selectStatus` walks the typed
|
|
6
6
|
* event log forward, tracking active pause / tool / LLM state,
|
|
7
7
|
* and returns the CURRENT thinking state (or null when the
|
|
8
8
|
* bubble should hide).
|
|
9
9
|
* Role: Outer ring. Consumers (Lens, custom chat UIs, embedded
|
|
10
10
|
* widgets) call this to drive a "what is the agent doing
|
|
11
|
-
* right now?" indicator. Output feeds `
|
|
11
|
+
* right now?" indicator. Output feeds `renderStatusLine`
|
|
12
12
|
* which resolves a template + variables to a final string.
|
|
13
13
|
*
|
|
14
14
|
* Why a subpath:
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
* (null) run done / between calls → bubble hidden
|
|
48
48
|
*/
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.
|
|
51
|
-
var
|
|
52
|
-
Object.defineProperty(exports, "
|
|
53
|
-
Object.defineProperty(exports, "
|
|
54
|
-
Object.defineProperty(exports, "
|
|
50
|
+
exports.renderStatusLine = exports.selectStatus = exports.defaultStatusTemplates = void 0;
|
|
51
|
+
var statusTemplates_js_1 = require("./recorders/observability/status/statusTemplates.js");
|
|
52
|
+
Object.defineProperty(exports, "defaultStatusTemplates", { enumerable: true, get: function () { return statusTemplates_js_1.defaultStatusTemplates; } });
|
|
53
|
+
Object.defineProperty(exports, "selectStatus", { enumerable: true, get: function () { return statusTemplates_js_1.selectStatus; } });
|
|
54
|
+
Object.defineProperty(exports, "renderStatusLine", { enumerable: true, get: function () { return statusTemplates_js_1.renderStatusLine; } });
|
|
55
55
|
//# sourceMappingURL=status.js.map
|
package/dist/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;;;AAEH,0FAQ6D;AAP3D,4HAAA,sBAAsB,OAAA;AACtB,kHAAA,YAAY,OAAA;AACZ,sHAAA,gBAAgB,OAAA"}
|
|
@@ -43,7 +43,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
44
|
exports.attachLiveStatusStrategy = exports.attachCostStrategy = exports.attachObservabilityStrategy = void 0;
|
|
45
45
|
const footprintjs_1 = require("footprintjs");
|
|
46
|
-
const
|
|
46
|
+
const statusTemplates_js_1 = require("../recorders/observability/status/statusTemplates.js");
|
|
47
47
|
// Registry-lookup helpers (`getObservabilityStrategy` etc.) are
|
|
48
48
|
// defined in `./registry.js` and used by consumers via the
|
|
49
49
|
// `enable.*({ vendor, config })` path elsewhere — not used in the
|
|
@@ -225,12 +225,12 @@ exports.attachCostStrategy = attachCostStrategy;
|
|
|
225
225
|
/** Sliding-window cap for `attachLiveStatusStrategy`'s internal event
|
|
226
226
|
* log. Long-lived agent servers would otherwise leak memory through
|
|
227
227
|
* unbounded growth (per OTel SIG panel review). The cap is high
|
|
228
|
-
* enough that `
|
|
228
|
+
* enough that `selectStatus` always sees the relevant recent
|
|
229
229
|
* history. */
|
|
230
230
|
const LIVE_STATUS_LOG_CAP = 1000;
|
|
231
231
|
function attachLiveStatusStrategy(dispatcher, opts) {
|
|
232
232
|
opts.strategy.validate?.();
|
|
233
|
-
const templates = { ...
|
|
233
|
+
const templates = { ...statusTemplates_js_1.defaultStatusTemplates, ...(opts.templates ?? {}) };
|
|
234
234
|
const ctx = { appName: opts.appName ?? 'Agent' };
|
|
235
235
|
const eventLog = [];
|
|
236
236
|
let lastLine = null;
|
|
@@ -240,12 +240,12 @@ function attachLiveStatusStrategy(dispatcher, opts) {
|
|
|
240
240
|
// because shift() runs only once per overflow.
|
|
241
241
|
while (eventLog.length > LIVE_STATUS_LOG_CAP)
|
|
242
242
|
eventLog.shift();
|
|
243
|
-
const state = (0,
|
|
243
|
+
const state = (0, statusTemplates_js_1.selectStatus)(eventLog);
|
|
244
244
|
if (!state) {
|
|
245
245
|
lastLine = null;
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
|
-
const line = (0,
|
|
248
|
+
const line = (0, statusTemplates_js_1.renderStatusLine)(state, ctx, templates);
|
|
249
249
|
if (line === null || line === lastLine)
|
|
250
250
|
return;
|
|
251
251
|
lastLine = line;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attach.js","sourceRoot":"","sources":["../../src/strategies/attach.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAAwC;AAexC,
|
|
1
|
+
{"version":3,"file":"attach.js","sourceRoot":"","sources":["../../src/strategies/attach.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAAwC;AAexC,6FAK8D;AAC9D,gEAAgE;AAChE,2DAA2D;AAC3D,kEAAkE;AAClE,yEAAyE;AAEzE;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAgB,GAAS,EAAE,CAAC,SAAS,CAAC;AAsB5D;;4BAE4B;AAC5B,SAAS,uBAAuB,CAAC,IAAsB;IACrD,OAAO,IAAA,uBAAS,EACd,+BAA+B,EAC/B,KAAK,EAAE,KAAK,EAAE,EAAE;QACd,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC,EACD,MAAM,CACP,CAAC,KAAK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AAI,GAAG,IAAA,qCAAgB,EAAC,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QACrD,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,QAAQ;YAAE,OAAO;QAC/C,QAAQ,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC;YACH,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAkB,CAAC,CAAC;QAC9D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACvF,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AA7BD,4DA6BC"}
|
|
@@ -145,13 +145,11 @@ export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
|
|
|
145
145
|
/** Per-COMPOSITION translator (L1b). Set from `opts.groupTranslator`;
|
|
146
146
|
* undefined when consumer didn't attach one. */
|
|
147
147
|
private readonly agentGroupTranslator?;
|
|
148
|
-
/** ReAct
|
|
149
|
-
* '
|
|
150
|
-
*
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
* turn, loop→InjectionEngine) or 'classic' (engineer context once,
|
|
154
|
-
* loop→Messages only). Set from `opts.reactMode`. See AgentOptions. */
|
|
148
|
+
/** ReAct loop mode — 'dynamic' (default, re-engineer all slots each turn,
|
|
149
|
+
* flat chart), 'classic' (engineer context once, loop→Messages only, flat
|
|
150
|
+
* chart), or 'dynamic-grouped' (dynamic semantics + LLM turn wrapped in an
|
|
151
|
+
* sf-llm-call subflow for richer Lens grouping). Set from `opts.reactMode`.
|
|
152
|
+
* See AgentOptions. */
|
|
155
153
|
private readonly reactMode;
|
|
156
154
|
constructor(opts: AgentOptions, systemPromptValue: string, registry: readonly ToolR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AAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAoC5D;;;;;;;;;;OAUG;IACG,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC;IAiB1E,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAwD7F;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,aAAa,CACjB,UAAU,EAAE,kBAAkB,GAAG,OAAO,EACxC,OAAO,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAQ5C;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAyB1B,MAAM,CACV,UAAU,EAAE,mBAAmB,EAC/B,KAAK,CAAC,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAW5C,OAAO,CAAC,cAAc;IA+CtB,OAAO,CAAC,cAAc;IA8FtB,OAAO,CAAC,UAAU;CA2JnB"}
|
|
@@ -209,7 +209,7 @@ export declare class AgentBuilder {
|
|
|
209
209
|
* contract shape as commentary; different vocabulary — first-person
|
|
210
210
|
* status the chat bubble shows mid-call. Per-tool overrides go via
|
|
211
211
|
* `tool.<toolName>` keys (e.g., `'tool.weather': 'Looking up the
|
|
212
|
-
* weather…'`). See `
|
|
212
|
+
* weather…'`). See `defaultStatusTemplates` for the full key list.
|
|
213
213
|
*/
|
|
214
214
|
thinkingTemplates(templates: Readonly<Record<string, string>>): this;
|
|
215
215
|
/**
|
|
@@ -95,57 +95,36 @@ export interface AgentOptions {
|
|
|
95
95
|
*/
|
|
96
96
|
readonly groupTranslator?: GroupTranslator;
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* `
|
|
101
|
-
*
|
|
102
|
-
* `'subflow'` wraps the whole LLM turn (injection engine + the 3
|
|
103
|
-
* slots + cache + the call + thinking) in a single `sf-llm-call`
|
|
104
|
-
* SUBFLOW — the SAME boundary the `LLMCall` primitive produces. This
|
|
105
|
-
* is the structurally-correct shape: the LLM invocation IS a subflow,
|
|
106
|
-
* so Lens (and any explainable-ui consumer) renders it as an LLM
|
|
107
|
-
* group with its slots inside, with zero bespoke collapsing. Behaviour
|
|
108
|
-
* is identical to `'flat'`; only the chart's nesting differs.
|
|
109
|
-
*
|
|
110
|
-
* Opt-in while the subflow shape proves out; will become the default
|
|
111
|
-
* once verified end-to-end. See `agent/buildDynamicAgentChart.ts`.
|
|
112
|
-
*/
|
|
113
|
-
readonly reactStructure?: 'flat' | 'subflow';
|
|
114
|
-
/**
|
|
115
|
-
* ReAct loop SEMANTICS — how much of the request is re-engineered each
|
|
116
|
-
* iteration. Default `'dynamic'`.
|
|
98
|
+
* How the ReAct loop behaves — a single setting with three honest choices.
|
|
99
|
+
* Default `'dynamic'`. (Merged in 6.0.0 from the old `reactMode` +
|
|
100
|
+
* `reactStructure` pair, which had a silently-ignored combination.)
|
|
117
101
|
*
|
|
118
102
|
* `'dynamic'` (default) — every iteration re-runs the InjectionEngine and
|
|
119
103
|
* all three slots (system-prompt ‖ messages ‖ tools), because which
|
|
120
104
|
* injections are active can change per turn (a skill activates, a rule
|
|
121
|
-
* fires, a tool-return triggers something). The
|
|
122
|
-
*
|
|
123
|
-
*
|
|
105
|
+
* fires, a tool-return triggers something). The right shape when the agent
|
|
106
|
+
* uses skills, rule/on-tool-return triggers, or any per-turn context
|
|
107
|
+
* steering. Flat chart shape.
|
|
124
108
|
*
|
|
125
109
|
* `'classic'` — textbook ReAct: context is engineered ONCE. The
|
|
126
|
-
* InjectionEngine, system-prompt and tools run a single time up front;
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* chart
|
|
131
|
-
* slots
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* triggers); `'classic'` just avoids re-computing fixed slots and shows in the
|
|
135
|
-
* chart that only the messages re-run (after turn 1 only the Messages slot
|
|
136
|
-
* lights up). Implementation-wise the chart is the SAME as Dynamic — the only
|
|
137
|
-
* difference is that the Context selector stops re-selecting the system-prompt
|
|
138
|
-
* and tools slots after the first turn, so their outputs are reused.
|
|
110
|
+
* InjectionEngine, system-prompt and tools run a single time up front; the
|
|
111
|
+
* loop targets only the Messages slot, so each iteration just appends the
|
|
112
|
+
* new tool result and re-calls the LLM. Use when the system prompt and tool
|
|
113
|
+
* set are FIXED for the whole run (the common case). Flat chart shape — the
|
|
114
|
+
* chart reads honestly: `ToolCalls → Messages` loops, static slots outside.
|
|
115
|
+
* CAVEAT: because static slots are cached after turn 1, do NOT use `'classic'`
|
|
116
|
+
* with skills or dynamic-trigger injections — a mid-run activation would not
|
|
117
|
+
* surface into the cached system-prompt/tools. Use `'dynamic'` for those.
|
|
139
118
|
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* `'
|
|
146
|
-
*
|
|
119
|
+
* `'dynamic-grouped'` — same semantics as `'dynamic'`, but the whole LLM turn
|
|
120
|
+
* (injection engine + 3 slots + cache + call + thinking) is wrapped in a
|
|
121
|
+
* single `sf-llm-call` SUBFLOW — the same boundary the `LLMCall` primitive
|
|
122
|
+
* produces. Lens (and any explainable-ui consumer) renders it as an LLM group
|
|
123
|
+
* with its slots inside, with zero bespoke collapsing. Behaviour is identical
|
|
124
|
+
* to `'dynamic'`; only the chart's nesting differs. (Grouping is dynamic-only:
|
|
125
|
+
* it re-seeds context every turn by design, so there is no classic-grouped.)
|
|
147
126
|
*/
|
|
148
|
-
readonly reactMode?: 'classic' | 'dynamic';
|
|
127
|
+
readonly reactMode?: 'classic' | 'dynamic' | 'dynamic-grouped';
|
|
149
128
|
}
|
|
150
129
|
export interface AgentInput {
|
|
151
130
|
readonly message: string;
|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ACxE,eAAe,EAAE,OAAO,CAAC;IACzB;uEACmE;IACnE,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;2CAEuC;IACvC,YAAY,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IAG9C;;;;0EAIsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;0BAEsB;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,yCAAyC;IACzC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kEAAkE;IAClE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAG7B;;;6EAGyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;0CAIsC;IACtC,cAAc,EAAE,SAAS,aAAa,EAAE,CAAC;IAGzC;;;;;;iFAM6E;IAC7E,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IACzD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;kEAC8D;IAC9D,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,39 +10,23 @@ import './cache/strategies/OpenAICacheStrategy.js';
|
|
|
10
10
|
import './cache/strategies/BedrockCacheStrategy.js';
|
|
11
11
|
export type { CombinedRecorder, ScopeRecorder, FlowRecorder, EmitRecorder, WriteEvent, ReadEvent, CommitEvent, StageEvent, ErrorEvent, FlowStageEvent, FlowNextEvent, FlowDecisionEvent, FlowForkEvent, FlowSelectedEvent, FlowSubflowEvent, FlowSubflowRegisteredEvent, FlowLoopEvent, FlowBreakEvent, FlowErrorEvent, TraversalContext, EmitEvent, RedactionPolicy, RedactionReport, } from 'footprintjs';
|
|
12
12
|
export * from './events/types.js';
|
|
13
|
-
export * from './events/payloads.js';
|
|
13
|
+
export type * as Payloads from './events/payloads.js';
|
|
14
14
|
export { EVENT_NAMES, ALL_EVENT_TYPES, type AgentfootprintEvent, type AgentfootprintEventMap, type AgentfootprintEventType, } from './events/registry.js';
|
|
15
15
|
export { EventDispatcher, type EventListener, type WildcardListener, type ListenOptions, type Unsubscribe, type DomainWildcard, type AllWildcard, type WildcardSubscription, } from './events/dispatcher.js';
|
|
16
16
|
export * from './adapters/types.js';
|
|
17
17
|
export { INJECTION_KEYS, injectionKeyForSlot, isInjectionKey, type InjectionKey, stageRole, type StageRole, milestoneFor, type Milestone, type MilestoneKind, } from './conventions.js';
|
|
18
18
|
export { COMPOSITION_KEYS, type BudgetPressureRecord, type CompositionKey, type EvictionRecord, type InjectionRecord, type SlotComposition, } from './recorders/core/types.js';
|
|
19
19
|
export { buildEventMeta, parseSubflowPath, type RunContext } from './bridge/eventMeta.js';
|
|
20
|
-
export { ContextRecorder, type ContextRecorderOptions } from './recorders/core/ContextRecorder.js';
|
|
21
20
|
export { contextEngineering, isEngineeredSource, isBaselineSource, ENGINEERED_SOURCES, BASELINE_SOURCES, type ContextEngineeringHandle, type ContextEngineeringUnsubscribe, type ContextInjectedEvent, type ContextInjectedListener, } from './recorders/core/contextEngineering.js';
|
|
22
21
|
export { EmitBridge, type EmitBridgeOptions } from './recorders/core/EmitBridge.js';
|
|
23
|
-
export { streamRecorder, type StreamRecorderOptions } from './recorders/core/StreamRecorder.js';
|
|
24
|
-
export { agentRecorder, type AgentRecorderOptions } from './recorders/core/AgentRecorder.js';
|
|
25
|
-
export { contextEvaluatedRecorder, type ContextEvaluatedRecorderOptions, } from './recorders/core/ContextEvaluatedRecorder.js';
|
|
26
|
-
export { compositionRecorder, type CompositionRecorderOptions, } from './recorders/core/CompositionRecorder.js';
|
|
27
|
-
export { costRecorder, type CostRecorderOptions } from './recorders/core/CostRecorder.js';
|
|
28
|
-
export { permissionRecorder, type PermissionRecorderOptions, } from './recorders/core/PermissionRecorder.js';
|
|
29
|
-
export { evalRecorder, type EvalRecorderOptions } from './recorders/core/EvalRecorder.js';
|
|
30
|
-
export { memoryRecorder, type MemoryRecorderOptions } from './recorders/core/MemoryRecorder.js';
|
|
31
|
-
export { skillRecorder, type SkillRecorderOptions } from './recorders/core/SkillRecorder.js';
|
|
32
|
-
export { toolsRecorder, type ToolsRecorderOptions } from './recorders/core/ToolsRecorder.js';
|
|
33
22
|
export { typedEmit } from './recorders/core/typedEmit.js';
|
|
34
23
|
export type { EmittedEvent, EnableNamespace, Runner } from './core/runner.js';
|
|
35
24
|
export { RunnerBase, makeRunId } from './core/RunnerBase.js';
|
|
36
25
|
export type { GroupKind, GroupMember, GroupMetadata, GroupTranslator } from './core/translator.js';
|
|
37
26
|
export { pauseHere, askHuman, isPauseRequest, isPaused, type RunnerPauseOutcome, } from './core/pause.js';
|
|
38
|
-
export {
|
|
39
|
-
export { attachLogging, LoggingDomains, type LoggingDomain, type LoggingLogger, type LoggingOptions, } from './recorders/observability/LoggingRecorder.js';
|
|
40
|
-
export { attachFlowchart, type ContextInjection, type FlowchartHandle, type FlowchartOptions, type StepEdge, type StepGraph, type StepNode, } from './recorders/observability/FlowchartRecorder.js';
|
|
41
|
-
export { buildRunSteps, RunStepRecorder, runStepRecorder, type BuildRunStepsOptions, type RunStep, type RunStepGraph, type RunStepKind, type RunStepMeta, type RunStepRecorderOptions, type RunStepTransition, } from './recorders/observability/RunStepRecorder.js';
|
|
42
|
-
export { BoundaryRecorder, boundaryRecorder, type ActorArrow, type BoundaryAggregate, type BoundaryRangeLabel, type BoundaryRecorderOptions, type DomainContextInjectedEvent, type DomainDecisionBranchEvent, type DomainEvent, type DomainForkBranchEvent, type DomainLLMEndEvent, type DomainLLMStartEvent, type DomainLoopIterationEvent, type DomainRunEvent, type DomainSubflowEvent, type DomainToolEndEvent, type DomainToolStartEvent, } from './recorders/observability/BoundaryRecorder.js';
|
|
43
|
-
export { liveStateRecorder, LiveStateRecorder, LiveLLMTracker, LiveToolTracker, LiveAgentTurnTracker, type LLMLiveState, type ToolLiveState, type AgentTurnLiveState, type LiveStateRunnerLike, } from './recorders/observability/LiveStateRecorder.js';
|
|
27
|
+
export type { FlowchartHandle, FlowchartOptions, } from './recorders/observability/FlowchartRecorder.js';
|
|
44
28
|
export { defaultCommentaryTemplates, extractAgentName, extractCommentaryVars, renderCommentary, selectCommentaryKey, type CommentaryContext, type CommentaryTemplates, } from './recorders/observability/commentary/commentaryTemplates.js';
|
|
45
|
-
export {
|
|
29
|
+
export { defaultStatusTemplates, selectStatus, renderStatusLine, type StatusContext, type StatusState, type StatusKind, type StatusTemplates, } from './recorders/observability/status/statusTemplates.js';
|
|
46
30
|
export { LLMCall, LLMCallBuilder, type LLMCallInput, type LLMCallOptions, type LLMCallOutput, } from './core/LLMCall.js';
|
|
47
31
|
export { buildMessageApiChart, type MessageApiChartDeps, } from './core/agent/buildMessageApiChart.js';
|
|
48
32
|
export { buildAgentMessageApiChart, type AgentMessageApiChartDeps, } from './core/agent/buildAgentMessageApiChart.js';
|
|
@@ -62,7 +46,7 @@ export { browserAnthropic, BrowserAnthropicProvider, type BrowserAnthropicProvid
|
|
|
62
46
|
export { browserOpenai, BrowserOpenAIProvider, type BrowserOpenAIProviderOptions, } from './adapters/llm/BrowserOpenAIProvider.js';
|
|
63
47
|
export { createProvider, type ProviderKind, type CreateProviderOptions, } from './adapters/llm/createProvider.js';
|
|
64
48
|
export { toSSE, SSEFormatter, encodeSSE, type ToSSEOptions } from './stream.js';
|
|
65
|
-
export { type Injection, type InjectionTrigger, type InjectionContent, type InjectionContext, type InjectionEvaluation, evaluateInjections, buildInjectionEngineSubflow, projectActiveInjection, type InjectionEngineConfig, type ActiveInjection, defineInstruction, type DefineInstructionOptions, defineSkill, resolveSurfaceMode, SkillRegistry, type SkillRegistryOptions, buildListSkillsTool, buildReadSkillTool, type SkillToolPair, type DefineSkillOptions, type SurfaceMode, type RefreshPolicy, type AutoActivateMode, defineSteering, type DefineSteeringOptions, defineFact, type DefineFactOptions, } from './lib/injection-engine/index.js';
|
|
49
|
+
export { type Injection, type InjectionTrigger, type InjectionContent, type InjectionContext, type InjectionEvaluation, evaluateInjections, buildInjectionEngineSubflow, projectActiveInjection, type InjectionEngineConfig, type ActiveInjection, defineInstruction, type DefineInstructionOptions, defineSkill, resolveSurfaceMode, SkillRegistry, type SkillRegistryOptions, buildListSkillsTool, buildReadSkillTool, type SkillToolPair, type DefineSkillOptions, type SurfaceMode, type RefreshPolicy, type AutoActivateMode, defineSteering, type DefineSteeringOptions, defineFact, type DefineFactOptions, defineInjection, type DefineInjectionOptions, type InjectionFlavor, } from './lib/injection-engine/index.js';
|
|
66
50
|
export * from './patterns/index.js';
|
|
67
51
|
export { defaultPipeline, ephemeralPipeline, factPipeline, narrativePipeline, semanticPipeline, autoPipeline, } from './memory/pipeline/index.js';
|
|
68
52
|
export { heuristicExtractor, llmExtractor, } from './memory/beats/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,8CAA8C,CAAC;AACtD,OAAO,2CAA2C,CAAC;AACnD,OAAO,4CAA4C,CAAC;AAOpD,YAAY,EAEV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,YAAY,EAEZ,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EAEV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACd,cAAc,EACd,gBAAgB,EAEhB,SAAS,EAET,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AAGrB,cAAc,mBAAmB,CAAC;
|
|
1
|
+
{"version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pC,OAAO,EAEL,kBAAkB,EAClB,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAIxB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,QAAQ,GACd,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EACL,SAAS,EACT,KAAK,gBAAgB,EACrB,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EACL,SAAS,EACT,aAAa,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,KAAK,cAAc,GACpB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* defineInjection — the unified injection factory (one factory, a `type`
|
|
3
|
+
* discriminant for the flavor).
|
|
4
|
+
*
|
|
5
|
+
* The named factories (`defineInstruction`, `defineSkill`, `defineSteering`,
|
|
6
|
+
* `defineFact`) are self-documenting sugar — prefer them when you know the
|
|
7
|
+
* flavor at author time. `defineInjection` is for the cases where the flavor is
|
|
8
|
+
* chosen *programmatically* (config-driven pipelines, a UI that lets users add
|
|
9
|
+
* any flavor, table-driven tests) — pass `type` and the same options the named
|
|
10
|
+
* factory takes:
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // these two are equivalent
|
|
14
|
+
* defineInstruction({ id: 'calm', prompt: '…', activeWhen });
|
|
15
|
+
* defineInjection({ type: 'instruction', id: 'calm', prompt: '…', activeWhen });
|
|
16
|
+
*
|
|
17
|
+
* @example // flavor decided at runtime
|
|
18
|
+
* const inj = defineInjection({ type: cfg.flavor, id: cfg.id, ...cfg.opts });
|
|
19
|
+
*
|
|
20
|
+
* All four flavors return the same `Injection` primitive — `type` simply routes
|
|
21
|
+
* to the matching named factory. RAG and Memory are NOT covered here: they are
|
|
22
|
+
* separate subsystems (retrieval + stores), not plain Injections.
|
|
23
|
+
*/
|
|
24
|
+
import type { Injection } from '../types.js';
|
|
25
|
+
import { type DefineFactOptions } from './defineFact.js';
|
|
26
|
+
import { type DefineInstructionOptions } from './defineInstruction.js';
|
|
27
|
+
import { type DefineSkillOptions } from './defineSkill.js';
|
|
28
|
+
import { type DefineSteeringOptions } from './defineSteering.js';
|
|
29
|
+
/** Discriminated union — `type` picks the flavor; the rest are that flavor's options. */
|
|
30
|
+
export type DefineInjectionOptions = ({
|
|
31
|
+
type: 'instruction';
|
|
32
|
+
} & DefineInstructionOptions) | ({
|
|
33
|
+
type: 'skill';
|
|
34
|
+
} & DefineSkillOptions) | ({
|
|
35
|
+
type: 'steering';
|
|
36
|
+
} & DefineSteeringOptions) | ({
|
|
37
|
+
type: 'fact';
|
|
38
|
+
} & DefineFactOptions);
|
|
39
|
+
/** The flavor discriminants `defineInjection` accepts. */
|
|
40
|
+
export type InjectionFlavor = DefineInjectionOptions['type'];
|
|
41
|
+
export declare function defineInjection(opts: DefineInjectionOptions): Injection;
|
|
42
|
+
//# sourceMappingURL=defineInjection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineInjection.d.ts","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineInjection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAqB,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjF,yFAAyF;AACzF,MAAM,MAAM,sBAAsB,GAC9B,CAAC;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GAAG,wBAAwB,CAAC,GACpD,CAAC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,kBAAkB,CAAC,GACxC,CAAC;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,qBAAqB,CAAC,GAC9C,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAAC,CAAC;AAE3C,0DAA0D;AAC1D,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAE7D,wBAAgB,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,SAAS,CAqBvE"}
|
|
@@ -15,4 +15,5 @@ export { SkillRegistry, type SkillRegistryOptions } from './SkillRegistry.js';
|
|
|
15
15
|
export { buildListSkillsTool, buildReadSkillTool, type SkillToolPair } from './skillTools.js';
|
|
16
16
|
export { defineSteering, type DefineSteeringOptions } from './factories/defineSteering.js';
|
|
17
17
|
export { defineFact, type DefineFactOptions } from './factories/defineFact.js';
|
|
18
|
+
export { defineInjection, type DefineInjectionOptions, type InjectionFlavor, } from './factories/defineInjection.js';
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/injection-engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAGpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,2BAA2B,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAEpG,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAM9E,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE9F,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/injection-engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAC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