@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.
- package/dist/adapters/in-memory-fs-adapter.d.ts +1 -1
- package/dist/adapters/in-memory-fs-adapter.js +1 -1
- package/dist/adapters/in-memory-shell-adapter.d.ts +1 -1
- package/dist/adapters/in-memory-subprocess/manifest-persistence.d.ts +2 -2
- package/dist/adapters/in-memory-subprocess/metadata.d.ts +1 -1
- package/dist/adapters/in-memory-subprocess/types.d.ts +2 -2
- package/dist/adapters/in-memory-subprocess-adapter.d.ts +1 -1
- package/dist/adapters/openrouter.d.ts +2 -6
- package/dist/adapters/openrouter.js +1 -4
- package/dist/builders/channel-builder.d.ts +1 -1
- package/dist/builders/control-flow-builders.d.ts +2 -3
- package/dist/builders/control-flow-builders.js +1 -2
- package/dist/builders/every.d.ts +2 -3
- package/dist/builders/every.js +1 -1
- package/dist/builders/layer-provides-builders.d.ts +1 -1
- package/dist/builders/layer-provides-builders.js +1 -1
- package/dist/builders/loop-builder.d.ts +2 -2
- package/dist/builders/loop-builder.js +1 -1
- package/dist/builders/memory-builder.d.ts +1 -1
- package/dist/builders/memory-builder.js +1 -1
- package/dist/builders/provide-builder.d.ts +2 -2
- package/dist/builders/provide-builder.js +1 -1
- package/dist/builders/spawn-builder.d.ts +2 -3
- package/dist/builders/spawn-builder.js +1 -1
- package/dist/builders/step-builders.d.ts +2 -6
- package/dist/builders/step-builders.js +1 -1
- package/dist/builders/tool-builder.d.ts +1 -3
- package/dist/builders/tool-builder.js +1 -1
- package/dist/builders/workflow-hydrator.d.ts +2 -3
- package/dist/builders/workflow-hydrator.js +1 -2
- package/dist/conditions/conditions.d.ts +2 -3
- package/dist/conditions/conditions.js +1 -1
- package/dist/harness/agent-harness.d.ts +13 -3
- package/dist/harness/agent-harness.js +48 -5
- package/dist/harness/deps/memory.d.ts +2 -5
- package/dist/harness/deps/memory.js +1 -4
- package/dist/harness/deps/types.d.ts +3 -16
- package/dist/harness/deps/types.js +1 -1
- package/dist/harness/model-call.d.ts +1 -3
- package/dist/harness/model-call.js +1 -2
- package/dist/harness/model-schema.d.ts +2 -4
- package/dist/harness/model-schema.js +1 -1
- package/dist/index.d.ts +28 -49
- package/dist/index.js +9 -27
- package/dist/interpreter/action-deps.d.ts +4 -8
- package/dist/interpreter/action-deps.js +2 -6
- package/dist/interpreter/action-types.d.ts +3 -8
- package/dist/interpreter/action-types.js +1 -1
- package/dist/interpreter/collect-tools.d.ts +1 -2
- package/dist/interpreter/collect-tools.js +1 -1
- package/dist/interpreter/execute-action.js +104 -26
- package/dist/interpreter/execute-control.d.ts +1 -2
- package/dist/interpreter/execute-control.js +1 -3
- package/dist/interpreter/execute.d.ts +2 -3
- package/dist/interpreter/execute.js +1 -2
- package/dist/interpreter/message-helpers.d.ts +1 -1
- package/dist/interpreter/message-helpers.js +1 -1
- package/dist/interpreter/step-dispatcher.d.ts +2 -5
- package/dist/interpreter/typeguards.d.ts +3 -4
- package/dist/interpreter/typeguards.js +1 -1
- package/dist/observability/span-impl.d.ts +1 -1
- package/dist/observability/trace-exporter.d.ts +1 -1
- package/dist/patterns/dynamic-workflow.d.ts +2 -5
- package/dist/patterns/dynamic-workflow.js +1 -2
- package/dist/patterns/flow.d.ts +2 -2
- package/dist/patterns/flow.js +1 -1
- package/dist/patterns/interview.d.ts +2 -2
- package/dist/patterns/interview.js +1 -1
- package/dist/patterns/plans.d.ts +2 -3
- package/dist/patterns/plans.js +1 -1
- package/dist/patterns/ralph-wiggum.d.ts +2 -3
- package/dist/patterns/react.d.ts +2 -3
- package/dist/portable/memory-layers.d.ts +1 -7
- package/dist/portable/memory-layers.js +1 -7
- package/dist/portable.d.ts +2 -2
- package/dist/portable.js +2 -2
- package/dist/runtime/broadcaster-utils.d.ts +1 -1
- package/dist/runtime/channel-store.d.ts +1 -1
- package/dist/runtime/channel-store.js +1 -2
- package/dist/runtime/context-deps.d.ts +3 -3
- package/dist/runtime/context-deps.js +2 -2
- package/dist/runtime/context-type-deps.d.ts +2 -11
- package/dist/runtime/cwd-helpers.d.ts +1 -1
- package/dist/runtime/detached-handle.d.ts +2 -3
- package/dist/runtime/detached-handle.js +1 -3
- package/dist/runtime/durable/checkpoint-store.d.ts +1 -1
- package/dist/runtime/durable/checkpoint-store.js +1 -1
- package/dist/runtime/durable/harness-checkpoints.d.ts +2 -5
- package/dist/runtime/durable/runnable-loop.d.ts +1 -3
- package/dist/runtime/durable/session-seed.d.ts +1 -1
- package/dist/runtime/durable/stall-nudge.d.ts +1 -1
- package/dist/runtime/event-broadcaster.d.ts +1 -1
- package/dist/runtime/in-memory-storage.d.ts +1 -1
- package/dist/runtime/in-memory-storage.js +1 -1
- package/dist/runtime/item-log-impl.d.ts +1 -3
- package/dist/runtime/item-log-impl.js +1 -1
- package/dist/runtime/message-queue.d.ts +1 -2
- package/dist/runtime/session-runner.d.ts +1 -4
- package/dist/runtime/session-streams.d.ts +1 -2
- package/dist/runtime/session-streams.js +1 -1
- package/dist/runtime/step-registry.d.ts +2 -2
- package/dist/runtime/step-registry.js +1 -2
- package/dist/runtime/tool-memory.d.ts +1 -3
- package/dist/types/mutable-context.d.ts +2 -3
- package/dist/types/step-registrar.d.ts +1 -1
- package/dist/unstable.d.ts +5 -9
- package/dist/unstable.js +3 -6
- package/dist/until/combinators.d.ts +1 -1
- package/dist/until/never.d.ts +1 -1
- package/dist/until/predicates.d.ts +2 -2
- package/package.json +6 -4
- package/dist/errors/noetic-config-error.d.ts +0 -41
- package/dist/errors/noetic-config-error.js +0 -44
- package/dist/errors/noetic-error.d.ts +0 -18
- package/dist/errors/noetic-error.js +0 -54
- package/dist/memory/budget.d.ts +0 -23
- package/dist/memory/budget.js +0 -117
- package/dist/memory/exec-context-factory.d.ts +0 -25
- package/dist/memory/exec-context-factory.js +0 -30
- package/dist/memory/flow-schema.d.ts +0 -52
- package/dist/memory/flow-schema.js +0 -102
- package/dist/memory/function-call-utils.d.ts +0 -6
- package/dist/memory/function-call-utils.js +0 -27
- package/dist/memory/layer-api.d.ts +0 -14
- package/dist/memory/layer-api.js +0 -91
- package/dist/memory/layer-lifecycle.d.ts +0 -160
- package/dist/memory/layer-lifecycle.js +0 -552
- package/dist/memory/layer-provides.d.ts +0 -32
- package/dist/memory/layer-provides.js +0 -33
- package/dist/memory/layer-usage.d.ts +0 -16
- package/dist/memory/layer-usage.js +0 -54
- package/dist/memory/layers/durable-task-state.d.ts +0 -79
- package/dist/memory/layers/durable-task-state.js +0 -118
- package/dist/memory/layers/file-reference.d.ts +0 -55
- package/dist/memory/layers/file-reference.js +0 -594
- package/dist/memory/layers/history-window.d.ts +0 -29
- package/dist/memory/layers/history-window.js +0 -114
- package/dist/memory/layers/observational-memory.d.ts +0 -53
- package/dist/memory/layers/observational-memory.js +0 -109
- package/dist/memory/layers/plan.d.ts +0 -55
- package/dist/memory/layers/plan.js +0 -374
- package/dist/memory/layers/static-content.d.ts +0 -27
- package/dist/memory/layers/static-content.js +0 -35
- package/dist/memory/layers/steering.d.ts +0 -51
- package/dist/memory/layers/steering.js +0 -258
- package/dist/memory/layers/temporal.d.ts +0 -91
- package/dist/memory/layers/temporal.js +0 -245
- package/dist/memory/layers/tool-memory-layer.d.ts +0 -16
- package/dist/memory/layers/tool-memory-layer.js +0 -43
- package/dist/memory/layers/working-memory.d.ts +0 -44
- package/dist/memory/layers/working-memory.js +0 -92
- package/dist/memory/projector.d.ts +0 -10
- package/dist/memory/projector.js +0 -19
- package/dist/memory/scope.d.ts +0 -3
- package/dist/memory/scope.js +0 -31
- package/dist/memory/strip-unresolved.d.ts +0 -13
- package/dist/memory/strip-unresolved.js +0 -35
- package/dist/schemas/item.d.ts +0 -35
- package/dist/schemas/item.js +0 -155
- package/dist/types/channel.d.ts +0 -29
- package/dist/types/channel.js +0 -1
- package/dist/types/common.d.ts +0 -68
- package/dist/types/common.js +0 -1
- package/dist/types/context-parts/item-log.d.ts +0 -6
- package/dist/types/context-parts/item-log.js +0 -1
- package/dist/types/context-parts/layer-usage.d.ts +0 -18
- package/dist/types/context-parts/layer-usage.js +0 -1
- package/dist/types/context.d.ts +0 -202
- package/dist/types/context.js +0 -1
- package/dist/types/detached.d.ts +0 -17
- package/dist/types/detached.js +0 -7
- package/dist/types/error.d.ts +0 -66
- package/dist/types/error.js +0 -1
- package/dist/types/fs-adapter.d.ts +0 -51
- package/dist/types/fs-adapter.js +0 -3
- package/dist/types/harness-result.d.ts +0 -43
- package/dist/types/harness-result.js +0 -2
- package/dist/types/items.d.ts +0 -131
- package/dist/types/items.js +0 -2
- package/dist/types/memory-context.d.ts +0 -39
- package/dist/types/memory-context.js +0 -1
- package/dist/types/memory.d.ts +0 -306
- package/dist/types/memory.js +0 -13
- package/dist/types/observability.d.ts +0 -30
- package/dist/types/observability.js +0 -1
- package/dist/types/runtime.d.ts +0 -256
- package/dist/types/runtime.js +0 -1
- package/dist/types/shell-adapter.d.ts +0 -34
- package/dist/types/shell-adapter.js +0 -10
- package/dist/types/steering.d.ts +0 -89
- package/dist/types/steering.js +0 -14
- package/dist/types/step.d.ts +0 -231
- package/dist/types/step.js +0 -1
- package/dist/types/subprocess-adapter.d.ts +0 -157
- package/dist/types/subprocess-adapter.js +0 -3
- package/dist/types/tool-context.d.ts +0 -34
- package/dist/types/tool-context.js +0 -1
- package/dist/types/tool.d.ts +0 -64
- package/dist/types/tool.js +0 -1
- package/dist/util/framework-cast.d.ts +0 -10
- package/dist/util/framework-cast.js +0 -16
- package/dist/util/message-helpers.d.ts +0 -17
- 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;
|
package/dist/patterns/flow.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { FlowNode, ForkFlowNode, LlmFlowNode, SequenceFlowNode, SpawnFlowNode, SubagentFlowNode, } from '
|
|
2
|
-
export { FlowSchema, flowDepth, validateFlow, walkFlow } from '
|
|
1
|
+
export type { FlowNode, ForkFlowNode, LlmFlowNode, SequenceFlowNode, SpawnFlowNode, SubagentFlowNode, } from '@noetic-tools/memory';
|
|
2
|
+
export { FlowSchema, flowDepth, validateFlow, walkFlow } from '@noetic-tools/memory';
|
package/dist/patterns/flow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FlowSchema, flowDepth, validateFlow, walkFlow } from '
|
|
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;
|
package/dist/patterns/plans.d.ts
CHANGED
|
@@ -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;
|
package/dist/patterns/plans.js
CHANGED
|
@@ -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 '
|
|
2
|
-
import type { StepLoop } from '
|
|
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
|
package/dist/patterns/react.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { ContextMemory, MemoryConfig, MemoryLayer } from '
|
|
2
|
-
import type { StepLoop, StepSpawn } from '
|
|
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 '
|
|
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 '
|
|
8
|
+
export { durableTaskState, historyWindow, observationalMemory, planMemory, temporalMemory, toolMemoryLayer, workingMemory, } from '@noetic-tools/memory';
|
package/dist/portable.d.ts
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';
|
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 '
|
|
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,5 +1,4 @@
|
|
|
1
|
-
import { NoeticErrorImpl } from '
|
|
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 '
|
|
2
|
-
export type { ItemSchemaRegistry } from '
|
|
3
|
-
export { defaultItemSchemaRegistry } from '
|
|
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 '
|
|
2
|
-
export { defaultItemSchemaRegistry } from '
|
|
1
|
+
export { buildContextMemory } from '@noetic-tools/memory';
|
|
2
|
+
export { defaultItemSchemaRegistry } from '@noetic-tools/types';
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
export type {
|
|
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 '
|
|
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 '
|
|
2
|
-
import { DetachedStatus } from '
|
|
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 '
|
|
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,8 +1,5 @@
|
|
|
1
|
-
import type { LayerStateStore } from '
|
|
2
|
-
import type { ItemSchemaRegistry } from '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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,6 +1,4 @@
|
|
|
1
|
-
import type { ItemSchemaRegistry } from '
|
|
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,5 +1,4 @@
|
|
|
1
|
-
import type { ExecuteInput } from '
|
|
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 '
|
|
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 '
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import type { ContextMemory } from '
|
|
2
|
-
import type { Step } from '
|
|
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 '
|
|
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 {
|
|
2
|
-
import type { Context } from '
|
|
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 '
|
|
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
|
package/dist/unstable.d.ts
CHANGED
|
@@ -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 '
|
|
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 '
|
|
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 '
|
|
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';
|
package/dist/until/never.d.ts
CHANGED
|
@@ -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.
|
|
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=
|
|
76
|
-
"test:ci": "bun test --coverage --coverage-reporter=
|
|
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
|
-
}
|