agentfootprint 2.11.0 → 2.11.2

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.
Files changed (110) hide show
  1. package/README.md +2 -1
  2. package/dist/core/Agent.js +89 -1341
  3. package/dist/core/Agent.js.map +1 -1
  4. package/dist/core/agent/AgentBuilder.js +489 -0
  5. package/dist/core/agent/AgentBuilder.js.map +1 -0
  6. package/dist/core/agent/buildAgentChart.js +227 -0
  7. package/dist/core/agent/buildAgentChart.js.map +1 -0
  8. package/dist/core/agent/buildToolRegistry.js +115 -0
  9. package/dist/core/agent/buildToolRegistry.js.map +1 -0
  10. package/dist/core/agent/stages/breakFinal.js +28 -0
  11. package/dist/core/agent/stages/breakFinal.js.map +1 -0
  12. package/dist/core/agent/stages/callLLM.js +129 -0
  13. package/dist/core/agent/stages/callLLM.js.map +1 -0
  14. package/dist/core/agent/stages/iterationStart.js +24 -0
  15. package/dist/core/agent/stages/iterationStart.js.map +1 -0
  16. package/dist/core/agent/stages/prepareFinal.js +45 -0
  17. package/dist/core/agent/stages/prepareFinal.js.map +1 -0
  18. package/dist/core/agent/stages/route.js +36 -0
  19. package/dist/core/agent/stages/route.js.map +1 -0
  20. package/dist/core/agent/stages/seed.js +95 -0
  21. package/dist/core/agent/stages/seed.js.map +1 -0
  22. package/dist/core/agent/stages/toolCalls.js +250 -0
  23. package/dist/core/agent/stages/toolCalls.js.map +1 -0
  24. package/dist/core/agent/types.js +12 -0
  25. package/dist/core/agent/types.js.map +1 -0
  26. package/dist/core/agent/validators.js +131 -0
  27. package/dist/core/agent/validators.js.map +1 -0
  28. package/dist/esm/core/Agent.js +87 -1338
  29. package/dist/esm/core/Agent.js.map +1 -1
  30. package/dist/esm/core/agent/AgentBuilder.js +485 -0
  31. package/dist/esm/core/agent/AgentBuilder.js.map +1 -0
  32. package/dist/esm/core/agent/buildAgentChart.js +223 -0
  33. package/dist/esm/core/agent/buildAgentChart.js.map +1 -0
  34. package/dist/esm/core/agent/buildToolRegistry.js +111 -0
  35. package/dist/esm/core/agent/buildToolRegistry.js.map +1 -0
  36. package/dist/esm/core/agent/stages/breakFinal.js +24 -0
  37. package/dist/esm/core/agent/stages/breakFinal.js.map +1 -0
  38. package/dist/esm/core/agent/stages/callLLM.js +125 -0
  39. package/dist/esm/core/agent/stages/callLLM.js.map +1 -0
  40. package/dist/esm/core/agent/stages/iterationStart.js +20 -0
  41. package/dist/esm/core/agent/stages/iterationStart.js.map +1 -0
  42. package/dist/esm/core/agent/stages/prepareFinal.js +41 -0
  43. package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -0
  44. package/dist/esm/core/agent/stages/route.js +32 -0
  45. package/dist/esm/core/agent/stages/route.js.map +1 -0
  46. package/dist/esm/core/agent/stages/seed.js +91 -0
  47. package/dist/esm/core/agent/stages/seed.js.map +1 -0
  48. package/dist/esm/core/agent/stages/toolCalls.js +246 -0
  49. package/dist/esm/core/agent/stages/toolCalls.js.map +1 -0
  50. package/dist/esm/core/agent/types.js +11 -0
  51. package/dist/esm/core/agent/types.js.map +1 -0
  52. package/dist/esm/core/agent/validators.js +124 -0
  53. package/dist/esm/core/agent/validators.js.map +1 -0
  54. package/dist/esm/reliability/CircuitBreaker.js +156 -0
  55. package/dist/esm/reliability/CircuitBreaker.js.map +1 -0
  56. package/dist/esm/reliability/buildReliabilityGateChart.js +359 -0
  57. package/dist/esm/reliability/buildReliabilityGateChart.js.map +1 -0
  58. package/dist/esm/reliability/classifyError.js +56 -0
  59. package/dist/esm/reliability/classifyError.js.map +1 -0
  60. package/dist/esm/reliability/index.js +36 -0
  61. package/dist/esm/reliability/index.js.map +1 -0
  62. package/dist/esm/reliability/types.js +44 -0
  63. package/dist/esm/reliability/types.js.map +1 -0
  64. package/dist/reliability/CircuitBreaker.js +165 -0
  65. package/dist/reliability/CircuitBreaker.js.map +1 -0
  66. package/dist/reliability/buildReliabilityGateChart.js +363 -0
  67. package/dist/reliability/buildReliabilityGateChart.js.map +1 -0
  68. package/dist/reliability/classifyError.js +60 -0
  69. package/dist/reliability/classifyError.js.map +1 -0
  70. package/dist/reliability/index.js +42 -0
  71. package/dist/reliability/index.js.map +1 -0
  72. package/dist/reliability/types.js +48 -0
  73. package/dist/reliability/types.js.map +1 -0
  74. package/dist/types/core/Agent.d.ts +7 -400
  75. package/dist/types/core/Agent.d.ts.map +1 -1
  76. package/dist/types/core/agent/AgentBuilder.d.ts +348 -0
  77. package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -0
  78. package/dist/types/core/agent/buildAgentChart.d.ts +74 -0
  79. package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -0
  80. package/dist/types/core/agent/buildToolRegistry.d.ts +62 -0
  81. package/dist/types/core/agent/buildToolRegistry.d.ts.map +1 -0
  82. package/dist/types/core/agent/stages/breakFinal.d.ts +23 -0
  83. package/dist/types/core/agent/stages/breakFinal.d.ts.map +1 -0
  84. package/dist/types/core/agent/stages/callLLM.d.ts +54 -0
  85. package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -0
  86. package/dist/types/core/agent/stages/iterationStart.d.ts +16 -0
  87. package/dist/types/core/agent/stages/iterationStart.d.ts.map +1 -0
  88. package/dist/types/core/agent/stages/prepareFinal.d.ts +20 -0
  89. package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -0
  90. package/dist/types/core/agent/stages/route.d.ts +19 -0
  91. package/dist/types/core/agent/stages/route.d.ts.map +1 -0
  92. package/dist/types/core/agent/stages/seed.d.ts +54 -0
  93. package/dist/types/core/agent/stages/seed.d.ts.map +1 -0
  94. package/dist/types/core/agent/stages/toolCalls.d.ts +50 -0
  95. package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -0
  96. package/dist/types/core/agent/types.d.ts +154 -0
  97. package/dist/types/core/agent/types.d.ts.map +1 -0
  98. package/dist/types/core/agent/validators.d.ts +48 -0
  99. package/dist/types/core/agent/validators.d.ts.map +1 -0
  100. package/dist/types/reliability/CircuitBreaker.d.ts +76 -0
  101. package/dist/types/reliability/CircuitBreaker.d.ts.map +1 -0
  102. package/dist/types/reliability/buildReliabilityGateChart.d.ts +54 -0
  103. package/dist/types/reliability/buildReliabilityGateChart.d.ts.map +1 -0
  104. package/dist/types/reliability/classifyError.d.ts +29 -0
  105. package/dist/types/reliability/classifyError.d.ts.map +1 -0
  106. package/dist/types/reliability/index.d.ts +34 -0
  107. package/dist/types/reliability/index.d.ts.map +1 -0
  108. package/dist/types/reliability/types.d.ts +256 -0
  109. package/dist/types/reliability/types.d.ts.map +1 -0
  110. package/package.json +1 -1
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /**
3
+ * Reliability — public surface for the v2.11.1 rules-based reliability
4
+ * subsystem. Internal-only helpers (CircuitBreaker class, classifyError,
5
+ * buildReliabilityGate) live in their own files; this barrel exports
6
+ * the consumer-facing types and the typed error.
7
+ *
8
+ * Consumer use:
9
+ * ```ts
10
+ * import { Agent } from 'agentfootprint';
11
+ * import type { ReliabilityRule, ReliabilityScope } from 'agentfootprint/reliability';
12
+ * import { ReliabilityFailFastError } from 'agentfootprint/reliability';
13
+ *
14
+ * const agent = Agent.create({...}).reliability({
15
+ * postDecide: [
16
+ * { when: (s) => s.errorKind === '5xx-transient' && s.attempt < 3,
17
+ * then: 'retry', kind: 'transient-retry' },
18
+ * { when: (s) => s.error !== undefined,
19
+ * then: 'fail-fast', kind: 'unrecoverable' },
20
+ * ],
21
+ * }).build();
22
+ *
23
+ * try {
24
+ * await agent.run({ message: '...' });
25
+ * } catch (e) {
26
+ * if (e instanceof ReliabilityFailFastError) {
27
+ * console.log(e.kind, e.reason);
28
+ * }
29
+ * }
30
+ * ```
31
+ */
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ exports.initialBreakerState = exports.CircuitOpenError = exports.ReliabilityFailFastError = void 0;
34
+ var types_js_1 = require("./types.js");
35
+ Object.defineProperty(exports, "ReliabilityFailFastError", { enumerable: true, get: function () { return types_js_1.ReliabilityFailFastError; } });
36
+ // CircuitBreaker pure-state-machine surface — exposed so consumers can
37
+ // hydrate breaker state from a persistence store (Redis/DynamoDB) or
38
+ // inspect projected state in their own observability adapters.
39
+ var CircuitBreaker_js_1 = require("./CircuitBreaker.js");
40
+ Object.defineProperty(exports, "CircuitOpenError", { enumerable: true, get: function () { return CircuitBreaker_js_1.CircuitOpenError; } });
41
+ Object.defineProperty(exports, "initialBreakerState", { enumerable: true, get: function () { return CircuitBreaker_js_1.initialBreakerState; } });
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reliability/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;AAYH,uCAAsD;AAA7C,oHAAA,wBAAwB,OAAA;AAEjC,uEAAuE;AACvE,qEAAqE;AACrE,+DAA+D;AAC/D,yDAK6B;AAJ3B,qHAAA,gBAAgB,OAAA;AAChB,wHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReliabilityFailFastError = void 0;
4
+ // ─── Public typed error ──────────────────────────────────────────────
5
+ /**
6
+ * Thrown by `Agent.run()` when a reliability rule routes to `'fail-fast'`
7
+ * and the gate $breaks with a reason. Carries:
8
+ *
9
+ * • `kind` — machine-readable identifier from the matched rule's
10
+ * `kind` field. Stable across versions; consumers
11
+ * branch on this.
12
+ * • `reason` — human-readable narrative string from `$break(reason)`.
13
+ * Format: `'reliability-{phase}: {label}'` (e.g.,
14
+ * `'reliability-post-decide: cost-cap-exceeded'`).
15
+ * • `cause` — the originating error from the LLM call, when one
16
+ * drove the fail-fast decision (e.g., the underlying
17
+ * HTTP error that tripped a circuit breaker).
18
+ * • `snapshot` — the full `executor.getSnapshot()` at fail-fast time
19
+ * for forensics. Consumers persist this for postmortem
20
+ * analysis (commitLog, narrative, scope state, etc.).
21
+ *
22
+ * Three-channel discipline: `kind`/`payload` came from scope state,
23
+ * `reason` came from $break, `snapshot` is the engine's own audit trail.
24
+ * Emit events flowed independently to any attached observability adapter
25
+ * (this error is the RUNTIME signal; emit is the OBSERVABILITY signal).
26
+ */
27
+ class ReliabilityFailFastError extends Error {
28
+ code = 'ERR_RELIABILITY_FAIL_FAST';
29
+ kind;
30
+ reason;
31
+ cause;
32
+ snapshot;
33
+ payload;
34
+ constructor(opts) {
35
+ super(`[reliability] ${opts.kind}: ${opts.reason}`);
36
+ this.name = 'ReliabilityFailFastError';
37
+ this.kind = opts.kind;
38
+ this.reason = opts.reason;
39
+ if (opts.cause !== undefined)
40
+ this.cause = opts.cause;
41
+ if (opts.snapshot !== undefined)
42
+ this.snapshot = opts.snapshot;
43
+ if (opts.payload !== undefined)
44
+ this.payload = opts.payload;
45
+ }
46
+ }
47
+ exports.ReliabilityFailFastError = ReliabilityFailFastError;
48
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/reliability/types.ts"],"names":[],"mappings":";;;AA2QA,wEAAwE;AAExE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,wBAAyB,SAAQ,KAAK;IACxC,IAAI,GAAG,2BAAoC,CAAC;IAC5C,IAAI,CAAS;IACb,MAAM,CAAS;IACf,KAAK,CAAS;IACd,QAAQ,CAAW;IACnB,OAAO,CAAmC;IAEnD,YAAY,IAMX;QACC,KAAK,CAAC,iBAAiB,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACtD,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;YAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/D,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9D,CAAC;CACF;AAvBD,4DAuBC"}
@@ -16,81 +16,18 @@
16
16
  import { type CombinedNarrativeEntry, type FlowChart, type FlowchartCheckpoint, type RunOptions, type RuntimeSnapshot } from 'footprintjs';
