@noetic-tools/core 0.2.0 → 0.3.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 (203) hide show
  1. package/dist/adapters/in-memory-fs-adapter.d.ts +1 -1
  2. package/dist/adapters/in-memory-fs-adapter.js +1 -1
  3. package/dist/adapters/in-memory-shell-adapter.d.ts +1 -1
  4. package/dist/adapters/in-memory-subprocess/manifest-persistence.d.ts +2 -2
  5. package/dist/adapters/in-memory-subprocess/metadata.d.ts +1 -1
  6. package/dist/adapters/in-memory-subprocess/types.d.ts +2 -2
  7. package/dist/adapters/in-memory-subprocess-adapter.d.ts +1 -1
  8. package/dist/adapters/openrouter.d.ts +2 -6
  9. package/dist/adapters/openrouter.js +1 -4
  10. package/dist/builders/channel-builder.d.ts +1 -1
  11. package/dist/builders/control-flow-builders.d.ts +2 -3
  12. package/dist/builders/control-flow-builders.js +1 -2
  13. package/dist/builders/every.d.ts +2 -3
  14. package/dist/builders/every.js +1 -1
  15. package/dist/builders/layer-provides-builders.d.ts +1 -1
  16. package/dist/builders/layer-provides-builders.js +1 -1
  17. package/dist/builders/loop-builder.d.ts +2 -2
  18. package/dist/builders/loop-builder.js +1 -1
  19. package/dist/builders/memory-builder.d.ts +1 -1
  20. package/dist/builders/memory-builder.js +1 -1
  21. package/dist/builders/provide-builder.d.ts +2 -2
  22. package/dist/builders/provide-builder.js +1 -1
  23. package/dist/builders/spawn-builder.d.ts +2 -3
  24. package/dist/builders/spawn-builder.js +1 -1
  25. package/dist/builders/step-builders.d.ts +2 -6
  26. package/dist/builders/step-builders.js +1 -1
  27. package/dist/builders/tool-builder.d.ts +1 -3
  28. package/dist/builders/tool-builder.js +1 -1
  29. package/dist/builders/workflow-hydrator.d.ts +2 -3
  30. package/dist/builders/workflow-hydrator.js +1 -2
  31. package/dist/conditions/conditions.d.ts +2 -3
  32. package/dist/conditions/conditions.js +1 -1
  33. package/dist/harness/agent-harness.d.ts +13 -3
  34. package/dist/harness/agent-harness.js +48 -5
  35. package/dist/harness/deps/memory.d.ts +2 -5
  36. package/dist/harness/deps/memory.js +1 -4
  37. package/dist/harness/deps/types.d.ts +3 -16
  38. package/dist/harness/deps/types.js +1 -1
  39. package/dist/harness/model-call.d.ts +1 -3
  40. package/dist/harness/model-call.js +1 -2
  41. package/dist/harness/model-schema.d.ts +2 -4
  42. package/dist/harness/model-schema.js +1 -1
  43. package/dist/index.d.ts +28 -49
  44. package/dist/index.js +9 -27
  45. package/dist/interpreter/action-deps.d.ts +4 -8
  46. package/dist/interpreter/action-deps.js +2 -6
  47. package/dist/interpreter/action-types.d.ts +3 -8
  48. package/dist/interpreter/action-types.js +1 -1
  49. package/dist/interpreter/collect-tools.d.ts +1 -2
  50. package/dist/interpreter/collect-tools.js +1 -1
  51. package/dist/interpreter/execute-action.js +104 -26
  52. package/dist/interpreter/execute-control.d.ts +1 -2
  53. package/dist/interpreter/execute-control.js +1 -3
  54. package/dist/interpreter/execute.d.ts +2 -3
  55. package/dist/interpreter/execute.js +1 -2
  56. package/dist/interpreter/message-helpers.d.ts +1 -1
  57. package/dist/interpreter/message-helpers.js +1 -1
  58. package/dist/interpreter/step-dispatcher.d.ts +2 -5
  59. package/dist/interpreter/typeguards.d.ts +3 -4
  60. package/dist/interpreter/typeguards.js +1 -1
  61. package/dist/observability/span-impl.d.ts +1 -1
  62. package/dist/observability/trace-exporter.d.ts +1 -1
  63. package/dist/patterns/dynamic-workflow.d.ts +2 -5
  64. package/dist/patterns/dynamic-workflow.js +1 -2
  65. package/dist/patterns/flow.d.ts +2 -2
  66. package/dist/patterns/flow.js +1 -1
  67. package/dist/patterns/interview.d.ts +2 -2
  68. package/dist/patterns/interview.js +1 -1
  69. package/dist/patterns/plans.d.ts +2 -3
  70. package/dist/patterns/plans.js +1 -1
  71. package/dist/patterns/ralph-wiggum.d.ts +2 -3
  72. package/dist/patterns/react.d.ts +2 -3
  73. package/dist/portable/memory-layers.d.ts +1 -7
  74. package/dist/portable/memory-layers.js +1 -7
  75. package/dist/portable.d.ts +2 -2
  76. package/dist/portable.js +2 -2
  77. package/dist/runtime/broadcaster-utils.d.ts +1 -1
  78. package/dist/runtime/channel-store.d.ts +1 -1
  79. package/dist/runtime/channel-store.js +1 -2
  80. package/dist/runtime/context-deps.d.ts +3 -3
  81. package/dist/runtime/context-deps.js +2 -2
  82. package/dist/runtime/context-type-deps.d.ts +2 -11
  83. package/dist/runtime/cwd-helpers.d.ts +1 -1
  84. package/dist/runtime/detached-handle.d.ts +2 -3
  85. package/dist/runtime/detached-handle.js +1 -3
  86. package/dist/runtime/durable/checkpoint-store.d.ts +1 -1
  87. package/dist/runtime/durable/checkpoint-store.js +1 -1
  88. package/dist/runtime/durable/harness-checkpoints.d.ts +2 -5
  89. package/dist/runtime/durable/runnable-loop.d.ts +1 -3
  90. package/dist/runtime/durable/session-seed.d.ts +1 -1
  91. package/dist/runtime/durable/stall-nudge.d.ts +1 -1
  92. package/dist/runtime/event-broadcaster.d.ts +1 -1
  93. package/dist/runtime/in-memory-storage.d.ts +1 -1
  94. package/dist/runtime/in-memory-storage.js +1 -1
  95. package/dist/runtime/item-log-impl.d.ts +1 -3
  96. package/dist/runtime/item-log-impl.js +1 -1
  97. package/dist/runtime/message-queue.d.ts +1 -2
  98. package/dist/runtime/session-runner.d.ts +1 -4
  99. package/dist/runtime/session-streams.d.ts +1 -2
  100. package/dist/runtime/session-streams.js +1 -1
  101. package/dist/runtime/step-registry.d.ts +2 -2
  102. package/dist/runtime/step-registry.js +1 -2
  103. package/dist/runtime/tool-memory.d.ts +1 -3
  104. package/dist/types/mutable-context.d.ts +2 -3
  105. package/dist/types/step-registrar.d.ts +1 -1
  106. package/dist/unstable.d.ts +5 -9
  107. package/dist/unstable.js +3 -6
  108. package/dist/until/combinators.d.ts +1 -1
  109. package/dist/until/never.d.ts +1 -1
  110. package/dist/until/predicates.d.ts +2 -2
  111. package/package.json +6 -4
  112. package/dist/errors/noetic-config-error.d.ts +0 -41
  113. package/dist/errors/noetic-config-error.js +0 -44
  114. package/dist/errors/noetic-error.d.ts +0 -18
  115. package/dist/errors/noetic-error.js +0 -54
  116. package/dist/memory/budget.d.ts +0 -23
  117. package/dist/memory/budget.js +0 -117
  118. package/dist/memory/exec-context-factory.d.ts +0 -25
  119. package/dist/memory/exec-context-factory.js +0 -30
  120. package/dist/memory/flow-schema.d.ts +0 -52
  121. package/dist/memory/flow-schema.js +0 -102
  122. package/dist/memory/function-call-utils.d.ts +0 -6
  123. package/dist/memory/function-call-utils.js +0 -27
  124. package/dist/memory/layer-api.d.ts +0 -14
  125. package/dist/memory/layer-api.js +0 -91
  126. package/dist/memory/layer-lifecycle.d.ts +0 -160
  127. package/dist/memory/layer-lifecycle.js +0 -552
  128. package/dist/memory/layer-provides.d.ts +0 -32
  129. package/dist/memory/layer-provides.js +0 -33
  130. package/dist/memory/layer-usage.d.ts +0 -16
  131. package/dist/memory/layer-usage.js +0 -54
  132. package/dist/memory/layers/durable-task-state.d.ts +0 -79
  133. package/dist/memory/layers/durable-task-state.js +0 -118
  134. package/dist/memory/layers/file-reference.d.ts +0 -55
  135. package/dist/memory/layers/file-reference.js +0 -594
  136. package/dist/memory/layers/history-window.d.ts +0 -29
  137. package/dist/memory/layers/history-window.js +0 -114
  138. package/dist/memory/layers/observational-memory.d.ts +0 -53
  139. package/dist/memory/layers/observational-memory.js +0 -109
  140. package/dist/memory/layers/plan.d.ts +0 -55
  141. package/dist/memory/layers/plan.js +0 -374
  142. package/dist/memory/layers/static-content.d.ts +0 -27
  143. package/dist/memory/layers/static-content.js +0 -35
  144. package/dist/memory/layers/steering.d.ts +0 -51
  145. package/dist/memory/layers/steering.js +0 -258
  146. package/dist/memory/layers/temporal.d.ts +0 -91
  147. package/dist/memory/layers/temporal.js +0 -245
  148. package/dist/memory/layers/tool-memory-layer.d.ts +0 -16
  149. package/dist/memory/layers/tool-memory-layer.js +0 -43
  150. package/dist/memory/layers/working-memory.d.ts +0 -44
  151. package/dist/memory/layers/working-memory.js +0 -92
  152. package/dist/memory/projector.d.ts +0 -10
  153. package/dist/memory/projector.js +0 -19
  154. package/dist/memory/scope.d.ts +0 -3
  155. package/dist/memory/scope.js +0 -31
  156. package/dist/memory/strip-unresolved.d.ts +0 -13
  157. package/dist/memory/strip-unresolved.js +0 -35
  158. package/dist/schemas/item.d.ts +0 -35
  159. package/dist/schemas/item.js +0 -155
  160. package/dist/types/channel.d.ts +0 -29
  161. package/dist/types/channel.js +0 -1
  162. package/dist/types/common.d.ts +0 -68
  163. package/dist/types/common.js +0 -1
  164. package/dist/types/context-parts/item-log.d.ts +0 -6
  165. package/dist/types/context-parts/item-log.js +0 -1
  166. package/dist/types/context-parts/layer-usage.d.ts +0 -18
  167. package/dist/types/context-parts/layer-usage.js +0 -1
  168. package/dist/types/context.d.ts +0 -202
  169. package/dist/types/context.js +0 -1
  170. package/dist/types/detached.d.ts +0 -17
  171. package/dist/types/detached.js +0 -7
  172. package/dist/types/error.d.ts +0 -66
  173. package/dist/types/error.js +0 -1
  174. package/dist/types/fs-adapter.d.ts +0 -51
  175. package/dist/types/fs-adapter.js +0 -3
  176. package/dist/types/harness-result.d.ts +0 -43
  177. package/dist/types/harness-result.js +0 -2
  178. package/dist/types/items.d.ts +0 -131
  179. package/dist/types/items.js +0 -2
  180. package/dist/types/memory-context.d.ts +0 -39
  181. package/dist/types/memory-context.js +0 -1
  182. package/dist/types/memory.d.ts +0 -306
  183. package/dist/types/memory.js +0 -13
  184. package/dist/types/observability.d.ts +0 -30
  185. package/dist/types/observability.js +0 -1
  186. package/dist/types/runtime.d.ts +0 -256
  187. package/dist/types/runtime.js +0 -1
  188. package/dist/types/shell-adapter.d.ts +0 -34
  189. package/dist/types/shell-adapter.js +0 -10
  190. package/dist/types/steering.d.ts +0 -89
  191. package/dist/types/steering.js +0 -14
  192. package/dist/types/step.d.ts +0 -231
  193. package/dist/types/step.js +0 -1
  194. package/dist/types/subprocess-adapter.d.ts +0 -157
  195. package/dist/types/subprocess-adapter.js +0 -3
  196. package/dist/types/tool-context.d.ts +0 -34
  197. package/dist/types/tool-context.js +0 -1
  198. package/dist/types/tool.d.ts +0 -64
  199. package/dist/types/tool.js +0 -1
  200. package/dist/util/framework-cast.d.ts +0 -10
  201. package/dist/util/framework-cast.js +0 -16
  202. package/dist/util/message-helpers.d.ts +0 -17
  203. package/dist/util/message-helpers.js +0 -64
