@mcp-abap-adt/llm-agent 16.1.1 → 17.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.
Files changed (76) hide show
  1. package/dist/coordinator-signals.d.ts +24 -0
  2. package/dist/coordinator-signals.d.ts.map +1 -0
  3. package/dist/coordinator-signals.js +33 -0
  4. package/dist/coordinator-signals.js.map +1 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +2 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/interfaces/builder.d.ts +7 -1
  10. package/dist/interfaces/builder.d.ts.map +1 -1
  11. package/dist/interfaces/context-path.d.ts +17 -0
  12. package/dist/interfaces/context-path.d.ts.map +1 -0
  13. package/dist/interfaces/context-path.js +2 -0
  14. package/dist/interfaces/context-path.js.map +1 -0
  15. package/dist/interfaces/coordinator.d.ts +21 -18
  16. package/dist/interfaces/coordinator.d.ts.map +1 -1
  17. package/dist/interfaces/dag-plan.d.ts +19 -0
  18. package/dist/interfaces/dag-plan.d.ts.map +1 -0
  19. package/dist/interfaces/dag-plan.js +2 -0
  20. package/dist/interfaces/dag-plan.js.map +1 -0
  21. package/dist/interfaces/error-strategy.d.ts +24 -0
  22. package/dist/interfaces/error-strategy.d.ts.map +1 -0
  23. package/dist/interfaces/error-strategy.js +2 -0
  24. package/dist/interfaces/error-strategy.js.map +1 -0
  25. package/dist/interfaces/finalizer.d.ts +33 -0
  26. package/dist/interfaces/finalizer.d.ts.map +1 -0
  27. package/dist/interfaces/finalizer.js +2 -0
  28. package/dist/interfaces/finalizer.js.map +1 -0
  29. package/dist/interfaces/index.d.ts +11 -1
  30. package/dist/interfaces/index.d.ts.map +1 -1
  31. package/dist/interfaces/index.js.map +1 -1
  32. package/dist/interfaces/interpreter.d.ts +56 -0
  33. package/dist/interfaces/interpreter.d.ts.map +1 -0
  34. package/dist/interfaces/interpreter.js +2 -0
  35. package/dist/interfaces/interpreter.js.map +1 -0
  36. package/dist/interfaces/planner.d.ts +33 -0
  37. package/dist/interfaces/planner.d.ts.map +1 -0
  38. package/dist/interfaces/planner.js +2 -0
  39. package/dist/interfaces/planner.js.map +1 -0
  40. package/dist/interfaces/request-logger.d.ts +19 -8
  41. package/dist/interfaces/request-logger.d.ts.map +1 -1
  42. package/dist/interfaces/review.d.ts +66 -0
  43. package/dist/interfaces/review.d.ts.map +1 -0
  44. package/dist/interfaces/review.js +2 -0
  45. package/dist/interfaces/review.js.map +1 -0
  46. package/dist/interfaces/session-identity.d.ts +10 -0
  47. package/dist/interfaces/session-identity.d.ts.map +1 -0
  48. package/dist/interfaces/session-identity.js +2 -0
  49. package/dist/interfaces/session-identity.js.map +1 -0
  50. package/dist/interfaces/skill.d.ts +6 -0
  51. package/dist/interfaces/skill.d.ts.map +1 -1
  52. package/dist/interfaces/state-oracle.d.ts +22 -0
  53. package/dist/interfaces/state-oracle.d.ts.map +1 -0
  54. package/dist/interfaces/state-oracle.js +2 -0
  55. package/dist/interfaces/state-oracle.js.map +1 -0
  56. package/dist/interfaces/streaming.d.ts +29 -0
  57. package/dist/interfaces/streaming.d.ts.map +1 -0
  58. package/dist/interfaces/streaming.js +2 -0
  59. package/dist/interfaces/streaming.js.map +1 -0
  60. package/dist/interfaces/subagent-context.d.ts +0 -1
  61. package/dist/interfaces/subagent-context.d.ts.map +1 -1
  62. package/dist/interfaces/subagent.d.ts +20 -32
  63. package/dist/interfaces/subagent.d.ts.map +1 -1
  64. package/dist/interfaces/types.d.ts +9 -5
  65. package/dist/interfaces/types.d.ts.map +1 -1
  66. package/dist/interfaces/types.js.map +1 -1
  67. package/dist/needs-decomposition-error.d.ts +10 -0
  68. package/dist/needs-decomposition-error.d.ts.map +1 -0
  69. package/dist/needs-decomposition-error.js +14 -0
  70. package/dist/needs-decomposition-error.js.map +1 -0
  71. package/dist/rag/in-memory-rag.d.ts.map +1 -1
  72. package/dist/rag/in-memory-rag.js +5 -1
  73. package/dist/rag/in-memory-rag.js.map +1 -1
  74. package/dist/types.d.ts +9 -5
  75. package/dist/types.d.ts.map +1 -1
  76. package/package.json +1 -1
@@ -0,0 +1,24 @@
1
+ import type { LlmUsage } from './interfaces/types.js';
2
+ /** A role (planner/reviewer) needs a REALITY fact; the coordinator routes the
3
+ * query to the state-oracle and re-invokes the role (autonomous, same turn). */
4
+ export declare class NeedInfoSignal extends Error {
5
+ readonly query: string;
6
+ /** Token usage consumed by the LLM call that produced this signal.
7
+ * Throwers SHOULD populate it (`signal.usage = res.usage`) before
8
+ * re-throwing, so the coordinator can attribute LLM spend on signal
9
+ * paths (which would otherwise discard the captured usage). Mutable
10
+ * by design — keeping it on the constructor would force every thrower
11
+ * to thread it through extra plumbing. */
12
+ usage?: LlmUsage;
13
+ constructor(query: string, usage?: LlmUsage);
14
+ }
15
+ /** A role needs a HUMAN decision; the coordinator emits the question and ends
16
+ * the turn (the next turn replans fresh from current state). */
17
+ export declare class ClarifySignal extends Error {
18
+ readonly question: string;
19
+ /** Token usage consumed by the LLM call that produced this signal.
20
+ * Throwers SHOULD populate it before re-throwing — see NeedInfoSignal. */
21
+ usage?: LlmUsage;
22
+ constructor(question: string, usage?: LlmUsage);
23
+ }
24
+ //# sourceMappingURL=coordinator-signals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-signals.d.ts","sourceRoot":"","sources":["../src/coordinator-signals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;iFACiF;AACjF,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;+CAK2C;IAC3C,KAAK,CAAC,EAAE,QAAQ,CAAC;gBACL,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ;CAM5C;AAED;iEACiE;AACjE,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;+EAC2E;IAC3E,KAAK,CAAC,EAAE,QAAQ,CAAC;gBACL,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ;CAM/C"}
@@ -0,0 +1,33 @@
1
+ /** A role (planner/reviewer) needs a REALITY fact; the coordinator routes the
2
+ * query to the state-oracle and re-invokes the role (autonomous, same turn). */
3
+ export class NeedInfoSignal extends Error {
4
+ query;
5
+ /** Token usage consumed by the LLM call that produced this signal.
6
+ * Throwers SHOULD populate it (`signal.usage = res.usage`) before
7
+ * re-throwing, so the coordinator can attribute LLM spend on signal
8
+ * paths (which would otherwise discard the captured usage). Mutable
9
+ * by design — keeping it on the constructor would force every thrower
10
+ * to thread it through extra plumbing. */
11
+ usage;
12
+ constructor(query, usage) {
13
+ super(`needs info: ${query}`);
14
+ this.name = 'NeedInfoSignal';
15
+ this.query = query;
16
+ this.usage = usage;
17
+ }
18
+ }
19
+ /** A role needs a HUMAN decision; the coordinator emits the question and ends
20
+ * the turn (the next turn replans fresh from current state). */
21
+ export class ClarifySignal extends Error {
22
+ question;
23
+ /** Token usage consumed by the LLM call that produced this signal.
24
+ * Throwers SHOULD populate it before re-throwing — see NeedInfoSignal. */
25
+ usage;
26
+ constructor(question, usage) {
27
+ super(`needs clarification: ${question}`);
28
+ this.name = 'ClarifySignal';
29
+ this.question = question;
30
+ this.usage = usage;
31
+ }
32
+ }
33
+ //# sourceMappingURL=coordinator-signals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-signals.js","sourceRoot":"","sources":["../src/coordinator-signals.ts"],"names":[],"mappings":"AAEA;iFACiF;AACjF,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,KAAK,CAAS;IACvB;;;;;+CAK2C;IAC3C,KAAK,CAAY;IACjB,YAAY,KAAa,EAAE,KAAgB;QACzC,KAAK,CAAC,eAAe,KAAK,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAED;iEACiE;AACjE,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC7B,QAAQ,CAAS;IAC1B;+EAC2E;IAC3E,KAAK,CAAY;IACjB,YAAY,QAAgB,EAAE,KAAgB;QAC5C,KAAK,CAAC,wBAAwB,QAAQ,EAAE,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ export { ClarifySignal, NeedInfoSignal } from './coordinator-signals.js';
1
2
  export * from './errors/index.js';
