@integrity-labs/agt-cli 0.28.1242 → 0.28.1244

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.
Files changed (31) hide show
  1. package/dist/bin/agt.js +6 -6
  2. package/dist/{chunk-CEGRVIOK.js → chunk-4D5PTVNR.js} +3 -3
  3. package/dist/{chunk-DZYHXUIG.js → chunk-6YZZ2WN2.js} +2 -2
  4. package/dist/{chunk-6TCXHVTP.js → chunk-AB47AXD6.js} +2 -2
  5. package/dist/{chunk-EJWFVHMV.js → chunk-BCYFOHFP.js} +5 -5
  6. package/dist/{chunk-JPRHN524.js → chunk-UAAR6VJI.js} +7 -3
  7. package/dist/chunk-UAAR6VJI.js.map +1 -0
  8. package/dist/{claude-code-updater-IDCCFG5Q.js → claude-code-updater-2QU66VPT.js} +3 -3
  9. package/dist/{claude-pair-runtime-OHUHLGN2.js → claude-pair-runtime-DR7HRJNI.js} +3 -3
  10. package/dist/lib/manager-worker.js +19 -19
  11. package/dist/mcp/direct-chat-channel.js +87 -64
  12. package/dist/mcp/index.js +9 -5
  13. package/dist/mcp/origami.js +6 -2
  14. package/dist/mcp/slack-channel.js +12 -5
  15. package/dist/mcp/teams-channel.js +6 -3
  16. package/dist/mcp/telegram-channel.js +12 -5
  17. package/dist/mcp/whatsapp-channel.js +6 -3
  18. package/dist/{persistent-session-VWDKTU3A.js → persistent-session-YJSZWSLQ.js} +4 -4
  19. package/dist/{responsiveness-probe-T2DI3OK3.js → responsiveness-probe-SPEEY2LI.js} +4 -4
  20. package/dist/{session-auth-dead-QRZG5AI7.js → session-auth-dead-TODAGWTJ.js} +3 -3
  21. package/package.json +1 -1
  22. package/dist/chunk-JPRHN524.js.map +0 -1
  23. /package/dist/{chunk-CEGRVIOK.js.map → chunk-4D5PTVNR.js.map} +0 -0
  24. /package/dist/{chunk-DZYHXUIG.js.map → chunk-6YZZ2WN2.js.map} +0 -0
  25. /package/dist/{chunk-6TCXHVTP.js.map → chunk-AB47AXD6.js.map} +0 -0
  26. /package/dist/{chunk-EJWFVHMV.js.map → chunk-BCYFOHFP.js.map} +0 -0
  27. /package/dist/{claude-code-updater-IDCCFG5Q.js.map → claude-code-updater-2QU66VPT.js.map} +0 -0
  28. /package/dist/{claude-pair-runtime-OHUHLGN2.js.map → claude-pair-runtime-DR7HRJNI.js.map} +0 -0
  29. /package/dist/{persistent-session-VWDKTU3A.js.map → persistent-session-YJSZWSLQ.js.map} +0 -0
  30. /package/dist/{responsiveness-probe-T2DI3OK3.js.map → responsiveness-probe-SPEEY2LI.js.map} +0 -0
  31. /package/dist/{session-auth-dead-QRZG5AI7.js.map → session-auth-dead-TODAGWTJ.js.map} +0 -0
@@ -13,9 +13,9 @@ import {
13
13
  probeClaudeInstalls,
14
14
  readsAsNativeInstall,
15
15
  shouldRunClaudeCodeUpdater
16
- } from "./chunk-DZYHXUIG.js";
16
+ } from "./chunk-6YZZ2WN2.js";
17
17
  import "./chunk-XWVM4KPK.js";
18
- import "./chunk-JPRHN524.js";
18
+ import "./chunk-UAAR6VJI.js";
19
19
  import "./chunk-AIUIMEUS.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
@@ -34,4 +34,4 @@ export {
34
34
  readsAsNativeInstall,
35
35
  shouldRunClaudeCodeUpdater
36
36
  };
37
- //# sourceMappingURL=claude-code-updater-IDCCFG5Q.js.map
37
+ //# sourceMappingURL=claude-code-updater-2QU66VPT.js.map
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  redactPaneFrame,
10
10
  sanitizeTerminalFrame
11
- } from "./chunk-JPRHN524.js";
11
+ } from "./chunk-UAAR6VJI.js";
12
12
  import {
13
13
  CLAUDE_CONFIG_DIR_ENV,
14
14
  claudeConfigDirFor,
@@ -321,7 +321,7 @@ async function spawnPairSession(session) {
321
321
  return { ok: true };
322
322
  } catch {
323
323
  }
324
- const { resolveClaudeBinary } = await import("./persistent-session-VWDKTU3A.js");
324
+ const { resolveClaudeBinary } = await import("./persistent-session-YJSZWSLQ.js");
325
325
  const claudeBin = resolveClaudeBinary();
326
326
  const pairEnv = {
327
327
  ...process.env,
@@ -836,4 +836,4 @@ export {
836
836
  startClaudePair,
837
837
  submitClaudePairCode
838
838
  };
839
- //# sourceMappingURL=claude-pair-runtime-OHUHLGN2.js.map
839
+ //# sourceMappingURL=claude-pair-runtime-DR7HRJNI.js.map
@@ -85,7 +85,7 @@ import {
85
85
  tripClass,
86
86
  writeEtcEnvironment,
87
87
  writeProfileDScript
88
- } from "../chunk-EJWFVHMV.js";
88
+ } from "../chunk-BCYFOHFP.js";
89
89
  import {
90
90
  CLAUDE_CODE_SECURITY_FLOOR,
91
91
  SELF_UPDATE_TIMEOUTS,
@@ -99,7 +99,7 @@ import {
99
99
  runSafeCleanup,
100
100
  tightestDiskStat,
101
101
  withPackageCacheLock
102
- } from "../chunk-DZYHXUIG.js";
102
+ } from "../chunk-6YZZ2WN2.js";
103
103
  import {
104
104
  rewriteSupervisorApiKey,
105
105
  supervisorChannelsRefusing
@@ -195,7 +195,7 @@ import {
195
195
  webFetchBaselineValue,
196
196
  webFetchRestartNeeded,
197
197
  writeEgressAllowlist
198
- } from "../chunk-CEGRVIOK.js";
198
+ } from "../chunk-4D5PTVNR.js";
199
199
  import {
200
200
  isAgentIdle,
201
201
  isStaleForToday,
@@ -206,7 +206,7 @@ import {
206
206
  subagentActivityAgeSeconds,
207
207
  subagentTranscriptDir,
208
208
  transcriptActivityAgeSeconds
209
- } from "../chunk-6TCXHVTP.js";
209
+ } from "../chunk-AB47AXD6.js";
210
210
  import {
211
211
  classifyUnanswerablePane,
212
212
  focusedConfirmDialogBlock,
@@ -337,7 +337,7 @@ import {
337
337
  stabiliseResetInstant,
338
338
  sumTranscriptUsageInWindow,
339
339
  summarizeTranscriptActivity
340
- } from "../chunk-JPRHN524.js";
340
+ } from "../chunk-UAAR6VJI.js";
341
341
  import {
342
342
  CLAUDE_CONFIG_DIR_ENV,
343
343
  claudeConfigDirFor,
@@ -15871,7 +15871,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
15871
15871
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
15872
15872
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
15873
15873
  async function channelInboundActivityAgeSecondsFor(codeName) {
15874
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-T2DI3OK3.js");
15874
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-SPEEY2LI.js");
15875
15875
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
15876
15876
  if (newest === null) return null;
15877
15877
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -16686,7 +16686,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
16686
16686
  var lastVersionCheckAt = 0;
16687
16687
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
16688
16688
  var lastResponsivenessProbeAt = 0;
16689
- var agtCliVersion = true ? "0.28.1242" : "dev";
16689
+ var agtCliVersion = true ? "0.28.1244" : "dev";
16690
16690
  function resolveBrewPath(execFileSync3) {
16691
16691
  try {
16692
16692
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -18683,7 +18683,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
18683
18683
  if (codeNames.length === 0) return;
18684
18684
  void (async () => {
18685
18685
  try {
18686
- const { collectDiagnostics } = await import("../persistent-session-VWDKTU3A.js");
18686
+ const { collectDiagnostics } = await import("../persistent-session-YJSZWSLQ.js");
18687
18687
  await api.post("/host/heartbeat", {
18688
18688
  host_id: hostId,
18689
18689
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -18826,7 +18826,7 @@ async function pollCycleInner() {
18826
18826
  }
18827
18827
  try {
18828
18828
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
18829
- const { collectDiagnostics } = await import("../persistent-session-VWDKTU3A.js");
18829
+ const { collectDiagnostics } = await import("../persistent-session-YJSZWSLQ.js");
18830
18830
  const diagCodeNames = [...agentState.persistentSessionAgents];
18831
18831
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor) : void 0;
18832
18832
  let tailscaleHostname;
@@ -19091,7 +19091,7 @@ async function pollCycleInner() {
19091
19091
  }
19092
19092
  try {
19093
19093
  const desiredClaudeCodeVersion = hbResp?.desired_claude_code_version?.trim();
19094
- const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-IDCCFG5Q.js");
19094
+ const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-2QU66VPT.js");
19095
19095
  const securityFloor = currentSecurityFloor();
19096
19096
  claudeUpdaterInFlight = true;
19097
19097
  if (desiredClaudeCodeVersion && (claudePairLoop.busy || claudePairingInProgress())) {
@@ -19126,7 +19126,7 @@ async function pollCycleInner() {
19126
19126
  collectPanelessActivityProbes,
19127
19127
  getResponsivenessIntervalMs,
19128
19128
  occupancyQualificationClassifications
19129
- } = await import("../responsiveness-probe-T2DI3OK3.js");
19129
+ } = await import("../responsiveness-probe-SPEEY2LI.js");
19130
19130
  const probeIntervalMs = getResponsivenessIntervalMs();
19131
19131
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
19132
19132
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -19243,7 +19243,7 @@ async function pollCycleInner() {
19243
19243
  collectResponsivenessProbes,
19244
19244
  livePendingInboundOldestAgeSeconds,
19245
19245
  parkPendingInbound
19246
- } = await import("../responsiveness-probe-T2DI3OK3.js");
19246
+ } = await import("../responsiveness-probe-SPEEY2LI.js");
19247
19247
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-5PCBGRNY.js");
19248
19248
  const wedgeNow = /* @__PURE__ */ new Date();
19249
19249
  const liveAgents = agentState.persistentSessionAgents;
@@ -19529,7 +19529,7 @@ async function pollCycleInner() {
19529
19529
  }
19530
19530
  }
19531
19531
  );
19532
- const { parkPendingInbound } = await import("../responsiveness-probe-T2DI3OK3.js");
19532
+ const { parkPendingInbound } = await import("../responsiveness-probe-SPEEY2LI.js");
19533
19533
  const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
19534
19534
  paneFatalStreak.delete(codeName);
19535
19535
  paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
@@ -19560,7 +19560,7 @@ async function pollCycleInner() {
19560
19560
  TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
19561
19561
  bindSourceEscalations
19562
19562
  } = await import("../transcript-mount-health-OHE6IVJV.js");
19563
- const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-VWDKTU3A.js");
19563
+ const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-YJSZWSLQ.js");
19564
19564
  const mountConfig = resolveTranscriptMountConfig();
19565
19565
  const liveAgents = agentState.persistentSessionAgents;
19566
19566
  for (const tracked of [
@@ -19725,7 +19725,7 @@ async function pollCycleInner() {
19725
19725
  }
19726
19726
  try {
19727
19727
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
19728
- const { probeSessionAuth } = await import("../session-auth-dead-QRZG5AI7.js");
19728
+ const { probeSessionAuth } = await import("../session-auth-dead-TODAGWTJ.js");
19729
19729
  const observations = [];
19730
19730
  const pendingCacheCommits = [];
19731
19731
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -24479,7 +24479,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
24479
24479
  try {
24480
24480
  const freshId = rotateSessionForWedge(codeName);
24481
24481
  consecutiveWedgeCycles.delete(codeName);
24482
- const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-T2DI3OK3.js");
24482
+ const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-SPEEY2LI.js");
24483
24483
  const { parked, deadLettered } = parkForRestart(codeName, /* @__PURE__ */ new Date());
24484
24484
  const parkNote = parked > 0 ? `, ${parked} inbound parked` : "";
24485
24485
  const deadNote = deadLettered > 0 ? `, ${deadLettered} undeliverable dead-lettered` : "";
@@ -24522,7 +24522,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
24522
24522
  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}`));
24523
24523
  void (async () => {
24524
24524
  try {
24525
- const { collectDiagnostics } = await import("../persistent-session-VWDKTU3A.js");
24525
+ const { collectDiagnostics } = await import("../persistent-session-YJSZWSLQ.js");
24526
24526
  await api.post("/host/heartbeat", {
24527
24527
  host_id: hostId,
24528
24528
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -24573,7 +24573,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
24573
24573
  }
24574
24574
  try {
24575
24575
  const hostId = await getHostId();
24576
- const { collectDiagnostics } = await import("../persistent-session-VWDKTU3A.js");
24576
+ const { collectDiagnostics } = await import("../persistent-session-YJSZWSLQ.js");
24577
24577
  await api.post("/host/heartbeat", {
24578
24578
  host_id: hostId,
24579
24579
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -25275,7 +25275,7 @@ async function processClaudePairSessions(agents) {
25275
25275
  snapshotPairConfig,
25276
25276
  // ENG-11659: result -> report body + the manager.log line that records it.
25277
25277
  planPairStartReport
25278
- } = await import("../claude-pair-runtime-OHUHLGN2.js");
25278
+ } = await import("../claude-pair-runtime-DR7HRJNI.js");
25279
25279
  const { resetClaudeSignin, describeSigninResetForLog, describeSigninResetFailure } = await import("../claude-signin-reset-6IJMMVYG.js");
25280
25280
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
25281
25281
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
@@ -38026,6 +38026,7 @@ var ROLE_PERMISSIONS = {
38026
38026
  "project.view",
38027
38027
  "project.create",
38028
38028
  "project.edit",
38029
+ "project.move",
38029
38030
  "workflow.author",
38030
38031
  "workflow.promote",
38031
38032
  "guardrail.author"
@@ -38054,6 +38055,7 @@ var ROLE_PERMISSIONS = {
38054
38055
  "project.view",
38055
38056
  "project.create",
38056
38057
  "project.edit",
38058
+ "project.move",
38057
38059
  "workflow.author",
38058
38060
  "workflow.promote",
38059
38061
  "guardrail.author"
@@ -40973,7 +40975,7 @@ var INTEGRATION_REGISTRY = [
40973
40975
  id: "video-gen",
40974
40976
  name: "Video Generation",
40975
40977
  category: "media",
40976
- description: 'AI video generation from a text prompt or an input image. An agent passes a prompt (plus optionally image_url) to generate_video and gets back a short generated video with audio, which it can deliver to a chat channel. Ninjafy manages the model access for you - there is no key to enter. Generation runs direct against xAI Grok Imagine: text-to-video on the base grok-imagine-video model, image-to-video on grok-imagine-video-1.5, or both modes on the lower-cost grok-imagine-video-1.5-lite when the agent asks for model "lite". It is a PREMIUM, usage-billed capability: gated on a per-org opt-in and a monthly USD budget, and metered per second of generated video.',
40978
+ description: 'AI video generation from a text prompt or an input image. An agent passes a prompt (plus optionally image_url) to generate_video and gets back a short generated video with audio, which it can deliver to a chat channel. Ninjafy manages the model access for you - there is no key to enter. Generation runs direct against xAI Grok Imagine: text-to-video on the base grok-imagine-video model, image-to-video on grok-imagine-video-1.5, or both modes on the lower-cost grok-imagine-video-1.5-lite when the agent asks for model "lite". When the agent asks for model "omni", text-to-video runs on Google Gemini Omni 1.2 Flash instead (720p, 3-15 whole seconds), so the prompt is sent to Google rather than xAI. It is a PREMIUM, usage-billed capability: gated on a per-org opt-in and a monthly USD budget, and metered per second of generated video.',
40977
40979
  // Platform-key model (mirrors Grok Voice / ADR-0031): Ninjafy holds one xAI
40978
40980
  // account key (XAI_API_KEY) and every customer render bills back to it, so
40979
40981
  // auth is `none` - customers never enter a key.
@@ -41013,7 +41015,9 @@ var INTEGRATION_REGISTRY = [
41013
41015
  // and reaches 1080p in either (upscaled from 720p), so all three map.
41014
41016
  { event_type: "grok_imagine_video_1_5_lite_480p", unit: "second" },
41015
41017
  { event_type: "grok_imagine_video_1_5_lite_720p", unit: "second" },
41016
- { event_type: "grok_imagine_video_1_5_lite_1080p", unit: "second" }
41018
+ { event_type: "grok_imagine_video_1_5_lite_1080p", unit: "second" },
41019
+ // model "omni": Google's gemini-omni-1.2-flash, text-to-video at 720p only for now.
41020
+ { event_type: "gemini_omni_1_2_flash_720p", unit: "second" }
41017
41021
  ]
41018
41022
  }
41019
41023
  },
@@ -47582,14 +47586,58 @@ function buildDirectChatChannelMeta(input) {
47582
47586
  };
47583
47587
  }
47584
47588
 
47589
+ // src/turn-context.ts
47590
+ import { mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
47591
+ import { homedir } from "os";
47592
+ import { dirname as dirname3, join as join6 } from "path";
47593
+
47594
+ // ../core/dist/provisioning/frameworks/claudecode/agent-dir-alias.js
47595
+ import { isAbsolute, join as join3, relative, sep } from "path";
47596
+ var VALID_CODE_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
47597
+ var VALID_AGENT_ID = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
47598
+ var INITIATOR_BASENAME = ".current-turn-initiator.json";
47599
+ function isSafeAgentSegment(segment) {
47600
+ return VALID_CODE_NAME.test(segment) || VALID_AGENT_ID.test(segment);
47601
+ }
47602
+ function initiatorDirSegment(initiatorFile, homeDir) {
47603
+ const rel = relative(join3(homeDir, ".augmented"), initiatorFile);
47604
+ if (!rel || isAbsolute(rel))
47605
+ return null;
47606
+ const parts = rel.split(sep);
47607
+ if (parts.length !== 2 || parts[1] !== INITIATOR_BASENAME)
47608
+ return null;
47609
+ const segment = parts[0];
47610
+ if (segment === void 0)
47611
+ return null;
47612
+ return isSafeAgentSegment(segment) ? segment : null;
47613
+ }
47614
+ function resolveAgentDirAlias(input) {
47615
+ const { codeName, turnInitiatorFile, agentId, homeDir } = input;
47616
+ const codeNameTrimmed = typeof codeName === "string" ? codeName.trim() : "";
47617
+ if (codeNameTrimmed && VALID_CODE_NAME.test(codeNameTrimmed)) {
47618
+ return join3(homeDir, ".augmented", codeNameTrimmed);
47619
+ }
47620
+ const initiator = typeof turnInitiatorFile === "string" ? turnInitiatorFile.trim() : "";
47621
+ if (initiator) {
47622
+ const segment = initiatorDirSegment(initiator, homeDir);
47623
+ if (segment)
47624
+ return join3(homeDir, ".augmented", segment);
47625
+ }
47626
+ const agentIdTrimmed = typeof agentId === "string" ? agentId.trim() : "";
47627
+ if (agentIdTrimmed && VALID_AGENT_ID.test(agentIdTrimmed)) {
47628
+ return join3(homeDir, ".augmented", agentIdTrimmed);
47629
+ }
47630
+ return null;
47631
+ }
47632
+
47585
47633
  // src/turn-initiator-marker.ts
47586
47634
  import { writeFileSync as writeFileSync2, readFileSync as readFileSync3, mkdirSync as mkdirSync2, renameSync as renameSync2 } from "fs";
47587
- import { dirname as dirname2, join as join3 } from "path";
47635
+ import { dirname as dirname2, join as join4 } from "path";
47588
47636
  var TURN_INITIATOR_MAX_AGE_MS = 5 * 60 * 1e3;
47589
47637
  var TURN_INITIATOR_LEDGER_MAX_ENTRIES = 20;
47590
47638
  var TURN_INITIATOR_LEDGER_FILENAME = ".turn-initiator-ledger.json";
47591
47639
  function turnInitiatorLedgerPath(singleSlotFile) {
47592
- return join3(dirname2(singleSlotFile), TURN_INITIATOR_LEDGER_FILENAME);
47640
+ return join4(dirname2(singleSlotFile), TURN_INITIATOR_LEDGER_FILENAME);
47593
47641
  }
47594
47642
  function foldTurnInitiatorLedger(existing, marker, maxAgeMs = TURN_INITIATOR_MAX_AGE_MS, maxEntries = TURN_INITIATOR_LEDGER_MAX_ENTRIES) {
47595
47643
  const now = marker.ts;
@@ -47608,6 +47656,7 @@ function foldTurnInitiatorLedger(existing, marker, maxAgeMs = TURN_INITIATOR_MAX
47608
47656
  ...marker.chat_kind ? { chat_kind: marker.chat_kind } : {},
47609
47657
  ...marker.chat_id ? { chat_id: marker.chat_id } : {},
47610
47658
  ...marker.unattributed ? { unattributed: true } : {},
47659
+ ...marker.notice ? { notice: true } : {},
47611
47660
  ...marker.loop_tick ? { loop_tick: true } : {},
47612
47661
  ts: marker.ts
47613
47662
  });
@@ -47644,50 +47693,6 @@ function writeTurnInitiatorMarker(input) {
47644
47693
  }
47645
47694
  }
47646
47695
 
47647
- // src/turn-context.ts
47648
- import { mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
47649
- import { homedir } from "os";
47650
- import { dirname as dirname3, join as join6 } from "path";
47651
-
47652
- // ../core/dist/provisioning/frameworks/claudecode/agent-dir-alias.js
47653
- import { isAbsolute, join as join4, relative, sep } from "path";
47654
- var VALID_CODE_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
47655
- var VALID_AGENT_ID = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
47656
- var INITIATOR_BASENAME = ".current-turn-initiator.json";
47657
- function isSafeAgentSegment(segment) {
47658
- return VALID_CODE_NAME.test(segment) || VALID_AGENT_ID.test(segment);
47659
- }
47660
- function initiatorDirSegment(initiatorFile, homeDir) {
47661
- const rel = relative(join4(homeDir, ".augmented"), initiatorFile);
47662
- if (!rel || isAbsolute(rel))
47663
- return null;
47664
- const parts = rel.split(sep);
47665
- if (parts.length !== 2 || parts[1] !== INITIATOR_BASENAME)
47666
- return null;
47667
- const segment = parts[0];
47668
- if (segment === void 0)
47669
- return null;
47670
- return isSafeAgentSegment(segment) ? segment : null;
47671
- }
47672
- function resolveAgentDirAlias(input) {
47673
- const { codeName, turnInitiatorFile, agentId, homeDir } = input;
47674
- const codeNameTrimmed = typeof codeName === "string" ? codeName.trim() : "";
47675
- if (codeNameTrimmed && VALID_CODE_NAME.test(codeNameTrimmed)) {
47676
- return join4(homeDir, ".augmented", codeNameTrimmed);
47677
- }
47678
- const initiator = typeof turnInitiatorFile === "string" ? turnInitiatorFile.trim() : "";
47679
- if (initiator) {
47680
- const segment = initiatorDirSegment(initiator, homeDir);
47681
- if (segment)
47682
- return join4(homeDir, ".augmented", segment);
47683
- }
47684
- const agentIdTrimmed = typeof agentId === "string" ? agentId.trim() : "";
47685
- if (agentIdTrimmed && VALID_AGENT_ID.test(agentIdTrimmed)) {
47686
- return join4(homeDir, ".augmented", agentIdTrimmed);
47687
- }
47688
- return null;
47689
- }
47690
-
47691
47696
  // src/scheduled-turn-marker.ts
47692
47697
  import { readFileSync as readFileSync4, unlinkSync } from "fs";
47693
47698
  import { join as join5 } from "path";
@@ -47711,11 +47716,13 @@ function writeUnattributedTurnMarker(channel, opts = {}) {
47711
47716
  updateTurnInitiatorLedger(file, {
47712
47717
  channel,
47713
47718
  sender_id: "",
47714
- // ENG-11979: its own ledger key. The ledger keeps one entry per (channel, ref),
47715
- // so a tick sharing a key would overwrite a stricter unattributed notice.
47716
- channel_ref: opts.loopTick ? "loop-tick" : "unattributed",
47719
+ // ENG-11979 / ENG-11553: each kind gets its own ledger key. The ledger keeps one
47720
+ // entry per (channel, ref), so a tick or a notice sharing the plain key would
47721
+ // overwrite a stricter unattributed entry that blocks regardless of order.
47722
+ channel_ref: opts.loopTick ? "loop-tick" : opts.notice ? "unattributed-notice" : "unattributed",
47717
47723
  unattributed: true,
47718
47724
  ...opts.loopTick ? { loop_tick: true } : {},
47725
+ ...opts.notice ? { notice: true } : {},
47719
47726
  ts: opts.now ?? Date.now()
47720
47727
  });
47721
47728
  } catch {
@@ -47733,6 +47740,34 @@ function resolveTurnInitiatorFile(env2 = process.env, home = homedir()) {
47733
47740
  return dir ? join6(dir, TURN_INITIATOR_MARKER_FILENAME) : null;
47734
47741
  }
47735
47742
 
47743
+ // src/direct-chat-turn-marker.ts
47744
+ var FYI_NOTICE_PAYLOAD_KINDS = /* @__PURE__ */ new Set([]);
47745
+ function classifyDirectChatNotice(payload, fyiKinds = FYI_NOTICE_PAYLOAD_KINDS) {
47746
+ if (isKanbanCheckPayload(payload)) return "loop_tick";
47747
+ const kind = typeof payload === "object" && payload !== null ? payload.kind : void 0;
47748
+ return typeof kind === "string" && fyiKinds.has(kind) ? "fyi" : "blocking";
47749
+ }
47750
+ function writeDirectChatTurnMarker(msg) {
47751
+ const isNotice = msg.kind === "notice";
47752
+ if (!isNotice && msg.sender_id) {
47753
+ writeTurnInitiatorMarker({
47754
+ channel: "direct-chat",
47755
+ sender_id: msg.sender_id,
47756
+ channel_ref: msg.session_id,
47757
+ // ENG-11348: one sender per session from this side. Whether the TRANSCRIPT is
47758
+ // private (only for a manager-only agent) is decided server-side, so 'direct'
47759
+ // here is not the last word.
47760
+ chat_kind: "direct"
47761
+ });
47762
+ } else {
47763
+ const kind = isNotice ? classifyDirectChatNotice(msg.payload) : "blocking";
47764
+ writeUnattributedTurnMarker(
47765
+ "direct-chat",
47766
+ kind === "loop_tick" ? { loopTick: true } : { notice: kind === "fyi" }
47767
+ );
47768
+ }
47769
+ }
47770
+
47736
47771
  // src/direct-chat-pending-inbound.ts
47737
47772
  import {
47738
47773
  existsSync as existsSync2,
@@ -56483,19 +56518,7 @@ async function pollForMessages(sinceMs) {
56483
56518
  );
56484
56519
  scheduleDirectChatBusyAck(msg.session_id, msg.id, arrivedWhileBusy);
56485
56520
  }
56486
- if (!isNotice && msg.sender_id) {
56487
- writeTurnInitiatorMarker({
56488
- channel: "direct-chat",
56489
- sender_id: msg.sender_id,
56490
- channel_ref: msg.session_id,
56491
- // ENG-11348: one sender per session from this side. Whether the
56492
- // TRANSCRIPT is private (only for a manager-only agent) is decided
56493
- // server-side, so 'direct' here is not the last word.
56494
- chat_kind: "direct"
56495
- });
56496
- } else {
56497
- writeUnattributedTurnMarker("direct-chat", { loopTick: isNotice && isKanbanCheckPayload(msg.payload) });
56498
- }
56521
+ writeDirectChatTurnMarker(msg);
56499
56522
  if (isNotice) {
56500
56523
  try {
56501
56524
  const res2 = await apiPost("/host/direct-chat/consume", {
package/dist/mcp/index.js CHANGED
@@ -24071,6 +24071,7 @@ var ROLE_PERMISSIONS = {
24071
24071
  "project.view",
24072
24072
  "project.create",
24073
24073
  "project.edit",
24074
+ "project.move",
24074
24075
  "workflow.author",
24075
24076
  "workflow.promote",
24076
24077
  "guardrail.author"
@@ -24099,6 +24100,7 @@ var ROLE_PERMISSIONS = {
24099
24100
  "project.view",
24100
24101
  "project.create",
24101
24102
  "project.edit",
24103
+ "project.move",
24102
24104
  "workflow.author",
24103
24105
  "workflow.promote",
24104
24106
  "guardrail.author"
@@ -27069,7 +27071,7 @@ var INTEGRATION_REGISTRY = [
27069
27071
  id: "video-gen",
27070
27072
  name: "Video Generation",
27071
27073
  category: "media",
27072
- description: 'AI video generation from a text prompt or an input image. An agent passes a prompt (plus optionally image_url) to generate_video and gets back a short generated video with audio, which it can deliver to a chat channel. Ninjafy manages the model access for you - there is no key to enter. Generation runs direct against xAI Grok Imagine: text-to-video on the base grok-imagine-video model, image-to-video on grok-imagine-video-1.5, or both modes on the lower-cost grok-imagine-video-1.5-lite when the agent asks for model "lite". It is a PREMIUM, usage-billed capability: gated on a per-org opt-in and a monthly USD budget, and metered per second of generated video.',
27074
+ description: 'AI video generation from a text prompt or an input image. An agent passes a prompt (plus optionally image_url) to generate_video and gets back a short generated video with audio, which it can deliver to a chat channel. Ninjafy manages the model access for you - there is no key to enter. Generation runs direct against xAI Grok Imagine: text-to-video on the base grok-imagine-video model, image-to-video on grok-imagine-video-1.5, or both modes on the lower-cost grok-imagine-video-1.5-lite when the agent asks for model "lite". When the agent asks for model "omni", text-to-video runs on Google Gemini Omni 1.2 Flash instead (720p, 3-15 whole seconds), so the prompt is sent to Google rather than xAI. It is a PREMIUM, usage-billed capability: gated on a per-org opt-in and a monthly USD budget, and metered per second of generated video.',
27073
27075
  // Platform-key model (mirrors Grok Voice / ADR-0031): Ninjafy holds one xAI
27074
27076
  // account key (XAI_API_KEY) and every customer render bills back to it, so
27075
27077
  // auth is `none` - customers never enter a key.
@@ -27109,7 +27111,9 @@ var INTEGRATION_REGISTRY = [
27109
27111
  // and reaches 1080p in either (upscaled from 720p), so all three map.
27110
27112
  { event_type: "grok_imagine_video_1_5_lite_480p", unit: "second" },
27111
27113
  { event_type: "grok_imagine_video_1_5_lite_720p", unit: "second" },
27112
- { event_type: "grok_imagine_video_1_5_lite_1080p", unit: "second" }
27114
+ { event_type: "grok_imagine_video_1_5_lite_1080p", unit: "second" },
27115
+ // model "omni": Google's gemini-omni-1.2-flash, text-to-video at 720p only for now.
27116
+ { event_type: "gemini_omni_1_2_flash_720p", unit: "second" }
27113
27117
  ]
27114
27118
  }
27115
27119
  },
@@ -37676,7 +37680,8 @@ function freshUnattributed(ledger, now, maxAgeMs, newestSenderTs) {
37676
37680
  if (!ledger || !Array.isArray(ledger.entries)) return false;
37677
37681
  return ledger.entries.some((e) => {
37678
37682
  const r = e;
37679
- if (r?.loop_tick === true && typeof r.ts === "number" && r.ts < newestSenderTs) return false;
37683
+ const olderPass = r?.loop_tick === true || r?.notice === true;
37684
+ if (olderPass && typeof r.ts === "number" && r.ts < newestSenderTs) return false;
37680
37685
  return r?.unattributed === true && typeof r.ts === "number" && Number.isFinite(r.ts) && now - r.ts >= 0 && now - r.ts <= maxAgeMs;
37681
37686
  });
37682
37687
  }
@@ -37718,9 +37723,8 @@ function readTurnContextUnguarded(opts) {
37718
37723
  now
37719
37724
  );
37720
37725
  if (senders.length === 0) return { v: 1, kind: "none" };
37721
- const newestSenderTs = Math.max(...senders.map((s) => s.ts));
37722
- if (scheduled || freshUnattributed(ledger, now, maxAgeMs, newestSenderTs)) return { v: 1, kind: "ambiguous" };
37723
37726
  const latest = [...senders].sort((a, b) => b.ts - a.ts)[0];
37727
+ if (scheduled || freshUnattributed(ledger, now, maxAgeMs, latest.ts)) return { v: 1, kind: "ambiguous" };
37724
37728
  const same = senders.every(
37725
37729
  (s) => s.channel === latest.channel && s.sender_id === latest.sender_id && s.chat_kind === latest.chat_kind && s.chat_id === latest.chat_id
37726
37730
  );
@@ -38198,6 +38198,7 @@ var ROLE_PERMISSIONS = {
38198
38198
  "project.view",
38199
38199
  "project.create",
38200
38200
  "project.edit",
38201
+ "project.move",
38201
38202
  "workflow.author",
38202
38203
  "workflow.promote",
38203
38204
  "guardrail.author"
@@ -38226,6 +38227,7 @@ var ROLE_PERMISSIONS = {
38226
38227
  "project.view",
38227
38228
  "project.create",
38228
38229
  "project.edit",
38230
+ "project.move",
38229
38231
  "workflow.author",
38230
38232
  "workflow.promote",
38231
38233
  "guardrail.author"
@@ -41130,7 +41132,7 @@ var INTEGRATION_REGISTRY = [
41130
41132
  id: "video-gen",
41131
41133
  name: "Video Generation",
41132
41134
  category: "media",
41133
- description: 'AI video generation from a text prompt or an input image. An agent passes a prompt (plus optionally image_url) to generate_video and gets back a short generated video with audio, which it can deliver to a chat channel. Ninjafy manages the model access for you - there is no key to enter. Generation runs direct against xAI Grok Imagine: text-to-video on the base grok-imagine-video model, image-to-video on grok-imagine-video-1.5, or both modes on the lower-cost grok-imagine-video-1.5-lite when the agent asks for model "lite". It is a PREMIUM, usage-billed capability: gated on a per-org opt-in and a monthly USD budget, and metered per second of generated video.',
41135
+ description: 'AI video generation from a text prompt or an input image. An agent passes a prompt (plus optionally image_url) to generate_video and gets back a short generated video with audio, which it can deliver to a chat channel. Ninjafy manages the model access for you - there is no key to enter. Generation runs direct against xAI Grok Imagine: text-to-video on the base grok-imagine-video model, image-to-video on grok-imagine-video-1.5, or both modes on the lower-cost grok-imagine-video-1.5-lite when the agent asks for model "lite". When the agent asks for model "omni", text-to-video runs on Google Gemini Omni 1.2 Flash instead (720p, 3-15 whole seconds), so the prompt is sent to Google rather than xAI. It is a PREMIUM, usage-billed capability: gated on a per-org opt-in and a monthly USD budget, and metered per second of generated video.',
41134
41136
  // Platform-key model (mirrors Grok Voice / ADR-0031): Ninjafy holds one xAI
41135
41137
  // account key (XAI_API_KEY) and every customer render bills back to it, so
41136
41138
  // auth is `none` - customers never enter a key.
@@ -41170,7 +41172,9 @@ var INTEGRATION_REGISTRY = [
41170
41172
  // and reaches 1080p in either (upscaled from 720p), so all three map.
41171
41173
  { event_type: "grok_imagine_video_1_5_lite_480p", unit: "second" },
41172
41174
  { event_type: "grok_imagine_video_1_5_lite_720p", unit: "second" },
41173
- { event_type: "grok_imagine_video_1_5_lite_1080p", unit: "second" }
41175
+ { event_type: "grok_imagine_video_1_5_lite_1080p", unit: "second" },
41176
+ // model "omni": Google's gemini-omni-1.2-flash, text-to-video at 720p only for now.
41177
+ { event_type: "gemini_omni_1_2_flash_720p", unit: "second" }
41174
41178
  ]
41175
41179
  }
41176
41180
  },
@@ -32631,6 +32631,7 @@ var ROLE_PERMISSIONS = {
32631
32631
  "project.view",
32632
32632
  "project.create",
32633
32633
  "project.edit",
32634
+ "project.move",
32634
32635
  "workflow.author",
32635
32636
  "workflow.promote",
32636
32637
  "guardrail.author"
@@ -32659,6 +32660,7 @@ var ROLE_PERMISSIONS = {
32659
32660
  "project.view",
32660
32661
  "project.create",
32661
32662
  "project.edit",
32663
+ "project.move",
32662
32664
  "workflow.author",
32663
32665
  "workflow.promote",
32664
32666
  "guardrail.author"
@@ -35563,7 +35565,7 @@ var INTEGRATION_REGISTRY = [
35563
35565
  id: "video-gen",
35564
35566
  name: "Video Generation",
35565
35567
  category: "media",
35566
- description: 'AI video generation from a text prompt or an input image. An agent passes a prompt (plus optionally image_url) to generate_video and gets back a short generated video with audio, which it can deliver to a chat channel. Ninjafy manages the model access for you - there is no key to enter. Generation runs direct against xAI Grok Imagine: text-to-video on the base grok-imagine-video model, image-to-video on grok-imagine-video-1.5, or both modes on the lower-cost grok-imagine-video-1.5-lite when the agent asks for model "lite". It is a PREMIUM, usage-billed capability: gated on a per-org opt-in and a monthly USD budget, and metered per second of generated video.',
35568
+ description: 'AI video generation from a text prompt or an input image. An agent passes a prompt (plus optionally image_url) to generate_video and gets back a short generated video with audio, which it can deliver to a chat channel. Ninjafy manages the model access for you - there is no key to enter. Generation runs direct against xAI Grok Imagine: text-to-video on the base grok-imagine-video model, image-to-video on grok-imagine-video-1.5, or both modes on the lower-cost grok-imagine-video-1.5-lite when the agent asks for model "lite". When the agent asks for model "omni", text-to-video runs on Google Gemini Omni 1.2 Flash instead (720p, 3-15 whole seconds), so the prompt is sent to Google rather than xAI. It is a PREMIUM, usage-billed capability: gated on a per-org opt-in and a monthly USD budget, and metered per second of generated video.',
35567
35569
  // Platform-key model (mirrors Grok Voice / ADR-0031): Ninjafy holds one xAI
35568
35570
  // account key (XAI_API_KEY) and every customer render bills back to it, so
35569
35571
  // auth is `none` - customers never enter a key.
@@ -35603,7 +35605,9 @@ var INTEGRATION_REGISTRY = [
35603
35605
  // and reaches 1080p in either (upscaled from 720p), so all three map.
35604
35606
  { event_type: "grok_imagine_video_1_5_lite_480p", unit: "second" },
35605
35607
  { event_type: "grok_imagine_video_1_5_lite_720p", unit: "second" },
35606
- { event_type: "grok_imagine_video_1_5_lite_1080p", unit: "second" }
35608
+ { event_type: "grok_imagine_video_1_5_lite_1080p", unit: "second" },
35609
+ // model "omni": Google's gemini-omni-1.2-flash, text-to-video at 720p only for now.
35610
+ { event_type: "gemini_omni_1_2_flash_720p", unit: "second" }
35607
35611
  ]
35608
35612
  }
35609
35613
  },
@@ -45318,6 +45322,7 @@ function foldTurnInitiatorLedger(existing, marker, maxAgeMs = TURN_INITIATOR_MAX
45318
45322
  ...marker.chat_kind ? { chat_kind: marker.chat_kind } : {},
45319
45323
  ...marker.chat_id ? { chat_id: marker.chat_id } : {},
45320
45324
  ...marker.unattributed ? { unattributed: true } : {},
45325
+ ...marker.notice ? { notice: true } : {},
45321
45326
  ...marker.loop_tick ? { loop_tick: true } : {},
45322
45327
  ts: marker.ts
45323
45328
  });
@@ -45463,11 +45468,13 @@ function writeUnattributedTurnMarker(channel, opts = {}) {
45463
45468
  updateTurnInitiatorLedger(file, {
45464
45469
  channel,
45465
45470
  sender_id: "",
45466
- // ENG-11979: its own ledger key. The ledger keeps one entry per (channel, ref),
45467
- // so a tick sharing a key would overwrite a stricter unattributed notice.
45468
- channel_ref: opts.loopTick ? "loop-tick" : "unattributed",
45471
+ // ENG-11979 / ENG-11553: each kind gets its own ledger key. The ledger keeps one
45472
+ // entry per (channel, ref), so a tick or a notice sharing the plain key would
45473
+ // overwrite a stricter unattributed entry that blocks regardless of order.
45474
+ channel_ref: opts.loopTick ? "loop-tick" : opts.notice ? "unattributed-notice" : "unattributed",
45469
45475
  unattributed: true,
45470
45476
  ...opts.loopTick ? { loop_tick: true } : {},
45477
+ ...opts.notice ? { notice: true } : {},
45471
45478
  ts: opts.now ?? Date.now()
45472
45479
  });
45473
45480
  } catch {
@@ -15428,6 +15428,7 @@ function foldTurnInitiatorLedger(existing, marker, maxAgeMs = TURN_INITIATOR_MAX
15428
15428
  ...marker.chat_kind ? { chat_kind: marker.chat_kind } : {},
15429
15429
  ...marker.chat_id ? { chat_id: marker.chat_id } : {},
15430
15430
  ...marker.unattributed ? { unattributed: true } : {},
15431
+ ...marker.notice ? { notice: true } : {},
15431
15432
  ...marker.loop_tick ? { loop_tick: true } : {},
15432
15433
  ts: marker.ts
15433
15434
  });
@@ -15463,11 +15464,13 @@ function writeUnattributedTurnMarker(channel, opts = {}) {
15463
15464
  updateTurnInitiatorLedger(file, {
15464
15465
  channel,
15465
15466
  sender_id: "",
15466
- // ENG-11979: its own ledger key. The ledger keeps one entry per (channel, ref),
15467
- // so a tick sharing a key would overwrite a stricter unattributed notice.
15468
- channel_ref: opts.loopTick ? "loop-tick" : "unattributed",
15467
+ // ENG-11979 / ENG-11553: each kind gets its own ledger key. The ledger keeps one
15468
+ // entry per (channel, ref), so a tick or a notice sharing the plain key would
15469
+ // overwrite a stricter unattributed entry that blocks regardless of order.
15470
+ channel_ref: opts.loopTick ? "loop-tick" : opts.notice ? "unattributed-notice" : "unattributed",
15469
15471
  unattributed: true,
15470
15472
  ...opts.loopTick ? { loop_tick: true } : {},
15473
+ ...opts.notice ? { notice: true } : {},
15471
15474
  ts: opts.now ?? Date.now()
15472
15475
  });
15473
15476
  } catch {