@integrity-labs/agt-cli 0.27.92 → 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-FXXCD523.js → chunk-5P3TU2TB.js} +1 -1
- package/dist/lib/manager-worker.js +2 -2
- package/dist/mcp/slack-channel.js +6 -118
- package/dist/mcp/telegram-channel.js +0 -19
- package/package.json +1 -1
- /package/dist/{chunk-FXXCD523.js.map → chunk-5P3TU2TB.js.map} +0 -0
package/dist/bin/agt.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
success,
|
|
29
29
|
table,
|
|
30
30
|
warn
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-5P3TU2TB.js";
|
|
32
32
|
import {
|
|
33
33
|
CHANNEL_REGISTRY,
|
|
34
34
|
DEPLOYMENT_TEMPLATES,
|
|
@@ -4934,7 +4934,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
4934
4934
|
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
4935
4935
|
import chalk18 from "chalk";
|
|
4936
4936
|
import ora16 from "ora";
|
|
4937
|
-
var cliVersion = true ? "0.27.
|
|
4937
|
+
var cliVersion = true ? "0.27.93" : "dev";
|
|
4938
4938
|
async function fetchLatestVersion() {
|
|
4939
4939
|
const host2 = getHost();
|
|
4940
4940
|
if (!host2) return null;
|
|
@@ -5857,7 +5857,7 @@ function handleError(err) {
|
|
|
5857
5857
|
}
|
|
5858
5858
|
|
|
5859
5859
|
// src/bin/agt.ts
|
|
5860
|
-
var cliVersion2 = true ? "0.27.
|
|
5860
|
+
var cliVersion2 = true ? "0.27.93" : "dev";
|
|
5861
5861
|
var program = new Command();
|
|
5862
5862
|
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");
|
|
5863
5863
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
provisionStopHook,
|
|
17
17
|
requireHost,
|
|
18
18
|
safeWriteJsonAtomic
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-5P3TU2TB.js";
|
|
20
20
|
import {
|
|
21
21
|
getProjectDir as getProjectDir2,
|
|
22
22
|
getReadyTasks,
|
|
@@ -3996,7 +3996,7 @@ var cachedMaintenanceWindow = null;
|
|
|
3996
3996
|
var lastVersionCheckAt = 0;
|
|
3997
3997
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
3998
3998
|
var lastResponsivenessProbeAt = 0;
|
|
3999
|
-
var agtCliVersion = true ? "0.27.
|
|
3999
|
+
var agtCliVersion = true ? "0.27.93" : "dev";
|
|
4000
4000
|
function resolveBrewPath(execFileSync4) {
|
|
4001
4001
|
try {
|
|
4002
4002
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -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,
|
|
@@ -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,
|
package/package.json
CHANGED
|
File without changes
|