2
3
  export * from './interfaces/index.js';
3
4
  export { BaseLLMProvider, type LLMProvider } from './llm/base-llm-provider.js';
5
+ export { NeedsDecompositionError } from './needs-decomposition-error.js';
4
6
  export * from './rag/index.js';
5
7
  export * from './types.js';
6
8
  export { ClineClientAdapter } from './adapters/cline-client-adapter.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC/E,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAI3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,uB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core subtrees.
2
+ export { ClarifySignal, NeedInfoSignal } from './coordinator-signals.js';
2
3
  export * from './errors/index.js';
3
4
  export * from './interfaces/index.js';
4
5
  export { BaseLLMProvider } from './llm/base-llm-provider.js';
6
+ export { NeedsDecompositionError } from './needs-decomposition-error.js';
5
7
  export * from './rag/index.js';
6
8
  export * from './types.js';
7
9
  // --- Library helpers (moved from @mcp-abap-adt/llm-agent-server) ---
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,eAAe,EAAoB,MAAM,4BAA4B,CAAC;AAC/E,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAE3B,sEAAsE;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,eAAe;AACf,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,iBAAiB;AACjB,OAAO,EACL,sBAAsB,EAGtB,iCAAiC,EACjC,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AACxC,yBAAyB;AACzB,OAAO,EACL,sBAAsB,GAKvB,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,oBAAoB;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,aAAa;AACb,OAAO,EACL,cAAc,GAGf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAA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M,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EACL,qBAAqB,EACrB,eAAe,GAChB,MAAM,uBAAuB,CAAC"}
@@ -3,8 +3,9 @@ import type { Message } from '../types.js';
3
3
  import type { AgentCallOptions, OrchestratorError, SmartAgentResponse } from './agent-contracts.js';
4
4
  import type { ILlmApiAdapter } from './api-adapter.js';
5
5
  import type { ILlm } from './llm.js';
6
+ import type { IMcpClient } from './mcp-client.js';
6
7
  import type { IModelProvider } from './model-provider.js';
7
- import type { IRag } from './rag.js';
8
+ import type { IRag, IRagRegistry } from './rag.js';
8
9
  import type { IRequestLogger } from './request-logger.js';
9
10
  import type { LlmStreamChunk, Result } from './types.js';
10
11
  /**
@@ -45,6 +46,11 @@ export interface SmartAgentHandle<T extends ISmartAgent = ISmartAgent> {
45
46
  circuitBreakers: CircuitBreaker[];
46
47
  /** RAG stores (for config hot-reload weight updates). */
47
48
  ragStores: SmartAgentRagStores;
49
+ /** The RAG registry composed by the builder (shared global, injected per-session). */
50
+ ragRegistry: IRagRegistry;
51
+ /** The connected upstream MCP clients (shared global, injected per-session
52
+ * via withMcpClients to skip re-connect + re-vectorize). Empty when no MCP. */
53
+ mcpClients: IMcpClient[];
48
54
  /** Model provider for discovery. Undefined when not available. */
49
55
  modelProvider?: IModelProvider;
50
56
  /** Look up a registered API adapter by name. */
