@integrity-labs/agt-cli 0.28.307 → 0.28.309

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.
@@ -18,7 +18,7 @@ import {
18
18
  resolveConnectivityProbe,
19
19
  worseConnectivityOutcome,
20
20
  wrapScheduledTaskPrompt
21
- } from "./chunk-QVYGYEBX.js";
21
+ } from "./chunk-62LAROZ4.js";
22
22
  import {
23
23
  parsePsRows
24
24
  } from "./chunk-XWVM4KPK.js";
@@ -5900,7 +5900,7 @@ function requireHost() {
5900
5900
  }
5901
5901
 
5902
5902
  // src/lib/api-client.ts
5903
- var agtCliVersion = true ? "0.28.307" : "dev";
5903
+ var agtCliVersion = true ? "0.28.309" : "dev";
5904
5904
  var lastConfigHash = null;
5905
5905
  function setConfigHash(hash) {
5906
5906
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8199,4 +8199,4 @@ export {
8199
8199
  managerInstallSystemUnitCommand,
8200
8200
  managerUninstallSystemUnitCommand
8201
8201
  };
8202
- //# sourceMappingURL=chunk-BV55I3J5.js.map
8202
+ //# sourceMappingURL=chunk-7QYIMU2Y.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-MJNQEARD.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-QQXENK3Z.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-H3TVBIOQ.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-A67UBVDS.js.map
@@ -39,7 +39,7 @@ import {
39
39
  requireHost,
40
40
  safeWriteJsonAtomic,
41
41
  setConfigHash
42
- } from "../chunk-BV55I3J5.js";
42
+ } from "../chunk-7QYIMU2Y.js";
43
43
  import {
44
44
  getProjectDir as getProjectDir2,
45
45
  getReadyTasks,
@@ -127,7 +127,7 @@ import {
127
127
  takeZombieDetection,
128
128
  transcriptActivityAgeSeconds,
129
129
  writeEgressAllowlist
130
- } from "../chunk-QVYGYEBX.js";
130
+ } from "../chunk-62LAROZ4.js";
131
131
  import {
132
132
  reapOrphanChannelMcps
133
133
  } from "../chunk-XWVM4KPK.js";
@@ -6997,7 +6997,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
6997
6997
  var lastVersionCheckAt = 0;
6998
6998
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
6999
6999
  var lastResponsivenessProbeAt = 0;
7000
- var agtCliVersion = true ? "0.28.307" : "dev";
7000
+ var agtCliVersion = true ? "0.28.309" : "dev";
7001
7001
  function resolveBrewPath(execFileSync2) {
7002
7002
  try {
7003
7003
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -7852,7 +7852,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
7852
7852
  if (codeNames.length === 0) return;
7853
7853
  void (async () => {
7854
7854
  try {
7855
- const { collectDiagnostics } = await import("../persistent-session-MJNQEARD.js");
7855
+ const { collectDiagnostics } = await import("../persistent-session-QQXENK3Z.js");
7856
7856
  await api.post("/host/heartbeat", {
7857
7857
  host_id: hostId,
7858
7858
  agent_diagnostics: collectDiagnostics(codeNames)
@@ -7950,7 +7950,7 @@ async function pollCycle() {
7950
7950
  }
7951
7951
  try {
7952
7952
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
7953
- const { collectDiagnostics } = await import("../persistent-session-MJNQEARD.js");
7953
+ const { collectDiagnostics } = await import("../persistent-session-QQXENK3Z.js");
7954
7954
  const diagCodeNames = [...agentState.persistentSessionAgents];
7955
7955
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
7956
7956
  let tailscaleHostname;
@@ -8098,7 +8098,7 @@ async function pollCycle() {
8098
8098
  const {
8099
8099
  collectResponsivenessProbes,
8100
8100
  getResponsivenessIntervalMs
8101
- } = await import("../responsiveness-probe-I4T3HL7C.js");
8101
+ } = await import("../responsiveness-probe-33SVBGM7.js");
8102
8102
  const probeIntervalMs = getResponsivenessIntervalMs();
8103
8103
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
8104
8104
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -8130,7 +8130,7 @@ async function pollCycle() {
8130
8130
  collectResponsivenessProbes,
8131
8131
  livePendingInboundOldestAgeSeconds,
8132
8132
  parkPendingInbound
8133
- } = await import("../responsiveness-probe-I4T3HL7C.js");
8133
+ } = await import("../responsiveness-probe-33SVBGM7.js");
8134
8134
  const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
8135
8135
  const wedgeNow = /* @__PURE__ */ new Date();
8136
8136
  const liveAgents = agentState.persistentSessionAgents;
@@ -11113,7 +11113,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
11113
11113
  void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
11114
11114
  void (async () => {
11115
11115
  try {
11116
- const { collectDiagnostics } = await import("../persistent-session-MJNQEARD.js");
11116
+ const { collectDiagnostics } = await import("../persistent-session-QQXENK3Z.js");
11117
11117
  await api.post("/host/heartbeat", {
11118
11118
  host_id: hostId,
11119
11119
  agent_diagnostics: collectDiagnostics([codeName])
@@ -11163,7 +11163,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
11163
11163
  }
11164
11164
  try {
11165
11165
  const hostId = await getHostId();
11166
- const { collectDiagnostics } = await import("../persistent-session-MJNQEARD.js");
11166
+ const { collectDiagnostics } = await import("../persistent-session-QQXENK3Z.js");
11167
11167
  await api.post("/host/heartbeat", {
11168
11168
  host_id: hostId,
11169
11169
  agent_diagnostics: collectDiagnostics([codeName])
@@ -11587,7 +11587,7 @@ async function processClaudePairSessions(agents) {
11587
11587
  killPairSession,
11588
11588
  pairTmuxSession,
11589
11589
  finalizeClaudePairOnboarding
11590
- } = await import("../claude-pair-runtime-H3TVBIOQ.js");
11590
+ } = await import("../claude-pair-runtime-A67UBVDS.js");
11591
11591
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
11592
11592
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
11593
11593
  const killed = await killPairSession(pairTmuxSession(pairId));
package/dist/mcp/index.js CHANGED
@@ -23639,6 +23639,7 @@ var LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
23639
23639
  "artefacts_get_source_chunk",
23640
23640
  "artefacts_download",
23641
23641
  "artefacts_resolve",
23642
+ "artefacts_analytics",
23642
23643
  // ADR-0017 Projects container (the reclaimed projects_* namespace). Read tools
23643
23644
  // shipped in v1; ENG-6769 adds agent-initiated create + post-creation tagging
23644
23645
  // of artefacts/tasks to a project. No projects_get_source_chunk — a project is
@@ -23752,6 +23753,61 @@ async function getPublishedArtefactSourceChunkText(artefactId, offset, limit) {
23752
23753
  (more \u2014 next offset: ${data.offset + data.length}, total: ${data.total_length} bytes)`;
23753
23754
  return data.chunk + trailer;
23754
23755
  }
23756
+ function formatDwellMs(ms) {
23757
+ const secs = Math.round((ms ?? 0) / 1e3);
23758
+ if (secs < 60) return `${secs}s`;
23759
+ const mins = secs / 60;
23760
+ return mins < 60 ? `${Math.round(mins)}m` : `${(mins / 60).toFixed(1)}h`;
23761
+ }
23762
+ function trendSparkText(series) {
23763
+ const s = series ?? [];
23764
+ if (!s.length) return "no view data yet";
23765
+ const total = s.reduce((a, b) => a + (b.views ?? 0), 0);
23766
+ const last7 = s.slice(-7).reduce((a, b) => a + (b.views ?? 0), 0);
23767
+ return `${total} views over the last ${s.length} days (${last7} in the last 7)`;
23768
+ }
23769
+ async function getArtefactAnalyticsText(params) {
23770
+ const qs = new URLSearchParams({ agent_id: AGT_AGENT_ID ?? "" });
23771
+ if (params.project_id) qs.set("project_id", params.project_id);
23772
+ if (params.artefact_id) qs.set("artefact_id", params.artefact_id);
23773
+ let data;
23774
+ try {
23775
+ data = await apiGet(`/host/artefact-analytics?${qs.toString()}`);
23776
+ } catch (err) {
23777
+ const msg = err instanceof Error ? err.message : String(err);
23778
+ if (msg.includes("premium_required") || msg.includes("Augmented Live Premium")) {
23779
+ return "Viewer analytics is an Augmented Live Premium feature, and this team is not on a Premium plan (or the Live Premium add-on). Ask your operator to enable Augmented Live Premium to read view counts.";
23780
+ }
23781
+ throw err;
23782
+ }
23783
+ if (data.scope === "project") {
23784
+ const a2 = data.analytics ?? null;
23785
+ if (!a2) return `No analytics available for project ${params.project_id}.`;
23786
+ const t = a2.totals ?? { views: 0, unique_visitors: 0, total_dwell_ms: 0, avg_dwell_ms: 0 };
23787
+ const lines = [
23788
+ `Project analytics${data.project_name ? ` \u2014 "${data.project_name}"` : ""} (${a2.artefact_count} published artefact${a2.artefact_count === 1 ? "" : "s"}):`,
23789
+ `- Total views: ${t.views} | Unique visitors: ${t.unique_visitors} | Avg dwell: ${formatDwellMs(t.avg_dwell_ms)}`,
23790
+ `- Trend: ${trendSparkText(a2.timeseries)}`,
23791
+ "",
23792
+ "Per episode (newest first):",
23793
+ ...(a2.episodes ?? []).map(
23794
+ (e) => `- ${e.title ?? "(untitled)"} [${e.kind ?? "?"}] \u2014 ${e.views} views, ${e.unique_visitors} unique, ${formatDwellMs(e.total_dwell_ms)} dwell${e.live_url ? ` (${e.live_url})` : ""}`
23795
+ )
23796
+ ];
23797
+ if (!(a2.episodes ?? []).length) lines.push("- (no published artefacts in this project yet)");
23798
+ return lines.join("\n");
23799
+ }
23800
+ const a = data.analytics ?? null;
23801
+ const art = data.artefact;
23802
+ const header = `Analytics for ${art?.title ?? "(untitled)"}${art?.kind ? ` [${art.kind}]` : ""}${art?.live_url ? ` (${art.live_url})` : ""}:`;
23803
+ if (!a) return `${header}
23804
+ - No view data yet.`;
23805
+ return [
23806
+ header,
23807
+ `- Views: ${a.views ?? 0} | Unique visitors: ${a.unique_visitors ?? 0} | Avg dwell: ${formatDwellMs(a.avg_dwell_ms)}`,
23808
+ `- Trend: ${trendSparkText(a.timeseries)}`
23809
+ ].join("\n");
23810
+ }
23755
23811
  var artefactListSchema = {
23756
23812
  publisher: external_exports.string().optional().describe('Filter by publisher (e.g. "agt-live")'),
23757
23813
  kind: external_exports.enum(["mockup", "deck", "carousel", "site", "app", "video", "other"]).optional().describe("Filter by artefact kind"),
@@ -23775,6 +23831,17 @@ server.tool(
23775
23831
  content: [{ type: "text", text: await getPublishedArtefactText(params.artefact_id) }]
23776
23832
  })
23777
23833
  );
23834
+ server.tool(
23835
+ "artefacts_analytics",
23836
+ "Get Augmented Live viewer analytics (views, unique visitors, dwell time, 30-day trend) for the agent's published work. Pass artefact_id for one artefact, or project_id for a whole series/project (total + per-episode breakdown + combined trend). Exactly one of artefact_id or project_id is required. Requires Augmented Live Premium.",
23837
+ {
23838
+ artefact_id: external_exports.string().uuid().optional().describe("Analytics for a single published artefact (id from artefacts_list / artefacts_resolve)."),
23839
+ project_id: external_exports.string().uuid().optional().describe("Rolled-up analytics for a whole project/series (id from projects_list): total + per-episode + trend.")
23840
+ },
23841
+ async (params) => ({
23842
+ content: [{ type: "text", text: await getArtefactAnalyticsText(params) }]
23843
+ })
23844
+ );
23778
23845
  server.tool(
23779
23846
  "artefacts_get_source_chunk",
23780
23847
  "Fetch a chunk of source HTML for a published artefact. Use this to assemble the HTML for modification when artefacts_get reports a non-zero source_html_length.",
@@ -39924,15 +39924,12 @@ var FLAG_REGISTRY = [
39924
39924
  // spend control, so mutations require explicit confirmation.
39925
39925
  sensitive: true
39926
39926
  },
39927
- {
39928
- key: "team-scoped-visibility",
39929
- description: "Restrict team-scoped reads to direct team members (ENG-7122). By default the API resolves X-Team-Slug for any org member (org-membership fallback), so a plain org member can read a sibling team they are not on (agents, kanban, run-derived spend) because the service-role API filters only by the org-resolved team_id. When ON for an org, the org-membership fallback is dropped for plain org member/viewer (they may only resolve teams they are a direct team_members of), while org owner/admin keep cross-team reach and the admin-onboarding bypass is preserved. The GET /teams listing is narrowed the same way. Boolean gate; default off (current behaviour).",
39930
- flagType: "boolean",
39931
- defaultValue: false,
39932
- // Tightening control: turning this flag OFF *relaxes* a visibility restriction,
39933
- // so mutations require explicit confirmation per ADR-0022 §4.
39934
- sensitive: true
39935
- },
39927
+ // ENG-7754: 'team-scoped-visibility' (ENG-7122) archived - the restriction it
39928
+ // gated is now the unconditional default for every org (a plain org
39929
+ // member/viewer only sees/resolves teams they directly belong to; owner/admin
39930
+ // keep cross-team reach). Enforced in code (routes/teams.ts, middleware/auth.ts,
39931
+ // lib/team-resolver.ts), no longer flag-gated. Override rows dropped by
39932
+ // migration 20260714000005. flag-archive-allow: team-scoped-visibility superseded by unconditional default (ENG-7754)
39936
39933
  {
39937
39934
  key: "channel-busy-ack",
39938
39935
  description: "Busy-but-alive ack notices when an agent is mid-task (ENG-6180). Boolean gate; ships dark.",
@@ -36,7 +36,7 @@ import {
36
36
  writeDirectChatSessionState,
37
37
  writeEgressAllowlist,
38
38
  writePersistentClaudeWrapper
39
- } from "./chunk-QVYGYEBX.js";
39
+ } from "./chunk-62LAROZ4.js";
40
40
  import "./chunk-XWVM4KPK.js";
41
41
  export {
42
42
  EGRESS_BASELINE_DOMAINS,
@@ -77,4 +77,4 @@ export {
77
77
  writeEgressAllowlist,
78
78
  writePersistentClaudeWrapper
79
79
  };
80
- //# sourceMappingURL=persistent-session-MJNQEARD.js.map
80
+ //# sourceMappingURL=persistent-session-QQXENK3Z.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-QVYGYEBX.js";
3
+ } from "./chunk-62LAROZ4.js";
4
4
  import "./chunk-XWVM4KPK.js";
5
5
 
6
6
  // src/lib/responsiveness-probe.ts
@@ -427,4 +427,4 @@ export {
427
427
  readAndResetSlackReplyBindingClassifications,
428
428
  readAndResetSlackReplyTargetClassifications
429
429
  };
430
- //# sourceMappingURL=responsiveness-probe-I4T3HL7C.js.map
430
+ //# sourceMappingURL=responsiveness-probe-33SVBGM7.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.307",
3
+ "version": "0.28.309",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {