@integrity-labs/agt-cli 0.12.1 → 0.12.2
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 +2 -2
- package/mcp/slack-channel.js +28 -2
- package/package.json +1 -1
package/dist/bin/agt.js
CHANGED
|
@@ -3717,7 +3717,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
3717
3717
|
import { existsSync as existsSync5, realpathSync } from "fs";
|
|
3718
3718
|
import chalk20 from "chalk";
|
|
3719
3719
|
import ora15 from "ora";
|
|
3720
|
-
var cliVersion = true ? "0.12.
|
|
3720
|
+
var cliVersion = true ? "0.12.2" : "dev";
|
|
3721
3721
|
async function fetchLatestVersion() {
|
|
3722
3722
|
const host2 = getHost();
|
|
3723
3723
|
if (!host2) return null;
|
|
@@ -4166,7 +4166,7 @@ function handleError(err) {
|
|
|
4166
4166
|
}
|
|
4167
4167
|
|
|
4168
4168
|
// src/bin/agt.ts
|
|
4169
|
-
var cliVersion2 = true ? "0.12.
|
|
4169
|
+
var cliVersion2 = true ? "0.12.2" : "dev";
|
|
4170
4170
|
var program = new Command();
|
|
4171
4171
|
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");
|
|
4172
4172
|
program.hook("preAction", (thisCommand) => {
|
package/mcp/slack-channel.js
CHANGED
|
@@ -13922,7 +13922,9 @@ var mcp = new Server(
|
|
|
13922
13922
|
tools: {}
|
|
13923
13923
|
},
|
|
13924
13924
|
instructions: [
|
|
13925
|
-
'Messages from Slack arrive as <channel source="slack" user="
|
|
13925
|
+
'Messages from Slack arrive as <channel source="slack" user="<slack-id>" user_name="<display-name>" channel="..." thread_ts="...">.',
|
|
13926
|
+
"Address users by their user_name (display name), NEVER by the raw user ID.",
|
|
13927
|
+
"In threads with multiple participants, the CURRENT speaker is always the one in the <channel> tag on the latest message \u2014 do not conflate them with other participants who spoke earlier.",
|
|
13926
13928
|
"Reply using the slack.reply tool, passing channel and thread_ts from the tag.",
|
|
13927
13929
|
"For threaded replies, always include thread_ts so the response appears in the same thread.",
|
|
13928
13930
|
"When someone @mentions you in a channel, respond helpfully in that thread.",
|
|
@@ -14129,7 +14131,10 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
14129
14131
|
}
|
|
14130
14132
|
cursor = data.response_metadata?.next_cursor || void 0;
|
|
14131
14133
|
} while (cursor && allMessages.length < limit);
|
|
14132
|
-
const
|
|
14134
|
+
const uniqueUserIds = [...new Set(allMessages.map((m) => m.user))];
|
|
14135
|
+
const resolved = await Promise.all(uniqueUserIds.map(async (id) => [id, await resolveUserName(id)]));
|
|
14136
|
+
const nameById = new Map(resolved);
|
|
14137
|
+
const formatted = allMessages.map((m) => `[${m.ts}] ${nameById.get(m.user) ?? m.user} (<@${m.user}>): ${m.text}`).join("\n");
|
|
14133
14138
|
return {
|
|
14134
14139
|
content: [{
|
|
14135
14140
|
type: "text",
|
|
@@ -14269,6 +14274,25 @@ async function getBotUserId() {
|
|
|
14269
14274
|
return null;
|
|
14270
14275
|
}
|
|
14271
14276
|
}
|
|
14277
|
+
var userNameCache = /* @__PURE__ */ new Map();
|
|
14278
|
+
async function resolveUserName(userId) {
|
|
14279
|
+
if (!userId || userId === "unknown") return userId ?? "unknown";
|
|
14280
|
+
const cached2 = userNameCache.get(userId);
|
|
14281
|
+
if (cached2 !== void 0) return cached2;
|
|
14282
|
+
try {
|
|
14283
|
+
const res = await fetch(
|
|
14284
|
+
`https://slack.com/api/users.info?user=${encodeURIComponent(userId)}`,
|
|
14285
|
+
{ headers: { Authorization: `Bearer ${BOT_TOKEN}` } }
|
|
14286
|
+
);
|
|
14287
|
+
const data = await res.json();
|
|
14288
|
+
const name = data.user?.profile?.display_name || data.user?.profile?.real_name || userId;
|
|
14289
|
+
userNameCache.set(userId, name);
|
|
14290
|
+
return name;
|
|
14291
|
+
} catch {
|
|
14292
|
+
userNameCache.set(userId, userId);
|
|
14293
|
+
return userId;
|
|
14294
|
+
}
|
|
14295
|
+
}
|
|
14272
14296
|
var currentWs = null;
|
|
14273
14297
|
var isShuttingDown = false;
|
|
14274
14298
|
async function connectSocketMode() {
|
|
@@ -14341,12 +14365,14 @@ async function connectSocketMode() {
|
|
|
14341
14365
|
if (channel && ts) {
|
|
14342
14366
|
trackPendingMessage(channel, threadTs, ts);
|
|
14343
14367
|
}
|
|
14368
|
+
const userName = await resolveUserName(user);
|
|
14344
14369
|
await mcp.notification({
|
|
14345
14370
|
method: "notifications/claude/channel",
|
|
14346
14371
|
params: {
|
|
14347
14372
|
content: text,
|
|
14348
14373
|
meta: {
|
|
14349
14374
|
user,
|
|
14375
|
+
user_name: userName,
|
|
14350
14376
|
channel,
|
|
14351
14377
|
thread_ts: threadTs,
|
|
14352
14378
|
event_type: evt.type,
|