@@ -1 +1 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/interfaces/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,kBA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ClC,OAAO,CAAC,EAAE,gBAAgB,GACzB,aAAa,CAAC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC,CAAC;CAC7D;AAMD,6DAA6D;AAC7D,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAM7E;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;IACnE,2DAA2D;IAC3D,KAAK,EAAE,CAAC,CAAC;IACT;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,iCAAiC;IACjC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC/B,mDAAmD;IACnD,aAAa,EAAE,cAAc,CAAC;IAC9B,0DAA0D;IAC1D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,oDAAoD;IACpD,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,yDAAyD;IACzD,SAAS,EAAE,mBAAmB,CAAC;IAC/B,sFAAsF;IACtF,WAAW,EAAE,YAAY,CAAC;IAC1B;oFACgF;IAChF,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,gDAAgD;IAChD,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IACxD,6CAA6C;IAC7C,eAAe,IAAI,MAAM,EAAE,CAAC;CAC7B"}
@@ -0,0 +1,17 @@
1
+ /** The hierarchical context unit: the current node/request + its ancestor intent
2
+ * path. NOT the whole chat, NOT just the last prompt. Travels into role inputs. */
3
+ export interface ContextPath {
4
+ /** Root/parent intent. */
5
+ objective?: string;
6
+ /** Intent-shaping dialogue along the path. */
7
+ clarifications: Array<{
8
+ question: string;
9
+ answer: string;
10
+ }>;
11
+ /** Reality facts gathered for THIS path via the oracle (needInfo round-trips). */
12
+ oracleObservations: Array<{
13
+ query: string;
14
+ answer: string;
15
+ }>;
16
+ }
17
+ //# sourceMappingURL=context-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-path.d.ts","sourceRoot":"","sources":["../../src/interfaces/context-path.ts"],"names":[],"mappings":"AAAA;oFACoF;AACpF,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,cAAc,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,kFAAkF;IAClF,kBAAkB,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=context-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-path.js","sourceRoot":"","sources":["../../src/interfaces/context-path.ts"],"names":[],"mappings":""}
@@ -7,21 +7,37 @@ export interface PlanStep {
7
7
  goal: string;
8
8
  agent?: string;
9
9
  inputTemplate?: string;
10
+ /**
11
+ * When true, the Coordinator embeds the client request (`ctx.inputText`)
12
+ * verbatim as delimited data inside the composed `task`. Default false —
13
+ * no material is forwarded unless the planner asks for it.
14
+ */
15
+ needsInput?: boolean;
10
16
  expectedTools?: string[];
11
17
  status: 'pending' | 'in_progress' | 'done' | 'failed';
12
18
  }
13
19
  export interface Plan {
14
20
  steps: PlanStep[];
21
+ /**
22
+ * Shared objective for the whole plan ("why"), authored once by the planner.
23
+ * Forwarded into every dispatched step's `task` so subagents act as a team.
24
+ */
25
+ objective?: string;
26
+ /**
27
+ * Set by the initial planner when it cannot form an unambiguous plan. When
28
+ * present, the Coordinator streams it to the consumer and dispatches nothing.
29
+ */
30
+ clarification?: string;
15
31
  rationale?: string;
16
32
  createdAt: number;
17
33
  source: 'planner-llm' | 'skill-steps' | 'manual';
18
34
  }
19
35
  /**
20
- * Trace frame for nested-dispatch failures. The parent appends its own
21
- * frame and passes the result upward without other transformation.
36
+ * Flat diagnostic trace for an epicfail failure. Captures a single frame:
37
+ * which step failed, which agent, the retry attempts, and the root error
38
+ * message. There is no nesting — each failure is represented independently.
22
39
  */
