@anvia/core 1.14.1 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/agent-tool.js +6 -6
- package/dist/agent/agent.js +20 -20
- package/dist/agent/index.d.ts +9 -9
- package/dist/agent/index.js +24 -24
- package/dist/agent/resolve-options.js +8 -8
- package/dist/agent/resolved-agent.js +21 -21
- package/dist/agent/team/agent-team.js +24 -24
- package/dist/agent/team/index.js +24 -24
- package/dist/agent/tool-catalog.js +8 -8
- package/dist/{agent-DdkrgyW0.d.ts → agent-CIM7noas.d.ts} +6 -6
- package/dist/chunk-2O3MLES7.js +82 -0
- package/dist/chunk-2O3MLES7.js.map +1 -0
- package/dist/{chunk-MIPBH5S7.js → chunk-3VIMLOWJ.js} +2 -1
- package/dist/{chunk-MIPBH5S7.js.map → chunk-3VIMLOWJ.js.map} +1 -1
- package/dist/{chunk-EF26KTFU.js → chunk-3XUUNNCS.js} +19 -16
- package/dist/{chunk-EF26KTFU.js.map → chunk-3XUUNNCS.js.map} +1 -1
- package/dist/{chunk-RVGSTZD3.js → chunk-4BGJBGJU.js} +4 -4
- package/dist/{chunk-3PSBUYXQ.js → chunk-4FSGJEFT.js} +3 -3
- package/dist/{chunk-EKZRAWBP.js → chunk-4HO6VPC7.js} +2 -2
- package/dist/{chunk-3F6ZY63S.js → chunk-54WSIN4Q.js} +3 -3
- package/dist/{chunk-6Q5VOKBO.js → chunk-6NQXLSCZ.js} +12 -9
- package/dist/chunk-6NQXLSCZ.js.map +1 -0
- package/dist/{chunk-27MBNR47.js → chunk-6YYZ7VJQ.js} +2 -2
- package/dist/{chunk-ATFSEEFX.js → chunk-BJ4LJGSI.js} +6 -6
- package/dist/{chunk-IRXAEVEQ.js → chunk-BX52ILPM.js} +2 -2
- package/dist/{chunk-X35O3AQG.js → chunk-C6YE3JXV.js} +2 -2
- package/dist/{chunk-ETYB5JO6.js → chunk-EM4F5SRB.js} +5 -3
- package/dist/chunk-EM4F5SRB.js.map +1 -0
- package/dist/{chunk-5G4NMOTJ.js → chunk-GRGD4ZCM.js} +2 -2
- package/dist/{chunk-LGPXCJJO.js → chunk-GULOODEA.js} +2 -2
- package/dist/{chunk-XQRMPPTC.js → chunk-HG3GHZVY.js} +108 -23
- package/dist/chunk-HG3GHZVY.js.map +1 -0
- package/dist/{chunk-ZWYMXBGB.js → chunk-I3O362NF.js} +2 -2
- package/dist/{chunk-MNWULFRX.js → chunk-I4AOH75W.js} +2 -2
- package/dist/{chunk-V5KBSXAJ.js → chunk-I5XFFO4W.js} +2 -2
- package/dist/{chunk-GEFG7VGF.js → chunk-JLSNI3DV.js} +4 -4
- package/dist/{chunk-X4XULHDO.js → chunk-KLDNHX4Z.js} +4 -4
- package/dist/{chunk-Y5FHUUNC.js → chunk-L2UPWQQZ.js} +27 -7
- package/dist/chunk-L2UPWQQZ.js.map +1 -0
- package/dist/{chunk-XIIVC5LY.js → chunk-NSG2CIGM.js} +5 -5
- package/dist/{chunk-TJOIYN4O.js → chunk-ONFVTMN3.js} +8 -8
- package/dist/{chunk-6S7ZON2E.js → chunk-OSS2VGRW.js} +3 -3
- package/dist/{chunk-R4AJ2EE3.js → chunk-PIBFPEK3.js} +2 -2
- package/dist/{chunk-PNMBJMLB.js → chunk-QNNDKCZG.js} +2 -2
- package/dist/{chunk-ET5SCES6.js → chunk-ROUJCOAN.js} +6 -6
- package/dist/{chunk-VCOGUS3Q.js → chunk-T5FMJJKQ.js} +2 -2
- package/dist/{chunk-VHPT2C4P.js → chunk-TMSWHXYQ.js} +2 -1
- package/dist/{chunk-VHPT2C4P.js.map → chunk-TMSWHXYQ.js.map} +1 -1
- package/dist/{chunk-CASF2TDK.js → chunk-WACXVXGU.js} +2 -2
- package/dist/{chunk-V3FFZWF3.js → chunk-YKGIOXTR.js} +38 -19
- package/dist/chunk-YKGIOXTR.js.map +1 -0
- package/dist/{chunk-MEFGXAKJ.js → chunk-Z5WMW4NP.js} +2 -2
- package/dist/{chunk-VUY2C2QD.js → chunk-ZQC5V2AM.js} +2 -2
- package/dist/{chunk-SS52CC5R.js → chunk-ZXSAPGWJ.js} +3 -3
- package/dist/completion/generate-completion.js +2 -2
- package/dist/completion/index.js +2 -2
- package/dist/completion/stream-accumulator.js +1 -1
- package/dist/decision/index.d.ts +6 -119
- package/dist/{dynamic-tools-B3OjYyhC.d.ts → dynamic-tools-BtvhcGIC.d.ts} +2 -2
- package/dist/embeddings/index.js +8 -8
- package/dist/evals/advanced-metrics.js +6 -6
- package/dist/evals/cli.js +5 -5
- package/dist/evals/index.d.ts +2 -2
- package/dist/evals/index.js +36 -36
- package/dist/evals/judge.js +4 -4
- package/dist/evals/metrics.js +6 -6
- package/dist/evals/runner.js +4 -4
- package/dist/extractor/extractor.js +3 -3
- package/dist/extractor/index.js +3 -3
- package/dist/index.d.ts +10 -9
- package/dist/index.js +32 -32
- package/dist/internal/agent-runtime/agent-run.js +16 -16
- package/dist/internal/agent-runtime/continuation-state.js +2 -2
- package/dist/internal/agent-runtime/interaction-suspension.js +2 -2
- package/dist/internal/agent-runtime/loop-context.js +4 -4
- package/dist/internal/agent-runtime/memory.js +5 -5
- package/dist/internal/agent-runtime/prepared-tool-call.js +2 -2
- package/dist/internal/agent-runtime/retrieval.js +6 -6
- package/dist/internal/agent-runtime/tool-execution.js +12 -12
- package/dist/internal/agent.d.ts +7 -7
- package/dist/internal/agent.js +21 -21
- package/dist/internal/team-runtime/member.js +2 -2
- package/dist/internal/team-runtime/run.js +23 -23
- package/dist/internal/team-runtime/tools.js +4 -4
- package/dist/mcp/index.d.ts +3 -3
- package/dist/memory/compaction.js +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/{middleware-rxi6GI2B.d.ts → middleware-CDQQr_PM.d.ts} +1 -1
- package/dist/observability/group.js +2 -2
- package/dist/observability/index.d.ts +2 -2
- package/dist/observability/index.js +2 -2
- package/dist/pipeline/graph.js +5 -7
- package/dist/pipeline/index.d.ts +45 -11
- package/dist/pipeline/index.js +11 -7
- package/dist/pipeline/observability.js +1 -1
- package/dist/pipeline/pipeline.js +11 -7
- package/dist/pipeline/runtime.js +2 -2
- package/dist/skills/index.d.ts +3 -3
- package/dist/skills/index.js +11 -11
- package/dist/skills/load.js +11 -11
- package/dist/skills/tools.js +10 -10
- package/dist/speech-generation/index.js +1 -1
- package/dist/{think-tool-CTuagAtn.d.ts → think-tool-vmLIfQik.d.ts} +1 -1
- package/dist/tool/create-tool.js +3 -3
- package/dist/tool/dynamic-tools.js +7 -7
- package/dist/tool/index.d.ts +5 -5
- package/dist/tool/index.js +9 -9
- package/dist/tool/question-tool.js +4 -4
- package/dist/tool/think-tool.js +4 -4
- package/dist/tool/tool.js +1 -1
- package/dist/{tool-W1cAPuRF.d.ts → tool-B6meo2AE.d.ts} +4 -1
- package/dist/{types-94Q2mPRa.d.ts → types-BOxOjkbS.d.ts} +1 -1
- package/dist/types-Bt19cjEr.d.ts +119 -0
- package/dist/{types-ChyQISt-.d.ts → types-CmdZOpKi.d.ts} +23 -3
- package/dist/{types-CIG2loIE.d.ts → types-jVXFDum8.d.ts} +1 -1
- package/dist/vector-store/filter.js +1 -1
- package/dist/vector-store/index.d.ts +24 -6
- package/dist/vector-store/index.js +6 -6
- package/dist/vector-store/ingest.js +1 -1
- package/dist/vector-store/retrieve.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5WLIHNNJ.js +0 -56
- package/dist/chunk-5WLIHNNJ.js.map +0 -1
- package/dist/chunk-6Q5VOKBO.js.map +0 -1
- package/dist/chunk-ETYB5JO6.js.map +0 -1
- package/dist/chunk-V3FFZWF3.js.map +0 -1
- package/dist/chunk-XQRMPPTC.js.map +0 -1
- package/dist/chunk-Y5FHUUNC.js.map +0 -1
- /package/dist/{chunk-RVGSTZD3.js.map → chunk-4BGJBGJU.js.map} +0 -0
- /package/dist/{chunk-3PSBUYXQ.js.map → chunk-4FSGJEFT.js.map} +0 -0
- /package/dist/{chunk-EKZRAWBP.js.map → chunk-4HO6VPC7.js.map} +0 -0
- /package/dist/{chunk-3F6ZY63S.js.map → chunk-54WSIN4Q.js.map} +0 -0
- /package/dist/{chunk-27MBNR47.js.map → chunk-6YYZ7VJQ.js.map} +0 -0
- /package/dist/{chunk-ATFSEEFX.js.map → chunk-BJ4LJGSI.js.map} +0 -0
- /package/dist/{chunk-IRXAEVEQ.js.map → chunk-BX52ILPM.js.map} +0 -0
- /package/dist/{chunk-X35O3AQG.js.map → chunk-C6YE3JXV.js.map} +0 -0
- /package/dist/{chunk-5G4NMOTJ.js.map → chunk-GRGD4ZCM.js.map} +0 -0
- /package/dist/{chunk-LGPXCJJO.js.map → chunk-GULOODEA.js.map} +0 -0
- /package/dist/{chunk-ZWYMXBGB.js.map → chunk-I3O362NF.js.map} +0 -0
- /package/dist/{chunk-MNWULFRX.js.map → chunk-I4AOH75W.js.map} +0 -0
- /package/dist/{chunk-V5KBSXAJ.js.map → chunk-I5XFFO4W.js.map} +0 -0
- /package/dist/{chunk-GEFG7VGF.js.map → chunk-JLSNI3DV.js.map} +0 -0
- /package/dist/{chunk-X4XULHDO.js.map → chunk-KLDNHX4Z.js.map} +0 -0
- /package/dist/{chunk-XIIVC5LY.js.map → chunk-NSG2CIGM.js.map} +0 -0
- /package/dist/{chunk-TJOIYN4O.js.map → chunk-ONFVTMN3.js.map} +0 -0
- /package/dist/{chunk-6S7ZON2E.js.map → chunk-OSS2VGRW.js.map} +0 -0
- /package/dist/{chunk-R4AJ2EE3.js.map → chunk-PIBFPEK3.js.map} +0 -0
- /package/dist/{chunk-PNMBJMLB.js.map → chunk-QNNDKCZG.js.map} +0 -0
- /package/dist/{chunk-ET5SCES6.js.map → chunk-ROUJCOAN.js.map} +0 -0
- /package/dist/{chunk-VCOGUS3Q.js.map → chunk-T5FMJJKQ.js.map} +0 -0
- /package/dist/{chunk-CASF2TDK.js.map → chunk-WACXVXGU.js.map} +0 -0
- /package/dist/{chunk-MEFGXAKJ.js.map → chunk-Z5WMW4NP.js.map} +0 -0
- /package/dist/{chunk-VUY2C2QD.js.map → chunk-ZQC5V2AM.js.map} +0 -0
- /package/dist/{chunk-SS52CC5R.js.map → chunk-ZXSAPGWJ.js.map} +0 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
extract
|
|
3
|
+
} from "./chunk-T5FMJJKQ.js";
|
|
1
4
|
import {
|
|
2
5
|
resolveActual,
|
|
3
6
|
resolveActualText,
|
|
@@ -12,14 +15,11 @@ import {
|
|
|
12
15
|
formatValue
|
|
13
16
|
} from "./chunk-ZYXMWEL4.js";
|
|
14
17
|
import {
|
|
15
|
-
|
|
16
|
-
} from "./chunk-
|
|
18
|
+
embedText
|
|
19
|
+
} from "./chunk-YCTXTOOQ.js";
|
|
17
20
|
import {
|
|
18
21
|
cosineSimilarity
|
|
19
22
|
} from "./chunk-7F53DOML.js";
|
|
20
|
-
import {
|
|
21
|
-
embedText
|
|
22
|
-
} from "./chunk-YCTXTOOQ.js";
|
|
23
23
|
import {
|
|
24
24
|
throwIfAborted
|
|
25
25
|
} from "./chunk-USRKPEQN.js";
|
|
@@ -328,4 +328,4 @@ export {
|
|
|
328
328
|
llmJudge,
|
|
329
329
|
llmScore
|
|
330
330
|
};
|
|
331
|
-
//# sourceMappingURL=chunk-
|
|
331
|
+
//# sourceMappingURL=chunk-ROUJCOAN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateCompletion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GULOODEA.js";
|
|
4
4
|
import {
|
|
5
5
|
CompletionCapabilityError,
|
|
6
6
|
Usage
|
|
@@ -128,4 +128,4 @@ export {
|
|
|
128
128
|
ExtractionError,
|
|
129
129
|
extract
|
|
130
130
|
};
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
131
|
+
//# sourceMappingURL=chunk-T5FMJJKQ.js.map
|
|
@@ -60,6 +60,7 @@ function isRichToolOutput(value) {
|
|
|
60
60
|
return Object.getOwnPropertyDescriptor(value, richToolOutput)?.value === true;
|
|
61
61
|
}
|
|
62
62
|
function parseToolArgs(args) {
|
|
63
|
+
if (args.trim() === "") return {};
|
|
63
64
|
const value = JSON.parse(args);
|
|
64
65
|
if (!isJsonValue(value)) {
|
|
65
66
|
throw new TypeError("Tool arguments must be a JSON value.");
|
|
@@ -74,4 +75,4 @@ export {
|
|
|
74
75
|
toolResultContentToText,
|
|
75
76
|
parseToolArgs
|
|
76
77
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
78
|
+
//# sourceMappingURL=chunk-TMSWHXYQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tool/tool.ts"],"sourcesContent":["import { isJsonValue } from \"../completion/json\";\nimport { parseMessage } from \"../completion/message-schema\";\nimport type {\n JsonObject,\n JsonValue,\n ToolDefinition,\n ToolResultContentPart,\n ToolResultOutput,\n} from \"../completion/types\";\n\n/** Identifies the agent run that requested a tool approval. */\nexport type ToolApprovalRunContext = {\n agentId: string;\n runId: string;\n sessionId?: string;\n metadata?: JsonObject;\n};\n\n/** Details of the pending tool call being evaluated for approval. */\nexport type ToolApprovalContext<Args = unknown> = {\n toolName: string;\n args: Args;\n /** The serialized argument string passed to hooks and approval checks. */\n rawArgs: string;\n toolCallId: string;\n callId?: string;\n internalCallId: string;\n run: ToolApprovalRunContext;\n};\n\n/** An approval demand, with an optional human-readable reason. */\nexport type ToolApprovalRequirement = {\n reason?: string | undefined;\n};\n\n/**\n * Whether a tool call needs human approval before execution:\n *\n * - `boolean`: a static requirement\n * - `ToolApprovalRequirement`: a requirement with a reason\n * - a function: evaluated per call, receiving the parsed args and call context\n */\nexport type ToolRequiresApproval<Args = unknown> =\n | boolean\n | ToolApprovalRequirement\n | ((\n args: Args,\n context: ToolApprovalContext<Args>,\n ) => boolean | ToolApprovalRequirement | Promise<boolean | ToolApprovalRequirement>);\n\n/** A child-agent event forwarded through a tool into the parent run's stream. */\nexport type ToolCallStreamEvent = {\n agentId: string;\n agentName?: string | undefined;\n event: unknown;\n};\n\n/** Execution context handed to a tool when the run invokes it. */\nexport type ToolCallContext = {\n /** Stable external-operation identity supplied by a durable execution runtime. */\n operationId?: string | undefined;\n /** Emits a child-agent event into the parent run's stream. */\n emitStreamEvent?(event: ToolCallStreamEvent): void | Promise<void>;\n /** Aborted when the run is cancelled or the stream consumer leaves. */\n abortSignal?: AbortSignal | undefined;\n};\n\n/**\n * A model-callable tool. `definition` builds the model-facing JSON description,\n * `call` executes it, and the optional `parseInput` converts raw model-supplied\n * JSON arguments into the typed `Args` before `call` runs.\n */\nexport interface Tool<Args = unknown, Output = unknown> {\n readonly name: string;\n readonly requiresApproval?: ToolRequiresApproval<Args>;\n definition(prompt: string): ToolDefinition | Promise<ToolDefinition>;\n call(args: Args, context?: ToolCallContext): Output | Promise<Output>;\n parseInput?(args: JsonValue): Args;\n}\n\n/** A tool with its argument and output types erased, e.g. as stored in an agent's catalog. */\nexport type AnyTool = Omit<Tool<unknown, unknown>, \"requiresApproval\"> & {\n readonly requiresApproval?: unknown;\n};\n\nconst richToolOutput: unique symbol = Symbol.for(\"anvia.tool-output.content\");\n\n/**\n * A tool result carrying mixed content parts (text, files), created with\n * {@link ToolOutput.content}. The brand symbol keeps plain objects from\n * impersonating rich outputs.\n */\nexport type RichToolOutput = Readonly<{\n [richToolOutput]: true;\n content: readonly ToolResultContentPart[];\n}>;\n\n/** Normalized tool result as stored in tool messages. */\nexport type NormalizedToolOutput = ToolResultOutput;\n\n/** Thrown when a tool returns a value that cannot be represented as a tool result. */\nexport class ToolResultSerializationError extends TypeError {\n constructor(readonly output: unknown) {\n super(\"Tool output must be a string, a strict JSON value, or ToolOutput.content(...).\");\n this.name = \"ToolResultSerializationError\";\n }\n}\n\n/** Helpers for building tool results. */\nexport const ToolOutput = {\n /** Wraps content parts so a tool can return text and files together. */\n content(content: readonly ToolResultContentPart[]): RichToolOutput {\n return { [richToolOutput]: true, content };\n },\n};\n\n/**\n * Coerces a tool's return value into a normalized result: strings become text,\n * rich outputs are validated, and strict JSON values become JSON results.\n * Anything else throws {@link ToolResultSerializationError}.\n */\nexport function normalizeToolResultOutput(output: unknown): NormalizedToolOutput {\n if (typeof output === \"string\") {\n return { type: \"text\", value: output };\n }\n if (isRichToolOutput(output)) {\n try {\n const message = parseMessage({\n role: \"tool\",\n content: [\n {\n type: \"tool-result\",\n toolCallId: \"validation\",\n toolName: \"validation\",\n output: { type: \"content\", value: output.content },\n },\n ],\n });\n if (message.role !== \"tool\") throw new TypeError(\"Unexpected message role\");\n const result = message.content[0];\n if (result?.type !== \"tool-result\") throw new TypeError(\"Unexpected tool result part\");\n if (result?.output.type !== \"content\") throw new TypeError(\"Unexpected tool output\");\n return result.output;\n } catch {\n throw new ToolResultSerializationError(output);\n }\n }\n if (isJsonValue(output)) {\n return { type: \"json\", value: output };\n }\n throw new ToolResultSerializationError(output);\n}\n\n/** Renders tool result content as text; file parts become `[file:<mediaType>]` placeholders. */\nexport function toolResultContentToText(content: readonly ToolResultContentPart[]): string {\n return content\n .map((item) => (item.type === \"text\" ? item.text : `[file:${item.mediaType}]`))\n .join(\"\\n\");\n}\n\nfunction isRichToolOutput(value: unknown): value is RichToolOutput {\n if (typeof value !== \"object\" || value === null) return false;\n return Object.getOwnPropertyDescriptor(value, richToolOutput)?.value === true;\n}\n\n
|
|
1
|
+
{"version":3,"sources":["../src/tool/tool.ts"],"sourcesContent":["import { isJsonValue } from \"../completion/json\";\nimport { parseMessage } from \"../completion/message-schema\";\nimport type {\n JsonObject,\n JsonValue,\n ToolDefinition,\n ToolResultContentPart,\n ToolResultOutput,\n} from \"../completion/types\";\n\n/** Identifies the agent run that requested a tool approval. */\nexport type ToolApprovalRunContext = {\n agentId: string;\n runId: string;\n sessionId?: string;\n metadata?: JsonObject;\n};\n\n/** Details of the pending tool call being evaluated for approval. */\nexport type ToolApprovalContext<Args = unknown> = {\n toolName: string;\n args: Args;\n /** The serialized argument string passed to hooks and approval checks. */\n rawArgs: string;\n toolCallId: string;\n callId?: string;\n internalCallId: string;\n run: ToolApprovalRunContext;\n};\n\n/** An approval demand, with an optional human-readable reason. */\nexport type ToolApprovalRequirement = {\n reason?: string | undefined;\n};\n\n/**\n * Whether a tool call needs human approval before execution:\n *\n * - `boolean`: a static requirement\n * - `ToolApprovalRequirement`: a requirement with a reason\n * - a function: evaluated per call, receiving the parsed args and call context\n */\nexport type ToolRequiresApproval<Args = unknown> =\n | boolean\n | ToolApprovalRequirement\n | ((\n args: Args,\n context: ToolApprovalContext<Args>,\n ) => boolean | ToolApprovalRequirement | Promise<boolean | ToolApprovalRequirement>);\n\n/** A child-agent event forwarded through a tool into the parent run's stream. */\nexport type ToolCallStreamEvent = {\n agentId: string;\n agentName?: string | undefined;\n event: unknown;\n};\n\n/** Execution context handed to a tool when the run invokes it. */\nexport type ToolCallContext = {\n /** Stable external-operation identity supplied by a durable execution runtime. */\n operationId?: string | undefined;\n /** Emits a child-agent event into the parent run's stream. */\n emitStreamEvent?(event: ToolCallStreamEvent): void | Promise<void>;\n /** Aborted when the run is cancelled or the stream consumer leaves. */\n abortSignal?: AbortSignal | undefined;\n};\n\n/**\n * A model-callable tool. `definition` builds the model-facing JSON description,\n * `call` executes it, and the optional `parseInput` converts raw model-supplied\n * JSON arguments into the typed `Args` before `call` runs.\n */\nexport interface Tool<Args = unknown, Output = unknown> {\n readonly name: string;\n readonly requiresApproval?: ToolRequiresApproval<Args>;\n definition(prompt: string): ToolDefinition | Promise<ToolDefinition>;\n call(args: Args, context?: ToolCallContext): Output | Promise<Output>;\n parseInput?(args: JsonValue): Args;\n}\n\n/** A tool with its argument and output types erased, e.g. as stored in an agent's catalog. */\nexport type AnyTool = Omit<Tool<unknown, unknown>, \"requiresApproval\"> & {\n readonly requiresApproval?: unknown;\n};\n\nconst richToolOutput: unique symbol = Symbol.for(\"anvia.tool-output.content\");\n\n/**\n * A tool result carrying mixed content parts (text, files), created with\n * {@link ToolOutput.content}. The brand symbol keeps plain objects from\n * impersonating rich outputs.\n */\nexport type RichToolOutput = Readonly<{\n [richToolOutput]: true;\n content: readonly ToolResultContentPart[];\n}>;\n\n/** Normalized tool result as stored in tool messages. */\nexport type NormalizedToolOutput = ToolResultOutput;\n\n/** Thrown when a tool returns a value that cannot be represented as a tool result. */\nexport class ToolResultSerializationError extends TypeError {\n constructor(readonly output: unknown) {\n super(\"Tool output must be a string, a strict JSON value, or ToolOutput.content(...).\");\n this.name = \"ToolResultSerializationError\";\n }\n}\n\n/** Helpers for building tool results. */\nexport const ToolOutput = {\n /** Wraps content parts so a tool can return text and files together. */\n content(content: readonly ToolResultContentPart[]): RichToolOutput {\n return { [richToolOutput]: true, content };\n },\n};\n\n/**\n * Coerces a tool's return value into a normalized result: strings become text,\n * rich outputs are validated, and strict JSON values become JSON results.\n * Anything else throws {@link ToolResultSerializationError}.\n */\nexport function normalizeToolResultOutput(output: unknown): NormalizedToolOutput {\n if (typeof output === \"string\") {\n return { type: \"text\", value: output };\n }\n if (isRichToolOutput(output)) {\n try {\n const message = parseMessage({\n role: \"tool\",\n content: [\n {\n type: \"tool-result\",\n toolCallId: \"validation\",\n toolName: \"validation\",\n output: { type: \"content\", value: output.content },\n },\n ],\n });\n if (message.role !== \"tool\") throw new TypeError(\"Unexpected message role\");\n const result = message.content[0];\n if (result?.type !== \"tool-result\") throw new TypeError(\"Unexpected tool result part\");\n if (result?.output.type !== \"content\") throw new TypeError(\"Unexpected tool output\");\n return result.output;\n } catch {\n throw new ToolResultSerializationError(output);\n }\n }\n if (isJsonValue(output)) {\n return { type: \"json\", value: output };\n }\n throw new ToolResultSerializationError(output);\n}\n\n/** Renders tool result content as text; file parts become `[file:<mediaType>]` placeholders. */\nexport function toolResultContentToText(content: readonly ToolResultContentPart[]): string {\n return content\n .map((item) => (item.type === \"text\" ? item.text : `[file:${item.mediaType}]`))\n .join(\"\\n\");\n}\n\nfunction isRichToolOutput(value: unknown): value is RichToolOutput {\n if (typeof value !== \"object\" || value === null) return false;\n return Object.getOwnPropertyDescriptor(value, richToolOutput)?.value === true;\n}\n\n/**\n * Parses and JSON-validates the raw argument string supplied by the model.\n * Blank argument strings are treated as an empty object for zero-argument tool calls.\n */\nexport function parseToolArgs(args: string): JsonValue {\n if (args.trim() === \"\") return {};\n const value: unknown = JSON.parse(args);\n if (!isJsonValue(value)) {\n throw new TypeError(\"Tool arguments must be a JSON value.\");\n }\n return value;\n}\n"],"mappings":";;;;;;;;AAqFA,IAAM,iBAAgC,uBAAO,IAAI,2BAA2B;AAgBrE,IAAM,+BAAN,cAA2C,UAAU;AAAA,EAC1D,YAAqB,QAAiB;AACpC,UAAM,gFAAgF;AADnE;AAEnB,SAAK,OAAO;AAAA,EACd;AAAA,EAHqB;AAIvB;AAGO,IAAM,aAAa;AAAA;AAAA,EAExB,QAAQ,SAA2D;AACjE,WAAO,EAAE,CAAC,cAAc,GAAG,MAAM,QAAQ;AAAA,EAC3C;AACF;AAOO,SAAS,0BAA0B,QAAuC;AAC/E,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO,EAAE,MAAM,QAAQ,OAAO,OAAO;AAAA,EACvC;AACA,MAAI,iBAAiB,MAAM,GAAG;AAC5B,QAAI;AACF,YAAM,UAAU,aAAa;AAAA,QAC3B,MAAM;AAAA,QACN,SAAS;AAAA,UACP;AAAA,YACE,MAAM;AAAA,YACN,YAAY;AAAA,YACZ,UAAU;AAAA,YACV,QAAQ,EAAE,MAAM,WAAW,OAAO,OAAO,QAAQ;AAAA,UACnD;AAAA,QACF;AAAA,MACF,CAAC;AACD,UAAI,QAAQ,SAAS,OAAQ,OAAM,IAAI,UAAU,yBAAyB;AAC1E,YAAM,SAAS,QAAQ,QAAQ,CAAC;AAChC,UAAI,QAAQ,SAAS,cAAe,OAAM,IAAI,UAAU,6BAA6B;AACrF,UAAI,QAAQ,OAAO,SAAS,UAAW,OAAM,IAAI,UAAU,wBAAwB;AACnF,aAAO,OAAO;AAAA,IAChB,QAAQ;AACN,YAAM,IAAI,6BAA6B,MAAM;AAAA,IAC/C;AAAA,EACF;AACA,MAAI,YAAY,MAAM,GAAG;AACvB,WAAO,EAAE,MAAM,QAAQ,OAAO,OAAO;AAAA,EACvC;AACA,QAAM,IAAI,6BAA6B,MAAM;AAC/C;AAGO,SAAS,wBAAwB,SAAmD;AACzF,SAAO,QACJ,IAAI,CAAC,SAAU,KAAK,SAAS,SAAS,KAAK,OAAO,SAAS,KAAK,SAAS,GAAI,EAC7E,KAAK,IAAI;AACd;AAEA,SAAS,iBAAiB,OAAyC;AACjE,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,SAAO,OAAO,yBAAyB,OAAO,cAAc,GAAG,UAAU;AAC3E;AAMO,SAAS,cAAc,MAAyB;AACrD,MAAI,KAAK,KAAK,MAAM,GAAI,QAAO,CAAC;AAChC,QAAM,QAAiB,KAAK,MAAM,IAAI;AACtC,MAAI,CAAC,YAAY,KAAK,GAAG;AACvB,UAAM,IAAI,UAAU,sCAAsC;AAAA,EAC5D;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createTool
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z5WMW4NP.js";
|
|
4
4
|
|
|
5
5
|
// src/tool/think-tool.ts
|
|
6
6
|
import { z } from "zod";
|
|
@@ -21,4 +21,4 @@ function createThinkTool(options = {}) {
|
|
|
21
21
|
export {
|
|
22
22
|
createThinkTool
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-WACXVXGU.js.map
|
|
@@ -39,16 +39,31 @@ function appendStageNode(state, kind, stage, options = {}) {
|
|
|
39
39
|
function appendComposedGraph(state, boundary, child) {
|
|
40
40
|
return appendChildGraph(state, boundary.path, child);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
function appendBranches(state, parent, branches, branchOf) {
|
|
43
|
+
let nextState = state;
|
|
44
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
45
|
+
const terminalPaths = [];
|
|
46
|
+
for (const [branchKey, child] of branches) {
|
|
47
|
+
const id = validateStageId(branchKey);
|
|
48
|
+
const node = graphNode(id, [...parent.path, id], "branch", id, {
|
|
49
|
+
branchKey: id,
|
|
50
|
+
branchOf,
|
|
51
|
+
pipelineId: child.id
|
|
52
|
+
});
|
|
53
|
+
const edgeLabel = branchOf === "route" ? id : void 0;
|
|
54
|
+
const withBranch = appendNode(
|
|
55
|
+
nextState,
|
|
56
|
+
node,
|
|
57
|
+
[parent.path],
|
|
58
|
+
nextState.terminalPaths,
|
|
59
|
+
void 0,
|
|
60
|
+
edgeLabel
|
|
61
|
+
);
|
|
62
|
+
nextState = appendChildGraph(withBranch, node.path, child);
|
|
63
|
+
nodes.set(id, node);
|
|
64
|
+
terminalPaths.push(...nextState.terminalPaths);
|
|
65
|
+
}
|
|
66
|
+
return { state: { ...nextState, terminalPaths }, nodes };
|
|
52
67
|
}
|
|
53
68
|
function withOutputNode(state) {
|
|
54
69
|
const graph = cloneGraph(state.graph);
|
|
@@ -114,12 +129,16 @@ function appendChildGraph(state, parentPath, child) {
|
|
|
114
129
|
nextEdgeIndex
|
|
115
130
|
};
|
|
116
131
|
}
|
|
117
|
-
function appendNode(state, node, sourcePaths, terminalPaths, stageId) {
|
|
118
|
-
const edges = sourcePaths.map((source, index) =>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
function appendNode(state, node, sourcePaths, terminalPaths, stageId, edgeLabel) {
|
|
133
|
+
const edges = sourcePaths.map((source, index) => {
|
|
134
|
+
const edge = {
|
|
135
|
+
id: `edge_${state.nextEdgeIndex + index}`,
|
|
136
|
+
source: [...source],
|
|
137
|
+
target: [...node.path]
|
|
138
|
+
};
|
|
139
|
+
if (edgeLabel !== void 0) edge.label = edgeLabel;
|
|
140
|
+
return edge;
|
|
141
|
+
});
|
|
123
142
|
const stageIds = new Set(state.stageIds);
|
|
124
143
|
if (stageId !== void 0) stageIds.add(stageId);
|
|
125
144
|
return {
|
|
@@ -141,6 +160,7 @@ function graphNode(id, path, kind, label, options = {}) {
|
|
|
141
160
|
if (options.agentName !== void 0) node.agentName = options.agentName;
|
|
142
161
|
if (options.pipelineId !== void 0) node.pipelineId = options.pipelineId;
|
|
143
162
|
if (options.branchKey !== void 0) node.branchKey = options.branchKey;
|
|
163
|
+
if (options.branchOf !== void 0) node.branchOf = options.branchOf;
|
|
144
164
|
return node;
|
|
145
165
|
}
|
|
146
166
|
function validateStageId(value) {
|
|
@@ -173,10 +193,9 @@ export {
|
|
|
173
193
|
initialPipelineState,
|
|
174
194
|
appendStageNode,
|
|
175
195
|
appendComposedGraph,
|
|
176
|
-
|
|
177
|
-
withTerminalPaths,
|
|
196
|
+
appendBranches,
|
|
178
197
|
withOutputNode,
|
|
179
198
|
cloneGraph,
|
|
180
199
|
scopedNode
|
|
181
200
|
};
|
|
182
|
-
//# sourceMappingURL=chunk-
|
|
201
|
+
//# sourceMappingURL=chunk-YKGIOXTR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/pipeline/graph.ts"],"sourcesContent":["import type { JsonObject } from \"../completion\";\nimport type {\n PipelineGraph,\n PipelineGraphEdge,\n PipelineGraphNode,\n PipelineNodePath,\n PipelineStageKind,\n PipelineStageMetadata,\n PipelineState,\n} from \"./types\";\n\nconst INPUT_ID = \"$input\";\nconst OUTPUT_ID = \"$output\";\nconst RESERVED_STAGE_IDS = new Set([INPUT_ID, OUTPUT_ID]);\n\nexport function initialPipelineState(options: {\n id: string;\n name?: string | undefined;\n description?: string | undefined;\n metadata?: JsonObject | undefined;\n}): PipelineState {\n const input = graphNode(INPUT_ID, [INPUT_ID], \"input\", \"Input\");\n const graph: PipelineGraph = {\n id: options.id,\n nodes: [input],\n edges: [],\n };\n if (options.name !== undefined) graph.name = options.name;\n if (options.description !== undefined) graph.description = options.description;\n if (options.metadata !== undefined) graph.metadata = options.metadata;\n return {\n graph,\n terminalPaths: [input.path],\n stageIds: new Set(),\n nextEdgeIndex: 1,\n };\n}\n\nexport function appendStageNode(\n state: PipelineState,\n kind: PipelineStageKind,\n stage: PipelineStageMetadata,\n options: {\n defaultLabel?: string | undefined;\n agentId?: string | undefined;\n agentName?: string | undefined;\n pipelineId?: string | undefined;\n } = {},\n): { state: PipelineState; node: PipelineGraphNode } {\n const id = validateStageId(stage.id);\n if (state.stageIds.has(id)) {\n throw new TypeError(`Pipeline stage id \"${id}\" is already registered.`);\n }\n const node = graphNode(id, [id], kind, stage.name ?? options.defaultLabel ?? id, {\n description: stage.description,\n metadata: stage.metadata,\n agentId: options.agentId,\n agentName: options.agentName,\n pipelineId: options.pipelineId,\n });\n return {\n node,\n state: appendNode(state, node, state.terminalPaths, [node.path], id),\n };\n}\n\nexport function appendComposedGraph(\n state: PipelineState,\n boundary: PipelineGraphNode,\n child: PipelineGraph,\n): PipelineState {\n return appendChildGraph(state, boundary.path, child);\n}\n\n/** Append one branch per child graph under a parallel or route node, joining their terminals. */\nexport function appendBranches(\n state: PipelineState,\n parent: PipelineGraphNode,\n branches: ReadonlyArray<readonly [string, PipelineGraph]>,\n branchOf: \"parallel\" | \"route\",\n): { state: PipelineState; nodes: Map<string, PipelineGraphNode> } {\n let nextState = state;\n const nodes = new Map<string, PipelineGraphNode>();\n const terminalPaths: PipelineNodePath[] = [];\n for (const [branchKey, child] of branches) {\n const id = validateStageId(branchKey);\n const node = graphNode(id, [...parent.path, id], \"branch\", id, {\n branchKey: id,\n branchOf,\n pipelineId: child.id,\n });\n const edgeLabel = branchOf === \"route\" ? id : undefined;\n const withBranch = appendNode(\n nextState,\n node,\n [parent.path],\n nextState.terminalPaths,\n undefined,\n edgeLabel,\n );\n nextState = appendChildGraph(withBranch, node.path, child);\n nodes.set(id, node);\n terminalPaths.push(...nextState.terminalPaths);\n }\n return { state: { ...nextState, terminalPaths }, nodes };\n}\n\nexport function withOutputNode(state: PipelineState): PipelineGraph {\n const graph = cloneGraph(state.graph);\n const outputPath = [OUTPUT_ID];\n if (graph.nodes.some((node) => pathEquals(node.path, outputPath))) {\n return graph;\n }\n graph.nodes.push(graphNode(OUTPUT_ID, outputPath, \"output\", \"Output\"));\n graph.edges.push(\n ...state.terminalPaths.map((source, index) => ({\n id: `edge_${state.nextEdgeIndex + index}`,\n source: [...source],\n target: outputPath,\n })),\n );\n return graph;\n}\n\nexport function cloneGraph(graph: PipelineGraph): PipelineGraph {\n return {\n ...graph,\n nodes: graph.nodes.map((node) => ({ ...node, path: [...node.path] })),\n edges: graph.edges.map((edge) => ({\n ...edge,\n source: [...edge.source],\n target: [...edge.target],\n })),\n };\n}\n\nexport function scopedNode(node: PipelineGraphNode, path: PipelineNodePath): PipelineGraphNode {\n return { ...node, path: [...path] };\n}\n\nfunction appendChildGraph(\n state: PipelineState,\n parentPath: PipelineNodePath,\n child: PipelineGraph,\n): PipelineState {\n const childNodes = child.nodes\n .filter((node) => !isBoundaryPath(node.path))\n .map((node) => scopedNode(node, [...parentPath, ...node.path]));\n const childEdges: PipelineState[\"graph\"][\"edges\"] = [];\n const terminalPaths: PipelineNodePath[] = [];\n let nextEdgeIndex = state.nextEdgeIndex;\n\n for (const edge of child.edges) {\n const sourceIsInput = isInputPath(edge.source);\n const targetIsOutput = isOutputPath(edge.target);\n const source = sourceIsInput ? [...parentPath] : [...parentPath, ...edge.source];\n if (targetIsOutput) {\n terminalPaths.push(source);\n continue;\n }\n const target = [...parentPath, ...edge.target];\n let childEdge: PipelineGraphEdge = {\n id: `edge_${nextEdgeIndex}`,\n source,\n target,\n };\n if (edge.label !== undefined) childEdge = { ...childEdge, label: edge.label };\n childEdges.push(childEdge);\n nextEdgeIndex += 1;\n }\n\n return {\n ...state,\n graph: {\n ...state.graph,\n nodes: [...state.graph.nodes, ...childNodes],\n edges: [...state.graph.edges, ...childEdges],\n },\n terminalPaths: terminalPaths.length === 0 ? [[...parentPath]] : terminalPaths,\n nextEdgeIndex,\n };\n}\n\nfunction appendNode(\n state: PipelineState,\n node: PipelineGraphNode,\n sourcePaths: PipelineNodePath[],\n terminalPaths: PipelineNodePath[],\n stageId?: string,\n edgeLabel?: string,\n): PipelineState {\n const edges = sourcePaths.map((source, index) => {\n const edge: PipelineGraphEdge = {\n id: `edge_${state.nextEdgeIndex + index}`,\n source: [...source],\n target: [...node.path],\n };\n if (edgeLabel !== undefined) edge.label = edgeLabel;\n return edge;\n });\n const stageIds = new Set(state.stageIds);\n if (stageId !== undefined) stageIds.add(stageId);\n return {\n graph: {\n ...state.graph,\n nodes: [...state.graph.nodes, node],\n edges: [...state.graph.edges, ...edges],\n },\n terminalPaths,\n stageIds,\n nextEdgeIndex: state.nextEdgeIndex + edges.length,\n };\n}\n\nfunction graphNode(\n id: string,\n path: PipelineNodePath,\n kind: PipelineStageKind,\n label: string,\n options: {\n description?: string | undefined;\n metadata?: JsonObject | undefined;\n agentId?: string | undefined;\n agentName?: string | undefined;\n pipelineId?: string | undefined;\n branchKey?: string | undefined;\n branchOf?: \"parallel\" | \"route\" | undefined;\n } = {},\n): PipelineGraphNode {\n const node: PipelineGraphNode = { id, path: [...path], kind, label };\n if (options.description !== undefined) node.description = options.description;\n if (options.metadata !== undefined) node.metadata = options.metadata;\n if (options.agentId !== undefined) node.agentId = options.agentId;\n if (options.agentName !== undefined) node.agentName = options.agentName;\n if (options.pipelineId !== undefined) node.pipelineId = options.pipelineId;\n if (options.branchKey !== undefined) node.branchKey = options.branchKey;\n if (options.branchOf !== undefined) node.branchOf = options.branchOf;\n return node;\n}\n\nfunction validateStageId(value: string): string {\n if (typeof value !== \"string\") {\n throw new TypeError(\"Pipeline stage id must be a string.\");\n }\n const id = value.trim();\n if (id.length === 0) {\n throw new TypeError(\"Pipeline stage id must be a non-empty string.\");\n }\n if (RESERVED_STAGE_IDS.has(id)) {\n throw new TypeError(`Pipeline stage id \"${id}\" is reserved.`);\n }\n return id;\n}\n\nfunction isBoundaryPath(path: PipelineNodePath): boolean {\n return isInputPath(path) || isOutputPath(path);\n}\n\nfunction isInputPath(path: PipelineNodePath): boolean {\n return path.length === 1 && path[0] === INPUT_ID;\n}\n\nfunction isOutputPath(path: PipelineNodePath): boolean {\n return path.length === 1 && path[0] === OUTPUT_ID;\n}\n\nfunction pathEquals(left: PipelineNodePath, right: PipelineNodePath): boolean {\n return left.length === right.length && left.every((segment, index) => segment === right[index]);\n}\n"],"mappings":";AAWA,IAAM,WAAW;AACjB,IAAM,YAAY;AAClB,IAAM,qBAAqB,oBAAI,IAAI,CAAC,UAAU,SAAS,CAAC;AAEjD,SAAS,qBAAqB,SAKnB;AAChB,QAAM,QAAQ,UAAU,UAAU,CAAC,QAAQ,GAAG,SAAS,OAAO;AAC9D,QAAM,QAAuB;AAAA,IAC3B,IAAI,QAAQ;AAAA,IACZ,OAAO,CAAC,KAAK;AAAA,IACb,OAAO,CAAC;AAAA,EACV;AACA,MAAI,QAAQ,SAAS,OAAW,OAAM,OAAO,QAAQ;AACrD,MAAI,QAAQ,gBAAgB,OAAW,OAAM,cAAc,QAAQ;AACnE,MAAI,QAAQ,aAAa,OAAW,OAAM,WAAW,QAAQ;AAC7D,SAAO;AAAA,IACL;AAAA,IACA,eAAe,CAAC,MAAM,IAAI;AAAA,IAC1B,UAAU,oBAAI,IAAI;AAAA,IAClB,eAAe;AAAA,EACjB;AACF;AAEO,SAAS,gBACd,OACA,MACA,OACA,UAKI,CAAC,GAC8C;AACnD,QAAM,KAAK,gBAAgB,MAAM,EAAE;AACnC,MAAI,MAAM,SAAS,IAAI,EAAE,GAAG;AAC1B,UAAM,IAAI,UAAU,sBAAsB,EAAE,0BAA0B;AAAA,EACxE;AACA,QAAM,OAAO,UAAU,IAAI,CAAC,EAAE,GAAG,MAAM,MAAM,QAAQ,QAAQ,gBAAgB,IAAI;AAAA,IAC/E,aAAa,M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
2
2
|
attachPreparedToolOwner,
|
|
3
3
|
preparedToolInput,
|
|
4
4
|
withoutPreparedToolInput
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6YYZ7VJQ.js";
|
|
6
6
|
import {
|
|
7
7
|
assertToolApprovalRequirement
|
|
8
8
|
} from "./chunk-YZVFIW5D.js";
|
|
@@ -55,4 +55,4 @@ function snapshotApprovalRequirement(requirement) {
|
|
|
55
55
|
export {
|
|
56
56
|
createTool
|
|
57
57
|
};
|
|
58
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-Z5WMW4NP.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InMemoryVectorStore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L2UPWQQZ.js";
|
|
4
4
|
import {
|
|
5
5
|
retrieveDocuments
|
|
6
6
|
} from "./chunk-CB2L2NIQ.js";
|
|
@@ -108,4 +108,4 @@ export {
|
|
|
108
108
|
createToolIndex,
|
|
109
109
|
isToolIndex
|
|
110
110
|
};
|
|
111
|
-
//# sourceMappingURL=chunk-
|
|
111
|
+
//# sourceMappingURL=chunk-ZQC5V2AM.js.map
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-X6WS3XWL.js";
|
|
4
4
|
import {
|
|
5
5
|
TeamRun
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NSG2CIGM.js";
|
|
7
7
|
import {
|
|
8
8
|
TeamStream
|
|
9
9
|
} from "./chunk-3TAQXJBC.js";
|
|
10
10
|
import {
|
|
11
11
|
Agent
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ONFVTMN3.js";
|
|
13
13
|
import {
|
|
14
14
|
assertPositiveSafeInteger
|
|
15
15
|
} from "./chunk-NPJ2T3L5.js";
|
|
@@ -104,4 +104,4 @@ var AgentTeam = class {
|
|
|
104
104
|
export {
|
|
105
105
|
AgentTeam
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-ZXSAPGWJ.js.map
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
generateCompletion,
|
|
4
4
|
isStreamingCompletionModel,
|
|
5
5
|
streamCompletion
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-GULOODEA.js";
|
|
7
7
|
import "../chunk-57AUTEQ6.js";
|
|
8
8
|
import "../chunk-6OO5C5GW.js";
|
|
9
9
|
import "../chunk-GSVOMQEE.js";
|
|
10
10
|
import "../chunk-4ONUNWGC.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-3VIMLOWJ.js";
|
|
12
12
|
import "../chunk-XQV3XNVT.js";
|
|
13
13
|
import "../chunk-HJ6KTQTZ.js";
|
|
14
14
|
import "../chunk-BONQTXRQ.js";
|
package/dist/completion/index.js
CHANGED
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
generateCompletion,
|
|
14
14
|
isStreamingCompletionModel,
|
|
15
15
|
streamCompletion
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-GULOODEA.js";
|
|
17
17
|
import "../chunk-57AUTEQ6.js";
|
|
18
18
|
import "../chunk-6OO5C5GW.js";
|
|
19
19
|
import "../chunk-GSVOMQEE.js";
|
|
20
20
|
import "../chunk-4ONUNWGC.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-3VIMLOWJ.js";
|
|
22
22
|
import {
|
|
23
23
|
COMPLETION_PROVIDER_OUTPUT_ERROR_CODE,
|
|
24
24
|
CompletionProviderOutputError
|
package/dist/decision/index.d.ts
CHANGED
|
@@ -1,121 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** Labels mapped to descriptions or structured criteria; null leaves a label undescribed. */
|
|
7
|
-
type DecisionOptions = Readonly<Record<string, JsonValue>>;
|
|
8
|
-
/** Ordered levels indexed from zero. At least two levels are required. */
|
|
9
|
-
type DecisionRubric = readonly [JsonValue, JsonValue, ...JsonValue[]];
|
|
10
|
-
type ChoiceQuestion<Options extends DecisionOptions = DecisionOptions> = {
|
|
11
|
-
readonly type: "choice";
|
|
12
|
-
readonly instructions: string;
|
|
13
|
-
readonly options: Options;
|
|
14
|
-
};
|
|
15
|
-
type MultiLabelQuestion<Options extends DecisionOptions = DecisionOptions> = {
|
|
16
|
-
readonly type: "multi-label";
|
|
17
|
-
readonly instructions: string;
|
|
18
|
-
readonly options: Options;
|
|
19
|
-
/** Inclusive threshold on each label's independent probability. Defaults to 0.5. */
|
|
20
|
-
readonly threshold?: number | undefined;
|
|
21
|
-
};
|
|
22
|
-
type ScoreQuestion<Rubric extends DecisionRubric = DecisionRubric> = {
|
|
23
|
-
readonly type: "score";
|
|
24
|
-
readonly instructions: string;
|
|
25
|
-
readonly rubric: Rubric;
|
|
26
|
-
};
|
|
27
|
-
type CheckQuestion = {
|
|
28
|
-
readonly type: "check";
|
|
29
|
-
readonly instructions: string;
|
|
30
|
-
};
|
|
31
|
-
type DecisionQuestion = ChoiceQuestion | MultiLabelQuestion | ScoreQuestion | CheckQuestion;
|
|
32
|
-
type DecisionQuestions = Readonly<Record<string, DecisionQuestion>>;
|
|
33
|
-
type DecisionQuestionType = DecisionQuestion["type"];
|
|
34
|
-
type ChoiceAnswer<Label extends string = string> = {
|
|
35
|
-
readonly type: "choice";
|
|
36
|
-
readonly choice: Label;
|
|
37
|
-
/** Exclusive probabilities summing to one, when reported by the provider. */
|
|
38
|
-
readonly probabilities?: Readonly<Record<Label, number>> | undefined;
|
|
39
|
-
/** Provider-reported confidence; not derived from the highest probability. */
|
|
40
|
-
readonly confidence?: number | undefined;
|
|
41
|
-
};
|
|
42
|
-
type MultiLabelAnswer<Label extends string = string> = {
|
|
43
|
-
readonly type: "multi-label";
|
|
44
|
-
readonly labels: readonly Label[];
|
|
45
|
-
/** Independent probabilities; they do not need to sum to one. */
|
|
46
|
-
readonly probabilities: Readonly<Record<Label, number>>;
|
|
47
|
-
};
|
|
48
|
-
type ScoreAnswer<Rubric extends DecisionRubric = DecisionRubric> = {
|
|
49
|
-
readonly type: "score";
|
|
50
|
-
/** Position on the zero-indexed rubric, potentially fractional. */
|
|
51
|
-
readonly score: number;
|
|
52
|
-
readonly rubric: Rubric;
|
|
53
|
-
/** Exclusive distribution over rubric levels, in rubric order. */
|
|
54
|
-
readonly probabilities?: readonly number[] | undefined;
|
|
55
|
-
readonly confidence?: number | undefined;
|
|
56
|
-
};
|
|
57
|
-
type CheckAnswer = {
|
|
58
|
-
readonly type: "check";
|
|
59
|
-
/** Estimated probability of yes, between zero and one. */
|
|
60
|
-
readonly probability: number;
|
|
61
|
-
};
|
|
62
|
-
type DecisionAnswerFor<Question extends DecisionQuestion> = Question extends ChoiceQuestion<infer Options> ? ChoiceAnswer<Extract<keyof Options, string>> : Question extends MultiLabelQuestion<infer Options> ? MultiLabelAnswer<Extract<keyof Options, string>> : Question extends ScoreQuestion<infer Rubric> ? ScoreAnswer<Rubric> : Question extends CheckQuestion ? CheckAnswer : never;
|
|
63
|
-
type DecisionAnswers<Questions extends DecisionQuestions> = {
|
|
64
|
-
readonly [Name in keyof Questions]: DecisionAnswerFor<Questions[Name]>;
|
|
65
|
-
};
|
|
66
|
-
type DecisionResult<Questions extends DecisionQuestions, RawResponse = unknown> = {
|
|
67
|
-
readonly answers: DecisionAnswers<Questions>;
|
|
68
|
-
/** Omitted by backends that do not report token usage. */
|
|
69
|
-
readonly usage?: Usage | undefined;
|
|
70
|
-
readonly rawResponse: RawResponse;
|
|
71
|
-
};
|
|
72
|
-
type DecisionCapabilities = {
|
|
73
|
-
readonly questionSupport: Readonly<Record<DecisionQuestionType, "native" | "composed" | "unsupported">>;
|
|
74
|
-
readonly mixedQuestions: boolean;
|
|
75
|
-
readonly limits?: {
|
|
76
|
-
readonly maxQuestionsPerRequest?: number | undefined;
|
|
77
|
-
readonly maxChoiceOptions?: number | undefined;
|
|
78
|
-
readonly maxMultiLabelOptions?: number | undefined;
|
|
79
|
-
readonly maxRubricLevels?: number | undefined;
|
|
80
|
-
} | undefined;
|
|
81
|
-
};
|
|
82
|
-
type DecisionRequest<Questions extends DecisionQuestions = DecisionQuestions> = {
|
|
83
|
-
readonly state: JsonValue;
|
|
84
|
-
readonly questions: Questions;
|
|
85
|
-
readonly providerOptions?: JsonObject | undefined;
|
|
86
|
-
};
|
|
87
|
-
/** One provider invocation. Call decide() for validation, retries, and cancellation. */
|
|
88
|
-
interface DecisionModel<RawResponse = unknown> {
|
|
89
|
-
readonly provider: string;
|
|
90
|
-
readonly modelId: string;
|
|
91
|
-
readonly capabilities: DecisionCapabilities;
|
|
92
|
-
decision<const Questions extends DecisionQuestions>(request: DecisionRequest<Questions>, options?: ModelCallOptions): Promise<DecisionResult<Questions, RawResponse>>;
|
|
93
|
-
}
|
|
94
|
-
type DecisionRawResponseOf<Model extends DecisionModel> = Model extends DecisionModel<infer RawResponse> ? RawResponse : never;
|
|
95
|
-
type DecideOptions<Questions extends DecisionQuestions, Model extends DecisionModel = DecisionModel> = DecisionRequest<Questions> & {
|
|
96
|
-
readonly model: Model;
|
|
97
|
-
readonly retries?: RetrySetting | undefined;
|
|
98
|
-
readonly abortSignal?: AbortSignal | undefined;
|
|
99
|
-
};
|
|
100
|
-
type DecideBatchOptions<Questions extends DecisionQuestions, Model extends DecisionModel = DecisionModel> = {
|
|
101
|
-
readonly model: Model;
|
|
102
|
-
readonly inputs: Iterable<DecisionRequest<Questions>>;
|
|
103
|
-
readonly concurrency: number;
|
|
104
|
-
readonly retries?: RetrySetting | undefined;
|
|
105
|
-
readonly abortSignal?: AbortSignal | undefined;
|
|
106
|
-
};
|
|
107
|
-
type DecisionBatchItem<Questions extends DecisionQuestions, RawResponse = unknown> = {
|
|
108
|
-
readonly index: number;
|
|
109
|
-
readonly status: "completed";
|
|
110
|
-
readonly result: DecisionResult<Questions, RawResponse>;
|
|
111
|
-
} | {
|
|
112
|
-
readonly index: number;
|
|
113
|
-
readonly status: "failed";
|
|
114
|
-
readonly error: unknown;
|
|
115
|
-
};
|
|
116
|
-
type DecisionBatchResult<Questions extends DecisionQuestions, RawResponse = unknown> = {
|
|
117
|
-
readonly items: readonly DecisionBatchItem<Questions, RawResponse>[];
|
|
118
|
-
};
|
|
1
|
+
export { J as JsonObject, t as JsonValue, U as Usage } from '../types-DYqZKDA8.js';
|
|
2
|
+
export { M as ModelCallOptions } from '../model-call-options-CZkSw_xN.js';
|
|
3
|
+
export { R as RetryContext, a as RetryOptions, b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
4
|
+
import { n as DecisionQuestions, j as DecisionModel, d as DecideOptions, q as DecisionResult, o as DecisionRawResponseOf, D as DecideBatchOptions, h as DecisionBatchResult, m as DecisionQuestionType, a as CheckQuestion, k as DecisionOptions, c as ChoiceQuestion, s as MultiLabelQuestion, r as DecisionRubric, t as ScoreQuestion } from '../types-Bt19cjEr.js';
|
|
5
|
+
export { C as CheckAnswer, b as ChoiceAnswer, e as DecisionAnswerFor, f as DecisionAnswers, g as DecisionBatchItem, i as DecisionCapabilities, l as DecisionQuestion, p as DecisionRequest, M as MultiLabelAnswer, S as ScoreAnswer } from '../types-Bt19cjEr.js';
|
|
119
6
|
|
|
120
7
|
declare function decide<const Questions extends DecisionQuestions, Model extends DecisionModel>(options: DecideOptions<Questions, Model>): Promise<DecisionResult<Questions, DecisionRawResponseOf<Model>>>;
|
|
121
8
|
/** Execute independent inputs with bounded concurrency, preserving order and individual failures. */
|
|
@@ -161,4 +48,4 @@ declare function multiLabel<const Options extends DecisionOptions>(options: Omit
|
|
|
161
48
|
declare function score<const Rubric extends DecisionRubric>(options: Omit<ScoreQuestion<Rubric>, "type">): ScoreQuestion<Rubric>;
|
|
162
49
|
declare function check(options: Omit<CheckQuestion, "type">): CheckQuestion;
|
|
163
50
|
|
|
164
|
-
export {
|
|
51
|
+
export { CheckQuestion, ChoiceQuestion, DecideBatchOptions, DecideOptions, DecisionBatchResult, DecisionCapabilityError, DecisionModel, DecisionOptions, DecisionProviderOutputError, DecisionQuestionType, DecisionQuestions, DecisionRawResponseOf, DecisionRefusalError, DecisionResult, DecisionRubric, MultiLabelQuestion, ScoreQuestion, check, choice, decide, decideBatch, multiLabel, score };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { b as RetrySetting } from './retry-CjvSlKGW.js';
|
|
2
2
|
import { B as ToolDefinition } from './types-DYqZKDA8.js';
|
|
3
3
|
import { V as VectorMetadata, E as EmbeddingModel, a as EmbeddedDocument } from './types-Cr4uiYo5.js';
|
|
4
|
-
import { A as AnyTool } from './tool-
|
|
5
|
-
import { V as VectorFilter, a as VectorSearchResult, b as VectorInspectRequest, c as VectorInspectPage } from './types-
|
|
4
|
+
import { A as AnyTool } from './tool-B6meo2AE.js';
|
|
5
|
+
import { V as VectorFilter, a as VectorSearchResult, b as VectorInspectRequest, c as VectorInspectPage } from './types-CmdZOpKi.js';
|
|
6
6
|
|
|
7
7
|
type ToolSearchDocument<Metadata extends VectorMetadata = VectorMetadata> = {
|
|
8
8
|
toolName: string;
|
package/dist/embeddings/index.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import "../chunk-ERN7P6Q4.js";
|
|
2
|
-
import {
|
|
3
|
-
angularDistance,
|
|
4
|
-
chebyshevDistance,
|
|
5
|
-
cosineSimilarity,
|
|
6
|
-
dotProduct,
|
|
7
|
-
euclideanDistance,
|
|
8
|
-
manhattanDistance
|
|
9
|
-
} from "../chunk-7F53DOML.js";
|
|
10
2
|
import {
|
|
11
3
|
embedDocuments,
|
|
12
4
|
embedSparseQuery,
|
|
@@ -15,6 +7,14 @@ import {
|
|
|
15
7
|
embedTexts
|
|
16
8
|
} from "../chunk-YCTXTOOQ.js";
|
|
17
9
|
import "../chunk-DU4WA6LQ.js";
|
|
10
|
+
import {
|
|
11
|
+
angularDistance,
|
|
12
|
+
chebyshevDistance,
|
|
13
|
+
cosineSimilarity,
|
|
14
|
+
dotProduct,
|
|
15
|
+
euclideanDistance,
|
|
16
|
+
manhattanDistance
|
|
17
|
+
} from "../chunk-7F53DOML.js";
|
|
18
18
|
import "../chunk-4FIVU53H.js";
|
|
19
19
|
import "../chunk-POXHJF3H.js";
|
|
20
20
|
import "../chunk-USRKPEQN.js";
|
|
@@ -9,23 +9,23 @@ import {
|
|
|
9
9
|
promptAlignment,
|
|
10
10
|
summarization,
|
|
11
11
|
turnRelevancy
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
} from "../chunk-PIBFPEK3.js";
|
|
13
|
+
import "../chunk-I5XFFO4W.js";
|
|
14
|
+
import "../chunk-3P3YVJ7V.js";
|
|
15
|
+
import "../chunk-T5FMJJKQ.js";
|
|
14
16
|
import "../chunk-ZPXOBQDS.js";
|
|
15
17
|
import "../chunk-EJR6VVB3.js";
|
|
16
18
|
import "../chunk-ZYXMWEL4.js";
|
|
17
|
-
import "../chunk-3P3YVJ7V.js";
|
|
18
|
-
import "../chunk-VCOGUS3Q.js";
|
|
19
19
|
import "../chunk-TP3MCUXS.js";
|
|
20
20
|
import "../chunk-6RQYWZI3.js";
|
|
21
21
|
import "../chunk-NF6WBPFG.js";
|
|
22
22
|
import "../chunk-4FIVU53H.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-GULOODEA.js";
|
|
24
24
|
import "../chunk-57AUTEQ6.js";
|
|
25
25
|
import "../chunk-6OO5C5GW.js";
|
|
26
26
|
import "../chunk-GSVOMQEE.js";
|
|
27
27
|
import "../chunk-4ONUNWGC.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-3VIMLOWJ.js";
|
|
29
29
|
import "../chunk-XQV3XNVT.js";
|
|
30
30
|
import "../chunk-HJ6KTQTZ.js";
|
|
31
31
|
import "../chunk-BONQTXRQ.js";
|
package/dist/evals/cli.js
CHANGED
|
@@ -7,21 +7,21 @@ import {
|
|
|
7
7
|
formatEvalResult,
|
|
8
8
|
printEvalResult,
|
|
9
9
|
runEvalCli
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-3XUUNNCS.js";
|
|
11
|
+
import "../chunk-KLDNHX4Z.js";
|
|
12
12
|
import "../chunk-PHLGGRHC.js";
|
|
13
|
-
import "../chunk-4OSA3MMA.js";
|
|
14
13
|
import "../chunk-EJR6VVB3.js";
|
|
14
|
+
import "../chunk-4OSA3MMA.js";
|
|
15
15
|
import "../chunk-ZYXMWEL4.js";
|
|
16
16
|
import "../chunk-TP3MCUXS.js";
|
|
17
17
|
import "../chunk-6RQYWZI3.js";
|
|
18
18
|
import "../chunk-NF6WBPFG.js";
|
|
19
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-GULOODEA.js";
|
|
20
20
|
import "../chunk-57AUTEQ6.js";
|
|
21
21
|
import "../chunk-6OO5C5GW.js";
|
|
22
22
|
import "../chunk-GSVOMQEE.js";
|
|
23
23
|
import "../chunk-4ONUNWGC.js";
|
|
24
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-3VIMLOWJ.js";
|
|
25
25
|
import "../chunk-XQV3XNVT.js";
|
|
26
26
|
import "../chunk-HJ6KTQTZ.js";
|
|
27
27
|
import "../chunk-BONQTXRQ.js";
|
package/dist/evals/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { U as Usage, J as JsonObject, d as CompletionModel, M as Message } from '../types-DYqZKDA8.js';
|
|
2
2
|
import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
|
|
3
|
-
import { $ as AgentRunPromptRef, g as AgentInteractionOutcome, n as AgentResponse, o as AgentRunOptions, l as AgentOutcome } from '../middleware-
|
|
3
|
+
import { $ as AgentRunPromptRef, g as AgentInteractionOutcome, n as AgentResponse, o as AgentRunOptions, l as AgentOutcome } from '../middleware-CDQQr_PM.js';
|
|
4
4
|
import { AgentInteractionRequest, AgentInteractionResponse } from '../agent/interactions/index.js';
|
|
5
5
|
import { E as EmbeddingModel } from '../types-Cr4uiYo5.js';
|
|
6
6
|
import '../model-call-options-CZkSw_xN.js';
|
|
@@ -8,7 +8,7 @@ import 'zod';
|
|
|
8
8
|
import '../types-CqiX-4_C.js';
|
|
9
9
|
import '../retry-CjvSlKGW.js';
|
|
10
10
|
import '../types-CWh9AQrq.js';
|
|
11
|
-
import '../tool-
|
|
11
|
+
import '../tool-B6meo2AE.js';
|
|
12
12
|
|
|
13
13
|
type EvalOutcomeOptions = {
|
|
14
14
|
comment?: string | undefined;
|