@integrity-labs/agt-cli 0.27.84 → 0.27.85

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.
@@ -9,7 +9,7 @@ import {
9
9
  parseDeliveryTarget,
10
10
  registerFramework,
11
11
  wrapScheduledTaskPrompt
12
- } from "./chunk-TXE2LLKI.js";
12
+ } from "./chunk-5IWPCN3V.js";
13
13
 
14
14
  // ../../packages/core/dist/integrations/registry.js
15
15
  var INTEGRATION_REGISTRY = [
@@ -7564,4 +7564,4 @@ export {
7564
7564
  managerInstallSystemUnitCommand,
7565
7565
  managerUninstallSystemUnitCommand
7566
7566
  };
7567
- //# sourceMappingURL=chunk-WISOJYIV.js.map
7567
+ //# sourceMappingURL=chunk-76NYF2QN.js.map
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
100
100
  return { ok: true };
101
101
  } catch {
102
102
  }
103
- const { resolveClaudeBinary } = await import("./persistent-session-BTXWOKJ6.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-YNVCVUK3.js");
104
104
  const claudeBin = resolveClaudeBinary();
105
105
  const pairEnv = {
106
106
  ...process.env,
@@ -373,4 +373,4 @@ export {
373
373
  startClaudePair,
374
374
  submitClaudePairCode
375
375
  };
376
- //# sourceMappingURL=claude-pair-runtime-MKK7LSQG.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-DY2LN3ED.js.map
@@ -16,7 +16,7 @@ import {
16
16
  provisionStopHook,
17
17
  requireHost,
18
18
  safeWriteJsonAtomic
19
- } from "../chunk-WISOJYIV.js";
19
+ } from "../chunk-76NYF2QN.js";
20
20
  import {
21
21
  getProjectDir as getProjectDir2,
22
22
  getReadyTasks,
@@ -53,7 +53,7 @@ import {
53
53
  stopPersistentSession,
54
54
  takeWatchdogGiveUpCount,
55
55
  takeZombieDetection
56
- } from "../chunk-S2QLE5BQ.js";
56
+ } from "../chunk-4LHN3FAL.js";
57
57
  import {
58
58
  KANBAN_CHECK_COMMAND,
59
59
  appendDmFooter,
@@ -76,7 +76,7 @@ import {
76
76
  resolveConnectivityProbe,
77
77
  resolveDmTarget,
78
78
  wrapScheduledTaskPrompt
79
- } from "../chunk-TXE2LLKI.js";
79
+ } from "../chunk-5IWPCN3V.js";
80
80
  import {
81
81
  parsePsRows,
82
82
  reapOrphanChannelMcps
@@ -3713,7 +3713,7 @@ var cachedMaintenanceWindow = null;
3713
3713
  var lastVersionCheckAt = 0;
3714
3714
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
3715
3715
  var lastResponsivenessProbeAt = 0;
3716
- var agtCliVersion = true ? "0.27.84" : "dev";
3716
+ var agtCliVersion = true ? "0.27.85" : "dev";
3717
3717
  function resolveBrewPath(execFileSync4) {
3718
3718
  try {
3719
3719
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -4827,7 +4827,7 @@ async function pollCycle() {
4827
4827
  }
4828
4828
  try {
4829
4829
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
4830
- const { collectDiagnostics } = await import("../persistent-session-BTXWOKJ6.js");
4830
+ const { collectDiagnostics } = await import("../persistent-session-YNVCVUK3.js");
4831
4831
  const diagCodeNames = [...agentState.persistentSessionAgents];
4832
4832
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
4833
4833
  let tailscaleHostname;
@@ -4900,7 +4900,7 @@ async function pollCycle() {
4900
4900
  const {
4901
4901
  collectResponsivenessProbes,
4902
4902
  getResponsivenessIntervalMs
4903
- } = await import("../responsiveness-probe-Y6TCM6T4.js");
4903
+ } = await import("../responsiveness-probe-5ICEBNCM.js");
4904
4904
  const probeIntervalMs = getResponsivenessIntervalMs();
4905
4905
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
4906
4906
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -9121,7 +9121,7 @@ async function processClaudePairSessions(agents) {
9121
9121
  killPairSession,
9122
9122
  pairTmuxSession,
9123
9123
  finalizeClaudePairOnboarding
9124
- } = await import("../claude-pair-runtime-MKK7LSQG.js");
9124
+ } = await import("../claude-pair-runtime-DY2LN3ED.js");
9125
9125
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
9126
9126
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
9127
9127
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -14202,6 +14202,75 @@ function startMsteamsInboundPuller(args) {
14202
14202
  };
14203
14203
  }
14204
14204
 
14205
+ // src/inbound-context-client.ts
14206
+ var REQUEST_TIMEOUT_MS2 = 1e4;
14207
+ function createInboundContextClient(args) {
14208
+ if (!args.agtHost || !args.agtApiKey || !args.agentId) return null;
14209
+ const fetchImpl = args.fetchImpl ?? fetch;
14210
+ const log = args.log ?? (() => {
14211
+ });
14212
+ const base = args.agtHost.replace(/\/+$/, "");
14213
+ const agentId = args.agentId;
14214
+ const apiKey = args.agtApiKey;
14215
+ let cachedToken = null;
14216
+ let cachedTokenExpiresAt = 0;
14217
+ async function getToken() {
14218
+ if (cachedToken && Date.now() < cachedTokenExpiresAt) return cachedToken;
14219
+ const resp = await fetchImpl(`${base}/host/exchange`, {
14220
+ method: "POST",
14221
+ headers: { "Content-Type": "application/json" },
14222
+ body: JSON.stringify({ host_key: apiKey }),
14223
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS2)
14224
+ });
14225
+ if (!resp.ok) {
14226
+ const body = await resp.text().catch(() => "");
14227
+ throw new Error(`/host/exchange failed (${resp.status}): ${body.slice(0, 200)}`);
14228
+ }
14229
+ const data = await resp.json();
14230
+ cachedToken = data.token;
14231
+ cachedTokenExpiresAt = data.expires_at ? new Date(data.expires_at).getTime() - 12e4 : Date.now() + 55 * 6e4;
14232
+ return cachedToken;
14233
+ }
14234
+ async function postOnce(body) {
14235
+ const token = await getToken();
14236
+ return fetchImpl(`${base}/host/inbound-context`, {
14237
+ method: "POST",
14238
+ headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
14239
+ body: JSON.stringify(body),
14240
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS2)
14241
+ });
14242
+ }
14243
+ async function emit(args2) {
14244
+ const body = {
14245
+ agent_id: agentId,
14246
+ source_integration: args2.sourceIntegration,
14247
+ source_external_id: args2.sourceExternalId,
14248
+ ...args2.sourceUrl ? { source_url: args2.sourceUrl } : {}
14249
+ };
14250
+ try {
14251
+ let resp = await postOnce(body);
14252
+ if (resp.status === 401) {
14253
+ cachedToken = null;
14254
+ cachedTokenExpiresAt = 0;
14255
+ resp = await postOnce(body);
14256
+ }
14257
+ if (!resp.ok) {
14258
+ const text = await resp.text().catch(() => "");
14259
+ log(
14260
+ `inbound-context: POST failed (${resp.status}) integration=${args2.sourceIntegration}: ${text.slice(0, 200)}`
14261
+ );
14262
+ }
14263
+ } catch (err) {
14264
+ log(`inbound-context: emit threw integration=${args2.sourceIntegration}: ${err.message}`);
14265
+ }
14266
+ }
14267
+ return {
14268
+ recordInbound(args2) {
14269
+ void emit(args2);
14270
+ }
14271
+ };
14272
+ }
14273
+
14205
14274
  // src/teams-channel-info.ts
