@integrity-labs/agt-cli 0.28.1286 → 0.28.1288

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.
@@ -15,7 +15,7 @@ import {
15
15
  mintRotatedHostKey,
16
16
  probeHostKey,
17
17
  setConfigHash
18
- } from "./chunk-3R7OXS5I.js";
18
+ } from "./chunk-Z7T5B4ES.js";
19
19
  import "./chunk-DITI25ZO.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
@@ -36,4 +36,4 @@ export {
36
36
  probeHostKey,
37
37
  setConfigHash
38
38
  };
39
- //# sourceMappingURL=api-client-XQRYQJKJ.js.map
39
+ //# sourceMappingURL=api-client-ONUS5KBY.js.map
package/dist/bin/agt.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  success,
32
32
  table,
33
33
  warn
34
- } from "../chunk-TTEBS4AE.js";
34
+ } from "../chunk-KWGJU7EK.js";
35
35
  import {
36
36
  ApiError,
37
37
  PROD_AGT_HOST,
@@ -42,7 +42,7 @@ import {
42
42
  getHost,
43
43
  getHostId,
44
44
  setActiveTeam
45
- } from "../chunk-3R7OXS5I.js";
45
+ } from "../chunk-Z7T5B4ES.js";
46
46
  import {
47
47
  getProjectDir,
48
48
  isSessionResumeDisabled,
@@ -5207,7 +5207,7 @@ import { execFileSync, execSync } from "child_process";
5207
5207
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
5208
5208
  import chalk17 from "chalk";
5209
5209
  import ora15 from "ora";
5210
- var cliVersion = true ? "0.28.1286" : "dev";
5210
+ var cliVersion = true ? "0.28.1288" : "dev";
5211
5211
  async function fetchLatestVersion() {
5212
5212
  const host2 = getHost();
5213
5213
  if (!host2) return null;
@@ -6467,7 +6467,7 @@ function handleError(err) {
6467
6467
  }
6468
6468
 
6469
6469
  // src/bin/agt.ts
6470
- var cliVersion2 = true ? "0.28.1286" : "dev";
6470
+ var cliVersion2 = true ? "0.28.1288" : "dev";
6471
6471
  var program = new Command();
6472
6472
  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");
6473
6473
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -2,7 +2,7 @@ import {
2
2
  exchangeApiKey,
3
3
  getApiKey,
4
4
  getHost
5
- } from "./chunk-3R7OXS5I.js";
5
+ } from "./chunk-Z7T5B4ES.js";
6
6
  import {
7
7
  LATE_BOUND_VARS,
8
8
  PLATFORM_DENY_PERMISSIONS,
@@ -13853,4 +13853,4 @@ export {
13853
13853
  managerInstallSystemUnitCommand,
13854
13854
  managerUninstallSystemUnitCommand
13855
13855
  };
13856
- //# sourceMappingURL=chunk-TTEBS4AE.js.map
13856
+ //# sourceMappingURL=chunk-KWGJU7EK.js.map
@@ -103,7 +103,7 @@ function exchangeFailureKind(err) {
103
103
  }
104
104
 
105
105
  // src/lib/api-client.ts
106
- var agtCliVersion = true ? "0.28.1286" : "dev";
106
+ var agtCliVersion = true ? "0.28.1288" : "dev";
107
107
  var lastConfigHash = null;
108
108
  function setConfigHash(hash) {
109
109
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -468,4 +468,4 @@ export {
468
468
  api,
469
469
  getHostId
470
470
  };
471
- //# sourceMappingURL=chunk-3R7OXS5I.js.map
471
+ //# sourceMappingURL=chunk-Z7T5B4ES.js.map
@@ -70,7 +70,7 @@ import {
70
70
  tripClass,
71
71
  writeEtcEnvironment,
72
72
  writeProfileDScript
73
- } from "../chunk-TTEBS4AE.js";
73
+ } from "../chunk-KWGJU7EK.js";
74
74
  import {
75
75
  ApiError,
76
76
  adoptHostKeyInProcess,
@@ -88,7 +88,7 @@ import {
88
88
  probeHostKey,
89
89
  requireHost,
90
90
  setConfigHash
91
- } from "../chunk-3R7OXS5I.js";
91
+ } from "../chunk-Z7T5B4ES.js";
92
92
  import {
93
93
  BLOCKED_ON_PROMPT_DECISION,
94
94
  CHANNEL_SECRET_ENV_KEYS,
@@ -15444,7 +15444,7 @@ function createFileMigrationReportIO(codeName, log2) {
15444
15444
  };
15445
15445
  }
15446
15446
  var managerHostPost = async (path, body) => {
15447
- const { api: api2, ApiError: ApiError3 } = await import("../api-client-XQRYQJKJ.js");
15447
+ const { api: api2, ApiError: ApiError3 } = await import("../api-client-ONUS5KBY.js");
15448
15448
  try {
15449
15449
  const json = await api2.post(path, body);
15450
15450
  return { status: 200, json };
@@ -18380,7 +18380,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
18380
18380
  var lastVersionCheckAt = 0;
18381
18381
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
18382
18382
  var lastResponsivenessProbeAt = 0;
18383
- var agtCliVersion = true ? "0.28.1286" : "dev";
18383
+ var agtCliVersion = true ? "0.28.1288" : "dev";
18384
18384
  function resolveBrewPath(execFileSync5) {
18385
18385
  try {
18386
18386
  const out = execFileSync5("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -55698,6 +55698,7 @@ var MAINTENANCE_GATED_TOOLS = /* @__PURE__ */ new Set([
55698
55698
  "request_form",
55699
55699
  "request_reconnect",
55700
55700
  "request_feature",
55701
+ "request_support",
55701
55702
  "request_feature_withdraw",
55702
55703
  // ADR-0025 approval tools, registered by `approval-tools.ts` against the same
55703
55704
  // server object, so the wrapper in index.ts covers them too.
package/dist/mcp/index.js CHANGED
@@ -48660,6 +48660,7 @@ var MAINTENANCE_GATED_TOOLS = /* @__PURE__ */ new Set([
48660
48660
  "request_form",
48661
48661
  "request_reconnect",
48662
48662
  "request_feature",
48663
+ "request_support",
48663
48664
  "request_feature_withdraw",
48664
48665
  // ADR-0025 approval tools, registered by `approval-tools.ts` against the same
48665
48666
  // server object, so the wrapper in index.ts covers them too.
@@ -49983,14 +49984,25 @@ function isInContainer(env2 = process.env) {
49983
49984
  }
49984
49985
 
49985
49986
  // src/feature-request.ts
49986
- var FEATURE_REQUEST_TYPES = [
49987
- "integration",
49988
- "tool",
49989
- "channel",
49990
- "capability",
49991
- "bug",
49992
- "other"
49993
- ];
49987
+ var NEW_CAPABILITY_TYPES = ["integration", "tool", "channel", "capability", "other"];
49988
+ var SUPPORT_REQUEST_FEATURE_TYPE = "bug";
49989
+ var SUPPORT_CHANNEL_LINE = "This is how you reach Ninjafy support: never email Ninjafy staff or ask the customer for a support address.";
49990
+ var REQUESTER_LINE = "Say who it is for: pass requester_email of the person who asked (only with their consent) or their requester_user_id, so Ninjafy can reply to them; if there is no one to reply to, pass no_requester_reason instead. One of the two is required.";
49991
+ var REQUEST_FEATURE_DESCRIPTION = 'Ask Ninjafy (formerly Augmented Team, the same platform) for a NEW capability you do not have and cannot set up yourself: most often a new third-party integration (feature_type="integration", service name in provider), or a new tool, channel or product capability. If something you already have is broken or erroring, use request_support instead. ' + SUPPORT_CHANNEL_LINE + " " + REQUESTER_LINE;
49992
+ var REQUEST_SUPPORT_DESCRIPTION = "Tell Ninjafy (formerly Augmented Team) support that something you already have is not working: an integration or tool that keeps erroring (e.g. a 403 scope error after a reconnect), a platform fault, or behaviour that is plainly wrong. For a NEW capability use request_feature instead; for expired credentials call request_reconnect first. " + SUPPORT_CHANNEL_LINE + " Check request_feature_list first: support requests show there too. " + REQUESTER_LINE;
49993
+ function intakeRequestBody(agentCodeName, featureType, params) {
49994
+ return {
49995
+ agent_code_name: agentCodeName,
49996
+ feature_type: featureType,
49997
+ title: params.title,
49998
+ description: params.description,
49999
+ ...params.provider ? { provider: params.provider } : {},
50000
+ ...params.requester_email ? { requester_email: params.requester_email } : {},
50001
+ ...params.requester_user_id ? { requester_user_id: params.requester_user_id } : {},
50002
+ ...params.no_requester_reason ? { no_requester_reason: params.no_requester_reason } : {},
50003
+ ...params.acknowledged_catalogue_alternative ? { acknowledged_catalogue_alternative: true } : {}
50004
+ };
50005
+ }
49994
50006
  var NO_REQUESTER_REASONS = [
49995
50007
  "agent_initiated",
49996
50008
  "requester_declined_contact",
@@ -50008,10 +50020,11 @@ function requesterChoiceError(args) {
50008
50020
  }
50009
50021
  return null;
50010
50022
  }
50011
- function describeFeatureRequestResult(resp) {
50023
+ function describeFeatureRequestResult(resp, kind = "feature") {
50024
+ const noun = kind === "support" ? "support request" : "feature request";
50012
50025
  if (resp.status === "created") {
50013
50026
  return {
50014
- text: "Feature request submitted to Ninjafy support.",
50027
+ text: `${noun.charAt(0).toUpperCase()}${noun.slice(1)} submitted to Ninjafy support.`,
50015
50028
  isError: false
50016
50029
  };
50017
50030
  }
@@ -50022,7 +50035,7 @@ function describeFeatureRequestResult(resp) {
50022
50035
  };
50023
50036
  }
50024
50037
  return {
50025
- text: `Could not submit the feature request${resp.message ? `: ${resp.message}` : ""}. Tell your operator what you need and don't keep retrying.`,
50038
+ text: `Could not submit the ${noun}${resp.message ? `: ${resp.message}` : ""}. Tell your operator what you need and don't keep retrying.`,
50026
50039
  isError: true
50027
50040
  };
50028
50041
  }
@@ -52249,10 +52262,10 @@ server.tool(
52249
52262
  );
52250
52263
  server.tool(
52251
52264
  "request_feature",
52252
- 'Send a feature request to Ninjafy support (formerly Augmented Team \u2014 the same platform either way, so use this whichever name the user says) \u2014 most often to ask for a NEW third-party integration that is not in your toolkit yet (set feature_type="integration" and put the service name in provider). Also accepts general product feedback (other feature_type values). Use this when a user needs a capability you do not have and that you cannot configure yourself. Do not use it for things you can already do or set up. Say who the request is for: pass the requester_email of the person who asked (only with their consent) or their requester_user_id, so Ninjafy can reply to them; if there is no one to reply to, pass no_requester_reason instead. One of the two is required.',
52265
+ REQUEST_FEATURE_DESCRIPTION,
52253
52266
  {
52254
- feature_type: external_exports.enum(FEATURE_REQUEST_TYPES).describe(
52255
- 'What kind of request this is. Use "integration" to ask for a new third-party integration/toolkit; otherwise: tool, channel, capability, bug, or other.'
52267
+ feature_type: external_exports.enum(NEW_CAPABILITY_TYPES).describe(
52268
+ 'What kind of request this is. Use "integration" to ask for a new third-party integration/toolkit; otherwise: tool, channel, capability, or other. Something broken is not a feature: use request_support.'
52256
52269
  ),
52257
52270
  title: external_exports.string().min(1).max(200).describe('Short, specific summary of the request (e.g. "Add Notion integration").'),
52258
52271
  description: external_exports.string().min(1).max(4e3).describe(
@@ -52285,17 +52298,10 @@ server.tool(
52285
52298
  }
52286
52299
  let resp;
52287
52300
  try {
52288
- resp = await apiPost("/host/request-feature", {
52289
- agent_code_name: AGT_AGENT_CODE_NAME,
52290
- feature_type: params.feature_type,
52291
- title: params.title,
52292
- description: params.description,
52293
- ...params.provider ? { provider: params.provider } : {},
52294
- ...params.requester_email ? { requester_email: params.requester_email } : {},
52295
- ...params.requester_user_id ? { requester_user_id: params.requester_user_id } : {},
52296
- ...params.no_requester_reason ? { no_requester_reason: params.no_requester_reason } : {},
52297
- ...params.acknowledged_catalogue_alternative ? { acknowledged_catalogue_alternative: true } : {}
52298
- });
52301
+ resp = await apiPost(
52302
+ "/host/request-feature",
52303
+ intakeRequestBody(AGT_AGENT_CODE_NAME, params.feature_type, params)
52304
+ );
52299
52305
  } catch (err) {
52300
52306
  return {
52301
52307
  content: [
@@ -52311,6 +52317,52 @@ server.tool(
52311
52317
  return { content: [{ type: "text", text }], ...isError ? { isError: true } : {} };
52312
52318
  }
52313
52319
  );
52320
+ server.tool(
52321
+ "request_support",
52322
+ REQUEST_SUPPORT_DESCRIPTION,
52323
+ {
52324
+ title: external_exports.string().min(1).max(200).describe('Short, specific summary of what is broken (e.g. "Zoho Desk KB calls return 403 SCOPE_MISMATCH").'),
52325
+ description: external_exports.string().min(1).max(4e3).describe(
52326
+ "What is failing and since when: the tool or integration, the exact error, what you were trying to do, and what you or your operator already tried."
52327
+ ),
52328
+ requester_email: external_exports.string().email().max(320).optional().describe(
52329
+ "The email address of the person affected, so Ninjafy can email them when it is resolved. Only an address they gave you and agreed to be contacted at; never guess one."
52330
+ ),
52331
+ requester_user_id: external_exports.string().uuid().optional().describe("Ninjafy user id (UUID) of the person affected, when you have an id but not an address."),
52332
+ no_requester_reason: external_exports.enum(NO_REQUESTER_REASONS).optional().describe(NO_REQUESTER_REASON_DESCRIPTION)
52333
+ },
52334
+ async (params) => {
52335
+ const choiceError = requesterChoiceError(params);
52336
+ if (choiceError) {
52337
+ return { content: [{ type: "text", text: choiceError }], isError: true };
52338
+ }
52339
+ if (!AGT_AGENT_CODE_NAME) {
52340
+ return {
52341
+ content: [{ type: "text", text: "Error: AGT_AGENT_CODE_NAME not configured." }],
52342
+ isError: true
52343
+ };
52344
+ }
52345
+ let resp;
52346
+ try {
52347
+ resp = await apiPost(
52348
+ "/host/request-feature",
52349
+ intakeRequestBody(AGT_AGENT_CODE_NAME, SUPPORT_REQUEST_FEATURE_TYPE, params)
52350
+ );
52351
+ } catch (err) {
52352
+ return {
52353
+ content: [
52354
+ {
52355
+ type: "text",
52356
+ text: `Could not reach Ninjafy support (${err instanceof Error ? err.message : String(err)}). Tell your operator what is broken; do not email Ninjafy staff.`
52357
+ }
52358
+ ],
52359
+ isError: true
52360
+ };
52361
+ }
52362
+ const { text, isError } = describeFeatureRequestResult(resp, "support");
52363
+ return { content: [{ type: "text", text }], ...isError ? { isError: true } : {} };
52364
+ }
52365
+ );
52314
52366
  server.tool(
52315
52367
  "request_feature_list",
52316
52368
  'List the feature requests your TEAM has already sent to Ninjafy support with request_feature, newest first. Call this BEFORE request_feature so you do not file a duplicate: each entry shows the full request body as it was submitted (never a preview), its current state (open, in_progress, resolved, closed, or unknown), and whether you or a teammate filed it. "closed" means it was declined or merged into another request; "unknown" means the status could not be read, not that it is open. Requests filed before this tool existed show their title but no body. Support ticket numbers and links are internal and are never shown. A request whose record failed to save when it was filed cannot appear here, so an empty list is strong evidence, not proof, that nothing was asked.',
@@ -54459,6 +54511,9 @@ var LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
54459
54511
  // this name, so the forwarding-skip is a no-op; listed here to keep the
54460
54512
  // lockstep guard green.
54461
54513
  "request_feature",
54514
+ // ENG-12299: the problem-report sibling of request_feature (always
54515
+ // registered). No API tool shares this name; listed for the lockstep guard.
54516
+ "request_support",
54462
54517
  // ENG-10427: the read half of request_feature (always registered). No API tool
54463
54518
  // shares this name; listed here to keep the lockstep guard green.
54464
54519
  "request_feature_list",
@@ -31086,6 +31086,7 @@ var MAINTENANCE_GATED_TOOLS = /* @__PURE__ */ new Set([
31086
31086
  "request_form",
31087
31087
  "request_reconnect",
31088
31088
  "request_feature",
31089
+ "request_support",
31089
31090
  "request_feature_withdraw",
31090
31091
  // ADR-0025 approval tools, registered by `approval-tools.ts` against the same
31091
31092
  // server object, so the wrapper in index.ts covers them too.
@@ -47833,6 +47834,28 @@ function textMentionsBot(text, botId) {
47833
47834
  return text.includes(`<@${botId}>`);
47834
47835
  }
47835
47836
 
47837
+ // src/slack-thread-follow.ts
47838
+ function trackingForBotPost(input) {
47839
+ if (input.followMode === "off") return null;
47840
+ if (!input.channel) return null;
47841
+ const threadTs = input.landedThreadTs || input.postedTs;
47842
+ if (!threadTs) return null;
47843
+ return {
47844
+ channel: input.channel,
47845
+ threadTs,
47846
+ involvement: input.landedThreadTs ? "mentioned" : "started",
47847
+ botPosted: true
47848
+ };
47849
+ }
47850
+ function threadReplyGate(followMode, involvement) {
47851
+ if (followMode === "off") return { deliver: false, reason: "auto_follow_off" };
47852
+ if (!involvement) return { deliver: false, reason: "thread_not_tracked" };
47853
+ if (followMode === "started" && involvement !== "started") {
47854
+ return { deliver: false, reason: "started_mode_not_started" };
47855
+ }
47856
+ return { deliver: true };
47857
+ }
47858
+
47836
47859
  // src/mcp-spawn-lock.ts
47837
47860
  import {
47838
47861
  existsSync as existsSync9,
@@ -51022,6 +51045,10 @@ function rememberThread(channel, threadTs, involvement, opts = {}) {
51022
51045
  threadPersister?.schedule(trackedThreads);
51023
51046
  }
51024
51047
  }
51048
+ function trackBotPost(channel, landedThreadTs, postedTs) {
51049
+ const t = trackingForBotPost({ followMode: THREAD_AUTO_FOLLOW, channel, landedThreadTs, postedTs });
51050
+ if (t) rememberThread(t.channel, t.threadTs, t.involvement, { botPosted: t.botPosted });
51051
+ }
51025
51052
  if (!BOT_TOKEN || !APP_TOKEN) {
51026
51053
  console.error(
51027
51054
  "slack-channel: Missing SLACK_BOT_TOKEN or SLACK_APP_TOKEN. Cannot start."
@@ -52175,6 +52202,7 @@ ${result.formatted}` : "No messages in range, or the bot is not a member of this
52175
52202
  if (channel && thread_ts) {
52176
52203
  clearPendingMessage(channel, thread_ts);
52177
52204
  }
52205
+ trackBotPost(channel, thread_ts, void 0);
52178
52206
  const permalink = step3Data.files?.[0]?.permalink;
52179
52207
  return {
52180
52208
  content: [{
@@ -52527,6 +52555,7 @@ async function handleSendStructured(args) {
52527
52555
  return errResult(`Slack chat.postMessage failed: ${result.error ?? "unknown"}`);
52528
52556
  }
52529
52557
  if (effectiveThreadTs) clearPendingMessage(channel, effectiveThreadTs);
52558
+ trackBotPost(channel, effectiveThreadTs, result.ts);
52530
52559
  if (interactiveHostAvailable()) {
52531
52560
  const cfg = {
52532
52561
  apiHost: AGT_HOST,
@@ -52620,6 +52649,7 @@ async function handleAskUser(args) {
52620
52649
  if (!slackResult.ok || !slackResult.ts) {
52621
52650
  return errResult(`Slack chat.postMessage failed: ${slackResult.error ?? "unknown"}`);
52622
52651
  }
52652
+ trackBotPost(channel, thread_ts, slackResult.ts);
52623
52653
  try {
52624
52654
  await runtime.updatePendingInteractionMessageTs(cfg, callbackId, slackResult.ts);
52625
52655
  } catch (err) {
@@ -52732,6 +52762,8 @@ async function handleChannelRequestInput(args) {
52732
52762
  );
52733
52763
  }
52734
52764
  const callbackId = dispatchPayload.callback_id;
52765
+ const requestThread = parseThreadKey(thread_id);
52766
+ if (requestThread) trackBotPost(requestThread.channel, requestThread.threadTs, void 0);
52735
52767
  const deadline = new Date(Date.now() + timeoutSec * 1e3);
52736
52768
  const resolution = await waitForResolution2(cfg, callbackId, { deadline });
52737
52769
  if (resolution.kind === "timeout") {
@@ -53616,17 +53648,10 @@ async function connectSocketMode() {
53616
53648
  })
53617
53649
  );
53618
53650
  };
53619
- if (THREAD_AUTO_FOLLOW === "off") {
53620
- logThreadDrop("auto_follow_off");
53621
- return;
53622
- }
53623
53651
  const threadInvolvement = threadKey ? trackedThreads.get(threadKey)?.involvement : void 0;
53624
- if (!threadInvolvement) {
53625
- logThreadDrop("thread_not_tracked");
53626
- return;
53627
- }
53628
- if (THREAD_AUTO_FOLLOW === "started" && threadInvolvement !== "started") {
53629
- logThreadDrop("started_mode_not_started");
53652
+ const gate = threadReplyGate(THREAD_AUTO_FOLLOW, threadInvolvement);
53653
+ if (!gate.deliver) {
53654
+ logThreadDrop(gate.reason);
53630
53655
  return;
53631
53656
  }
53632
53657
  } else {
@@ -31563,6 +31563,7 @@ var MAINTENANCE_GATED_TOOLS = /* @__PURE__ */ new Set([
31563
31563
  "request_form",
31564
31564
  "request_reconnect",
31565
31565
  "request_feature",
31566
+ "request_support",
31566
31567
  "request_feature_withdraw",
31567
31568
  // ADR-0025 approval tools, registered by `approval-tools.ts` against the same
31568
31569
  // server object, so the wrapper in index.ts covers them too.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1286",
3
+ "version": "0.28.1288",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {