@integrity-labs/agt-cli 0.28.1202 → 0.28.1203

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-IXPDHCIL.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.1203" : "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.1203" : "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.1203" : "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-IXPDHCIL.js.map
@@ -85,7 +85,7 @@ import {
85
85
  tripClass,
86
86
  writeEtcEnvironment,
87
87
  writeProfileDScript
88
- } from "../chunk-QYYXOM23.js";
88
+ } from "../chunk-IXPDHCIL.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.1203" : "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
@@ -36874,6 +36874,32 @@ function resolveHostFilePath(toolName, args, opts) {
36874
36874
  }
36875
36875
  }
36876
36876
 
36877
+ // src/knowledge-edit-result.ts
36878
+ function formatKnowledgeEditResult(id, data) {
36879
+ const report = data.edits?.[0];
36880
+ if (data.updated !== 1 || !report) {
36881
+ const reason = data.errors?.[0] ?? "the server did not confirm the edit";
36882
+ return { text: `Failed to edit knowledge entry ${id}: ${reason}. Nothing was changed.`, isError: true };
36883
+ }
36884
+ const delta = report.length - report.previous_length;
36885
+ const lines = [
36886
+ `Edited knowledge entry ${report.id} (${report.op}): ${report.previous_length} -> ${report.length} chars (${delta >= 0 ? "+" : ""}${delta}).`,
36887
+ `sha256 before: ${report.previous_sha256}`,
36888
+ `sha256 after: ${report.sha256}`,
36889
+ "Text around the change, as now stored:",
36890
+ "<<<",
36891
+ report.context,
36892
+ ">>>"
36893
+ ];
36894
+ const warnings = data.errors ?? [];
36895
+ if (warnings.length > 0) {
36896
+ lines.push(
36897
+ `The edit WAS saved; do not repeat it. The server also reported: ${warnings.join("; ")}`
36898
+ );
36899
+ }
36900
+ return { text: lines.join("\n"), isError: false };
36901
+ }
36902
+
36877
36903
  // src/artefact-work-dir.ts
36878
36904
  import { mkdir, mkdtemp } from "fs/promises";
36879
36905
  import { existsSync } from "fs";
@@ -47488,6 +47514,7 @@ var MAINTENANCE_GATED_TOOLS = /* @__PURE__ */ new Set([
47488
47514
  // Knowledge.
47489
47515
  "knowledge_add",
47490
47516
  "knowledge_update",
47517
+ "knowledge_edit",
47491
47518
  "knowledge_delete",
47492
47519
  // Projects and project tagging.
47493
47520
  "projects_create",
@@ -52276,7 +52303,9 @@ server.tool(
52276
52303
  const header2 = [
52277
52304
  `# ${k.title}`,
52278
52305
  `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}`
52306
+ `length: ${k.full_length} chars \xB7 source: ${k.source_type ?? "unknown"}${k.source_url ? ` (${k.source_url})` : ""} \xB7 updated: ${k.updated_at}`,
52307
+ // CS-1811: an older API sends no hash; say nothing rather than a blank.
52308
+ ...k.content_sha256 ? [`sha256: ${k.content_sha256} (knowledge_edit reports the hash before and after its write)`] : []
52280
52309
  ];
52281
52310
  if (k.truncated) {
52282
52311
  header2.push(
@@ -52430,7 +52459,7 @@ server.tool(
52430
52459
  );
52431
52460
  server.tool(
52432
52461
  "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.",
52462
+ "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
52463
  {
52435
52464
  id: external_exports.string().describe("Knowledge entry id (uuid) \u2014 from knowledge_list or knowledge_add"),
52436
52465
  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 +52496,41 @@ server.tool(
52467
52496
  return { content: [{ type: "text", text: `Updated knowledge entry ${params.id}.` }] };
52468
52497
  }
52469
52498
  );
52499
+ server.tool(
52500
+ "knowledge_edit",
52501
+ "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.",
52502
+ {
52503
+ id: external_exports.string().describe("Knowledge entry id (uuid), from knowledge_list or knowledge_get"),
52504
+ 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).'),
52505
+ append: external_exports.string().optional().describe("Text to add to the end of the entry, verbatim. Mutually exclusive with replace_find."),
52506
+ replace_find: external_exports.string().optional().describe("The exact passage to replace. Must occur exactly once in the entry."),
52507
+ replace_with: external_exports.string().optional().describe("What replace_find becomes. Required with replace_find; may be empty to delete it.")
52508
+ },
52509
+ async (params) => {
52510
+ const isReplace = params.replace_find !== void 0 || params.replace_with !== void 0;
52511
+ if (params.append !== void 0 === isReplace) {
52512
+ return {
52513
+ content: [{ type: "text", text: "Error: knowledge_edit needs exactly one of append, or replace_find with replace_with." }],
52514
+ isError: true
52515
+ };
52516
+ }
52517
+ if (isReplace && (params.replace_find === void 0 || params.replace_with === void 0)) {
52518
+ return {
52519
+ content: [{ type: "text", text: "Error: replace_find and replace_with go together. To delete a passage, pass replace_with as an empty string." }],
52520
+ isError: true
52521
+ };
52522
+ }
52523
+ const data = await apiPost("/host/knowledge", {
52524
+ agent_id: AGT_AGENT_ID,
52525
+ scope: params.scope ?? "team",
52526
+ update: [
52527
+ isReplace ? { id: params.id, replace: { find: params.replace_find, with: params.replace_with } } : { id: params.id, append: params.append }
52528
+ ]
52529
+ });
52530
+ const result = formatKnowledgeEditResult(params.id, data);
52531
+ return { content: [{ type: "text", text: result.text }], ...result.isError ? { isError: true } : {} };
52532
+ }
52533
+ );
52470
52534
  server.tool(
52471
52535
  "knowledge_delete",
52472
52536
  "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.",
@@ -52925,10 +52989,12 @@ var LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
52925
52989
  // ENG-10276: knowledge_get is the untruncated single-entry read. The list and
52926
52990
  // search tools serve a stored SUMMARY column, not the entry, so this is the
52927
52991
  // only one that can be trusted before a knowledge_update.
52992
+ // CS-1811: knowledge_edit is the partial edit, so a small change is a small write.
52928
52993
  "knowledge_list",
52929
52994
  "knowledge_get",
52930
52995
  "knowledge_add",
52931
52996
  "knowledge_update",
52997
+ "knowledge_edit",
52932
52998
  "knowledge_delete",
52933
52999
  "integration_list",
52934
53000
  "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.1203",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {