@axiom-lattice/core 12.3.0 → 13.0.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 +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +212 -82
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +185 -56
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -5
package/dist/index.mjs
CHANGED
|
@@ -6859,6 +6859,20 @@ import { EMBEDDING_DEFAULT_KEY as EMBEDDING_DEFAULT_KEY2 } from "@axiom-lattice/
|
|
|
6859
6859
|
|
|
6860
6860
|
// src/collection_lattice/SimpleMemoryVectorStore.ts
|
|
6861
6861
|
import { VectorStore } from "@langchain/core/vectorstores";
|
|
6862
|
+
function matchesMetadataFilter(metadata, filter2) {
|
|
6863
|
+
return Object.entries(filter2).every(([key6, expected]) => {
|
|
6864
|
+
if (expected && typeof expected === "object" && !Array.isArray(expected)) {
|
|
6865
|
+
const operator = expected;
|
|
6866
|
+
if (Array.isArray(operator.in)) {
|
|
6867
|
+
return operator.in.includes(metadata[key6]);
|
|
6868
|
+
}
|
|
6869
|
+
if (Array.isArray(operator.notIn)) {
|
|
6870
|
+
return !operator.notIn.includes(metadata[key6]);
|
|
6871
|
+
}
|
|
6872
|
+
}
|
|
6873
|
+
return metadata[key6] === expected;
|
|
6874
|
+
});
|
|
6875
|
+
}
|
|
6862
6876
|
function cosineSimilarity(a, b) {
|
|
6863
6877
|
let dotProduct = 0;
|
|
6864
6878
|
let normA = 0;
|
|
@@ -6908,11 +6922,9 @@ var SimpleMemoryVectorStore = class extends VectorStore {
|
|
|
6908
6922
|
this.vectors = [];
|
|
6909
6923
|
return;
|
|
6910
6924
|
}
|
|
6911
|
-
this.vectors = this.vectors.filter(
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
});
|
|
6915
|
-
});
|
|
6925
|
+
this.vectors = this.vectors.filter(
|
|
6926
|
+
(v) => !matchesMetadataFilter(v.document.metadata, filter2)
|
|
6927
|
+
);
|
|
6916
6928
|
}
|
|
6917
6929
|
/**
|
|
6918
6930
|
* Similarity search with vector and scores.
|
|
@@ -6921,11 +6933,9 @@ var SimpleMemoryVectorStore = class extends VectorStore {
|
|
|
6921
6933
|
let candidates = this.vectors;
|
|
6922
6934
|
if (filter2 && typeof filter2 === "object") {
|
|
6923
6935
|
const filterObj = filter2;
|
|
6924
|
-
candidates = candidates.filter(
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
});
|
|
6928
|
-
});
|
|
6936
|
+
candidates = candidates.filter(
|
|
6937
|
+
(v) => matchesMetadataFilter(v.document.metadata, filterObj)
|
|
6938
|
+
);
|
|
6929
6939
|
}
|
|
6930
6940
|
const scored = candidates.map((v) => ({
|
|
6931
6941
|
document: v.document,
|
|
@@ -7593,6 +7603,23 @@ function tryExtractTools(plugin) {
|
|
|
7593
7603
|
}
|
|
7594
7604
|
return [];
|
|
7595
7605
|
}
|
|
7606
|
+
function mergeToolMeta(extracted, declared) {
|
|
7607
|
+
if (!declared || declared.length === 0) return extracted;
|
|
7608
|
+
const remaining = new Map(declared.map((tool68) => [tool68.name, tool68]));
|
|
7609
|
+
const merged = extracted.map((tool68) => {
|
|
7610
|
+
const override = remaining.get(tool68.name);
|
|
7611
|
+
if (!override) return tool68;
|
|
7612
|
+
remaining.delete(tool68.name);
|
|
7613
|
+
return { ...tool68, ...override };
|
|
7614
|
+
});
|
|
7615
|
+
for (const tool68 of declared) {
|
|
7616
|
+
if (remaining.has(tool68.name)) {
|
|
7617
|
+
merged.push(tool68);
|
|
7618
|
+
remaining.delete(tool68.name);
|
|
7619
|
+
}
|
|
7620
|
+
}
|
|
7621
|
+
return merged;
|
|
7622
|
+
}
|
|
7596
7623
|
function serializePluginMeta(plugin) {
|
|
7597
7624
|
const meta = {
|
|
7598
7625
|
type: plugin.meta.type,
|
|
@@ -7601,7 +7628,7 @@ function serializePluginMeta(plugin) {
|
|
|
7601
7628
|
version: plugin.meta.version,
|
|
7602
7629
|
source: plugin.meta.source,
|
|
7603
7630
|
icon: plugin.meta.icon,
|
|
7604
|
-
tools: plugin.meta.tools
|
|
7631
|
+
tools: mergeToolMeta(tryExtractTools(plugin), plugin.meta.tools),
|
|
7605
7632
|
configSchema: plugin.meta.configSchema,
|
|
7606
7633
|
defaultConfig: plugin.meta.defaultConfig,
|
|
7607
7634
|
category: plugin.meta.category,
|
|
@@ -12187,7 +12214,8 @@ Ask the user to clarify:
|
|
|
12187
12214
|
3. **What should I search for to verify it works?** Give 2-3 example queries you'll use to test retrieval.
|
|
12188
12215
|
4. **Existing knowledge base \u2014 update or replace?** If entries already exist, confirm:
|
|
12189
12216
|
- **Update** \u2014 add new entries alongside existing ones, or
|
|
12190
|
-
- **Replace** \u2014 delete old entries first
|
|
12217
|
+
- **Replace** \u2014 delete old entries first with \`delete_entries\` (up to 50 IDs
|
|
12218
|
+
per call), then add new ones.
|
|
12191
12219
|
|
|
12192
12220
|
Present the plan as a summary before starting. Do NOT begin building until the user confirms.
|
|
12193
12221
|
|
|
@@ -12199,7 +12227,8 @@ Present the plan as a summary before starting. Do NOT begin building until the u
|
|
|
12199
12227
|
- No collection yet \u2192 \`create_collection(name: "{domain}-knowledge")\`
|
|
12200
12228
|
(one per domain)
|
|
12201
12229
|
3. Use \`add_entries\` in batches of up to 50 knowledge entries per batch.
|
|
12202
|
-
|
|
12230
|
+
Include every extracted chunk when splitting across calls \u2014 never omit
|
|
12231
|
+
content. Extract one self-contained fact or answer per entry. Keep each entry focused \u2014
|
|
12203
12232
|
one topic, one question, one answer. Avoid dumping large paragraphs.
|
|
12204
12233
|
4. Verify retrievability: run the 2-3 example queries from step 3 with
|
|
12205
12234
|
\`search_collection\` \u2014 entries must return with reasonable relevance scores.
|
|
@@ -12710,7 +12739,7 @@ injected with two environment variables:
|
|
|
12710
12739
|
|
|
12711
12740
|
The token already encodes this agent's authority: the platform reflects the agent's
|
|
12712
12741
|
own configured middleware into Open grants, plus a small always-on baseline
|
|
12713
|
-
(\`
|
|
12742
|
+
(\`collection\` read-only search and \`sandbox:self\`). So the callable set = that baseline \u222A the
|
|
12714
12743
|
domains your configured middleware exposes \u2014 and nothing beyond it.
|
|
12715
12744
|
|
|
12716
12745
|
## Client
|
|
@@ -12751,7 +12780,7 @@ CLI equivalents (config comes from the same env vars):
|
|
|
12751
12780
|
|
|
12752
12781
|
\`\`\`bash
|
|
12753
12782
|
open-mcp tools list --json
|
|
12754
|
-
open-mcp tools call
|
|
12783
|
+
open-mcp tools call collection_search_collection --json '{"collection":"docs","query":"refund policy"}'
|
|
12755
12784
|
\`\`\`
|
|
12756
12785
|
|
|
12757
12786
|
## Discover, then call
|
|
@@ -12788,8 +12817,8 @@ const { OpenMcpClient } = require("@axiom-lattice/open-mcp-client");
|
|
|
12788
12817
|
async function main() {
|
|
12789
12818
|
const client = OpenMcpClient.fromEnv(); // API_GATEWAY_URL + OPEN_API_TOKEN
|
|
12790
12819
|
const tools = await client.listTools(); // exactly what this agent may call
|
|
12791
|
-
const pick = tools.find((t) => t.name === "
|
|
12792
|
-
const out = await client.callTool(pick.name, { query: "refund policy" });
|
|
12820
|
+
const pick = tools.find((t) => t.name === "collection_search_collection") ?? tools[0];
|
|
12821
|
+
const out = await client.callTool(pick.name, { collection: "docs", query: "refund policy" });
|
|
12793
12822
|
console.log(JSON.stringify({ called: pick.name, result: out.json() }));
|
|
12794
12823
|
}
|
|
12795
12824
|
|
|
@@ -24529,7 +24558,7 @@ var LEGACY_PLUGIN_CONNECTION_FIELDS = Object.freeze({
|
|
|
24529
24558
|
list_entries: Object.freeze({ argumentField: "collection", configField: "collectionKeys", allowAllField: "connectAll" }),
|
|
24530
24559
|
add_entries: Object.freeze({ argumentField: "collection", configField: "collectionKeys", allowAllField: "connectAll" }),
|
|
24531
24560
|
update_entry: Object.freeze({ argumentField: "collection", configField: "collectionKeys", allowAllField: "connectAll" }),
|
|
24532
|
-
|
|
24561
|
+
delete_entries: Object.freeze({ argumentField: "collection", configField: "collectionKeys", allowAllField: "connectAll" }),
|
|
24533
24562
|
get_collection: Object.freeze({ argumentField: "name", configField: "collectionKeys", allowAllField: "connectAll" }),
|
|
24534
24563
|
update_collection: Object.freeze({ argumentField: "name", configField: "collectionKeys", allowAllField: "connectAll" }),
|
|
24535
24564
|
delete_collection: Object.freeze({ argumentField: "name", configField: "collectionKeys", allowAllField: "connectAll" })
|
|
@@ -39496,6 +39525,18 @@ async function listCollectionEntries(name, embeddingKey, tenantId2) {
|
|
|
39496
39525
|
}
|
|
39497
39526
|
return [];
|
|
39498
39527
|
}
|
|
39528
|
+
async function deleteCollectionEntryIds(vectorStore, entryIds) {
|
|
39529
|
+
if (entryIds.length === 0) return;
|
|
39530
|
+
const typed = vectorStore;
|
|
39531
|
+
const storeType = typeof typed._vectorstoreType === "function" ? typed._vectorstoreType() : "";
|
|
39532
|
+
if (storeType === "pgvector" || storeType === "simple_memory") {
|
|
39533
|
+
await vectorStore.delete({ filter: { _id: { in: entryIds } } });
|
|
39534
|
+
return;
|
|
39535
|
+
}
|
|
39536
|
+
for (const entryId of entryIds) {
|
|
39537
|
+
await vectorStore.delete({ filter: { _id: entryId } });
|
|
39538
|
+
}
|
|
39539
|
+
}
|
|
39499
39540
|
async function removeCollectionVectorStore(name, tenantId2) {
|
|
39500
39541
|
const storeKey = buildKey(tenantId2, name);
|
|
39501
39542
|
const tableName = buildTableName(tenantId2, name);
|
|
@@ -48810,8 +48851,10 @@ var createDeleteCollectionTool = (scope = { collectionKeys: [], connectAll: true
|
|
|
48810
48851
|
const scopeError = validateCollectionScope(input.name, _exeConfig, scope);
|
|
48811
48852
|
if (scopeError) return scopeError;
|
|
48812
48853
|
const tenantId2 = _exeConfig?.configurable?.runConfig?.tenantId || "default";
|
|
48813
|
-
const
|
|
48814
|
-
|
|
48854
|
+
const removed = await collectionLatticeManager.removeCollection(tenantId2, input.name);
|
|
48855
|
+
if (!removed) return `Collection "${input.name}" not found.`;
|
|
48856
|
+
await removeCollectionVectorStore(input.name, tenantId2);
|
|
48857
|
+
return `Collection "${input.name}" deleted.`;
|
|
48815
48858
|
} catch (e) {
|
|
48816
48859
|
return `Error: ${e.message}`;
|
|
48817
48860
|
}
|
|
@@ -48856,20 +48899,27 @@ var createListEntriesTool = (scope = { collectionKeys: [], connectAll: true }) =
|
|
|
48856
48899
|
{ name: "list_entries", description: `List entries in a collection. Shows ID and first 80 chars of content.`, schema: schema2 }
|
|
48857
48900
|
);
|
|
48858
48901
|
|
|
48859
|
-
// src/tool_lattice/collection/
|
|
48902
|
+
// src/tool_lattice/collection/add_entries.ts
|
|
48860
48903
|
import z64 from "zod";
|
|
48861
48904
|
import { tool as tool56 } from "langchain";
|
|
48862
48905
|
import { Document } from "@langchain/core/documents";
|
|
48863
48906
|
import { v4 as uuidv47 } from "uuid";
|
|
48907
|
+
import { COLLECTION_ENTRY_BATCH_MAX } from "@axiom-lattice/protocols";
|
|
48864
48908
|
var schema3 = z64.object({
|
|
48865
48909
|
collection: z64.string().describe("Collection name"),
|
|
48866
|
-
|
|
48867
|
-
|
|
48910
|
+
entries: z64.array(
|
|
48911
|
+
z64.object({
|
|
48912
|
+
content: z64.string().refine((value) => value.trim().length > 0, {
|
|
48913
|
+
message: "content must not be blank"
|
|
48914
|
+
}).describe("Entry content text"),
|
|
48915
|
+
metadata: z64.record(z64.string(), z64.unknown()).optional().describe("Metadata fields matching the collection schema")
|
|
48916
|
+
})
|
|
48917
|
+
).min(1).max(COLLECTION_ENTRY_BATCH_MAX)
|
|
48868
48918
|
});
|
|
48869
|
-
function key3(
|
|
48870
|
-
return `${
|
|
48919
|
+
function key3(tenantId2, collection) {
|
|
48920
|
+
return `${tenantId2}:${collection}`;
|
|
48871
48921
|
}
|
|
48872
|
-
var
|
|
48922
|
+
var createAddEntriesTool = (scope = { collectionKeys: [], connectAll: true }) => tool56(
|
|
48873
48923
|
async (input, _exeConfig) => {
|
|
48874
48924
|
try {
|
|
48875
48925
|
const scopeError = validateCollectionScope(input.collection, _exeConfig, scope);
|
|
@@ -48887,17 +48937,29 @@ var createAddEntryTool = (scope = { collectionKeys: [], connectAll: true }) => t
|
|
|
48887
48937
|
tenantId2
|
|
48888
48938
|
);
|
|
48889
48939
|
}
|
|
48890
|
-
const
|
|
48891
|
-
|
|
48892
|
-
|
|
48893
|
-
|
|
48894
|
-
|
|
48895
|
-
|
|
48940
|
+
const documents = input.entries.map((entry) => {
|
|
48941
|
+
const id = uuidv47();
|
|
48942
|
+
return new Document({
|
|
48943
|
+
pageContent: entry.content,
|
|
48944
|
+
metadata: {
|
|
48945
|
+
...entry.metadata || {},
|
|
48946
|
+
_id: id,
|
|
48947
|
+
_created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
48948
|
+
}
|
|
48949
|
+
});
|
|
48950
|
+
});
|
|
48951
|
+
await vs.addDocuments(documents);
|
|
48952
|
+
const ids = documents.map((document) => document.metadata._id).join(", ");
|
|
48953
|
+
return `Added ${documents.length} entries to "${input.collection}". IDs: ${ids}`;
|
|
48896
48954
|
} catch (error) {
|
|
48897
|
-
return `Error adding
|
|
48955
|
+
return `Error adding entries to "${input.collection}": ${error instanceof Error ? error.message : String(error)}`;
|
|
48898
48956
|
}
|
|
48899
48957
|
},
|
|
48900
|
-
{
|
|
48958
|
+
{
|
|
48959
|
+
name: "add_entries",
|
|
48960
|
+
description: "Add multiple new entries to a collection in batches of up to 50.",
|
|
48961
|
+
schema: schema3
|
|
48962
|
+
}
|
|
48901
48963
|
);
|
|
48902
48964
|
|
|
48903
48965
|
// src/tool_lattice/collection/update_entry.ts
|
|
@@ -48918,44 +48980,98 @@ var createUpdateEntryTool = (scope = { collectionKeys: [], connectAll: true }) =
|
|
|
48918
48980
|
const scopeError = validateCollectionScope(input.collection, _exeConfig, scope);
|
|
48919
48981
|
if (scopeError) return scopeError;
|
|
48920
48982
|
const tenantId2 = _exeConfig?.configurable?.runConfig?.tenantId || "default";
|
|
48921
|
-
const
|
|
48983
|
+
const collection = await collectionLatticeManager.getCollection(tenantId2, input.collection);
|
|
48984
|
+
if (!collection) return `Collection "${input.collection}" not found.`;
|
|
48985
|
+
let vs;
|
|
48922
48986
|
try {
|
|
48923
|
-
|
|
48987
|
+
vs = vectorStoreLatticeManager.getVectorStoreClient(key4(tenantId2, input.collection));
|
|
48924
48988
|
} catch {
|
|
48989
|
+
vs = await getOrCreateCollectionVectorStore(
|
|
48990
|
+
input.collection,
|
|
48991
|
+
collection.embeddingKey,
|
|
48992
|
+
tenantId2
|
|
48993
|
+
);
|
|
48994
|
+
}
|
|
48995
|
+
const docs = await listCollectionEntries(input.collection, collection.embeddingKey, tenantId2);
|
|
48996
|
+
const existing = docs.find((document) => document.metadata._id === input.entryId);
|
|
48997
|
+
if (!existing) return `Entry ${input.entryId} not found in "${input.collection}".`;
|
|
48998
|
+
await vs.delete({ filter: { _id: input.entryId } });
|
|
48999
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
49000
|
+
const callerMetadata = Object.fromEntries(
|
|
49001
|
+
Object.entries(input.metadata || {}).filter(([key6]) => !key6.startsWith("_"))
|
|
49002
|
+
);
|
|
49003
|
+
const nextDocument = {
|
|
49004
|
+
pageContent: input.content ?? existing.pageContent,
|
|
49005
|
+
metadata: {
|
|
49006
|
+
...existing.metadata,
|
|
49007
|
+
...callerMetadata,
|
|
49008
|
+
_id: input.entryId,
|
|
49009
|
+
_created_at: existing.metadata._created_at ?? now,
|
|
49010
|
+
_updated_at: now
|
|
49011
|
+
}
|
|
49012
|
+
};
|
|
49013
|
+
try {
|
|
49014
|
+
await vs.addDocuments([nextDocument]);
|
|
49015
|
+
} catch (error) {
|
|
49016
|
+
try {
|
|
49017
|
+
await vs.addDocuments([existing]);
|
|
49018
|
+
} catch {
|
|
49019
|
+
}
|
|
49020
|
+
throw error;
|
|
48925
49021
|
}
|
|
48926
|
-
await vs.addDocuments([{ pageContent: input.content || "", metadata: { _id: input.entryId, _updated_at: (/* @__PURE__ */ new Date()).toISOString(), ...input.metadata || {} } }]);
|
|
48927
49022
|
return `Entry ${input.entryId} updated in "${input.collection}".`;
|
|
48928
|
-
} catch {
|
|
48929
|
-
return `
|
|
49023
|
+
} catch (error) {
|
|
49024
|
+
return `Error updating entry in "${input.collection}": ${error instanceof Error ? error.message : String(error)}`;
|
|
48930
49025
|
}
|
|
48931
49026
|
},
|
|
48932
49027
|
{ name: "update_entry", description: `Update an entry by ID. Provide at least content or metadata.`, schema: schema4 }
|
|
48933
49028
|
);
|
|
48934
49029
|
|
|
48935
|
-
// src/tool_lattice/collection/
|
|
49030
|
+
// src/tool_lattice/collection/delete_entries.ts
|
|
48936
49031
|
import z66 from "zod";
|
|
48937
49032
|
import { tool as tool58 } from "langchain";
|
|
49033
|
+
import { COLLECTION_ENTRY_BATCH_MAX as COLLECTION_ENTRY_BATCH_MAX2 } from "@axiom-lattice/protocols";
|
|
48938
49034
|
var schema5 = z66.object({
|
|
48939
49035
|
collection: z66.string().describe("Collection name"),
|
|
48940
|
-
|
|
49036
|
+
entryIds: z66.array(
|
|
49037
|
+
z66.string().refine((value) => value.trim().length > 0, {
|
|
49038
|
+
message: "entry id must not be blank"
|
|
49039
|
+
}).describe("Entry ID to delete")
|
|
49040
|
+
).min(1).max(COLLECTION_ENTRY_BATCH_MAX2)
|
|
48941
49041
|
});
|
|
48942
|
-
function key5(
|
|
48943
|
-
return `${
|
|
49042
|
+
function key5(tenantId2, collection) {
|
|
49043
|
+
return `${tenantId2}:${collection}`;
|
|
48944
49044
|
}
|
|
48945
|
-
var
|
|
49045
|
+
var createDeleteEntriesTool = (scope = { collectionKeys: [], connectAll: true }) => tool58(
|
|
48946
49046
|
async (input, _exeConfig) => {
|
|
48947
49047
|
try {
|
|
48948
49048
|
const scopeError = validateCollectionScope(input.collection, _exeConfig, scope);
|
|
48949
49049
|
if (scopeError) return scopeError;
|
|
48950
49050
|
const tenantId2 = _exeConfig?.configurable?.runConfig?.tenantId || "default";
|
|
48951
|
-
|
|
48952
|
-
|
|
48953
|
-
|
|
48954
|
-
|
|
48955
|
-
|
|
49051
|
+
let vs;
|
|
49052
|
+
try {
|
|
49053
|
+
vs = vectorStoreLatticeManager.getVectorStoreClient(key5(tenantId2, input.collection));
|
|
49054
|
+
} catch {
|
|
49055
|
+
const collection = await collectionLatticeManager.getCollection(tenantId2, input.collection);
|
|
49056
|
+
if (!collection) return `Collection "${input.collection}" not found.`;
|
|
49057
|
+
vs = await getOrCreateCollectionVectorStore(
|
|
49058
|
+
collection.name,
|
|
49059
|
+
collection.embeddingKey,
|
|
49060
|
+
tenantId2
|
|
49061
|
+
);
|
|
49062
|
+
}
|
|
49063
|
+
await deleteCollectionEntryIds(vs, input.entryIds);
|
|
49064
|
+
const noun = input.entryIds.length === 1 ? "entry" : "entries";
|
|
49065
|
+
return `Processed ${input.entryIds.length} ${noun} for deletion from "${input.collection}" (idempotent).`;
|
|
49066
|
+
} catch (error) {
|
|
49067
|
+
return `Error deleting entries from "${input.collection}": ${error instanceof Error ? error.message : String(error)}`;
|
|
48956
49068
|
}
|
|
48957
49069
|
},
|
|
48958
|
-
{
|
|
49070
|
+
{
|
|
49071
|
+
name: "delete_entries",
|
|
49072
|
+
description: "Delete entries from a collection in batches of up to 50.",
|
|
49073
|
+
schema: schema5
|
|
49074
|
+
}
|
|
48959
49075
|
);
|
|
48960
49076
|
|
|
48961
49077
|
// src/middlewares/collectionMiddleware.ts
|
|
@@ -48983,9 +49099,9 @@ function createCollectionMiddleware(params) {
|
|
|
48983
49099
|
createCreateCollectionTool({ collectionKeys, connectAll }),
|
|
48984
49100
|
createUpdateCollectionTool(toolParams),
|
|
48985
49101
|
createDeleteCollectionTool(toolParams),
|
|
48986
|
-
|
|
49102
|
+
createAddEntriesTool(toolParams),
|
|
48987
49103
|
createUpdateEntryTool(toolParams),
|
|
48988
|
-
|
|
49104
|
+
createDeleteEntriesTool(toolParams)
|
|
48989
49105
|
]
|
|
48990
49106
|
});
|
|
48991
49107
|
}
|
|
@@ -48996,6 +49112,18 @@ var collectionPlugin = {
|
|
|
48996
49112
|
capabilityBundleEligible: true,
|
|
48997
49113
|
name: "Collection",
|
|
48998
49114
|
description: "Provides vector search and CRUD access to knowledge collections",
|
|
49115
|
+
openExpose: [
|
|
49116
|
+
{ name: "list_collections", readOnly: true, destructive: false },
|
|
49117
|
+
{ name: "search_collection", readOnly: true, destructive: false },
|
|
49118
|
+
{ name: "get_collection", readOnly: true, destructive: false },
|
|
49119
|
+
{ name: "list_entries", readOnly: true, destructive: false },
|
|
49120
|
+
{ name: "create_collection", readOnly: false, destructive: false },
|
|
49121
|
+
{ name: "update_collection", readOnly: false, destructive: false },
|
|
49122
|
+
{ name: "add_entries", readOnly: false, destructive: false },
|
|
49123
|
+
{ name: "update_entry", readOnly: false, destructive: false },
|
|
49124
|
+
{ name: "delete_collection", readOnly: false, destructive: true },
|
|
49125
|
+
{ name: "delete_entries", readOnly: false, destructive: true }
|
|
49126
|
+
],
|
|
48999
49127
|
tools: [
|
|
49000
49128
|
{ name: "list_collections", description: "List all available collections" },
|
|
49001
49129
|
{ name: "search_collection", description: "Search for documents in a collection" },
|
|
@@ -49006,7 +49134,7 @@ var collectionPlugin = {
|
|
|
49006
49134
|
{ name: "delete_collection", description: "Delete a collection" },
|
|
49007
49135
|
{ name: "add_entries", description: "Add entries to a collection in batches" },
|
|
49008
49136
|
{ name: "update_entry", description: "Update an entry in a collection" },
|
|
49009
|
-
{ name: "
|
|
49137
|
+
{ name: "delete_entries", description: "Delete entries from a collection in batches" }
|
|
49010
49138
|
],
|
|
49011
49139
|
configSchema: {
|
|
49012
49140
|
type: "object",
|
|
@@ -55054,7 +55182,7 @@ async function main() {
|
|
|
55054
55182
|
token: conn.platformApiKey,
|
|
55055
55183
|
});
|
|
55056
55184
|
const tools = await client.listTools(); // exactly what this handler may call
|
|
55057
|
-
const kb = await client.callTool("
|
|
55185
|
+
const kb = await client.callTool("collection_search_collection", { collection: "docs", query: input.q });
|
|
55058
55186
|
|
|
55059
55187
|
process.stdout.write(JSON.stringify({ ok: true, result: kb }));
|
|
55060
55188
|
}
|
|
@@ -55103,7 +55231,7 @@ output (e.g. the tool result), not on echoing the key.
|
|
|
55103
55231
|
## Discover, then call
|
|
55104
55232
|
|
|
55105
55233
|
Never hardcode the tool list: the callable set is the key's grants. Call
|
|
55106
|
-
\`listTools()\` at runtime. Tool names are \`{domain}_{action}\` (e.g. \`
|
|
55234
|
+
\`listTools()\` at runtime. Tool names are \`{domain}_{action}\` (e.g. \`collection_search_collection\`,
|
|
55107
55235
|
\`task_manage_task\`); args follow the tool's \`inputSchema\`. Return the result
|
|
55108
55236
|
through the normal handler envelope (\`{ ok: true, result }\`) \u2014 see
|
|
55109
55237
|
\`sandbox-plugins-handlers\`.
|
|
@@ -55124,7 +55252,7 @@ through the normal handler envelope (\`{ ok: true, result }\`) \u2014 see
|
|
|
55124
55252
|
## What the handler may call
|
|
55125
55253
|
|
|
55126
55254
|
The API key carries **only its own grants**. Unlike agent \`code_eval\`, a plugin
|
|
55127
|
-
key does not automatically get the sandbox
|
|
55255
|
+
key does not automatically get the sandbox/collection defaults; grant those explicitly
|
|
55128
55256
|
on the key if the handler needs them. A call outside the key's grants fails
|
|
55129
55257
|
(tool-not-found or \`GRANT_DENIED\`); retrying will not help. Give the plugin a
|
|
55130
55258
|
least-privilege key.
|
|
@@ -58666,6 +58794,7 @@ export {
|
|
|
58666
58794
|
decrypt,
|
|
58667
58795
|
decryptConfigFields,
|
|
58668
58796
|
delegationService,
|
|
58797
|
+
deleteCollectionEntryIds,
|
|
58669
58798
|
describeCronExpression,
|
|
58670
58799
|
disconnectAllChannels,
|
|
58671
58800
|
documentLearningPlugin,
|