17
17
  import type { CachePolicy, CacheStrategy } from '../cache/types.js';
18
18
  import { type RunnerPauseOutcome } from './pause.js';
19
- import type { LLMProvider, PermissionChecker, PricingTable } from '../adapters/types.js';
20
- import type { MemoryIdentity } from '../memory/identity/index.js';
21
19
  import type { MemoryDefinition } from '../memory/define.types.js';
22
20
  import type { Injection } from '../lib/injection-engine/types.js';
23
- import { type OutputFallbackOptions, type ResolvedOutputFallback } from './outputFallback.js';
21
+ import { type ResolvedOutputFallback } from './outputFallback.js';
24
22
  import { type AgentRunCheckpoint } from './runCheckpoint.js';
25
- import { type OutputSchemaOptions, type OutputSchemaParser } from './outputSchema.js';
23
+ import { type OutputSchemaParser } from './outputSchema.js';
26
24
  import { RunnerBase } from './RunnerBase.js';
27
- import type { Tool, ToolRegistryEntry } from './tools.js';
25
+ import type { ToolRegistryEntry } from './tools.js';
28
26
  import type { ToolProvider } from '../tool-providers/types.js';
29
- export interface AgentOptions {
30
- readonly provider: LLMProvider;
31
- /** Human-friendly name shown in events/metrics. Default: 'Agent'. */
32
- readonly name?: string;
33
- /** Stable id used for topology + events. Default: 'agent'. */
34
- readonly id?: string;
35
- readonly model: string;
36
- readonly temperature?: number;
37
- readonly maxTokens?: number;
38
- /** Hard budget on ReAct iterations. Default: 10. Hard cap: 50. */
39
- readonly maxIterations?: number;
40
- /**
41
- * Pricing adapter. When set, Agent emits `agentfootprint.cost.tick`
42
- * after every LLM response (once per ReAct iteration) with per-call
43
- * and cumulative USD. Run-scoped — the cumulative resets each `.run()`.
44
- */
45
- readonly pricingTable?: PricingTable;
46
- /**
47
- * Cumulative USD budget per run. With `pricingTable`, Agent emits a
48
- * one-shot `agentfootprint.cost.limit_hit` (`action: 'warn'`) when
49
- * cumulative USD crosses this budget. Execution continues — consumers
50
- * choose whether to abort by listening to the event.
51
- */
52
- readonly costBudget?: number;
53
- /**
54
- * Permission adapter. When set, the Agent calls
55
- * `permissionChecker.check({capability: 'tool_call', ...})` BEFORE every
56
- * `tool.execute()`. Emits `agentfootprint.permission.check` with the
57
- * decision. On `deny`, the tool is skipped and its result is a
58
- * synthetic denial string; on `allow` / `gate_open`, execution proceeds
59
- * normally.
60
- */
61
- readonly permissionChecker?: PermissionChecker;
62
- /**
63
- * Global cache kill switch (v2.6+). `'off'` disables the cache
64
- * layer entirely — the CacheGate decider routes to `'no-markers'`
65
- * every iteration regardless of other rules. Default: caching
66
- * enabled (auto-resolved per provider via the strategy registry).
67
- *
68
- * Use `'off'` for low-frequency agents (cron jobs running once per
69
- * hour) where the cache TTL guarantees zero cache hits and the
70
- * cache-write penalty isn't worth paying.
71
- */
72
- readonly caching?: 'off';
73
- /**
74
- * Optional explicit CacheStrategy override (v2.6+). Defaults to
75
- * `getDefaultCacheStrategy(provider.name)` — so Anthropic/OpenAI/
76
- * Bedrock/Mock providers auto-resolve to their respective strategies
77
- * once those land in Phase 7+.
78
- */
79
- readonly cacheStrategy?: CacheStrategy;
80
- }
81
- export interface AgentInput {
82
- readonly message: string;
83
- /**
84
- * Multi-tenant memory scope. Populated to `scope.identity` so memory
85
- * subflows registered via `.memory()` can isolate reads/writes per
86
- * tenant + principal + conversation.
87
- *
88
- * Defaults to `{ conversationId: '<runId>' }` when omitted, so agents
89
- * without memory work unchanged.
90
- */
91
- readonly identity?: MemoryIdentity;
92
- }
93
- export type AgentOutput = string;
27
+ import type { AgentInput, AgentOptions, AgentOutput } from './agent/types.js';
28
+ import { AgentBuilder } from './agent/AgentBuilder.js';
29
+ export { AgentBuilder };
30
+ export type { AgentInput, AgentOptions, AgentOutput };
94
31
  export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
