@anvia/core 1.0.0-rc.3 → 1.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -3
- package/dist/agent/index.d.ts +28 -6
- package/dist/agent/index.js +17 -27
- package/dist/{interactions-csssHYcN.d.ts → agent/interactions/index.d.ts} +3 -55
- package/dist/agent/interactions/index.js +20 -0
- package/dist/agent/interactions/index.js.map +1 -0
- package/dist/{agent-CXScUOpX.d.ts → agent-LlCD_2UQ.d.ts} +2 -2
- package/dist/{chunk-AI5JMUW7.js → chunk-7OCVDT2X.js} +2 -2
- package/dist/{chunk-5MK3BISB.js → chunk-7YAH2F3J.js} +3 -3
- package/dist/{chunk-LXMAFD23.js → chunk-BAEFBTOW.js} +2 -2
- package/dist/chunk-BEU6FCTN.js +164 -0
- package/dist/chunk-BEU6FCTN.js.map +1 -0
- package/dist/{chunk-KFR4CDGK.js → chunk-DNQNOHD5.js} +2 -2
- package/dist/{chunk-VKYZZXP5.js → chunk-E5J4OY4K.js} +2 -2
- package/dist/{chunk-BY4OMNIU.js → chunk-FCANRQ5Q.js} +201 -191
- package/dist/chunk-FCANRQ5Q.js.map +1 -0
- package/dist/{chunk-PK5LKOFL.js → chunk-G5OACQEI.js} +4 -66
- package/dist/chunk-G5OACQEI.js.map +1 -0
- package/dist/{chunk-GQL5KRAH.js → chunk-H7BI3BSP.js} +2 -2
- package/dist/{chunk-D2ECOWN5.js → chunk-HSA6NL2E.js} +6 -4
- package/dist/{chunk-D2ECOWN5.js.map → chunk-HSA6NL2E.js.map} +1 -1
- package/dist/{chunk-BEYBU7VJ.js → chunk-HVHTVGPP.js} +2 -2
- package/dist/{chunk-KV6QCRQ4.js → chunk-JXZTTNCR.js} +3 -3
- package/dist/{chunk-3CMWKK32.js → chunk-RZDI7B6Z.js} +8 -5
- package/dist/chunk-RZDI7B6Z.js.map +1 -0
- package/dist/chunk-SROQA7I7.js +69 -0
- package/dist/chunk-SROQA7I7.js.map +1 -0
- package/dist/{chunk-TRQ3XRFD.js → chunk-TEV3OB7N.js} +26 -1
- package/dist/chunk-TEV3OB7N.js.map +1 -0
- package/dist/{chunk-FN7HLLAZ.js → chunk-UBE4WH6G.js} +2 -1
- package/dist/chunk-UBE4WH6G.js.map +1 -0
- package/dist/{chunk-ZCPOIDAQ.js → chunk-YDJA4R37.js} +4 -4
- package/dist/{chunk-GKDERULJ.js → chunk-YXLDR2O4.js} +2 -2
- package/dist/completion/index.js +6 -4
- package/dist/embeddings/index.js +2 -2
- package/dist/evals/index.d.ts +4 -3
- package/dist/evals/index.js +7 -6
- package/dist/evals/index.js.map +1 -1
- package/dist/extractor/index.js +5 -4
- package/dist/image-generation/index.js +2 -2
- package/dist/index.d.ts +7 -6
- package/dist/index.js +31 -38
- package/dist/internal/agent.d.ts +4 -3
- package/dist/internal/agent.js +13 -11
- package/dist/internal/agent.js.map +1 -1
- package/dist/mcp/index.js +7 -6
- package/dist/memory/index.js +5 -4
- package/dist/middleware-BqtLB_Xt.d.ts +56 -0
- package/dist/observability/index.d.ts +5 -4
- package/dist/observability/index.js +5 -4
- package/dist/pipeline/index.d.ts +5 -4
- package/dist/pipeline/index.js +6 -5
- package/dist/pipeline/index.js.map +1 -1
- package/dist/skills/index.js +7 -6
- package/dist/speech-generation/index.js +2 -2
- package/dist/{think-tool-D8frXxwV.d.ts → think-tool-Cz3QYNPX.d.ts} +1 -1
- package/dist/tool/index.d.ts +4 -3
- package/dist/tool/index.js +6 -5
- package/dist/transcription/index.js +2 -2
- package/dist/{types-CElwurHZ.d.ts → types-1KpjDfoN.d.ts} +2 -1
- package/dist/vector-store/index.d.ts +3 -2
- package/dist/vector-store/index.js +7 -4
- package/package.json +6 -2
- package/dist/chunk-3CMWKK32.js.map +0 -1
- package/dist/chunk-BY4OMNIU.js.map +0 -1
- package/dist/chunk-FN7HLLAZ.js.map +0 -1
- package/dist/chunk-PK5LKOFL.js.map +0 -1
- package/dist/chunk-TRQ3XRFD.js.map +0 -1
- /package/dist/{chunk-AI5JMUW7.js.map → chunk-7OCVDT2X.js.map} +0 -0
- /package/dist/{chunk-5MK3BISB.js.map → chunk-7YAH2F3J.js.map} +0 -0
- /package/dist/{chunk-LXMAFD23.js.map → chunk-BAEFBTOW.js.map} +0 -0
- /package/dist/{chunk-KFR4CDGK.js.map → chunk-DNQNOHD5.js.map} +0 -0
- /package/dist/{chunk-VKYZZXP5.js.map → chunk-E5J4OY4K.js.map} +0 -0
- /package/dist/{chunk-GQL5KRAH.js.map → chunk-H7BI3BSP.js.map} +0 -0
- /package/dist/{chunk-BEYBU7VJ.js.map → chunk-HVHTVGPP.js.map} +0 -0
- /package/dist/{chunk-KV6QCRQ4.js.map → chunk-JXZTTNCR.js.map} +0 -0
- /package/dist/{chunk-ZCPOIDAQ.js.map → chunk-YDJA4R37.js.map} +0 -0
- /package/dist/{chunk-GKDERULJ.js.map → chunk-YXLDR2O4.js.map} +0 -0
package/README.md
CHANGED
|
@@ -12,10 +12,17 @@ The package is dependency-injection oriented: create provider models, typed tool
|
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
|
+
Anvia 1.0 is currently published on npm under the `rc` tag. The unqualified `latest` tag remains
|
|
16
|
+
on the maintenance-only v0 line until 1.0 reaches general availability. Keep Core and every Anvia
|
|
17
|
+
adapter on the same release channel.
|
|
18
|
+
|
|
15
19
|
```sh
|
|
16
|
-
pnpm add @anvia/core
|
|
20
|
+
pnpm add @anvia/core@rc
|
|
17
21
|
```
|
|
18
22
|
|
|
23
|
+
See the repository's [1.0 release policy](../../docs/releases/v1.md) for channel and support
|
|
24
|
+
details.
|
|
25
|
+
|
|
19
26
|
In this monorepo, the package is available through the workspace:
|
|
20
27
|
|
|
21
28
|
```sh
|
|
@@ -184,7 +191,9 @@ keys. Cancellation is forwarded to provider SDK calls and is never retried.
|
|
|
184
191
|
|
|
185
192
|
Agents own their default retry policy. A run with no `retries` value inherits the Agent setting;
|
|
186
193
|
`false` disables it for that run; an object replaces it for that run. Retries apply to the current
|
|
187
|
-
|
|
194
|
+
completion only, so completed tools and earlier turns are never replayed. `maxAttempts` is the
|
|
195
|
+
total number of model attempts for that completion, including the initial attempt; it is not the
|
|
196
|
+
number of additional retries.
|
|
188
197
|
|
|
189
198
|
```ts
|
|
190
199
|
const agent = new Agent({
|
|
@@ -201,6 +210,19 @@ await agent.generate({
|
|
|
201
210
|
});
|
|
202
211
|
```
|
|
203
212
|
|
|
213
|
+
When an Agent has `outputSchema`, JSON parsing and schema-validation failures use the same retry
|
|
214
|
+
budget when retries are explicitly enabled. A correction request includes the rejected response in
|
|
215
|
+
the provider transcript and asks for raw JSON matching the schema, without Markdown or commentary.
|
|
216
|
+
Transport failures and structured-output failures therefore cannot exceed `maxAttempts` in total.
|
|
217
|
+
|
|
218
|
+
Structured output remains strict: Core trims surrounding whitespace, parses JSON, and validates the
|
|
219
|
+
result with the configured Zod schema. As a compatibility fallback for OpenAI-compatible providers
|
|
220
|
+
that violate strict JSON mode, Core also accepts a response consisting entirely of one lowercase
|
|
221
|
+
`json` Markdown fence or one unlabeled Markdown fence. It does not search prose for JSON, accept
|
|
222
|
+
content before or after a fence, or bypass schema validation. `AgentStructuredOutputError` reports
|
|
223
|
+
the `parse` or `schema` phase, attempt counts, output length/format metadata, cumulative attempt
|
|
224
|
+
usage, and the original `cause`; its message never contains the rejected model response.
|
|
225
|
+
|
|
204
226
|
Agent results are discriminated by `status`. Completed results include typed `output` and `text`;
|
|
205
227
|
guardrail blocks return `status: "blocked"`, `stage`, and `text`; tool approvals and first-class
|
|
206
228
|
questions return a JSON-safe `status: "suspended"` result.
|
|
@@ -233,6 +255,17 @@ continuation and current Agent/tool registration but does not provide a durable
|
|
|
233
255
|
or exactly-once execution. Use `createQuestionTool({ name, description })` when a model must ask for
|
|
234
256
|
structured free-text or choice answers.
|
|
235
257
|
|
|
258
|
+
Import JSON-safe interaction contracts and parsers from their browser-safe subpath. This entrypoint
|
|
259
|
+
does not load the Agent runtime, MCP clients, or Node infrastructure:
|
|
260
|
+
|
|
261
|
+
```ts
|
|
262
|
+
import {
|
|
263
|
+
type AgentInteractionResponse,
|
|
264
|
+
parseAgentInteractionRequest,
|
|
265
|
+
parseAgentInteractionResponse,
|
|
266
|
+
} from "@anvia/core/agent/interactions";
|
|
267
|
+
```
|
|
268
|
+
|
|
236
269
|
An Agent with `outputSchema` carries that output type through `generate`, `stream`, `asTool`, and
|
|
237
270
|
Pipeline Agent stages. Agent stream finals use the same result shape:
|
|
238
271
|
|
|
@@ -497,7 +530,8 @@ added to Agent instructions.
|
|
|
497
530
|
|
|
498
531
|
## Public Areas
|
|
499
532
|
|
|
500
|
-
- `agent`: typed Agent runtime,
|
|
533
|
+
- `agent`: typed Agent runtime, retries, and stream events
|
|
534
|
+
- `agent/interactions`: browser-safe interaction contracts, schemas, assertions, and parsers
|
|
501
535
|
- `tool`: typed tool creation and tool sets
|
|
502
536
|
- `completion`: direct completion helpers and provider-neutral model contracts
|
|
503
537
|
- `memory`: durable session memory interfaces and in-memory store
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export { M as ModelCallOptions } from '../model-call-options-CZkSw_xN.js';
|
|
2
2
|
export { R as RetryContext, a as RetryOptions, b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
3
|
-
export { A as Agent, a as AgentContextInput, b as AgentMemory, c as AgentMemoryOptions, d as AgentOptions, e as AgentToolInput, f as AgentToolOptions, C as CreateHybridVectorContextOptions, g as CreateVectorContextOptions, V as VectorContext, h as VectorContextBaseOptions, i as createVectorContext, j as isVectorContext } from '../agent-
|
|
4
|
-
import { M as Message } from '../types-D9rKQ_as.js';
|
|
5
|
-
import { A as AgentBlockedResult, t as AgentSuspendedResult } from '../types-
|
|
6
|
-
export { a as AgentChildStreamEvent, b as AgentDeltaEvent, c as AgentErrorEvent, d as AgentErrorStreamEvent, e as AgentFinishEvent, f as AgentInput, g as AgentLifecycle, h as AgentMemoryCompactionEvent, i as AgentPrompt, j as AgentResponse, k as AgentResult, l as AgentRunOptions, m as AgentRunSettings, n as AgentStartEvent, o as AgentSteerInput, p as AgentSteerReceipt, q as AgentStepFinishEvent, r as AgentStream, s as AgentStreamEvent, u as AgentToolCallDeltaEvent, v as AgentToolFinishEvent, w as AgentToolStartEvent } from '../types-
|
|
7
|
-
export { A as AgentContinuation, a as AgentInteractionRequest, b as AgentInteractionResponse, d as AgentQuestionAnswer, e as AgentQuestionChoice, f as AgentQuestionPrompt, g as AgentToolApprovalRequest, h as AgentToolQuestionRequest, p as agentContinuationSchema, q as agentInteractionRequestSchema, r as agentInteractionResponseSchema, w as assertAgentInteractionResponse, t as parseAgentContinuation, u as parseAgentInteractionRequest, v as parseAgentInteractionResponse } from '../interactions-csssHYcN.js';
|
|
3
|
+
export { A as Agent, a as AgentContextInput, b as AgentMemory, c as AgentMemoryOptions, d as AgentOptions, e as AgentToolInput, f as AgentToolOptions, C as CreateHybridVectorContextOptions, g as CreateVectorContextOptions, V as VectorContext, h as VectorContextBaseOptions, i as createVectorContext, j as isVectorContext } from '../agent-LlCD_2UQ.js';
|
|
4
|
+
import { M as Message, U as Usage } from '../types-D9rKQ_as.js';
|
|
5
|
+
import { A as AgentBlockedResult, t as AgentSuspendedResult } from '../types-1KpjDfoN.js';
|
|
6
|
+
export { a as AgentChildStreamEvent, b as AgentDeltaEvent, c as AgentErrorEvent, d as AgentErrorStreamEvent, e as AgentFinishEvent, f as AgentInput, g as AgentLifecycle, h as AgentMemoryCompactionEvent, i as AgentPrompt, j as AgentResponse, k as AgentResult, l as AgentRunOptions, m as AgentRunSettings, n as AgentStartEvent, o as AgentSteerInput, p as AgentSteerReceipt, q as AgentStepFinishEvent, r as AgentStream, s as AgentStreamEvent, u as AgentToolCallDeltaEvent, v as AgentToolFinishEvent, w as AgentToolStartEvent } from '../types-1KpjDfoN.js';
|
|
8
7
|
import '../zod-schema-C7F4clpm.js';
|
|
9
8
|
import 'zod';
|
|
10
9
|
import '../types-CIPaIbZo.js';
|
|
@@ -16,12 +15,35 @@ import '@modelcontextprotocol/sdk/client/auth.js';
|
|
|
16
15
|
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
17
16
|
import '@modelcontextprotocol/sdk/shared/transport.js';
|
|
18
17
|
import '../tool-r62gf3QY.js';
|
|
18
|
+
import '../middleware-BqtLB_Xt.js';
|
|
19
19
|
import '../types-DbolvLtZ.js';
|
|
20
20
|
import '../types-RT3cuyRk.js';
|
|
21
21
|
import '../dynamic-tools-AEBOTgu1.js';
|
|
22
22
|
import '../types-Cr4uiYo5.js';
|
|
23
23
|
import '../types-C3gv9EX6.js';
|
|
24
|
+
import './interactions/index.js';
|
|
24
25
|
|
|
26
|
+
type AgentStructuredOutputPhase = "parse" | "schema";
|
|
27
|
+
type AgentStructuredOutputFormat = "raw" | "json-fence" | "unlabeled-fence";
|
|
28
|
+
declare class AgentStructuredOutputError extends Error {
|
|
29
|
+
readonly phase: AgentStructuredOutputPhase;
|
|
30
|
+
readonly attempt: number;
|
|
31
|
+
readonly maxAttempts: number;
|
|
32
|
+
readonly outputLength: number;
|
|
33
|
+
readonly normalizedLength: number;
|
|
34
|
+
readonly outputFormat: AgentStructuredOutputFormat;
|
|
35
|
+
readonly usage: Usage;
|
|
36
|
+
constructor(options: {
|
|
37
|
+
phase: AgentStructuredOutputPhase;
|
|
38
|
+
attempt: number;
|
|
39
|
+
maxAttempts: number;
|
|
40
|
+
outputLength: number;
|
|
41
|
+
normalizedLength: number;
|
|
42
|
+
outputFormat: AgentStructuredOutputFormat;
|
|
43
|
+
usage: Usage;
|
|
44
|
+
cause: unknown;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
25
47
|
declare class MaxTurnsError extends Error {
|
|
26
48
|
readonly maxTurns: number;
|
|
27
49
|
readonly chatHistory: Message[];
|
|
@@ -45,4 +67,4 @@ declare class AgentToolSuspensionError extends Error {
|
|
|
45
67
|
constructor(result: AgentSuspendedResult);
|
|
46
68
|
}
|
|
47
69
|
|
|
48
|
-
export { AgentBlockedResult, AgentRunBlockedError, AgentRunCancelledError, AgentStreamClosedError, AgentSuspendedResult, AgentToolSuspensionError, MaxTurnsError };
|
|
70
|
+
export { AgentBlockedResult, AgentRunBlockedError, AgentRunCancelledError, AgentStreamClosedError, AgentStructuredOutputError, type AgentStructuredOutputFormat, type AgentStructuredOutputPhase, AgentSuspendedResult, AgentToolSuspensionError, MaxTurnsError };
|
package/dist/agent/index.js
CHANGED
|
@@ -1,51 +1,41 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Agent,
|
|
3
|
-
agentContinuationSchema,
|
|
4
|
-
agentInteractionRequestSchema,
|
|
5
|
-
agentInteractionResponseSchema,
|
|
6
|
-
assertAgentInteractionResponse,
|
|
7
3
|
createVectorContext,
|
|
8
|
-
isVectorContext
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
isVectorContext
|
|
5
|
+
} from "../chunk-FCANRQ5Q.js";
|
|
6
|
+
import "../chunk-BEU6FCTN.js";
|
|
7
|
+
import "../chunk-7YAH2F3J.js";
|
|
8
|
+
import "../chunk-DNQNOHD5.js";
|
|
9
|
+
import "../chunk-E5J4OY4K.js";
|
|
13
10
|
import "../chunk-YK4WAAS4.js";
|
|
14
|
-
import "../chunk-5MK3BISB.js";
|
|
15
11
|
import "../chunk-CQNNSZPG.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-KFR4CDGK.js";
|
|
19
|
-
import "../chunk-VKYZZXP5.js";
|
|
12
|
+
import "../chunk-JXZTTNCR.js";
|
|
13
|
+
import "../chunk-RZDI7B6Z.js";
|
|
20
14
|
import {
|
|
21
15
|
AgentRunBlockedError,
|
|
22
16
|
AgentRunCancelledError,
|
|
23
17
|
AgentStreamClosedError,
|
|
18
|
+
AgentStructuredOutputError,
|
|
24
19
|
AgentToolSuspensionError,
|
|
25
20
|
MaxTurnsError
|
|
26
|
-
} from "../chunk-
|
|
27
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-TEV3OB7N.js";
|
|
22
|
+
import "../chunk-H7BI3BSP.js";
|
|
28
23
|
import "../chunk-3RM57ZT2.js";
|
|
29
24
|
import "../chunk-MGNTXGTX.js";
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-HSA6NL2E.js";
|
|
26
|
+
import "../chunk-G5OACQEI.js";
|
|
27
|
+
import "../chunk-SROQA7I7.js";
|
|
28
|
+
import "../chunk-UBE4WH6G.js";
|
|
33
29
|
import "../chunk-AZB6N7P4.js";
|
|
34
30
|
export {
|
|
35
31
|
Agent,
|
|
36
32
|
AgentRunBlockedError,
|
|
37
33
|
AgentRunCancelledError,
|
|
38
34
|
AgentStreamClosedError,
|
|
35
|
+
AgentStructuredOutputError,
|
|
39
36
|
AgentToolSuspensionError,
|
|
40
37
|
MaxTurnsError,
|
|
41
|
-
agentContinuationSchema,
|
|
42
|
-
agentInteractionRequestSchema,
|
|
43
|
-
agentInteractionResponseSchema,
|
|
44
|
-
assertAgentInteractionResponse,
|
|
45
38
|
createVectorContext,
|
|
46
|
-
isVectorContext
|
|
47
|
-
parseAgentContinuation,
|
|
48
|
-
parseAgentInteractionRequest,
|
|
49
|
-
parseAgentInteractionResponse
|
|
39
|
+
isVectorContext
|
|
50
40
|
};
|
|
51
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,58 +1,6 @@
|
|
|
1
|
-
import { e as CompletionRequest, f as CompletionResponse, o as JsonValue, x as ToolResultContentPart, J as JsonObject, _ as ToolQuestionAnswer } from './types-D9rKQ_as.js';
|
|
2
|
-
import { M as MaybePromise } from './type-utils-CtHVDRn_.js';
|
|
3
1
|
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
turn: number;
|
|
7
|
-
request: CompletionRequest;
|
|
8
|
-
originalRequest: CompletionRequest;
|
|
9
|
-
};
|
|
10
|
-
type CompletionRequestMiddlewareResult = {
|
|
11
|
-
request: CompletionRequest;
|
|
12
|
-
} | undefined;
|
|
13
|
-
type CompletionResponseMiddlewareArgs<RawResponse = unknown> = {
|
|
14
|
-
turn: number;
|
|
15
|
-
request: CompletionRequest;
|
|
16
|
-
response: CompletionResponse<RawResponse>;
|
|
17
|
-
originalResponse: CompletionResponse<RawResponse>;
|
|
18
|
-
};
|
|
19
|
-
type CompletionResponseMiddlewareResult<RawResponse = unknown> = {
|
|
20
|
-
response: CompletionResponse<RawResponse>;
|
|
21
|
-
} | undefined;
|
|
22
|
-
type ToolInputMiddlewareArgs = {
|
|
23
|
-
toolName: string;
|
|
24
|
-
args: string;
|
|
25
|
-
originalArgs: string;
|
|
26
|
-
turn: number;
|
|
27
|
-
toolCallId?: string | undefined;
|
|
28
|
-
internalCallId: string;
|
|
29
|
-
};
|
|
30
|
-
type ToolInputMiddlewareResult = {
|
|
31
|
-
args: JsonValue | string;
|
|
32
|
-
} | undefined;
|
|
33
|
-
type ToolResultMiddlewareArgs = {
|
|
34
|
-
toolName: string;
|
|
35
|
-
args: string;
|
|
36
|
-
result: string;
|
|
37
|
-
originalResult: string;
|
|
38
|
-
structuredResult?: readonly ToolResultContentPart[] | undefined;
|
|
39
|
-
originalStructuredResult?: readonly ToolResultContentPart[] | undefined;
|
|
40
|
-
turn: number;
|
|
41
|
-
toolCallId?: string | undefined;
|
|
42
|
-
internalCallId: string;
|
|
43
|
-
};
|
|
44
|
-
type ToolOutputMiddlewareArgs = ToolResultMiddlewareArgs;
|
|
45
|
-
type ToolOutputMiddlewareResult = string | {
|
|
46
|
-
result?: string | undefined;
|
|
47
|
-
structuredResult?: readonly ToolResultContentPart[] | undefined;
|
|
48
|
-
} | undefined;
|
|
49
|
-
interface AgentMiddleware<RawResponse = unknown> {
|
|
50
|
-
onCompletionRequest?(args: CompletionRequestMiddlewareArgs): MaybePromise<CompletionRequestMiddlewareResult>;
|
|
51
|
-
onCompletionResponse?(args: CompletionResponseMiddlewareArgs<RawResponse>): MaybePromise<CompletionResponseMiddlewareResult<RawResponse>>;
|
|
52
|
-
onToolInput?(args: ToolInputMiddlewareArgs): MaybePromise<ToolInputMiddlewareResult>;
|
|
53
|
-
onToolOutput?(args: ToolOutputMiddlewareArgs): MaybePromise<ToolOutputMiddlewareResult>;
|
|
54
|
-
}
|
|
55
|
-
declare function createMiddleware<RawResponse = unknown>(middleware: AgentMiddleware<RawResponse>): AgentMiddleware<RawResponse>;
|
|
2
|
+
import { o as JsonValue, J as JsonObject, _ as ToolQuestionAnswer } from '../../types-D9rKQ_as.js';
|
|
3
|
+
import '../../model-call-options-CZkSw_xN.js';
|
|
56
4
|
|
|
57
5
|
type AgentQuestionChoice = Readonly<{
|
|
58
6
|
label: string;
|
|
@@ -171,4 +119,4 @@ declare function parseAgentInteractionResponse(value: unknown): AgentInteraction
|
|
|
171
119
|
declare function parseAgentContinuation(value: unknown): AgentContinuation;
|
|
172
120
|
declare function assertAgentInteractionResponse(request: AgentInteractionRequest, response: AgentInteractionResponse): void;
|
|
173
121
|
|
|
174
|
-
export { type AgentContinuation
|
|
122
|
+
export { type AgentContinuation, type AgentInteractionRequest, type AgentInteractionResponse, type AgentQuestionAnswer, type AgentQuestionChoice, type AgentQuestionPrompt, type AgentToolApprovalRequest, type AgentToolQuestionRequest, agentContinuationSchema, agentInteractionRequestSchema, agentInteractionResponseSchema, assertAgentInteractionResponse, parseAgentContinuation, parseAgentInteractionRequest, parseAgentInteractionResponse };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
agentContinuationSchema,
|
|
3
|
+
agentInteractionRequestSchema,
|
|
4
|
+
agentInteractionResponseSchema,
|
|
5
|
+
assertAgentInteractionResponse,
|
|
6
|
+
parseAgentContinuation,
|
|
7
|
+
parseAgentInteractionRequest,
|
|
8
|
+
parseAgentInteractionResponse
|
|
9
|
+
} from "../../chunk-BEU6FCTN.js";
|
|
10
|
+
import "../../chunk-SROQA7I7.js";
|
|
11
|
+
export {
|
|
12
|
+
agentContinuationSchema,
|
|
13
|
+
agentInteractionRequestSchema,
|
|
14
|
+
agentInteractionResponseSchema,
|
|
15
|
+
assertAgentInteractionResponse,
|
|
16
|
+
parseAgentContinuation,
|
|
17
|
+
parseAgentInteractionRequest,
|
|
18
|
+
parseAgentInteractionResponse
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -3,8 +3,8 @@ import { D as Document, C as CompletionModel, P as ProviderTool, J as JsonObject
|
|
|
3
3
|
import { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
|
|
4
4
|
import { d as GuardrailPolicyInput, c as GuardrailPolicy } from './types-CIPaIbZo.js';
|
|
5
5
|
import { a as McpServer } from './client-DvUatElp.js';
|
|
6
|
-
import { g as AgentLifecycle, E as AgentObservabilityOptions, l as AgentRunOptions, k as AgentResult, r as AgentStream, s as AgentStreamEvent } from './types-
|
|
7
|
-
import {
|
|
6
|
+
import { g as AgentLifecycle, E as AgentObservabilityOptions, l as AgentRunOptions, k as AgentResult, r as AgentStream, s as AgentStreamEvent } from './types-1KpjDfoN.js';
|
|
7
|
+
import { A as AgentMiddleware } from './middleware-BqtLB_Xt.js';
|
|
8
8
|
import { A as AnyTool, T as Tool, c as ToolCallContext, N as NormalizedToolOutput } from './tool-r62gf3QY.js';
|
|
9
9
|
import { D as MemoryStore, y as MemorySavePolicy, m as MemoryCompactor, d as MemoryCompactionConflictRetryOptions, x as MemoryOptions } from './types-DbolvLtZ.js';
|
|
10
10
|
import { a as SkillSet } from './types-RT3cuyRk.js';
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
resolveRetryOptions,
|
|
3
3
|
runWithRetries,
|
|
4
4
|
throwIfAborted
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UBE4WH6G.js";
|
|
6
6
|
|
|
7
7
|
// src/speech-generation/generate-speech.ts
|
|
8
8
|
async function generateSpeech(options) {
|
|
@@ -42,4 +42,4 @@ function assertNonEmptyString(value, name) {
|
|
|
42
42
|
export {
|
|
43
43
|
generateSpeech
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-7OCVDT2X.js.map
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-CQNNSZPG.js";
|
|
4
4
|
import {
|
|
5
5
|
ToolOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RZDI7B6Z.js";
|
|
7
7
|
import {
|
|
8
8
|
abortError,
|
|
9
9
|
throwIfAborted
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UBE4WH6G.js";
|
|
11
11
|
|
|
12
12
|
// src/mcp/client.ts
|
|
13
13
|
import { readFileSync } from "fs";
|
|
@@ -701,4 +701,4 @@ export {
|
|
|
701
701
|
McpClient,
|
|
702
702
|
McpClientGroup
|
|
703
703
|
};
|
|
704
|
-
//# sourceMappingURL=chunk-
|
|
704
|
+
//# sourceMappingURL=chunk-7YAH2F3J.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-CQNNSZPG.js";
|
|
7
7
|
import {
|
|
8
8
|
createTool
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RZDI7B6Z.js";
|
|
10
10
|
|
|
11
11
|
// src/skills/instructions.ts
|
|
12
12
|
function skillInstructions(skills) {
|
|
@@ -395,4 +395,4 @@ export {
|
|
|
395
395
|
SkillValidationError,
|
|
396
396
|
skill
|
|
397
397
|
};
|
|
398
|
-
//# sourceMappingURL=chunk-
|
|
398
|
+
//# sourceMappingURL=chunk-BAEFBTOW.js.map
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isJsonValue
|
|
3
|
+
} from "./chunk-SROQA7I7.js";
|
|
4
|
+
|
|
5
|
+
// src/agent/interactions.ts
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
var nonblank = z.string().trim().min(1);
|
|
8
|
+
var jsonValueSchema = z.custom(isJsonValue, {
|
|
9
|
+
message: "Expected a strict JSON value"
|
|
10
|
+
});
|
|
11
|
+
var jsonObjectSchema = z.custom(
|
|
12
|
+
(value) => typeof value === "object" && value !== null && !Array.isArray(value) && isJsonValue(value),
|
|
13
|
+
{ message: "Expected a strict JSON object" }
|
|
14
|
+
);
|
|
15
|
+
var questionChoiceSchema = z.object({
|
|
16
|
+
label: nonblank,
|
|
17
|
+
value: nonblank
|
|
18
|
+
}).strict();
|
|
19
|
+
var questionPromptSchema = z.object({
|
|
20
|
+
id: nonblank,
|
|
21
|
+
text: nonblank,
|
|
22
|
+
choices: z.array(questionChoiceSchema).min(1).optional(),
|
|
23
|
+
allowCustom: z.boolean().optional()
|
|
24
|
+
}).strict().superRefine((question, context) => {
|
|
25
|
+
if (question.choices === void 0 && question.allowCustom === false) {
|
|
26
|
+
context.addIssue({
|
|
27
|
+
code: "custom",
|
|
28
|
+
message: "A free-text question cannot disable custom answers.",
|
|
29
|
+
path: ["allowCustom"]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const values = /* @__PURE__ */ new Set();
|
|
33
|
+
for (const [index, choice] of (question.choices ?? []).entries()) {
|
|
34
|
+
if (values.has(choice.value)) {
|
|
35
|
+
context.addIssue({
|
|
36
|
+
code: "custom",
|
|
37
|
+
message: "Question choice values must be unique.",
|
|
38
|
+
path: ["choices", index, "value"]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
values.add(choice.value);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
var questionAnswerSchema = z.object({
|
|
45
|
+
questionId: nonblank,
|
|
46
|
+
value: nonblank
|
|
47
|
+
}).strict();
|
|
48
|
+
var interactionBase = {
|
|
49
|
+
id: nonblank,
|
|
50
|
+
toolName: nonblank,
|
|
51
|
+
toolCallId: nonblank,
|
|
52
|
+
callId: z.string().optional(),
|
|
53
|
+
internalCallId: nonblank
|
|
54
|
+
};
|
|
55
|
+
var approvalRequestSchema = z.object({
|
|
56
|
+
type: z.literal("tool-approval"),
|
|
57
|
+
...interactionBase,
|
|
58
|
+
input: jsonValueSchema,
|
|
59
|
+
reason: z.string().optional()
|
|
60
|
+
}).strict();
|
|
61
|
+
var questionRequestSchema = z.object({
|
|
62
|
+
type: z.literal("tool-question"),
|
|
63
|
+
...interactionBase,
|
|
64
|
+
questions: z.array(questionPromptSchema).min(1)
|
|
65
|
+
}).strict().superRefine((request, context) => {
|
|
66
|
+
const ids = /* @__PURE__ */ new Set();
|
|
67
|
+
for (const [index, question] of request.questions.entries()) {
|
|
68
|
+
if (ids.has(question.id)) {
|
|
69
|
+
context.addIssue({
|
|
70
|
+
code: "custom",
|
|
71
|
+
message: "Question IDs must be unique.",
|
|
72
|
+
path: ["questions", index, "id"]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
ids.add(question.id);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
var agentInteractionRequestSchema = z.discriminatedUnion("type", [
|
|
79
|
+
approvalRequestSchema,
|
|
80
|
+
questionRequestSchema
|
|
81
|
+
]);
|
|
82
|
+
var agentInteractionResponseSchema = z.discriminatedUnion("type", [
|
|
83
|
+
z.object({
|
|
84
|
+
type: z.literal("tool-approval"),
|
|
85
|
+
approved: z.boolean(),
|
|
86
|
+
reason: z.string().optional()
|
|
87
|
+
}).strict(),
|
|
88
|
+
z.object({
|
|
89
|
+
type: z.literal("tool-question"),
|
|
90
|
+
answers: z.array(questionAnswerSchema)
|
|
91
|
+
}).strict()
|
|
92
|
+
]);
|
|
93
|
+
var agentContinuationSchema = z.object({
|
|
94
|
+
version: z.literal(1),
|
|
95
|
+
agentId: nonblank,
|
|
96
|
+
sourceRunId: nonblank,
|
|
97
|
+
interaction: agentInteractionRequestSchema,
|
|
98
|
+
state: jsonObjectSchema
|
|
99
|
+
}).strict();
|
|
100
|
+
function parseAgentInteractionRequest(value) {
|
|
101
|
+
return freeze(agentInteractionRequestSchema.parse(value));
|
|
102
|
+
}
|
|
103
|
+
function parseAgentInteractionResponse(value) {
|
|
104
|
+
return freeze(agentInteractionResponseSchema.parse(value));
|
|
105
|
+
}
|
|
106
|
+
function parseAgentQuestionPrompts(value) {
|
|
107
|
+
const request = questionRequestSchema.parse({
|
|
108
|
+
type: "tool-question",
|
|
109
|
+
id: "validation",
|
|
110
|
+
toolName: "validation",
|
|
111
|
+
toolCallId: "validation",
|
|
112
|
+
internalCallId: "validation",
|
|
113
|
+
questions: value
|
|
114
|
+
});
|
|
115
|
+
return freeze(request.questions);
|
|
116
|
+
}
|
|
117
|
+
function parseAgentContinuation(value) {
|
|
118
|
+
return freeze(agentContinuationSchema.parse(value));
|
|
119
|
+
}
|
|
120
|
+
function assertAgentInteractionResponse(request, response) {
|
|
121
|
+
if (request.type !== response.type) {
|
|
122
|
+
throw new TypeError("Interaction response type does not match the pending request.");
|
|
123
|
+
}
|
|
124
|
+
if (request.type === "tool-question" && response.type === "tool-question") {
|
|
125
|
+
assertQuestionAnswers(request, response.answers);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function assertQuestionAnswers(request, answers) {
|
|
129
|
+
const parsed = answers.map((answer) => questionAnswerSchema.parse(answer));
|
|
130
|
+
const byId = new Map(parsed.map((answer) => [answer.questionId, answer]));
|
|
131
|
+
if (byId.size !== parsed.length) {
|
|
132
|
+
throw new TypeError("Question answers must not contain duplicate question IDs.");
|
|
133
|
+
}
|
|
134
|
+
if (byId.size !== request.questions.length) {
|
|
135
|
+
throw new TypeError("Question responses must answer every question exactly once.");
|
|
136
|
+
}
|
|
137
|
+
for (const question of request.questions) {
|
|
138
|
+
const answer = byId.get(question.id);
|
|
139
|
+
if (answer === void 0) {
|
|
140
|
+
throw new TypeError(`Question response is missing an answer for "${question.id}".`);
|
|
141
|
+
}
|
|
142
|
+
const choices = question.choices;
|
|
143
|
+
if (choices !== void 0 && question.allowCustom !== true && !choices.some((choice) => choice.value === answer.value)) {
|
|
144
|
+
throw new TypeError(`Question "${question.id}" requires one of its configured choices.`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function freeze(value) {
|
|
149
|
+
if (typeof value !== "object" || value === null || Object.isFrozen(value)) return value;
|
|
150
|
+
for (const child of Object.values(value)) freeze(child);
|
|
151
|
+
return Object.freeze(value);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
agentInteractionRequestSchema,
|
|
156
|
+
agentInteractionResponseSchema,
|
|
157
|
+
agentContinuationSchema,
|
|
158
|
+
parseAgentInteractionRequest,
|
|
159
|
+
parseAgentInteractionResponse,
|
|
160
|
+
parseAgentQuestionPrompts,
|
|
161
|
+
parseAgentContinuation,
|
|
162
|
+
assertAgentInteractionResponse
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=chunk-BEU6FCTN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agent/interactions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { isJsonValue } from \"../completion/json\";\nimport type { JsonObject, JsonValue, ToolQuestionAnswer } from \"../completion/types\";\n\nexport type AgentQuestionChoice = Readonly<{\n label: string;\n value: string;\n}>;\n\nexport type AgentQuestionPrompt = Readonly<{\n id: string;\n text: string;\n choices?: readonly AgentQuestionChoice[];\n allowCustom?: boolean;\n}>;\n\nexport type AgentQuestionAnswer = ToolQuestionAnswer;\n\ntype AgentInteractionRequestBase = Readonly<{\n id: string;\n toolName: string;\n toolCallId: string;\n callId?: string;\n internalCallId: string;\n}>;\n\nexport type AgentToolApprovalRequest = AgentInteractionRequestBase &\n Readonly<{\n type: \"tool-approval\";\n input: JsonValue;\n reason?: string;\n }>;\n\nexport type AgentToolQuestionRequest = AgentInteractionRequestBase &\n Readonly<{\n type: \"tool-question\";\n questions: readonly AgentQuestionPrompt[];\n }>;\n\nexport type AgentInteractionRequest = AgentToolApprovalRequest | AgentToolQuestionRequest;\n\nexport type AgentInteractionResponse =\n | Readonly<{\n type: \"tool-approval\";\n approved: boolean;\n reason?: string;\n }>\n | Readonly<{\n type: \"tool-question\";\n answers: readonly AgentQuestionAnswer[];\n }>;\n\nexport type AgentContinuation = Readonly<{\n version: 1;\n agentId: string;\n sourceRunId: string;\n interaction: AgentInteractionRequest;\n state: JsonObject;\n}>;\n\nconst nonblank = z.string().trim().min(1);\nconst jsonValueSchema = z.custom<JsonValue>(isJsonValue, {\n message: \"Expected a strict JSON value\",\n});\nconst jsonObjectSchema = z.custom<JsonObject>(\n (value) =>\n typeof value === \"object\" && value !== null && !Array.isArray(value) && isJsonValue(value),\n { message: \"Expected a strict JSON object\" },\n);\n\nconst questionChoiceSchema = z\n .object({\n label: nonblank,\n value: nonblank,\n })\n .strict();\n\nconst questionPromptSchema = z\n .object({\n id: nonblank,\n text: nonblank,\n choices: z.array(questionChoiceSchema).min(1).optional(),\n allowCustom: z.boolean().optional(),\n })\n .strict()\n .superRefine((question, context) => {\n if (question.choices === undefined && question.allowCustom === false) {\n context.addIssue({\n code: \"custom\",\n message: \"A free-text question cannot disable custom answers.\",\n path: [\"allowCustom\"],\n });\n }\n const values = new Set<string>();\n for (const [index, choice] of (question.choices ?? []).entries()) {\n if (values.has(choice.value)) {\n context.addIssue({\n code: \"custom\",\n message: \"Question choice values must be unique.\",\n path: [\"choices\", index, \"value\"],\n });\n }\n values.add(choice.value);\n }\n });\n\nconst questionAnswerSchema = z\n .object({\n questionId: nonblank,\n value: nonblank,\n })\n .strict();\n\nconst interactionBase = {\n id: nonblank,\n toolName: nonblank,\n toolCallId: nonblank,\n callId: z.string().optional(),\n internalCallId: nonblank,\n};\n\nconst approvalRequestSchema = z\n .object({\n type: z.literal(\"tool-approval\"),\n ...interactionBase,\n input: jsonValueSchema,\n reason: z.string().optional(),\n })\n .strict();\n\nconst questionRequestSchema = z\n .object({\n type: z.literal(\"tool-question\"),\n ...interactionBase,\n questions: z.array(questionPromptSchema).min(1),\n })\n .strict()\n .superRefine((request, context) => {\n const ids = new Set<string>();\n for (const [index, question] of request.questions.entries()) {\n if (ids.has(question.id)) {\n context.addIssue({\n code: \"custom\",\n message: \"Question IDs must be unique.\",\n path: [\"questions\", index, \"id\"],\n });\n }\n ids.add(question.id);\n }\n });\n\nexport const agentInteractionRequestSchema = z.discriminatedUnion(\"type\", [\n approvalRequestSchema,\n questionRequestSchema,\n]);\n\nexport const agentInteractionResponseSchema = z.discriminatedUnion(\"type\", [\n z\n .object({\n type: z.literal(\"tool-approval\"),\n approved: z.boolean(),\n reason: z.string().optional(),\n })\n .strict(),\n z\n .object({\n type: z.literal(\"tool-question\"),\n answers: z.array(questionAnswerSchema),\n })\n .strict(),\n]);\n\nexport const agentContinuationSchema = z\n .object({\n version: z.literal(1),\n agentId: nonblank,\n sourceRunId: nonblank,\n interaction: agentInteractionRequestSchema,\n state: jsonObjectSchema,\n })\n .strict();\n\nexport function parseAgentInteractionRequest(value: unknown): AgentInteractionRequest {\n return freeze(agentInteractionRequestSchema.parse(value)) as AgentInteractionRequest;\n}\n\nexport function parseAgentInteractionResponse(value: unknown): AgentInteractionResponse {\n return freeze(agentInteractionResponseSchema.parse(value)) as AgentInteractionResponse;\n}\n\nexport function parseAgentQuestionPrompts(value: unknown): readonly AgentQuestionPrompt[] {\n const request = questionRequestSchema.parse({\n type: \"tool-question\",\n id: \"validation\",\n toolName: \"validation\",\n toolCallId: \"validation\",\n internalCallId: \"validation\",\n questions: value,\n });\n return freeze(request.questions) as readonly AgentQuestionPrompt[];\n}\n\nexport function parseAgentContinuation(value: unknown): AgentContinuation {\n return freeze(agentContinuationSchema.parse(value)) as AgentContinuation;\n}\n\nexport function assertAgentInteractionResponse(\n request: AgentInteractionRequest,\n response: AgentInteractionResponse,\n): void {\n if (request.type !== response.type) {\n throw new TypeError(\"Interaction response type does not match the pending request.\");\n }\n if (request.type === \"tool-question\" && response.type === \"tool-question\") {\n assertQuestionAnswers(request, response.answers);\n }\n}\n\nfunction assertQuestionAnswers(\n request: AgentToolQuestionRequest,\n answers: readonly AgentQuestionAnswer[],\n): void {\n const parsed = answers.map((answer) => questionAnswerSchema.parse(answer));\n const byId = new Map(parsed.map((answer) => [answer.questionId, answer]));\n if (byId.size !== parsed.length) {\n throw new TypeError(\"Question answers must not contain duplicate question IDs.\");\n }\n if (byId.size !== request.questions.length) {\n throw new TypeError(\"Question responses must answer every question exactly once.\");\n }\n for (const question of request.questions) {\n const answer = byId.get(question.id);\n if (answer === undefined) {\n throw new TypeError(`Question response is missing an answer for \"${question.id}\".`);\n }\n const choices = question.choices;\n if (\n choices !== undefined &&\n question.allowCustom !== true &&\n !choices.some((choice) => choice.value === answer.value)\n ) {\n throw new TypeError(`Question \"${question.id}\" requires one of its configured choices.`);\n }\n }\n}\n\nfunction freeze<T>(value: T): T {\n if (typeof value !== \"object\" || value === null || Object.isFrozen(value)) return value;\n for (const child of Object.values(value)) freeze(child);\n return Object.freeze(value);\n}\n"],"mappings":";;;;;AAAA,SAAS,SAAS;AA4DlB,IAAM,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;AACxC,IAAM,kBAAkB,EAAE,OAAkB,aAAa;AAAA,EACvD,SAAS;AACX,CAAC;AACD,IAAM,mBAAmB,EAAE;AAAA,EACzB,CAAC,UACC,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,KAAK,YAAY,KAAK;AAAA,EAC3F,EAAE,SAAS,gCAAgC;AAC7C;AAEA,IAAM,uBAAuB,EAC1B,OAAO;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AACT,CAAC,EACA,OAAO;AAEV,IAAM,uBAAuB,EAC1B,OAAO;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS,EAAE,MAAM,oBAAoB,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACvD,aAAa,EAAE,QAAQ,EAAE,SAAS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-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HSA6NL2E.js";
|
|
4
4
|
|
|
5
5
|
// src/memory/errors.ts
|
|
6
6
|
var MemoryCompactionError = class extends Error {
|
|
@@ -235,4 +235,4 @@ export {
|
|
|
235
235
|
createMemoryCompactionSummary,
|
|
236
236
|
cumulativeCompactedMessageCount
|
|
237
237
|
};
|
|
238
|
-
//# sourceMappingURL=chunk-
|
|
238
|
+
//# sourceMappingURL=chunk-DNQNOHD5.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Usage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HSA6NL2E.js";
|
|
4
4
|
|
|
5
5
|
// src/observability/snapshot.ts
|
|
6
6
|
function observerSnapshot(value) {
|
|
@@ -320,4 +320,4 @@ export {
|
|
|
320
320
|
AgentObserverDispatchError,
|
|
321
321
|
startAgentRunObservers
|
|
322
322
|
};
|
|
323
|
-
//# sourceMappingURL=chunk-
|
|
323
|
+
//# sourceMappingURL=chunk-E5J4OY4K.js.map
|