@arden-hq/loop 0.0.0-stage → 0.1.2
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/LICENSE +202 -0
- package/README.md +121 -2
- package/dist/abort.d.ts +9 -0
- package/dist/abort.d.ts.map +1 -0
- package/dist/abort.js +31 -0
- package/dist/abort.js.map +1 -0
- package/dist/agent/agent.d.ts +48 -0
- package/dist/agent/agent.d.ts.map +1 -0
- package/dist/agent/agent.js +146 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/background-tools.d.ts +51 -0
- package/dist/agent/background-tools.d.ts.map +1 -0
- package/dist/agent/background-tools.js +257 -0
- package/dist/agent/background-tools.js.map +1 -0
- package/dist/agent/budget.d.ts +5 -0
- package/dist/agent/budget.d.ts.map +1 -0
- package/dist/agent/budget.js +48 -0
- package/dist/agent/budget.js.map +1 -0
- package/dist/agent/config.d.ts +61 -0
- package/dist/agent/config.d.ts.map +1 -0
- package/dist/agent/config.js +99 -0
- package/dist/agent/config.js.map +1 -0
- package/dist/agent/guards.d.ts +10 -0
- package/dist/agent/guards.d.ts.map +1 -0
- package/dist/agent/guards.js +136 -0
- package/dist/agent/guards.js.map +1 -0
- package/dist/agent/history-journal.d.ts +18 -0
- package/dist/agent/history-journal.d.ts.map +1 -0
- package/dist/agent/history-journal.js +87 -0
- package/dist/agent/history-journal.js.map +1 -0
- package/dist/agent/history-projection.d.ts +6 -0
- package/dist/agent/history-projection.d.ts.map +1 -0
- package/dist/agent/history-projection.js +62 -0
- package/dist/agent/history-projection.js.map +1 -0
- package/dist/agent/interactions.d.ts +14 -0
- package/dist/agent/interactions.d.ts.map +1 -0
- package/dist/agent/interactions.js +85 -0
- package/dist/agent/interactions.js.map +1 -0
- package/dist/agent/middleware.d.ts +5 -0
- package/dist/agent/middleware.d.ts.map +1 -0
- package/dist/agent/middleware.js +55 -0
- package/dist/agent/middleware.js.map +1 -0
- package/dist/agent/model-output-projection.d.ts +27 -0
- package/dist/agent/model-output-projection.d.ts.map +1 -0
- package/dist/agent/model-output-projection.js +138 -0
- package/dist/agent/model-output-projection.js.map +1 -0
- package/dist/agent/model-output.d.ts +19 -0
- package/dist/agent/model-output.d.ts.map +1 -0
- package/dist/agent/model-output.js +172 -0
- package/dist/agent/model-output.js.map +1 -0
- package/dist/agent/model-turn.d.ts +29 -0
- package/dist/agent/model-turn.d.ts.map +1 -0
- package/dist/agent/model-turn.js +401 -0
- package/dist/agent/model-turn.js.map +1 -0
- package/dist/agent/policy.d.ts +28 -0
- package/dist/agent/policy.d.ts.map +1 -0
- package/dist/agent/policy.js +109 -0
- package/dist/agent/policy.js.map +1 -0
- package/dist/agent/provider-capabilities.d.ts +12 -0
- package/dist/agent/provider-capabilities.d.ts.map +1 -0
- package/dist/agent/provider-capabilities.js +76 -0
- package/dist/agent/provider-capabilities.js.map +1 -0
- package/dist/agent/recovery.d.ts +8 -0
- package/dist/agent/recovery.d.ts.map +1 -0
- package/dist/agent/recovery.js +21 -0
- package/dist/agent/recovery.js.map +1 -0
- package/dist/agent/replies.d.ts +3 -0
- package/dist/agent/replies.d.ts.map +1 -0
- package/dist/agent/replies.js +24 -0
- package/dist/agent/replies.js.map +1 -0
- package/dist/agent/run-state.d.ts +98 -0
- package/dist/agent/run-state.d.ts.map +1 -0
- package/dist/agent/run-state.js +454 -0
- package/dist/agent/run-state.js.map +1 -0
- package/dist/agent/run.d.ts +6 -0
- package/dist/agent/run.d.ts.map +1 -0
- package/dist/agent/run.js +462 -0
- package/dist/agent/run.js.map +1 -0
- package/dist/agent/streamed-call-history.d.ts +20 -0
- package/dist/agent/streamed-call-history.d.ts.map +1 -0
- package/dist/agent/streamed-call-history.js +71 -0
- package/dist/agent/streamed-call-history.js.map +1 -0
- package/dist/agent/streaming-tools.d.ts +23 -0
- package/dist/agent/streaming-tools.d.ts.map +1 -0
- package/dist/agent/streaming-tools.js +67 -0
- package/dist/agent/streaming-tools.js.map +1 -0
- package/dist/agent/structured-output.d.ts +27 -0
- package/dist/agent/structured-output.d.ts.map +1 -0
- package/dist/agent/structured-output.js +26 -0
- package/dist/agent/structured-output.js.map +1 -0
- package/dist/agent/tool-admission.d.ts +18 -0
- package/dist/agent/tool-admission.d.ts.map +1 -0
- package/dist/agent/tool-admission.js +22 -0
- package/dist/agent/tool-admission.js.map +1 -0
- package/dist/contracts/events.d.ts +236 -0
- package/dist/contracts/events.d.ts.map +1 -0
- package/dist/contracts/events.js +13 -0
- package/dist/contracts/events.js.map +1 -0
- package/dist/contracts/messages.d.ts +234 -0
- package/dist/contracts/messages.d.ts.map +1 -0
- package/dist/contracts/messages.js +11 -0
- package/dist/contracts/messages.js.map +1 -0
- package/dist/contracts/provider.d.ts +177 -0
- package/dist/contracts/provider.d.ts.map +1 -0
- package/dist/contracts/provider.js +26 -0
- package/dist/contracts/provider.js.map +1 -0
- package/dist/contracts/tools.d.ts +217 -0
- package/dist/contracts/tools.d.ts.map +1 -0
- package/dist/contracts/tools.js +16 -0
- package/dist/contracts/tools.js.map +1 -0
- package/dist/errors.d.ts +112 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +190 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/concurrency.d.ts +11 -0
- package/dist/internal/concurrency.d.ts.map +1 -0
- package/dist/internal/concurrency.js +86 -0
- package/dist/internal/concurrency.js.map +1 -0
- package/dist/internal/stream.d.ts +25 -0
- package/dist/internal/stream.d.ts.map +1 -0
- package/dist/internal/stream.js +97 -0
- package/dist/internal/stream.js.map +1 -0
- package/dist/internal/validate.d.ts +30 -0
- package/dist/internal/validate.d.ts.map +1 -0
- package/dist/internal/validate.js +480 -0
- package/dist/internal/validate.js.map +1 -0
- package/dist/providers/kit/errors.d.ts +40 -0
- package/dist/providers/kit/errors.d.ts.map +1 -0
- package/dist/providers/kit/errors.js +48 -0
- package/dist/providers/kit/errors.js.map +1 -0
- package/dist/providers/kit/index.d.ts +10 -0
- package/dist/providers/kit/index.d.ts.map +1 -0
- package/dist/providers/kit/index.js +10 -0
- package/dist/providers/kit/index.js.map +1 -0
- package/dist/providers/kit/retry.d.ts +43 -0
- package/dist/providers/kit/retry.d.ts.map +1 -0
- package/dist/providers/kit/retry.js +118 -0
- package/dist/providers/kit/retry.js.map +1 -0
- package/dist/providers/kit/sse.d.ts +22 -0
- package/dist/providers/kit/sse.d.ts.map +1 -0
- package/dist/providers/kit/sse.js +70 -0
- package/dist/providers/kit/sse.js.map +1 -0
- package/dist/providers/openai-responses/citations.d.ts +21 -0
- package/dist/providers/openai-responses/citations.d.ts.map +1 -0
- package/dist/providers/openai-responses/citations.js +65 -0
- package/dist/providers/openai-responses/citations.js.map +1 -0
- package/dist/providers/openai-responses/continuation.d.ts +19 -0
- package/dist/providers/openai-responses/continuation.d.ts.map +1 -0
- package/dist/providers/openai-responses/continuation.js +28 -0
- package/dist/providers/openai-responses/continuation.js.map +1 -0
- package/dist/providers/openai-responses/errors.d.ts +28 -0
- package/dist/providers/openai-responses/errors.d.ts.map +1 -0
- package/dist/providers/openai-responses/errors.js +103 -0
- package/dist/providers/openai-responses/errors.js.map +1 -0
- package/dist/providers/openai-responses/history.d.ts +8 -0
- package/dist/providers/openai-responses/history.d.ts.map +1 -0
- package/dist/providers/openai-responses/history.js +93 -0
- package/dist/providers/openai-responses/history.js.map +1 -0
- package/dist/providers/openai-responses/items.d.ts +106 -0
- package/dist/providers/openai-responses/items.d.ts.map +1 -0
- package/dist/providers/openai-responses/items.js +124 -0
- package/dist/providers/openai-responses/items.js.map +1 -0
- package/dist/providers/openai-responses/parameter-schema.d.ts +11 -0
- package/dist/providers/openai-responses/parameter-schema.d.ts.map +1 -0
- package/dist/providers/openai-responses/parameter-schema.js +186 -0
- package/dist/providers/openai-responses/parameter-schema.js.map +1 -0
- package/dist/providers/openai-responses/provider.d.ts +54 -0
- package/dist/providers/openai-responses/provider.d.ts.map +1 -0
- package/dist/providers/openai-responses/provider.js +270 -0
- package/dist/providers/openai-responses/provider.js.map +1 -0
- package/dist/providers/openai-responses/request.d.ts +41 -0
- package/dist/providers/openai-responses/request.d.ts.map +1 -0
- package/dist/providers/openai-responses/request.js +276 -0
- package/dist/providers/openai-responses/request.js.map +1 -0
- package/dist/providers/openai-responses/response.d.ts +7 -0
- package/dist/providers/openai-responses/response.d.ts.map +1 -0
- package/dist/providers/openai-responses/response.js +354 -0
- package/dist/providers/openai-responses/response.js.map +1 -0
- package/dist/providers/openai-responses/stored-items.d.ts +9 -0
- package/dist/providers/openai-responses/stored-items.d.ts.map +1 -0
- package/dist/providers/openai-responses/stored-items.js +133 -0
- package/dist/providers/openai-responses/stored-items.js.map +1 -0
- package/dist/providers/openai-responses/tool-search.d.ts +12 -0
- package/dist/providers/openai-responses/tool-search.d.ts.map +1 -0
- package/dist/providers/openai-responses/tool-search.js +68 -0
- package/dist/providers/openai-responses/tool-search.js.map +1 -0
- package/dist/providers/openai-responses/tools.d.ts +33 -0
- package/dist/providers/openai-responses/tools.d.ts.map +1 -0
- package/dist/providers/openai-responses/tools.js +53 -0
- package/dist/providers/openai-responses/tools.js.map +1 -0
- package/dist/providers/openai-responses/web-search.d.ts +5 -0
- package/dist/providers/openai-responses/web-search.d.ts.map +1 -0
- package/dist/providers/openai-responses/web-search.js +114 -0
- package/dist/providers/openai-responses/web-search.js.map +1 -0
- package/dist/providers/openai-responses/websocket.d.ts +29 -0
- package/dist/providers/openai-responses/websocket.d.ts.map +1 -0
- package/dist/providers/openai-responses/websocket.js +400 -0
- package/dist/providers/openai-responses/websocket.js.map +1 -0
- package/dist/tools/dispatch.d.ts +65 -0
- package/dist/tools/dispatch.d.ts.map +1 -0
- package/dist/tools/dispatch.js +536 -0
- package/dist/tools/dispatch.js.map +1 -0
- package/dist/tools/display-title.d.ts +18 -0
- package/dist/tools/display-title.d.ts.map +1 -0
- package/dist/tools/display-title.js +50 -0
- package/dist/tools/display-title.js.map +1 -0
- package/dist/tools/search.d.ts +36 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +224 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/tool.d.ts +200 -0
- package/dist/tools/tool.d.ts.map +1 -0
- package/dist/tools/tool.js +275 -0
- package/dist/tools/tool.js.map +1 -0
- package/dist/tools/truncate.d.ts +18 -0
- package/dist/tools/truncate.d.ts.map +1 -0
- package/dist/tools/truncate.js +76 -0
- package/dist/tools/truncate.js.map +1 -0
- package/package.json +67 -4
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import type { ChatMessage, ContentBlock, JsonObject, MaybePromise, Metadata, ToolCall } from "./messages.js";
|
|
2
|
+
export interface ToolMeta {
|
|
3
|
+
/**
|
|
4
|
+
* Start in the background at once. Any other call that can run in the
|
|
5
|
+
* background moves there when it outlives the foreground budget.
|
|
6
|
+
*/
|
|
7
|
+
readonly background?: boolean;
|
|
8
|
+
/** Returns a handle to its own long-running job; never also run in the background. */
|
|
9
|
+
readonly detached?: boolean;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
/** Executes upstream rather than through the local toolset. */
|
|
12
|
+
readonly hosted?: boolean;
|
|
13
|
+
readonly changes_state?: boolean;
|
|
14
|
+
readonly concurrency_group?: string | null;
|
|
15
|
+
readonly ends_turn?: EndsTurn;
|
|
16
|
+
readonly deferred?: boolean;
|
|
17
|
+
/** The namespace a deferred tool is found and loaded under. */
|
|
18
|
+
readonly group?: string;
|
|
19
|
+
/** Tools that produce this tool's required inputs; search loads them with it. */
|
|
20
|
+
readonly input_sources?: ReadonlyArray<ToolInputSource>;
|
|
21
|
+
readonly host?: Metadata;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Whether a successful call ends the run with its result as the final text:
|
|
25
|
+
* always, or only when one top-level argument
|
|
26
|
+
* has the given value (one tool whose `event: "blocked"` is a verdict on the whole run, while its other
|
|
27
|
+
* events let the run go on).
|
|
28
|
+
*/
|
|
29
|
+
export type EndsTurn = boolean | {
|
|
30
|
+
readonly argument: string;
|
|
31
|
+
readonly equals: string;
|
|
32
|
+
};
|
|
33
|
+
/** Whether this call, with these arguments, ends the run. */
|
|
34
|
+
export declare const callEndsTurn: (meta: {
|
|
35
|
+
readonly ends_turn?: EndsTurn;
|
|
36
|
+
} | undefined, args: Readonly<Record<string, unknown>>) => boolean;
|
|
37
|
+
/** Whether some call of this tool may end the run. */
|
|
38
|
+
export declare const mayEndTurn: (meta: {
|
|
39
|
+
readonly ends_turn?: EndsTurn;
|
|
40
|
+
} | undefined) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether calls of this tool can run in the background: hosted tools run
|
|
43
|
+
* upstream, turn-ending ones must stand alone and last, and detached ones
|
|
44
|
+
* already return their own job handle.
|
|
45
|
+
*/
|
|
46
|
+
export declare const canRunInBackground: (meta: Pick<ToolMeta, "hosted" | "detached" | "ends_turn"> | undefined) => boolean;
|
|
47
|
+
/** One required input and the tools that can produce its value. */
|
|
48
|
+
export interface ToolInputSource {
|
|
49
|
+
readonly input: string;
|
|
50
|
+
readonly tools: ReadonlyArray<string>;
|
|
51
|
+
}
|
|
52
|
+
/** One tool as a toolset advertises it; `meta.name` names it. */
|
|
53
|
+
export interface ToolEntry {
|
|
54
|
+
readonly description: string;
|
|
55
|
+
readonly parameters: JsonSchema;
|
|
56
|
+
readonly meta: ToolMeta;
|
|
57
|
+
}
|
|
58
|
+
/** Standard JSON Schema; each provider maps it to its own wire dialect. */
|
|
59
|
+
export type JsonSchema = Readonly<Record<string, unknown>>;
|
|
60
|
+
/** The provider-neutral declaration of one tool in a model request. */
|
|
61
|
+
export interface ToolDeclaration {
|
|
62
|
+
readonly name: string;
|
|
63
|
+
readonly description: string;
|
|
64
|
+
readonly parameters: JsonSchema;
|
|
65
|
+
/** Executes upstream; the provider maps it to its own hosted tool. */
|
|
66
|
+
readonly hosted?: boolean;
|
|
67
|
+
/** The provider may deliver this call's output after the response ends. */
|
|
68
|
+
readonly async?: boolean;
|
|
69
|
+
/** The namespace a deferred tool loads under. */
|
|
70
|
+
readonly group?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A request's client-side tool search. The loop builds it; a provider with
|
|
74
|
+
* native client-executed search declares its description and parameters and
|
|
75
|
+
* answers the model's search calls through `search`.
|
|
76
|
+
*/
|
|
77
|
+
export interface ToolSearch {
|
|
78
|
+
/** Model-facing description, including the stable catalog listing. */
|
|
79
|
+
readonly description: string;
|
|
80
|
+
readonly parameters: JsonSchema;
|
|
81
|
+
readonly search: (input: {
|
|
82
|
+
readonly query: string;
|
|
83
|
+
readonly limit?: number;
|
|
84
|
+
}) => ToolSearchResult;
|
|
85
|
+
/** Exact declarations for names, without companions: the same names always render the same. */
|
|
86
|
+
readonly lookup: (names: ReadonlyArray<string>) => ReadonlyArray<ToolDeclaration>;
|
|
87
|
+
}
|
|
88
|
+
export interface ToolSearchResult {
|
|
89
|
+
/** Selected primary declarations, then unloaded companions outside the primary-match limit. */
|
|
90
|
+
readonly tools: ReadonlyArray<ToolDeclaration>;
|
|
91
|
+
/** Selected primary matches within the limit, including ones already loaded. */
|
|
92
|
+
readonly matched: ReadonlyArray<string>;
|
|
93
|
+
}
|
|
94
|
+
export interface ToolResult {
|
|
95
|
+
readonly content: string;
|
|
96
|
+
readonly preview: string;
|
|
97
|
+
readonly is_error?: boolean;
|
|
98
|
+
readonly retryable?: boolean | null;
|
|
99
|
+
readonly data?: JsonObject | null;
|
|
100
|
+
readonly message_extras?: Metadata;
|
|
101
|
+
readonly host?: Metadata;
|
|
102
|
+
readonly model_content?: ReadonlyArray<ContentBlock>;
|
|
103
|
+
}
|
|
104
|
+
export type ToolArgumentErrorCode = "invalid_tool_arguments" | "unavailable_tool";
|
|
105
|
+
export interface ToolArgumentError {
|
|
106
|
+
readonly code: ToolArgumentErrorCode;
|
|
107
|
+
readonly message: string;
|
|
108
|
+
}
|
|
109
|
+
export interface PendingToolCall {
|
|
110
|
+
readonly toolCall: ToolCall;
|
|
111
|
+
readonly name: string;
|
|
112
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
113
|
+
readonly displayTitle?: string;
|
|
114
|
+
readonly argumentError?: ToolArgumentError;
|
|
115
|
+
}
|
|
116
|
+
/** Host-confirmed approval for this exact tool call. */
|
|
117
|
+
export interface ToolApprovalContext {
|
|
118
|
+
readonly approved: true;
|
|
119
|
+
/**
|
|
120
|
+
* A reviewer model approved this call on the person's behalf, judging the
|
|
121
|
+
* card they would have seen; absent, the person approved it themselves.
|
|
122
|
+
*/
|
|
123
|
+
readonly reviewer?: true;
|
|
124
|
+
readonly feedback: string | null;
|
|
125
|
+
/** The user also saved a standing rule with this approval. */
|
|
126
|
+
readonly grantStanding?: boolean;
|
|
127
|
+
/** Host-private, durable data captured when this exact call was reviewed. */
|
|
128
|
+
readonly data?: JsonObject;
|
|
129
|
+
/** The person changed this call's arguments while approving it. */
|
|
130
|
+
readonly edited?: ToolApprovalEdits;
|
|
131
|
+
/**
|
|
132
|
+
* The person chose the tool's own alternative on the card instead of the
|
|
133
|
+
* call as asked: `draft` keeps a message as a draft and never sends it. The
|
|
134
|
+
* host runs only tools that offer it; the call settles with that result.
|
|
135
|
+
*/
|
|
136
|
+
readonly alternative?: "draft";
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Arguments a person edited on the approval card. The call runs with
|
|
140
|
+
* `arguments`, validated by the tool's own schema like any call; `requested`
|
|
141
|
+
* is what the model asked for, so the tool can tell it what changed.
|
|
142
|
+
*/
|
|
143
|
+
export interface ToolApprovalEdits {
|
|
144
|
+
readonly requested: JsonObject;
|
|
145
|
+
readonly arguments: JsonObject;
|
|
146
|
+
}
|
|
147
|
+
/** One live progress update pushed by a running tool. */
|
|
148
|
+
export interface ToolProgressUpdate {
|
|
149
|
+
readonly message: string;
|
|
150
|
+
readonly data?: Readonly<Record<string, unknown>>;
|
|
151
|
+
}
|
|
152
|
+
export interface ToolCallRequest {
|
|
153
|
+
readonly name: string;
|
|
154
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
155
|
+
readonly toolCallId: string;
|
|
156
|
+
readonly approval?: ToolApprovalContext;
|
|
157
|
+
readonly signal?: AbortSignal;
|
|
158
|
+
/** Read-only view of the canonical history at call time. */
|
|
159
|
+
readonly messages?: ReadonlyArray<ChatMessage>;
|
|
160
|
+
/** Fire-and-forget progress channel bound to this call's identity. */
|
|
161
|
+
readonly emit?: (update: ToolProgressUpdate) => void;
|
|
162
|
+
/** Recheck after host approval/locks, immediately before an unstarted effect. */
|
|
163
|
+
readonly beforeExecute?: () => Promise<ToolResult | undefined>;
|
|
164
|
+
/**
|
|
165
|
+
* The toolset reports where the call is: `waiting` before its effect (an
|
|
166
|
+
* approval gate, a host lock), `executing` once its effect begins. The
|
|
167
|
+
* loop's foreground budget counts from `executing`, or from `execute` for a
|
|
168
|
+
* toolset that never reports.
|
|
169
|
+
*/
|
|
170
|
+
readonly phase?: (phase: ToolPhase) => void;
|
|
171
|
+
/**
|
|
172
|
+
* Resolves when the loop moves this still-running call to the background:
|
|
173
|
+
* the model has a receipt and the call's result arrives later. A host that
|
|
174
|
+
* holds its own state-change lock releases it here, as the loop does.
|
|
175
|
+
*/
|
|
176
|
+
readonly backgrounded?: Promise<void>;
|
|
177
|
+
}
|
|
178
|
+
export type ToolPhase = "waiting" | "executing";
|
|
179
|
+
/** A background call a paused run left running, held by the host until claimed or stopped. */
|
|
180
|
+
export interface HeldToolCall {
|
|
181
|
+
readonly toolCallId: string;
|
|
182
|
+
/** Its outcome; undefined when it settles without one (it paused or was stopped). */
|
|
183
|
+
readonly result: Promise<ToolResult | undefined>;
|
|
184
|
+
/** Aborts the call (and the others it was started beside). */
|
|
185
|
+
readonly stop: () => void;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* A host's opt-in display-title argument: every tool schema advertises it,
|
|
189
|
+
* the loop strips it before validation, sanitizes it (control characters to
|
|
190
|
+
* spaces, whitespace collapsed, capped at `maxLength` code points) and
|
|
191
|
+
* persists it as `ToolCall.display_title`.
|
|
192
|
+
*/
|
|
193
|
+
export interface ToolDisplayTitle {
|
|
194
|
+
readonly argument: string;
|
|
195
|
+
readonly maxLength: number;
|
|
196
|
+
}
|
|
197
|
+
export interface Toolset {
|
|
198
|
+
/** The display-title argument this toolset's schemas advertise, if any. */
|
|
199
|
+
readonly displayTitle?: ToolDisplayTitle;
|
|
200
|
+
readonly entries: () => MaybePromise<ReadonlyArray<ToolEntry>>;
|
|
201
|
+
/** Resolve metadata for a tool omitted from the advertised catalog. */
|
|
202
|
+
readonly metadata?: (name: string) => MaybePromise<ToolMeta | undefined>;
|
|
203
|
+
readonly loadedNames: () => MaybePromise<ReadonlySet<string>>;
|
|
204
|
+
readonly load: (names: ReadonlySet<string>) => MaybePromise<void>;
|
|
205
|
+
readonly seedLoadedNames?: (names: ReadonlySet<string>) => MaybePromise<void>;
|
|
206
|
+
readonly execute: (request: ToolCallRequest) => MaybePromise<ToolResult>;
|
|
207
|
+
/** Settle an unstarted admission refusal through the host's durable owner. */
|
|
208
|
+
readonly settleRefusal?: (request: ToolCallRequest, result: ToolResult) => MaybePromise<ToolResult>;
|
|
209
|
+
/**
|
|
210
|
+
* Pure harness-owned decoration applied to every model-visible outcome,
|
|
211
|
+
* including validation failures, durable recovery, and batch rejection.
|
|
212
|
+
*/
|
|
213
|
+
readonly decorateResult?: (request: ToolCallRequest, result: ToolResult) => ToolResult;
|
|
214
|
+
}
|
|
215
|
+
export type ToolCallNext = (request: ToolCallRequest) => MaybePromise<ToolResult>;
|
|
216
|
+
export type ToolCallMiddleware = (request: ToolCallRequest, next: ToolCallNext) => MaybePromise<ToolResult>;
|
|
217
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/contracts/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,YAA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,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,CAAA;IACjE,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,CAAA;IAC7E,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,YAAY,CAAC,UAAU,CAAC,CAAA;IACxE,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,CAAC,EAAE,CACvB,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,UAAU,KACf,YAAY,CAAC,UAAU,CAAC,CAAA;IAC7B;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,KAAK,UAAU,CAAA;CACvF;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,eAAe,KAAK,YAAY,CAAC,UAAU,CAAC,CAAA;AACjF,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,YAAY,KACf,YAAY,CAAC,UAAU,CAAC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Whether this call, with these arguments, ends the run. */
|
|
2
|
+
export const callEndsTurn = (meta, args) => {
|
|
3
|
+
const rule = meta?.ends_turn;
|
|
4
|
+
if (rule === undefined || typeof rule === "boolean")
|
|
5
|
+
return rule === true;
|
|
6
|
+
return args[rule.argument] === rule.equals;
|
|
7
|
+
};
|
|
8
|
+
/** Whether some call of this tool may end the run. */
|
|
9
|
+
export const mayEndTurn = (meta) => meta?.ends_turn !== undefined && meta.ends_turn !== false;
|
|
10
|
+
/**
|
|
11
|
+
* Whether calls of this tool can run in the background: hosted tools run
|
|
12
|
+
* upstream, turn-ending ones must stand alone and last, and detached ones
|
|
13
|
+
* already return their own job handle.
|
|
14
|
+
*/
|
|
15
|
+
export const canRunInBackground = (meta) => meta?.hosted !== true && meta?.detached !== true && !mayEndTurn(meta);
|
|
16
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/contracts/tools.ts"],"names":[],"mappings":"AAuCA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,IAAmD,EACnD,IAAuC,EAC9B,EAAE;IACX,MAAM,IAAI,GAAG,IAAI,EAAE,SAAS,CAAA;IAC5B,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,KAAK,IAAI,CAAA;IACzE,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,MAAM,CAAA;AAC5C,CAAC,CAAA;AAED,sDAAsD;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAmD,EAAW,EAAE,CACzF,IAAI,EAAE,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,CAAA;AAE3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,IAAqE,EAC5D,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,IAAI,IAAI,EAAE,QAAQ,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { JsonObject, StandardSchemaV1 } from "./contracts/messages.js";
|
|
2
|
+
import type { ToolResult } from "./contracts/tools.js";
|
|
3
|
+
export declare class LoopError extends Error {
|
|
4
|
+
readonly _tag: string;
|
|
5
|
+
readonly cause?: unknown;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
constructor(tag: string, message: string, cause?: unknown);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Closed classification of a model-provider failure, attached where the
|
|
11
|
+
* failure is thrown. Hosts map it straight onto their own wire contract
|
|
12
|
+
* instead of re-deriving it from error messages.
|
|
13
|
+
*/
|
|
14
|
+
export type ProviderErrorCode = "context_length_exceeded" | "rate_limited" | "provider_auth" | "provider_unavailable" | "provider_error"
|
|
15
|
+
/**
|
|
16
|
+
* The provider refused the request Arden built (HTTP 400
|
|
17
|
+
* `invalid_request_error`), or the adapter could not build one from the
|
|
18
|
+
* stored history. Arden's defect, not the person's input or the weather.
|
|
19
|
+
*/
|
|
20
|
+
| "request_invalid"
|
|
21
|
+
/**
|
|
22
|
+
* The provider will not run the requested model for this account or route:
|
|
23
|
+
* a model it does not offer, or one this sign-in may not use. Trying again
|
|
24
|
+
* never helps; only another model or another account does.
|
|
25
|
+
*/
|
|
26
|
+
| "model_unavailable";
|
|
27
|
+
export declare const isProviderErrorCode: (value: unknown) => value is ProviderErrorCode;
|
|
28
|
+
/** The classification carried by `cause`, or by the nearest of its causes that has one. */
|
|
29
|
+
export declare const providerErrorCode: (cause: unknown) => ProviderErrorCode | undefined;
|
|
30
|
+
export declare class InvalidAgentConfigError extends LoopError {
|
|
31
|
+
constructor(message: string);
|
|
32
|
+
}
|
|
33
|
+
export declare class ProtocolContractError extends LoopError {
|
|
34
|
+
readonly subject: string;
|
|
35
|
+
constructor(subject: string, cause: unknown);
|
|
36
|
+
}
|
|
37
|
+
export declare class InvalidModelResponseError extends LoopError {
|
|
38
|
+
constructor(message: string);
|
|
39
|
+
}
|
|
40
|
+
export declare class ModelProviderError extends LoopError {
|
|
41
|
+
readonly code: ProviderErrorCode;
|
|
42
|
+
constructor(message: string, cause?: unknown);
|
|
43
|
+
}
|
|
44
|
+
export declare class ModelRequestMiddlewareError extends LoopError {
|
|
45
|
+
constructor(message: string, cause?: unknown);
|
|
46
|
+
}
|
|
47
|
+
export declare class HookError extends LoopError {
|
|
48
|
+
readonly hook: string;
|
|
49
|
+
constructor(hook: string, message: string, cause?: unknown);
|
|
50
|
+
}
|
|
51
|
+
export declare class ToolsetError extends LoopError {
|
|
52
|
+
constructor(message: string, cause?: unknown);
|
|
53
|
+
}
|
|
54
|
+
export declare class AgentInvariantError extends LoopError {
|
|
55
|
+
constructor(message: string);
|
|
56
|
+
}
|
|
57
|
+
export declare class AgentCallbackError extends LoopError {
|
|
58
|
+
readonly operation: string;
|
|
59
|
+
constructor(operation: string, message: string, cause?: unknown);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The final text failed structured-output validation even after the one
|
|
63
|
+
* correction retry. Carries the Standard Schema issues of the last attempt.
|
|
64
|
+
*/
|
|
65
|
+
export declare class StructuredOutputError extends LoopError {
|
|
66
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
67
|
+
constructor(message: string, issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
68
|
+
}
|
|
69
|
+
/** The effective model route cannot constrain a requested structured response. */
|
|
70
|
+
export declare class UnsupportedStructuredOutputError extends LoopError {
|
|
71
|
+
readonly model: string;
|
|
72
|
+
constructor(model: string);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A host deliberately suspended a tool while it waits for external input.
|
|
76
|
+
* `presentation` is the host's own card shape; the loop carries it untouched.
|
|
77
|
+
*/
|
|
78
|
+
export declare class PauseRequested<Presentation = unknown> extends LoopError {
|
|
79
|
+
readonly reason: string;
|
|
80
|
+
readonly detail?: string;
|
|
81
|
+
readonly preview?: string;
|
|
82
|
+
readonly diff?: string;
|
|
83
|
+
readonly presentation?: Presentation;
|
|
84
|
+
readonly data?: JsonObject;
|
|
85
|
+
constructor(reason: string, detail?: string, options?: {
|
|
86
|
+
readonly preview?: string;
|
|
87
|
+
readonly diff?: string;
|
|
88
|
+
readonly presentation?: Presentation;
|
|
89
|
+
readonly data?: JsonObject;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** A safe, model-facing tool failure reported by a host adapter. */
|
|
93
|
+
export declare class ToolExecutionError extends LoopError {
|
|
94
|
+
readonly preview?: string;
|
|
95
|
+
readonly retryable?: boolean | null;
|
|
96
|
+
readonly diagnosticRef?: string;
|
|
97
|
+
/** Host facts the failed call still carries into its result (`ToolResult.host`). */
|
|
98
|
+
readonly host?: Readonly<Record<string, unknown>>;
|
|
99
|
+
constructor(message: string, options?: {
|
|
100
|
+
readonly preview?: string;
|
|
101
|
+
readonly retryable?: boolean | null;
|
|
102
|
+
readonly diagnosticRef?: string;
|
|
103
|
+
readonly host?: Readonly<Record<string, unknown>>;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/** The failed result a thrown {@link ToolExecutionError} becomes in the transcript. */
|
|
107
|
+
export declare const failedToolResult: (failure: ToolExecutionError) => ToolResult;
|
|
108
|
+
export type ToolFailure = PauseRequested | ToolExecutionError | ToolsetError;
|
|
109
|
+
export type AgentError = ProtocolContractError | InvalidModelResponseError | ModelProviderError | ModelRequestMiddlewareError | HookError | ToolsetError | AgentInvariantError | AgentCallbackError | StructuredOutputError | UnsupportedStructuredOutputError;
|
|
110
|
+
/** Normalize a thrown tool failure at the loop boundary. */
|
|
111
|
+
export declare const toToolFailure: (cause: unknown) => PauseRequested | ToolExecutionError;
|
|
112
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,qBAAa,SAAU,SAAQ,KAAK;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,SAAkB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEjC,SAAkB,IAAI,EAAE,MAAM,CAAA;IAE9B,YAAY,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,C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E,qBAAa,kBAAmB,SAAQ,SAAS;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,oFAAoF;IACpF,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAEjD,YACE,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QACP,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;QACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;QACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;QAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;KAC7C,EAOP;CACF;AAED,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,YAAa,kBAAkB,KAAG,UAM7D,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,kBAAkB,GAAG,YAAY,CAAA;AAE5E,MAAM,MAAM,UAAU,GAClB,qBAAqB,GACrB,yBAAyB,GACzB,kBAAkB,GAClB,2BAA2B,GAC3B,SAAS,GACT,YAAY,GACZ,mBAAmB,GACnB,kBAAkB,GAClB,qBAAqB,GACrB,gCAAgC,CAAA;AAKpC,4DAA4D;AAC5D,eAAO,MAAM,aAAa,UAAW,OAAO,KAAG,cAAc,GAAG,kBA+B/D,CAAA"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { errorMessage } from "@arden-hq/std/errors";
|
|
2
|
+
export class LoopError extends Error {
|
|
3
|
+
_tag;
|
|
4
|
+
cause;
|
|
5
|
+
name;
|
|
6
|
+
constructor(tag, message, cause) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = tag;
|
|
9
|
+
this._tag = tag;
|
|
10
|
+
if (cause !== undefined)
|
|
11
|
+
this.cause = cause;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const PROVIDER_ERROR_CODES = new Set([
|
|
15
|
+
"context_length_exceeded",
|
|
16
|
+
"rate_limited",
|
|
17
|
+
"provider_auth",
|
|
18
|
+
"provider_unavailable",
|
|
19
|
+
"provider_error",
|
|
20
|
+
"request_invalid",
|
|
21
|
+
"model_unavailable"
|
|
22
|
+
]);
|
|
23
|
+
export const isProviderErrorCode = (value) => typeof value === "string" && PROVIDER_ERROR_CODES.has(value);
|
|
24
|
+
/** The classification carried by `cause`, or by the nearest of its causes that has one. */
|
|
25
|
+
export const providerErrorCode = (cause) => {
|
|
26
|
+
const seen = new Set();
|
|
27
|
+
let current = cause;
|
|
28
|
+
while (current instanceof Error && !seen.has(current)) {
|
|
29
|
+
seen.add(current);
|
|
30
|
+
const code = current.code;
|
|
31
|
+
if (isProviderErrorCode(code))
|
|
32
|
+
return code;
|
|
33
|
+
current = current.cause;
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
};
|
|
37
|
+
export class InvalidAgentConfigError extends LoopError {
|
|
38
|
+
constructor(message) {
|
|
39
|
+
super("InvalidAgentConfigError", message);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export class ProtocolContractError extends LoopError {
|
|
43
|
+
subject;
|
|
44
|
+
constructor(subject, cause) {
|
|
45
|
+
super("ProtocolContractError", `invalid ${subject} protocol value`, cause);
|
|
46
|
+
this.subject = subject;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export class InvalidModelResponseError extends LoopError {
|
|
50
|
+
constructor(message) {
|
|
51
|
+
super("InvalidModelResponseError", message);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export class ModelProviderError extends LoopError {
|
|
55
|
+
code;
|
|
56
|
+
constructor(message, cause) {
|
|
57
|
+
super("ModelProviderError", message, cause);
|
|
58
|
+
this.code = providerErrorCode(cause) ?? "provider_error";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export class ModelRequestMiddlewareError extends LoopError {
|
|
62
|
+
constructor(message, cause) {
|
|
63
|
+
super("ModelRequestMiddlewareError", message, cause);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export class HookError extends LoopError {
|
|
67
|
+
hook;
|
|
68
|
+
constructor(hook, message, cause) {
|
|
69
|
+
super("HookError", message, cause);
|
|
70
|
+
this.hook = hook;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export class ToolsetError extends LoopError {
|
|
74
|
+
constructor(message, cause) {
|
|
75
|
+
super("ToolsetError", message, cause);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export class AgentInvariantError extends LoopError {
|
|
79
|
+
constructor(message) {
|
|
80
|
+
super("AgentInvariantError", message);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export class AgentCallbackError extends LoopError {
|
|
84
|
+
operation;
|
|
85
|
+
constructor(operation, message, cause) {
|
|
86
|
+
super("AgentCallbackError", message, cause);
|
|
87
|
+
this.operation = operation;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The final text failed structured-output validation even after the one
|
|
92
|
+
* correction retry. Carries the Standard Schema issues of the last attempt.
|
|
93
|
+
*/
|
|
94
|
+
export class StructuredOutputError extends LoopError {
|
|
95
|
+
issues;
|
|
96
|
+
constructor(message, issues) {
|
|
97
|
+
super("StructuredOutputError", message);
|
|
98
|
+
this.issues = issues;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/** The effective model route cannot constrain a requested structured response. */
|
|
102
|
+
export class UnsupportedStructuredOutputError extends LoopError {
|
|
103
|
+
model;
|
|
104
|
+
constructor(model) {
|
|
105
|
+
super("UnsupportedStructuredOutputError", `Model ${model} does not support constrained structured output`);
|
|
106
|
+
this.model = model;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A host deliberately suspended a tool while it waits for external input.
|
|
111
|
+
* `presentation` is the host's own card shape; the loop carries it untouched.
|
|
112
|
+
*/
|
|
113
|
+
export class PauseRequested extends LoopError {
|
|
114
|
+
reason;
|
|
115
|
+
detail;
|
|
116
|
+
preview;
|
|
117
|
+
diff;
|
|
118
|
+
presentation;
|
|
119
|
+
data;
|
|
120
|
+
constructor(reason, detail, options = {}) {
|
|
121
|
+
super("PauseRequested", reason);
|
|
122
|
+
this.reason = reason;
|
|
123
|
+
if (detail !== undefined)
|
|
124
|
+
this.detail = detail;
|
|
125
|
+
if (options.preview !== undefined)
|
|
126
|
+
this.preview = options.preview;
|
|
127
|
+
if (options.diff !== undefined)
|
|
128
|
+
this.diff = options.diff;
|
|
129
|
+
if (options.presentation !== undefined)
|
|
130
|
+
this.presentation = options.presentation;
|
|
131
|
+
if (options.data !== undefined)
|
|
132
|
+
this.data = options.data;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/** A safe, model-facing tool failure reported by a host adapter. */
|
|
136
|
+
export class ToolExecutionError extends LoopError {
|
|
137
|
+
preview;
|
|
138
|
+
retryable;
|
|
139
|
+
diagnosticRef;
|
|
140
|
+
/** Host facts the failed call still carries into its result (`ToolResult.host`). */
|
|
141
|
+
host;
|
|
142
|
+
constructor(message, options = {}) {
|
|
143
|
+
super("ToolExecutionError", message);
|
|
144
|
+
if (options.preview !== undefined)
|
|
145
|
+
this.preview = options.preview;
|
|
146
|
+
if (options.retryable !== undefined)
|
|
147
|
+
this.retryable = options.retryable;
|
|
148
|
+
if (options.diagnosticRef !== undefined)
|
|
149
|
+
this.diagnosticRef = options.diagnosticRef;
|
|
150
|
+
if (options.host !== undefined)
|
|
151
|
+
this.host = options.host;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** The failed result a thrown {@link ToolExecutionError} becomes in the transcript. */
|
|
155
|
+
export const failedToolResult = (failure) => ({
|
|
156
|
+
content: failure.message,
|
|
157
|
+
preview: failure.preview ?? "Tool execution failed",
|
|
158
|
+
is_error: true,
|
|
159
|
+
retryable: failure.retryable ?? false,
|
|
160
|
+
...(failure.host === undefined ? {} : { host: failure.host })
|
|
161
|
+
});
|
|
162
|
+
const isTagged = (value) => typeof value === "object" && value !== null && "_tag" in value && typeof value._tag === "string";
|
|
163
|
+
/** Normalize a thrown tool failure at the loop boundary. */
|
|
164
|
+
export const toToolFailure = (cause) => {
|
|
165
|
+
if (cause instanceof PauseRequested || cause instanceof ToolExecutionError)
|
|
166
|
+
return cause;
|
|
167
|
+
const record = (typeof cause === "object" && cause !== null ? cause : {});
|
|
168
|
+
if (isTagged(cause) && cause._tag === "PauseRequested") {
|
|
169
|
+
return new PauseRequested(typeof record.reason === "string" ? record.reason : "paused", typeof record.detail === "string" ? record.detail : undefined, {
|
|
170
|
+
...(typeof record.preview === "string" ? { preview: record.preview } : {}),
|
|
171
|
+
...(typeof record.diff === "string" ? { diff: record.diff } : {}),
|
|
172
|
+
...(typeof record.presentation === "object" &&
|
|
173
|
+
record.presentation !== null &&
|
|
174
|
+
!Array.isArray(record.presentation)
|
|
175
|
+
? { presentation: record.presentation }
|
|
176
|
+
: {}),
|
|
177
|
+
...(typeof record.data === "object" && record.data !== null && !Array.isArray(record.data)
|
|
178
|
+
? { data: record.data }
|
|
179
|
+
: {})
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
return new ToolExecutionError(errorMessage(cause), {
|
|
183
|
+
...(typeof record.preview === "string" ? { preview: record.preview } : {}),
|
|
184
|
+
...(typeof record.retryable === "boolean" || record.retryable === null
|
|
185
|
+
? { retryable: record.retryable }
|
|
186
|
+
: {}),
|
|
187
|
+
...(typeof record.diagnosticRef === "string" ? { diagnosticRef: record.diagnosticRef } : {})
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"err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ports are
|
|
3
|
+
* "./providers/openai-responses" (the bundled provider) and "./provider-kit"
|
|
4
|
+
* (what a provider needs besides these contracts); everything else imports the root.
|
|
5
|
+
*/
|
|
6
|
+
export { pendingBackgroundCalls } from "./agent/background-tools.js";
|
|
7
|
+
export { isConversationalInput, isHumanMessage } from "./agent/interactions.js";
|
|
8
|
+
export type { InputEnvelope } from "./agent/interactions.js";
|
|
9
|
+
export { makeAgent } from "./agent/agent.js";
|
|
10
|
+
export { resolveModelCapabilities } from "./agent/provider-capabilities.js";
|
|
11
|
+
export type { Agent, AgentInvocationOptions, AgentOptions } from "./agent/agent.js";
|
|
12
|
+
export type { AgentCostGetter } from "./agent/run-state.js";
|
|
13
|
+
export type { HistoryChange } from "./agent/history-journal.js";
|
|
14
|
+
export type { AgentOutputOptions } from "./agent/structured-output.js";
|
|
15
|
+
export type { AgentConfig, AgentConfigInput } from "./agent/config.js";
|
|
16
|
+
export { AgentCallbackError, AgentInvariantError, HookError, InvalidAgentConfigError, InvalidModelResponseError, LoopError, ModelProviderError, ModelRequestMiddlewareError, PauseRequested, ProtocolContractError, StructuredOutputError, UnsupportedStructuredOutputError, ToolExecutionError, ToolsetError, failedToolResult, isProviderErrorCode, providerErrorCode, toToolFailure } from "./errors.js";
|
|
17
|
+
export type { AgentError, ProviderErrorCode, ToolFailure } from "./errors.js";
|
|
18
|
+
export { ToolChoice, usageInputTokens } from "./contracts/provider.js";
|
|
19
|
+
export { decodeMessage } from "./internal/validate.js";
|
|
20
|
+
export { makeRunBudget } from "./agent/budget.js";
|
|
21
|
+
export { createTool, createToolset, INVALID_ARGUMENTS_OUTCOME } from "./tools/tool.js";
|
|
22
|
+
export type { CreateToolsetOptions, JsonSchemaConverter, LoopToolMetadata, Tool, ToolApprovalCall, ToolApprovalDecision, ToolApprovalGate, ToolApprovalPrompt, ToolContext, ToolDefinition, ToolExecuteOptions, ToolMetadata, ToolResultOutput } from "./tools/tool.js";
|
|
23
|
+
export { DEFAULT_TRUNCATE_MAX_BYTES, DEFAULT_TRUNCATE_MAX_LINES, truncateToolResult } from "./tools/truncate.js";
|
|
24
|
+
export type { TruncateToolResultOptions } from "./tools/truncate.js";
|
|
25
|
+
export { defaultToolSearchStrategy, makeToolSearch } from "./tools/search.js";
|
|
26
|
+
export { splitToolArguments } from "./tools/display-title.js";
|
|
27
|
+
export { makeFairReadWriteLock } from "./internal/concurrency.js";
|
|
28
|
+
export type { ToolSearchDocument, ToolSearchStrategy } from "./tools/search.js";
|
|
29
|
+
export type { AssistantMessage, AssistantOutputPart, AssistantTextPhase, AudioContent, ChatMessage, ContentBlock, ContextContent, FunctionCall, ImageContent, Interaction, InteractionActor, InteractionActorType, InteractionReference, ReplyContext, JsonObject, JsonPrimitive, JsonValue, MaybePromise, MessageIdMinter, Metadata, ModelContentBlock, ModelMessage, ProviderState, ProviderToolCall, Role, StandardSchemaV1, SystemMessage, TextContent, AsyncToolLaunch, ToolCall, ToolResultMessage, UserMessage } from "./contracts/messages.js";
|
|
30
|
+
export { callEndsTurn, mayEndTurn } from "./contracts/tools.js";
|
|
31
|
+
export type { EndsTurn, HeldToolCall, JsonSchema, PendingToolCall, ToolApprovalContext, ToolApprovalEdits, ToolArgumentError, ToolArgumentErrorCode, ToolCallMiddleware, ToolCallNext, ToolCallRequest, ToolDeclaration, ToolEntry, ToolInputSource, ToolMeta, ToolSearch, ToolSearchResult, ToolPhase, ToolProgressUpdate, ToolResult, Toolset, ToolDisplayTitle } from "./contracts/tools.js";
|
|
32
|
+
export type { CompletionResponse, FinishReason, ModelCapabilities, ImageInputLimits, ModelProvider, ModelProviderRequest, ModelProviderSession, ModelRequest, ModelRequestMiddleware, ModelRequestNext, ModelSource, ModelStreamItem, ProviderMessage, ProviderStreamRetry, ProviderToolCallDelta, ReasoningContentDelta, ResponseFormat, TextContentDelta, ToolCallStreamDelta, OutputItemReady, Usage } from "./contracts/provider.js";
|
|
33
|
+
export type { AgentEvent, AgentHooks, AgentStreamEvent, EventBase, FinalTextSuperseded, InputTaken, ModelResponseReset, ModelStreamRetry, PendingToolRequest, ReasoningDelta, ReasoningEnded, ReasoningStarted, Result, RunBudget, RunBudgetOptions, RunBudgetSnapshot, RunPolicy, StopReason, TextDelta, TextEnded, TextPhaseResolved, TextStarted, ToolCompleted, ToolInputDelta, ToolInputEnded, ToolInputStarted, ToolPaused, ToolProgress, ToolStarted } from "./contracts/events.js";
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC/E,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,YAAY,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACnF,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEtE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEtE,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,uBAAuB,EACvB,yBAAyB,EACzB,SAAS,EACT,kBAAkB,EAClB,2BAA2B,EAC3B,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,gCAAgC,EAChC,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACd,MAAM,a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 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The root export surface of @arden-hq/loop. The subpath exports are
|
|
3
|
+
* "./providers/openai-responses" (the bundled provider) and "./provider-kit"
|
|
4
|
+
* (what a provider needs besides these contracts); everything else imports the root.
|
|
5
|
+
*/
|
|
6
|
+
export { pendingBackgroundCalls } from "./agent/background-tools.js";
|
|
7
|
+
export { isConversationalInput, isHumanMessage } from "./agent/interactions.js";
|
|
8
|
+
export { makeAgent } from "./agent/agent.js";
|
|
9
|
+
export { resolveModelCapabilities } from "./agent/provider-capabilities.js";
|
|
10
|
+
export { AgentCallbackError, AgentInvariantError, HookError, InvalidAgentConfigError, InvalidModelResponseError, LoopError, ModelProviderError, ModelRequestMiddlewareError, PauseRequested, ProtocolContractError, StructuredOutputError, UnsupportedStructuredOutputError, ToolExecutionError, ToolsetError, failedToolResult, isProviderErrorCode, providerErrorCode, toToolFailure } from "./errors.js";
|
|
11
|
+
export { ToolChoice, usageInputTokens } from "./contracts/provider.js";
|
|
12
|
+
export { decodeMessage } from "./internal/validate.js";
|
|
13
|
+
export { makeRunBudget } from "./agent/budget.js";
|
|
14
|
+
export { createTool, createToolset, INVALID_ARGUMENTS_OUTCOME } from "./tools/tool.js";
|
|
15
|
+
export { DEFAULT_TRUNCATE_MAX_BYTES, DEFAULT_TRUNCATE_MAX_LINES, truncateToolResult } from "./tools/truncate.js";
|
|
16
|
+
export { defaultToolSearchStrategy, makeToolSearch } from "./tools/search.js";
|
|
17
|
+
export { splitToolArguments } from "./tools/display-title.js";
|
|
18
|
+
export { makeFairReadWriteLock } from "./internal/concurrency.js";
|
|
19
|
+
export { callEndsTurn, mayEndTurn } from "./contracts/tools.js";
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAQ3E,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,uBAAuB,EACvB,yBAAyB,EACzB,SAAS,EACT,kBAAkB,EAClB,2BAA2B,EAC3B,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,gCAAgC,EAChC,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACd,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAiBtF,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAqCjE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA"}
|