@integrity-labs/agt-cli 0.28.191 → 0.28.193

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.
@@ -6994,6 +6994,7 @@ __export(slack_block_kit_runtime_exports, {
6994
6994
  generateOptionToken: () => generateOptionToken,
6995
6995
  recordSlackDelivery: () => recordSlackDelivery,
6996
6996
  resolveInteractive: () => resolveInteractive,
6997
+ submitInteractive: () => submitInteractive,
6997
6998
  updatePendingInteractionMessageTs: () => updatePendingInteractionMessageTs,
6998
6999
  validateAskUserOptions: () => validateAskUserOptions,
6999
7000
  validateSlackBlocks: () => validateSlackBlocks,
@@ -7165,13 +7166,28 @@ async function resolveInteractive(cfg, input) {
7165
7166
  token: input.token,
7166
7167
  responded_by_user: input.respondedByUser,
7167
7168
  response_url: input.responseUrl,
7168
- original_blocks: input.originalBlocks
7169
+ original_blocks: input.originalBlocks,
7170
+ trigger_id: input.triggerId
7169
7171
  });
7170
7172
  if (!res.ok) {
7171
7173
  const body = await res.text().catch(() => "");
7172
7174
  throw new Error(`resolveInteractive failed (${res.status}): ${body.slice(0, 200)}`);
7173
7175
  }
7174
7176
  }
