@anvia/core 1.11.1 → 1.12.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/README.md +36 -0
- package/dist/agent/agent.js +13 -13
- package/dist/agent/index.js +16 -16
- package/dist/agent/resolve-options.js +6 -6
- package/dist/agent/resolved-agent.js +14 -14
- package/dist/agent/team/agent-team.js +16 -16
- package/dist/agent/team/index.js +16 -16
- package/dist/agent/tool-catalog.js +6 -6
- package/dist/{chunk-PLJQ4274.js → chunk-4NGQXLJI.js} +3 -3
- package/dist/{chunk-WU4ODZKR.js → chunk-BFB7UCIR.js} +3 -3
- package/dist/{chunk-DRSKZVC6.js → chunk-BLCGXW53.js} +4 -4
- package/dist/{chunk-GNBPXJC6.js → chunk-EF26KTFU.js} +2 -2
- package/dist/{chunk-2K7NSWUC.js → chunk-ET5SCES6.js} +8 -8
- package/dist/{chunk-VUY2C2QD.js → chunk-GAF5XEDA.js} +2 -2
- package/dist/{chunk-7XDM7A3W.js → chunk-IAUCRAK7.js} +3 -3
- package/dist/chunk-IRXAEVEQ.js +105 -0
- package/dist/chunk-IRXAEVEQ.js.map +1 -0
- package/dist/{chunk-L2JI2GDH.js → chunk-IVXYLD2M.js} +2 -2
- package/dist/{chunk-GSMLYI4Z.js → chunk-KZYVFQYY.js} +3 -3
- package/dist/{chunk-GI6APIEU.js → chunk-R4AJ2EE3.js} +4 -4
- package/dist/{chunk-Y5FHUUNC.js → chunk-TYOIMXFR.js} +4 -4
- package/dist/{chunk-TXWNIEZU.js → chunk-USPZU7EM.js} +4 -4
- package/dist/{chunk-MNWULFRX.js → chunk-W2UT2YCM.js} +2 -2
- package/dist/{chunk-4IOC4SP6.js → chunk-X4XULHDO.js} +7 -7
- package/dist/decision/index.js +5 -5
- package/dist/embeddings/index.js +8 -8
- package/dist/evals/advanced-metrics.js +3 -3
- package/dist/evals/cli.js +4 -4
- package/dist/evals/index.js +34 -34
- package/dist/evals/metrics.js +4 -4
- package/dist/evals/runner.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +38 -34
- package/dist/internal/agent-runtime/agent-run.js +10 -10
- package/dist/internal/agent-runtime/retrieval.js +4 -4
- package/dist/internal/agent-runtime/tool-execution.js +9 -9
- package/dist/internal/agent.js +14 -14
- package/dist/internal/team-runtime/run.js +15 -15
- package/dist/skills/index.js +9 -9
- package/dist/skills/load.js +8 -8
- package/dist/skills/tools.js +8 -8
- package/dist/think-tool-CTuagAtn.d.ts +44 -0
- package/dist/tool/dynamic-tools.js +5 -5
- package/dist/tool/index.d.ts +1 -1
- package/dist/tool/index.js +13 -9
- package/dist/tool/question-tool.js +5 -1
- package/dist/transcription/index.js +1 -1
- package/dist/vector-store/index.js +7 -7
- package/dist/vector-store/ingest.js +2 -2
- package/dist/vector-store/retrieve.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-MNBKSRS5.js +0 -47
- package/dist/chunk-MNBKSRS5.js.map +0 -1
- package/dist/think-tool-DJbtUDZm.d.ts +0 -40
- /package/dist/{chunk-PLJQ4274.js.map → chunk-4NGQXLJI.js.map} +0 -0
- /package/dist/{chunk-WU4ODZKR.js.map → chunk-BFB7UCIR.js.map} +0 -0
- /package/dist/{chunk-DRSKZVC6.js.map → chunk-BLCGXW53.js.map} +0 -0
- /package/dist/{chunk-GNBPXJC6.js.map → chunk-EF26KTFU.js.map} +0 -0
- /package/dist/{chunk-2K7NSWUC.js.map → chunk-ET5SCES6.js.map} +0 -0
- /package/dist/{chunk-VUY2C2QD.js.map → chunk-GAF5XEDA.js.map} +0 -0
- /package/dist/{chunk-7XDM7A3W.js.map → chunk-IAUCRAK7.js.map} +0 -0
- /package/dist/{chunk-L2JI2GDH.js.map → chunk-IVXYLD2M.js.map} +0 -0
- /package/dist/{chunk-GSMLYI4Z.js.map → chunk-KZYVFQYY.js.map} +0 -0
- /package/dist/{chunk-GI6APIEU.js.map → chunk-R4AJ2EE3.js.map} +0 -0
- /package/dist/{chunk-Y5FHUUNC.js.map → chunk-TYOIMXFR.js.map} +0 -0
- /package/dist/{chunk-TXWNIEZU.js.map → chunk-USPZU7EM.js.map} +0 -0
- /package/dist/{chunk-MNWULFRX.js.map → chunk-W2UT2YCM.js.map} +0 -0
- /package/dist/{chunk-4IOC4SP6.js.map → chunk-X4XULHDO.js.map} +0 -0
package/dist/tool/index.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import "../chunk-JMJFK3A4.js";
|
|
2
2
|
import {
|
|
3
|
+
createMiddleware
|
|
4
|
+
} from "../chunk-4AW2633B.js";
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_QUESTION_TOOL_DESCRIPTION,
|
|
7
|
+
DEFAULT_QUESTION_TOOL_NAME,
|
|
3
8
|
createQuestionTool,
|
|
4
9
|
isQuestionTool
|
|
5
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-IRXAEVEQ.js";
|
|
6
11
|
import {
|
|
7
12
|
createThinkTool
|
|
8
13
|
} from "../chunk-CASF2TDK.js";
|
|
9
|
-
import {
|
|
10
|
-
createMiddleware
|
|
11
|
-
} from "../chunk-4AW2633B.js";
|
|
12
14
|
import {
|
|
13
15
|
createToolIndex,
|
|
14
16
|
embedTools,
|
|
15
17
|
isToolIndex
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-GAF5XEDA.js";
|
|
19
|
+
import "../chunk-TYOIMXFR.js";
|
|
20
|
+
import "../chunk-5WLIHNNJ.js";
|
|
18
21
|
import "../chunk-3FIX7GLM.js";
|
|
19
22
|
import "../chunk-ESOFEAYK.js";
|
|
20
23
|
import "../chunk-CB2L2NIQ.js";
|
|
21
|
-
import "../chunk-5WLIHNNJ.js";
|
|
22
24
|
import "../chunk-ERN7P6Q4.js";
|
|
25
|
+
import "../chunk-7F53DOML.js";
|
|
23
26
|
import "../chunk-YCTXTOOQ.js";
|
|
24
27
|
import "../chunk-DU4WA6LQ.js";
|
|
28
|
+
import "../chunk-4FIVU53H.js";
|
|
25
29
|
import "../chunk-KO5NMTAM.js";
|
|
26
30
|
import "../chunk-TFIOU6UR.js";
|
|
27
31
|
import "../chunk-GPVXCY5I.js";
|
|
28
|
-
import "../chunk-7F53DOML.js";
|
|
29
|
-
import "../chunk-4FIVU53H.js";
|
|
30
32
|
import "../chunk-5V533R7F.js";
|
|
31
33
|
import {
|
|
32
34
|
createTool
|
|
@@ -51,6 +53,8 @@ import "../chunk-SQAAVYJG.js";
|
|
|
51
53
|
import "../chunk-POXHJF3H.js";
|
|
52
54
|
import "../chunk-USRKPEQN.js";
|
|
53
55
|
export {
|
|
56
|
+
DEFAULT_QUESTION_TOOL_DESCRIPTION,
|
|
57
|
+
DEFAULT_QUESTION_TOOL_NAME,
|
|
54
58
|
ToolCallError,
|
|
55
59
|
ToolJsonError,
|
|
56
60
|
ToolNotFoundError,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DEFAULT_QUESTION_TOOL_DESCRIPTION,
|
|
3
|
+
DEFAULT_QUESTION_TOOL_NAME,
|
|
2
4
|
createQuestionTool,
|
|
3
5
|
isQuestionTool
|
|
4
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-IRXAEVEQ.js";
|
|
5
7
|
import "../chunk-MEFGXAKJ.js";
|
|
6
8
|
import "../chunk-27MBNR47.js";
|
|
7
9
|
import "../chunk-YZVFIW5D.js";
|
|
@@ -11,6 +13,8 @@ import "../chunk-BONQTXRQ.js";
|
|
|
11
13
|
import "../chunk-4C7AXYOM.js";
|
|
12
14
|
import "../chunk-SQAAVYJG.js";
|
|
13
15
|
export {
|
|
16
|
+
DEFAULT_QUESTION_TOOL_DESCRIPTION,
|
|
17
|
+
DEFAULT_QUESTION_TOOL_NAME,
|
|
14
18
|
createQuestionTool,
|
|
15
19
|
isQuestionTool
|
|
16
20
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InMemoryVectorStore,
|
|
3
3
|
createVectorSearchTool
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-TYOIMXFR.js";
|
|
5
|
+
import {
|
|
6
|
+
matchesVectorFilter,
|
|
7
|
+
vectorFilter
|
|
8
|
+
} from "../chunk-5WLIHNNJ.js";
|
|
5
9
|
import {
|
|
6
10
|
ingestVectorDocuments,
|
|
7
11
|
ingestVectorText
|
|
@@ -10,18 +14,14 @@ import "../chunk-ESOFEAYK.js";
|
|
|
10
14
|
import {
|
|
11
15
|
retrieveDocuments
|
|
12
16
|
} from "../chunk-CB2L2NIQ.js";
|
|
13
|
-
import {
|
|
14
|
-
matchesVectorFilter,
|
|
15
|
-
vectorFilter
|
|
16
|
-
} from "../chunk-5WLIHNNJ.js";
|
|
17
17
|
import "../chunk-ERN7P6Q4.js";
|
|
18
|
+
import "../chunk-7F53DOML.js";
|
|
18
19
|
import "../chunk-YCTXTOOQ.js";
|
|
19
20
|
import "../chunk-DU4WA6LQ.js";
|
|
21
|
+
import "../chunk-4FIVU53H.js";
|
|
20
22
|
import "../chunk-KO5NMTAM.js";
|
|
21
23
|
import "../chunk-TFIOU6UR.js";
|
|
22
24
|
import "../chunk-GPVXCY5I.js";
|
|
23
|
-
import "../chunk-7F53DOML.js";
|
|
24
|
-
import "../chunk-4FIVU53H.js";
|
|
25
25
|
import "../chunk-5V533R7F.js";
|
|
26
26
|
import "../chunk-MEFGXAKJ.js";
|
|
27
27
|
import "../chunk-27MBNR47.js";
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
ingestVectorText
|
|
4
4
|
} from "../chunk-3FIX7GLM.js";
|
|
5
5
|
import "../chunk-ERN7P6Q4.js";
|
|
6
|
+
import "../chunk-7F53DOML.js";
|
|
6
7
|
import "../chunk-YCTXTOOQ.js";
|
|
7
8
|
import "../chunk-DU4WA6LQ.js";
|
|
9
|
+
import "../chunk-4FIVU53H.js";
|
|
8
10
|
import "../chunk-KO5NMTAM.js";
|
|
9
11
|
import "../chunk-TFIOU6UR.js";
|
|
10
12
|
import "../chunk-GPVXCY5I.js";
|
|
11
|
-
import "../chunk-7F53DOML.js";
|
|
12
|
-
import "../chunk-4FIVU53H.js";
|
|
13
13
|
import "../chunk-POXHJF3H.js";
|
|
14
14
|
import "../chunk-USRKPEQN.js";
|
|
15
15
|
export {
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
retrieveDocuments
|
|
3
3
|
} from "../chunk-CB2L2NIQ.js";
|
|
4
4
|
import "../chunk-ERN7P6Q4.js";
|
|
5
|
+
import "../chunk-7F53DOML.js";
|
|
5
6
|
import "../chunk-YCTXTOOQ.js";
|
|
6
7
|
import "../chunk-DU4WA6LQ.js";
|
|
7
|
-
import "../chunk-7F53DOML.js";
|
|
8
8
|
import "../chunk-4FIVU53H.js";
|
|
9
9
|
import "../chunk-5V533R7F.js";
|
|
10
10
|
import "../chunk-POXHJF3H.js";
|
package/package.json
CHANGED
package/dist/chunk-MNBKSRS5.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTool
|
|
3
|
-
} from "./chunk-MEFGXAKJ.js";
|
|
4
|
-
|
|
5
|
-
// src/tool/question-tool.ts
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
var questionToolMarker = /* @__PURE__ */ Symbol("anvia.question-tool");
|
|
8
|
-
function createQuestionTool(options) {
|
|
9
|
-
const tool = createTool({
|
|
10
|
-
name: options.name,
|
|
11
|
-
description: options.description,
|
|
12
|
-
inputSchema: z.object({
|
|
13
|
-
questions: z.array(
|
|
14
|
-
z.object({
|
|
15
|
-
id: z.string().trim().min(1),
|
|
16
|
-
text: z.string().trim().min(1),
|
|
17
|
-
choices: z.array(
|
|
18
|
-
z.object({
|
|
19
|
-
label: z.string().trim().min(1),
|
|
20
|
-
value: z.string().trim().min(1)
|
|
21
|
-
}).strict()
|
|
22
|
-
).min(1).optional(),
|
|
23
|
-
allowCustom: z.boolean().optional()
|
|
24
|
-
}).strict()
|
|
25
|
-
).min(1)
|
|
26
|
-
}).strict(),
|
|
27
|
-
execute() {
|
|
28
|
-
throw new Error("Question tools can only be resolved through an Agent interaction.");
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(tool, questionToolMarker, {
|
|
32
|
-
configurable: false,
|
|
33
|
-
enumerable: false,
|
|
34
|
-
value: true,
|
|
35
|
-
writable: false
|
|
36
|
-
});
|
|
37
|
-
return tool;
|
|
38
|
-
}
|
|
39
|
-
function isQuestionTool(tool) {
|
|
40
|
-
return typeof tool === "object" && tool !== null && questionToolMarker in tool;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export {
|
|
44
|
-
createQuestionTool,
|
|
45
|
-
isQuestionTool
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=chunk-MNBKSRS5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tool/question-tool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { AgentQuestionAnswer, AgentQuestionPrompt } from \"../agent/interactions\";\nimport { createTool } from \"./create-tool\";\nimport type { Tool } from \"./tool\";\n\nconst questionToolMarker = Symbol(\"anvia.question-tool\");\n\nexport type QuestionToolInput = {\n questions: readonly AgentQuestionPrompt[];\n};\n\nexport type QuestionToolOutput = {\n answers: readonly AgentQuestionAnswer[];\n};\n\nexport type CreateQuestionToolOptions = {\n name: string;\n description: string;\n};\n\ntype MarkedQuestionTool = Tool<QuestionToolInput, QuestionToolOutput> & {\n readonly [questionToolMarker]: true;\n};\n\nexport function createQuestionTool(\n options: CreateQuestionToolOptions,\n): Tool<QuestionToolInput, QuestionToolOutput> {\n const tool = createTool({\n name: options.name,\n description: options.description,\n inputSchema: z\n .object({\n questions: z\n .array(\n z\n .object({\n id: z.string().trim().min(1),\n text: z.string().trim().min(1),\n choices: z\n .array(\n z\n .object({\n label: z.string().trim().min(1),\n value: z.string().trim().min(1),\n })\n .strict(),\n )\n .min(1)\n .optional(),\n allowCustom: z.boolean().optional(),\n })\n .strict(),\n )\n .min(1),\n })\n .strict(),\n execute(): never {\n throw new Error(\"Question tools can only be resolved through an Agent interaction.\");\n },\n }) as unknown as MarkedQuestionTool;\n Object.defineProperty(tool, questionToolMarker, {\n configurable: false,\n enumerable: false,\n value: true,\n writable: false,\n });\n return tool;\n}\n\nexport function isQuestionTool(tool: unknown): tool is Tool<QuestionToolInput, QuestionToolOutput> {\n return typeof tool === \"object\" && tool !== null && questionToolMarker in tool;\n}\n"],"mappings":";;;;;AAAA,SAAS,SAAS;AAKlB,IAAM,qBAAqB,uBAAO,qBAAqB;AAmBhD,SAAS,mBACd,SAC6C;AAC7C,QAAM,OAAO,WAAW;AAAA,IACtB,MAAM,QAAQ;AAAA,IACd,aAAa,QAAQ;AAAA,IACrB,aAAa,EACV,OAAO;AAAA,MACN,WAAW,EACR;AAAA,QACC,EACG,OAAO;AAAA,UACN,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;AAAA,UAC3B,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;AAAA,UAC7B,SAAS,EACN;AAAA,YACC,EACG,OAAO;AAAA,cACN,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;AAAA,cAC9B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;AAAA,YAChC,CAAC,EACA,OAAO;AAAA,UACZ,EACC,IAAI,CAAC,EACL,SAAS;AAAA,UACZ,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,QACpC,CAAC,EACA,OAAO;AAAA,MACZ,EACC,IAAI,CAAC;AAAA,IACV,CAAC,EACA,OAAO;AAAA,IACV,UAAiB;AACf,YAAM,IAAI,MAAM,mEAAmE;AAAA,IACrF;AAAA,EACF,CAAC;AACD,SAAO,eAAe,MAAM,oBAAoB;AAAA,IAC9C,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,UAAU;AAAA,EACZ,CAAC;AACD,SAAO;AACT;AAEO,SAAS,eAAe,MAAoE;AACjG,SAAO,OAAO,SAAS,YAAY,SAAS,QAAQ,sBAAsB;AAC5E;","names":[]}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
|
|
3
|
-
import { e as ToolRequiresApproval, c as ToolCallContext, T as Tool } from './tool-W1cAPuRF.js';
|
|
4
|
-
import { AgentQuestionPrompt, AgentQuestionAnswer } from './agent/interactions/index.js';
|
|
5
|
-
|
|
6
|
-
type CreateToolOptions<InputSchema extends ZodSchema, OutputSchema extends ZodSchema | undefined = undefined, Output = unknown> = {
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
inputSchema: InputSchema;
|
|
10
|
-
outputSchema?: OutputSchema;
|
|
11
|
-
requiresApproval?: ToolRequiresApproval<z.output<InputSchema>>;
|
|
12
|
-
execute(args: z.output<InputSchema>, context: ToolCallContext): OutputSchema extends ZodSchema ? z.input<OutputSchema> | Promise<z.input<OutputSchema>> : Output | Promise<Output>;
|
|
13
|
-
};
|
|
14
|
-
declare function createTool<InputSchema extends ZodSchema, Output = unknown>(options: CreateToolOptions<InputSchema, undefined, Output> & {
|
|
15
|
-
outputSchema?: undefined;
|
|
16
|
-
}): Tool<z.output<InputSchema>, Output>;
|
|
17
|
-
declare function createTool<InputSchema extends ZodSchema, OutputSchema extends ZodSchema>(options: CreateToolOptions<InputSchema, OutputSchema>): Tool<z.output<InputSchema>, z.output<OutputSchema>>;
|
|
18
|
-
|
|
19
|
-
type QuestionToolInput = {
|
|
20
|
-
questions: readonly AgentQuestionPrompt[];
|
|
21
|
-
};
|
|
22
|
-
type QuestionToolOutput = {
|
|
23
|
-
answers: readonly AgentQuestionAnswer[];
|
|
24
|
-
};
|
|
25
|
-
type CreateQuestionToolOptions = {
|
|
26
|
-
name: string;
|
|
27
|
-
description: string;
|
|
28
|
-
};
|
|
29
|
-
declare function createQuestionTool(options: CreateQuestionToolOptions): Tool<QuestionToolInput, QuestionToolOutput>;
|
|
30
|
-
declare function isQuestionTool(tool: unknown): tool is Tool<QuestionToolInput, QuestionToolOutput>;
|
|
31
|
-
|
|
32
|
-
type CreateThinkToolOptions = {
|
|
33
|
-
name?: string;
|
|
34
|
-
description?: string;
|
|
35
|
-
};
|
|
36
|
-
declare function createThinkTool(options?: CreateThinkToolOptions): Tool<{
|
|
37
|
-
thought: string;
|
|
38
|
-
}, string>;
|
|
39
|
-
|
|
40
|
-
export { type CreateToolOptions as C, type QuestionToolInput as Q, createThinkTool as a, createTool as b, createQuestionTool as c, type CreateQuestionToolOptions as d, type CreateThinkToolOptions as e, type QuestionToolOutput as f, isQuestionTool as i };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|