@noetic-tools/core 0.1.0 → 0.1.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 (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,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';
@@ -1,4 +1,4 @@
1
1
  /** @public */
2
- export { AgentHarness } from '../harness/agent-harness';
2
+ export { AgentHarness } from '../harness/agent-harness.js';
3
3
  /** @public */
4
- export { createInMemoryStorage } from '../runtime/in-memory-storage';
4
+ export { createInMemoryStorage } from '../runtime/in-memory-storage.js';
@@ -1,4 +1,4 @@
1
1
  /** @public */
2
- export { AgentHarness } from '../harness/agent-harness';
2
+ export { AgentHarness } from '../harness/agent-harness.js';
3
3
  /** @public */
4
- export { createInMemoryStorage } from '../runtime/in-memory-storage';
4
+ export { createInMemoryStorage } from '../runtime/in-memory-storage.js';
@@ -1,4 +1,4 @@
1
1
  /** @public */
2
- export { all, any } from '../until/combinators';
2
+ export { all, any } from '../until/combinators.js';
3
3
  /** @public */
4
- export { until } from '../until/predicates';
4
+ export { until } from '../until/predicates.js';
@@ -1,4 +1,4 @@
1
1
  /** @public */
2
- export { all, any } from '../until/combinators';
2
+ export { all, any } from '../until/combinators.js';
3
3
  /** @public */
4
- export { until } from '../until/predicates';
4
+ export { until } from '../until/predicates.js';
@@ -1,8 +1,8 @@
1
- export * from './portable/adapters';
2
- export * from './portable/ask-user';
3
- export * from './portable/builders';
4
- export * from './portable/memory-layers';
5
- export * from './portable/runtime';
6
- export * from './portable/until';
1
+ export * from './portable/adapters.js';
2
+ export * from './portable/ask-user.js';
3
+ export * from './portable/builders.js';
4
+ export * from './portable/memory-layers.js';
5
+ export * from './portable/runtime.js';
6
+ export * from './portable/until.js';
7
7
  /** @public */
8
- export { Slot } from './types/memory';
8
+ export { Slot } from './types/memory.js';
package/dist/portable.js CHANGED
@@ -1,8 +1,8 @@
1
- export * from './portable/adapters';
2
- export * from './portable/ask-user';
3
- export * from './portable/builders';
4
- export * from './portable/memory-layers';
5
- export * from './portable/runtime';
6
- export * from './portable/until';
1
+ export * from './portable/adapters.js';
2
+ export * from './portable/ask-user.js';
3
+ export * from './portable/builders.js';
4
+ export * from './portable/memory-layers.js';
5
+ export * from './portable/runtime.js';
6
+ export * from './portable/until.js';
7
7
  /** @public */
8
- export { Slot } from './types/memory';
8
+ export { Slot } from './types/memory.js';
@@ -1,5 +1,5 @@
1
- import type { Context } from '../types/context';
2
- import type { EventBroadcaster } from './event-broadcaster';
1
+ import type { Context } from '../types/context.js';
2
+ import type { EventBroadcaster } from './event-broadcaster.js';
3
3
  /** @internal Option controlling framework event emission on a step or callModel request. */
4
4
  export type EmitOption = boolean | ((eventType: string, data: Record<string, unknown>) => boolean);
5
5
  /**
@@ -1,4 +1,4 @@
1
- import type { Channel, ChannelHandle, ExternalChannel } from '../types/channel';
1
+ import type { Channel, ChannelHandle, ExternalChannel } from '../types/channel.js';
2
2
  export declare class ChannelStore {
3
3
  private channels;
4
4
  private closedExecutions;
@@ -1,5 +1,5 @@
1
- import { NoeticErrorImpl } from '../errors/noetic-error';
2
- import { frameworkCast } from '../util/framework-cast';
1
+ import { NoeticErrorImpl } from '../errors/noetic-error.js';
2
+ import { frameworkCast } from '../util/framework-cast.js';
3
3
  function isExternalChannel(ch) {
4
4
  return 'external' in ch && ch.external === true;
5
5
  }
@@ -1,4 +1,4 @@
1
- export { buildContextMemory } from '../memory/layer-api';
2
- export type { ItemSchemaRegistry } from '../schemas/item';
3
- export { defaultItemSchemaRegistry } from '../schemas/item';
4
- export type { AgentHarnessContract, Channel, ChannelStore, Context, ContextMemory, CwdState, EventBroadcaster, FrontierFrame, FsAdapter, Item, ItemLog, LastLayerUsage, MemoryLayer, Span, StepMeta, TokenUsage, Tool, } from './context-type-deps';
1
+ export { buildContextMemory } from '../memory/layer-api.js';
2
+ export type { ItemSchemaRegistry } from '../schemas/item.js';
3
+ export { defaultItemSchemaRegistry } from '../schemas/item.js';
4
+ export type { AgentHarnessContract, Channel, ChannelStore, Context, ContextMemory, CwdState, EventBroadcaster, FrontierFrame, FsAdapter, Item, ItemLog, LastLayerUsage, MemoryLayer, Span, StepMeta, TokenUsage, Tool, } from './context-type-deps.js';
@@ -1,2 +1,2 @@
1
- export { buildContextMemory } from '../memory/layer-api';
2
- export { defaultItemSchemaRegistry } from '../schemas/item';
1
+ export { buildContextMemory } from '../memory/layer-api.js';
2
+ export { defaultItemSchemaRegistry } from '../schemas/item.js';
@@ -1,4 +1,4 @@
1
- import type { AgentHarnessContract, Channel, ChannelStore, Context, ContextMemory, CwdState, EventBroadcaster, FrontierFrame, FsAdapter, Item, ItemLog, ItemSchemaRegistry, LastLayerUsage, MemoryLayer, Span, StepMeta, TokenUsage, Tool } from './context-deps';
1
+ import type { AgentHarnessContract, Channel, ChannelStore, Context, ContextMemory, CwdState, EventBroadcaster, FrontierFrame, FsAdapter, Item, ItemLog, ItemSchemaRegistry, LastLayerUsage, MemoryLayer, Span, StepMeta, TokenUsage, Tool } from './context-deps.js';
2
2
  export declare class ContextImpl implements Context<ContextMemory> {
3
3
  readonly id: string;
4
4
  stepCount: number;
@@ -1,5 +1,5 @@
1
- import { buildContextMemory, defaultItemSchemaRegistry } from './context-deps';
2
- import { ItemLogImpl } from './item-log-impl';
1
+ import { buildContextMemory, defaultItemSchemaRegistry } from './context-deps.js';
2
+ import { ItemLogImpl } from './item-log-impl.js';
3
3
  const EMPTY_MEMORY = Object.freeze({});
4
4
  class NoopSpan {
5
5
  traceId = crypto.randomUUID();
@@ -1,14 +1,14 @@
1
- export type { Channel } from '../types/channel';
2
- export type { FrontierFrame } from '../types/checkpoint';
3
- export type { StepMeta, TokenUsage } from '../types/common';
4
- export type { Context, CwdState } from '../types/context';
5
- export type { ItemLog } from '../types/context-parts/item-log';
6
- export type { LastLayerUsage } from '../types/context-parts/layer-usage';
7
- export type { FsAdapter } from '../types/fs-adapter';
8
- export type { Item } from '../types/items';
9
- export type { ContextMemory, MemoryLayer } from '../types/memory';
10
- export type { Span } from '../types/observability';
11
- export type { AgentHarnessContract } from '../types/runtime';
12
- export type { Tool } from '../types/tool';
13
- export type { ChannelStore } from './channel-store';
14
- export type { EventBroadcaster } from './event-broadcaster';
1
+ export type { Channel } from '../types/channel.js';
2
+ export type { FrontierFrame } from '../types/checkpoint.js';
3
+ export type { StepMeta, TokenUsage } from '../types/common.js';
4
+ export type { Context, CwdState } from '../types/context.js';
5
+ export type { ItemLog } from '../types/context-parts/item-log.js';
6
+ export type { LastLayerUsage } from '../types/context-parts/layer-usage.js';
7
+ export type { FsAdapter } from '../types/fs-adapter.js';
8
+ export type { Item } from '../types/items.js';
9
+ export type { ContextMemory, MemoryLayer } from '../types/memory.js';
10
+ export type { Span } from '../types/observability.js';
11
+ export type { AgentHarnessContract } from '../types/runtime.js';
12
+ export type { Tool } from '../types/tool.js';
13
+ export type { ChannelStore } from './channel-store.js';
14
+ export type { EventBroadcaster } from './event-broadcaster.js';
@@ -1,4 +1,4 @@
1
- import type { Context, CwdState } from '../types/context';
1
+ import type { Context, CwdState } from '../types/context.js';
2
2
  /**
3
3
  * @public Resolve the live cwd for a tool execution. Falls back to the
4
4
  * tool's factory-time cwd (then `process.cwd()`) so partial test contexts
@@ -1,6 +1,6 @@
1
- import type { DetachedHandle } from '../types/detached';
2
- import { DetachedStatus } from '../types/detached';
3
- import type { SubprocessAdapter, SubprocessHandle } from '../types/subprocess-adapter';
1
+ import type { DetachedHandle } from '../types/detached.js';
2
+ import { DetachedStatus } from '../types/detached.js';
3
+ import type { SubprocessAdapter, SubprocessHandle } from '../types/subprocess-adapter.js';
4
4
  interface DetachedHandleOpts {
5
5
  /** Id surfaced to callers — usually the execution id (childCtx.id in
6
6
  * `detachedSpawn`) so consumers can correlate it with their own state. */
@@ -1,6 +1,6 @@
1
- import { NoeticErrorImpl } from '../errors/noetic-error';
2
- import { DetachedStatus } from '../types/detached';
3
- import { frameworkCast } from '../util/framework-cast';
1
+ import { NoeticErrorImpl } from '../errors/noetic-error.js';
2
+ import { DetachedStatus } from '../types/detached.js';
3
+ import { frameworkCast } from '../util/framework-cast.js';
4
4
  //#endregion
5
5
  //#region Helpers
6
6
  const INITIAL_POLL_MS = 10;
@@ -1,5 +1,5 @@
1
- import type { CheckpointSnapshot } from '../../types/checkpoint';
2
- import type { StorageAdapter } from '../../types/memory';
1
+ import type { CheckpointSnapshot } from '../../types/checkpoint.js';
2
+ import type { StorageAdapter } from '../../types/memory.js';
3
3
  export declare const CheckpointKeys: {
4
4
  readonly ExecPrefix: "execution:";
5
5
  readonly SnapshotSuffix: ":snapshot";
@@ -1,5 +1,5 @@
1
- import { NoeticConfigError } from '../../errors/noetic-config-error';
2
- import { CheckpointSnapshotSchema } from '../../types/checkpoint';
1
+ import { NoeticConfigError } from '../../errors/noetic-config-error.js';
2
+ import { CheckpointSnapshotSchema } from '../../types/checkpoint.js';
3
3
  //#region Keys
4
4
  /**
5
5
  * Typed key constants for the checkpoint namespace. Every execution snapshot
@@ -1,9 +1,9 @@
1
- import type { LayerStateStore } from '../../memory/layer-lifecycle';
2
- import type { ItemSchemaRegistry } from '../../schemas/item';
3
- import type { Context } from '../../types/context';
4
- import type { Item } from '../../types/items';
5
- import type { MemoryLayer } from '../../types/memory';
6
- import type { CheckpointStore } from './checkpoint-store';
1
+ import type { LayerStateStore } from '../../memory/layer-lifecycle.js';
2
+ import type { ItemSchemaRegistry } from '../../schemas/item.js';
3
+ import type { Context } from '../../types/context.js';
4
+ import type { Item } from '../../types/items.js';
5
+ import type { MemoryLayer } from '../../types/memory.js';
6
+ import type { CheckpointStore } from './checkpoint-store.js';
7
7
  /**
8
8
  * Minimum harness surface `captureCheckpoint` / `restoreFromCheckpoint`
9
9
  * require. `AgentHarness` already satisfies this shape via its
@@ -1,5 +1,5 @@
1
- import { CheckpointSchemaVersion } from '../../types/checkpoint';
2
- import { ContextImpl } from '../context-impl';
1
+ import { CheckpointSchemaVersion } from '../../types/checkpoint.js';
2
+ import { ContextImpl } from '../context-impl.js';
3
3
  //#endregion
4
4
  //#region captureCheckpoint
5
5
  /**
@@ -1,10 +1,10 @@
1
- export type { CheckpointStore, CreateCheckpointStoreOptions } from './checkpoint-store';
2
- export { CheckpointKeys, createCheckpointStore } from './checkpoint-store';
3
- export type { DetachedSignal } from './detached-signal';
4
- export { createDetachedSignal } from './detached-signal';
5
- export type { AfterFirstTurnContext, RunnableLoopHarness, RunnableLoopOpts } from './runnable-loop';
6
- export { runnableLoop } from './runnable-loop';
7
- export type { SessionSeedHarness } from './session-seed';
8
- export { seedFromItems } from './session-seed';
9
- export type { CreateNudgeMessageOpts, StallNudgeOpts } from './stall-nudge';
10
- export { createNudgeMessage, createStallNudgeHook, DEFAULT_NUDGE_MESSAGE_TEXT, } from './stall-nudge';
1
+ export type { CheckpointStore, CreateCheckpointStoreOptions } from './checkpoint-store.js';
2
+ export { CheckpointKeys, createCheckpointStore } from './checkpoint-store.js';
3
+ export type { DetachedSignal } from './detached-signal.js';
4
+ export { createDetachedSignal } from './detached-signal.js';
5
+ export type { AfterFirstTurnContext, RunnableLoopHarness, RunnableLoopOpts } from './runnable-loop.js';
6
+ export { runnableLoop } from './runnable-loop.js';
7
+ export type { SessionSeedHarness } from './session-seed.js';
8
+ export { seedFromItems } from './session-seed.js';
9
+ export type { CreateNudgeMessageOpts, StallNudgeOpts } from './stall-nudge.js';
10
+ export { createNudgeMessage, createStallNudgeHook, DEFAULT_NUDGE_MESSAGE_TEXT, } from './stall-nudge.js';
@@ -1,5 +1,5 @@
1
- export { CheckpointKeys, createCheckpointStore } from './checkpoint-store';
2
- export { createDetachedSignal } from './detached-signal';
3
- export { runnableLoop } from './runnable-loop';
4
- export { seedFromItems } from './session-seed';
5
- export { createNudgeMessage, createStallNudgeHook, DEFAULT_NUDGE_MESSAGE_TEXT, } from './stall-nudge';
1
+ export { CheckpointKeys, createCheckpointStore } from './checkpoint-store.js';
2
+ export { createDetachedSignal } from './detached-signal.js';
3
+ export { runnableLoop } from './runnable-loop.js';
4
+ export { seedFromItems } from './session-seed.js';
5
+ export { createNudgeMessage, createStallNudgeHook, DEFAULT_NUDGE_MESSAGE_TEXT, } from './stall-nudge.js';
@@ -30,10 +30,10 @@
30
30
  * escalation) lives in the caller and composes via the `afterFirstTurn`
31
31
  * hook.
32
32
  */
33
- import type { HarnessResponse } from '../../types/harness-result';
34
- import type { ExecuteInput, Item } from '../../types/items';
35
- import type { ExecuteOptions, SessionScope } from '../../types/runtime';
36
- import type { DetachedSignal } from './detached-signal';
33
+ import type { HarnessResponse } from '../../types/harness-result.js';
34
+ import type { ExecuteInput, Item } from '../../types/items.js';
35
+ import type { ExecuteOptions, SessionScope } from '../../types/runtime.js';
36
+ import type { DetachedSignal } from './detached-signal.js';
37
37
  /**
38
38
  * Minimum harness surface the loop calls into. Defining this
39
39
  * structurally keeps the loop loosely coupled — the concrete
@@ -10,7 +10,7 @@
10
10
  * restore a prior session) has one documented, named entrypoint rather
11
11
  * than reaching for the harness method inline.
12
12
  */
13
- import type { Item } from '../../types/items';
13
+ import type { Item } from '../../types/items.js';
14
14
  /**
15
15
  * Minimum harness surface `seedFromItems` requires. Defined structurally
16
16
  * so tests (and out-of-process children) can pass a stub without casts;
@@ -17,9 +17,9 @@
17
17
  * represents a stalled failure) stay with the caller and flow in via
18
18
  * the config.
19
19
  */
20
- import type { InputMessageItem } from '../../types/items';
21
- import type { DetachedSignal } from './detached-signal';
22
- import type { AfterFirstTurnContext, RunnableLoopHarness } from './runnable-loop';
20
+ import type { InputMessageItem } from '../../types/items.js';
21
+ import type { DetachedSignal } from './detached-signal.js';
22
+ import type { AfterFirstTurnContext, RunnableLoopHarness } from './runnable-loop.js';
23
23
  /**
24
24
  * Default developer-role text sent when the agent finishes a turn
25
25
  * without calling a terminal tool or an ask-user tool. Kept short and
@@ -1,4 +1,4 @@
1
- import type { StreamEvent } from '../types/harness-result';
1
+ import type { StreamEvent } from '../types/harness-result.js';
2
2
  interface EventBroadcasterOpts {
3
3
  maxBufferSize?: number;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { StorageAdapter } from '../types/memory';
1
+ import type { StorageAdapter } from '../types/memory.js';
2
2
  /**
3
3
  * @public Process-local, Map-backed StorageAdapter.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { frameworkCast } from '../util/framework-cast';
1
+ import { frameworkCast } from '../util/framework-cast.js';
2
2
  //#region Public API
3
3
  /**
4
4
  * @public Process-local, Map-backed StorageAdapter.
@@ -1,6 +1,6 @@
1
- import type { ItemSchemaRegistry } from '../schemas/item';
2
- import type { ItemLog } from '../types/context-parts/item-log';
3
- import type { Item } from '../types/items';
1
+ import type { ItemSchemaRegistry } from '../schemas/item.js';
2
+ import type { ItemLog } from '../types/context-parts/item-log.js';
3
+ import type { Item } from '../types/items.js';
4
4
  export declare class ItemLogImpl implements ItemLog {
5
5
  private readonly itemSchemas;
6
6
  private readonly _items;
@@ -1,4 +1,4 @@
1
- import { defaultItemSchemaRegistry } from '../schemas/item';
1
+ import { defaultItemSchemaRegistry } from '../schemas/item.js';
2
2
  export class ItemLogImpl {
3
3
  itemSchemas;
4
4
  _items = [];
@@ -1,5 +1,5 @@
1
- import type { ExecuteInput } from '../types/items';
2
- import type { DeliveryMode, ExecuteOptions } from '../types/runtime';
1
+ import type { ExecuteInput } from '../types/items.js';
2
+ import type { DeliveryMode, ExecuteOptions } from '../types/runtime.js';
3
3
  /** @internal A message accepted by `AgentHarness.execute()` and held until the
4
4
  * session runner processes it. The effective `DeliveryMode` is resolved at
5
5
  * enqueue time so the runner never has to look at harness defaults again. */
@@ -1,10 +1,10 @@
1
- import type { Context } from '../types/context';
2
- import type { HarnessResponse } from '../types/harness-result';
3
- import type { Item } from '../types/items';
4
- import type { HarnessStatus } from '../types/runtime';
5
- import { EventBroadcaster } from './event-broadcaster';
6
- import type { QueuedMessage } from './message-queue';
7
- import { MessageQueue } from './message-queue';
1
+ import type { Context } from '../types/context.js';
2
+ import type { HarnessResponse } from '../types/harness-result.js';
3
+ import type { Item } from '../types/items.js';
4
+ import type { HarnessStatus } from '../types/runtime.js';
5
+ import { EventBroadcaster } from './event-broadcaster.js';
6
+ import type { QueuedMessage } from './message-queue.js';
7
+ import { MessageQueue } from './message-queue.js';
8
8
  /** @internal Callback the harness supplies to run a single turn against a
9
9
  * prepared context. The runner invokes this once per turn; it returns the
10
10
  * final text as a string and must append any produced items to `ctx.itemLog`. */
@@ -1,6 +1,6 @@
1
- import { emitFrameworkEvent } from './broadcaster-utils';
2
- import { EventBroadcaster } from './event-broadcaster';
3
- import { MessageQueue } from './message-queue';
1
+ import { emitFrameworkEvent } from './broadcaster-utils.js';
2
+ import { EventBroadcaster } from './event-broadcaster.js';
3
+ import { MessageQueue } from './message-queue.js';
4
4
  //#endregion
5
5
  //#region Helpers
6
6
  function inputToItems(input) {
@@ -1,6 +1,6 @@
1
- import type { ItemSchemaRegistry } from '../schemas/item';
2
- import type { StreamingItem } from '../types/harness-result';
3
- import type { EventBroadcaster } from './event-broadcaster';
1
+ import type { ItemSchemaRegistry } from '../schemas/item.js';
2
+ import type { StreamingItem } from '../types/harness-result.js';
3
+ import type { EventBroadcaster } from './event-broadcaster.js';
4
4
  /** @internal Yield text deltas from the session broadcaster. */
5
5
  export declare function filterTextStream(broadcaster: EventBroadcaster): AsyncIterable<string>;
6
6
  /** @internal Yield reasoning-token deltas from the session broadcaster. */
@@ -1,4 +1,4 @@
1
- import { defaultItemSchemaRegistry } from '../schemas/item';
1
+ import { defaultItemSchemaRegistry } from '../schemas/item.js';
2
2
  //#endregion
3
3
  //#region Helpers
4
4
  function isItemRecord(value) {
@@ -1,5 +1,5 @@
1
- import type { ContextMemory } from '../types/memory';
2
- import type { Step } from '../types/step';
1
+ import type { ContextMemory } from '../types/memory.js';
2
+ import type { Step } from '../types/step.js';
3
3
  /** Registry-wide step type — stored at the widest generic parameters so
4
4
  * callers can register steps with narrower input/output types without
5
5
  * fighting variance. The public `Step` default already uses `unknown` for
@@ -1,6 +1,6 @@
1
- import { NoeticConfigError } from '../errors/noetic-config-error';
2
- import { setDefaultRegistrar } from '../types/step-registrar';
3
- import { frameworkCast } from '../util/framework-cast';
1
+ import { NoeticConfigError } from '../errors/noetic-config-error.js';
2
+ import { setDefaultRegistrar } from '../types/step-registrar.js';
3
+ import { frameworkCast } from '../util/framework-cast.js';
4
4
  //#endregion
5
5
  //#region Module state
6
6
  const registry = new Map();
@@ -1,6 +1,6 @@
1
1
  import type { TurnContext } from '@openrouter/agent';
2
- import type { Context } from '../types/context';
3
- import type { AgentHarnessContract } from '../types/runtime';
4
- import type { ToolExecutionContext, ToolMemory } from '../types/tool-context';
2
+ import type { Context } from '../types/context.js';
3
+ import type { AgentHarnessContract } from '../types/runtime.js';
4
+ import type { ToolExecutionContext, ToolMemory } from '../types/tool-context.js';
5
5
  export declare function buildToolMemory(harness: AgentHarnessContract, ctx: Context): ToolMemory;
6
6
  export declare function buildToolExecutionContext(ctx: Context, harness: AgentHarnessContract, turnContext?: TurnContext): ToolExecutionContext;
@@ -13,7 +13,7 @@
13
13
  * don't need to re-validate every provider field TypeScript already types.
14
14
  */
15
15
  import { z } from 'zod';
16
- import type { Item, ItemSchemaExtensions } from '../types/items';
16
+ import type { Item, ItemSchemaExtensions } from '../types/items.js';
17
17
  /** @public Structural validator for `Item`. Asserts non-empty string `type` discriminant. */
18
18
  export declare const ItemSchema: z.ZodCustom<Item, Item>;
19
19
  type ItemSchemaCategory = keyof Required<ItemSchemaExtensions>;
@@ -1,4 +1,4 @@
1
- import type { FunctionCallItem, Item } from './items';
1
+ import type { FunctionCallItem, Item } from './items.js';
2
2
  /**
3
3
  * Policy controlling automatic retry behavior on step failure.
4
4
  * @public
@@ -1,4 +1,4 @@
1
- import type { Item } from '../items';
1
+ import type { Item } from '../items.js';
2
2
  /** @public Append-only log of conversation items accumulated during execution. */
3
3
  export interface ItemLog {
4
4
  readonly items: ReadonlyArray<Item>;
@@ -1,4 +1,4 @@
1
- import type { Item } from '../items';
1
+ import type { Item } from '../items.js';
2
2
  /** @public Per-layer contribution to the context window on the most recent LLM call. */
3
3
  export interface LayerUsageEntry {
4
4
  readonly layerId: string;
@@ -1,19 +1,19 @@
1
1
  import type { ZodType } from 'zod';
2
- import type { ItemSchemaRegistry } from '../schemas/item';
3
- import type { Channel, ChannelHandle, ExternalChannel } from './channel';
4
- import type { LLMResponse, ModelParams, StepMeta, TokenUsage } from './common';
5
- import type { ItemLog } from './context-parts/item-log';
6
- import type { LastLayerUsage } from './context-parts/layer-usage';
7
- import type { DetachedHandle } from './detached';
8
- import type { FsAdapter } from './fs-adapter';
9
- import type { HarnessResponse, StreamEvent, StreamingItem } from './harness-result';
10
- import type { ExecuteInput } from './items';
11
- import type { ContextMemory, MemoryLayer, StorageAdapter } from './memory';
12
- import type { Span } from './observability';
13
- import type { ShellAdapter } from './shell-adapter';
14
- import type { SteeringDecision } from './steering';
15
- import type { SubprocessAdapter } from './subprocess-adapter';
16
- import type { Tool } from './tool';
2
+ import type { ItemSchemaRegistry } from '../schemas/item.js';
3
+ import type { Channel, ChannelHandle, ExternalChannel } from './channel.js';
4
+ import type { LLMResponse, ModelParams, StepMeta, TokenUsage } from './common.js';
5
+ import type { ItemLog } from './context-parts/item-log.js';
6
+ import type { LastLayerUsage } from './context-parts/layer-usage.js';
7
+ import type { DetachedHandle } from './detached.js';
8
+ import type { FsAdapter } from './fs-adapter.js';
9
+ import type { HarnessResponse, StreamEvent, StreamingItem } from './harness-result.js';
10
+ import type { ExecuteInput } from './items.js';
11
+ import type { ContextMemory, MemoryLayer, StorageAdapter } from './memory.js';
12
+ import type { Span } from './observability.js';
13
+ import type { ShellAdapter } from './shell-adapter.js';
14
+ import type { SteeringDecision } from './steering.js';
15
+ import type { SubprocessAdapter } from './subprocess-adapter.js';
16
+ import type { Tool } from './tool.js';
17
17
  /**
18
18
  * @public Mutable working-directory state shared among the tools attached to a
19
19
  * single Context. The reference is fixed for the Context's lifetime; mutate
@@ -37,7 +37,7 @@ export type ContextHarnessStatus = {
37
37
  };
38
38
  interface ContextCallModelRequestBase {
39
39
  model: string;
40
- items: ReadonlyArray<import('./items').Item>;
40
+ items: ReadonlyArray<import('./items.js').Item>;
41
41
  instructions?: string;
42
42
  params?: ModelParams;
43
43
  outputSchema?: ZodType;
@@ -68,12 +68,12 @@ export interface ContextRerenderRequest {
68
68
  scope: 'self' | 'slot-after' | 'all';
69
69
  }
70
70
  export interface ContextAppendPipelineResult {
71
- readonly items: import('./items').Item[];
71
+ readonly items: import('./items.js').Item[];
72
72
  readonly rerenderRequests: ContextRerenderRequest[];
73
73
  }
74
74
  export interface ContextRecallLayerOutput {
75
75
  layerId: string;
76
- items: import('./items').Item[];
76
+ items: import('./items.js').Item[];
77
77
  tokenCount: number;
78
78
  }
79
79
  export type ContextStep<TMemory = ContextMemory, I = unknown, O = unknown> = {
@@ -114,7 +114,7 @@ export interface ContextHarness {
114
114
  detachedSpawn<I, O>(step: unknown, input: I, parentCtx: Context, overrides?: ContextDetachedSpawnOverrides): DetachedHandle<O>;
115
115
  createContext(opts?: {
116
116
  parent?: Context;
117
- items?: import('./items').Item[];
117
+ items?: import('./items.js').Item[];
118
118
  state?: unknown;
119
119
  threadId?: string;
120
120
  resourceId?: string;
@@ -126,11 +126,11 @@ export interface ContextHarness {
126
126
  setLayerState<T>(executionId: string, layerId: string, state: T): void;
127
127
  beforeToolCall(layers: MemoryLayer[], toolName: string, toolArgs: unknown, ctx: Context): Promise<SteeringDecision>;
128
128
  afterModelCall(layers: MemoryLayer[], response: LLMResponse, ctx: Context): Promise<SteeringDecision>;
129
- runAppendPipeline(layers: MemoryLayer[], items: import('./items').Item[], ctx: Context): Promise<ContextAppendPipelineResult>;
129
+ runAppendPipeline(layers: MemoryLayer[], items: import('./items.js').Item[], ctx: Context): Promise<ContextAppendPipelineResult>;
130
130
  recallLayers(layers: MemoryLayer[], input: string, ctx: Context): Promise<ContextRecallLayerOutput[]>;
131
- projectHistory(layers: MemoryLayer[], items: ReadonlyArray<import('./items').Item>, ctx: Context): Promise<ReadonlyArray<import('./items').Item>>;
131
+ projectHistory(layers: MemoryLayer[], items: ReadonlyArray<import('./items.js').Item>, ctx: Context): Promise<ReadonlyArray<import('./items.js').Item>>;
132
132
  storeLayers(layers: MemoryLayer[], response: LLMResponse, ctx: Context): Promise<void>;
133
- previewRequestItems(scope?: unknown): Promise<ReadonlyArray<import('./items').Item>>;
133
+ previewRequestItems(scope?: unknown): Promise<ReadonlyArray<import('./items.js').Item>>;
134
134
  send<T>(channel: Channel<T>, value: T, ctx: Context): void;
135
135
  recv<T>(channel: Channel<T>, ctx: Context, opts?: {
136
136
  timeout?: number;
@@ -146,7 +146,7 @@ export interface ContextHarness {
146
146
  abort(scope?: unknown): Promise<void>;
147
147
  getStatus(scope?: unknown): ContextHarnessStatus;
148
148
  getQueueSize(scope?: unknown): number;
149
- seedSessionHistory(threadId: string, items: ReadonlyArray<import('./items').Item>): void;
149
+ seedSessionHistory(threadId: string, items: ReadonlyArray<import('./items.js').Item>): void;
150
150
  executeRerender(requests: ContextRerenderRequest[], layers: MemoryLayer[], ctx: Context, budgets: Map<string, number>, query?: string): Promise<ContextRecallLayerOutput[]>;
151
151
  }
152
152
  /** @public Execution context threaded through every step, carrying state, metrics, and channels. */
@@ -1,5 +1,5 @@
1
- import type { LastLayerUsage } from './context-parts/layer-usage';
2
- import type { Item } from './items';
1
+ import type { LastLayerUsage } from './context-parts/layer-usage.js';
2
+ import type { Item } from './items.js';
3
3
  /** @public SDK-originated event from the OpenResponses streaming API. */
4
4
  export interface SdkStreamEvent {
5
5
  readonly source: 'sdk';
@@ -1,7 +1,7 @@
1
- import type { LLMResponse } from './common';
2
- import type { FsAdapter } from './fs-adapter';
3
- import type { Item } from './items';
4
- import type { ShellAdapter } from './shell-adapter';
1
+ import type { LLMResponse } from './common.js';
2
+ import type { FsAdapter } from './fs-adapter.js';
3
+ import type { Item } from './items.js';
4
+ import type { ShellAdapter } from './shell-adapter.js';
5
5
  /** @public Isolation scope controlling how a memory layer's state is keyed and shared. */
6
6
  export type MemoryScope = 'thread' | 'resource' | 'global' | 'execution';
7
7
  /** @public Terminal outcome of an execution run, reported to memory layers on completion. */