@integrity-labs/agt-cli 0.19.8 → 0.19.10

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.
@@ -12,8 +12,9 @@ import {
12
12
  startPersistentSession,
13
13
  stopAllSessions,
14
14
  stopAllSessionsAndWait,
15
- stopPersistentSession
16
- } from "./chunk-EG5D3KUV.js";
15
+ stopPersistentSession,
16
+ writePersistentClaudeWrapper
17
+ } from "./chunk-QFWR2NV5.js";
17
18
  export {
18
19
  _internals,
19
20
  collectDiagnostics,
@@ -28,6 +29,7 @@ export {
28
29
  startPersistentSession,
29
30
  stopAllSessions,
30
31
  stopAllSessionsAndWait,
31
- stopPersistentSession
32
+ stopPersistentSession,
33
+ writePersistentClaudeWrapper
32
34
  };
33
- //# sourceMappingURL=persistent-session-YEUFJMWF.js.map
35
+ //# sourceMappingURL=persistent-session-XBRQN7XE.js.map
@@ -14989,14 +14989,12 @@ function buildSlackHelpMessage(codeName) {
14989
14989
  return [
14990
14990
  `\u{1F916} *Available commands for \`${codeName}\`*`,
14991
14991
  "",
14992
- "_Type these in a thread or channel where the bot is present (intercepted by the agent):_",
14992
+ "All commands are real Slack slash commands (autocomplete via `/`). For backward compatibility, `/help` and `/restart` can also be typed as plain messages in any channel where the bot is present:",
14993
14993
  "\u2022 `/help` \u2014 show this help",
14994
14994
  "\u2022 `/restart` \u2014 restart this agent",
14995
- "",
14996
- "_Real Slack slash commands (also discoverable via `/`-autocomplete):_",
14995
+ "\u2022 `/agent-status` \u2014 report whether this agent is online + last activity",
14997
14996
  "\u2022 `/kill` \u2014 silence all agents in this thread for 6h (use as a thread reply)",
14998
- "\u2022 `/unkill` \u2014 clear a kill (use as a thread reply)",
14999
- "\u2022 `/agent-status` \u2014 report whether this agent is online + last activity"
14997
+ "\u2022 `/unkill` \u2014 clear a kill (use as a thread reply)"
15000
14998
  ].join("\n");
15001
14999
  }
15002
15000
  var lastActivityAt = null;
@@ -15094,6 +15092,70 @@ async function handleSlashCommandEnvelope(payload) {
15094
15092
  await postEphemeralViaResponseUrl(responseUrl, buildAgentStatusReply(codeName), codeName);
15095
15093
  return;
15096
15094
  }
15095
+ if (command === "/help") {
15096
+ await postEphemeralViaResponseUrl(responseUrl, buildSlackHelpMessage(codeName), codeName);
15097
+ return;
15098
+ }
15099
+ if (command === "/restart") {
15100
+ if (ALLOWED_USERS.size > 0 && (!payload.user_id || !ALLOWED_USERS.has(payload.user_id))) {
15101
+ process.stderr.write(
15102
+ `slack-channel(${codeName}): /restart slash-command denied \u2014 user not in SLACK_ALLOWED_USERS
15103
+ `
15104
+ );
15105
+ await postEphemeralViaResponseUrl(
15106
+ responseUrl,
15107
+ `\u{1F6AB} \`/restart\` denied \u2014 your Slack user is not in the allowlist for \`${codeName}\`.`,
15108
+ codeName
15109
+ );
15110
+ return;
15111
+ }
15112
+ if (!payload.channel_id) {
15113
+ await postEphemeralViaResponseUrl(
15114
+ responseUrl,
15115
+ `:warning: \`/restart\` needs a channel context \u2014 invoke it inside a channel or DM where \`${codeName}\` is present.`,
15116
+ codeName
15117
+ );
15118
+ return;
15119
+ }
15120
+ try {
15121
+ if (!existsSync(RESTART_FLAGS_DIR)) {
15122
+ mkdirSync2(RESTART_FLAGS_DIR, { recursive: true });
15123
+ }
15124
+ const flagPath = join2(RESTART_FLAGS_DIR, `${codeName}.flag`);
15125
+ const flag = {
15126
+ codeName,
15127
+ source: "slack",
15128
+ ts: Date.now(),
15129
+ reply: {
15130
+ channel: payload.channel_id,
15131
+ ...payload.thread_ts ? { thread_ts: payload.thread_ts } : {}
15132
+ }
15133
+ };
15134
+ const tmpPath = `${flagPath}.${process.pid}.${randomUUID()}.tmp`;
15135
+ writeFileSync2(tmpPath, JSON.stringify(flag) + "\n", "utf8");
15136
+ renameSync(tmpPath, flagPath);
15137
+ process.stderr.write(
15138
+ `slack-channel(${codeName}): /restart slash-command queued from channel ${hashChannelId(payload.channel_id)}
15139
+ `
15140
+ );
15141
+ await postEphemeralViaResponseUrl(
15142
+ responseUrl,
15143
+ `\u23F3 Restart queued for \`${codeName}\`. The session will reconnect in a few seconds.`,
15144
+ codeName
15145
+ );
15146
+ } catch (err) {
15147
+ process.stderr.write(
15148
+ `slack-channel(${codeName}): /restart slash-command flag write failed: ${redactAugmentedPaths(err.message)}
15149
+ `
15150
+ );
15151
+ await postEphemeralViaResponseUrl(
15152
+ responseUrl,
15153
+ `\u274C Failed to queue restart for \`${codeName}\`. Please try again in a few seconds.`,
15154
+ codeName
15155
+ );
15156
+ }
15157
+ return;
15158
+ }
15097
15159
  if (command === "/kill" || command === "/unkill") {
15098
15160
  if (!AGT_HOST || !AGT_API_KEY || !AGT_AGENT_ID) {
15099
15161
  await postEphemeralViaResponseUrl(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.19.8",
3
+ "version": "0.19.10",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {