@integrity-labs/agt-cli 0.27.9-test.13 → 0.27.9-test.14

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.
Files changed (35) hide show
  1. package/dist/bin/agt.js +4 -4
  2. package/dist/chunk-354FAVQR.js +173 -0
  3. package/dist/chunk-354FAVQR.js.map +1 -0
  4. package/dist/{chunk-MQJ5DMPT.js → chunk-7GKJZBTB.js} +111 -204
  5. package/dist/chunk-7GKJZBTB.js.map +1 -0
  6. package/dist/{chunk-HR5T2RQF.js → chunk-I3YS5WFV.js} +3 -1
  7. package/dist/chunk-I3YS5WFV.js.map +1 -0
  8. package/dist/{chunk-VNIHFGA2.js → chunk-R7NKCGWN.js} +341 -46
  9. package/dist/chunk-R7NKCGWN.js.map +1 -0
  10. package/dist/{chunk-I2OTQJH3.js → chunk-WOOYOAPG.js} +2644 -2142
  11. package/dist/chunk-WOOYOAPG.js.map +1 -0
  12. package/dist/{claude-pair-runtime-F6USL3EW.js → claude-pair-runtime-GIUCD7IG.js} +2 -2
  13. package/dist/{claude-scheduler-EM24LTGV.js → claude-scheduler-FATCLHDM.js} +2 -2
  14. package/dist/daily-session-PNQX5URX.js +27 -0
  15. package/dist/lib/manager-worker.js +1125 -149
  16. package/dist/lib/manager-worker.js.map +1 -1
  17. package/dist/mcp/augmented-admin.js +21335 -0
  18. package/dist/mcp/index.js +121 -4
  19. package/dist/mcp/slack-channel.js +845 -208
  20. package/dist/mcp/teams-channel.js +73 -29
  21. package/dist/mcp/telegram-channel.js +579 -157
  22. package/dist/{persistent-session-OL5EDYB4.js → persistent-session-35PWSTLO.js} +10 -3
  23. package/dist/persistent-session-35PWSTLO.js.map +1 -0
  24. package/dist/responsiveness-probe-MA4M2QM4.js +158 -0
  25. package/dist/responsiveness-probe-MA4M2QM4.js.map +1 -0
  26. package/package.json +3 -2
  27. package/dist/chunk-HR5T2RQF.js.map +0 -1
  28. package/dist/chunk-I2OTQJH3.js.map +0 -1
  29. package/dist/chunk-MQJ5DMPT.js.map +0 -1
  30. package/dist/chunk-VNIHFGA2.js.map +0 -1
  31. package/dist/responsiveness-probe-B6LJJRUD.js +0 -74
  32. package/dist/responsiveness-probe-B6LJJRUD.js.map +0 -1
  33. /package/dist/{claude-pair-runtime-F6USL3EW.js.map → claude-pair-runtime-GIUCD7IG.js.map} +0 -0
  34. /package/dist/{claude-scheduler-EM24LTGV.js.map → claude-scheduler-FATCLHDM.js.map} +0 -0
  35. /package/dist/{persistent-session-OL5EDYB4.js.map → daily-session-PNQX5URX.js.map} +0 -0
package/dist/mcp/index.js CHANGED
@@ -21052,6 +21052,32 @@ function selectIntegrationsToRefresh(input) {
21052
21052
  });
21053
21053
  }
21054
21054
 
21055
+ // src/self-restart.ts
21056
+ import { existsSync, mkdirSync, renameSync, writeFileSync } from "fs";
21057
+ import { homedir } from "os";
21058
+ import { join } from "path";
21059
+ import { randomUUID } from "crypto";
21060
+ function restartFlagsDir() {
21061
+ return join(homedir(), ".augmented", "restart-flags");
21062
+ }
21063
+ function isSelfRestartEnabled(env) {
21064
+ const raw = (env.AGT_AGENT_SELF_RESTART_ENABLED ?? "").trim().toLowerCase();
21065
+ return raw === "true" || raw === "1";
21066
+ }
21067
+ function buildAgentRestartFlag(codeName, reason, nowMs) {
21068
+ return { codeName, source: "agent", ts: nowMs, reason };
21069
+ }
21070
+ function writeAgentRestartFlag(codeName, reason, nowMs) {
21071
+ const dir = restartFlagsDir();
21072
+ if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
21073
+ const path = join(dir, `${codeName}.flag`);
21074
+ const flag = buildAgentRestartFlag(codeName, reason, nowMs);
21075
+ const tmpPath = `${path}.${process.pid}.${randomUUID()}.tmp`;
21076
+ writeFileSync(tmpPath, JSON.stringify(flag) + "\n", "utf8");
21077
+ renameSync(tmpPath, path);
21078
+ return path;
21079
+ }
21080
+
21055
21081
  // src/index.ts
21056
21082
  import { spawn } from "child_process";
21057
21083
  var DeliveryTargetSchema = external_exports.union([
@@ -21178,7 +21204,7 @@ var server = new McpServer({
21178
21204
  });
21179
21205
  server.tool(
21180
21206
  "kanban_list",
21181
- "List kanban board items for this agent. Returns active items and recently completed items (last 7 days).",
21207
+ 'List kanban board items for this agent. Returns active items plus only the most recently completed work (last 24h). This is a NARROW, recency-windowed view \u2014 older done cards are NOT here (only done cards are windowed; failed and active cards always show). Before telling anyone you have "no record" of past work, use kanban_search, which covers your full history.',
21182
21208
  {},
21183
21209
  async () => {
21184
21210
  const data = await apiPost("/host/my-kanban", {
@@ -21205,6 +21231,52 @@ server.tool(
21205
21231
  return { content: [{ type: "text", text: lines.join("\n") }] };
21206
21232
  }
21207
21233
  );
21234
+ server.tool(
21235
+ "kanban_search",
21236
+ `Search your FULL kanban history by keyword \u2014 including done cards older than 24h that kanban_list omits. Use this BEFORE telling anyone you have "no record" of work they say you did: the board only shows the last 24h of completed cards, so "it's not on my board" does NOT mean you never did it. Each hit includes the card's result (the actual deliverable), so you can recite what you produced. An empty query returns your most recent cards across all statuses.`,
21237
+ {
21238
+ query: external_exports.string().optional().describe('Keyword to match across title, description, result, deliverable and notes (e.g. "carousels", "Caribbean Park"). Omit to get your most recent cards.'),
21239
+ status: external_exports.enum(["backlog", "todo", "in_progress", "done", "failed", "all"]).optional().describe('Restrict to one status. Default "all" searches every status \u2014 leave it unset to reach old done/failed work.'),
21240
+ since: external_exports.string().optional().describe('ISO date lower bound on created_at (e.g. "2026-06-06").'),
21241
+ until: external_exports.string().optional().describe("ISO date upper bound on created_at."),
21242
+ limit: external_exports.number().int().min(1).max(50).optional().describe("Max results (default 20, max 50).")
21243
+ },
21244
+ async (params) => {
21245
+ const data = await apiPost("/host/kanban/search", {
21246
+ agent_id: AGT_AGENT_ID,
21247
+ query: params.query,
21248
+ status: params.status,
21249
+ since: params.since,
21250
+ until: params.until,
21251
+ limit: params.limit
21252
+ });
21253
+ if (!data.items.length) {
21254
+ const scope = params.query ? `"${params.query}"` : "your history";
21255
+ return {
21256
+ content: [
21257
+ {
21258
+ type: "text",
21259
+ text: `No cards found for ${scope}. That means there is genuinely no kanban record \u2014 but check whether the work might have been delivered without a card (e.g. answered live in a channel) before concluding it never happened.`
21260
+ }
21261
+ ]
21262
+ };
21263
+ }
21264
+ const lines = [`Found ${data.items.length} card(s):`];
21265
+ for (const item of data.items) {
21266
+ const when = item.completed_at ?? item.created_at;
21267
+ const day = typeof when === "string" ? when.slice(0, 10) : "";
21268
+ const via = item.source_integration ? ` via ${item.source_integration}` : "";
21269
+ lines.push(`
21270
+ - [${item.status}${via}, ${day}] ${item.title} (id: ${item.id})`);
21271
+ if (item.deliverable) lines.push(` \u2192 ${item.deliverable}`);
21272
+ if (item.result) {
21273
+ const more = item.result_truncated ? " \u2026(result trimmed; open the card in the console for the full text)" : "";
21274
+ lines.push(` \u2713 ${item.result}${more}`);
21275
+ }
21276
+ }
21277
+ return { content: [{ type: "text", text: lines.join("\n") }] };
21278
+ }
21279
+ );
21208
21280
  server.tool(
21209
21281
  "kanban_add",
21210
21282
  "Add a new item to the kanban board.",
@@ -21218,7 +21290,10 @@ server.tool(
21218
21290
  source: external_exports.enum(["cron", "chat", "manual", "integration"]).optional().describe("Source of the item (default: manual)"),
21219
21291
  source_integration: external_exports.string().optional().describe('Integration name (e.g., "linear", "github") when source is "integration"'),
21220
21292
  source_external_id: external_exports.string().optional().describe('ID in the external system (e.g., "ENG-123")'),
21221
- source_url: external_exports.string().optional().describe("Deep link URL to the external source")
21293
+ source_url: external_exports.string().optional().describe("Deep link URL to the external source"),
21294
+ project_id: external_exports.string().uuid().optional().describe(
21295
+ "Optional project to file this task under (id from projects_list). Groups the task with related tasks/artefacts across agents. Projects are created by humans \u2014 you can tag but not create them."
21296
+ )
21222
21297
  },
21223
21298
  async (params) => {
21224
21299
  const data = await apiPost("/host/kanban", {
@@ -21235,7 +21310,8 @@ server.tool(
21235
21310
  source: params.source ?? "manual",
21236
21311
  source_integration: params.source_integration,
21237
21312
  source_external_id: params.source_external_id,
21238
- source_url: params.source_url
21313
+ source_url: params.source_url,
21314
+ project_id: params.project_id
21239
21315
  }
21240
21316
  ]
21241
21317
  });
@@ -22299,6 +22375,7 @@ async function forwardToolCall(toolName, args) {
22299
22375
  }
22300
22376
  var LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
22301
22377
  "kanban_list",
22378
+ "kanban_search",
22302
22379
  "kanban_add",
22303
22380
  "kanban_move",
22304
22381
  "kanban_update",
@@ -22336,7 +22413,12 @@ var LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
22336
22413
  // ADR-0017 Projects container (the reclaimed projects_* namespace — read-only
22337
22414
  // in v1; no projects_get_source_chunk, a project is a container not a document).
22338
22415
  "projects_list",
22339
- "projects_get"
22416
+ "projects_get",
22417
+ // ENG-6229: self-restart. Conditionally registered (dark unless
22418
+ // AGT_AGENT_SELF_RESTART_ENABLED), but the lockstep guard parses the
22419
+ // server.tool('request_restart', …) call statically, so it lives here too.
22420
+ // No API tool shares this name, so the forwarding-skip effect is a no-op.
22421
+ "request_restart"
22340
22422
  ]);
22341
22423
  async function registerForwardedApiTools() {
22342
22424
  const apiTools = await discoverApiTools();
@@ -22500,6 +22582,41 @@ server.tool(
22500
22582
  content: [{ type: "text", text: await getProjectText(params.project_id) }]
22501
22583
  })
22502
22584
  );
22585
+ if (isSelfRestartEnabled(process.env) && AGT_AGENT_CODE_NAME) {
22586
+ const codeName = AGT_AGENT_CODE_NAME;
22587
+ server.tool(
22588
+ "request_restart",
22589
+ `Request a restart of YOUR OWN session to reload a change you can see is missing but can't pick up live \u2014 e.g. a tool that should be in your registry isn't, or an integration/model was just changed. PREREQUISITE \u2014 you MUST first confirm with the human using your ask_user / channel_request_input tool (e.g. "I think I need to restart to load <reason> \u2014 restart now?") and only call request_restart after they approve. Do NOT call this unprompted or on a hunch: a restart ENDS your current session (you lose in-memory context for this conversation) and a fresh session starts in ~30s. If a restart will not plausibly fix what you observe (a structural/upstream fault), do NOT call this \u2014 tell the operator what you are missing instead. Repeated requests are circuit-broken and will pause you for an operator to clear.`,
22590
+ {
22591
+ reason: external_exports.string().min(1).max(280).describe(
22592
+ `Short description of the change you need to reload (e.g. "the Xero tools the user just added aren't in my registry"). Surfaced in the manager log; keep it specific.`
22593
+ )
22594
+ },
22595
+ async (params) => {
22596
+ try {
22597
+ writeAgentRestartFlag(codeName, params.reason, Date.now());
22598
+ } catch (err) {
22599
+ return {
22600
+ content: [
22601
+ {
22602
+ type: "text",
22603
+ text: `Could not queue the restart: ${err.message}. Tell the operator you may be missing: ${params.reason}.`
22604
+ }
22605
+ ],
22606
+ isError: true
22607
+ };
22608
+ }
22609
+ return {
22610
+ content: [
22611
+ {
22612
+ type: "text",
22613
+ text: `Restart queued \u2014 your manager will recreate this session shortly to reload: ${params.reason}. You'll come back as a fresh session in ~30s, so finish your current turn (you already told the human you're reloading). If you do NOT come back able to do the thing, the fault is structural \u2014 tell the operator rather than requesting another restart.`
22614
+ }
22615
+ ]
22616
+ };
22617
+ }
22618
+ );
22619
+ }
22503
22620
  async function main() {
22504
22621
  try {
22505
22622
  const result = await registerForwardedApiTools();