@noetic-tools/core 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -11
- 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 +3 -3
- package/dist/adapters/in-memory-subprocess/manifest-persistence.js +1 -1
- package/dist/adapters/in-memory-subprocess/metadata.d.ts +1 -1
- package/dist/adapters/in-memory-subprocess/step-completion.d.ts +1 -1
- package/dist/adapters/in-memory-subprocess/step-completion.js +1 -1
- package/dist/adapters/in-memory-subprocess/types.d.ts +2 -2
- package/dist/adapters/in-memory-subprocess-adapter.d.ts +3 -3
- package/dist/adapters/in-memory-subprocess-adapter.js +3 -3
- package/dist/adapters/openrouter.d.ts +7 -7
- package/dist/adapters/openrouter.js +5 -5
- package/dist/builders/channel-builder.d.ts +1 -1
- package/dist/builders/control-flow-builders.d.ts +3 -3
- package/dist/builders/control-flow-builders.js +3 -3
- package/dist/builders/every.d.ts +3 -3
- package/dist/builders/every.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/builders/spawn-builder.d.ts +3 -3
- package/dist/builders/spawn-builder.js +2 -2
- package/dist/builders/step-builders.d.ts +6 -6
- package/dist/builders/step-builders.js +2 -2
- package/dist/builders/tool-builder.d.ts +3 -3
- package/dist/builders/tool-builder.js +1 -1
- package/dist/builders/workflow-hydrator.d.ts +4 -4
- package/dist/builders/workflow-hydrator.js +10 -10
- package/dist/conditions/conditions.d.ts +4 -4
- package/dist/conditions/conditions.js +2 -2
- package/dist/errors/noetic-error.d.ts +1 -1
- package/dist/harness/agent-harness.d.ts +6 -6
- package/dist/harness/agent-harness.js +13 -13
- package/dist/harness/deps/adapters.d.ts +3 -3
- package/dist/harness/deps/adapters.js +3 -3
- package/dist/harness/deps/interpreter.d.ts +5 -5
- package/dist/harness/deps/interpreter.js +4 -4
- package/dist/harness/deps/memory.d.ts +5 -5
- package/dist/harness/deps/memory.js +4 -4
- package/dist/harness/deps/runtime.d.ts +10 -10
- package/dist/harness/deps/runtime.js +7 -7
- package/dist/harness/deps/types.d.ts +16 -16
- package/dist/harness/deps/types.js +1 -1
- package/dist/harness/model-call.d.ts +4 -4
- package/dist/harness/model-call.js +5 -5
- package/dist/harness/model-schema.d.ts +4 -4
- package/dist/harness/model-schema.js +1 -1
- package/dist/harness/step-bootstrap.js +2 -2
- package/dist/index.d.ts +96 -94
- package/dist/index.js +57 -55
- package/dist/internal-test.d.ts +4 -4
- package/dist/internal-test.js +4 -4
- package/dist/interpreter/action-deps.d.ts +12 -12
- package/dist/interpreter/action-deps.js +10 -10
- package/dist/interpreter/action-types.d.ts +8 -8
- package/dist/interpreter/action-types.js +1 -1
- package/dist/interpreter/collect-tools.d.ts +2 -2
- package/dist/interpreter/collect-tools.js +1 -1
- package/dist/interpreter/execute-action.d.ts +2 -2
- package/dist/interpreter/execute-action.js +10 -10
- package/dist/interpreter/execute-control.d.ts +2 -2
- package/dist/interpreter/execute-control.js +7 -7
- package/dist/interpreter/execute.d.ts +3 -3
- package/dist/interpreter/execute.js +8 -8
- package/dist/interpreter/message-helpers.d.ts +1 -1
- package/dist/interpreter/message-helpers.js +1 -1
- package/dist/interpreter/step-dispatcher.d.ts +5 -5
- package/dist/interpreter/step-dispatcher.js +2 -2
- package/dist/interpreter/typeguards.d.ts +7 -7
- package/dist/interpreter/typeguards.js +2 -2
- package/dist/memory/budget.d.ts +2 -2
- package/dist/memory/budget.js +1 -1
- package/dist/memory/exec-context-factory.d.ts +2 -2
- package/dist/memory/exec-context-factory.js +1 -1
- package/dist/memory/function-call-utils.d.ts +1 -1
- package/dist/memory/function-call-utils.js +1 -1
- package/dist/memory/layer-api.d.ts +4 -4
- package/dist/memory/layer-api.js +2 -2
- package/dist/memory/layer-lifecycle.d.ts +6 -6
- package/dist/memory/layer-lifecycle.js +6 -6
- package/dist/memory/layer-provides.d.ts +1 -1
- package/dist/memory/layer-usage.d.ts +4 -4
- package/dist/memory/layer-usage.js +1 -1
- package/dist/memory/layers/durable-task-state.d.ts +8 -8
- package/dist/memory/layers/durable-task-state.js +2 -2
- package/dist/memory/layers/file-reference.d.ts +1 -1
- package/dist/memory/layers/file-reference.js +2 -2
- package/dist/memory/layers/history-window.d.ts +1 -1
- package/dist/memory/layers/history-window.js +4 -4
- package/dist/memory/layers/observational-memory.d.ts +5 -5
- package/dist/memory/layers/observational-memory.js +2 -2
- package/dist/memory/layers/plan.d.ts +2 -2
- package/dist/memory/layers/plan.js +5 -5
- package/dist/memory/layers/static-content.d.ts +2 -2
- package/dist/memory/layers/static-content.js +1 -1
- package/dist/memory/layers/steering.d.ts +7 -7
- package/dist/memory/layers/steering.js +5 -5
- package/dist/memory/layers/tool-memory-layer.d.ts +2 -2
- package/dist/memory/layers/tool-memory-layer.js +1 -1
- package/dist/memory/layers/working-memory.d.ts +7 -7
- package/dist/memory/layers/working-memory.js +4 -4
- package/dist/memory/projector.d.ts +2 -2
- package/dist/memory/scope.d.ts +1 -1
- package/dist/memory/strip-unresolved.d.ts +1 -1
- package/dist/observability/span-impl.d.ts +1 -1
- package/dist/observability/trace-exporter.d.ts +2 -2
- package/dist/observability/trace-exporter.js +1 -1
- package/dist/patterns/dynamic-workflow.d.ts +5 -5
- package/dist/patterns/dynamic-workflow.js +5 -5
- 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 +5 -5
- package/dist/patterns/plans.d.ts +3 -3
- package/dist/patterns/plans.js +2 -2
- package/dist/patterns/ralph-wiggum.d.ts +4 -4
- package/dist/patterns/ralph-wiggum.js +5 -5
- package/dist/patterns/react.d.ts +3 -3
- package/dist/patterns/react.js +5 -5
- package/dist/portable/adapters.d.ts +3 -3
- package/dist/portable/adapters.js +3 -3
- package/dist/portable/ask-user.d.ts +2 -2
- package/dist/portable/ask-user.js +1 -1
- package/dist/portable/builders.d.ts +6 -6
- package/dist/portable/builders.js +6 -6
- package/dist/portable/memory-layers.d.ts +6 -6
- package/dist/portable/memory-layers.js +6 -6
- package/dist/portable/runtime.d.ts +2 -2
- package/dist/portable/runtime.js +2 -2
- package/dist/portable/until.d.ts +2 -2
- package/dist/portable/until.js +2 -2
- package/dist/portable.d.ts +7 -7
- package/dist/portable.js +7 -7
- package/dist/runtime/broadcaster-utils.d.ts +2 -2
- package/dist/runtime/channel-store.d.ts +1 -1
- package/dist/runtime/channel-store.js +2 -2
- package/dist/runtime/context-deps.d.ts +4 -4
- package/dist/runtime/context-deps.js +2 -2
- package/dist/runtime/context-impl.d.ts +1 -1
- package/dist/runtime/context-impl.js +2 -2
- package/dist/runtime/context-type-deps.d.ts +14 -14
- package/dist/runtime/cwd-helpers.d.ts +1 -1
- package/dist/runtime/detached-handle.d.ts +3 -3
- package/dist/runtime/detached-handle.js +3 -3
- package/dist/runtime/durable/checkpoint-store.d.ts +2 -2
- package/dist/runtime/durable/checkpoint-store.js +2 -2
- package/dist/runtime/durable/harness-checkpoints.d.ts +6 -6
- package/dist/runtime/durable/harness-checkpoints.js +2 -2
- package/dist/runtime/durable/index.d.ts +10 -10
- package/dist/runtime/durable/index.js +5 -5
- package/dist/runtime/durable/runnable-loop.d.ts +4 -4
- package/dist/runtime/durable/session-seed.d.ts +1 -1
- package/dist/runtime/durable/stall-nudge.d.ts +3 -3
- 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 +3 -3
- package/dist/runtime/item-log-impl.js +1 -1
- package/dist/runtime/message-queue.d.ts +2 -2
- package/dist/runtime/session-runner.d.ts +7 -7
- package/dist/runtime/session-runner.js +3 -3
- package/dist/runtime/session-streams.d.ts +3 -3
- package/dist/runtime/session-streams.js +1 -1
- package/dist/runtime/step-registry.d.ts +2 -2
- package/dist/runtime/step-registry.js +3 -3
- package/dist/runtime/tool-memory.d.ts +3 -3
- package/dist/schemas/item.d.ts +1 -1
- package/dist/types/common.d.ts +1 -1
- package/dist/types/context-parts/item-log.d.ts +1 -1
- package/dist/types/context-parts/layer-usage.d.ts +1 -1
- package/dist/types/context.d.ts +23 -23
- package/dist/types/harness-result.d.ts +2 -2
- package/dist/types/memory-context.d.ts +4 -4
- package/dist/types/memory.d.ts +6 -6
- package/dist/types/mutable-context.d.ts +3 -3
- package/dist/types/runtime.d.ts +14 -14
- package/dist/types/steering.d.ts +2 -2
- package/dist/types/step-registrar.d.ts +1 -1
- package/dist/types/step.d.ts +7 -7
- package/dist/types/tool-context.d.ts +6 -6
- package/dist/types/tool.d.ts +1 -1
- package/dist/unstable.d.ts +8 -8
- package/dist/unstable.js +6 -6
- package/dist/until/combinators.d.ts +1 -1
- package/dist/until/never.d.ts +1 -1
- package/dist/until/predicates.d.ts +4 -4
- package/dist/until/predicates.js +2 -2
- package/dist/util/message-helpers.d.ts +3 -3
- package/package.json +6 -4
- package/dist/conditions/index.d.ts +0 -3
- package/dist/conditions/index.js +0 -2
|
@@ -37,21 +37,21 @@ export declare function durableTaskState(_config?: DurableTaskStateConfig): {
|
|
|
37
37
|
store: number;
|
|
38
38
|
};
|
|
39
39
|
hooks: {
|
|
40
|
-
init({ storage }: import("
|
|
40
|
+
init({ storage }: import("../../index.js").InitParams): Promise<{
|
|
41
41
|
state: DurableTaskState;
|
|
42
42
|
}>;
|
|
43
|
-
recall({ state }: import("
|
|
44
|
-
items: import("
|
|
43
|
+
recall({ state }: import("../../index.js").RecallParams<DurableTaskState>): Promise<{
|
|
44
|
+
items: import("../../index.js").InputMessageItem[];
|
|
45
45
|
tokenCount: number;
|
|
46
46
|
} | null>;
|
|
47
|
-
store({ state, ctx }: import("
|
|
47
|
+
store({ state, ctx }: import("../../index.js").StoreParams<DurableTaskState>): Promise<{
|
|
48
48
|
state: DurableTaskState;
|
|
49
49
|
}>;
|
|
50
|
-
onSpawn({ parentState }: import("
|
|
50
|
+
onSpawn({ parentState }: import("../../index.js").SpawnParams<DurableTaskState>): Promise<{
|
|
51
51
|
childState: DurableTaskState;
|
|
52
52
|
items: never[];
|
|
53
53
|
}>;
|
|
54
|
-
onReturn({ childState, parentState }: import("
|
|
54
|
+
onReturn({ childState, parentState }: import("../../index.js").ReturnParams<DurableTaskState>): Promise<{
|
|
55
55
|
parentState: {
|
|
56
56
|
checkpoints: {
|
|
57
57
|
timestamp: number;
|
|
@@ -63,10 +63,10 @@ export declare function durableTaskState(_config?: DurableTaskStateConfig): {
|
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
}>;
|
|
66
|
-
onComplete({ state, outcome }: import("
|
|
66
|
+
onComplete({ state, outcome }: import("../../index.js").CompleteParams<DurableTaskState>): Promise<{
|
|
67
67
|
state: {
|
|
68
68
|
data: {
|
|
69
|
-
__outcome: import("
|
|
69
|
+
__outcome: import("../../index.js").ExecutionOutcome;
|
|
70
70
|
};
|
|
71
71
|
checkpoints: {
|
|
72
72
|
timestamp: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Slot } from '../../types/memory';
|
|
2
|
-
import { createMessage, estimateTokens } from '../../util/message-helpers';
|
|
1
|
+
import { Slot } from '../../types/memory.js';
|
|
2
|
+
import { createMessage, estimateTokens } from '../../util/message-helpers.js';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a memory layer that persists task checkpoints, files, and arbitrary data across iterations.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Slot } from '../../types/memory';
|
|
2
|
-
import { createMessage, estimateTokens } from '../../util/message-helpers';
|
|
1
|
+
import { Slot } from '../../types/memory.js';
|
|
2
|
+
import { createMessage, estimateTokens } from '../../util/message-helpers.js';
|
|
3
3
|
/** Default max file size: 1MB */
|
|
4
4
|
const DEFAULT_MAX_FILE_SIZE = 1024 * 1024;
|
|
5
5
|
/** Default allowed extensions */
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* 3. Drop any orphan `function_call` / `function_call_output` left at the
|
|
13
13
|
* slice boundary via `stripUnresolvedToolCalls`.
|
|
14
14
|
*/
|
|
15
|
-
import type { MemoryLayer } from '../../types/memory';
|
|
15
|
+
import type { MemoryLayer } from '../../types/memory.js';
|
|
16
16
|
/** @public Configuration for the {@link historyWindow} layer. */
|
|
17
17
|
export interface HistoryWindowConfig {
|
|
18
18
|
/** Cap on the number of trailing items projected to the LLM. Defaults to 40. */
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
* 3. Drop any orphan `function_call` / `function_call_output` left at the
|
|
13
13
|
* slice boundary via `stripUnresolvedToolCalls`.
|
|
14
14
|
*/
|
|
15
|
-
import { NoeticConfigError } from '../../errors/noetic-config-error';
|
|
16
|
-
import { Slot } from '../../types/memory';
|
|
17
|
-
import { isAssistantMessage, isUserMessage } from '../../util/message-helpers';
|
|
18
|
-
import { stripUnresolvedToolCalls } from '../strip-unresolved';
|
|
15
|
+
import { NoeticConfigError } from '../../errors/noetic-config-error.js';
|
|
16
|
+
import { Slot } from '../../types/memory.js';
|
|
17
|
+
import { isAssistantMessage, isUserMessage } from '../../util/message-helpers.js';
|
|
18
|
+
import { stripUnresolvedToolCalls } from '../strip-unresolved.js';
|
|
19
19
|
//#region Constants
|
|
20
20
|
const DEFAULT_MAX_ITEMS = 40;
|
|
21
21
|
const MIN_MAX_ITEMS = 2;
|
|
@@ -31,14 +31,14 @@ export declare function observationalMemory(config?: ObservationalMemoryConfig):
|
|
|
31
31
|
store: number;
|
|
32
32
|
};
|
|
33
33
|
hooks: {
|
|
34
|
-
init({ storage }: import("
|
|
34
|
+
init({ storage }: import("../../index.js").InitParams): Promise<{
|
|
35
35
|
state: ObservationalState;
|
|
36
36
|
}>;
|
|
37
|
-
recall({ state }: import("
|
|
38
|
-
items: import("
|
|
37
|
+
recall({ state }: import("../../index.js").RecallParams<ObservationalState>): Promise<{
|
|
38
|
+
items: import("../../index.js").InputMessageItem[];
|
|
39
39
|
tokenCount: number;
|
|
40
40
|
} | null>;
|
|
41
|
-
store({ newItems, state }: import("
|
|
41
|
+
store({ newItems, state }: import("../../index.js").StoreParams<ObservationalState>): Promise<{
|
|
42
42
|
state: {
|
|
43
43
|
buffer: string[];
|
|
44
44
|
bufferTokens: number;
|
|
@@ -46,7 +46,7 @@ export declare function observationalMemory(config?: ObservationalMemoryConfig):
|
|
|
46
46
|
version: number;
|
|
47
47
|
};
|
|
48
48
|
}>;
|
|
49
|
-
onSpawn({ parentState }: import("
|
|
49
|
+
onSpawn({ parentState }: import("../../index.js").SpawnParams<ObservationalState>): Promise<{
|
|
50
50
|
childState: ObservationalState;
|
|
51
51
|
}>;
|
|
52
52
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Slot } from '../../types/memory';
|
|
2
|
-
import { createMessage, estimateTokens, isOutputText } from '../../util/message-helpers';
|
|
1
|
+
import { Slot } from '../../types/memory.js';
|
|
2
|
+
import { createMessage, estimateTokens, isOutputText } from '../../util/message-helpers.js';
|
|
3
3
|
const DEFAULT_BUFFER_THRESHOLD_TOKENS = 2_000;
|
|
4
4
|
const DEFAULT_MAX_OBSERVATIONS = 50;
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MemoryLayer, MemoryScope } from '../../types/memory';
|
|
2
|
-
import type { FlowNode } from '../flow-schema';
|
|
1
|
+
import type { MemoryLayer, MemoryScope } from '../../types/memory.js';
|
|
2
|
+
import type { FlowNode } from '../flow-schema.js';
|
|
3
3
|
export declare const PlanPhase: {
|
|
4
4
|
readonly Idle: "idle";
|
|
5
5
|
readonly Planning: "planning";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Slot } from '../../types/memory';
|
|
3
|
-
import { SteeringAction } from '../../types/steering';
|
|
4
|
-
import { createMessage, estimateTokens } from '../../util/message-helpers';
|
|
5
|
-
import { FlowSchema, flowDepth } from '../flow-schema';
|
|
6
|
-
import { layerData, layerFn } from '../layer-provides';
|
|
2
|
+
import { Slot } from '../../types/memory.js';
|
|
3
|
+
import { SteeringAction } from '../../types/steering.js';
|
|
4
|
+
import { createMessage, estimateTokens } from '../../util/message-helpers.js';
|
|
5
|
+
import { FlowSchema, flowDepth } from '../flow-schema.js';
|
|
6
|
+
import { layerData, layerFn } from '../layer-provides.js';
|
|
7
7
|
//#region Constants
|
|
8
8
|
const MAX_PRD_LENGTH = 5e4;
|
|
9
9
|
const MAX_TREE_DEPTH = 5;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MemoryScope } from '../../types/memory';
|
|
1
|
+
import type { MemoryScope } from '../../types/memory.js';
|
|
2
2
|
interface StaticContentOpts {
|
|
3
3
|
id?: string;
|
|
4
4
|
slot?: number;
|
|
@@ -21,7 +21,7 @@ export declare function staticContent(opts: StaticContentOpts): {
|
|
|
21
21
|
init(): Promise<{
|
|
22
22
|
state: string;
|
|
23
23
|
}>;
|
|
24
|
-
recall({ state }: import("
|
|
24
|
+
recall({ state }: import("../../index.js").RecallParams<string>): Promise<string | null>;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MemoryScope } from '../../types/memory';
|
|
2
|
-
import type { AfterModelCallParams, BeforeToolCallParams, LedgerEntry, SteeringConfig, SteeringDecision, SteeringState } from '../../types/steering';
|
|
1
|
+
import type { MemoryScope } from '../../types/memory.js';
|
|
2
|
+
import type { AfterModelCallParams, BeforeToolCallParams, LedgerEntry, SteeringConfig, SteeringDecision, SteeringState } from '../../types/steering.js';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a steering memory layer that evaluates rules before tool calls and after model calls.
|
|
5
5
|
*
|
|
@@ -21,11 +21,11 @@ export declare function steering(config: SteeringConfig): {
|
|
|
21
21
|
afterModelCall: number;
|
|
22
22
|
};
|
|
23
23
|
hooks: {
|
|
24
|
-
init({ storage }: import("
|
|
24
|
+
init({ storage }: import("../../index.js").InitParams): Promise<{
|
|
25
25
|
state: SteeringState;
|
|
26
26
|
}>;
|
|
27
|
-
recall({ state }: import("
|
|
28
|
-
items: import("
|
|
27
|
+
recall({ state }: import("../../index.js").RecallParams<SteeringState>): Promise<{
|
|
28
|
+
items: import("../../index.js").InputMessageItem[];
|
|
29
29
|
tokenCount: number;
|
|
30
30
|
state: SteeringState;
|
|
31
31
|
} | null>;
|
|
@@ -38,13 +38,13 @@ export declare function steering(config: SteeringConfig): {
|
|
|
38
38
|
decision: SteeringDecision;
|
|
39
39
|
state: SteeringState;
|
|
40
40
|
}>;
|
|
41
|
-
onSpawn({ parentState }: import("
|
|
41
|
+
onSpawn({ parentState }: import("../../index.js").SpawnParams<SteeringState>): Promise<{
|
|
42
42
|
childState: {
|
|
43
43
|
ledger: LedgerEntry[];
|
|
44
44
|
pendingAsync: never[];
|
|
45
45
|
};
|
|
46
46
|
}>;
|
|
47
|
-
onComplete({ state, outcome }: import("
|
|
47
|
+
onComplete({ state, outcome }: import("../../index.js").CompleteParams<SteeringState>): Promise<{
|
|
48
48
|
state: SteeringState;
|
|
49
49
|
}>;
|
|
50
50
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { NoeticConfigError } from '../../errors/noetic-config-error';
|
|
2
|
-
import { Slot } from '../../types/memory';
|
|
3
|
-
import { LedgerEntryKind, SteeringAction } from '../../types/steering';
|
|
4
|
-
import { createMessage, estimateTokens, extractAssistantText } from '../../util/message-helpers';
|
|
5
|
-
import { mostRestrictive } from '../layer-lifecycle';
|
|
1
|
+
import { NoeticConfigError } from '../../errors/noetic-config-error.js';
|
|
2
|
+
import { Slot } from '../../types/memory.js';
|
|
3
|
+
import { LedgerEntryKind, SteeringAction } from '../../types/steering.js';
|
|
4
|
+
import { createMessage, estimateTokens, extractAssistantText } from '../../util/message-helpers.js';
|
|
5
|
+
import { mostRestrictive } from '../layer-lifecycle.js';
|
|
6
6
|
//#region Constants
|
|
7
7
|
const DEFAULT_MAX_LEDGER_ENTRIES = 100;
|
|
8
8
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MemoryLayer } from '../../types/memory';
|
|
2
|
-
import type { Tool } from '../../types/tool';
|
|
1
|
+
import type { MemoryLayer } from '../../types/memory.js';
|
|
2
|
+
import type { Tool } from '../../types/tool.js';
|
|
3
3
|
interface ToolMemoryLayerOpts {
|
|
4
4
|
slot?: number;
|
|
5
5
|
}
|
|
@@ -23,21 +23,21 @@ export declare function workingMemory(config?: WorkingMemoryConfig): {
|
|
|
23
23
|
max: number;
|
|
24
24
|
};
|
|
25
25
|
provides: {
|
|
26
|
-
snapshot: import("
|
|
27
|
-
update: import("
|
|
26
|
+
snapshot: import("../../index.js").LayerDataDecl<WorkingMemoryState, WorkingMemoryState>;
|
|
27
|
+
update: import("../../index.js").LayerFunctionDecl<Record<string, unknown>, void, WorkingMemoryState>;
|
|
28
28
|
};
|
|
29
29
|
hooks: {
|
|
30
|
-
init({ storage }: import("
|
|
30
|
+
init({ storage }: import("../../index.js").InitParams): Promise<{
|
|
31
31
|
state: WorkingMemoryState;
|
|
32
32
|
}>;
|
|
33
|
-
recall({ state }: import("
|
|
34
|
-
items: import("
|
|
33
|
+
recall({ state }: import("../../index.js").RecallParams<WorkingMemoryState>): Promise<{
|
|
34
|
+
items: import("../../index.js").InputMessageItem[];
|
|
35
35
|
tokenCount: number;
|
|
36
36
|
} | null>;
|
|
37
|
-
store({ newItems, state }: import("
|
|
37
|
+
store({ newItems, state }: import("../../index.js").StoreParams<WorkingMemoryState>): Promise<{
|
|
38
38
|
state: WorkingMemoryState;
|
|
39
39
|
} | undefined>;
|
|
40
|
-
onSpawn({ parentState }: import("
|
|
40
|
+
onSpawn({ parentState }: import("../../index.js").SpawnParams<WorkingMemoryState>): Promise<{
|
|
41
41
|
childState: WorkingMemoryState;
|
|
42
42
|
} | null>;
|
|
43
43
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Slot } from '../../types/memory';
|
|
3
|
-
import { createMessage, estimateTokens } from '../../util/message-helpers';
|
|
4
|
-
import { findFunctionCall } from '../function-call-utils';
|
|
5
|
-
import { layerData, layerFn } from '../layer-provides';
|
|
2
|
+
import { Slot } from '../../types/memory.js';
|
|
3
|
+
import { createMessage, estimateTokens } from '../../util/message-helpers.js';
|
|
4
|
+
import { findFunctionCall } from '../function-call-utils.js';
|
|
5
|
+
import { layerData, layerFn } from '../layer-provides.js';
|
|
6
6
|
function safeMerge(state, args) {
|
|
7
7
|
const { __proto__: _p, constructor: _c, ...safeArgs } = args;
|
|
8
8
|
if (typeof state === 'object' && state !== null) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Item } from '../types/items';
|
|
2
|
-
import type { ProjectionPolicy } from '../types/memory';
|
|
1
|
+
import type { Item } from '../types/items.js';
|
|
2
|
+
import type { ProjectionPolicy } from '../types/memory.js';
|
|
3
3
|
interface AssembleViewParams {
|
|
4
4
|
systemPromptItems: Item[];
|
|
5
5
|
layerOutputItems: Item[];
|
package/dist/memory/scope.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ExecutionContext, MemoryScope, ScopedStorage, StorageAdapter } from '../types/memory';
|
|
1
|
+
import type { ExecutionContext, MemoryScope, ScopedStorage, StorageAdapter } from '../types/memory.js';
|
|
2
2
|
export declare function resolveScopeKey(scope: MemoryScope, ctx: ExecutionContext): string;
|
|
3
3
|
export declare function createScopedStorage(storage: StorageAdapter, layerId: string, scopeKey: string): ScopedStorage;
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
* session-resume path to drop dangling pairs left by a crash, and by the
|
|
9
9
|
* `historyWindow` memory layer to clean orphans at the slice boundary.
|
|
10
10
|
*/
|
|
11
|
-
import type { Item } from '../types/items';
|
|
11
|
+
import type { Item } from '../types/items.js';
|
|
12
12
|
/** @public */
|
|
13
13
|
export declare function stripUnresolvedToolCalls(items: ReadonlyArray<Item>): Item[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Span, TraceExporter } from '../types/observability';
|
|
2
|
-
import { SpanImpl } from './span-impl';
|
|
1
|
+
import type { Span, TraceExporter } from '../types/observability.js';
|
|
2
|
+
import { SpanImpl } from './span-impl.js';
|
|
3
3
|
/** @public No-op trace exporter that silently discards all spans. */
|
|
4
4
|
export declare class NoopExporter implements TraceExporter {
|
|
5
5
|
export(_spans: Span[]): Promise<void>;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Pattern that lets an LLM generate a workflow as JSON during execution,
|
|
3
3
|
* then hydrates and runs it within the same harness session.
|
|
4
4
|
*/
|
|
5
|
-
import type { Context } from '../types/context';
|
|
6
|
-
import type { ContextMemory } from '../types/memory';
|
|
7
|
-
import type { AgentHarnessContract } from '../types/runtime';
|
|
8
|
-
import type { Step } from '../types/step';
|
|
9
|
-
import type { Tool } from '../types/tool';
|
|
5
|
+
import type { Context } from '../types/context.js';
|
|
6
|
+
import type { ContextMemory } from '../types/memory.js';
|
|
7
|
+
import type { AgentHarnessContract } from '../types/runtime.js';
|
|
8
|
+
import type { Step } from '../types/step.js';
|
|
9
|
+
import type { Tool } from '../types/tool.js';
|
|
10
10
|
/** @public Options for creating a dynamic workflow step. */
|
|
11
11
|
export interface DynamicWorkflowOpts {
|
|
12
12
|
model?: string;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Pattern that lets an LLM generate a workflow as JSON during execution,
|
|
3
3
|
* then hydrates and runs it within the same harness session.
|
|
4
4
|
*/
|
|
5
|
-
import { step } from '../builders/step-builders';
|
|
6
|
-
import { hydrateWorkflow } from '../builders/workflow-hydrator';
|
|
7
|
-
import { NoeticConfigError } from '../errors/noetic-config-error';
|
|
8
|
-
import { WorkflowDocumentSchema, workflowDepth } from '../schemas/workflow';
|
|
9
|
-
import { frameworkCast } from '../util/framework-cast';
|
|
5
|
+
import { step } from '../builders/step-builders.js';
|
|
6
|
+
import { hydrateWorkflow } from '../builders/workflow-hydrator.js';
|
|
7
|
+
import { NoeticConfigError } from '../errors/noetic-config-error.js';
|
|
8
|
+
import { WorkflowDocumentSchema, workflowDepth } from '../schemas/workflow.js';
|
|
9
|
+
import { frameworkCast } from '../util/framework-cast.js';
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region Constants
|
|
12
12
|
const DEFAULT_MAX_DEPTH = 5;
|
package/dist/patterns/flow.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { FlowNode, ForkFlowNode, LlmFlowNode, SequenceFlowNode, SpawnFlowNode, SubagentFlowNode, } from '../memory/flow-schema';
|
|
2
|
-
export { FlowSchema, flowDepth, validateFlow, walkFlow } from '../memory/flow-schema';
|
|
1
|
+
export type { FlowNode, ForkFlowNode, LlmFlowNode, SequenceFlowNode, SpawnFlowNode, SubagentFlowNode, } from '../memory/flow-schema.js';
|
|
2
|
+
export { FlowSchema, flowDepth, validateFlow, walkFlow } from '../memory/flow-schema.js';
|
package/dist/patterns/flow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FlowSchema, flowDepth, validateFlow, walkFlow } from '../memory/flow-schema';
|
|
1
|
+
export { FlowSchema, flowDepth, validateFlow, walkFlow } from '../memory/flow-schema.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType } from 'zod';
|
|
2
|
-
import type { ContextMemory } from '../types/memory';
|
|
3
|
-
import type { Step } from '../types/step';
|
|
2
|
+
import type { ContextMemory } from '../types/memory.js';
|
|
3
|
+
import type { Step } from '../types/step.js';
|
|
4
4
|
/** @public Answer captured by the host for a single interview question. */
|
|
5
5
|
export interface InterviewQuestionAnswer {
|
|
6
6
|
questionId: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { loop } from '../builders/loop-builder';
|
|
3
|
-
import { step } from '../builders/step-builders';
|
|
4
|
-
import { any } from '../until/combinators';
|
|
5
|
-
import { until } from '../until/predicates';
|
|
6
|
-
import { frameworkCast } from '../util/framework-cast';
|
|
2
|
+
import { loop } from '../builders/loop-builder.js';
|
|
3
|
+
import { step } from '../builders/step-builders.js';
|
|
4
|
+
import { any } from '../until/combinators.js';
|
|
5
|
+
import { until } from '../until/predicates.js';
|
|
6
|
+
import { frameworkCast } from '../util/framework-cast.js';
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region Helpers
|
|
9
9
|
const DEFAULT_MAX_QUESTIONS = 8;
|
package/dist/patterns/plans.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { Context } from '../types/context';
|
|
3
|
-
import type { ContextMemory } from '../types/memory';
|
|
4
|
-
import type { ExecuteStepFn, Step } from '../types/step';
|
|
2
|
+
import type { Context } from '../types/context.js';
|
|
3
|
+
import type { ContextMemory } from '../types/memory.js';
|
|
4
|
+
import type { ExecuteStepFn, Step } from '../types/step.js';
|
|
5
5
|
export interface PlanNode {
|
|
6
6
|
id: string;
|
|
7
7
|
description: string;
|
package/dist/patterns/plans.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { fork } from '../builders/control-flow-builders';
|
|
3
|
-
import { frameworkCast } from '../util/framework-cast';
|
|
2
|
+
import { fork } from '../builders/control-flow-builders.js';
|
|
3
|
+
import { frameworkCast } from '../util/framework-cast.js';
|
|
4
4
|
// PlanNode schema — the variable annotation provides the recursive type;
|
|
5
5
|
// z.lazy() returns a compatible type that TypeScript checks against it.
|
|
6
6
|
/** @public Zod schema for recursive `PlanNode` validation. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ContextMemory } from '../types/memory';
|
|
2
|
-
import type { StepLoop } from '../types/step';
|
|
3
|
-
import type { Tool } from '../types/tool';
|
|
4
|
-
import type { VerifyFn } from '../until/predicates';
|
|
1
|
+
import type { ContextMemory } from '../types/memory.js';
|
|
2
|
+
import type { StepLoop } from '../types/step.js';
|
|
3
|
+
import type { Tool } from '../types/tool.js';
|
|
4
|
+
import type { VerifyFn } from '../until/predicates.js';
|
|
5
5
|
/**
|
|
6
6
|
* Creates a retry-with-feedback loop wrapping a ReAct agent. Each iteration spawns an inner agent
|
|
7
7
|
* and retries with verification feedback until the verifier passes or max iterations is reached.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { loop } from '../builders/loop-builder';
|
|
2
|
-
import { spawn } from '../builders/spawn-builder';
|
|
3
|
-
import { any } from '../until/combinators';
|
|
4
|
-
import { until } from '../until/predicates';
|
|
5
|
-
import { react } from './react';
|
|
1
|
+
import { loop } from '../builders/loop-builder.js';
|
|
2
|
+
import { spawn } from '../builders/spawn-builder.js';
|
|
3
|
+
import { any } from '../until/combinators.js';
|
|
4
|
+
import { until } from '../until/predicates.js';
|
|
5
|
+
import { react } from './react.js';
|
|
6
6
|
/**
|
|
7
7
|
* Creates a retry-with-feedback loop wrapping a ReAct agent. Each iteration spawns an inner agent
|
|
8
8
|
* and retries with verification feedback until the verifier passes or max iterations is reached.
|
package/dist/patterns/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ContextMemory, MemoryConfig, MemoryLayer } from '../types/memory';
|
|
2
|
-
import type { StepLoop, StepSpawn } from '../types/step';
|
|
3
|
-
import type { Tool } from '../types/tool';
|
|
1
|
+
import type { ContextMemory, MemoryConfig, MemoryLayer } from '../types/memory.js';
|
|
2
|
+
import type { StepLoop, StepSpawn } from '../types/step.js';
|
|
3
|
+
import type { Tool } from '../types/tool.js';
|
|
4
4
|
/**
|
|
5
5
|
* Creates a ReAct (Reason + Act) agent loop: an LLM step with tools iterated until no tool calls or limits are hit.
|
|
6
6
|
*
|
package/dist/patterns/react.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { loop } from '../builders/loop-builder';
|
|
2
|
-
import { spawn } from '../builders/spawn-builder';
|
|
3
|
-
import { step } from '../builders/step-builders';
|
|
4
|
-
import { any } from '../until/combinators';
|
|
5
|
-
import { until } from '../until/predicates';
|
|
1
|
+
import { loop } from '../builders/loop-builder.js';
|
|
2
|
+
import { spawn } from '../builders/spawn-builder.js';
|
|
3
|
+
import { step } from '../builders/step-builders.js';
|
|
4
|
+
import { any } from '../until/combinators.js';
|
|
5
|
+
import { until } from '../until/predicates.js';
|
|
6
6
|
/**
|
|
7
7
|
* Creates a ReAct (Reason + Act) agent loop: an LLM step with tools iterated until no tool calls or limits are hit.
|
|
8
8
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @public */
|
|
2
|
-
export { createInMemoryFsAdapter } from '../adapters/in-memory-fs-adapter';
|
|
2
|
+
export { createInMemoryFsAdapter } from '../adapters/in-memory-fs-adapter.js';
|
|
3
3
|
/** @public */
|
|
4
|
-
export { createInMemoryShellAdapter } from '../adapters/in-memory-shell-adapter';
|
|
4
|
+
export { createInMemoryShellAdapter } from '../adapters/in-memory-shell-adapter.js';
|
|
5
5
|
/** @public */
|
|
6
|
-
export { createInMemorySubprocessAdapter } from '../adapters/in-memory-subprocess-adapter';
|
|
6
|
+
export { createInMemorySubprocessAdapter } from '../adapters/in-memory-subprocess-adapter.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @public */
|
|
2
|
-
export { createInMemoryFsAdapter } from '../adapters/in-memory-fs-adapter';
|
|
2
|
+
export { createInMemoryFsAdapter } from '../adapters/in-memory-fs-adapter.js';
|
|
3
3
|
/** @public */
|
|
4
|
-
export { createInMemoryShellAdapter } from '../adapters/in-memory-shell-adapter';
|
|
4
|
+
export { createInMemoryShellAdapter } from '../adapters/in-memory-shell-adapter.js';
|
|
5
5
|
/** @public */
|
|
6
|
-
export { createInMemorySubprocessAdapter } from '../adapters/in-memory-subprocess-adapter';
|
|
6
|
+
export { createInMemorySubprocessAdapter } from '../adapters/in-memory-subprocess-adapter.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** @public */
|
|
2
|
-
export type { AskUserAnnotation, AskUserInput, AskUserOption, AskUserOutput, AskUserQuestion, } from '../types/ask-user-types';
|
|
2
|
+
export type { AskUserAnnotation, AskUserInput, AskUserOption, AskUserOutput, AskUserQuestion, } from '../types/ask-user-types.js';
|
|
3
3
|
/** @public */
|
|
4
|
-
export { AskUserAnnotationSchema, AskUserInputSchema, AskUserOptionSchema, AskUserOutputSchema, AskUserQuestionSchema, } from '../types/ask-user-types';
|
|
4
|
+
export { AskUserAnnotationSchema, AskUserInputSchema, AskUserOptionSchema, AskUserOutputSchema, AskUserQuestionSchema, } from '../types/ask-user-types.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @public */
|
|
2
|
-
export { AskUserAnnotationSchema, AskUserInputSchema, AskUserOptionSchema, AskUserOutputSchema, AskUserQuestionSchema, } from '../types/ask-user-types';
|
|
2
|
+
export { AskUserAnnotationSchema, AskUserInputSchema, AskUserOptionSchema, AskUserOutputSchema, AskUserQuestionSchema, } from '../types/ask-user-types.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/** @public */
|
|
2
|
-
export { branch, fork } from '../builders/control-flow-builders';
|
|
2
|
+
export { branch, fork } from '../builders/control-flow-builders.js';
|
|
3
3
|
/** @public */
|
|
4
|
-
export { layerData, layerFn } from '../builders/layer-provides-builders';
|
|
4
|
+
export { layerData, layerFn } from '../builders/layer-provides-builders.js';
|
|
5
5
|
/** @public */
|
|
6
|
-
export { loop } from '../builders/loop-builder';
|
|
6
|
+
export { loop } from '../builders/loop-builder.js';
|
|
7
7
|
/** @public */
|
|
8
|
-
export { spawn } from '../builders/spawn-builder';
|
|
8
|
+
export { spawn } from '../builders/spawn-builder.js';
|
|
9
9
|
/** @public */
|
|
10
|
-
export { step } from '../builders/step-builders';
|
|
10
|
+
export { step } from '../builders/step-builders.js';
|
|
11
11
|
/** @public */
|
|
12
|
-
export { tool, toolWithGenerator } from '../builders/tool-builder';
|
|
12
|
+
export { tool, toolWithGenerator } from '../builders/tool-builder.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/** @public */
|
|
2
|
-
export { branch, fork } from '../builders/control-flow-builders';
|
|
2
|
+
export { branch, fork } from '../builders/control-flow-builders.js';
|
|
3
3
|
/** @public */
|
|
4
|
-
export { layerData, layerFn } from '../builders/layer-provides-builders';
|
|
4
|
+
export { layerData, layerFn } from '../builders/layer-provides-builders.js';
|
|
5
5
|
/** @public */
|
|
6
|
-
export { loop } from '../builders/loop-builder';
|
|
6
|
+
export { loop } from '../builders/loop-builder.js';
|
|
7
7
|
/** @public */
|
|
8
|
-
export { spawn } from '../builders/spawn-builder';
|
|
8
|
+
export { spawn } from '../builders/spawn-builder.js';
|
|
9
9
|
/** @public */
|
|
10
|
-
export { step } from '../builders/step-builders';
|
|
10
|
+
export { step } from '../builders/step-builders.js';
|
|
11
11
|
/** @public */
|
|
12
|
-
export { tool, toolWithGenerator } from '../builders/tool-builder';
|
|
12
|
+
export { tool, toolWithGenerator } from '../builders/tool-builder.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/** @public */
|
|
2
|
-
export { durableTaskState } from '../memory/layers/durable-task-state';
|
|
2
|
+
export { durableTaskState } from '../memory/layers/durable-task-state.js';
|
|
3
3
|
/** @public */
|
|
4
|
-
export { historyWindow } from '../memory/layers/history-window';
|
|
4
|
+
export { historyWindow } from '../memory/layers/history-window.js';
|
|
5
5
|
/** @public */
|
|
6
|
-
export { observationalMemory } from '../memory/layers/observational-memory';
|
|
6
|
+
export { observationalMemory } from '../memory/layers/observational-memory.js';
|
|
7
7
|
/** @public */
|
|
8
|
-
export { planMemory } from '../memory/layers/plan';
|
|
8
|
+
export { planMemory } from '../memory/layers/plan.js';
|
|
9
9
|
/** @public */
|
|
10
|
-
export { toolMemoryLayer } from '../memory/layers/tool-memory-layer';
|
|
10
|
+
export { toolMemoryLayer } from '../memory/layers/tool-memory-layer.js';
|
|
11
11
|
/** @public */
|
|
12
|
-
export { workingMemory } from '../memory/layers/working-memory';
|
|
12
|
+
export { workingMemory } from '../memory/layers/working-memory.js';
|