@integrity-labs/agt-cli 0.14.14 → 0.14.16
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/mcp/index.js
CHANGED
|
@@ -21719,6 +21719,119 @@ server.tool(
|
|
|
21719
21719
|
return { content: [{ type: "text", text: summary }] };
|
|
21720
21720
|
}
|
|
21721
21721
|
);
|
|
21722
|
+
server.tool(
|
|
21723
|
+
"knowledge.list",
|
|
21724
|
+
"List team knowledge entries (ids, titles, source types). Use before knowledge.add to check if a fact is already saved, or before knowledge.update/delete to find the target id. Returns metadata only \u2014 fetch the full content via the webapp if you need to read an entry back.",
|
|
21725
|
+
{},
|
|
21726
|
+
async () => {
|
|
21727
|
+
const data = await apiPost("/host/my-knowledge", {
|
|
21728
|
+
agent_id: AGT_AGENT_ID
|
|
21729
|
+
});
|
|
21730
|
+
if (!data.items.length) {
|
|
21731
|
+
return { content: [{ type: "text", text: "No knowledge entries yet." }] };
|
|
21732
|
+
}
|
|
21733
|
+
const lines = data.items.map((k) => {
|
|
21734
|
+
const inactive = k.is_active ? "" : " (inactive)";
|
|
21735
|
+
return `- ${k.title}${inactive} [${k.source_type}, id: ${k.id}]`;
|
|
21736
|
+
});
|
|
21737
|
+
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
21738
|
+
}
|
|
21739
|
+
);
|
|
21740
|
+
server.tool(
|
|
21741
|
+
"knowledge.add",
|
|
21742
|
+
"Save a new durable fact or learning to the team knowledge base. Use when the user explicitly asks you to save/remember something, or when you discover information that will be useful on future runs (e.g. a tenant id, an API key name, a company policy). Do NOT use for tasks (use kanban.add) or trivial one-off answers. Returns the new entry id so you can target it with knowledge.update / knowledge.delete.",
|
|
21743
|
+
{
|
|
21744
|
+
title: external_exports.string().describe("Short title summarising the entry (max 200 chars)"),
|
|
21745
|
+
content: external_exports.string().describe("The knowledge content \u2014 the actual fact, learning, or reference material"),
|
|
21746
|
+
source_type: external_exports.enum(["manual", "url", "upload"]).optional().describe('How the entry was sourced \u2014 default "manual" for agent-created entries'),
|
|
21747
|
+
source_url: external_exports.string().optional().describe("Optional URL the content was derived from")
|
|
21748
|
+
},
|
|
21749
|
+
async (params) => {
|
|
21750
|
+
const data = await apiPost("/host/knowledge", {
|
|
21751
|
+
agent_id: AGT_AGENT_ID,
|
|
21752
|
+
add: [
|
|
21753
|
+
{
|
|
21754
|
+
title: params.title,
|
|
21755
|
+
raw_content: params.content,
|
|
21756
|
+
source_type: params.source_type ?? "manual",
|
|
21757
|
+
source_url: params.source_url
|
|
21758
|
+
}
|
|
21759
|
+
]
|
|
21760
|
+
});
|
|
21761
|
+
const first = data.added_items?.[0];
|
|
21762
|
+
if (!data.ok || !first) {
|
|
21763
|
+
const reason = data.errors?.[0] ?? "unknown error";
|
|
21764
|
+
return {
|
|
21765
|
+
content: [{ type: "text", text: `Failed to save knowledge entry: ${reason}` }],
|
|
21766
|
+
isError: true
|
|
21767
|
+
};
|
|
21768
|
+
}
|
|
21769
|
+
return {
|
|
21770
|
+
content: [{
|
|
21771
|
+
type: "text",
|
|
21772
|
+
text: `Saved "${first.title}" to team knowledge (id: ${first.id}). It will appear in future /host/refresh context.`
|
|
21773
|
+
}]
|
|
21774
|
+
};
|
|
21775
|
+
}
|
|
21776
|
+
);
|
|
21777
|
+
server.tool(
|
|
21778
|
+
"knowledge.update",
|
|
21779
|
+
"Edit an existing knowledge entry by id. Use to correct a saved fact or refine its wording. Only the fields you pass are changed; others are left alone. Call knowledge.list first if you need to find the target id.",
|
|
21780
|
+
{
|
|
21781
|
+
id: external_exports.string().describe("Knowledge entry id (uuid) \u2014 from knowledge.list or knowledge.add"),
|
|
21782
|
+
title: external_exports.string().optional().describe("New title (max 200 chars). Regenerates the slug."),
|
|
21783
|
+
content: external_exports.string().optional().describe("Replacement content for the entry"),
|
|
21784
|
+
is_active: external_exports.boolean().optional().describe("Set false to soft-disable without deleting")
|
|
21785
|
+
},
|
|
21786
|
+
async (params) => {
|
|
21787
|
+
if (params.title === void 0 && params.content === void 0 && params.is_active === void 0) {
|
|
21788
|
+
return {
|
|
21789
|
+
content: [{ type: "text", text: "Error: knowledge.update needs at least one of title, content, or is_active." }],
|
|
21790
|
+
isError: true
|
|
21791
|
+
};
|
|
21792
|
+
}
|
|
21793
|
+
const data = await apiPost("/host/knowledge", {
|
|
21794
|
+
agent_id: AGT_AGENT_ID,
|
|
21795
|
+
update: [
|
|
21796
|
+
{
|
|
21797
|
+
id: params.id,
|
|
21798
|
+
title: params.title,
|
|
21799
|
+
raw_content: params.content,
|
|
21800
|
+
is_active: params.is_active
|
|
21801
|
+
}
|
|
21802
|
+
]
|
|
21803
|
+
});
|
|
21804
|
+
if (!data.ok || data.updated !== 1) {
|
|
21805
|
+
const reason = data.errors?.[0] ?? "unknown error";
|
|
21806
|
+
return {
|
|
21807
|
+
content: [{ type: "text", text: `Failed to update knowledge entry ${params.id}: ${reason}` }],
|
|
21808
|
+
isError: true
|
|
21809
|
+
};
|
|
21810
|
+
}
|
|
21811
|
+
return { content: [{ type: "text", text: `Updated knowledge entry ${params.id}.` }] };
|
|
21812
|
+
}
|
|
21813
|
+
);
|
|
21814
|
+
server.tool(
|
|
21815
|
+
"knowledge.delete",
|
|
21816
|
+
"Remove a knowledge entry permanently. Prefer knowledge.update with is_active=false for temporary hides; use delete only when the fact was wrong or no longer applies.",
|
|
21817
|
+
{
|
|
21818
|
+
id: external_exports.string().describe("Knowledge entry id (uuid) to delete")
|
|
21819
|
+
},
|
|
21820
|
+
async (params) => {
|
|
21821
|
+
const data = await apiPost("/host/knowledge", {
|
|
21822
|
+
agent_id: AGT_AGENT_ID,
|
|
21823
|
+
delete: [{ id: params.id }]
|
|
21824
|
+
});
|
|
21825
|
+
if (!data.ok || data.deleted !== 1) {
|
|
21826
|
+
const reason = data.errors?.[0] ?? "unknown error";
|
|
21827
|
+
return {
|
|
21828
|
+
content: [{ type: "text", text: `Failed to delete knowledge entry ${params.id}: ${reason}` }],
|
|
21829
|
+
isError: true
|
|
21830
|
+
};
|
|
21831
|
+
}
|
|
21832
|
+
return { content: [{ type: "text", text: `Deleted knowledge entry ${params.id}.` }] };
|
|
21833
|
+
}
|
|
21834
|
+
);
|
|
21722
21835
|
server.tool(
|
|
21723
21836
|
"plugin.list",
|
|
21724
21837
|
`List the plugins currently installed on this agent, with their current typed context values and a preview of any freeform overrides. Use this when the user asks "what plugins do I have?", "show me the plugins", "what is the Coding plugin configured with?", or before calling plugin.improve to see what fields exist and what they're set to.`,
|