7177
+ async function submitInteractive(cfg, input) {
7178
+ const res = await apiCall(cfg, "POST", "/host/interactive/submit", {
7179
+ agent_id: cfg.agentId,
7180
+ callback_id: input.callbackId,
7181
+ state_values: input.stateValues,
7182
+ responded_by_user: input.respondedByUser
7183
+ });
7184
+ if (!res.ok) {
7185
+ const body = await res.text().catch(() => "");
7186
+ throw new Error(`submitInteractive failed (${res.status}): ${body.slice(0, 200)}`);
7187
+ }
7188
+ const json = await res.json().catch(() => ({}));
7189
+ return json.response_action === "errors" ? { action: "errors", errors: json.errors ?? {} } : { action: "close" };
7190
+ }
7175
7191
  async function recordSlackDelivery(cfg, input) {
7176
7192
  const res = await apiCall(
7177
7193
  cfg,
@@ -21040,7 +21056,8 @@ async function connectSocketMode() {
21040
21056
  ws.onmessage = async (event) => {
21041
21057
  try {
21042
21058
  const msg = JSON.parse(String(event.data));
21043
- if (msg.envelope_id) {
21059
+ const isViewSubmission = msg.type === "interactive" && msg.payload?.type === "view_submission";
21060
+ if (msg.envelope_id && !isViewSubmission) {
21044
21061
  ws.send(JSON.stringify({ envelope_id: msg.envelope_id }));
21045
21062
  }
21046
21063
  if (msg.type === "slash_commands" && msg.payload?.command) {
@@ -21074,12 +21091,62 @@ async function connectSocketMode() {
21074
21091
  token: decoded.token,
21075
21092
  respondedByUser: msg.payload.user?.id,
21076
21093
  originalBlocks: msg.payload.message?.blocks,
21077
- responseUrl: msg.payload.response_url
21094
+ responseUrl: msg.payload.response_url,
21095
+ // ENG-7170: needed by the resolver's form_request branch to
21096
+ // open the modal via views.open (ignored for other kinds).
21097
+ triggerId: msg.payload.trigger_id
21078
21098
  }
21079
21099
  );
21080
21100
  } catch (err) {
21081
21101
  process.stderr.write(
21082
21102
  `slack-channel(${AGENT_CODE_NAME}): resolveInteractive failed for ${hashId(decoded.callbackId)}: ${err.message}
21103
+ `
21104
+ );
21105
+ }
21106
+ return;
21107
+ }
21108
+ if (msg.type === "interactive" && msg.payload?.type === "view_submission") {
21109
+ const ackEmpty = () => {
21110
+ if (msg.envelope_id) ws.send(JSON.stringify({ envelope_id: msg.envelope_id }));
21111
+ };
21112
+ if (!forwardingHostAvailable()) {
21113
+ ackEmpty();
21114
+ return;
21115
+ }
21116
+ const view = msg.payload.view;
21117
+ const callbackId = view?.callback_id || view?.private_metadata;
21118
+ if (!callbackId) {
21119
+ ackEmpty();
21120
+ return;
21121
+ }
21122
+ try {
21123
+ const runtime = await Promise.resolve().then(() => (init_slack_block_kit_runtime(), slack_block_kit_runtime_exports));
21124
+ const result = await runtime.submitInteractive(
21125
+ {
21126
+ apiHost: AGT_HOST,
21127
+ apiKey: AGT_API_KEY,
21128
+ agentId: AGT_AGENT_ID
21129
+ },
21130
+ {
21131
+ callbackId,
21132
+ stateValues: view?.state?.values,
21133
+ respondedByUser: msg.payload.user?.id
21134
+ }
21135
+ );
21136
+ if (msg.envelope_id) {
21137
+ ws.send(
21138
+ JSON.stringify(
21139
+ result.action === "errors" ? {
21140
+ envelope_id: msg.envelope_id,
21141
+ payload: { response_action: "errors", errors: result.errors }
21142
+ } : { envelope_id: msg.envelope_id }
21143
+ )
21144
+ );
21145
+ }
21146
+ } catch (err) {
21147
+ ackEmpty();
21148
+ process.stderr.write(
21149
+ `slack-channel(${AGENT_CODE_NAME}): submitInteractive failed for ${hashId(callbackId)}: ${err.message}
21083
21150
  `
21084
21151
  );
21085
21152
  }
@@ -6994,6 +6994,7 @@ __export(slack_block_kit_runtime_exports, {
6994
6994
  generateOptionToken: () => generateOptionToken,
6995
6995
  recordSlackDelivery: () => recordSlackDelivery,
6996
6996
  resolveInteractive: () => resolveInteractive,
6997
+ submitInteractive: () => submitInteractive,
6997
6998
  updatePendingInteractionMessageTs: () => updatePendingInteractionMessageTs,
6998
6999
  validateAskUserOptions: () => validateAskUserOptions,
6999
7000
  validateSlackBlocks: () => validateSlackBlocks,
@@ -7165,13 +7166,28 @@ async function resolveInteractive(cfg, input) {
7165
7166
  token: input.token,
7166
7167
  responded_by_user: input.respondedByUser,
7167
7168
  response_url: input.responseUrl,
7168
- original_blocks: input.originalBlocks
7169
+ original_blocks: input.originalBlocks,
7170
+ trigger_id: input.triggerId
7169
7171
  });
7170
7172
  if (!res.ok) {
7171
7173
  const body = await res.text().catch(() => "");
7172
7174
  throw new Error(`resolveInteractive failed (${res.status}): ${body.slice(0, 200)}`);
7173
7175
  }
7174
7176
  }
7177
+ async function submitInteractive(cfg, input) {
7178
+ const res = await apiCall(cfg, "POST", "/host/interactive/submit", {
7179
+ agent_id: cfg.agentId,
7180
+ callback_id: input.callbackId,
7181
+ state_values: input.stateValues,
7182
+ responded_by_user: input.respondedByUser
7183
+ });
7184
+ if (!res.ok) {
7185
+ const body = await res.text().catch(() => "");
7186
+ throw new Error(`submitInteractive failed (${res.status}): ${body.slice(0, 200)}`);
7187
+ }
7188
+ const json = await res.json().catch(() => ({}));
7189
+ return json.response_action === "errors" ? { action: "errors", errors: json.errors ?? {} } : { action: "close" };
7190
+ }
7175
7191
  async function recordSlackDelivery(cfg, input) {
7176
7192
  const res = await apiCall(
7177
7193
  cfg,
@@ -34,8 +34,8 @@ import {
34
34
  writeDirectChatSessionState,
35
35
  writeEgressAllowlist,
36
36
  writePersistentClaudeWrapper
37
- } from "./chunk-SJ3TWGEN.js";
38
- import "./chunk-C7VSGFDC.js";
37
+ } from "./chunk-AABQHAHG.js";
38
+ import "./chunk-4D2OW6W6.js";
39
39
  import "./chunk-XWVM4KPK.js";
40
40
  export {
41
41
  EGRESS_BASELINE_DOMAINS,
@@ -74,4 +74,4 @@ export {
74
74
  writeEgressAllowlist,
75
75
  writePersistentClaudeWrapper
76
76
  };
77
- //# sourceMappingURL=persistent-session-HXTMZX67.js.map
77
+ //# sourceMappingURL=persistent-session-HKZD767L.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-SJ3TWGEN.js";
4
- import "./chunk-C7VSGFDC.js";
3
+ } from "./chunk-AABQHAHG.js";
4
+ import "./chunk-4D2OW6W6.js";
5
5
  import "./chunk-XWVM4KPK.js";
6
6
 
7
7
  // src/lib/responsiveness-probe.ts
@@ -304,4 +304,4 @@ export {
304
304
  readAndResetChannelDeflections,
305
305
  readAndResetChannelLaneClassifications
306
306
  };
307
- //# sourceMappingURL=responsiveness-probe-2OV5K45J.js.map
307
+ //# sourceMappingURL=responsiveness-probe-WGO7BF64.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.191",
3
+ "version": "0.28.193",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {