@noetic-tools/types 3.9.0 → 3.9.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.
|
@@ -16,3 +16,27 @@ export interface HarnessJudgmentContract {
|
|
|
16
16
|
beforeToolCall(layers: ContextLayer[], toolName: string, toolArgs: unknown, ctx: Context, callId?: string): Promise<SteeringDecision>;
|
|
17
17
|
afterModelCall(layers: ContextLayer[], response: LLMResponse, ctx: Context): Promise<SteeringDecision>;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* @public Parameters passed to the harness approver for a call to a tool that
|
|
21
|
+
* declares `needsApproval`.
|
|
22
|
+
*/
|
|
23
|
+
export interface ApproveToolCallParams {
|
|
24
|
+
toolName: string;
|
|
25
|
+
/** The validated arguments — exactly what `execute` receives if the call is approved. */
|
|
26
|
+
toolArgs: unknown;
|
|
27
|
+
/** Correlation id of the pending call; see `BeforeToolCallParams.callId`. */
|
|
28
|
+
callId?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The calling step's context. An approver that waits on a human passes it
|
|
31
|
+
* to `ctx.harness.send` / `ctx.harness.recv` to park on a channel.
|
|
32
|
+
*/
|
|
33
|
+
ctx: Context;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @public Decides whether a call to a tool that declares `needsApproval` may
|
|
37
|
+
* run. Configured once per harness (`AgentHarness({ approveToolCall })`) and
|
|
38
|
+
* consulted after every `beforeToolCall` layer has allowed the call. `allow`
|
|
39
|
+
* runs the call; any other action refuses it, with `guidance` as the reason.
|
|
40
|
+
* May be async and may wait — e.g. on a channel a human answers.
|
|
41
|
+
*/
|
|
42
|
+
export type ToolApprover = (params: ApproveToolCallParams) => SteeringDecision | Promise<SteeringDecision>;
|
package/dist/types/runtime.d.ts
CHANGED
|
@@ -6,12 +6,11 @@ import type { ContextCacheConfig, ContextCacheStore } from './context-cache.js';
|
|
|
6
6
|
import type { ContextData, ContextLayer, ProjectionPolicy, RecallOptions, StorageAdapter } from './context-layer.js';
|
|
7
7
|
import type { DetachedHandle } from './detached.js';
|
|
8
8
|
import type { FsAdapter } from './fs-adapter.js';
|
|
9
|
-
import type { HarnessJudgmentContract } from './harness-judgment.js';
|
|
9
|
+
import type { HarnessJudgmentContract, ToolApprover } from './harness-judgment.js';
|
|
10
10
|
import type { HarnessResponse, StreamEvent, StreamingItem } from './harness-result.js';
|
|
11
11
|
import type { ExecuteInput, Item, ItemSchemaExtensions } from './items.js';
|
|
12
12
|
import type { Span, TraceExporter } from './observability.js';
|
|
13
13
|
import type { ShellAdapter } from './shell-adapter.js';
|
|
14
|
-
import type { ToolApprover } from './steering.js';
|
|
15
14
|
import type { Step } from './step.js';
|
|
16
15
|
import type { SubprocessAdapter } from './subprocess-adapter.js';
|
|
17
16
|
import type { Tool } from './tool.js';
|
package/dist/types/steering.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { LLMResponse } from './common.js';
|
|
2
|
-
import type { Context } from './context.js';
|
|
3
2
|
import type { ContextScope, ExecutionContext } from './context-scope.js';
|
|
4
3
|
/** @public Enumeration of actions a steering rule can take on a tool call or model response. */
|
|
5
4
|
export declare const SteeringAction: {
|
|
@@ -60,30 +59,6 @@ export interface BeforeToolCallResult<TState = unknown> {
|
|
|
60
59
|
decision: SteeringDecision;
|
|
61
60
|
state?: TState;
|
|
62
61
|
}
|
|
63
|
-
/**
|
|
64
|
-
* @public Parameters passed to the harness approver for a call to a tool that
|
|
65
|
-
* declares `needsApproval`.
|
|
66
|
-
*/
|
|
67
|
-
export interface ApproveToolCallParams {
|
|
68
|
-
toolName: string;
|
|
69
|
-
/** The validated arguments — exactly what `execute` receives if the call is approved. */
|
|
70
|
-
toolArgs: unknown;
|
|
71
|
-
/** Correlation id of the pending call; see `BeforeToolCallParams.callId`. */
|
|
72
|
-
callId?: string;
|
|
73
|
-
/**
|
|
74
|
-
* The calling step's context. An approver that waits on a human passes it
|
|
75
|
-
* to `ctx.harness.send` / `ctx.harness.recv` to park on a channel.
|
|
76
|
-
*/
|
|
77
|
-
ctx: Context;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* @public Decides whether a call to a tool that declares `needsApproval` may
|
|
81
|
-
* run. Configured once per harness (`AgentHarness({ approveToolCall })`) and
|
|
82
|
-
* consulted after every `beforeToolCall` layer has allowed the call. `allow`
|
|
83
|
-
* runs the call; any other action refuses it, with `guidance` as the reason.
|
|
84
|
-
* May be async and may wait — e.g. on a channel a human answers.
|
|
85
|
-
*/
|
|
86
|
-
export type ToolApprover = (params: ApproveToolCallParams) => SteeringDecision | Promise<SteeringDecision>;
|
|
87
62
|
/** @public Parameters passed to a steering rule's `afterModelCall` evaluation. */
|
|
88
63
|
export interface AfterModelCallParams<TState = unknown> {
|
|
89
64
|
response: LLMResponse;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noetic-tools/types",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Foundational type contracts and primitives shared across the Noetic framework (items, LLM config, adapters, steering, errors).",
|
|
6
6
|
"license": "Apache-2.0",
|