@integrity-labs/agt-cli 0.27.91 → 0.27.93
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 +3 -3
- package/dist/{chunk-ALXQEKLP.js → chunk-5P3TU2TB.js} +1 -1
- package/dist/{chunk-4MZWINDQ.js → chunk-RDIDG5IF.js} +25 -5
- package/dist/{chunk-4MZWINDQ.js.map → chunk-RDIDG5IF.js.map} +1 -1
- package/dist/{claude-pair-runtime-XCZUY66M.js → claude-pair-runtime-JVMK3POM.js} +2 -2
- package/dist/lib/manager-worker.js +13 -6
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/slack-channel.js +7 -119
- package/dist/mcp/telegram-channel.js +1 -20
- package/dist/{persistent-session-BMP74QGP.js → persistent-session-SPGHFGCF.js} +2 -2
- package/dist/{responsiveness-probe-AFOPQEFX.js → responsiveness-probe-PR7RS6JB.js} +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-ALXQEKLP.js.map → chunk-5P3TU2TB.js.map} +0 -0
- /package/dist/{claude-pair-runtime-XCZUY66M.js.map → claude-pair-runtime-JVMK3POM.js.map} +0 -0
- /package/dist/{persistent-session-BMP74QGP.js.map → persistent-session-SPGHFGCF.js.map} +0 -0
- /package/dist/{responsiveness-probe-AFOPQEFX.js.map → responsiveness-probe-PR7RS6JB.js.map} +0 -0
|
@@ -6986,13 +6986,10 @@ __export(slack_block_kit_runtime_exports, {
|
|
|
6986
6986
|
DEFAULT_ASK_USER_LIMITS: () => DEFAULT_ASK_USER_LIMITS,
|
|
6987
6987
|
apiCall: () => apiCall,
|
|
6988
6988
|
buildAskUserBlocks: () => buildAskUserBlocks,
|
|
6989
|
-
buildRatingActionsBlock: () => buildRatingActionsBlock,
|
|
6990
6989
|
createPendingInteraction: () => createPendingInteraction,
|
|
6991
6990
|
decodeActionId: () => decodeActionId,
|
|
6992
|
-
defaultRatingLabels: () => defaultRatingLabels,
|
|
6993
6991
|
encodeActionId: () => encodeActionId,
|
|
6994
6992
|
generateOptionToken: () => generateOptionToken,
|
|
6995
|
-
ratingValuesForScale: () => ratingValuesForScale,
|
|
6996
6993
|
recordSlackDelivery: () => recordSlackDelivery,
|
|
6997
6994
|
resolveInteractive: () => resolveInteractive,
|
|
6998
6995
|
updatePendingInteractionMessageTs: () => updatePendingInteractionMessageTs,
|
|
@@ -7159,22 +7156,6 @@ function buildAskUserBlocks(opts) {
|
|
|
7159
7156
|
}
|
|
7160
7157
|
];
|
|
7161
7158
|
}
|
|
7162
|
-
function ratingValuesForScale(scale) {
|
|
7163
|
-
return scale === "1-5" ? [1, 2, 3, 4, 5] : [-1, 0, 1];
|
|
7164
|
-
}
|
|
7165
|
-
function defaultRatingLabels(scale) {
|
|
7166
|
-
return scale === "1-5" ? ["1", "2", "3", "4", "5"] : ["\u{1F44E}", "\u{1F914}", "\u{1F44D}"];
|
|
7167
|
-
}
|
|
7168
|
-
function buildRatingActionsBlock(opts) {
|
|
7169
|
-
return {
|
|
7170
|
-
type: "actions",
|
|
7171
|
-
elements: opts.options.map(({ label, token }) => ({
|
|
7172
|
-
type: "button",
|
|
7173
|
-
text: { type: "plain_text", text: label },
|
|
7174
|
-
action_id: encodeActionId(opts.callbackId, token)
|
|
7175
|
-
}))
|
|
7176
|
-
};
|
|
7177
|
-
}
|
|
7178
7159
|
async function resolveInteractive(cfg, input) {
|
|
7179
7160
|
const res = await apiCall(cfg, "POST", "/host/interactive/resolve", {
|
|
7180
7161
|
agent_id: cfg.agentId,
|
|
@@ -14352,7 +14333,7 @@ function shouldPostUndeliverableNotice(lastNoticeAtMs, nowMs, throttleMs = UNDEL
|
|
|
14352
14333
|
return lastNoticeAtMs == null || nowMs - lastNoticeAtMs >= throttleMs;
|
|
14353
14334
|
}
|
|
14354
14335
|
function undeliverableNoticeText() {
|
|
14355
|
-
return "\u23F3 I can't get to this right now
|
|
14336
|
+
return "\u23F3 I can't get to this right now. Please resend in a few minutes \u2014 I may not see this one.";
|
|
14356
14337
|
}
|
|
14357
14338
|
function oldestPendingMarkerAgeMs(dir, now = Date.now()) {
|
|
14358
14339
|
if (!dir) return null;
|
|
@@ -17212,7 +17193,7 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
17212
17193
|
...blockKitToolsAvailable() ? [
|
|
17213
17194
|
{
|
|
17214
17195
|
name: "slack.send_structured",
|
|
17215
|
-
description:
|
|
17196
|
+
description: "Send a Slack message built from Block Kit blocks (structured layout: headers, sections, dividers, context, action buttons). Use when plain text isn't enough \u2014 status reports, confirmations with multiple fields, calls-to-action with buttons. Pass a `text` fallback for push notifications. Returns { message_ts, permalink }. Does NOT block waiting for user interactions; for that use slack.ask_user.",
|
|
17216
17197
|
inputSchema: {
|
|
17217
17198
|
type: "object",
|
|
17218
17199
|
properties: {
|
|
@@ -17222,18 +17203,7 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
17222
17203
|
description: "Array of Block Kit blocks. Supported block types: header, section, divider, context, actions. Supported interactive elements (inside actions blocks): button. Hard limits: 50 blocks per message, 5 elements per actions block, 3000 chars per section text, 75 chars per button label."
|
|
17223
17204
|
},
|
|
17224
17205
|
text: { type: "string", description: "Plain-text fallback for push notifications and unfurls. Required." },
|
|
17225
|
-
thread_ts: { type: "string", description: "Thread timestamp for threaded replies (optional)" }
|
|
17226
|
-
interactive: {
|
|
17227
|
-
type: "object",
|
|
17228
|
-
description: `Optional interactive affordance appended to the message. Currently supports type="rate_run" \u2014 appends a 1-5 button row that updates this run's rating when tapped. Use after a scheduled-task delivery so users can rate the firing.`,
|
|
17229
|
-
properties: {
|
|
17230
|
-
type: { type: "string", enum: ["rate_run"], description: 'Affordance kind. Only "rate_run" is supported today.' },
|
|
17231
|
-
run_id: { type: "string", description: "The runs.run_id this rating belongs to (returned by /host/runs/start)." },
|
|
17232
|
-
scale: { type: "string", enum: ["1-5", "sentiment"], description: 'Rating scale. Default "1-5" (1..5 buttons). "sentiment" emits \u{1F44E}/\u{1F914}/\u{1F44D} mapping to -1/0/+1 \u2014 reserved for future Telegram parity.' },
|
|
17233
|
-
expires_in_seconds: { type: "number", description: "How long the rating row stays tappable. Default 86400 (24h). The pending row times out after this; later taps are ignored." }
|
|
17234
|
-
},
|
|
17235
|
-
required: ["type", "run_id"]
|
|
17236
|
-
}
|
|
17206
|
+
thread_ts: { type: "string", description: "Thread timestamp for threaded replies (optional)" }
|
|
17237
17207
|
},
|
|
17238
17208
|
required: ["channel", "blocks", "text"]
|
|
17239
17209
|
}
|
|
@@ -17908,7 +17878,7 @@ async function handleSendStructured(args) {
|
|
|
17908
17878
|
}
|
|
17909
17879
|
const runtime = await Promise.resolve().then(() => (init_slack_block_kit_runtime(), slack_block_kit_runtime_exports));
|
|
17910
17880
|
const { validateSlackBlocks: validateSlackBlocks2 } = runtime;
|
|
17911
|
-
const { channel, blocks, text, thread_ts
|
|
17881
|
+
const { channel, blocks, text, thread_ts } = args;
|
|
17912
17882
|
if (typeof channel !== "string" || !channel) {
|
|
17913
17883
|
return errResult("channel is required");
|
|
17914
17884
|
}
|
|
@@ -17920,97 +17890,16 @@ async function handleSendStructured(args) {
|
|
|
17920
17890
|
if (!validation.ok) {
|
|
17921
17891
|
return errResult(`Invalid blocks: ${validation.errors.map((e) => `${e.path}: ${e.message}`).join("; ")}`);
|
|
17922
17892
|
}
|
|
17923
|
-
let effectiveBlocks = blocks;
|
|
17924
|
-
let ratingCallbackId = null;
|
|
17925
|
-
let ratingExpiresAt = null;
|
|
17926
|
-
let ratingTokenised = [];
|
|
17927
|
-
if (interactive) {
|
|
17928
|
-
if (interactive.type !== "rate_run") {
|
|
17929
|
-
return errResult(`Unsupported interactive.type '${interactive.type}'. Supported: rate_run.`);
|
|
17930
|
-
}
|
|
17931
|
-
if (typeof interactive.run_id !== "string" || !interactive.run_id) {
|
|
17932
|
-
return errResult("interactive.run_id is required when interactive is set");
|
|
17933
|
-
}
|
|
17934
|
-
if (!interactiveHostAvailable()) {
|
|
17935
|
-
return errResult(
|
|
17936
|
-
"interactive=rate_run requires Block Kit plus host MCP wiring (AGT_HOST, AGT_API_KEY, AGT_AGENT_ID)."
|
|
17937
|
-
);
|
|
17938
|
-
}
|
|
17939
|
-
const scale = interactive.scale === "sentiment" ? "sentiment" : "1-5";
|
|
17940
|
-
const requestedTtl = typeof interactive.expires_in_seconds === "number" ? interactive.expires_in_seconds : 86400;
|
|
17941
|
-
const ttl = Math.max(60, Math.min(7 * 86400, requestedTtl));
|
|
17942
|
-
const { randomUUID: rndUUID } = await import("crypto");
|
|
17943
|
-
ratingCallbackId = rndUUID();
|
|
17944
|
-
ratingExpiresAt = new Date(Date.now() + ttl * 1e3);
|
|
17945
|
-
const values = runtime.ratingValuesForScale(scale);
|
|
17946
|
-
const labels = runtime.defaultRatingLabels(scale);
|
|
17947
|
-
ratingTokenised = values.map((v, i) => ({
|
|
17948
|
-
token: runtime.generateOptionToken(),
|
|
17949
|
-
value: String(v),
|
|
17950
|
-
label: labels[i] ?? String(v)
|
|
17951
|
-
}));
|
|
17952
|
-
const ratingBlock = runtime.buildRatingActionsBlock({
|
|
17953
|
-
callbackId: ratingCallbackId,
|
|
17954
|
-
options: ratingTokenised.map(({ label, token }) => ({
|
|
17955
|
-
// The numeric value is carried by token → options mapping in the
|
|
17956
|
-
// pending_interaction row, not by the button itself, so this
|
|
17957
|
-
// cast-back to RatingOption only needs label + token + a placeholder.
|
|
17958
|
-
value: 0,
|
|
17959
|
-
label,
|
|
17960
|
-
token
|
|
17961
|
-
}))
|
|
17962
|
-
});
|
|
17963
|
-
effectiveBlocks = [...blocks, ratingBlock];
|
|
17964
|
-
const finalValidation = runtime.validateSlackBlocks(effectiveBlocks);
|
|
17965
|
-
if (!finalValidation.ok) {
|
|
17966
|
-
return errResult(
|
|
17967
|
-
`Invalid blocks (after appending rating row): ${finalValidation.errors.map((e) => `${e.path}: ${e.message}`).join("; ")}`
|
|
17968
|
-
);
|
|
17969
|
-
}
|
|
17970
|
-
const cfg = {
|
|
17971
|
-
apiHost: AGT_HOST,
|
|
17972
|
-
apiKey: AGT_API_KEY,
|
|
17973
|
-
agentId: AGT_AGENT_ID
|
|
17974
|
-
};
|
|
17975
|
-
try {
|
|
17976
|
-
await runtime.createPendingInteraction(cfg, {
|
|
17977
|
-
callbackId: ratingCallbackId,
|
|
17978
|
-
channelId: channel,
|
|
17979
|
-
messageTs: "",
|
|
17980
|
-
threadTs: thread_ts,
|
|
17981
|
-
options: ratingTokenised,
|
|
17982
|
-
expiresAt: ratingExpiresAt,
|
|
17983
|
-
kind: "rate_run",
|
|
17984
|
-
kindData: { run_id: interactive.run_id, scale }
|
|
17985
|
-
});
|
|
17986
|
-
} catch (err) {
|
|
17987
|
-
return errResult(`Failed to register rating row: ${err.message}`);
|
|
17988
|
-
}
|
|
17989
|
-
}
|
|
17990
17893
|
const result = await postSlackMessageWithTs({
|
|
17991
17894
|
channel,
|
|
17992
|
-
blocks
|
|
17895
|
+
blocks,
|
|
17993
17896
|
text,
|
|
17994
17897
|
...thread_ts ? { thread_ts } : {}
|
|
17995
17898
|
});
|
|
17996
17899
|
if (!result.ok || !result.ts) {
|
|
17997
17900
|
return errResult(`Slack chat.postMessage failed: ${result.error ?? "unknown"}`);
|
|
17998
17901
|
}
|
|
17999
|
-
if (
|
|
18000
|
-
try {
|
|
18001
|
-
await runtime.updatePendingInteractionMessageTs(
|
|
18002
|
-
{ apiHost: AGT_HOST, apiKey: AGT_API_KEY, agentId: AGT_AGENT_ID },
|
|
18003
|
-
ratingCallbackId,
|
|
18004
|
-
result.ts
|
|
18005
|
-
);
|
|
18006
|
-
} catch (err) {
|
|
18007
|
-
process.stderr.write(
|
|
18008
|
-
`slack-channel(${AGENT_CODE_NAME}): updatePendingInteractionMessageTs failed for rating ${hashId(ratingCallbackId)}: ${err.message}
|
|
18009
|
-
`
|
|
18010
|
-
);
|
|
18011
|
-
}
|
|
18012
|
-
}
|
|
18013
|
-
if (interactiveHostAvailable() && !ratingCallbackId) {
|
|
17902
|
+
if (interactiveHostAvailable()) {
|
|
18014
17903
|
const cfg = {
|
|
18015
17904
|
apiHost: AGT_HOST,
|
|
18016
17905
|
apiKey: AGT_API_KEY,
|
|
@@ -18040,8 +17929,7 @@ async function handleSendStructured(args) {
|
|
|
18040
17929
|
type: "text",
|
|
18041
17930
|
text: JSON.stringify({
|
|
18042
17931
|
message_ts: result.ts,
|
|
18043
|
-
permalink: permalink ?? ""
|
|
18044
|
-
...ratingCallbackId ? { rating_callback_id: ratingCallbackId } : {}
|
|
17932
|
+
permalink: permalink ?? ""
|
|
18045
17933
|
})
|
|
18046
17934
|
}
|
|
18047
17935
|
]
|
|
@@ -6986,13 +6986,10 @@ __export(slack_block_kit_runtime_exports, {
|
|
|
6986
6986
|
DEFAULT_ASK_USER_LIMITS: () => DEFAULT_ASK_USER_LIMITS,
|
|
6987
6987
|
apiCall: () => apiCall,
|
|
6988
6988
|
buildAskUserBlocks: () => buildAskUserBlocks,
|
|
6989
|
-
buildRatingActionsBlock: () => buildRatingActionsBlock,
|
|
6990
6989
|
createPendingInteraction: () => createPendingInteraction,
|
|
6991
6990
|
decodeActionId: () => decodeActionId,
|
|
6992
|
-
defaultRatingLabels: () => defaultRatingLabels,
|
|
6993
6991
|
encodeActionId: () => encodeActionId,
|
|
6994
6992
|
generateOptionToken: () => generateOptionToken,
|
|
6995
|
-
ratingValuesForScale: () => ratingValuesForScale,
|
|
6996
6993
|
recordSlackDelivery: () => recordSlackDelivery,
|
|
6997
6994
|
resolveInteractive: () => resolveInteractive,
|
|
6998
6995
|
updatePendingInteractionMessageTs: () => updatePendingInteractionMessageTs,
|
|
@@ -7159,22 +7156,6 @@ function buildAskUserBlocks(opts) {
|
|
|
7159
7156
|
}
|
|
7160
7157
|
];
|
|
7161
7158
|
}
|
|
7162
|
-
function ratingValuesForScale(scale) {
|
|
7163
|
-
return scale === "1-5" ? [1, 2, 3, 4, 5] : [-1, 0, 1];
|
|
7164
|
-
}
|
|
7165
|
-
function defaultRatingLabels(scale) {
|
|
7166
|
-
return scale === "1-5" ? ["1", "2", "3", "4", "5"] : ["\u{1F44E}", "\u{1F914}", "\u{1F44D}"];
|
|
7167
|
-
}
|
|
7168
|
-
function buildRatingActionsBlock(opts) {
|
|
7169
|
-
return {
|
|
7170
|
-
type: "actions",
|
|
7171
|
-
elements: opts.options.map(({ label, token }) => ({
|
|
7172
|
-
type: "button",
|
|
7173
|
-
text: { type: "plain_text", text: label },
|
|
7174
|
-
action_id: encodeActionId(opts.callbackId, token)
|
|
7175
|
-
}))
|
|
7176
|
-
};
|
|
7177
|
-
}
|
|
7178
7159
|
async function resolveInteractive(cfg, input) {
|
|
7179
7160
|
const res = await apiCall(cfg, "POST", "/host/interactive/resolve", {
|
|
7180
7161
|
agent_id: cfg.agentId,
|
|
@@ -15531,7 +15512,7 @@ function shouldPostUndeliverableNotice(lastNoticeAtMs, nowMs, throttleMs = UNDEL
|
|
|
15531
15512
|
return lastNoticeAtMs == null || nowMs - lastNoticeAtMs >= throttleMs;
|
|
15532
15513
|
}
|
|
15533
15514
|
function undeliverableNoticeText() {
|
|
15534
|
-
return "\u23F3 I can't get to this right now
|
|
15515
|
+
return "\u23F3 I can't get to this right now. Please resend in a few minutes \u2014 I may not see this one.";
|
|
15535
15516
|
}
|
|
15536
15517
|
function oldestPendingMarkerAgeMs(dir, now = Date.now()) {
|
|
15537
15518
|
if (!dir) return null;
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
stopPersistentSession,
|
|
23
23
|
takeZombieDetection,
|
|
24
24
|
writePersistentClaudeWrapper
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RDIDG5IF.js";
|
|
26
26
|
import "./chunk-T2UTQH6W.js";
|
|
27
27
|
import "./chunk-XWVM4KPK.js";
|
|
28
28
|
export {
|
|
@@ -50,4 +50,4 @@ export {
|
|
|
50
50
|
takeZombieDetection,
|
|
51
51
|
writePersistentClaudeWrapper
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=persistent-session-
|
|
53
|
+
//# sourceMappingURL=persistent-session-SPGHFGCF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paneLogPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RDIDG5IF.js";
|
|
4
4
|
import "./chunk-T2UTQH6W.js";
|
|
5
5
|
import "./chunk-XWVM4KPK.js";
|
|
6
6
|
|
|
@@ -70,4 +70,4 @@ export {
|
|
|
70
70
|
collectResponsivenessProbes,
|
|
71
71
|
getResponsivenessIntervalMs
|
|
72
72
|
};
|
|
73
|
-
//# sourceMappingURL=responsiveness-probe-
|
|
73
|
+
//# sourceMappingURL=responsiveness-probe-PR7RS6JB.js.map
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|