@@ -2,11 +2,10 @@
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 { frameworkCast, NoeticConfigError } from '@noetic-tools/types';
5
6
  import { step } from '../builders/step-builders.js';
6
7
  import { hydrateWorkflow } from '../builders/workflow-hydrator.js';
7
- import { NoeticConfigError } from '../errors/noetic-config-error.js';
8
8
  import { WorkflowDocumentSchema, workflowDepth } from '../schemas/workflow.js';
9
- import { frameworkCast } from '../util/framework-cast.js';
10
9
  //#endregion
11
10
  //#region Constants
12
11
  const DEFAULT_MAX_DEPTH = 5;
@@ -1,2 +1,2 @@
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
+ export type { FlowNode, ForkFlowNode, LlmFlowNode, SequenceFlowNode, SpawnFlowNode, SubagentFlowNode, } from '@noetic-tools/memory';
2
+ export { FlowSchema, flowDepth, validateFlow, walkFlow } from '@noetic-tools/memory';
@@ -1 +1 @@
1
- export { FlowSchema, flowDepth, validateFlow, walkFlow } from '../memory/flow-schema.js';
1
+ export { FlowSchema, flowDepth, validateFlow, walkFlow } from '@noetic-tools/memory';
@@ -1,6 +1,6 @@
1
+ import type { ContextMemory } from '@noetic-tools/memory';
2
+ import type { Step } from '@noetic-tools/types';
1
3
  import type { ZodType } from 'zod';
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
+ import { frameworkCast } from '@noetic-tools/types';
1
2
  import { z } from 'zod';
2
3
  import { loop } from '../builders/loop-builder.js';
3
4
  import { step } from '../builders/step-builders.js';
4
5
  import { any } from '../until/combinators.js';
5
6
  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,6 @@
1
+ import type { ContextMemory } from '@noetic-tools/memory';
2
+ import type { Context, ExecuteStepFn, Step } from '@noetic-tools/types';
1
3
  import { z } from 'zod';
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
4
  export interface PlanNode {
6
5
  id: string;
7
6
  description: string;
@@ -1,6 +1,6 @@
1
+ import { frameworkCast } from '@noetic-tools/types';
1
2
  import { z } from 'zod';
2
3
  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,6 +1,5 @@
1
- import type { ContextMemory } from '../types/memory.js';
2
- import type { StepLoop } from '../types/step.js';
3
- import type { Tool } from '../types/tool.js';
1
+ import type { ContextMemory } from '@noetic-tools/memory';
2
+ import type { StepLoop, Tool } from '@noetic-tools/types';
4
3
  import type { VerifyFn } from '../until/predicates.js';
5
4
  /**
6
5
  * Creates a retry-with-feedback loop wrapping a ReAct agent. Each iteration spawns an inner agent
@@ -1,6 +1,5 @@
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';
1
+ import type { ContextMemory, MemoryConfig, MemoryLayer } from '@noetic-tools/memory';
2
+ import type { StepLoop, StepSpawn, Tool } from '@noetic-tools/types';
4
3
  /**
5
4
  * Creates a ReAct (Reason + Act) agent loop: an LLM step with tools iterated until no tool calls or limits are hit.
6
5
  *
@@ -1,14 +1,8 @@
1
1
  /** @public */
2
- export { durableTaskState } from '../memory/layers/durable-task-state.js';
3
2
  /** @public */
4
- export { historyWindow } from '../memory/layers/history-window.js';
5
3
  /** @public */
6
- export { observationalMemory } from '../memory/layers/observational-memory.js';
7
4
  /** @public */
8
- export { planMemory } from '../memory/layers/plan.js';
9
5
  /** @public */
10
- export { temporalMemory } from '../memory/layers/temporal.js';
11
6
  /** @public */
12
- export { toolMemoryLayer } from '../memory/layers/tool-memory-layer.js';
13
7
  /** @public */
14
- export { workingMemory } from '../memory/layers/working-memory.js';
8
+ export { durableTaskState, historyWindow, observationalMemory, planMemory, temporalMemory, toolMemoryLayer, workingMemory, } from '@noetic-tools/memory';
@@ -1,14 +1,8 @@
1
1
  /** @public */
2
- export { durableTaskState } from '../memory/layers/durable-task-state.js';
3
2
  /** @public */
4
- export { historyWindow } from '../memory/layers/history-window.js';
5
3
  /** @public */
6
- export { observationalMemory } from '../memory/layers/observational-memory.js';
7
4
  /** @public */
8
- export { planMemory } from '../memory/layers/plan.js';
9
5
  /** @public */
10
- export { temporalMemory } from '../memory/layers/temporal.js';
11
6
  /** @public */
12
- export { toolMemoryLayer } from '../memory/layers/tool-memory-layer.js';
13
7
  /** @public */
14
- export { workingMemory } from '../memory/layers/working-memory.js';
8
+ export { durableTaskState, historyWindow, observationalMemory, planMemory, temporalMemory, toolMemoryLayer, workingMemory, } from '@noetic-tools/memory';
@@ -1,8 +1,8 @@
1
+ /** @public */
2
+ export { Slot } from '@noetic-tools/memory';
1
3
  export * from './portable/adapters.js';
2
4
  export * from './portable/ask-user.js';
3
5
  export * from './portable/builders.js';
4
6
  export * from './portable/memory-layers.js';
5
7
  export * from './portable/runtime.js';
6
8
  export * from './portable/until.js';
7
- /** @public */
8
- export { Slot } from './types/memory.js';
package/dist/portable.js CHANGED
@@ -1,8 +1,8 @@
1
+ /** @public */
2
+ export { Slot } from '@noetic-tools/memory';
1
3
  export * from './portable/adapters.js';
2
4
  export * from './portable/ask-user.js';
3
5
  export * from './portable/builders.js';
4
6
  export * from './portable/memory-layers.js';
5
7
  export * from './portable/runtime.js';
6
8
  export * from './portable/until.js';
7
- /** @public */
8
- export { Slot } from './types/memory.js';
@@ -1,4 +1,4 @@
1
- import type { Context } from '../types/context.js';
1
+ import type { Context } from '@noetic-tools/types';
2
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);
@@ -1,4 +1,4 @@
1
- import type { Channel, ChannelHandle, ExternalChannel } from '../types/channel.js';
1
+ import type { Channel, ChannelHandle, ExternalChannel } from '@noetic-tools/types';
2
2
  export declare class ChannelStore {
3
3
  private channels;
4
4
  private closedExecutions;
@@ -1,5 +1,4 @@
1
- import { NoeticErrorImpl } from '../errors/noetic-error.js';
2
- import { frameworkCast } from '../util/framework-cast.js';
1
+ import { frameworkCast, NoeticErrorImpl } from '@noetic-tools/types';
3
2
  function isExternalChannel(ch) {
4
3
  return 'external' in ch && ch.external === true;
5
4
  }
@@ -1,4 +1,4 @@
1
- export { buildContextMemory } from '../memory/layer-api.js';
2
- export type { ItemSchemaRegistry } from '../schemas/item.js';
3
- export { defaultItemSchemaRegistry } from '../schemas/item.js';
1
+ export { buildContextMemory } from '@noetic-tools/memory';
2
+ export type { ItemSchemaRegistry } from '@noetic-tools/types';
3
+ export { defaultItemSchemaRegistry } from '@noetic-tools/types';
4
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.js';
2
- export { defaultItemSchemaRegistry } from '../schemas/item.js';
1
+ export { buildContextMemory } from '@noetic-tools/memory';
2
+ export { defaultItemSchemaRegistry } from '@noetic-tools/types';
@@ -1,14 +1,5 @@
1
- export type { Channel } from '../types/channel.js';
1
+ export type { ContextMemory, MemoryLayer } from '@noetic-tools/memory';
2
+ export type { AgentHarnessContract, Channel, Context, CwdState, FsAdapter, Item, ItemLog, LastLayerUsage, Span, StepMeta, TokenUsage, Tool, } from '@noetic-tools/types';
2
3
  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
4
  export type { ChannelStore } from './channel-store.js';
14
5
  export type { EventBroadcaster } from './event-broadcaster.js';
@@ -1,4 +1,4 @@
1
- import type { Context, CwdState } from '../types/context.js';
1
+ import type { Context, CwdState } from '@noetic-tools/types';
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,5 @@
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';
1
+ import type { DetachedHandle, SubprocessAdapter, SubprocessHandle } from '@noetic-tools/types';
2
+ import { DetachedStatus } from '@noetic-tools/types';
4
3
  interface DetachedHandleOpts {
5
4
  /** Id surfaced to callers — usually the execution id (childCtx.id in
6
5
  * `detachedSpawn`) so consumers can correlate it with their own state. */
@@ -1,6 +1,4 @@
1
- import { NoeticErrorImpl } from '../errors/noetic-error.js';
2
- import { DetachedStatus } from '../types/detached.js';
3
- import { frameworkCast } from '../util/framework-cast.js';
1
+ import { DetachedStatus, frameworkCast, NoeticErrorImpl } from '@noetic-tools/types';
4
2
  //#endregion
5
3
  //#region Helpers
6
4
  const INITIAL_POLL_MS = 10;
@@ -1,5 +1,5 @@
1
+ import type { StorageAdapter } from '@noetic-tools/memory';
1
2
  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,4 +1,4 @@
1
- import { NoeticConfigError } from '../../errors/noetic-config-error.js';
1
+ import { NoeticConfigError } from '@noetic-tools/types';
2
2
  import { CheckpointSnapshotSchema } from '../../types/checkpoint.js';
3
3
  //#region Keys
4
4
  /**
@@ -1,8 +1,5 @@
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';
1
+ import type { LayerStateStore, MemoryLayer } from '@noetic-tools/memory';
2
+ import type { Context, Item, ItemSchemaRegistry } from '@noetic-tools/types';
6
3
  import type { CheckpointStore } from './checkpoint-store.js';
7
4
  /**
8
5
  * Minimum harness surface `captureCheckpoint` / `restoreFromCheckpoint`
@@ -30,9 +30,7 @@
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.js';
34
- import type { ExecuteInput, Item } from '../../types/items.js';
35
- import type { ExecuteOptions, SessionScope } from '../../types/runtime.js';
33
+ import type { ExecuteInput, ExecuteOptions, HarnessResponse, Item, SessionScope } from '@noetic-tools/types';
36
34
  import type { DetachedSignal } from './detached-signal.js';
37
35
  /**
38
36
  * Minimum harness surface the loop calls into. Defining this
@@ -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.js';
13
+ import type { Item } from '@noetic-tools/types';
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,7 +17,7 @@
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.js';
20
+ import type { InputMessageItem } from '@noetic-tools/types';
21
21
  import type { DetachedSignal } from './detached-signal.js';
22
22
  import type { AfterFirstTurnContext, RunnableLoopHarness } from './runnable-loop.js';
23
23
  /**
@@ -1,4 +1,4 @@
1
- import type { StreamEvent } from '../types/harness-result.js';
1
+ import type { StreamEvent } from '@noetic-tools/types';
2
2
  interface EventBroadcasterOpts {
3
3
  maxBufferSize?: number;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { StorageAdapter } from '../types/memory.js';
1
+ import type { StorageAdapter } from '@noetic-tools/memory';
2
2
  /**
3
3
  * @public Process-local, Map-backed StorageAdapter.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { frameworkCast } from '../util/framework-cast.js';
1
+ import { frameworkCast } from '@noetic-tools/types';
2
2
  //#region Public API
3
3
  /**
4
4
  * @public Process-local, Map-backed StorageAdapter.
@@ -1,6 +1,4 @@
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';
1
+ import type { Item, ItemLog, ItemSchemaRegistry } from '@noetic-tools/types';
4
2
  export declare class ItemLogImpl implements ItemLog {
5
3
  private readonly itemSchemas;
6
4
  private readonly _items;
@@ -1,4 +1,4 @@
1
- import { defaultItemSchemaRegistry } from '../schemas/item.js';
1
+ import { defaultItemSchemaRegistry } from '@noetic-tools/types';
2
2
  export class ItemLogImpl {
3
3
  itemSchemas;
4
4
  _items = [];
@@ -1,5 +1,4 @@
1
- import type { ExecuteInput } from '../types/items.js';
2
- import type { DeliveryMode, ExecuteOptions } from '../types/runtime.js';
1
+ import type { DeliveryMode, ExecuteInput, ExecuteOptions } from '@noetic-tools/types';
3
2
  /** @internal A message accepted by `AgentHarness.execute()` and held until the
4
3
  * session runner processes it. The effective `DeliveryMode` is resolved at
5
4
  * enqueue time so the runner never has to look at harness defaults again. */
@@ -1,7 +1,4 @@
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';
1
+ import type { Context, HarnessResponse, HarnessStatus, Item } from '@noetic-tools/types';
5
2
  import { EventBroadcaster } from './event-broadcaster.js';
6
3
  import type { QueuedMessage } from './message-queue.js';
7
4
  import { MessageQueue } from './message-queue.js';
@@ -1,5 +1,4 @@
1
- import type { ItemSchemaRegistry } from '../schemas/item.js';
2
- import type { StreamingItem } from '../types/harness-result.js';
1
+ import type { ItemSchemaRegistry, StreamingItem } from '@noetic-tools/types';
3
2
  import type { EventBroadcaster } from './event-broadcaster.js';
4
3
  /** @internal Yield text deltas from the session broadcaster. */
5
4
  export declare function filterTextStream(broadcaster: EventBroadcaster): AsyncIterable<string>;
@@ -1,4 +1,4 @@
1
- import { defaultItemSchemaRegistry } from '../schemas/item.js';
1
+ import { defaultItemSchemaRegistry } from '@noetic-tools/types';
2
2
  //#endregion
3
3
  //#region Helpers
4
4
  function isItemRecord(value) {
@@ -1,5 +1,5 @@
1
- import type { ContextMemory } from '../types/memory.js';
2
- import type { Step } from '../types/step.js';
1
+ import type { ContextMemory } from '@noetic-tools/memory';
2
+ import type { Step } from '@noetic-tools/types';
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,5 @@
1
- import { NoeticConfigError } from '../errors/noetic-config-error.js';
1
+ import { frameworkCast, NoeticConfigError } from '@noetic-tools/types';
2
2
  import { setDefaultRegistrar } from '../types/step-registrar.js';
3
- import { frameworkCast } from '../util/framework-cast.js';
4
3
  //#endregion
5
4
  //#region Module state
6
5
  const registry = new Map();
@@ -1,6 +1,4 @@
1
+ import type { AgentHarnessContract, Context, ToolExecutionContext, ToolMemory } from '@noetic-tools/types';
1
2
  import type { TurnContext } from '@openrouter/agent';
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
3
  export declare function buildToolMemory(harness: AgentHarnessContract, ctx: Context): ToolMemory;
6
4
  export declare function buildToolExecutionContext(ctx: Context, harness: AgentHarnessContract, turnContext?: TurnContext): ToolExecutionContext;
@@ -1,6 +1,5 @@
1
- import type { StepMeta, TokenUsage } from './common.js';
2
- import type { Context } from './context.js';
3
- import type { ContextMemory } from './memory.js';
1
+ import type { ContextMemory } from '@noetic-tools/memory';
2
+ import type { Context, StepMeta, TokenUsage } from '@noetic-tools/types';
4
3
  /**
5
4
  * Internal-only interface for interpreter code that needs to mutate Context fields.
6
5
  * NOT exported from the package public API.
@@ -13,7 +13,7 @@
13
13
  * when an out-of-process child needs to look up a step by id. In-process
14
14
  * execution walks the step tree directly and never touches either side.
15
15
  */
16
- import type { Step } from './step.js';
16
+ import type { Step } from '@noetic-tools/types';
17
17
  /**
18
18
  * @public
19
19
  * Registers a step under its `id` so the subprocess adapter can later
@@ -7,22 +7,18 @@
7
7
  * and other framework extensions. Do not depend on them in application code.
8
8
  */
9
9
  /** @unstable Budget allocation algorithm for memory layer token budgets. */
10
- export type { BudgetAllocation, BudgetLimits } from './memory/budget.js';
11
- /** @unstable Budget allocation and checking utilities. */
12
- export { allocateBudgets, checkBudget } from './memory/budget.js';
13
10
  /** @unstable Layer state store type for managing per-layer state during execution. */
14
- export type { LayerStateStore } from './memory/layer-lifecycle.js';
11
+ export type { BudgetAllocation, BudgetLimits, LayerStateStore } from '@noetic-tools/memory';
12
+ /** @unstable Budget allocation and checking utilities. */
15
13
  /** @unstable Factory for creating layer state stores. */
16
- export { createLayerStateStore } from './memory/layer-lifecycle.js';
17
14
  /** @unstable View assembly algorithm that converges memory layer outputs into the LLM context. */
18
- export { assembleView } from './memory/projector.js';
19
15
  /** @unstable Factory for creating scoped storage wrappers around a StorageAdapter. */
20
- export { createScopedStorage } from './memory/scope.js';
16
+ export { allocateBudgets, assembleView, checkBudget, createLayerStateStore, createScopedStorage, } from '@noetic-tools/memory';
17
+ /** @unstable Unsafe cast utility for bridging internal type boundaries. */
18
+ export { frameworkCast } from '@noetic-tools/types';
21
19
  /**
22
20
  * @unstable Internal helper used by sync agent-spawn paths (worktree isolation)
23
21
  * to seed a child's cwd snapshot without touching `previousCwd`. Not part of
24
22
  * the public surface — call sites must hold exclusive use of the parent ctx.
25
23
  */
26
24
  export { retargetCwdForSpawn } from './runtime/cwd-helpers.js';
27
- /** @unstable Unsafe cast utility for bridging internal type boundaries. */
28
- export { frameworkCast } from './util/framework-cast.js';
package/dist/unstable.js CHANGED
@@ -7,18 +7,15 @@
7
7
  * and other framework extensions. Do not depend on them in application code.
8
8
  */
9
9
  /** @unstable Budget allocation and checking utilities. */
10
- export { allocateBudgets, checkBudget } from './memory/budget.js';
11
10
  /** @unstable Factory for creating layer state stores. */
12
- export { createLayerStateStore } from './memory/layer-lifecycle.js';
13
11
  /** @unstable View assembly algorithm that converges memory layer outputs into the LLM context. */
14
- export { assembleView } from './memory/projector.js';
15
12
  /** @unstable Factory for creating scoped storage wrappers around a StorageAdapter. */
16
- export { createScopedStorage } from './memory/scope.js';
13
+ export { allocateBudgets, assembleView, checkBudget, createLayerStateStore, createScopedStorage, } from '@noetic-tools/memory';
14
+ /** @unstable Unsafe cast utility for bridging internal type boundaries. */
15
+ export { frameworkCast } from '@noetic-tools/types';
17
16
  /**
18
17
  * @unstable Internal helper used by sync agent-spawn paths (worktree isolation)
19
18
  * to seed a child's cwd snapshot without touching `previousCwd`. Not part of
20
19
  * the public surface — call sites must hold exclusive use of the parent ctx.
21
20
  */
22
21
  export { retargetCwdForSpawn } from './runtime/cwd-helpers.js';
23
- /** @unstable Unsafe cast utility for bridging internal type boundaries. */
24
- export { frameworkCast } from './util/framework-cast.js';
@@ -1,4 +1,4 @@
1
- import type { Until } from '../types/step.js';
1
+ import type { Until } from '@noetic-tools/types';
2
2
  /**
3
3
  * Combines predicates with OR semantics; stops the loop when any predicate says stop.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Until } from '../types/step.js';
1
+ import type { Until } from '@noetic-tools/types';
2
2
  /**
3
3
  * Termination predicate that never stops the loop. Use with `every`-like
4
4
  * forever-loops or with explicit cancellation paths.
@@ -1,6 +1,6 @@
1
+ import type { StorageAdapter } from '@noetic-tools/memory';
2
+ import type { Until } from '@noetic-tools/types';
1
3
  import type { EmbedFn } from '../types/embed.js';
2
- import type { StorageAdapter } from '../types/memory.js';
3
- import type { Until } from '../types/step.js';
4
4
  import { never } from './never.js';
5
5
  /** @public Async verification function that checks loop output and optionally returns feedback. */
6
6
  export type VerifyFn = (output: unknown) => Promise<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noetic-tools/core",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Step primitives, interpreter, runtime, and memory layer contract for Noetic agents.",
6
6
  "license": "Apache-2.0",
@@ -64,16 +64,18 @@
64
64
  }
65
65
  },
66
66
  "dependencies": {
67
+ "@noetic-tools/memory": "^0.2.0",
68
+ "@noetic-tools/types": "^0.2.0",
67
69
  "@openrouter/agent": "^0.6.0",
68
70
  "zod": "^4.0.0"
69
71
  },
70
72
  "scripts": {
71
73
  "build": "bunx tsc -p tsconfig.build.json && bun scripts/add-js-extensions.ts",
72
74
  "verify:esm": "bun scripts/verify-node-esm.ts",
73
- "prepublishOnly": "rm -rf dist && bun run build && bun run verify:esm",
75
+ "prepublishOnly": "rm -rf dist && bun run build && bun run verify:esm && bun scripts/pin-workspace-deps.ts",
74
76
  "test": "bun test",
75
- "test:coverage": "bun test --coverage --coverage-reporter=text --coverage-reporter=json",
76
- "test:ci": "bun test --coverage --coverage-reporter=json",
77
+ "test:coverage": "bun test --coverage --coverage-reporter=text --coverage-reporter=lcov",
78
+ "test:ci": "bun test --coverage --coverage-reporter=lcov",
77
79
  "typecheck": "bunx tsc --noEmit",
78
80
  "lint": "bunx biome check .",
79
81
  "lint:fix": "bunx biome check --fix .",
@@ -1,41 +0,0 @@
1
- /**
2
- * @public
3
- * Configuration-time error thrown during construction and setup.
4
- *
5
- * `NoeticConfigError` is separate from `NoeticError`. The two are never interchangeable:
6
- * - `NoeticError` — thrown during execution (LLM failures, fork failures, budget exceeded).
7
- * - `NoeticConfigError` — thrown during construction (invalid step config, missing env vars, runtime misconfiguration).
8
- *
9
- * @example
10
- * ```ts
11
- * try {
12
- * loop({ id: '', steps: [], until: until.maxSteps(10) });
13
- * } catch (e) {
14
- * if (isNoeticConfigError(e)) {
15
- * console.error(e.code, e.hint);
16
- * }
17
- * }
18
- * ```
19
- */
20
- export declare class NoeticConfigError extends Error {
21
- /** SCREAMING_SNAKE_CASE code uniquely identifying this error condition. */
22
- readonly code: string;
23
- /** Complete sentence describing what the user should do next. */
24
- readonly hint: string;
25
- /** Link to the relevant docs page, if available. */
26
- readonly docsUrl?: string;
27
- constructor(opts: {
28
- code: string;
29
- message: string;
30
- hint: string;
31
- docsUrl?: string;
32
- });
33
- }
34
- /**
35
- * @public
36
- * Type guard for `NoeticConfigError`.
37
- *
38
- * @param e - Value to check.
39
- * @returns `true` if `e` is a `NoeticConfigError`.
40
- */
41
- export declare function isNoeticConfigError(e: unknown): e is NoeticConfigError;
@@ -1,44 +0,0 @@
1
- /**
2
- * @public
3
- * Configuration-time error thrown during construction and setup.
4
- *
5
- * `NoeticConfigError` is separate from `NoeticError`. The two are never interchangeable:
6
- * - `NoeticError` — thrown during execution (LLM failures, fork failures, budget exceeded).
7
- * - `NoeticConfigError` — thrown during construction (invalid step config, missing env vars, runtime misconfiguration).
8
- *
9
- * @example
10
- * ```ts
11
- * try {
12
- * loop({ id: '', steps: [], until: until.maxSteps(10) });
13
- * } catch (e) {
14
- * if (isNoeticConfigError(e)) {
15
- * console.error(e.code, e.hint);
16
- * }
17
- * }
18
- * ```
19
- */
20
- export class NoeticConfigError extends Error {
21
- /** SCREAMING_SNAKE_CASE code uniquely identifying this error condition. */
22
- code;
23
- /** Complete sentence describing what the user should do next. */
24
- hint;
25
- /** Link to the relevant docs page, if available. */
26
- docsUrl;
27
- constructor(opts) {
28
- super(opts.message);
29
- this.name = 'NoeticConfigError';
30
- this.code = opts.code;
31
- this.hint = opts.hint;
32
- this.docsUrl = opts.docsUrl;
33
- }
34
- }
35
- /**
36
- * @public
37
- * Type guard for `NoeticConfigError`.
38
- *
39
- * @param e - Value to check.
40
- * @returns `true` if `e` is a `NoeticConfigError`.
41
- */
42
- export function isNoeticConfigError(e) {
43
- return e instanceof NoeticConfigError;
44
- }