@noetic-tools/core 0.1.0 → 0.1.1

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 (198) hide show
  1. package/README.md +31 -11
  2. package/dist/adapters/in-memory-fs-adapter.d.ts +1 -1
  3. package/dist/adapters/in-memory-fs-adapter.js +1 -1
  4. package/dist/adapters/in-memory-shell-adapter.d.ts +1 -1
  5. package/dist/adapters/in-memory-subprocess/manifest-persistence.d.ts +3 -3
  6. package/dist/adapters/in-memory-subprocess/manifest-persistence.js +1 -1
  7. package/dist/adapters/in-memory-subprocess/metadata.d.ts +1 -1
  8. package/dist/adapters/in-memory-subprocess/step-completion.d.ts +1 -1
  9. package/dist/adapters/in-memory-subprocess/step-completion.js +1 -1
  10. package/dist/adapters/in-memory-subprocess/types.d.ts +2 -2
  11. package/dist/adapters/in-memory-subprocess-adapter.d.ts +3 -3
  12. package/dist/adapters/in-memory-subprocess-adapter.js +3 -3
  13. package/dist/adapters/openrouter.d.ts +7 -7
  14. package/dist/adapters/openrouter.js +5 -5
  15. package/dist/builders/channel-builder.d.ts +1 -1
  16. package/dist/builders/control-flow-builders.d.ts +3 -3
  17. package/dist/builders/control-flow-builders.js +3 -3
  18. package/dist/builders/every.d.ts +3 -3
  19. package/dist/builders/every.js +2 -2
  20. package/dist/builders/layer-provides-builders.d.ts +1 -1
  21. package/dist/builders/layer-provides-builders.js +1 -1
  22. package/dist/builders/loop-builder.d.ts +2 -2
  23. package/dist/builders/loop-builder.js +2 -2
  24. package/dist/builders/memory-builder.d.ts +1 -1
  25. package/dist/builders/memory-builder.js +1 -1
  26. package/dist/builders/provide-builder.d.ts +2 -2
  27. package/dist/builders/provide-builder.js +2 -2
  28. package/dist/builders/spawn-builder.d.ts +3 -3
  29. package/dist/builders/spawn-builder.js +2 -2
  30. package/dist/builders/step-builders.d.ts +6 -6
  31. package/dist/builders/step-builders.js +2 -2
  32. package/dist/builders/tool-builder.d.ts +3 -3
  33. package/dist/builders/tool-builder.js +1 -1
  34. package/dist/builders/workflow-hydrator.d.ts +4 -4
  35. package/dist/builders/workflow-hydrator.js +10 -10
  36. package/dist/conditions/conditions.d.ts +4 -4
  37. package/dist/conditions/conditions.js +2 -2
  38. package/dist/errors/noetic-error.d.ts +1 -1
  39. package/dist/harness/agent-harness.d.ts +6 -6
  40. package/dist/harness/agent-harness.js +13 -13
  41. package/dist/harness/deps/adapters.d.ts +3 -3
  42. package/dist/harness/deps/adapters.js +3 -3
  43. package/dist/harness/deps/interpreter.d.ts +5 -5
  44. package/dist/harness/deps/interpreter.js +4 -4
  45. package/dist/harness/deps/memory.d.ts +5 -5
  46. package/dist/harness/deps/memory.js +4 -4
  47. package/dist/harness/deps/runtime.d.ts +10 -10
  48. package/dist/harness/deps/runtime.js +7 -7
  49. package/dist/harness/deps/types.d.ts +16 -16
  50. package/dist/harness/deps/types.js +1 -1
  51. package/dist/harness/model-call.d.ts +4 -4
  52. package/dist/harness/model-call.js +5 -5
  53. package/dist/harness/model-schema.d.ts +4 -4
  54. package/dist/harness/model-schema.js +1 -1
  55. package/dist/harness/step-bootstrap.js +2 -2
  56. package/dist/index.d.ts +96 -94
  57. package/dist/index.js +57 -55
  58. package/dist/internal-test.d.ts +4 -4
  59. package/dist/internal-test.js +4 -4
  60. package/dist/interpreter/action-deps.d.ts +12 -12
  61. package/dist/interpreter/action-deps.js +10 -10
  62. package/dist/interpreter/action-types.d.ts +8 -8
  63. package/dist/interpreter/action-types.js +1 -1
  64. package/dist/interpreter/collect-tools.d.ts +2 -2
  65. package/dist/interpreter/collect-tools.js +1 -1
  66. package/dist/interpreter/execute-action.d.ts +2 -2
  67. package/dist/interpreter/execute-action.js +10 -10
  68. package/dist/interpreter/execute-control.d.ts +2 -2
  69. package/dist/interpreter/execute-control.js +7 -7
  70. package/dist/interpreter/execute.d.ts +3 -3
  71. package/dist/interpreter/execute.js +8 -8
  72. package/dist/interpreter/message-helpers.d.ts +1 -1
  73. package/dist/interpreter/message-helpers.js +1 -1
  74. package/dist/interpreter/step-dispatcher.d.ts +5 -5
  75. package/dist/interpreter/step-dispatcher.js +2 -2
  76. package/dist/interpreter/typeguards.d.ts +7 -7
  77. package/dist/interpreter/typeguards.js +2 -2
  78. package/dist/memory/budget.d.ts +2 -2
  79. package/dist/memory/budget.js +1 -1
  80. package/dist/memory/exec-context-factory.d.ts +2 -2
  81. package/dist/memory/exec-context-factory.js +1 -1
  82. package/dist/memory/function-call-utils.d.ts +1 -1
  83. package/dist/memory/function-call-utils.js +1 -1
  84. package/dist/memory/layer-api.d.ts +4 -4
  85. package/dist/memory/layer-api.js +2 -2
  86. package/dist/memory/layer-lifecycle.d.ts +6 -6
  87. package/dist/memory/layer-lifecycle.js +6 -6
  88. package/dist/memory/layer-provides.d.ts +1 -1
  89. package/dist/memory/layer-usage.d.ts +4 -4
  90. package/dist/memory/layer-usage.js +1 -1
  91. package/dist/memory/layers/durable-task-state.d.ts +8 -8
  92. package/dist/memory/layers/durable-task-state.js +2 -2
  93. package/dist/memory/layers/file-reference.d.ts +1 -1
  94. package/dist/memory/layers/file-reference.js +2 -2
  95. package/dist/memory/layers/history-window.d.ts +1 -1
  96. package/dist/memory/layers/history-window.js +4 -4
  97. package/dist/memory/layers/observational-memory.d.ts +5 -5
  98. package/dist/memory/layers/observational-memory.js +2 -2
  99. package/dist/memory/layers/plan.d.ts +2 -2
  100. package/dist/memory/layers/plan.js +5 -5
  101. package/dist/memory/layers/static-content.d.ts +2 -2
  102. package/dist/memory/layers/static-content.js +1 -1
  103. package/dist/memory/layers/steering.d.ts +7 -7
  104. package/dist/memory/layers/steering.js +5 -5
  105. package/dist/memory/layers/tool-memory-layer.d.ts +2 -2
  106. package/dist/memory/layers/tool-memory-layer.js +1 -1
  107. package/dist/memory/layers/working-memory.d.ts +7 -7
  108. package/dist/memory/layers/working-memory.js +4 -4
  109. package/dist/memory/projector.d.ts +2 -2
  110. package/dist/memory/scope.d.ts +1 -1
  111. package/dist/memory/strip-unresolved.d.ts +1 -1
  112. package/dist/observability/span-impl.d.ts +1 -1
  113. package/dist/observability/trace-exporter.d.ts +2 -2
  114. package/dist/observability/trace-exporter.js +1 -1
  115. package/dist/patterns/dynamic-workflow.d.ts +5 -5
  116. package/dist/patterns/dynamic-workflow.js +5 -5
  117. package/dist/patterns/flow.d.ts +2 -2
  118. package/dist/patterns/flow.js +1 -1
  119. package/dist/patterns/interview.d.ts +2 -2
  120. package/dist/patterns/interview.js +5 -5
  121. package/dist/patterns/plans.d.ts +3 -3
  122. package/dist/patterns/plans.js +2 -2
  123. package/dist/patterns/ralph-wiggum.d.ts +4 -4
  124. package/dist/patterns/ralph-wiggum.js +5 -5
  125. package/dist/patterns/react.d.ts +3 -3
  126. package/dist/patterns/react.js +5 -5
  127. package/dist/portable/adapters.d.ts +3 -3
  128. package/dist/portable/adapters.js +3 -3
  129. package/dist/portable/ask-user.d.ts +2 -2
  130. package/dist/portable/ask-user.js +1 -1
  131. package/dist/portable/builders.d.ts +6 -6
  132. package/dist/portable/builders.js +6 -6
  133. package/dist/portable/memory-layers.d.ts +6 -6
  134. package/dist/portable/memory-layers.js +6 -6
  135. package/dist/portable/runtime.d.ts +2 -2
  136. package/dist/portable/runtime.js +2 -2
  137. package/dist/portable/until.d.ts +2 -2
  138. package/dist/portable/until.js +2 -2
  139. package/dist/portable.d.ts +7 -7
  140. package/dist/portable.js +7 -7
  141. package/dist/runtime/broadcaster-utils.d.ts +2 -2
  142. package/dist/runtime/channel-store.d.ts +1 -1
  143. package/dist/runtime/channel-store.js +2 -2
  144. package/dist/runtime/context-deps.d.ts +4 -4
  145. package/dist/runtime/context-deps.js +2 -2
  146. package/dist/runtime/context-impl.d.ts +1 -1
  147. package/dist/runtime/context-impl.js +2 -2
  148. package/dist/runtime/context-type-deps.d.ts +14 -14
  149. package/dist/runtime/cwd-helpers.d.ts +1 -1
  150. package/dist/runtime/detached-handle.d.ts +3 -3
  151. package/dist/runtime/detached-handle.js +3 -3
  152. package/dist/runtime/durable/checkpoint-store.d.ts +2 -2
  153. package/dist/runtime/durable/checkpoint-store.js +2 -2
  154. package/dist/runtime/durable/harness-checkpoints.d.ts +6 -6
  155. package/dist/runtime/durable/harness-checkpoints.js +2 -2
  156. package/dist/runtime/durable/index.d.ts +10 -10
  157. package/dist/runtime/durable/index.js +5 -5
  158. package/dist/runtime/durable/runnable-loop.d.ts +4 -4
  159. package/dist/runtime/durable/session-seed.d.ts +1 -1
  160. package/dist/runtime/durable/stall-nudge.d.ts +3 -3
  161. package/dist/runtime/event-broadcaster.d.ts +1 -1
  162. package/dist/runtime/in-memory-storage.d.ts +1 -1
  163. package/dist/runtime/in-memory-storage.js +1 -1
  164. package/dist/runtime/item-log-impl.d.ts +3 -3
  165. package/dist/runtime/item-log-impl.js +1 -1
  166. package/dist/runtime/message-queue.d.ts +2 -2
  167. package/dist/runtime/session-runner.d.ts +7 -7
  168. package/dist/runtime/session-runner.js +3 -3
  169. package/dist/runtime/session-streams.d.ts +3 -3
  170. package/dist/runtime/session-streams.js +1 -1
  171. package/dist/runtime/step-registry.d.ts +2 -2
  172. package/dist/runtime/step-registry.js +3 -3
  173. package/dist/runtime/tool-memory.d.ts +3 -3
  174. package/dist/schemas/item.d.ts +1 -1
  175. package/dist/types/common.d.ts +1 -1
  176. package/dist/types/context-parts/item-log.d.ts +1 -1
  177. package/dist/types/context-parts/layer-usage.d.ts +1 -1
  178. package/dist/types/context.d.ts +23 -23
  179. package/dist/types/harness-result.d.ts +2 -2
  180. package/dist/types/memory-context.d.ts +4 -4
  181. package/dist/types/memory.d.ts +6 -6
  182. package/dist/types/mutable-context.d.ts +3 -3
  183. package/dist/types/runtime.d.ts +14 -14
  184. package/dist/types/steering.d.ts +2 -2
  185. package/dist/types/step-registrar.d.ts +1 -1
  186. package/dist/types/step.d.ts +7 -7
  187. package/dist/types/tool-context.d.ts +6 -6
  188. package/dist/types/tool.d.ts +1 -1
  189. package/dist/unstable.d.ts +8 -8
  190. package/dist/unstable.js +6 -6
  191. package/dist/until/combinators.d.ts +1 -1
  192. package/dist/until/never.d.ts +1 -1
  193. package/dist/until/predicates.d.ts +4 -4
  194. package/dist/until/predicates.js +2 -2
  195. package/dist/util/message-helpers.d.ts +3 -3
  196. package/package.json +6 -4
  197. package/dist/conditions/index.d.ts +0 -3
  198. package/dist/conditions/index.js +0 -2