95
32
  readonly name: string;
96
33
  readonly id: string;
@@ -308,334 +245,4 @@ export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
308
245
  private finalizeResult;
309
246
  private buildChart;
310
247
  }
311
- /**
312
- * Fluent builder. `tool()` accepts any Tool<TArgs, TResult> and registers
313
- * it by its schema.name. Duplicate names throw at build time.
314
- */
315
- export declare class AgentBuilder {
316
- private readonly opts;
317
- private systemPromptValue;
318
- /**
319
- * Cache policy for the base system prompt. Set via the optional
320
- * 2nd argument to `.system(text, { cache })`. Default `'always'` —
321
- * the base prompt is stable per-turn and an ideal cache anchor.
322
- */
323
- private systemPromptCachePolicy;
324
- /**
325
- * Global cache kill switch. Set via `Agent.create({ caching: 'off' })`
326
- * (handled in `AgentOptions` propagation). Defaults to `false`
327
- * (caching enabled). When `true`, the CacheGate decider routes to
328
- * `'no-markers'` every iteration regardless of other rules.
329
- */
330
- private cachingDisabledValue;
331
- /**
332
- * Optional explicit CacheStrategy override. Default: undefined,
333
- * which means the agent auto-resolves from
334
- * `getDefaultCacheStrategy(provider.name)` at construction. Power
335
- * users override here for custom backends or test mocks.
336
- */
337
- private cacheStrategyOverride?;
338
- private readonly registry;
339
- private readonly injectionList;
340
- private readonly memoryList;
341
- /**
342
- * Optional terminal contract — see `outputSchema()`. Stored on the
343
- * builder, propagated to the Agent at `.build()` time.
344
- */
345
- private outputSchemaParser?;
346
- /** 3-tier output fallback chain — set via `.outputFallback({...})`.
347
- * Optional; absent = current throw-on-validation-failure behavior. */
348
- private outputFallbackCfg?;
349
- /**
350
- * Optional `ToolProvider` set via `.toolProvider()`. Propagated to
351
- * the Agent's Tools slot subflow + tool-call dispatcher; consulted
352
- * per iteration so dynamic chains (`gatedTools`, `skillScopedTools`)
353
- * react to current activation state.
354
- */
355
- private toolProviderRef?;
356
- /**
357
- * Optional override for `AgentOptions.maxIterations`. When set via
358
- * the `.maxIterations()` builder method, takes precedence over the
359
- * value passed to `Agent.create({ maxIterations })`.
360
- */
361
- private maxIterationsOverride?;
362
- /**
363
- * Recorders collected via `.recorder()`. Attached to the built Agent
364
- * before `build()` returns (each via `agent.attach(rec)`).
365
- */
366
- private readonly recorderList;
367
- private appNameValue;
368
- private commentaryOverrides;
369
- private thinkingOverrides;
370
- constructor(opts: AgentOptions);
371
- /**
372
- * Set the base system prompt.
373
- *
374
- * @param prompt - The system prompt text. Stable per-turn.
375
- * @param options - Optional config. `cache` controls how the
376
- * CacheDecision subflow treats this prompt block:
377
- * - `'always'` (default) — cache the base prompt as a stable
378
- * prefix anchor. Highest cache-hit rate; recommended for
379
- * production agents whose system prompt rarely changes.
380
- * - `'never'` — skip caching. Use if the prompt contains volatile
381
- * content (timestamps, per-request user IDs).
382
- * - `'while-active'` — semantically equivalent to `'always'` for
383
- * the base prompt (it's always active by definition).
384
- * - `{ until }` — conditional invalidation (e.g., flush after iter 5).
385
- */
386
- system(prompt: string, options?: {
387
- readonly cache?: CachePolicy;
388
- }): this;
389
- tool<TArgs, TResult>(tool: Tool<TArgs, TResult>): this;
390
- /**
391
- * Register many tools at once. Convenience for tool sources that
392
- * return a list (e.g., `await mcpClient(...).tools()`). Each tool
393
- * is registered via `.tool()` so duplicate-name validation still
394
- * fires per-entry.
395
- */
396
- tools(tools: ReadonlyArray<Tool>): this;
397
- /**
398
- * Wire a chainable `ToolProvider` (from `agentfootprint/tool-providers`)
399
- * as the agent's per-iteration tool source.
400
- *
401
- * The provider is consulted EVERY iteration via `provider.list(ctx)`
402
- * with `ctx = { iteration, activeSkillId, identity }`. Tools the
403
- * provider emits flow into the Tools slot alongside any static
404
- * tools registered via `.tool()` / `.tools()`. The tool-call
405
- * dispatcher also consults the provider so dynamic chains
406
- * (`gatedTools`, `skillScopedTools`) dispatch correctly when their
407
- * visible-set changes mid-turn.
408
- *
409
- * Throws if called more than once on the same builder (avoids
410
- * silent override surprises).
411
- *
412
- * @example Permission-gated baseline
413
- * import { gatedTools, staticTools } from 'agentfootprint/tool-providers';
414
- * import { PermissionPolicy } from 'agentfootprint/security';
415
- *
416
- * const policy = PermissionPolicy.fromRoles({
417
- * readonly: ['lookup', 'list_skills', 'read_skill'],
418
- * admin: ['lookup', 'list_skills', 'read_skill', 'delete'],
419
- * }, 'readonly');
420
- *
421
- * const provider = gatedTools(
422
- * staticTools(allTools),
423
- * (toolName) => policy.isAllowed(toolName),
424
- * );
425
- *
426
- * const agent = Agent.create({ provider: llm, model })
427
- * .system('You answer.')
428
- * .toolProvider(provider)
429
- * .build();
430
- */
431
- toolProvider(provider: ToolProvider): this;
432
- /**
433
- * Override the ReAct iteration cap set via `Agent.create({
434
- * maxIterations })`. Convenience for builder-style code that prefers
435
- * fluent setters over constructor opts. Last call wins.
436
- *
437
- * Throws if `n` is not a positive integer or exceeds the hard cap
438
- * (`clampIterations`'s upper bound).
439
- */
440
- maxIterations(n: number): this;
441
- /**
442
- * Attach a footprintjs `CombinedRecorder` to the built Agent. Wired
443
- * via `agent.attach(rec)` immediately after construction, so the
444
- * recorder sees every event from the very first run.
445
- *
446
- * Equivalent to calling `agent.attach(rec)` post-build; the builder
447
- * method is a convenience for codebases that prefer fully-fluent
448
- * agent assembly. Multiple recorders are supported (each gets its
449
- * own `attach()` call).
450
- */
451
- recorder(rec: import('footprintjs').CombinedRecorder): this;
452
- /**
453
- * Set the agent's display name — substituted as `{{appName}}` in
454
- * commentary + thinking templates. Same place to brand a tenant
455
- * ("Acme Bot"), distinguish multi-agent roles ("Triage" vs
456
- * "Reviewer"), or localize ("Asistente"). Default: `'Chatbot'`.
457
- */
458
- appName(name: string): this;
459
- /**
460
- * Override agentfootprint's bundled commentary templates. Spread on
461
- * top of `defaultCommentaryTemplates`; missing keys fall back. Same
462
- * `Record<string, string>` shape with `{{vars}}` substitution as
463
- * the bundled defaults — see `defaultCommentaryTemplates` for the
464
- * full key list.
465
- *
466
- * Use cases: i18n (`'agent.turn_start': 'El usuario...'`), brand
467
- * voice ("You: {{userPrompt}}"), per-tenant customization.
468
- */
469
- commentaryTemplates(templates: Readonly<Record<string, string>>): this;
470
- /**
471
- * Override agentfootprint's bundled thinking templates. Same
472
- * contract shape as commentary; different vocabulary — first-person
473
- * status the chat bubble shows mid-call. Per-tool overrides go via
474
- * `tool.<toolName>` keys (e.g., `'tool.weather': 'Looking up the
475
- * weather…'`). See `defaultThinkingTemplates` for the full key list.
476
- */
477
- thinkingTemplates(templates: Readonly<Record<string, string>>): this;
478
- /**
479
- * Register any `Injection`. Use this for power-user / custom flavors;
480
- * for built-in flavors use the typed sugar (`.skill`, `.steering`,
481
- * `.instruction`, `.fact`).
482
- */
483
- injection(injection: Injection): this;
484
- /**
485
- * Register a Skill — LLM-activated, system-prompt + tools.
486
- * Auto-attaches the `read_skill` activation tool to the agent.
487
- * Skill stays active for the rest of the turn once activated.
488
- */
489
- skill(injection: Injection): this;
490
- /**
491
- * Bulk-register every Skill in a `SkillRegistry`. Use for shared
492
- * skill catalogs across multiple Agents — register skills once on
493
- * the registry; attach the same registry to every consumer Agent.
494
- *
495
- * @example
496
- * const registry = new SkillRegistry();
497
- * registry.register(billingSkill).register(refundSkill);
498
- * const supportAgent = Agent.create({ provider }).skills(registry).build();
499
- * const escalationAgent = Agent.create({ provider }).skills(registry).build();
500
- */
501
- skills(registry: {
502
- list(): readonly Injection[];
503
- }): this;
504
- /**
505
- * Register a Steering doc — always-on system-prompt rule.
506
- * Use for invariant guidance: output format, persona, safety policies.
507
- */
508
- steering(injection: Injection): this;
509
- /**
510
- * Register an Instruction — rule-based system-prompt guidance.
511
- * Predicate runs each iteration. Use for context-dependent rules
512
- * including the "Dynamic ReAct" `on-tool-return` pattern.
513
- */
514
- instruction(injection: Injection): this;
515
- /**
516
- * Bulk-register many instructions at once. Convenience for consumer
517
- * code that organizes its instruction set in a flat array (`const
518
- * instructions = [outputFormat, dataRouting, ...]`). Each element
519
- * is registered via `.instruction()` so duplicate-id checks still
520
- * fire per-entry.
521
- */
522
- instructions(injections: ReadonlyArray<Injection>): this;
523
- /**
524
- * Register a Fact — developer-supplied data the LLM should see.
525
- * User profile, env info, computed summary, current time, …
526
- * Distinct from Skills (LLM-activated guidance) and Steering
527
- * (always-on rules) in INTENT — the engine treats them all alike.
528
- */
529
- fact(injection: Injection): this;
530
- /**
531
- * Register a Memory subsystem — load/persist conversation context,
532
- * facts, narrative beats, or causal snapshots across runs.
533
- *
534
- * The `MemoryDefinition` is produced by `defineMemory({ type, strategy,
535
- * store })`. Multiple memories layer cleanly via per-id scope keys
536
- * (`memoryInjection_${id}`):
537
- *
538
- * ```ts
539
- * Agent.create({ provider })
540
- * .memory(defineMemory({ id: 'short', type: MEMORY_TYPES.EPISODIC,
541
- * strategy: { kind: MEMORY_STRATEGIES.WINDOW, size: 10 },
542
- * store }))
543
- * .memory(defineMemory({ id: 'facts', type: MEMORY_TYPES.SEMANTIC,
544
- * strategy: { kind: MEMORY_STRATEGIES.EXTRACT,
545
- * extractor: 'pattern' }, store }))
546
- * .build();
547
- * ```
548
- *
549
- * The READ subflow runs at the configured `timing` (default
550
- * `MEMORY_TIMING.TURN_START`) and writes its formatted output to the
551
- * `memoryInjection_${id}` scope key for the slot subflows to consume.
552
- */
553
- memory(definition: MemoryDefinition): this;
554
- /**
555
- * Register a RAG retriever — semantic search over a vector-indexed
556
- * corpus. Identical plumbing to `.memory()` (RAG resolves to a
557
- * `MemoryDefinition` produced by `defineRAG()`); this alias exists
558
- * so the consumer's intent reads clearly:
559
- *
560
- * ```ts
561
- * agent
562
- * .memory(shortTermConversation) // remembers what the USER said
563
- * .rag(productDocs) // retrieves what the CORPUS says
564
- * .build();
565
- * ```
566
- *
567
- * Both end up as memory subflows, but the alias separates "user
568
- * conversation memory" from "document corpus retrieval" in code
569
- * intent, ids, and Lens chips.
570
- */
571
- rag(definition: MemoryDefinition): this;
572
- /**
573
- * Declarative terminal contract. The agent's final answer must be
574
- * JSON matching `parser`. Auto-injects a system-prompt instruction
575
- * telling the LLM the shape, and exposes `agent.runTyped()` /
576
- * `agent.parseOutput()` for parse + validate at the call site.
577
- *
578
- * The `parser` is duck-typed: any object with a `parse(unknown): T`
579
- * method works (Zod, Valibot, ArkType, hand-written). The optional
580
- * `description` field on the parser drives the auto-generated
581
- * instruction; consumers can also override via `opts.instruction`.
582
- *
583
- * Throws if called more than once on the same builder (avoids
584
- * silent override surprises).
585
- *
586
- * @param parser Validation strategy that throws on shape failure.
587
- * @param opts Optional `{ name, instruction }` to customize.
588
- *
589
- * @example
590
- * import { z } from 'zod';
591
- * const Output = z.object({
592
- * status: z.enum(['ok', 'err']),
593
- * items: z.array(z.string()),
594
- * }).describe('A status enum + an array of strings.');
595
- *
596
- * const agent = Agent.create({...})
597
- * .outputSchema(Output)
598
- * .build();
599
- *
600
- * const typed = await agent.runTyped({ message: '...' });
601
- * typed.status; // narrowed to 'ok' | 'err'
602
- */
603
- outputSchema<T>(parser: OutputSchemaParser<T>, opts?: OutputSchemaOptions): this;
604
- /**
605
- * 3-tier degradation for output-schema validation failures. Pairs
606
- * with `.outputSchema()` — calling `.outputFallback()` without an
607
- * `outputSchema` first throws (the fallback has nothing to validate).
608
- *
609
- * Three tiers:
610
- *
611
- * 1. **Primary** — LLM emitted schema-valid JSON. Caller gets it.
612
- * 2. **Fallback** — `OutputSchemaError` thrown. The async
613
- * `fallback(error, raw)` runs; its return is re-validated.
614
- * 3. **Canned** — static safety-net value. NEVER throws when set.
615
- *
616
- * `canned` is validated against the schema at builder time —
617
- * fail-fast on misconfig (a `canned` that doesn't validate would
618
- * defeat the fail-open guarantee).
619
- *
620
- * Two typed events fire on tier transitions for observability:
621
- * - `agentfootprint.resilience.output_fallback_triggered`
622
- * - `agentfootprint.resilience.output_canned_used`
623
- *
624
- * @example
625
- * ```ts
626
- * import { z } from 'zod';
627
- * const Refund = z.object({ amount: z.number(), reason: z.string() });
628
- *
629
- * const agent = Agent.create({...})
630
- * .outputSchema(Refund)
631
- * .outputFallback({
632
- * fallback: async (err, raw) => ({ amount: 0, reason: 'manual review' }),
633
- * canned: { amount: 0, reason: 'unable to process' },
634
- * })
635
- * .build();
636
- * ```
637
- */
638
- outputFallback<T>(options: OutputFallbackOptions<T>): this;
639
- build(): Agent;
640
- }
641
248
  //# sourceMappingURL=Agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../../src/core/Agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,mBAAmB,EAExB,KAAK,UAAU,EACf,KAAK,eAAe,EAErB,MAAM,aAAa,CAAC;AAQrB,OAAO,KAAK,EAAe,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAOjF,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,KAAK,EACV,WAAW,EAIX,iBAAiB,EACjB,YAAY,EACb,MAAM,sBAAsB,CAAC;AAgB9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AASlE,OAAO,KAAK,EAAmB,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAEnF,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAKL,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAa,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAuB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEpF,MAAM,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