@equationalapplications/core-llm-tools 4.16.0 → 4.17.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/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -53,4 +53,7 @@ declare const getCurrentTimeManifest: AgentToolManifest;
|
|
|
53
53
|
declare const escalateToCloudManifest: AgentToolManifest;
|
|
54
54
|
declare const googleSearchManifest: BuiltInToolManifest;
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
declare const wikiGetOntologyManifest: AgentToolManifest;
|
|
57
|
+
declare const wikiTraverseGraphManifest: AgentToolManifest;
|
|
58
|
+
|
|
59
|
+
export { type AgentScope, type AgentToolManifest, type AgentToolSchema, type AnyAgentToolManifest, type BuiltInToolManifest, type BuiltInToolName, type FunctionToolManifest, type GeminiToolEntry, buildAuthorizedSchemaArray, buildAuthorizedToolsArray, escalateToCloudManifest, getCurrentTimeManifest, googleSearchManifest, wikiGetOntologyManifest, wikiTraverseGraphManifest };
|
package/dist/index.d.ts
CHANGED
|
@@ -53,4 +53,7 @@ declare const getCurrentTimeManifest: AgentToolManifest;
|
|
|
53
53
|
declare const escalateToCloudManifest: AgentToolManifest;
|
|
54
54
|
declare const googleSearchManifest: BuiltInToolManifest;
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
declare const wikiGetOntologyManifest: AgentToolManifest;
|
|
57
|
+
declare const wikiTraverseGraphManifest: AgentToolManifest;
|
|
58
|
+
|
|
59
|
+
export { type AgentScope, type AgentToolManifest, type AgentToolSchema, type AnyAgentToolManifest, type BuiltInToolManifest, type BuiltInToolName, type FunctionToolManifest, type GeminiToolEntry, buildAuthorizedSchemaArray, buildAuthorizedToolsArray, escalateToCloudManifest, getCurrentTimeManifest, googleSearchManifest, wikiGetOntologyManifest, wikiTraverseGraphManifest };
|
package/dist/index.js
CHANGED
|
@@ -51,10 +51,53 @@ var googleSearchManifest = {
|
|
|
51
51
|
builtIn: "google_search"
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
// src/manifests/graph.ts
|
|
55
|
+
var wikiGetOntologyManifest = {
|
|
56
|
+
name: "wiki_get_ontology",
|
|
57
|
+
scope: "memory:read",
|
|
58
|
+
schema: {
|
|
59
|
+
name: "wiki_get_ontology",
|
|
60
|
+
description: "Retrieve the current ontology manifest (allowed node types and edge types) for the user's memory. Use this to understand the structure of the knowledge graph and what relationships exist.",
|
|
61
|
+
parameters: {
|
|
62
|
+
type: "object",
|
|
63
|
+
properties: {
|
|
64
|
+
entityId: { type: "string", description: "The namespace/entity ID to inspect." }
|
|
65
|
+
},
|
|
66
|
+
required: ["entityId"]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var wikiTraverseGraphManifest = {
|
|
71
|
+
name: "wiki_traverse_graph",
|
|
72
|
+
scope: "memory:read",
|
|
73
|
+
schema: {
|
|
74
|
+
name: "wiki_traverse_graph",
|
|
75
|
+
description: "Traverse the knowledge graph starting from a specific fact ID to discover connected concepts and relationships. Returns a formatted neighborhood subgraph.",
|
|
76
|
+
parameters: {
|
|
77
|
+
type: "object",
|
|
78
|
+
properties: {
|
|
79
|
+
entityId: { type: "string", description: "The namespace/entity ID to traverse." },
|
|
80
|
+
sourceId: { type: "string", description: "The exact ID of the starting fact node (obtained from a previous wiki_read call)." },
|
|
81
|
+
maxDepth: {
|
|
82
|
+
type: "integer",
|
|
83
|
+
minimum: 1,
|
|
84
|
+
maximum: 3,
|
|
85
|
+
description: "How many relationship hops to traverse. Maximum allowed is 3."
|
|
86
|
+
},
|
|
87
|
+
direction: { type: "string", enum: ["inbound", "outbound", "both"], description: "The direction of relationships to follow. Default 'both'." },
|
|
88
|
+
edgeTypes: { type: "array", items: { type: "string" }, description: 'Optional filter. If provided, traversal only follows these edge types (e.g. ["reports_to", "depends_on"]).' }
|
|
89
|
+
},
|
|
90
|
+
required: ["entityId", "sourceId"]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
54
95
|
exports.buildAuthorizedSchemaArray = buildAuthorizedSchemaArray;
|
|
55
96
|
exports.buildAuthorizedToolsArray = buildAuthorizedToolsArray;
|
|
56
97
|
exports.escalateToCloudManifest = escalateToCloudManifest;
|
|
57
98
|
exports.getCurrentTimeManifest = getCurrentTimeManifest;
|
|
58
99
|
exports.googleSearchManifest = googleSearchManifest;
|
|
100
|
+
exports.wikiGetOntologyManifest = wikiGetOntologyManifest;
|
|
101
|
+
exports.wikiTraverseGraphManifest = wikiTraverseGraphManifest;
|
|
59
102
|
//# sourceMappingURL=index.js.map
|
|
60
103
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/injector.ts","../src/manifests/core.ts"],"names":[],"mappings":";;;AAaO,SAAS,0BAAA,CACd,oBACA,iBAAA,EACmB;AACnB,EAAA,OAAO,kBAAA,CACJ,MAAA;AAAA,IACC,CAAC,aACC,QAAA,CAAS,KAAA,KAAU,UAAU,iBAAA,CAAkB,QAAA,CAAS,SAAS,KAAK;AAAA,GAC1E,CACC,MAAA;AAAA,IACC,CAAC,aAA+C,QAAA,IAAY;AAAA,GAC9D,CACC,GAAA,CAAI,CAAC,QAAA,KAAa,SAAS,MAAM,CAAA;AACtC;AAYO,SAAS,yBAAA,CACd,oBACA,iBAAA,EACmB;AACnB,EAAA,MAAM,aAAa,kBAAA,CAAmB,MAAA;AAAA,IACpC,CAAC,aACC,QAAA,CAAS,KAAA,KAAU,UAAU,iBAAA,CAAkB,QAAA,CAAS,SAAS,KAAK;AAAA,GAC1E;AAEA,EAAA,MAAM,UAA6B,EAAC;AAEpC,EAAA,MAAM,YAAY,UAAA,CACf,MAAA;AAAA,IACC,CAAC,QAAA,KAA+C,QAAA,CAAS,IAAA,KAAS;AAAA,GACpE,CACC,GAAA,CAAI,CAAC,QAAA,KAAa,SAAS,MAAM,CAAA;AACpC,EAAA,IAAI,SAAA,CAAU,SAAS,CAAA,EAAG,OAAA,CAAQ,KAAK,EAAE,oBAAA,EAAsB,WAAW,CAAA;AAE1E,EAAA,KAAA,MAAW,YAAY,UAAA,EAAY;AACjC,IAAA,IAAI,QAAA,CAAS,SAAS,UAAA,EAAY;AAChC,MAAA,OAAA,CAAQ,IAAA,CAAK,EAAE,CAAC,QAAA,CAAS,OAAO,GAAG,IAAuB,CAAA;AAAA,IAC5D;AAAA,EACF;AAEA,EAAA,OAAO,OAAA;AACT;;;AC7DO,IAAM,sBAAA,GAA4C;AAAA,EACvD,IAAA,EAAM,kBAAA;AAAA,EACN,KAAA,EAAO,MAAA;AAAA,EACP,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,kBAAA;AAAA,IACN,WAAA,EACE,mIAAA;AAAA,IACF,YAAY,EAAE,IAAA,EAAM,QAAA,EAAU,UAAA,EAAY,EAAC;AAAE;AAEjD;AAEO,IAAM,uBAAA,GAA6C;AAAA,EACxD,IAAA,EAAM,yBAAA;AAAA,EACN,KAAA,EAAO,MAAA;AAAA,EACP,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,yBAAA;AAAA,IACN,WAAA,EACE,qJAAA;AAAA,IACF,YAAY,EAAE,IAAA,EAAM,QAAA,EAAU,UAAA,EAAY,EAAC;AAAE;AAEjD;AAEO,IAAM,oBAAA,GAA4C;AAAA,EACvD,IAAA,EAAM,eAAA;AAAA,EACN,KAAA,EAAO,MAAA;AAAA,EACP,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS;AACX","file":"index.js","sourcesContent":["import type {\n AgentToolManifest,\n AgentToolSchema,\n AnyAgentToolManifest,\n BuiltInToolName,\n FunctionToolManifest,\n} from './types';\n\n/**\n * @deprecated Use buildAuthorizedToolsArray instead — it returns the full Gemini\n * tools[] array, including built-in tools like google_search. This function only\n * ever returns function-declaration schemas; built-in manifests are ignored.\n */\nexport function buildAuthorizedSchemaArray(\n availableManifests: AgentToolManifest[],\n userGrantedScopes: string[]\n): AgentToolSchema[] {\n return availableManifests\n .filter(\n (manifest) =>\n manifest.scope === 'core' || userGrantedScopes.includes(manifest.scope)\n )\n .filter(\n (manifest): manifest is FunctionToolManifest => 'schema' in manifest\n )\n .map((manifest) => manifest.schema);\n}\n\n/** One entry of a Gemini `tools[]` array: a function-declarations group, or a built-in tool. */\nexport type GeminiToolEntry =\n | { functionDeclarations: AgentToolSchema[] }\n | { [K in BuiltInToolName]: Record<string, never> };\n\n/**\n * Filters manifests by granted scope (core-scoped manifests always pass) and\n * returns the full Gemini tools[] array: at most one functionDeclarations\n * group, plus one entry per authorized built-in tool.\n */\nexport function buildAuthorizedToolsArray(\n availableManifests: AnyAgentToolManifest[],\n userGrantedScopes: string[]\n): GeminiToolEntry[] {\n const authorized = availableManifests.filter(\n (manifest) =>\n manifest.scope === 'core' || userGrantedScopes.includes(manifest.scope)\n );\n\n const entries: GeminiToolEntry[] = [];\n\n const fnSchemas = authorized\n .filter(\n (manifest): manifest is FunctionToolManifest => manifest.kind !== 'built_in'\n )\n .map((manifest) => manifest.schema);\n if (fnSchemas.length > 0) entries.push({ functionDeclarations: fnSchemas });\n\n for (const manifest of authorized) {\n if (manifest.kind === 'built_in') {\n entries.push({ [manifest.builtIn]: {} } as GeminiToolEntry);\n }\n }\n\n return entries;\n}\n","import type { AgentToolManifest, BuiltInToolManifest } from '../types';\n\nexport const getCurrentTimeManifest: AgentToolManifest = {\n name: 'get_current_time',\n scope: 'core',\n schema: {\n name: 'get_current_time',\n description:\n 'Get the exact current date and time. Always call this tool first if resolving relative temporal words like \"today\" or \"tomorrow\".',\n parameters: { type: 'object', properties: {} },\n },\n};\n\nexport const escalateToCloudManifest: AgentToolManifest = {\n name: 'escalate_to_cloud_agent',\n scope: 'core',\n schema: {\n name: 'escalate_to_cloud_agent',\n description:\n 'Use this tool when the user asks to schedule a reminder, perform deep memory searches, or execute a complex workflow that requires cloud resources.',\n parameters: { type: 'object', properties: {} },\n },\n};\n\nexport const googleSearchManifest: BuiltInToolManifest = {\n name: 'google_search',\n scope: 'core',\n kind: 'built_in',\n builtIn: 'google_search',\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/injector.ts","../src/manifests/core.ts","../src/manifests/graph.ts"],"names":[],"mappings":";;;AAaO,SAAS,0BAAA,CACd,oBACA,iBAAA,EACmB;AACnB,EAAA,OAAO,kBAAA,CACJ,MAAA;AAAA,IACC,CAAC,aACC,QAAA,CAAS,KAAA,KAAU,UAAU,iBAAA,CAAkB,QAAA,CAAS,SAAS,KAAK;AAAA,GAC1E,CACC,MAAA;AAAA,IACC,CAAC,aAA+C,QAAA,IAAY;AAAA,GAC9D,CACC,GAAA,CAAI,CAAC,QAAA,KAAa,SAAS,MAAM,CAAA;AACtC;AAYO,SAAS,yBAAA,CACd,oBACA,iBAAA,EACmB;AACnB,EAAA,MAAM,aAAa,kBAAA,CAAmB,MAAA;AAAA,IACpC,CAAC,aACC,QAAA,CAAS,KAAA,KAAU,UAAU,iBAAA,CAAkB,QAAA,CAAS,SAAS,KAAK;AAAA,GAC1E;AAEA,EAAA,MAAM,UAA6B,EAAC;AAEpC,EAAA,MAAM,YAAY,UAAA,CACf,MAAA;AAAA,IACC,CAAC,QAAA,KAA+C,QAAA,CAAS,IAAA,KAAS;AAAA,GACpE,CACC,GAAA,CAAI,CAAC,QAAA,KAAa,SAAS,MAAM,CAAA;AACpC,EAAA,IAAI,SAAA,CAAU,SAAS,CAAA,EAAG,OAAA,CAAQ,KAAK,EAAE,oBAAA,EAAsB,WAAW,CAAA;AAE1E,EAAA,KAAA,MAAW,YAAY,UAAA,EAAY;AACjC,IAAA,IAAI,QAAA,CAAS,SAAS,UAAA,EAAY;AAChC,MAAA,OAAA,CAAQ,IAAA,CAAK,EAAE,CAAC,QAAA,CAAS,OAAO,GAAG,IAA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,IACN,WAAA,EACE,4JAAA;AAAA,IACF,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,QAAA;AAAA,MACN,UAAA,EAAY;AAAA,QACV,QAAA,EAAU,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,sCAAA,EAAuC;AAAA,QAChF,QAAA,EAAU,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,mFAAA,EAAoF;AAAA,QAC7H,QAAA,EAAU;AAAA,UACR,IAAA,EAAM,SAAA;AAAA,UACN,OAAA,EAAS,CAAA;AAAA,UACT,OAAA,EAAS,CAAA;AAAA,UACT,WAAA,EAAa;AAAA,SACf;AAAA,QACA,SAAA,EAAW,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,CAAC,SAAA,EAAW,UAAA,EAAY,MAAM,CAAA,EAAG,WAAA,EAAa,2DAAA,EAA4D;AAAA,QAC7I,SAAA,EAAW,EAAE,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,EAAE,IAAA,EAAM,QAAA,EAAS,EAAG,WAAA,EAAa,4GAAA;AAA6G,OACnL;AAAA,MACA,QAAA,EAAU,CAAC,UAAA,EAAY,UAAU;AAAA;AACnC;AAEJ","file":"index.js","sourcesContent":["import type {\n AgentToolManifest,\n AgentToolSchema,\n AnyAgentToolManifest,\n BuiltInToolName,\n FunctionToolManifest,\n} from './types';\n\n/**\n * @deprecated Use buildAuthorizedToolsArray instead — it returns the full Gemini\n * tools[] array, including built-in tools like google_search. This function only\n * ever returns function-declaration schemas; built-in manifests are ignored.\n */\nexport function buildAuthorizedSchemaArray(\n availableManifests: AgentToolManifest[],\n userGrantedScopes: string[]\n): AgentToolSchema[] {\n return availableManifests\n .filter(\n (manifest) =>\n manifest.scope === 'core' || userGrantedScopes.includes(manifest.scope)\n )\n .filter(\n (manifest): manifest is FunctionToolManifest => 'schema' in manifest\n )\n .map((manifest) => manifest.schema);\n}\n\n/** One entry of a Gemini `tools[]` array: a function-declarations group, or a built-in tool. */\nexport type GeminiToolEntry =\n | { functionDeclarations: AgentToolSchema[] }\n | { [K in BuiltInToolName]: Record<string, never> };\n\n/**\n * Filters manifests by granted scope (core-scoped manifests always pass) and\n * returns the full Gemini tools[] array: at most one functionDeclarations\n * group, plus one entry per authorized built-in tool.\n */\nexport function buildAuthorizedToolsArray(\n availableManifests: AnyAgentToolManifest[],\n userGrantedScopes: string[]\n): GeminiToolEntry[] {\n const authorized = availableManifests.filter(\n (manifest) =>\n manifest.scope === 'core' || userGrantedScopes.includes(manifest.scope)\n );\n\n const entries: GeminiToolEntry[] = [];\n\n const fnSchemas = authorized\n .filter(\n (manifest): manifest is FunctionToolManifest => manifest.kind !== 'built_in'\n )\n .map((manifest) => manifest.schema);\n if (fnSchemas.length > 0) entries.push({ functionDeclarations: fnSchemas });\n\n for (const manifest of authorized) {\n if (manifest.kind === 'built_in') {\n entries.push({ [manifest.builtIn]: {} } as GeminiToolEntry);\n }\n }\n\n return entries;\n}\n","import type { AgentToolManifest, BuiltInToolManifest } from '../types';\n\nexport const getCurrentTimeManifest: AgentToolManifest = {\n name: 'get_current_time',\n scope: 'core',\n schema: {\n name: 'get_current_time',\n description:\n 'Get the exact current date and time. Always call this tool first if resolving relative temporal words like \"today\" or \"tomorrow\".',\n parameters: { type: 'object', properties: {} },\n },\n};\n\nexport const escalateToCloudManifest: AgentToolManifest = {\n name: 'escalate_to_cloud_agent',\n scope: 'core',\n schema: {\n name: 'escalate_to_cloud_agent',\n description:\n 'Use this tool when the user asks to schedule a reminder, perform deep memory searches, or execute a complex workflow that requires cloud resources.',\n parameters: { type: 'object', properties: {} },\n },\n};\n\nexport const googleSearchManifest: BuiltInToolManifest = {\n name: 'google_search',\n scope: 'core',\n kind: 'built_in',\n builtIn: 'google_search',\n};\n","import type { AgentToolManifest } from '../types';\n\nexport const wikiGetOntologyManifest: AgentToolManifest = {\n name: 'wiki_get_ontology',\n scope: 'memory:read',\n schema: {\n name: 'wiki_get_ontology',\n description:\n \"Retrieve the current ontology manifest (allowed node types and edge types) for the user's memory. Use this to understand the structure of the knowledge graph and what relationships exist.\",\n parameters: {\n type: 'object',\n properties: {\n entityId: { type: 'string', description: 'The namespace/entity ID to inspect.' },\n },\n required: ['entityId'],\n },\n },\n};\n\nexport const wikiTraverseGraphManifest: AgentToolManifest = {\n name: 'wiki_traverse_graph',\n scope: 'memory:read',\n schema: {\n name: 'wiki_traverse_graph',\n description:\n 'Traverse the knowledge graph starting from a specific fact ID to discover connected concepts and relationships. Returns a formatted neighborhood subgraph.',\n parameters: {\n type: 'object',\n properties: {\n entityId: { type: 'string', description: 'The namespace/entity ID to traverse.' },\n sourceId: { type: 'string', description: 'The exact ID of the starting fact node (obtained from a previous wiki_read call).' },\n maxDepth: {\n type: 'integer',\n minimum: 1,\n maximum: 3,\n description: 'How many relationship hops to traverse. Maximum allowed is 3.',\n },\n direction: { type: 'string', enum: ['inbound', 'outbound', 'both'], description: \"The direction of relationships to follow. Default 'both'.\" },\n edgeTypes: { type: 'array', items: { type: 'string' }, description: 'Optional filter. If provided, traversal only follows these edge types (e.g. [\"reports_to\", \"depends_on\"]).' },\n },\n required: ['entityId', 'sourceId'],\n },\n },\n};\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -49,6 +49,47 @@ var googleSearchManifest = {
|
|
|
49
49
|
builtIn: "google_search"
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
// src/manifests/graph.ts
|
|
53
|
+
var wikiGetOntologyManifest = {
|
|
54
|
+
name: "wiki_get_ontology",
|
|
55
|
+
scope: "memory:read",
|
|
56
|
+
schema: {
|
|
57
|
+
name: "wiki_get_ontology",
|
|
58
|
+
description: "Retrieve the current ontology manifest (allowed node types and edge types) for the user's memory. Use this to understand the structure of the knowledge graph and what relationships exist.",
|
|
59
|
+
parameters: {
|
|
60
|
+
type: "object",
|
|
61
|
+
properties: {
|
|
62
|
+
entityId: { type: "string", description: "The namespace/entity ID to inspect." }
|
|
63
|
+
},
|
|
64
|
+
required: ["entityId"]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var wikiTraverseGraphManifest = {
|
|
69
|
+
name: "wiki_traverse_graph",
|
|
70
|
+
scope: "memory:read",
|
|
71
|
+
schema: {
|
|
72
|
+
name: "wiki_traverse_graph",
|
|
73
|
+
description: "Traverse the knowledge graph starting from a specific fact ID to discover connected concepts and relationships. Returns a formatted neighborhood subgraph.",
|
|
74
|
+
parameters: {
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {
|
|
77
|
+
entityId: { type: "string", description: "The namespace/entity ID to traverse." },
|
|
78
|
+
sourceId: { type: "string", description: "The exact ID of the starting fact node (obtained from a previous wiki_read call)." },
|
|
79
|
+
maxDepth: {
|
|
80
|
+
type: "integer",
|
|
81
|
+
minimum: 1,
|
|
82
|
+
maximum: 3,
|
|
83
|
+
description: "How many relationship hops to traverse. Maximum allowed is 3."
|
|
84
|
+
},
|
|
85
|
+
direction: { type: "string", enum: ["inbound", "outbound", "both"], description: "The direction of relationships to follow. Default 'both'." },
|
|
86
|
+
edgeTypes: { type: "array", items: { type: "string" }, description: 'Optional filter. If provided, traversal only follows these edge types (e.g. ["reports_to", "depends_on"]).' }
|
|
87
|
+
},
|
|
88
|
+
required: ["entityId", "sourceId"]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export { buildAuthorizedSchemaArray, buildAuthorizedToolsArray, escalateToCloudManifest, getCurrentTimeManifest, googleSearchManifest, wikiGetOntologyManifest, wikiTraverseGraphManifest };
|
|
53
94
|
//# sourceMappingURL=index.mjs.map
|
|
54
95
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/injector.ts","../src/manifests/core.ts"],"names":[],"mappings":";AAaO,SAAS,0BAAA,CACd,oBACA,iBAAA,EACmB;AACnB,EAAA,OAAO,kBAAA,CACJ,MAAA;AAAA,IACC,CA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A;AAAA,EACN,KAAA,EAAO,MAAA;AAAA,EACP,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,yBAAA;AAAA,IACN,WAAA,EACE,qJAAA;AAAA,IACF,YAAY,EAAE,IAAA,EAAM,QAAA,EAAU,UAAA,EAAY,EAAC;AAAE;AAEjD;AAEO,IAAM,oBAAA,GAA4C;AAAA,EACvD,IAAA,EAAM,eAAA;AAAA,EACN,KAAA,EAAO,MAAA;AAAA,EACP,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS;AACX","file":"index.mjs","sourcesContent":["import type {\n AgentToolManifest,\n AgentToolSchema,\n AnyAgentToolManifest,\n BuiltInToolName,\n FunctionToolManifest,\n} from './types';\n\n/**\n * @deprecated Use buildAuthorizedToolsArray instead — it returns the full Gemini\n * tools[] array, including built-in tools like google_search. This function only\n * ever returns function-declaration schemas; built-in manifests are ignored.\n */\nexport function buildAuthorizedSchemaArray(\n availableManifests: AgentToolManifest[],\n userGrantedScopes: string[]\n): AgentToolSchema[] {\n return availableManifests\n .filter(\n (manifest) =>\n manifest.scope === 'core' || userGrantedScopes.includes(manifest.scope)\n )\n .filter(\n (manifest): manifest is FunctionToolManifest => 'schema' in manifest\n )\n .map((manifest) => manifest.schema);\n}\n\n/** One entry of a Gemini `tools[]` array: a function-declarations group, or a built-in tool. */\nexport type GeminiToolEntry =\n | { functionDeclarations: AgentToolSchema[] }\n | { [K in BuiltInToolName]: Record<string, never> };\n\n/**\n * Filters manifests by granted scope (core-scoped manifests always pass) and\n * returns the full Gemini tools[] array: at most one functionDeclarations\n * group, plus one entry per authorized built-in tool.\n */\nexport function buildAuthorizedToolsArray(\n availableManifests: AnyAgentToolManifest[],\n userGrantedScopes: string[]\n): GeminiToolEntry[] {\n const authorized = availableManifests.filter(\n (manifest) =>\n manifest.scope === 'core' || userGrantedScopes.includes(manifest.scope)\n );\n\n const entries: GeminiToolEntry[] = [];\n\n const fnSchemas = authorized\n .filter(\n (manifest): manifest is FunctionToolManifest => manifest.kind !== 'built_in'\n )\n .map((manifest) => manifest.schema);\n if (fnSchemas.length > 0) entries.push({ functionDeclarations: fnSchemas });\n\n for (const manifest of authorized) {\n if (manifest.kind === 'built_in') {\n entries.push({ [manifest.builtIn]: {} } as GeminiToolEntry);\n }\n }\n\n return entries;\n}\n","import type { AgentToolManifest, BuiltInToolManifest } from '../types';\n\nexport const getCurrentTimeManifest: AgentToolManifest = {\n name: 'get_current_time',\n scope: 'core',\n schema: {\n name: 'get_current_time',\n description:\n 'Get the exact current date and time. Always call this tool first if resolving relative temporal words like \"today\" or \"tomorrow\".',\n parameters: { type: 'object', properties: {} },\n },\n};\n\nexport const escalateToCloudManifest: AgentToolManifest = {\n name: 'escalate_to_cloud_agent',\n scope: 'core',\n schema: {\n name: 'escalate_to_cloud_agent',\n description:\n 'Use this tool when the user asks to schedule a reminder, perform deep memory searches, or execute a complex workflow that requires cloud resources.',\n parameters: { type: 'object', properties: {} },\n },\n};\n\nexport const googleSearchManifest: BuiltInToolManifest = {\n name: 'google_search',\n scope: 'core',\n kind: 'built_in',\n builtIn: 'google_search',\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/injector.ts","../src/manifests/core.ts","../src/manifests/graph.ts"],"names":[],"mappings":";AAaO,SAAS,0BAAA,CACd,oBACA,iBAAA,EACmB;AACnB,EAAA,OAAO,kBAAA,CACJ,MAAA;AAAA,IACC,CAAC,aACC,QAAA,CAAS,KAAA,KAAU,UAAU,iBAAA,CAAkB,QAAA,CAAS,SAAS,KAAK;AAAA,GAC1E,CACC,MAAA;AAAA,IACC,CAAC,aAA+C,QAAA,IAAY;AAAA,GAC9D,CACC,GAAA,CAAI,CAAC,QAAA,KAAa,SAAS,MAAM,CAAA;AACtC;AAYO,SAAS,yBAAA,CACd,oBACA,iBAAA,EACmB;AACnB,EAAA,MAAM,aAAa,kBAAA,CAAmB,MAAA;AAAA,IACpC,CAAC,aACC,QAAA,CAAS,KAAA,KAAU,UAAU,iBAAA,CAAkB,QAAA,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mjs","sourcesContent":["import type {\n AgentToolManifest,\n AgentToolSchema,\n AnyAgentToolManifest,\n BuiltInToolName,\n FunctionToolManifest,\n} from './types';\n\n/**\n * @deprecated Use buildAuthorizedToolsArray instead — it returns the full Gemini\n * tools[] array, including built-in tools like google_search. This function only\n * ever returns function-declaration schemas; built-in manifests are ignored.\n */\nexport function buildAuthorizedSchemaArray(\n availableManifests: AgentToolManifest[],\n userGrantedScopes: string[]\n): AgentToolSchema[] {\n return availableManifests\n .filter(\n (manifest) =>\n manifest.scope === 'core' || userGrantedScopes.includes(manifest.scope)\n )\n .filter(\n (manifest): manifest is FunctionToolManifest => 'schema' in manifest\n )\n .map((manifest) => manifest.schema);\n}\n\n/** One entry of a Gemini `tools[]` array: a function-declarations group, or a built-in tool. */\nexport type GeminiToolEntry =\n | { functionDeclarations: AgentToolSchema[] }\n | { [K in BuiltInToolName]: Record<string, never> };\n\n/**\n * Filters manifests by granted scope (core-scoped manifests always pass) and\n * returns the full Gemini tools[] array: at most one functionDeclarations\n * group, plus one entry per authorized built-in tool.\n */\nexport function buildAuthorizedToolsArray(\n availableManifests: AnyAgentToolManifest[],\n userGrantedScopes: string[]\n): GeminiToolEntry[] {\n const authorized = availableManifests.filter(\n (manifest) =>\n manifest.scope === 'core' || userGrantedScopes.includes(manifest.scope)\n );\n\n const entries: GeminiToolEntry[] = [];\n\n const fnSchemas = authorized\n .filter(\n (manifest): manifest is FunctionToolManifest => manifest.kind !== 'built_in'\n )\n .map((manifest) => manifest.schema);\n if (fnSchemas.length > 0) entries.push({ functionDeclarations: fnSchemas });\n\n for (const manifest of authorized) {\n if (manifest.kind === 'built_in') {\n entries.push({ [manifest.builtIn]: {} } as GeminiToolEntry);\n }\n }\n\n return entries;\n}\n","import type { AgentToolManifest, BuiltInToolManifest } from '../types';\n\nexport const getCurrentTimeManifest: AgentToolManifest = {\n name: 'get_current_time',\n scope: 'core',\n schema: {\n name: 'get_current_time',\n description:\n 'Get the exact current date and time. Always call this tool first if resolving relative temporal words like \"today\" or \"tomorrow\".',\n parameters: { type: 'object', properties: {} },\n },\n};\n\nexport const escalateToCloudManifest: AgentToolManifest = {\n name: 'escalate_to_cloud_agent',\n scope: 'core',\n schema: {\n name: 'escalate_to_cloud_agent',\n description:\n 'Use this tool when the user asks to schedule a reminder, perform deep memory searches, or execute a complex workflow that requires cloud resources.',\n parameters: { type: 'object', properties: {} },\n },\n};\n\nexport const googleSearchManifest: BuiltInToolManifest = {\n name: 'google_search',\n scope: 'core',\n kind: 'built_in',\n builtIn: 'google_search',\n};\n","import type { AgentToolManifest } from '../types';\n\nexport const wikiGetOntologyManifest: AgentToolManifest = {\n name: 'wiki_get_ontology',\n scope: 'memory:read',\n schema: {\n name: 'wiki_get_ontology',\n description:\n \"Retrieve the current ontology manifest (allowed node types and edge types) for the user's memory. Use this to understand the structure of the knowledge graph and what relationships exist.\",\n parameters: {\n type: 'object',\n properties: {\n entityId: { type: 'string', description: 'The namespace/entity ID to inspect.' },\n },\n required: ['entityId'],\n },\n },\n};\n\nexport const wikiTraverseGraphManifest: AgentToolManifest = {\n name: 'wiki_traverse_graph',\n scope: 'memory:read',\n schema: {\n name: 'wiki_traverse_graph',\n description:\n 'Traverse the knowledge graph starting from a specific fact ID to discover connected concepts and relationships. Returns a formatted neighborhood subgraph.',\n parameters: {\n type: 'object',\n properties: {\n entityId: { type: 'string', description: 'The namespace/entity ID to traverse.' },\n sourceId: { type: 'string', description: 'The exact ID of the starting fact node (obtained from a previous wiki_read call).' },\n maxDepth: {\n type: 'integer',\n minimum: 1,\n maximum: 3,\n description: 'How many relationship hops to traverse. Maximum allowed is 3.',\n },\n direction: { type: 'string', enum: ['inbound', 'outbound', 'both'], description: \"The direction of relationships to follow. Default 'both'.\" },\n edgeTypes: { type: 'array', items: { type: 'string' }, description: 'Optional filter. If provided, traversal only follows these edge types (e.g. [\"reports_to\", \"depends_on\"]).' },\n },\n required: ['entityId', 'sourceId'],\n },\n },\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equationalapplications/core-llm-tools",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.0",
|
|
4
4
|
"description": "Zero-dependency Gemini function-calling schemas and capability-scoped tool injection for edge AI agents. Works in Node.js, browser, and React Native (Hermes).",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|