@@ -1,4 +1,4 @@
1
- import { estimateTokens } from '../util/message-helpers';
1
+ import { estimateTokens } from '../util/message-helpers.js';
2
2
  function canWriteLayerUsage(ctx) {
3
3
  const desc = Object.getOwnPropertyDescriptor(ctx, 'lastLayerUsage');
4
4
  if (desc === undefined) {
@@ -37,21 +37,21 @@ export declare function durableTaskState(_config?: DurableTaskStateConfig): {
37
37
  store: number;
38
38
  };
39
39
  hooks: {
40
- init({ storage }: import("../..").InitParams): Promise<{
40
+ init({ storage }: import("../../index.js").InitParams): Promise<{
41
41
  state: DurableTaskState;
42
42
  }>;
43
- recall({ state }: import("../..").RecallParams<DurableTaskState>): Promise<{
44
- items: import("../..").InputMessageItem[];
43
+ recall({ state }: import("../../index.js").RecallParams<DurableTaskState>): Promise<{
44
+ items: import("../../index.js").InputMessageItem[];
45
45
  tokenCount: number;
46
46
  } | null>;
47
- store({ state, ctx }: import("../..").StoreParams<DurableTaskState>): Promise<{
47
+ store({ state, ctx }: import("../../index.js").StoreParams<DurableTaskState>): Promise<{
48
48
  state: DurableTaskState;
49
49
  }>;
50
- onSpawn({ parentState }: import("../..").SpawnParams<DurableTaskState>): Promise<{
50
+ onSpawn({ parentState }: import("../../index.js").SpawnParams<DurableTaskState>): Promise<{
51
51
  childState: DurableTaskState;
52
52
  items: never[];
53
53
  }>;
54
- onReturn({ childState, parentState }: import("../..").ReturnParams<DurableTaskState>): Promise<{
54
+ onReturn({ childState, parentState }: import("../../index.js").ReturnParams<DurableTaskState>): Promise<{
55
55
  parentState: {
56
56
  checkpoints: {
57
57
  timestamp: number;
@@ -63,10 +63,10 @@ export declare function durableTaskState(_config?: DurableTaskStateConfig): {
63
63
  };
64
64
  };
65
65
  }>;
66
- onComplete({ state, outcome }: import("../..").CompleteParams<DurableTaskState>): Promise<{
66
+ onComplete({ state, outcome }: import("../../index.js").CompleteParams<DurableTaskState>): Promise<{
67
67
  state: {
68
68
  data: {
69
- __outcome: import("../..").ExecutionOutcome;
69
+ __outcome: import("../../index.js").ExecutionOutcome;
70
70
  };
71
71
  checkpoints: {
72
72
  timestamp: number;
@@ -1,5 +1,5 @@
1
- import { Slot } from '../../types/memory';
2
- import { createMessage, estimateTokens } from '../../util/message-helpers';
1
+ import { Slot } from '../../types/memory.js';
2
+ import { createMessage, estimateTokens } from '../../util/message-helpers.js';
3
3
  /**
4
4
  * Creates a memory layer that persists task checkpoints, files, and arbitrary data across iterations.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { MemoryLayer } from '../../types/memory';
1
+ import type { MemoryLayer } from '../../types/memory.js';
2
2
  interface TrackedFile {
3
3
  /** Absolute path to the file */
4
4
  absolutePath: string;
@@ -1,5 +1,5 @@
1
- import { Slot } from '../../types/memory';
2
- import { createMessage, estimateTokens } from '../../util/message-helpers';
1
+ import { Slot } from '../../types/memory.js';
2
+ import { createMessage, estimateTokens } from '../../util/message-helpers.js';
3
3
  /** Default max file size: 1MB */
4
4
  const DEFAULT_MAX_FILE_SIZE = 1024 * 1024;
5
5
  /** Default allowed extensions */
@@ -12,7 +12,7 @@
12
12
  * 3. Drop any orphan `function_call` / `function_call_output` left at the
13
13
  * slice boundary via `stripUnresolvedToolCalls`.
14
14
  */
15
- import type { MemoryLayer } from '../../types/memory';
15
+ import type { MemoryLayer } from '../../types/memory.js';
16
16
  /** @public Configuration for the {@link historyWindow} layer. */
17
17
  export interface HistoryWindowConfig {
18
18
  /** Cap on the number of trailing items projected to the LLM. Defaults to 40. */
@@ -12,10 +12,10 @@
12
12
  * 3. Drop any orphan `function_call` / `function_call_output` left at the
13
13
  * slice boundary via `stripUnresolvedToolCalls`.
14
14
  */
15
- import { NoeticConfigError } from '../../errors/noetic-config-error';
16
- import { Slot } from '../../types/memory';
17
- import { isAssistantMessage, isUserMessage } from '../../util/message-helpers';
18
- import { stripUnresolvedToolCalls } from '../strip-unresolved';
15
+ import { NoeticConfigError } from '../../errors/noetic-config-error.js';
16
+ import { Slot } from '../../types/memory.js';
17
+ import { isAssistantMessage, isUserMessage } from '../../util/message-helpers.js';
18
+ import { stripUnresolvedToolCalls } from '../strip-unresolved.js';
19
19
  //#region Constants
20
20
  const DEFAULT_MAX_ITEMS = 40;
21
21
  const MIN_MAX_ITEMS = 2;
@@ -31,14 +31,14 @@ export declare function observationalMemory(config?: ObservationalMemoryConfig):
31
31
  store: number;
32
32
  };
33
33
  hooks: {
34
- init({ storage }: import("../..").InitParams): Promise<{
34
+ init({ storage }: import("../../index.js").InitParams): Promise<{
35
35
  state: ObservationalState;
36
36
  }>;
37
- recall({ state }: import("../..").RecallParams<ObservationalState>): Promise<{
38
- items: import("../..").InputMessageItem[];
37
+ recall({ state }: import("../../index.js").RecallParams<ObservationalState>): Promise<{
38
+ items: import("../../index.js").InputMessageItem[];
39
39
  tokenCount: number;
40
40
  } | null>;
41
- store({ newItems, state }: import("../..").StoreParams<ObservationalState>): Promise<{
41
+ store({ newItems, state }: import("../../index.js").StoreParams<ObservationalState>): Promise<{
42
42
  state: {
43
43
  buffer: string[];
44
44
  bufferTokens: number;
@@ -46,7 +46,7 @@ export declare function observationalMemory(config?: ObservationalMemoryConfig):
46
46
  version: number;
47
47
  };
48
48
  }>;
49
- onSpawn({ parentState }: import("../..").SpawnParams<ObservationalState>): Promise<{
49
+ onSpawn({ parentState }: import("../../index.js").SpawnParams<ObservationalState>): Promise<{
50
50
  childState: ObservationalState;
51
51
  }>;
52
52
  };
@@ -1,5 +1,5 @@
1
- import { Slot } from '../../types/memory';
2
- import { createMessage, estimateTokens, isOutputText } from '../../util/message-helpers';
1
+ import { Slot } from '../../types/memory.js';
2
+ import { createMessage, estimateTokens, isOutputText } from '../../util/message-helpers.js';
3
3
  const DEFAULT_BUFFER_THRESHOLD_TOKENS = 2_000;
4
4
  const DEFAULT_MAX_OBSERVATIONS = 50;
5
5
  /**
@@ -1,5 +1,5 @@
1
- import type { MemoryLayer, MemoryScope } from '../../types/memory';
2
- import type { FlowNode } from '../flow-schema';
1
+ import type { MemoryLayer, MemoryScope } from '../../types/memory.js';
2
+ import type { FlowNode } from '../flow-schema.js';
3
3
  export declare const PlanPhase: {
4
4
  readonly Idle: "idle";
5
5
  readonly Planning: "planning";
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { Slot } from '../../types/memory';
3
- import { SteeringAction } from '../../types/steering';
4
- import { createMessage, estimateTokens } from '../../util/message-helpers';
5
- import { FlowSchema, flowDepth } from '../flow-schema';
6
- import { layerData, layerFn } from '../layer-provides';
2
+ import { Slot } from '../../types/memory.js';
3
+ import { SteeringAction } from '../../types/steering.js';
4
+ import { createMessage, estimateTokens } from '../../util/message-helpers.js';
5
+ import { FlowSchema, flowDepth } from '../flow-schema.js';
6
+ import { layerData, layerFn } from '../layer-provides.js';
7
7
  //#region Constants
8
8
  const MAX_PRD_LENGTH = 5e4;
9
9
  const MAX_TREE_DEPTH = 5;
@@ -1,4 +1,4 @@
1
- import type { MemoryScope } from '../../types/memory';
1
+ import type { MemoryScope } from '../../types/memory.js';
2
2
  interface StaticContentOpts {
3
3
  id?: string;
4
4
  slot?: number;
@@ -21,7 +21,7 @@ export declare function staticContent(opts: StaticContentOpts): {
21
21
  init(): Promise<{
22
22
  state: string;
23
23
  }>;
24
- recall({ state }: import("../..").RecallParams<string>): Promise<string | null>;
24
+ recall({ state }: import("../../index.js").RecallParams<string>): Promise<string | null>;
25
25
  };
26
26
  };
27
27
  export {};
@@ -1,4 +1,4 @@
1
- import { Slot } from '../../types/memory';
1
+ import { Slot } from '../../types/memory.js';
2
2
  /**
3
3
  * Creates a read-only memory layer that loads static content once at init and injects it into recall.
4
4
  *
@@ -1,5 +1,5 @@
1
- import type { MemoryScope } from '../../types/memory';
2
- import type { AfterModelCallParams, BeforeToolCallParams, LedgerEntry, SteeringConfig, SteeringDecision, SteeringState } from '../../types/steering';
1
+ import type { MemoryScope } from '../../types/memory.js';
2
+ import type { AfterModelCallParams, BeforeToolCallParams, LedgerEntry, SteeringConfig, SteeringDecision, SteeringState } from '../../types/steering.js';
3
3
  /**
4
4
  * Creates a steering memory layer that evaluates rules before tool calls and after model calls.
5
5
  *
@@ -21,11 +21,11 @@ export declare function steering(config: SteeringConfig): {
21
21
  afterModelCall: number;
22
22
  };
23
23
  hooks: {
24
- init({ storage }: import("../..").InitParams): Promise<{
24
+ init({ storage }: import("../../index.js").InitParams): Promise<{
25
25
  state: SteeringState;
26
26
  }>;
27
- recall({ state }: import("../..").RecallParams<SteeringState>): Promise<{
28
- items: import("../..").InputMessageItem[];
27
+ recall({ state }: import("../../index.js").RecallParams<SteeringState>): Promise<{
28
+ items: import("../../index.js").InputMessageItem[];
29
29
  tokenCount: number;
30
30
  state: SteeringState;
31
31
  } | null>;
@@ -38,13 +38,13 @@ export declare function steering(config: SteeringConfig): {
38
38
  decision: SteeringDecision;
39
39
  state: SteeringState;
40
40
  }>;
41
- onSpawn({ parentState }: import("../..").SpawnParams<SteeringState>): Promise<{
41
+ onSpawn({ parentState }: import("../../index.js").SpawnParams<SteeringState>): Promise<{
42
42
  childState: {
43
43
  ledger: LedgerEntry[];
44
44
  pendingAsync: never[];
45
45
  };
46
46
  }>;
47
- onComplete({ state, outcome }: import("../..").CompleteParams<SteeringState>): Promise<{
47
+ onComplete({ state, outcome }: import("../../index.js").CompleteParams<SteeringState>): Promise<{
48
48
  state: SteeringState;
49
49
  }>;
50
50
  };
@@ -1,8 +1,8 @@
1
- import { NoeticConfigError } from '../../errors/noetic-config-error';
2
- import { Slot } from '../../types/memory';
3
- import { LedgerEntryKind, SteeringAction } from '../../types/steering';
4
- import { createMessage, estimateTokens, extractAssistantText } from '../../util/message-helpers';
5
- import { mostRestrictive } from '../layer-lifecycle';
1
+ import { NoeticConfigError } from '../../errors/noetic-config-error.js';
2
+ import { Slot } from '../../types/memory.js';
3
+ import { LedgerEntryKind, SteeringAction } from '../../types/steering.js';
4
+ import { createMessage, estimateTokens, extractAssistantText } from '../../util/message-helpers.js';
5
+ import { mostRestrictive } from '../layer-lifecycle.js';
6
6
  //#region Constants
7
7
  const DEFAULT_MAX_LEDGER_ENTRIES = 100;
8
8
  //#endregion
@@ -1,5 +1,5 @@
1
- import type { MemoryLayer } from '../../types/memory';
2
- import type { Tool } from '../../types/tool';
1
+ import type { MemoryLayer } from '../../types/memory.js';
2
+ import type { Tool } from '../../types/tool.js';
3
3
  interface ToolMemoryLayerOpts {
4
4
  slot?: number;
5
5
  }
@@ -1,4 +1,4 @@
1
- import { Slot } from '../../types/memory';
1
+ import { Slot } from '../../types/memory.js';
2
2
  const EXECUTION_SCOPE = 'execution';
3
3
  /**
4
4
  * Generates one MemoryLayer per unique memory id among the provided tools.
@@ -23,21 +23,21 @@ export declare function workingMemory(config?: WorkingMemoryConfig): {
23
23
  max: number;
24
24
  };
25
25
  provides: {
26
- snapshot: import("../..").LayerDataDecl<WorkingMemoryState, WorkingMemoryState>;
27
- update: import("../..").LayerFunctionDecl<Record<string, unknown>, void, WorkingMemoryState>;
26
+ snapshot: import("../../index.js").LayerDataDecl<WorkingMemoryState, WorkingMemoryState>;
27
+ update: import("../../index.js").LayerFunctionDecl<Record<string, unknown>, void, WorkingMemoryState>;
28
28
  };
29
29
  hooks: {
30
- init({ storage }: import("../..").InitParams): Promise<{
30
+ init({ storage }: import("../../index.js").InitParams): Promise<{
31
31
  state: WorkingMemoryState;
32
32
  }>;
33
- recall({ state }: import("../..").RecallParams<WorkingMemoryState>): Promise<{
34
- items: import("../..").InputMessageItem[];
33
+ recall({ state }: import("../../index.js").RecallParams<WorkingMemoryState>): Promise<{
34
+ items: import("../../index.js").InputMessageItem[];
35
35
  tokenCount: number;
36
36
  } | null>;
37
- store({ newItems, state }: import("../..").StoreParams<WorkingMemoryState>): Promise<{
37
+ store({ newItems, state }: import("../../index.js").StoreParams<WorkingMemoryState>): Promise<{
38
38
  state: WorkingMemoryState;
39
39
  } | undefined>;
40
- onSpawn({ parentState }: import("../..").SpawnParams<WorkingMemoryState>): Promise<{
40
+ onSpawn({ parentState }: import("../../index.js").SpawnParams<WorkingMemoryState>): Promise<{
41
41
  childState: WorkingMemoryState;
42
42
  } | null>;
43
43
  };
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { Slot } from '../../types/memory';
3
- import { createMessage, estimateTokens } from '../../util/message-helpers';
4
- import { findFunctionCall } from '../function-call-utils';
5
- import { layerData, layerFn } from '../layer-provides';
2
+ import { Slot } from '../../types/memory.js';
3
+ import { createMessage, estimateTokens } from '../../util/message-helpers.js';
4
+ import { findFunctionCall } from '../function-call-utils.js';
5
+ import { layerData, layerFn } from '../layer-provides.js';
6
6
  function safeMerge(state, args) {
7
7
  const { __proto__: _p, constructor: _c, ...safeArgs } = args;
8
8
  if (typeof state === 'object' && state !== null) {
@@ -1,5 +1,5 @@
1
- import type { Item } from '../types/items';
2
- import type { ProjectionPolicy } from '../types/memory';
1
+ import type { Item } from '../types/items.js';
2
+ import type { ProjectionPolicy } from '../types/memory.js';
3
3
  interface AssembleViewParams {
4
4
  systemPromptItems: Item[];
5
5
  layerOutputItems: Item[];
@@ -1,3 +1,3 @@
1
- import type { ExecutionContext, MemoryScope, ScopedStorage, StorageAdapter } from '../types/memory';
1
+ import type { ExecutionContext, MemoryScope, ScopedStorage, StorageAdapter } from '../types/memory.js';
2
2
  export declare function resolveScopeKey(scope: MemoryScope, ctx: ExecutionContext): string;
3
3
  export declare function createScopedStorage(storage: StorageAdapter, layerId: string, scopeKey: string): ScopedStorage;
@@ -8,6 +8,6 @@
8
8
  * session-resume path to drop dangling pairs left by a crash, and by the
9
9
  * `historyWindow` memory layer to clean orphans at the slice boundary.
10
10
  */
11
- import type { Item } from '../types/items';
11
+ import type { Item } from '../types/items.js';
12
12
  /** @public */
13
13
  export declare function stripUnresolvedToolCalls(items: ReadonlyArray<Item>): Item[];
@@ -1,4 +1,4 @@
1
- import type { Span } from '../types/observability';
1
+ import type { Span } from '../types/observability.js';
2
2
  export declare class SpanImpl implements Span {
3
3
  readonly traceId: string;
4
4
  readonly spanId: string;
@@ -1,5 +1,5 @@
1
- import type { Span, TraceExporter } from '../types/observability';
2
- import { SpanImpl } from './span-impl';
1
+ import type { Span, TraceExporter } from '../types/observability.js';
2
+ import { SpanImpl } from './span-impl.js';
3
3
  /** @public No-op trace exporter that silently discards all spans. */
4
4
  export declare class NoopExporter implements TraceExporter {
5
5
  export(_spans: Span[]): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { SpanImpl } from './span-impl';
1
+ import { SpanImpl } from './span-impl.js';
2
2
  /** @public No-op trace exporter that silently discards all spans. */
3
3
  export class NoopExporter {
4
4
  async export(_spans) {
@@ -2,11 +2,11 @@
2
2
  * Pattern that lets an LLM generate a workflow as JSON during execution,
3
3
  * then hydrates and runs it within the same harness session.
4
4
  */
5
- import type { Context } from '../types/context';
6
- import type { ContextMemory } from '../types/memory';
7
- import type { AgentHarnessContract } from '../types/runtime';
8
- import type { Step } from '../types/step';
9
- import type { Tool } from '../types/tool';
5
+ import type { Context } from '../types/context.js';
6
+ import type { ContextMemory } from '../types/memory.js';
7
+ import type { AgentHarnessContract } from '../types/runtime.js';
8
+ import type { Step } from '../types/step.js';
9
+ import type { Tool } from '../types/tool.js';
10
10
  /** @public Options for creating a dynamic workflow step. */
11
11
  export interface DynamicWorkflowOpts {
12
12
  model?: string;
@@ -2,11 +2,11 @@
2
2
  * Pattern that lets an LLM generate a workflow as JSON during execution,
3
3
  * then hydrates and runs it within the same harness session.
4
4
  */
5
- import { step } from '../builders/step-builders';
6
- import { hydrateWorkflow } from '../builders/workflow-hydrator';
7
- import { NoeticConfigError } from '../errors/noetic-config-error';
8
- import { WorkflowDocumentSchema, workflowDepth } from '../schemas/workflow';
9
- import { frameworkCast } from '../util/framework-cast';
5
+ import { step } from '../builders/step-builders.js';
6
+ import { hydrateWorkflow } from '../builders/workflow-hydrator.js';
7
+ import { NoeticConfigError } from '../errors/noetic-config-error.js';
8
+ import { WorkflowDocumentSchema, workflowDepth } from '../schemas/workflow.js';
9
+ import { frameworkCast } from '../util/framework-cast.js';
10
10
  //#endregion
11
11
  //#region Constants
12
12
  const DEFAULT_MAX_DEPTH = 5;
@@ -1,2 +1,2 @@
1
- export type { FlowNode, ForkFlowNode, LlmFlowNode, SequenceFlowNode, SpawnFlowNode, SubagentFlowNode, } from '../memory/flow-schema';
2
- export { FlowSchema, flowDepth, validateFlow, walkFlow } from '../memory/flow-schema';
1
+ export type { FlowNode, ForkFlowNode, LlmFlowNode, SequenceFlowNode, SpawnFlowNode, SubagentFlowNode, } from '../memory/flow-schema.js';
2
+ export { FlowSchema, flowDepth, validateFlow, walkFlow } from '../memory/flow-schema.js';
@@ -1 +1 @@
1
- export { FlowSchema, flowDepth, validateFlow, walkFlow } from '../memory/flow-schema';
1
+ export { FlowSchema, flowDepth, validateFlow, walkFlow } from '../memory/flow-schema.js';
@@ -1,6 +1,6 @@
1
1
  import type { ZodType } from 'zod';
2
- import type { ContextMemory } from '../types/memory';
3
- import type { Step } from '../types/step';
2
+ import type { ContextMemory } from '../types/memory.js';
3
+ import type { Step } from '../types/step.js';
4
4
  /** @public Answer captured by the host for a single interview question. */
5
5
  export interface InterviewQuestionAnswer {
6
6
  questionId: string;
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { loop } from '../builders/loop-builder';
3
- import { step } from '../builders/step-builders';
4
- import { any } from '../until/combinators';
5
- import { until } from '../until/predicates';
6
- import { frameworkCast } from '../util/framework-cast';
2
+ import { loop } from '../builders/loop-builder.js';
3
+ import { step } from '../builders/step-builders.js';
4
+ import { any } from '../until/combinators.js';
5
+ import { until } from '../until/predicates.js';
6
+ import { frameworkCast } from '../util/framework-cast.js';
7
7
  //#endregion
8
8
  //#region Helpers
9
9
  const DEFAULT_MAX_QUESTIONS = 8;
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import type { Context } from '../types/context';
3
- import type { ContextMemory } from '../types/memory';
4
- import type { ExecuteStepFn, Step } from '../types/step';
2
+ import type { Context } from '../types/context.js';
3
+ import type { ContextMemory } from '../types/memory.js';
4
+ import type { ExecuteStepFn, Step } from '../types/step.js';
5
5
  export interface PlanNode {
6
6
  id: string;
7
7
  description: string;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { fork } from '../builders/control-flow-builders';
3
- import { frameworkCast } from '../util/framework-cast';
2
+ import { fork } from '../builders/control-flow-builders.js';
3
+ import { frameworkCast } from '../util/framework-cast.js';
4
4
  // PlanNode schema — the variable annotation provides the recursive type;
5
5
  // z.lazy() returns a compatible type that TypeScript checks against it.
6
6
  /** @public Zod schema for recursive `PlanNode` validation. */
@@ -1,7 +1,7 @@
1
- import type { ContextMemory } from '../types/memory';
2
- import type { StepLoop } from '../types/step';
3
- import type { Tool } from '../types/tool';
4
- import type { VerifyFn } from '../until/predicates';
1
+ import type { ContextMemory } from '../types/memory.js';
2
+ import type { StepLoop } from '../types/step.js';
3
+ import type { Tool } from '../types/tool.js';
4
+ import type { VerifyFn } from '../until/predicates.js';
5
5
  /**
6
6
  * Creates a retry-with-feedback loop wrapping a ReAct agent. Each iteration spawns an inner agent
7
7
  * and retries with verification feedback until the verifier passes or max iterations is reached.
@@ -1,8 +1,8 @@
1
- import { loop } from '../builders/loop-builder';
2
- import { spawn } from '../builders/spawn-builder';
3
- import { any } from '../until/combinators';
4
- import { until } from '../until/predicates';
5
- import { react } from './react';
1
+ import { loop } from '../builders/loop-builder.js';
2
+ import { spawn } from '../builders/spawn-builder.js';
3
+ import { any } from '../until/combinators.js';
4
+ import { until } from '../until/predicates.js';
5
+ import { react } from './react.js';
6
6
  /**
7
7
  * Creates a retry-with-feedback loop wrapping a ReAct agent. Each iteration spawns an inner agent
8
8
  * and retries with verification feedback until the verifier passes or max iterations is reached.
@@ -1,6 +1,6 @@
1
- import type { ContextMemory, MemoryConfig, MemoryLayer } from '../types/memory';
2
- import type { StepLoop, StepSpawn } from '../types/step';
3
- import type { Tool } from '../types/tool';
1
+ import type { ContextMemory, MemoryConfig, MemoryLayer } from '../types/memory.js';
2
+ import type { StepLoop, StepSpawn } from '../types/step.js';
3
+ import type { Tool } from '../types/tool.js';
4
4
  /**
5
5
  * Creates a ReAct (Reason + Act) agent loop: an LLM step with tools iterated until no tool calls or limits are hit.
6
6
  *
@@ -1,8 +1,8 @@
1
- import { loop } from '../builders/loop-builder';
2
- import { spawn } from '../builders/spawn-builder';
3
- import { step } from '../builders/step-builders';
4
- import { any } from '../until/combinators';
5
- import { until } from '../until/predicates';
1
+ import { loop } from '../builders/loop-builder.js';
2
+ import { spawn } from '../builders/spawn-builder.js';
3
+ import { step } from '../builders/step-builders.js';
4
+ import { any } from '../until/combinators.js';
5
+ import { until } from '../until/predicates.js';
6
6
  /**
7
7
  * Creates a ReAct (Reason + Act) agent loop: an LLM step with tools iterated until no tool calls or limits are hit.
8
8
  *
@@ -1,6 +1,6 @@
1
1
  /** @public */
2
- export { createInMemoryFsAdapter } from '../adapters/in-memory-fs-adapter';
2
+ export { createInMemoryFsAdapter } from '../adapters/in-memory-fs-adapter.js';
3
3
  /** @public */
4
- export { createInMemoryShellAdapter } from '../adapters/in-memory-shell-adapter';
4
+ export { createInMemoryShellAdapter } from '../adapters/in-memory-shell-adapter.js';
5
5
  /** @public */
6
- export { createInMemorySubprocessAdapter } from '../adapters/in-memory-subprocess-adapter';
6
+ export { createInMemorySubprocessAdapter } from '../adapters/in-memory-subprocess-adapter.js';
@@ -1,6 +1,6 @@
1
1
  /** @public */
2
- export { createInMemoryFsAdapter } from '../adapters/in-memory-fs-adapter';
2
+ export { createInMemoryFsAdapter } from '../adapters/in-memory-fs-adapter.js';
3
3
  /** @public */
4
- export { createInMemoryShellAdapter } from '../adapters/in-memory-shell-adapter';
4
+ export { createInMemoryShellAdapter } from '../adapters/in-memory-shell-adapter.js';
5
5
  /** @public */
6
- export { createInMemorySubprocessAdapter } from '../adapters/in-memory-subprocess-adapter';
6
+ export { createInMemorySubprocessAdapter } from '../adapters/in-memory-subprocess-adapter.js';
@@ -1,4 +1,4 @@
1
1
  /** @public */
2
- export type { AskUserAnnotation, AskUserInput, AskUserOption, AskUserOutput, AskUserQuestion, } from '../types/ask-user-types';
2
+ export type { AskUserAnnotation, AskUserInput, AskUserOption, AskUserOutput, AskUserQuestion, } from '../types/ask-user-types.js';
3
3
  /** @public */
4
- export { AskUserAnnotationSchema, AskUserInputSchema, AskUserOptionSchema, AskUserOutputSchema, AskUserQuestionSchema, } from '../types/ask-user-types';
4
+ export { AskUserAnnotationSchema, AskUserInputSchema, AskUserOptionSchema, AskUserOutputSchema, AskUserQuestionSchema, } from '../types/ask-user-types.js';
@@ -1,2 +1,2 @@
1
1
  /** @public */
2
- export { AskUserAnnotationSchema, AskUserInputSchema, AskUserOptionSchema, AskUserOutputSchema, AskUserQuestionSchema, } from '../types/ask-user-types';
2
+ export { AskUserAnnotationSchema, AskUserInputSchema, AskUserOptionSchema, AskUserOutputSchema, AskUserQuestionSchema, } from '../types/ask-user-types.js';
@@ -1,12 +1,12 @@
1
1
  /** @public */
2
- export { branch, fork } from '../builders/control-flow-builders';
2
+ export { branch, fork } from '../builders/control-flow-builders.js';
3
3
  /** @public */
4
- export { layerData, layerFn } from '../builders/layer-provides-builders';
4
+ export { layerData, layerFn } from '../builders/layer-provides-builders.js';
5
5
  /** @public */
6
- export { loop } from '../builders/loop-builder';
6
+ export { loop } from '../builders/loop-builder.js';
7
7
  /** @public */
8
- export { spawn } from '../builders/spawn-builder';
8
+ export { spawn } from '../builders/spawn-builder.js';
9
9
  /** @public */
10
- export { step } from '../builders/step-builders';
10
+ export { step } from '../builders/step-builders.js';
11
11
  /** @public */
12
- export { tool, toolWithGenerator } from '../builders/tool-builder';
12
+ export { tool, toolWithGenerator } from '../builders/tool-builder.js';
@@ -1,12 +1,12 @@
1
1
  /** @public */
2
- export { branch, fork } from '../builders/control-flow-builders';
2
+ export { branch, fork } from '../builders/control-flow-builders.js';
3
3
  /** @public */
4
- export { layerData, layerFn } from '../builders/layer-provides-builders';
4
+ export { layerData, layerFn } from '../builders/layer-provides-builders.js';
5
5
  /** @public */
6
- export { loop } from '../builders/loop-builder';
6
+ export { loop } from '../builders/loop-builder.js';
7
7
  /** @public */
8
- export { spawn } from '../builders/spawn-builder';
8
+ export { spawn } from '../builders/spawn-builder.js';
9
9
  /** @public */
10
- export { step } from '../builders/step-builders';
10
+ export { step } from '../builders/step-builders.js';
11
11
  /** @public */
12
- export { tool, toolWithGenerator } from '../builders/tool-builder';
12
+ export { tool, toolWithGenerator } from '../builders/tool-builder.js';
@@ -1,12 +1,12 @@
1
1
  /** @public */
2
- export { durableTaskState } from '../memory/layers/durable-task-state';
2
+ export { durableTaskState } from '../memory/layers/durable-task-state.js';
3
3
  /** @public */
4
- export { historyWindow } from '../memory/layers/history-window';
4
+ export { historyWindow } from '../memory/layers/history-window.js';
5
5
  /** @public */
6
- export { observationalMemory } from '../memory/layers/observational-memory';
6
+ export { observationalMemory } from '../memory/layers/observational-memory.js';
7
7
  /** @public */
8
- export { planMemory } from '../memory/layers/plan';
8
+ export { planMemory } from '../memory/layers/plan.js';
9
9
  /** @public */
10
- export { toolMemoryLayer } from '../memory/layers/tool-memory-layer';
10
+ export { toolMemoryLayer } from '../memory/layers/tool-memory-layer.js';
11
11
  /** @public */
12
- export { workingMemory } from '../memory/layers/working-memory';
12
+ export { workingMemory } from '../memory/layers/working-memory.js';