23
40
  export interface EpicFailTrace {
24
- layer: number;
25
41
  stepId: string;
26
42
  agentName: string;
27
43
  attempts: Array<{
@@ -30,7 +46,6 @@ export interface EpicFailTrace {
30
46
  durationMs: number;
31
47
  }>;
32
48
  originalError: string;
33
- childTrace?: EpicFailTrace;
34
49
  }
35
50
  export interface StepResult {
36
51
  stepId: string;
@@ -42,8 +57,8 @@ export interface StepResult {
42
57
  error?: string;
43
58
  /**
44
59
  * Populated when a child subagent returned `errorClass: 'epicfail'`.
45
- * Carries the diagnostic trace upward unchanged so consumers see the
46
- * full chain instead of a flattened error string.
60
+ * Carries a flat diagnostic trace (single frame) upward so consumers
61
+ * can inspect which step and agent failed.
47
62
  */
48
63
  epicFailTrace?: EpicFailTrace;
49
64
  }
@@ -63,12 +78,6 @@ export interface ICoordinatorContext {
63
78
  stepResults: Record<string, StepResult>;
64
79
  signal?: AbortSignal;
65
80
  sessionId: string;
66
- /**
67
- * Dispatch depth of the current coordinator. Root coordinator is 0; child
68
- * subagent coordinators increment per nested dispatch. Forward-declared for
69
- * Task 4 of the nested-subagent-dispatch foundation plan.
70
- */
71
- layer?: number;
72
81
  }
73
82
  export interface IPlanningStrategy {
74
83
  readonly name: string;
@@ -95,12 +104,6 @@ export interface ICoordinatorConfig {
95
104
  maxSteps?: number;
96
105
  maxRetriesPerStep?: number;
97
106
  failPolicy?: 'abort' | 'continue';
98
- /**
99
- * Maximum dispatch depth from this coordinator. Default 1: the
100
- * coordinator may dispatch children (layer 1), but those children
101
- * may not dispatch further unless they raise maxLayer themselves.
102
- */
103
- maxLayer?: number;
104
107
  }
105
108
  export type SubAgentWithDescription = ISubAgent & {
106
109
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../src/interfaces/coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,MAAM,GAAG,QAAQ,CAAC;CACvD;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,aAAa,GAAG,aAAa,GAAG,QAAQ,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;QACtC,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE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 +1,19 @@
1
+ export interface PlanNode {
2
+ id: string;
3
+ goal: string;
4
+ agent?: string;
5
+ dependsOn?: string[];
6
+ needsInput?: boolean;
7
+ }
8
+ /** Pure domain type: the DAG of work to execute. Runtime telemetry (e.g.
9
+ * per-role LLM usage) is intentionally NOT here — it would leak into
10
+ * downstream consumers (notably the reviewer prompt, which serializes the
11
+ * plan with JSON.stringify). LLM-backed planners return `{plan, usage}`
12
+ * from `IPlanner.plan`; see planner.ts. */
13
+ export interface DagPlan {
14
+ nodes: PlanNode[];
15
+ objective?: string;
16
+ rationale?: string;
17
+ createdAt: number;
18
+ }
19
+ //# sourceMappingURL=dag-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dag-plan.d.ts","sourceRoot":"","sources":["../../src/interfaces/dag-plan.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;4CAI4C;AAC5C,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dag-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dag-plan.js","sourceRoot":"","sources":["../../src/interfaces/dag-plan.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import type { DagPlan, PlanNode } from './dag-plan.js';
2
+ import type { PlannerCatalogEntry } from './planner.js';
3
+ export interface ErrorContext {
4
+ /** The composed task the failed node was given. */
5
+ task: string;
6
+ /** Replans/revises still allowed this run (the interpreter owns the counter). */
7
+ remainingReplans: number;
8
+ agents: PlannerCatalogEntry[];
9
+ sessionId: string;
10
+ signal?: AbortSignal;
11
+ }
12
+ export type ErrorReaction = {
13
+ action: 'abort';
14
+ } | {
15
+ action: 'replan';
16
+ subPlan: DagPlan;
17
+ };
18
+ export interface IErrorStrategy {
19
+ readonly name: string;
20
+ /** Per-run budget ceiling (replan AND revise consume it). Default 4. */
21
+ readonly maxReplans?: number;
22
+ onNodeFailure(node: PlanNode, error: unknown, ctx: ErrorContext): Promise<ErrorReaction>;
23
+ }
24
+ //# sourceMappingURL=error-strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-strategy.d.ts","sourceRoot":"","sources":["../../src/interfaces/error-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CACX,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,YAAY,GAChB,OAAO,CAAC,aAAa,CAAC,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=error-strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-strategy.js","sourceRoot":"","sources":["../../src/interfaces/error-strategy.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ import type { ContextPath } from './context-path.js';
2
+ import type { OnPartial } from './streaming.js';
3
+ import type { LlmUsage } from './types.js';
4
+ export interface FinalizerInput {
5
+ prompt: string;
6
+ objective: string;
7
+ ancestorContext?: ContextPath;
8
+ interpreterOutput: string;
9
+ executionTrace: ReadonlyArray<{
10
+ nodeId: string;
11
+ goal: string;
12
+ output: string;
13
+ }>;
14
+ sessionId?: string;
15
+ signal?: AbortSignal;
16
+ trace?: {
17
+ traceId: string;
18
+ };
19
+ /** Optional streaming sink for finalizer-produced content.
20
+ * LlmFinalizer streams synthesis deltas; Passthrough/Template
21
+ * emit one chunk equal to their full output. */
22
+ onPartial?: OnPartial;
23
+ }
24
+ export interface FinalizerResult {
25
+ output: string;
26
+ usage?: LlmUsage;
27
+ }
28
+ export interface IFinalizer {
29
+ readonly name: string;
30
+ readonly model?: string;
31
+ finalize(input: FinalizerInput): Promise<FinalizerResult>;
32
+ }
33
+ //# sourceMappingURL=finalizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finalizer.d.ts","sourceRoot":"","sources":["../../src/interfaces/finalizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,aAAa,CAAC;QAC5B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B;;qDAEiD;IACjD,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAC3D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=finalizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finalizer.js","sourceRoot":"","sources":["../../src/interfaces/finalizer.ts"],"names":[],"mappings":""}
@@ -3,10 +3,15 @@ export { type AgentCallOptions, type BaseAgentLlmBridge, OrchestratorError, type
3
3
  export type { HistoryEntry, IContextAssembler } from './assembler.js';
4
4
  export type { ISmartAgent, SmartAgentHandle, SmartAgentRagStores, } from './builder.js';
5
5
  export type { ISubpromptClassifier } from './classifier.js';
6
+ export type { ContextPath } from './context-path.js';
6
7
  export type { EpicFailTrace, IActivationStrategy, ICoordinatorConfig, ICoordinatorContext, IDispatchStrategy, IPlanningStrategy, Plan, PlanStep, StepResult, SubAgentWithDescription, } from './coordinator.js';
8
+ export type { DagPlan, PlanNode } from './dag-plan.js';
9
+ export type { ErrorContext, ErrorReaction, IErrorStrategy, } from './error-strategy.js';
10
+ export type { FinalizerInput, FinalizerResult, IFinalizer, } from './finalizer.js';
7
11
  export type { CircuitBreakerStatus, HealthComponentStatus, HealthStatus, } from './health.js';
8
12
  export type { IHistoryMemory } from './history-memory.js';
9
13
  export type { HistoryTurn, IHistorySummarizer, } from './history-summarizer.js';
14
+ export type { IInterpreter, InterpretContext, InterpretResult, NodeResult, } from './interpreter.js';
10
15
  export type { ILlm } from './llm.js';
11
16
  export type { ILlmCallStrategy } from './llm-call-strategy.js';
12
17
  export type { IMcpClient } from './mcp-client.js';
@@ -15,6 +20,7 @@ export type { CounterSnapshot, HistogramSnapshot, ICounter, IHistogram, IMetrics
15
20
  export type { IModelFilter, IModelInfo, IModelProvider, } from './model-provider.js';
16
21
  export type { IModelResolver } from './model-resolver.js';
17
22
  export type { BuiltInStageType, ControlFlowType, StageDefinition, StageType, } from './pipeline.js';
23
+ export type { IPlanner, PlannerCatalogEntry, PlannerInput, PlannerResult, } from './planner.js';
18
24
  export type { IPluginLoader, IRagStoreConfig, ISmartAgentPlugin, IStageHandler, LoadedPlugins, PluginExports, RagScope, } from './plugin.js';
19
25
  export type { IQueryEmbedding } from './query-embedding.js';
20
26
  export type { EmbedderFactory, EmbedderFactoryConfig, IEmbedder, IEmbedderBatch, IEmbedResult, IIdStrategy, IRag, IRagBackendWriter, IRagEditor, IRagProvider, IRagProviderRegistry, IRagRegistry, RagCollectionMeta, RagCollectionScope, } from './rag.js';
@@ -22,9 +28,13 @@ export { isBatchEmbedder } from './rag.js';
22
28
  export type { ILlmRateLimiter } from './rate-limiter.js';
23
29
  export type { IRequestLogger, LlmCallEntry, LlmComponent, RagQueryEntry, RequestSummary, TokenBucket, TokenCategory, ToolCallEntry, } from './request-logger.js';
24
30
  export type { IReranker } from './reranker.js';
31
+ export type { ExecutionFailureInput, ExecutionReviewDecision, ExecutionReviewResult, IReviewStrategy, ReviewInput, ReviewResult, ReviewVerdict, } from './review.js';
25
32
  export type { ISessionManager } from './session.js';
33
+ export type { SessionIdentity } from './session-identity.js';
26
34
  export type { ISkill, ISkillManager, ISkillMeta, ISkillResource, } from './skill.js';
27
- export type { ISubAgent, ISubAgentInput, ISubAgentResult, SubAgentCapabilities, SubAgentKind, SubAgentRegistry, } from './subagent.js';
35
+ export type { IStateOracle, StateOracleInput, StateOracleResult, } from './state-oracle.js';
36
+ export type { OnPartial, StreamChunk } from './streaming.js';
37
+ export type { ISubAgent, ISubAgentInput, ISubAgentResult, SubAgentCapabilities, SubAgentRegistry, } from './subagent.js';
28
38
  export type { ISubAgentContextBuilder, SubAgentContextRequest, SubAgentContextResult, } from './subagent-context.js';
29
39
  export type { IToolSelectionStrategy } from './tool-selection-strategy.js';
30
40
  export type { ISpan, ITracer, SpanOptions, SpanStatus } from './tracer.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,UAAU,GAChB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EACV,WAAW,EACX,kBAAkB,GACnB,MAAM,yBAAyB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AAM,eAAe,CAAC;AAC/C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC3E,YAAY,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,cAAc,EACd,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,aAAa,EACb,eAAe,EACf,WAAW,EACX,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,K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M,uBAAuB,CAAC;AAC7D,YAAY,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7D,YAAY,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC3E,YAAY,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,cAAc,EACd,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,aAAa,EACb,eAAe,EACf,WAAW,EACX,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,iBAAiB,GAGlB,MAAM,sBAAsB,CAAC;AAuF9B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA6D3C,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,iBAAiB,GAGlB,MAAM,sBAAsB,CAAC;AA+G9B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA4E3C,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,56 @@
1
+ import type { ContextPath } from './context-path.js';
2
+ import type { DagPlan } from './dag-plan.js';
3
+ import type { IErrorStrategy } from './error-strategy.js';
4
+ import type { OnPartial } from './streaming.js';
5
+ import type { ISubAgent } from './subagent.js';
6
+ export interface IInterpreter<TInput, TOutput> {
7
+ readonly name: string;
8
+ interpret(input: TInput, ctx: InterpretContext): Promise<TOutput>;
9
+ }
10
+ export interface InterpretContext {
11
+ inputText: string;
12
+ workers: ReadonlyMap<string, ISubAgent>;
13
+ sessionId: string;
14
+ signal?: AbortSignal;
15
+ /** Reaction to a node failure (abort | replan). Always populated by the
16
+ * caller; defaults to AbortErrorStrategy. */
17
+ errorStrategy: IErrorStrategy;
18
+ /** Hierarchical ancestor context (parent objective + clarification Q/A +
19
+ * oracle observations). Threaded into node task composition. */
20
+ ancestorContext?: ContextPath;
21
+ /** Request correlation, threaded into each worker dispatch. */
22
+ trace?: {
23
+ traceId: string;
24
+ };
25
+ /** Per-request session debugger logger, threaded into each worker dispatch
26
+ * so worker stages write to the parent's per-request session-log directory. */
27
+ sessionLogger?: {
28
+ logStep(name: string, data: unknown): void;
29
+ };
30
+ /** Forwarded into each `worker.run({ ..., onPartial })`; the
31
+ * interpreter annotates `nodeId` before calling and emits
32
+ * `node-start` / `node-end` itself. */
33
+ onPartial?: OnPartial;
34
+ }
35
+ export interface NodeResult {
36
+ nodeId: string;
37
+ output: string;
38
+ status: 'done' | 'failed' | 'skipped';
39
+ /** Populated by convention when `status === 'failed'` (the failure reason). */
40
+ error?: string;
41
+ durationMs: number;
42
+ }
43
+ export interface InterpretResult {
44
+ nodeResults: Record<string, NodeResult>;
45
+ ok: boolean;
46
+ error?: string;
47
+ output: string;
48
+ /** Set when ok === false: the node whose failure stopped the run (first
49
+ * plan-node-order node with status 'failed'). */
50
+ failedNodeId?: string;
51
+ /** The final plan after any in-run local splices. Populated on BOTH success and failure. */
52
+ executedPlan?: DagPlan;
53
+ /** Topological execution order of node ids in actual run order. */
54
+ executionOrder: readonly string[];
55
+ }
56
+ //# sourceMappingURL=interpreter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../../src/interfaces/interpreter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,WAAW,YAAY,CAAC,MAAM,EAAE,OAAO;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACnE;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;kDAC8C;IAC9C,aAAa,EAAE,cAAc,CAAC;IAC9B;qEACiE;IACjE,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,+DAA+D;IAC/D,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B;oFACgF;IAChF,aAAa,CAAC,EAAE;QACd,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;KAC5C,CAAC;IACF;;4CAEwC;IACxC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf;sDACkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4FAA4F;IAC5F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interpreter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpreter.js","sourceRoot":"","sources":["../../src/interfaces/interpreter.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ import type { ContextPath } from './context-path.js';
2
+ import type { DagPlan } from './dag-plan.js';
3
+ import type { LlmUsage } from './types.js';
4
+ export interface PlannerCatalogEntry {
5
+ name: string;
6
+ description?: string;
7
+ }
8
+ export interface PlannerInput {
9
+ prompt: string;
10
+ agents: PlannerCatalogEntry[];
11
+ sessionId: string;
12
+ signal?: AbortSignal;
13
+ ancestorContext?: ContextPath;
14
+ reviewerFeedback?: string;
15
+ }
16
+ /** Wrapper returned by `IPlanner.plan`. Splits the pure domain plan from the
17
+ * optional runtime telemetry, so the plan itself stays free of LLM-overhead
18
+ * metadata that would otherwise leak into prompts (the reviewer serializes
19
+ * `input.plan` via JSON.stringify into the critic prompt) or into
20
+ * persistence. Non-LLM planners may omit `usage`. */
21
+ export interface PlannerResult {
22
+ plan: DagPlan;
23
+ usage?: LlmUsage;
24
+ }
25
+ export interface IPlanner {
26
+ readonly name: string;
27
+ /** Optional model identifier (best-effort), surfaced to the coordinator so
28
+ * per-role LLM usage can be attributed to a specific model in the request
29
+ * logger. Non-LLM planners may omit it. */
30
+ readonly model?: string;
31
+ plan(input: PlannerInput): Promise<PlannerResult>;
32
+ }
33
+ //# sourceMappingURL=planner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/interfaces/planner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;sDAIsD;AACtD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;gDAE4C;IAC5C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACnD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=planner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.js","sourceRoot":"","sources":["../../src/interfaces/planner.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- export type LlmComponent = 'tool-loop' | 'classifier' | 'helper' | 'translate' | 'query-expander' | 'embedding';
1
+ export type LlmComponent = 'tool-loop' | 'classifier' | 'helper' | 'translate' | 'query-expander' | 'embedding' | 'planner' | 'reviewer' | 'finalizer' | 'oracle';
2
2
  export type TokenCategory = 'initialization' | 'auxiliary' | 'request';
3
3
  export interface TokenBucket {
4
4
  promptTokens: number;
@@ -17,6 +17,9 @@ export interface LlmCallEntry {
17
17
  estimated?: boolean;
18
18
  scope?: 'initialization' | 'request';
19
19
  detail?: string;
20
+ /** Request correlation id (the server's traceId). Routes the entry to the
21
+ * per-request delta; absent → session-cumulative only. */
22
+ requestId?: string;
20
23
  }
21
24
  export interface RagQueryEntry {
22
25
  store: string;
@@ -44,13 +47,21 @@ export interface RequestSummary {
44
47
  }
45
48
  export interface IRequestLogger {
46
49
  logLlmCall(entry: LlmCallEntry): void;
47
- logRagQuery(entry: RagQueryEntry): void;
48
- logToolCall(entry: ToolCallEntry): void;
49
- /** Mark the start of a request for wall-clock duration tracking. */
50
- startRequest(): void;
51
- /** Mark the end of a request for wall-clock duration tracking. */
52
- endRequest(): void;
53
- getSummary(): RequestSummary;
50
+ logRagQuery(entry: RagQueryEntry & {
51
+ requestId?: string;
52
+ }): void;
53
+ logToolCall(entry: ToolCallEntry & {
54
+ requestId?: string;
55
+ }): void;
56
+ /** Enter a request scope. Nested-safe: depth-counted, bucket created if absent,
57
+ * NEVER clears an existing bucket. */
58
+ startRequest(requestId?: string): void;
59
+ /** Leave a request scope. Depth-counted; NEVER deletes the bucket. */
60
+ endRequest(requestId?: string): void;
61
+ /** Explicitly free a request delta. The top-level owner (server) calls this
62
+ * AFTER reading getSummary(requestId) for the response usage. */
63
+ dropRequest(requestId?: string): void;
64
+ getSummary(requestId?: string): RequestSummary;
54
65
  reset(): void;
55
66
  }
56
67
  //# sourceMappingURL=request-logger.d.ts.map