@noetic-tools/core 0.2.1 → 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 +4 -2
- 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
package/dist/index.d.ts
CHANGED
|
@@ -41,9 +41,8 @@ export { aiCondition, allCondition, anyCondition, embeddingMatch, otherwise, sem
|
|
|
41
41
|
/** @public */
|
|
42
42
|
export { cosineSimilarity } from './conditions/cosine-similarity.js';
|
|
43
43
|
/** @public */
|
|
44
|
-
export { isNoeticConfigError, NoeticConfigError } from './errors/noetic-config-error.js';
|
|
45
44
|
/** @public */
|
|
46
|
-
export { isNoeticError, NoeticErrorImpl } from '
|
|
45
|
+
export { isNoeticConfigError, isNoeticError, NoeticConfigError, NoeticErrorImpl, } from '@noetic-tools/types';
|
|
47
46
|
/** @public */
|
|
48
47
|
export type { AskUserAnnotation, AskUserInput, AskUserOption, AskUserOutput, AskUserQuestion, } from './types/ask-user-types.js';
|
|
49
48
|
/** @public */
|
|
@@ -51,43 +50,27 @@ export { AskUserAnnotationSchema, AskUserInputSchema, AskUserOptionSchema, AskUs
|
|
|
51
50
|
/** @public */
|
|
52
51
|
export { execute } from './interpreter/execute.js';
|
|
53
52
|
/** @public */
|
|
54
|
-
export { findFunctionCall } from './memory/function-call-utils.js';
|
|
55
53
|
/** @public */
|
|
56
|
-
export type { DurableTaskState, DurableTaskStateConfig } from './memory/layers/durable-task-state.js';
|
|
57
54
|
/** @public */
|
|
58
|
-
export { durableTaskState } from './memory/layers/durable-task-state.js';
|
|
59
55
|
/** @public */
|
|
60
|
-
export { fileReference } from './memory/layers/file-reference.js';
|
|
61
56
|
/** @public */
|
|
62
|
-
export type { HistoryWindowConfig } from './memory/layers/history-window.js';
|
|
63
57
|
/** @public */
|
|
64
|
-
export {
|
|
58
|
+
export type { DurableTaskState, DurableTaskStateConfig, FactExtractor, FactSearcher, HistoryWindowConfig, ObservationalMemoryConfig, ObservationalState, PlanEnterSessionCallback, PlanExecutionEntry, PlanExitCallback, PlanMemoryConfig, PlanState, TemporalFact, TemporalMemoryConfig, TemporalSearchResult, WorkingMemoryConfig, WorkingMemoryState, } from '@noetic-tools/memory';
|
|
65
59
|
/** @public */
|
|
66
|
-
export type { ObservationalMemoryConfig, ObservationalState, } from './memory/layers/observational-memory.js';
|
|
67
60
|
/** @public */
|
|
68
|
-
export { observationalMemory } from './memory/layers/observational-memory.js';
|
|
69
61
|
/** @public */
|
|
70
|
-
export type { PlanEnterSessionCallback, PlanExecutionEntry, PlanExitCallback, PlanMemoryConfig, PlanState, } from './memory/layers/plan.js';
|
|
71
62
|
/** @public */
|
|
72
|
-
export { PlanPhase, planMemory } from './memory/layers/plan.js';
|
|
73
63
|
/** @public */
|
|
74
|
-
export { staticContent } from './memory/layers/static-content.js';
|
|
75
64
|
/** @public */
|
|
76
|
-
export { steering } from './memory/layers/steering.js';
|
|
77
65
|
/** @public */
|
|
78
|
-
export type { FactExtractor, FactSearcher, TemporalFact, TemporalMemoryConfig, TemporalSearchResult, } from './memory/layers/temporal.js';
|
|
79
66
|
/** @public */
|
|
80
|
-
export { temporalMemory } from './memory/layers/temporal.js';
|
|
81
67
|
/** @public */
|
|
82
|
-
export { toolMemoryLayer } from './memory/layers/tool-memory-layer.js';
|
|
83
68
|
/** @public */
|
|
84
|
-
export type { WorkingMemoryConfig, WorkingMemoryState } from './memory/layers/working-memory.js';
|
|
85
69
|
/** @public */
|
|
86
|
-
export { workingMemory } from './memory/layers/working-memory.js';
|
|
87
70
|
/** @public */
|
|
88
|
-
export { stripUnresolvedToolCalls } from '
|
|
71
|
+
export { durableTaskState, fileReference, findFunctionCall, historyWindow, observationalMemory, PlanPhase, planMemory, staticContent, steering, stripUnresolvedToolCalls, temporalMemory, toolMemoryLayer, workingMemory, } from '@noetic-tools/memory';
|
|
89
72
|
/** @public */
|
|
90
|
-
export { createMessage, estimateTokens } from '
|
|
73
|
+
export { createMessage, estimateTokens } from '@noetic-tools/types';
|
|
91
74
|
/** @public */
|
|
92
75
|
export { GenAI, ToolAttr } from './observability/genai-attributes.js';
|
|
93
76
|
/** @public */
|
|
@@ -123,29 +106,26 @@ export { CheckpointKeys, createCheckpointStore, createDetachedSignal, createNudg
|
|
|
123
106
|
/** @public */
|
|
124
107
|
export { getRegistry, lookupStep, registerStep } from './runtime/step-registry.js';
|
|
125
108
|
/** @public */
|
|
126
|
-
export { defaultItemSchemaRegistry, ItemSchema, ItemSchemaRegistry } from '
|
|
109
|
+
export { defaultItemSchemaRegistry, ItemSchema, ItemSchemaRegistry } from '@noetic-tools/types';
|
|
127
110
|
/** @public */
|
|
128
111
|
export type { BranchRoute, BranchWorkflowNode, EveryWorkflowNode, ForkWorkflowNode, LlmWorkflowNode, LoopWorkflowNode, MergeStrategy, ProvideWorkflowNode, SequenceWorkflowNode, SpawnWorkflowNode, ToolWorkflowNode, UntilPredicate, WorkflowDocument, WorkflowNode, } from './schemas/workflow.js';
|
|
129
112
|
/** @public */
|
|
130
113
|
export { MergeStrategySchema, UntilPredicateSchema, validateWorkflow, WorkflowDocumentSchema, WorkflowNodeSchema, walkWorkflow, workflowDepth, } from './schemas/workflow.js';
|
|
131
114
|
/** @public */
|
|
132
|
-
export type { Channel, ChannelHandle, ExternalChannel } from '
|
|
115
|
+
export type { Channel, ChannelHandle, ExternalChannel } from '@noetic-tools/types';
|
|
133
116
|
/** @public */
|
|
134
|
-
export type { LLMResponse, LlmProviderConfig, ModelParams, RetryPolicy, StepMeta, TokenUsage, } from './types/common.js';
|
|
135
117
|
/** @public */
|
|
136
|
-
export type { Tool, ToolMemoryDeclaration } from '
|
|
118
|
+
export type { LLMResponse, LlmProviderConfig, ModelParams, RetryPolicy, StepMeta, TokenUsage, Tool, ToolMemoryDeclaration, } from '@noetic-tools/types';
|
|
137
119
|
/** @public */
|
|
138
|
-
export { getToolCwd, setToolCwd, snapshotCwdState } from './runtime/cwd-helpers.js';
|
|
139
120
|
/** @public */
|
|
140
|
-
export type { Context, ContextHarness, CwdState, } from './types/context.js';
|
|
141
121
|
/** @public */
|
|
142
|
-
export type { ItemLog } from '
|
|
122
|
+
export type { Context, ContextHarness, CwdState, ItemLog, LastLayerUsage, LayerUsageEntry, } from '@noetic-tools/types';
|
|
143
123
|
/** @public */
|
|
144
|
-
export
|
|
124
|
+
export { getToolCwd, setToolCwd, snapshotCwdState } from './runtime/cwd-helpers.js';
|
|
145
125
|
/** @public */
|
|
146
|
-
export type { DetachedHandle } from '
|
|
126
|
+
export type { DetachedHandle } from '@noetic-tools/types';
|
|
147
127
|
/** @public */
|
|
148
|
-
export { DetachedStatus } from '
|
|
128
|
+
export { DetachedStatus } from '@noetic-tools/types';
|
|
149
129
|
/** @public */
|
|
150
130
|
export type { EmbedFn } from './types/embed.js';
|
|
151
131
|
/** @public */
|
|
@@ -153,39 +133,38 @@ export type { CheckpointSnapshot, CwdSnapshot, FrontierFrame, ItemLogSnapshot, P
|
|
|
153
133
|
/** @public */
|
|
154
134
|
export { CheckpointSchemaVersion, CheckpointSnapshotSchema, CwdSnapshotSchema, FrontierFrameSchema, ItemLogSnapshotSchema, PendingAskUserSnapshotSchema, } from './types/checkpoint.js';
|
|
155
135
|
/** @public */
|
|
156
|
-
export type { NoeticError } from '
|
|
136
|
+
export type { NoeticError } from '@noetic-tools/types';
|
|
157
137
|
/** @public */
|
|
158
|
-
export type { ContentPart, DeveloperMessageExtensionItem, ExecuteInput, ExtendedItem, ExtensionItem, FileSearchItem, FunctionCallItem, FunctionCallOutputItem, ImageGenerationItem, InferExtendedItem, InputContentPart, InputFilePart, InputImagePart, InputMessageItem, InputTextPart, Item, ItemBase, ItemSchemaExtensions, MessageItem, OutputItem, OutputTextPart, ReasoningItem, ReasoningTextPart, RefusalPart, ServerToolItem, SummaryTextPart, WebSearchItem, } from '
|
|
138
|
+
export type { ContentPart, DeveloperMessageExtensionItem, ExecuteInput, ExtendedItem, ExtensionItem, FileSearchItem, FunctionCallItem, FunctionCallOutputItem, ImageGenerationItem, InferExtendedItem, InputContentPart, InputFilePart, InputImagePart, InputMessageItem, InputTextPart, Item, ItemBase, ItemSchemaExtensions, MessageItem, OutputItem, OutputTextPart, ReasoningItem, ReasoningTextPart, RefusalPart, ServerToolItem, SummaryTextPart, WebSearchItem, } from '@noetic-tools/types';
|
|
159
139
|
/** @public */
|
|
160
|
-
export type { BudgetConfig, CompleteParams, ContextMemory, DisposeParams, InferMemory, InferMemoryShape, InitParams, InitResult, LayerDataDecl, LayerFunctionDecl, LayerProvides, LayerTimeouts, MemoryConfig, MemoryHooks, MemoryLayer, ProjectionPolicy, RecallParams, RecallResult, ReturnParams, ReturnResult, ScopedStorage, SpawnParams, SpawnResult, StorageAdapter, StoreParams, StoreResult, } from '
|
|
140
|
+
export type { BudgetConfig, CompleteParams, ContextMemory, DisposeParams, InferMemory, InferMemoryShape, InitParams, InitResult, LayerDataDecl, LayerFunctionDecl, LayerProvides, LayerTimeouts, MemoryConfig, MemoryHooks, MemoryLayer, ProjectionPolicy, RecallParams, RecallResult, ReturnParams, ReturnResult, ScopedStorage, SpawnParams, SpawnResult, StorageAdapter, StoreParams, StoreResult, } from '@noetic-tools/memory';
|
|
161
141
|
/** @public */
|
|
162
|
-
export { Slot } from '
|
|
142
|
+
export { Slot } from '@noetic-tools/memory';
|
|
163
143
|
/** @public */
|
|
164
|
-
export type { ExecutionContext, ExecutionOutcome, MemoryCallModelRequest, MemoryScope, } from '
|
|
144
|
+
export type { ExecutionContext, ExecutionOutcome, MemoryCallModelRequest, MemoryScope, } from '@noetic-tools/types';
|
|
165
145
|
/** @public */
|
|
166
|
-
export type { MemoryTraceSpan, Span, TraceExporter } from '
|
|
146
|
+
export type { MemoryTraceSpan, Span, TraceExporter } from '@noetic-tools/types';
|
|
167
147
|
/** @public */
|
|
168
|
-
export type { FrameworkStreamEvent, HarnessResponse, SdkStreamEvent, StreamEvent, StreamingItem, } from '
|
|
148
|
+
export type { FrameworkStreamEvent, HarnessResponse, SdkStreamEvent, StreamEvent, StreamingItem, } from '@noetic-tools/types';
|
|
169
149
|
/** @public */
|
|
170
|
-
export type { AgentConfig, AgentHarnessContract, AgentHooks, CallModelRequest, DeliveryMode, ExecuteOptions, HarnessStatus, RecallLayerOutput, SessionScope, } from '
|
|
150
|
+
export type { AgentConfig, AgentHarnessContract, AgentHooks, CallModelRequest, DeliveryMode, ExecuteOptions, HarnessStatus, RecallLayerOutput, SessionScope, } from '@noetic-tools/types';
|
|
171
151
|
/** @public */
|
|
172
|
-
export type { AfterModelCallParams, AfterModelCallResult, BeforeToolCallParams, BeforeToolCallResult, LedgerEntry, SteeringConfig, SteeringDecision, SteeringRule, SteeringState, } from '
|
|
152
|
+
export type { AfterModelCallParams, AfterModelCallResult, BeforeToolCallParams, BeforeToolCallResult, LedgerEntry, SteeringConfig, SteeringDecision, SteeringRule, SteeringState, } from '@noetic-tools/types';
|
|
173
153
|
/** @public */
|
|
174
|
-
export { LedgerEntryKind, SteeringAction } from '
|
|
154
|
+
export { LedgerEntryKind, SteeringAction } from '@noetic-tools/types';
|
|
175
155
|
/** @public */
|
|
176
|
-
export type { ExecuteStepFn, SettleResult, Snapshot, Step, StepBranch, StepFork, StepForkAll, StepForkRace, StepForkSettle, StepLLM, StepLoop, StepProvide, StepRun, StepSpawn, StepTool, Until, Verdict, } from '
|
|
156
|
+
export type { ExecuteStepFn, SettleResult, Snapshot, Step, StepBranch, StepFork, StepForkAll, StepForkRace, StepForkSettle, StepLLM, StepLoop, StepProvide, StepRun, StepSpawn, StepTool, Until, Verdict, } from '@noetic-tools/types';
|
|
177
157
|
/** @public */
|
|
178
|
-
export type { FsAdapter, FsStats } from '
|
|
179
|
-
/** @public Reusable error-serialiser used by custom SubprocessAdapter implementations. */
|
|
180
|
-
export { serializeError } from './adapters/in-memory-subprocess/metadata.js';
|
|
158
|
+
export type { FsAdapter, FsStats } from '@noetic-tools/types';
|
|
181
159
|
/** @public */
|
|
182
|
-
export type { ShellAdapter, ShellExecOptions, ShellExecResult } from './types/shell-adapter.js';
|
|
183
160
|
/** @public */
|
|
184
|
-
export {
|
|
161
|
+
export type { ProcessSubprocessRequest, SerializedError, ShellAdapter, ShellExecOptions, ShellExecResult, StepSubprocessOverrides, StepSubprocessRequest, SubprocessAdapter, SubprocessControlResult, SubprocessHandle, SubprocessHandleMetadata, SubprocessRequest, SubprocessStatus, SubprocessStopResult, } from '@noetic-tools/types';
|
|
185
162
|
/** @public */
|
|
186
|
-
export
|
|
163
|
+
export { TIMEOUT_ERROR_PREFIX } from '@noetic-tools/types';
|
|
164
|
+
/** @public Reusable error-serialiser used by custom SubprocessAdapter implementations. */
|
|
165
|
+
export { serializeError } from './adapters/in-memory-subprocess/metadata.js';
|
|
187
166
|
/** @public */
|
|
188
|
-
export type { ToolExecutionContext, ToolMemory } from '
|
|
167
|
+
export type { ToolExecutionContext, ToolMemory } from '@noetic-tools/types';
|
|
189
168
|
/** @public */
|
|
190
169
|
export { all, any } from './until/combinators.js';
|
|
191
170
|
/** @public */
|
package/dist/index.js
CHANGED
|
@@ -38,45 +38,31 @@ export { cosineSimilarity } from './conditions/cosine-similarity.js';
|
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region Errors
|
|
40
40
|
/** @public */
|
|
41
|
-
export { isNoeticConfigError, NoeticConfigError } from './errors/noetic-config-error.js';
|
|
42
41
|
/** @public */
|
|
43
|
-
export { isNoeticError, NoeticErrorImpl } from '
|
|
42
|
+
export { isNoeticConfigError, isNoeticError, NoeticConfigError, NoeticErrorImpl, } from '@noetic-tools/types';
|
|
44
43
|
/** @public */
|
|
45
44
|
export { AskUserAnnotationSchema, AskUserInputSchema, AskUserOptionSchema, AskUserOutputSchema, AskUserQuestionSchema, } from './types/ask-user-types.js';
|
|
46
45
|
//#endregion
|
|
47
46
|
//#region Execution
|
|
48
47
|
/** @public */
|
|
49
48
|
export { execute } from './interpreter/execute.js';
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region Memory Layers
|
|
52
49
|
/** @public */
|
|
53
|
-
export { findFunctionCall } from './memory/function-call-utils.js';
|
|
54
50
|
/** @public */
|
|
55
|
-
export { durableTaskState } from './memory/layers/durable-task-state.js';
|
|
56
51
|
/** @public */
|
|
57
|
-
export { fileReference } from './memory/layers/file-reference.js';
|
|
58
52
|
/** @public */
|
|
59
|
-
export { historyWindow } from './memory/layers/history-window.js';
|
|
60
53
|
/** @public */
|
|
61
|
-
export { observationalMemory } from './memory/layers/observational-memory.js';
|
|
62
54
|
/** @public */
|
|
63
|
-
export { PlanPhase, planMemory } from './memory/layers/plan.js';
|
|
64
55
|
/** @public */
|
|
65
|
-
export { staticContent } from './memory/layers/static-content.js';
|
|
66
56
|
/** @public */
|
|
67
|
-
export { steering } from './memory/layers/steering.js';
|
|
68
57
|
/** @public */
|
|
69
|
-
export { temporalMemory } from './memory/layers/temporal.js';
|
|
70
58
|
/** @public */
|
|
71
|
-
export { toolMemoryLayer } from './memory/layers/tool-memory-layer.js';
|
|
72
59
|
/** @public */
|
|
73
|
-
export { workingMemory } from './memory/layers/working-memory.js';
|
|
74
60
|
/** @public */
|
|
75
|
-
export { stripUnresolvedToolCalls } from '
|
|
61
|
+
export { durableTaskState, fileReference, findFunctionCall, historyWindow, observationalMemory, PlanPhase, planMemory, staticContent, steering, stripUnresolvedToolCalls, temporalMemory, toolMemoryLayer, workingMemory, } from '@noetic-tools/memory';
|
|
76
62
|
//#endregion
|
|
77
63
|
//#region Message Utilities
|
|
78
64
|
/** @public */
|
|
79
|
-
export { createMessage, estimateTokens } from '
|
|
65
|
+
export { createMessage, estimateTokens } from '@noetic-tools/types';
|
|
80
66
|
//#endregion
|
|
81
67
|
//#region Observability
|
|
82
68
|
/** @public */
|
|
@@ -108,27 +94,23 @@ export { getRegistry, lookupStep, registerStep } from './runtime/step-registry.j
|
|
|
108
94
|
//#endregion
|
|
109
95
|
//#region Schemas
|
|
110
96
|
/** @public */
|
|
111
|
-
export { defaultItemSchemaRegistry, ItemSchema, ItemSchemaRegistry } from '
|
|
97
|
+
export { defaultItemSchemaRegistry, ItemSchema, ItemSchemaRegistry } from '@noetic-tools/types';
|
|
112
98
|
/** @public */
|
|
113
99
|
export { MergeStrategySchema, UntilPredicateSchema, validateWorkflow, WorkflowDocumentSchema, WorkflowNodeSchema, walkWorkflow, workflowDepth, } from './schemas/workflow.js';
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region Types — Context
|
|
116
100
|
/** @public */
|
|
117
101
|
export { getToolCwd, setToolCwd, snapshotCwdState } from './runtime/cwd-helpers.js';
|
|
118
102
|
/** @public */
|
|
119
|
-
export { DetachedStatus } from '
|
|
103
|
+
export { DetachedStatus } from '@noetic-tools/types';
|
|
120
104
|
/** @public */
|
|
121
105
|
export { CheckpointSchemaVersion, CheckpointSnapshotSchema, CwdSnapshotSchema, FrontierFrameSchema, ItemLogSnapshotSchema, PendingAskUserSnapshotSchema, } from './types/checkpoint.js';
|
|
122
106
|
/** @public */
|
|
123
|
-
export { Slot } from '
|
|
107
|
+
export { Slot } from '@noetic-tools/memory';
|
|
124
108
|
/** @public */
|
|
125
|
-
export { LedgerEntryKind, SteeringAction } from '
|
|
126
|
-
|
|
127
|
-
|
|
109
|
+
export { LedgerEntryKind, SteeringAction } from '@noetic-tools/types';
|
|
110
|
+
/** @public */
|
|
111
|
+
export { TIMEOUT_ERROR_PREFIX } from '@noetic-tools/types';
|
|
128
112
|
/** @public Reusable error-serialiser used by custom SubprocessAdapter implementations. */
|
|
129
113
|
export { serializeError } from './adapters/in-memory-subprocess/metadata.js';
|
|
130
|
-
/** @public */
|
|
131
|
-
export { TIMEOUT_ERROR_PREFIX } from './types/shell-adapter.js';
|
|
132
114
|
//#endregion
|
|
133
115
|
//#region Until
|
|
134
116
|
/** @public */
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { resolveLayerTools } from '
|
|
3
|
-
export type {
|
|
4
|
-
export {
|
|
5
|
-
export { commitLayerUsage, computeLayerUsage } from '../memory/layer-usage.js';
|
|
6
|
-
export { assembleView } from '../memory/projector.js';
|
|
1
|
+
export type { LayerStateStore } from '@noetic-tools/memory';
|
|
2
|
+
export { allocateBudgets, assembleView, commitLayerUsage, computeLayerUsage, contextToExecCtx, DEFAULT_PROJECTION, resolveLayerTools, returnLayers, spawnLayers, } from '@noetic-tools/memory';
|
|
3
|
+
export type { ItemSchemaRegistry } from '@noetic-tools/types';
|
|
4
|
+
export { defaultItemSchemaRegistry } from '@noetic-tools/types';
|
|
7
5
|
export { emitFrameworkEvent, getBroadcaster } from '../runtime/broadcaster-utils.js';
|
|
8
6
|
export { ContextImpl } from '../runtime/context-impl.js';
|
|
9
7
|
export { snapshotCwdState } from '../runtime/cwd-helpers.js';
|
|
10
8
|
export { buildToolExecutionContext } from '../runtime/tool-memory.js';
|
|
11
|
-
export type { ItemSchemaRegistry } from '../schemas/item.js';
|
|
12
|
-
export { defaultItemSchemaRegistry } from '../schemas/item.js';
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
export { contextToExecCtx } from '
|
|
2
|
-
export {
|
|
3
|
-
export { returnLayers, spawnLayers } from '../memory/layer-lifecycle.js';
|
|
4
|
-
export { commitLayerUsage, computeLayerUsage } from '../memory/layer-usage.js';
|
|
5
|
-
export { assembleView } from '../memory/projector.js';
|
|
1
|
+
export { allocateBudgets, assembleView, commitLayerUsage, computeLayerUsage, contextToExecCtx, DEFAULT_PROJECTION, resolveLayerTools, returnLayers, spawnLayers, } from '@noetic-tools/memory';
|
|
2
|
+
export { defaultItemSchemaRegistry } from '@noetic-tools/types';
|
|
6
3
|
export { emitFrameworkEvent, getBroadcaster } from '../runtime/broadcaster-utils.js';
|
|
7
4
|
export { ContextImpl } from '../runtime/context-impl.js';
|
|
8
5
|
export { snapshotCwdState } from '../runtime/cwd-helpers.js';
|
|
9
6
|
export { buildToolExecutionContext } from '../runtime/tool-memory.js';
|
|
10
|
-
export { defaultItemSchemaRegistry } from '../schemas/item.js';
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type { Context } from '
|
|
3
|
-
export
|
|
4
|
-
export type { ContextMemory, ExecutionContext, MemoryConfig, MemoryLayer } from '../types/memory.js';
|
|
5
|
-
export type { AgentHarnessContract, RecallLayerOutput } from '../types/runtime.js';
|
|
6
|
-
export { SteeringAction } from '../types/steering.js';
|
|
7
|
-
export type { ExecuteStepFn, StepLLM, StepProvide, StepRun, StepSpawn, StepTool, } from '../types/step.js';
|
|
8
|
-
export type { Tool } from '../types/tool.js';
|
|
1
|
+
export type { ContextMemory, ExecutionContext, MemoryConfig, MemoryLayer, } from '@noetic-tools/memory';
|
|
2
|
+
export type { AgentHarnessContract, Context, ContextRerenderRequest, ExecuteStepFn, FunctionCallItem, Item, ProjectionPolicy, RecallLayerOutput, RetryPolicy, StepLLM, StepMeta, StepProvide, StepRun, StepSpawn, StepTool, Tool, } from '@noetic-tools/types';
|
|
3
|
+
export { SteeringAction } from '@noetic-tools/types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SteeringAction } from '
|
|
1
|
+
export { SteeringAction } from '@noetic-tools/types';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Step } from '
|
|
2
|
-
import type { Tool } from '../types/tool.js';
|
|
1
|
+
import type { Step, Tool } from '@noetic-tools/types';
|
|
3
2
|
/**
|
|
4
3
|
* Recursively walks a step tree and collects all Tool instances
|
|
5
4
|
* declared on LLM steps. Used to build the unified tool set
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Action step handlers: run, llm, spawn, provide, tool.
|
|
3
3
|
*/
|
|
4
|
+
import { createMessage, estimateTokens, extractAssistantText, frameworkCast, NoeticConfigError, NoeticErrorImpl, } from '@noetic-tools/types';
|
|
4
5
|
import { ZodError } from 'zod';
|
|
5
|
-
import {
|
|
6
|
-
import { NoeticErrorImpl } from '../errors/noetic-error.js';
|
|
7
|
-
import { frameworkCast } from '../util/framework-cast.js';
|
|
8
|
-
import { createMessage, extractAssistantText } from '../util/message-helpers.js';
|
|
9
|
-
import { assembleView, buildToolExecutionContext, ContextImpl, commitLayerUsage, computeLayerUsage, contextToExecCtx, defaultItemSchemaRegistry, emitFrameworkEvent, getBroadcaster, resolveLayerTools, returnLayers, snapshotCwdState, spawnLayers, } from './action-deps.js';
|
|
6
|
+
import { allocateBudgets, assembleView, buildToolExecutionContext, ContextImpl, commitLayerUsage, computeLayerUsage, contextToExecCtx, DEFAULT_PROJECTION, defaultItemSchemaRegistry, emitFrameworkEvent, getBroadcaster, resolveLayerTools, returnLayers, snapshotCwdState, spawnLayers, } from './action-deps.js';
|
|
10
7
|
import { SteeringAction } from './action-types.js';
|
|
11
8
|
import { cloneWithGuard } from './clone-guard.js';
|
|
12
9
|
import { collectAllTools, deduplicateTools } from './collect-tools.js';
|
|
@@ -55,6 +52,27 @@ function computeDelay(retry, attempt) {
|
|
|
55
52
|
//#region llm
|
|
56
53
|
const MAX_STEERING_RETRIES = 3;
|
|
57
54
|
const emptyRecall = [];
|
|
55
|
+
/**
|
|
56
|
+
* Merge re-render recall outputs over the base recall results, replacing entries
|
|
57
|
+
* for the same layer and keeping slot order. New layer entries are appended.
|
|
58
|
+
*/
|
|
59
|
+
function mergeRecallResults(base, overrides, slotOf) {
|
|
60
|
+
if (overrides.length === 0) {
|
|
61
|
+
return base;
|
|
62
|
+
}
|
|
63
|
+
const byId = new Map(overrides.map((r) => [
|
|
64
|
+
r.layerId,
|
|
65
|
+
r,
|
|
66
|
+
]));
|
|
67
|
+
const merged = base.map((r) => byId.get(r.layerId) ?? r);
|
|
68
|
+
const seen = new Set(base.map((r) => r.layerId));
|
|
69
|
+
for (const o of overrides) {
|
|
70
|
+
if (!seen.has(o.layerId)) {
|
|
71
|
+
merged.push(o);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return merged.sort((a, b) => (slotOf.get(a.layerId) ?? 0) - (slotOf.get(b.layerId) ?? 0));
|
|
75
|
+
}
|
|
58
76
|
/**
|
|
59
77
|
* Resolves a `Lazy<T>` step field. If the value is a function, it is invoked
|
|
60
78
|
* with the current context; otherwise the value is returned as-is. Supports
|
|
@@ -123,14 +141,15 @@ function resolveToolsAndRestrictions(stepTools, layers, ctx) {
|
|
|
123
141
|
allowedToolNames: undefined,
|
|
124
142
|
};
|
|
125
143
|
}
|
|
126
|
-
async function runInputPipeline({ ctx, layers, input }) {
|
|
144
|
+
async function runInputPipeline({ ctx, layers, input, }) {
|
|
127
145
|
const userItem = createMessage(input, 'user');
|
|
128
|
-
const { items: finalItems } = await ctx.harness.runAppendPipeline(layers, [
|
|
146
|
+
const { items: finalItems, rerenderRequests } = await ctx.harness.runAppendPipeline(layers, [
|
|
129
147
|
userItem,
|
|
130
148
|
], ctx);
|
|
131
149
|
for (const item of finalItems) {
|
|
132
150
|
ctx.itemLog.append(item);
|
|
133
151
|
}
|
|
152
|
+
return rerenderRequests;
|
|
134
153
|
}
|
|
135
154
|
export async function executeLLM(step, input, ctx, layers) {
|
|
136
155
|
const baseCtx = frameworkCast(ctx);
|
|
@@ -149,9 +168,12 @@ export async function executeLLM(step, input, ctx, layers) {
|
|
|
149
168
|
const resolvedInstructions = await resolveLazy(step.instructions, ctx);
|
|
150
169
|
const resolvedStepTools = await resolveLazy(step.tools, ctx);
|
|
151
170
|
// Append user input — through layer pipeline if layers exist, otherwise direct.
|
|
171
|
+
// The append pipeline may request a context re-render (e.g. a layer that
|
|
172
|
+
// expanded an input reference into new content); applied after recall below.
|
|
173
|
+
let rerenderRequests = [];
|
|
152
174
|
if (typeof input === 'string' && input.length > 0) {
|
|
153
175
|
if (hasLayers) {
|
|
154
|
-
await runInputPipeline({
|
|
176
|
+
rerenderRequests = await runInputPipeline({
|
|
155
177
|
ctx: baseCtx,
|
|
156
178
|
layers,
|
|
157
179
|
input,
|
|
@@ -162,14 +184,55 @@ export async function executeLLM(step, input, ctx, layers) {
|
|
|
162
184
|
}
|
|
163
185
|
}
|
|
164
186
|
const { tools: resolvedTools, allowedToolNames } = resolveToolsAndRestrictions(resolvedStepTools, layers, baseCtx);
|
|
165
|
-
//
|
|
166
|
-
//
|
|
167
|
-
|
|
187
|
+
// Resolve the projection policy (step override > harness default > fallback)
|
|
188
|
+
// and split the context budget across layers via allocateBudgets.
|
|
189
|
+
const policy = step.projection ?? baseCtx.harness.config.projection ?? DEFAULT_PROJECTION;
|
|
190
|
+
// `instructions` are sent to the model as a separate field, outside the
|
|
191
|
+
// assembled view. Reserve their tokens from the projection budget so the
|
|
192
|
+
// view + instructions together stay within the policy's token budget.
|
|
193
|
+
const systemPromptTokens = resolvedInstructions ? estimateTokens(resolvedInstructions) : 0;
|
|
194
|
+
const viewPolicy = {
|
|
195
|
+
...policy,
|
|
196
|
+
tokenBudget: Math.max(0, policy.tokenBudget - systemPromptTokens),
|
|
197
|
+
};
|
|
198
|
+
let budgetMap = new Map();
|
|
199
|
+
if (hasLayers) {
|
|
200
|
+
const { allocations } = allocateBudgets({
|
|
201
|
+
layers,
|
|
202
|
+
totalBudget: policy.tokenBudget,
|
|
203
|
+
systemPromptTokens,
|
|
204
|
+
responseReserve: policy.responseReserve,
|
|
205
|
+
});
|
|
206
|
+
budgetMap = new Map(allocations.map((a) => [
|
|
207
|
+
a.layerId,
|
|
208
|
+
a.allocated,
|
|
209
|
+
]));
|
|
210
|
+
}
|
|
211
|
+
// Recall once per LLM step: atomic layers run in the hot path; eventual layers
|
|
212
|
+
// are served from cache. Results drive both the assembled context window and
|
|
213
|
+
// the per-layer usage breakdown (ctx.lastLayerUsage). Recall fires before the
|
|
168
214
|
// steering retry loop because retries replay the same context.
|
|
169
215
|
const recallQuery = typeof input === 'string' ? input : '';
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
216
|
+
const slotOf = new Map((layers ?? []).map((l) => [
|
|
217
|
+
l.id,
|
|
218
|
+
l.slot,
|
|
219
|
+
]));
|
|
220
|
+
let recallResults = emptyRecall;
|
|
221
|
+
if (hasLayers) {
|
|
222
|
+
const atomic = await baseCtx.harness.recallLayersAtomic(layers, recallQuery, baseCtx, budgetMap);
|
|
223
|
+
const eventual = await baseCtx.harness.recallLayersEventual(layers, recallQuery, baseCtx, budgetMap);
|
|
224
|
+
recallResults = [
|
|
225
|
+
...atomic,
|
|
226
|
+
...eventual,
|
|
227
|
+
].sort((a, b) => (slotOf.get(a.layerId) ?? 0) - (slotOf.get(b.layerId) ?? 0));
|
|
228
|
+
// Apply re-render requests collected from the input-append pipeline.
|
|
229
|
+
if (rerenderRequests.length > 0) {
|
|
230
|
+
const rerendered = await baseCtx.harness.executeRerender(rerenderRequests, layers, baseCtx, budgetMap, recallQuery);
|
|
231
|
+
recallResults = mergeRecallResults([
|
|
232
|
+
...recallResults,
|
|
233
|
+
], rerendered, slotOf);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
173
236
|
const layerOutputItems = recallResults.flatMap((r) => r.items);
|
|
174
237
|
let retries = 0;
|
|
175
238
|
while (retries <= MAX_STEERING_RETRIES) {
|
|
@@ -177,19 +240,34 @@ export async function executeLLM(step, input, ctx, layers) {
|
|
|
177
240
|
const projectedHistoryItems = hasLayers
|
|
178
241
|
? await baseCtx.harness.projectHistory(layers, rawHistoryItems, baseCtx)
|
|
179
242
|
: rawHistoryItems;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
243
|
+
let assembledItems;
|
|
244
|
+
if (hasLayers) {
|
|
245
|
+
// Keep system messages at the front; the projector enforces the token
|
|
246
|
+
// budget (drops highest-slot layer output, then oldest history).
|
|
247
|
+
const systemItems = [];
|
|
248
|
+
const nonSystemHistory = [];
|
|
249
|
+
for (const item of projectedHistoryItems) {
|
|
250
|
+
if (item.type === 'message' && item.role === 'system') {
|
|
251
|
+
systemItems.push(item);
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
nonSystemHistory.push(item);
|
|
255
|
+
}
|
|
256
|
+
assembledItems = assembleView({
|
|
257
|
+
systemPromptItems: systemItems,
|
|
183
258
|
layerOutputItems,
|
|
184
|
-
historyItems:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
259
|
+
historyItems: nonSystemHistory,
|
|
260
|
+
policy: viewPolicy,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
assembledItems =
|
|
265
|
+
projectedHistoryItems === rawHistoryItems
|
|
266
|
+
? rawHistoryItems
|
|
267
|
+
: [
|
|
268
|
+
...projectedHistoryItems,
|
|
269
|
+
];
|
|
270
|
+
}
|
|
193
271
|
const request = resolvedTools
|
|
194
272
|
? {
|
|
195
273
|
model: resolvedModel,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Control-flow step handlers: branch, fork, loop, every.
|
|
3
3
|
*/
|
|
4
|
-
import type { Context } from '
|
|
5
|
-
import type { ExecuteStepFn, StepBranch, StepEvery, StepFork, StepLoop } from '../types/step.js';
|
|
4
|
+
import type { Context, ExecuteStepFn, StepBranch, StepEvery, StepFork, StepLoop } from '@noetic-tools/types';
|
|
6
5
|
export declare function executeBranch<TMemory, I, O>(step: StepBranch<TMemory, I, O>, input: I, ctx: Context<TMemory>, executeStep: ExecuteStepFn): Promise<O>;
|
|
7
6
|
export declare function executeFork<TMemory, I, O>(step: StepFork<TMemory, I, O>, input: I, ctx: Context<TMemory>, executeStep: ExecuteStepFn): Promise<O>;
|
|
8
7
|
export declare function executeLoop<TMemory, I, O>(step: StepLoop<TMemory, I, O>, input: I, ctx: Context<TMemory>, executeStep: ExecuteStepFn): Promise<O>;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Control-flow step handlers: branch, fork, loop, every.
|
|
3
3
|
*/
|
|
4
|
-
import { isNoeticError, NoeticErrorImpl } from '
|
|
4
|
+
import { createMessage, frameworkCast, isNoeticError, NoeticErrorImpl } from '@noetic-tools/types';
|
|
5
5
|
import { ContextImpl } from '../runtime/context-impl.js';
|
|
6
6
|
import { snapshotCwdState } from '../runtime/cwd-helpers.js';
|
|
7
|
-
import { frameworkCast } from '../util/framework-cast.js';
|
|
8
|
-
import { createMessage } from '../util/message-helpers.js';
|
|
9
7
|
import { cloneWithGuard } from './clone-guard.js';
|
|
10
8
|
import { getContextChannelStore, isContextImpl, isMutableContext } from './typeguards.js';
|
|
11
9
|
//#region branch
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { Step } from '../types/step.js';
|
|
1
|
+
import type { ContextMemory } from '@noetic-tools/memory';
|
|
2
|
+
import type { Context, Step } from '@noetic-tools/types';
|
|
4
3
|
/**
|
|
5
4
|
* @internal
|
|
6
5
|
* Dispatch a step at the per-kind handler level without adapter routing.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { NoeticErrorImpl } from '
|
|
1
|
+
import { frameworkCast, NoeticErrorImpl } from '@noetic-tools/types';
|
|
2
2
|
import { emitFrameworkEvent, getBroadcaster, shouldEmit } from '../runtime/broadcaster-utils.js';
|
|
3
3
|
import { ContextImpl } from '../runtime/context-impl.js';
|
|
4
4
|
import { DetachedHandleImpl } from '../runtime/detached-handle.js';
|
|
5
|
-
import { frameworkCast } from '../util/framework-cast.js';
|
|
6
5
|
import { executeLLM, executeProvide, executeRun, executeSpawn, executeTool, } from './execute-action.js';
|
|
7
6
|
import { executeBranch, executeEvery, executeFork, executeLoop } from './execute-control.js';
|
|
8
7
|
import { isMutableContext } from './typeguards.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { trackUsage } from '
|
|
1
|
+
export { trackUsage } from '@noetic-tools/types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { trackUsage } from '
|
|
1
|
+
export { trackUsage } from '@noetic-tools/types';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { DetachedHandle } from '
|
|
3
|
-
import type { ContextMemory } from '../types/memory.js';
|
|
4
|
-
import type { Step } from '../types/step.js';
|
|
5
|
-
import type { SubprocessAdapter } from '../types/subprocess-adapter.js';
|
|
1
|
+
import type { ContextMemory } from '@noetic-tools/memory';
|
|
2
|
+
import type { Context, DetachedHandle, Step, SubprocessAdapter } from '@noetic-tools/types';
|
|
6
3
|
/**
|
|
7
4
|
* Resolve the subprocess adapter used for a given step dispatch.
|
|
8
5
|
*
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import type { ContextMemory } from '@noetic-tools/memory';
|
|
2
|
+
import type { Context, FunctionCallItem, Item } from '@noetic-tools/types';
|
|
1
3
|
import type { ChannelStore } from '../runtime/channel-store.js';
|
|
2
4
|
import { ContextImpl } from '../runtime/context-impl.js';
|
|
3
|
-
import type { Context } from '../types/context.js';
|
|
4
|
-
import type { FunctionCallItem, Item } from '../types/items.js';
|
|
5
|
-
import type { ContextMemory } from '../types/memory.js';
|
|
6
5
|
import type { MutableContext } from '../types/mutable-context.js';
|
|
7
|
-
export { isAssistantMessage, isOutputText, isUserMessage } from '
|
|
6
|
+
export { isAssistantMessage, isOutputText, isUserMessage } from '@noetic-tools/types';
|
|
8
7
|
export declare function isMutableContext(ctx: Context<ContextMemory>): ctx is MutableContext;
|
|
9
8
|
export declare function isContextImpl(ctx: Context<ContextMemory>): ctx is ContextImpl;
|
|
10
9
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContextImpl } from '../runtime/context-impl.js';
|
|
2
2
|
// Re-exports for backward compatibility; the pure variants live in util/.
|
|
3
|
-
export { isAssistantMessage, isOutputText, isUserMessage } from '
|
|
3
|
+
export { isAssistantMessage, isOutputText, isUserMessage } from '@noetic-tools/types';
|
|
4
4
|
export function isMutableContext(ctx) {
|
|
5
5
|
// Check if the context has writable mutable fields (ContextImpl or compatible mock)
|
|
6
6
|
if (ctx instanceof ContextImpl) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Span, TraceExporter } from '
|
|
1
|
+
import type { Span, TraceExporter } from '@noetic-tools/types';
|
|
2
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 {
|
|
@@ -2,11 +2,8 @@
|
|
|
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 {
|
|
6
|
-
import type {
|
|
7
|
-
import type { AgentHarnessContract } from '../types/runtime.js';
|
|
8
|
-
import type { Step } from '../types/step.js';
|
|
9
|
-
import type { Tool } from '../types/tool.js';
|
|
5
|
+
import type { ContextMemory } from '@noetic-tools/memory';
|
|
6
|
+
import type { AgentHarnessContract, Context, Step, Tool } from '@noetic-tools/types';
|
|
10
7
|
/** @public Options for creating a dynamic workflow step. */
|
|
11
8
|
export interface DynamicWorkflowOpts {
|
|
12
9
|
model?: string;
|