14206
14275
  function buildChannelInfoResult(input) {
14207
14276
  if (input.members === null) {
@@ -14558,6 +14627,13 @@ var KNOWN_PEER_BOT_IDS = parsePeerBotIdsEnv(process.env.MSTEAMS_KNOWN_PEER_BOT_I
14558
14627
  var PEER_TEAM_IDS = parsePeerTeamIdsEnv(process.env.MSTEAMS_PEER_TEAM_IDS);
14559
14628
  var AGT_TEAM_ID = process.env.AGT_TEAM_ID ?? null;
14560
14629
  var AGT_AGENT_ID = process.env.AGT_AGENT_ID ?? null;
14630
+ var inboundContextClient = createInboundContextClient({
14631
+ agtHost: process.env["AGT_HOST"]?.trim() || "https://api.augmented.team",
14632
+ agtApiKey: process.env.AGT_API_KEY ?? null,
14633
+ agentId: AGT_AGENT_ID,
14634
+ log: (line) => process.stderr.write(`teams-channel: ${line}
14635
+ `)
14636
+ });
14561
14637
  var MSTEAMS_SENDER_POLICY = (() => {
14562
14638
  const raw = (process.env.MSTEAMS_SENDER_POLICY ?? "all").trim().toLowerCase();
14563
14639
  const internalOnly = process.env.MSTEAMS_INTERNAL_ONLY === "true";
@@ -14886,6 +14962,16 @@ async function processPendingFile(filename) {
14886
14962
  resetThread(activity.conversation.id, throttleKey);
14887
14963
  }
14888
14964
  const isPeerListen = peerDecision.classification === "peer_agent" && peerDecision.action === "forward_listen";
14965
+ if (peerDecision.classification === "human" && activity.conversation?.id && activity.serviceUrl) {
14966
+ const rootActivityId = activity.replyToId ?? activity.id;
14967
+ if (rootActivityId) {
14968
+ inboundContextClient?.recordInbound({
14969
+ sourceIntegration: "msteams",
14970
+ sourceExternalId: `${activity.conversation.id}#${rootActivityId}`,
14971
+ sourceUrl: activity.serviceUrl
14972
+ });
14973
+ }
14974
+ }
14889
14975
  writePendingMarker(activity);
14890
14976
  await emitChannelNotification(activity, { isPeerListen });
14891
14977
  }
@@ -21,8 +21,8 @@ import {
21
21
  stopPersistentSession,
22
22
  takeZombieDetection,
23
23
  writePersistentClaudeWrapper
24
- } from "./chunk-S2QLE5BQ.js";
25
- import "./chunk-TXE2LLKI.js";
24
+ } from "./chunk-4LHN3FAL.js";
25
+ import "./chunk-5IWPCN3V.js";
26
26
  import "./chunk-XWVM4KPK.js";
27
27
  export {
28
28
  SEND_KEYS_ENTER_DELAY_MS,
@@ -48,4 +48,4 @@ export {
48
48
  takeZombieDetection,
49
49
  writePersistentClaudeWrapper
50
50
  };
51
- //# sourceMappingURL=persistent-session-BTXWOKJ6.js.map
51
+ //# sourceMappingURL=persistent-session-YNVCVUK3.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-S2QLE5BQ.js";
4
- import "./chunk-TXE2LLKI.js";
3
+ } from "./chunk-4LHN3FAL.js";
4
+ import "./chunk-5IWPCN3V.js";
5
5
  import "./chunk-XWVM4KPK.js";
6
6
 
7
7
  // src/lib/responsiveness-probe.ts
@@ -70,4 +70,4 @@ export {
70
70
  collectResponsivenessProbes,
71
71
  getResponsivenessIntervalMs
72
72
  };
73
- //# sourceMappingURL=responsiveness-probe-Y6TCM6T4.js.map
73
+ //# sourceMappingURL=responsiveness-probe-5ICEBNCM.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.27.84",
3
+ "version": "0.27.85",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {