@integrity-labs/agt-cli 0.28.1202 → 0.28.1204

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/bin/agt.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-QYYXOM23.js";
43
+ } from "../chunk-PRW37VJ2.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
@@ -5200,7 +5200,7 @@ import { execFileSync, execSync } from "child_process";
5200
5200
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
5201
5201
  import chalk17 from "chalk";
5202
5202
  import ora15 from "ora";
5203
- var cliVersion = true ? "0.28.1202" : "dev";
5203
+ var cliVersion = true ? "0.28.1204" : "dev";
5204
5204
  async function fetchLatestVersion() {
5205
5205
  const host2 = getHost();
5206
5206
  if (!host2) return null;
@@ -6460,7 +6460,7 @@ function handleError(err) {
6460
6460
  }
6461
6461
 
6462
6462
  // src/bin/agt.ts
6463
- var cliVersion2 = true ? "0.28.1202" : "dev";
6463
+ var cliVersion2 = true ? "0.28.1204" : "dev";
6464
6464
  var program = new Command();
6465
6465
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6466
6466
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -8082,7 +8082,7 @@ function exchangeFailureKind(err) {
8082
8082
  }
8083
8083
 
8084
8084
  // src/lib/api-client.ts
8085
- var agtCliVersion = true ? "0.28.1202" : "dev";
8085
+ var agtCliVersion = true ? "0.28.1204" : "dev";
8086
8086
  var lastConfigHash = null;
8087
8087
  function setConfigHash(hash) {
8088
8088
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -13683,4 +13683,4 @@ export {
13683
13683
  managerInstallSystemUnitCommand,
13684
13684
  managerUninstallSystemUnitCommand
13685
13685
  };
13686
- //# sourceMappingURL=chunk-QYYXOM23.js.map
13686
+ //# sourceMappingURL=chunk-PRW37VJ2.js.map
@@ -85,7 +85,7 @@ import {
85
85
  tripClass,
86
86
  writeEtcEnvironment,
87
87
  writeProfileDScript
88
- } from "../chunk-QYYXOM23.js";
88
+ } from "../chunk-PRW37VJ2.js";
89
89
  import {
90
90
  CLAUDE_CODE_SECURITY_FLOOR,
91
91
  SELF_UPDATE_TIMEOUTS,
@@ -16359,7 +16359,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
16359
16359
  var lastVersionCheckAt = 0;
16360
16360
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
16361
16361
  var lastResponsivenessProbeAt = 0;
16362
- var agtCliVersion = true ? "0.28.1202" : "dev";
16362
+ var agtCliVersion = true ? "0.28.1204" : "dev";
16363
16363
  function resolveBrewPath(execFileSync3) {
16364
16364
  try {
16365
16365
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -54103,6 +54103,7 @@ var MAINTENANCE_GATED_TOOLS = /* @__PURE__ */ new Set([
54103
54103
  // Knowledge.
54104
54104
  "knowledge_add",
54105
54105
  "knowledge_update",
54106
+ "knowledge_edit",
54106
54107
  "knowledge_delete",
54107
54108
  // Projects and project tagging.
54108
54109
  "projects_create",
package/dist/mcp/index.js CHANGED
@@ -32442,6 +32442,56 @@ var HOST_KEY_ROTATION_GRACE_MAX_MS = 60 * 6e4;
32442
32442
  var TEAM_SLUG_MAX_ATTEMPTS = 20;
32443
32443
  var SUFFIX_RESERVE = `-${TEAM_SLUG_MAX_ATTEMPTS}`.length;
32444
32444
 
32445
+ // src/integration-list-render.ts
32446
+ var PREVIEW_LENGTH = 200;
32447
+ function renderIntegrationList(plugins) {
32448
+ const lines = [];
32449
+ lines.push(`## Installed Integrations (${plugins.length})
32450
+ `);
32451
+ for (const p2 of plugins) {
32452
+ lines.push(`### ${p2.plugin_name} \`${p2.integration_slug ?? p2.plugin_slug}\` (v${p2.version})`);
32453
+ if (p2.description) lines.push(p2.description);
32454
+ lines.push(`- Skills: ${p2.skill_count}`);
32455
+ if (p2.excluded_skills?.length) {
32456
+ lines.push(`- Excluded on this agent only: ${p2.excluded_skills.map((s) => `\`${s}\``).join(", ")}`);
32457
+ }
32458
+ if (p2.base_hash && p2.effective_hash) {
32459
+ lines.push(`- Instructions: shared \`${p2.base_hash}\`, yours \`${p2.effective_hash}\``);
32460
+ }
32461
+ if (p2.has_schema && p2.context_field_count > 0) {
32462
+ lines.push(`- Context values:`);
32463
+ for (const [key, val] of Object.entries(p2.current_values)) {
32464
+ lines.push(` - \`${key}\`: ${JSON.stringify(val)}`);
32465
+ }
32466
+ } else if (p2.has_schema) {
32467
+ lines.push(`- Context: schema declared but no values set (all defaults)`);
32468
+ } else {
32469
+ lines.push(`- Context: no typed schema (freeform overrides only)`);
32470
+ }
32471
+ if (p2.has_overrides) {
32472
+ if (typeof p2.overrides === "string") {
32473
+ lines.push(`- Freeform overrides, on this agent only (full text):`);
32474
+ lines.push(` > ${p2.overrides.replace(/\n/g, "\n > ")}`);
32475
+ } else {
32476
+ const cut = p2.overrides_preview.length >= PREVIEW_LENGTH;
32477
+ lines.push(`- Freeform overrides, on this agent only (${cut ? "preview, call again with include_full_overrides: true for all of it" : "preview"}):`);
32478
+ lines.push(` > ${p2.overrides_preview.replace(/\n/g, "\n > ")}`);
32479
+ }
32480
+ } else {
32481
+ lines.push(`- Freeform overrides: none on this agent`);
32482
+ }
32483
+ lines.push("");
32484
+ }
32485
+ if (plugins.some((p2) => p2.base_hash && p2.effective_hash)) {
32486
+ lines.push(
32487
+ "To compare with another agent: the same shared hash and a different yours hash means one of you has a per-agent layer, which is the values, overrides and excluded skills above. A different shared hash means the shared skills themselves differ: one was edited, renamed, added or removed. These describe what you should have, so a just-changed integration can briefly differ from your files."
32488
+ );
32489
+ lines.push("");
32490
+ }
32491
+ lines.push("To update any integration's behavior, use the `integration_improve` tool with the user's feedback. It changes this agent's copy only, not other agents on the same integration.");
32492
+ return lines.join("\n");
32493
+ }
32494
+
32445
32495
  // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
32446
32496
  var external_exports = {};
32447
32497
  __export(external_exports, {
@@ -36874,6 +36924,32 @@ function resolveHostFilePath(toolName, args, opts) {
36874
36924
  }
36875
36925
  }
36876
36926
 
36927
+ // src/knowledge-edit-result.ts
36928
+ function formatKnowledgeEditResult(id, data) {
36929
+ const report = data.edits?.[0];
36930
+ if (data.updated !== 1 || !report) {
36931
+ const reason = data.errors?.[0] ?? "the server did not confirm the edit";
36932
+ return { text: `Failed to edit knowledge entry ${id}: ${reason}. Nothing was changed.`, isError: true };
36933
+ }
36934
+ const delta = report.length - report.previous_length;
36935
+ const lines = [
36936
+ `Edited knowledge entry ${report.id} (${report.op}): ${report.previous_length} -> ${report.length} chars (${delta >= 0 ? "+" : ""}${delta}).`,
36937
+ `sha256 before: ${report.previous_sha256}`,
36938
+ `sha256 after: ${report.sha256}`,
36939
+ "Text around the change, as now stored:",
36940
+ "<<<",
36941
+ report.context,
36942
+ ">>>"
36943
+ ];
36944
+ const warnings = data.errors ?? [];
36945
+ if (warnings.length > 0) {
36946
+ lines.push(
36947
+ `The edit WAS saved; do not repeat it. The server also reported: ${warnings.join("; ")}`
36948
+ );
36949
+ }
36950
+ return { text: lines.join("\n"), isError: false };
36951
+ }
36952
+
36877
36953
  // src/artefact-work-dir.ts
36878
36954
  import { mkdir, mkdtemp } from "fs/promises";
36879
36955
  import { existsSync } from "fs";
@@ -47488,6 +47564,7 @@ var MAINTENANCE_GATED_TOOLS = /* @__PURE__ */ new Set([
47488
47564
  // Knowledge.
47489
47565
  "knowledge_add",
47490
47566
  "knowledge_update",
47567
+ "knowledge_edit",
47491
47568
  "knowledge_delete",
47492
47569
  // Projects and project tagging.
47493
47570
  "projects_create",
@@ -52276,7 +52353,9 @@ server.tool(
52276
52353
  const header2 = [
52277
52354
  `# ${k.title}`,
52278
52355
  `id: ${k.id} \xB7 slug: ${k.slug} \xB7 scope: ${k.scope} \xB7 ${k.is_active ? "active" : "INACTIVE"}`,
52279
- `length: ${k.full_length} chars \xB7 source: ${k.source_type ?? "unknown"}${k.source_url ? ` (${k.source_url})` : ""} \xB7 updated: ${k.updated_at}`
52356
+ `length: ${k.full_length} chars \xB7 source: ${k.source_type ?? "unknown"}${k.source_url ? ` (${k.source_url})` : ""} \xB7 updated: ${k.updated_at}`,
52357
+ // CS-1811: an older API sends no hash; say nothing rather than a blank.
52358
+ ...k.content_sha256 ? [`sha256: ${k.content_sha256} (knowledge_edit reports the hash before and after its write)`] : []
52280
52359
  ];
52281
52360
  if (k.truncated) {
52282
52361
  header2.push(
@@ -52430,7 +52509,7 @@ server.tool(
52430
52509
  );
52431
52510
  server.tool(
52432
52511
  "knowledge_update",
52433
- "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 AND its scope; you must pass the same scope the entry was listed under.",
52512
+ "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. `content` REPLACES THE WHOLE BODY: to add or change part of an entry, use knowledge_edit instead. Call knowledge_list first if you need to find the target id AND its scope; you must pass the same scope the entry was listed under.",
52434
52513
  {
52435
52514
  id: external_exports.string().describe("Knowledge entry id (uuid) \u2014 from knowledge_list or knowledge_add"),
52436
52515
  scope: external_exports.enum(["team", "org"]).optional().describe('Scope of the target entry as shown by knowledge_list ("team" default, "org" for organization-wide entries). Must match the entry, or the update will not find it.'),
@@ -52467,6 +52546,41 @@ server.tool(
52467
52546
  return { content: [{ type: "text", text: `Updated knowledge entry ${params.id}.` }] };
52468
52547
  }
52469
52548
  );
52549
+ server.tool(
52550
+ "knowledge_edit",
52551
+ "Change PART of an existing knowledge entry without resending the rest: either append text to the end, or replace one exact passage. Prefer this to knowledge_update whenever you are not rewriting the whole entry. knowledge_update replaces the entire body, so a small change to a long entry means retyping all of it, and anything dropped is lost without an error. APPEND adds `append` verbatim, with no separator, so include any leading newline yourself. REPLACE swaps `replace_find` for `replace_with`. `replace_find` must occur EXACTLY ONCE: if it is missing or repeated, nothing is written and the reason is returned, so copy it exactly from knowledge_get and lengthen it until it is unique. To delete a passage, replace it with an empty string. If someone else changes the entry at the same moment, your edit is re-applied to their version, or refused if your anchor no longer fits. The reply gives the length and sha256 before and after, plus the text around the change, so you can check it without reading the whole entry back.",
52552
+ {
52553
+ id: external_exports.string().describe("Knowledge entry id (uuid), from knowledge_list or knowledge_get"),
52554
+ scope: external_exports.enum(["team", "org"]).optional().describe('Scope of the target entry as shown by knowledge_list ("team" default, "org" for organization-wide entries).'),
52555
+ append: external_exports.string().optional().describe("Text to add to the end of the entry, verbatim. Mutually exclusive with replace_find."),
52556
+ replace_find: external_exports.string().optional().describe("The exact passage to replace. Must occur exactly once in the entry."),
52557
+ replace_with: external_exports.string().optional().describe("What replace_find becomes. Required with replace_find; may be empty to delete it.")
52558
+ },
52559
+ async (params) => {
52560
+ const isReplace = params.replace_find !== void 0 || params.replace_with !== void 0;
52561
+ if (params.append !== void 0 === isReplace) {
52562
+ return {
52563
+ content: [{ type: "text", text: "Error: knowledge_edit needs exactly one of append, or replace_find with replace_with." }],
52564
+ isError: true
52565
+ };
52566
+ }
52567
+ if (isReplace && (params.replace_find === void 0 || params.replace_with === void 0)) {
52568
+ return {
52569
+ content: [{ type: "text", text: "Error: replace_find and replace_with go together. To delete a passage, pass replace_with as an empty string." }],
52570
+ isError: true
52571
+ };
52572
+ }
52573
+ const data = await apiPost("/host/knowledge", {
52574
+ agent_id: AGT_AGENT_ID,
52575
+ scope: params.scope ?? "team",
52576
+ update: [
52577
+ isReplace ? { id: params.id, replace: { find: params.replace_find, with: params.replace_with } } : { id: params.id, append: params.append }
52578
+ ]
52579
+ });
52580
+ const result = formatKnowledgeEditResult(params.id, data);
52581
+ return { content: [{ type: "text", text: result.text }], ...result.isError ? { isError: true } : {} };
52582
+ }
52583
+ );
52470
52584
  server.tool(
52471
52585
  "knowledge_delete",
52472
52586
  "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. Pass the same scope the entry was listed under.",
@@ -52492,40 +52606,21 @@ server.tool(
52492
52606
  );
52493
52607
  server.tool(
52494
52608
  "integration_list",
52495
- `List the integrations 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 integrations do I have?", "show me the integrations", "what is the Coding integration configured with?", or before calling integration_improve to see what fields exist and what they're set to.`,
52496
- {},
52497
- async () => {
52609
+ `List the integrations currently installed on this agent, with their current typed context values, any freeform overrides, and hashes to compare your instructions with another agent's. Use this when the user asks "what integrations do I have?", "show me the integrations", "what is the Coding integration configured with?", when two agents seem to read different instructions, or before calling integration_improve to see what fields exist and what they're set to.`,
52610
+ {
52611
+ include_full_overrides: external_exports.boolean().optional().describe(
52612
+ "Return each integration's complete freeform overrides instead of a 200-character preview. This is the text appended to your skill files for that integration."
52613
+ )
52614
+ },
52615
+ async (params) => {
52498
52616
  const data = await apiPost("/host/list-integrations", {
52499
- agent_id: AGT_AGENT_ID
52617
+ agent_id: AGT_AGENT_ID,
52618
+ ...params.include_full_overrides ? { include_full_overrides: true } : {}
52500
52619
  });
52501
52620
  if (!data.plugins.length) {
52502
52621
  return { content: [{ type: "text", text: "No integrations installed on this agent." }] };
52503
52622
  }
52504
- const lines = [];
52505
- lines.push(`## Installed Integrations (${data.plugins.length})
52506
- `);
52507
- for (const p2 of data.plugins) {
52508
- lines.push(`### ${p2.plugin_name} \`${p2.integration_slug ?? p2.plugin_slug}\` (v${p2.version})`);
52509
- if (p2.description) lines.push(p2.description);
52510
- lines.push(`- Skills: ${p2.skill_count}`);
52511
- if (p2.has_schema && p2.context_field_count > 0) {
52512
- lines.push(`- Context values:`);
52513
- for (const [key, val] of Object.entries(p2.current_values)) {
52514
- lines.push(` - \`${key}\`: ${JSON.stringify(val)}`);
52515
- }
52516
- } else if (p2.has_schema) {
52517
- lines.push(`- Context: schema declared but no values set (all defaults)`);
52518
- } else {
52519
- lines.push(`- Context: no typed schema (freeform overrides only)`);
52520
- }
52521
- if (p2.has_overrides) {
52522
- lines.push(`- Freeform overrides (preview):`);
52523
- lines.push(` > ${p2.overrides_preview.replace(/\n/g, "\n > ")}`);
52524
- }
52525
- lines.push("");
52526
- }
52527
- lines.push("To update any integration's behavior, use the `integration_improve` tool with the user's feedback.");
52528
- return { content: [{ type: "text", text: lines.join("\n") }] };
52623
+ return { content: [{ type: "text", text: renderIntegrationList(data.plugins) }] };
52529
52624
  }
52530
52625
  );
52531
52626
  server.tool(
@@ -52533,7 +52628,7 @@ server.tool(
52533
52628
  // Description leads with the user phrasings the agent should match against,
52534
52629
  // then explains the safety rule. Order matters — Claude\'s tool selection
52535
52630
  // weights the first line of a description heavily.
52536
- `Update, edit, or add a rule to an installed integration (e.g. the Coding integration, the Knowledge Base integration, the Slack integration). USE THIS TOOL when the user says any of: "update the X integration", "add a rule to integration Y", "tell the X integration not to do Z", "change the X integration so it does Y", "the Coding integration should always/never...", "remember this for the X integration". This is the ONLY correct way to modify an integration's behavior. NEVER edit SKILL.md files under .claude/skills/integration-* directly \u2014 those files are derived from the platform database and your edits will be silently overwritten on the next manager refresh. The platform calls an LLM to translate the user's request into a structured update of the integration's typed context fields and/or freeform overrides text, then returns a diff for you to show the user. Default flow is preview-then-apply: call once to get the proposed diff, show it to the user, then call again with auto_apply=true if they confirm. Only works for integrations that are actually installed on this agent. Stored overrides are never rewritten: a note is only ever appended after them, and existing overrides text cannot be removed or reworded through this tool. If an auto_apply=true call fails as INDETERMINATE, do NOT retry it: a retry generates the note again and can append it twice. Tell the user the outcome is unknown instead.`,
52631
+ `Update, edit, or add a rule to an installed integration (e.g. the Coding integration, the Knowledge Base integration, the Slack integration). USE THIS TOOL when the user says any of: "update the X integration", "add a rule to integration Y", "tell the X integration not to do Z", "change the X integration so it does Y", "the Coding integration should always/never...", "remember this for the X integration". This is the ONLY correct way to modify an integration's behavior. NEVER edit SKILL.md files under .claude/skills/integration-* directly \u2014 those files are derived from the platform database and your edits will be silently overwritten on the next manager refresh. The platform calls an LLM to translate the user's request into a structured update of the integration's typed context fields and/or freeform overrides text, then returns a diff for you to show the user. Default flow is preview-then-apply: call once to get the proposed diff, show it to the user, then call again with auto_apply=true if they confirm. Only works for integrations that are actually installed on this agent. Stored overrides are never rewritten: a note is only ever appended after them, and existing overrides text cannot be removed or reworded through this tool. If an auto_apply=true call fails as INDETERMINATE, do NOT retry it: a retry generates the note again and can append it twice. Tell the user the outcome is unknown instead. It changes this agent's copy only: other agents on the same integration keep theirs.`,
52537
52632
  {
52538
52633
  integration_slug: external_exports.string().optional().describe('Integration slug to improve (e.g. "claude-code-github"). Either this or integration_id is required.'),
52539
52634
  integration_id: external_exports.string().optional().describe("Integration UUID. Either this or integration_slug is required."),
@@ -52925,10 +53020,12 @@ var LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
52925
53020
  // ENG-10276: knowledge_get is the untruncated single-entry read. The list and
52926
53021
  // search tools serve a stored SUMMARY column, not the entry, so this is the
52927
53022
  // only one that can be trusted before a knowledge_update.
53023
+ // CS-1811: knowledge_edit is the partial edit, so a small change is a small write.
52928
53024
  "knowledge_list",
52929
53025
  "knowledge_get",
52930
53026
  "knowledge_add",
52931
53027
  "knowledge_update",
53028
+ "knowledge_edit",
52932
53029
  "knowledge_delete",
52933
53030
  "integration_list",
52934
53031
  "integration_improve",
@@ -31035,6 +31035,7 @@ var MAINTENANCE_GATED_TOOLS = /* @__PURE__ */ new Set([
31035
31035
  // Knowledge.
31036
31036
  "knowledge_add",
31037
31037
  "knowledge_update",
31038
+ "knowledge_edit",
31038
31039
  "knowledge_delete",
31039
31040
  // Projects and project tagging.
31040
31041
  "projects_create",
@@ -31252,6 +31252,7 @@ var MAINTENANCE_GATED_TOOLS = /* @__PURE__ */ new Set([
31252
31252
  // Knowledge.
31253
31253
  "knowledge_add",
31254
31254
  "knowledge_update",
31255
+ "knowledge_edit",
31255
31256
  "knowledge_delete",
31256
31257
  // Projects and project tagging.
31257
31258
  "projects_create",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1202",
3
+ "version": "0.28.1204",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {