@integrity-labs/agt-cli 0.28.889 → 0.28.891

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.
@@ -4,6 +4,7 @@ import {
4
4
  PLATFORM_STORAGE_RULE,
5
5
  SECRET_PATTERNS,
6
6
  claudeModelAlias,
7
+ encodeClaudeProjectPath,
7
8
  getOrCreateDailySession,
8
9
  isClaudeFastMode,
9
10
  isDefaultRemoteMcpConnection,
@@ -18,7 +19,7 @@ import {
18
19
  rotateDailySession,
19
20
  sessionFileExists,
20
21
  todayLocalIso
21
- } from "./chunk-7LIBFSX6.js";
22
+ } from "./chunk-BH5RFBUM.js";
22
23
  import {
23
24
  reapOrphanChannelMcps
24
25
  } from "./chunk-XWVM4KPK.js";
@@ -3892,6 +3893,121 @@ function restartEgressSidecar(codeName) {
3892
3893
  return false;
3893
3894
  }
3894
3895
  }
3896
+ var TRANSCRIPT_MASK_DIR_PREFIX = ".agent-";
3897
+ var CLAUDE_PER_AGENT_DIRS = [
3898
+ // Present on a live host, 2026-09-11.
3899
+ "file-history",
3900
+ // edit snapshots (122 MB on one host)
3901
+ "session-env",
3902
+ "shell-snapshots",
3903
+ "sessions",
3904
+ // PID-keyed; every container's claude is the same PID, so sharing also collides
3905
+ "debug",
3906
+ "paste-cache",
3907
+ "todos",
3908
+ // Created on demand by Claude Code 2.1.267; each holds session-derived content.
3909
+ "tasks",
3910
+ // task lists, keyed by session
3911
+ "uploads",
3912
+ // files staged into a session
3913
+ "plans",
3914
+ // plan-mode documents
3915
+ "teams",
3916
+ // agent-team mailboxes
3917
+ "jobs",
3918
+ // background job state
3919
+ "shares",
3920
+ // session share bundles
3921
+ "usage-data",
3922
+ // per-session facets and metadata
3923
+ "feedback",
3924
+ // feedback drafts
3925
+ "feedback-bundles",
3926
+ // feedback zips, which can carry the transcript
3927
+ "dump-prompts",
3928
+ // full request dumps, keyed by session
3929
+ "api-dumps",
3930
+ "image-cache",
3931
+ // pasted images, keyed by session
3932
+ "file-transfers",
3933
+ // peer file-transfer attachments
3934
+ "downloads",
3935
+ "scratch",
3936
+ // per-session scratch namespace
3937
+ "traces",
3938
+ "startup-perf",
3939
+ // per-session profiling reports
3940
+ "bridge-spawn"
3941
+ ];
3942
+ var CLAUDE_NULLED_FILES = ["history.jsonl"];
3943
+ var CLAUDE_HOST_WIDE = [
3944
+ // Account and auth: one login per host, refreshed in place.
3945
+ ".credentials.json",
3946
+ ".claude.json",
3947
+ ".claude.json.backup",
3948
+ "hfi-auth.json",
3949
+ ".session_ingress_token",
3950
+ // Settings, policy and consent that apply to the whole host.
3951
+ "settings.json",
3952
+ "plugins",
3953
+ "policy-limits.json",
3954
+ "policy-limits.json.signature.json",
3955
+ "policy-limits.json.signature-iat.json",
3956
+ "remote-settings.json",
3957
+ "remote-settings.json.signature.json",
3958
+ "remote-settings.json.signature-iat.json",
3959
+ "remote-settings-helper-consent",
3960
+ "remote-settings-consent.json",
3961
+ // 2.1.268: account-keyed consent records for remote managed settings
3962
+ "state",
3963
+ // host-level consent records
3964
+ "local-settings",
3965
+ "project-settings",
3966
+ "backups",
3967
+ // .claude.json backups, the same content as .claude.json
3968
+ // Install, caches and host services with no session content.
3969
+ "local",
3970
+ // host Claude Code install; read host-side by claude-code-updater.ts
3971
+ "ccr",
3972
+ // CA bundle
3973
+ "cache",
3974
+ "statsig",
3975
+ "mcp-discovery-cache",
3976
+ "mcp-skill-archives",
3977
+ "mcp-needs-auth-cache.json",
3978
+ "gh-pr-status-cache.json",
3979
+ "stats-cache.json",
3980
+ "telemetry",
3981
+ "logs",
3982
+ "ide",
3983
+ "chrome",
3984
+ "systemd",
3985
+ "daemon",
3986
+ "computer-use.lock",
3987
+ "server.lock",
3988
+ // Per-session FILES: a file bind breaks rename-over writes and nulling them
3989
+ // would break the feature. None exists on the fleet hosts checked.
3990
+ "active-time.json",
3991
+ "server-sessions.json",
3992
+ "loop.md",
3993
+ // only ever read-denied by the sandbox; not written by /loop
3994
+ "antproto.json",
3995
+ // No writer found in 2.1.267. Left shared rather than guessed: storage-v2 may
3996
+ // back account state, and a wrong per-agent guess there would break auth.
3997
+ "storage-v2",
3998
+ "remote",
3999
+ ".cc-writes"
4000
+ ];
4001
+ function claudeStateDirFor(homeDir, agentId) {
4002
+ return join7(homeDir, ".augmented", agentId, ".claude-state");
4003
+ }
4004
+ function ensureClaudeStateLayout(args) {
4005
+ const stateDir = claudeStateDirFor(args.homeDir, args.agentId);
4006
+ for (const dir of CLAUDE_PER_AGENT_DIRS) mkdirSync6(join7(stateDir, dir), { recursive: true });
4007
+ const projects = join7(args.homeDir, ".claude", "projects");
4008
+ mkdirSync6(join7(projects, `${TRANSCRIPT_MASK_DIR_PREFIX}${args.agentId}`), { recursive: true });
4009
+ mkdirSync6(join7(projects, encodeClaudeProjectPath(args.projectDir)), { recursive: true });
4010
+ }
3895
4011
  function buildDockerRunCommand(args) {
3896
4012
  const { codeName, agentId, wrapperPath, projectDir, homeDir, runId, passApiKey, passOpenRouter, passModelPolicyGateway, passModelPolicyModel, egress, forwardSlackReplyBinding, forwardBlockTurnEndAllMarkers, forwardKanbanWaiting, forwardNotifyDispatch, forwardTurnFailureNotice, forwardChannelSecrets } = args;
3897
4013
  const q = (s) => `'${s.replace(/'/g, `'\\''`)}'`;
@@ -3900,12 +4016,23 @@ function buildDockerRunCommand(args) {
3900
4016
  const mcpDir = join7(homeDir, ".augmented", "_mcp");
3901
4017
  const claudeHome = join7(homeDir, ".claude");
3902
4018
  const claudeJson = join7(homeDir, ".claude.json");
4019
+ const claudeProjects = join7(claudeHome, "projects");
4020
+ const transcriptMask = join7(claudeProjects, `${TRANSCRIPT_MASK_DIR_PREFIX}${agentId}`);
4021
+ const ownTranscripts = join7(claudeProjects, encodeClaudeProjectPath(projectDir));
3903
4022
  const mounts = [
3904
4023
  `-v ${q(`${agentDir2}:${agentDir2}`)}`,
3905
4024
  `-v ${q(`${agentIdDir}:${agentIdDir}`)}`,
3906
4025
  `-v ${q(`${mcpDir}:${mcpDir}:ro`)}`,
3907
4026
  `-v ${q(`${claudeHome}:${claudeHome}`)}`,
3908
- `-v ${q(`${claudeJson}:${claudeJson}`)}`
4027
+ `-v ${q(`${transcriptMask}:${claudeProjects}`)}`,
4028
+ `-v ${q(`${ownTranscripts}:${ownTranscripts}`)}`,
4029
+ `-v ${q(`${claudeJson}:${claudeJson}`)}`,
4030
+ // ENG-8854: the rest of the per-session state, from the agent's own id-keyed tree.
4031
+ ...CLAUDE_PER_AGENT_DIRS.map(
4032
+ (name) => `-v ${q(`${join7(claudeStateDirFor(homeDir, agentId), name)}:${join7(claudeHome, name)}`)}`
4033
+ ),
4034
+ // ENG-8854: history.jsonl cannot take a per-agent file bind (see CLAUDE_NULLED_FILES).
4035
+ ...CLAUDE_NULLED_FILES.map((name) => `-v ${q(`/dev/null:${join7(claudeHome, name)}`)}`)
3909
4036
  ];
3910
4037
  const image = process.env.AGT_ISOLATION_IMAGE || "agt-runtime:latest";
3911
4038
  const memory = process.env.AGT_ISOLATION_MEMORY || "2g";
@@ -4670,6 +4797,9 @@ function spawnSession(config, session) {
4670
4797
  egress = { allowlistHostPath };
4671
4798
  log2(`[persistent-session] egress allowlist for '${codeName}': ${allowlist.length} domains (deny-by-default)`);
4672
4799
  }
4800
+ if (effectiveMode === "docker") {
4801
+ ensureClaudeStateLayout({ homeDir: sessionHomeDir, agentId: config.agentId, projectDir });
4802
+ }
4673
4803
  const claudeCmd = effectiveMode === "docker" ? buildDockerRunCommand({
4674
4804
  codeName,
4675
4805
  agentId: config.agentId,
@@ -5549,6 +5679,12 @@ export {
5549
5679
  writeEgressAllowlist,
5550
5680
  reloadEgressSidecar,
5551
5681
  restartEgressSidecar,
5682
+ TRANSCRIPT_MASK_DIR_PREFIX,
5683
+ CLAUDE_PER_AGENT_DIRS,
5684
+ CLAUDE_NULLED_FILES,
5685
+ CLAUDE_HOST_WIDE,
5686
+ claudeStateDirFor,
5687
+ ensureClaudeStateLayout,
5552
5688
  buildDockerRunCommand,
5553
5689
  writePersistentClaudeWrapper,
5554
5690
  PANE_AGENT_ID_PROBE_TIMEOUT_MS,
@@ -5594,4 +5730,4 @@ export {
5594
5730
  stopAllSessionsAndWait,
5595
5731
  getProjectDir
5596
5732
  };
5597
- //# sourceMappingURL=chunk-OMRYKBFE.js.map
5733
+ //# sourceMappingURL=chunk-SXYTFXPO.js.map