@platless/axom-cli 0.6.36 → 0.6.52
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/README.md +7 -1
- package/dist/axom-patch/cli/README.md +31 -2
- package/dist/axom-patch/cli/account-limits/generate.py +2 -2
- package/dist/axom-patch/cli/claude-replay-lifecycle.json +16 -0
- package/dist/axom-patch/cli/codex-terminal-output.json +2 -2
- package/dist/axom-patch/cli/probes/claude-replay-lifecycle.mjs +31 -0
- package/dist/axom-patch/cli/probes/codex-terminal-output.mjs +1 -1
- package/dist/axom-patch/cli/probes/zcode-env-account.mjs +81 -0
- package/dist/axom-patch/cli/probes/zcode-subagent-subwork.mjs +7 -0
- package/dist/axom-patch/cli/qoder/dist/axom-acp-compat.mjs +137 -41
- package/dist/axom-patch/cli/qoder/releases/1.1.75.json +5 -88
- package/dist/axom-patch/cli/qoder-native-acp.json +23 -23
- package/dist/axom-patch/cli/runtime.json +3 -1
- package/dist/axom-patch/cli/zcode/env-account.mjs +13 -0
- package/dist/axom-patch/cli/zcode/generate-env-account.py +52 -0
- package/dist/axom-patch/cli/zcode-account-limits.json +7 -7
- package/dist/axom-patch/cli/zcode-env-account.json +58 -0
- package/dist/axom-patch/cli/zcode-models.json +9 -9
- package/dist/axom-patch/cli/zcode-subagent-subwork.json +10 -10
- package/dist/cli.js +9 -11
- package/dist/commands/auth.js +4 -1
- package/dist/commands/update.js +68 -7
- package/dist/commands/workstation.js +94 -223
- package/dist/commands/workstationRegistrations.js +116 -0
- package/dist/credentialBroker.js +13 -2
- package/dist/credentials.js +16 -0
- package/dist/install/claude/commands.js +2 -2
- package/dist/keepers/terminal/keeper.mjs +1089 -673
- package/dist/keepers/terminal/manifest.json +4 -4
- package/dist/native/darwin-x64/axom-quic +0 -0
- package/dist/workstation/acp/acpAgents.js +11 -4
- package/dist/workstation/acp/outbox.js +12 -5
- package/dist/workstation/acp/permission.js +2 -2
- package/dist/workstation/acp/processor/checkpoint.js +4 -3
- package/dist/workstation/acp/processor/control.js +2 -2
- package/dist/workstation/acp/processor/jsonrpc.js +8 -0
- package/dist/workstation/acp/processor/session.js +3 -2
- package/dist/workstation/acp/processor/state.js +1 -0
- package/dist/workstation/acp/processor/transport/local.js +19 -3
- package/dist/workstation/acp/processor/updates.js +25 -0
- package/dist/workstation/acp/processorSession.js +12 -1
- package/dist/workstation/acp/registry/catalog.js +6 -6
- package/dist/workstation/acp/test/keeperWorld.js +4 -3
- package/dist/workstation/agentSessions.js +76 -23
- package/dist/workstation/channels/agent.js +9 -1
- package/dist/workstation/channels/computer.js +27 -4
- package/dist/workstation/channels/management.js +36 -5
- package/dist/workstation/config.js +18 -6
- package/dist/workstation/control/bindingStore.js +4 -0
- package/dist/workstation/control/commands.js +1 -0
- package/dist/workstation/control/daemonIdentity.js +90 -0
- package/dist/workstation/control/deviceCommands.js +191 -0
- package/dist/workstation/control/deviceProtocol.js +68 -0
- package/dist/workstation/control/locks.js +51 -4
- package/dist/workstation/control/rootFormat.js +16 -0
- package/dist/workstation/control/runtimeClient.js +60 -5
- package/dist/workstation/control/runtimeHost.js +96 -9
- package/dist/workstation/control/serverIdentity.js +2 -2
- package/dist/workstation/control/updateTransition.js +91 -0
- package/dist/workstation/daemon.js +262 -360
- package/dist/workstation/daemonctl.js +150 -12
- package/dist/workstation/desktopControl/automationDevice.js +219 -0
- package/dist/workstation/desktopControl/automationJson.js +74 -0
- package/dist/workstation/desktopControl/automationLocalState.js +23 -0
- package/dist/workstation/desktopControl/automationPreparation.js +1 -0
- package/dist/workstation/desktopControl/automationProtocol.js +253 -0
- package/dist/workstation/desktopControl/automationSchema.generated.js +1 -0
- package/dist/workstation/desktopControl/automationSession.js +81 -0
- package/dist/workstation/desktopControl/automationTransport.js +138 -0
- package/dist/workstation/desktopControl/capabilities.js +2 -1
- package/dist/workstation/desktopControl/deviceAdmission.js +229 -0
- package/dist/workstation/desktopControl/deviceOwnership.js +130 -0
- package/dist/workstation/desktopControl/deviceSockets.js +2 -2
- package/dist/workstation/desktopControl/helperProcess.js +250 -1
- package/dist/workstation/desktopControl/hostGrant.js +65 -0
- package/dist/workstation/desktopControl/lobby.js +4 -2
- package/dist/workstation/desktopControl/macProvider.js +41 -40
- package/dist/workstation/desktopControl/nativeDeviceAdmission.js +207 -0
- package/dist/workstation/desktopControl/nativeProvider.js +31 -5
- package/dist/workstation/desktopControl/ownershipProtocol.js +31 -0
- package/dist/workstation/desktopControl/protocol.js +15 -6
- package/dist/workstation/desktopControl/supervisor.js +110 -17
- package/dist/workstation/desktopControl/wallpaper.js +26 -6
- package/dist/workstation/exec/policy.js +5 -0
- package/dist/workstation/files/client.js +10 -1
- package/dist/workstation/files/host.js +9 -2
- package/dist/workstation/journal.js +5 -2
- package/dist/workstation/keepers/acp/client.js +38 -2
- package/dist/workstation/keepers/kit/buildVersion.js +35 -11
- package/dist/workstation/keepers/kit/client.js +2 -2
- package/dist/workstation/keepers/kit/launcher.js +80 -4
- package/dist/workstation/keepers/legacy.js +16 -2
- package/dist/workstation/keepers/policy.js +5 -34
- package/dist/workstation/keepers/terminal/client.js +115 -23
- package/dist/workstation/keepers/terminal/exec.js +6 -3
- package/dist/workstation/keepers/terminal/frames.js +73 -0
- package/dist/workstation/keepers/terminal/generations.js +5 -8
- package/dist/workstation/keepers/terminal/gridProtocol.js +16 -0
- package/dist/workstation/keepers/terminal/input.js +146 -0
- package/dist/workstation/keepers/terminal/keeper.js +22 -8
- package/dist/workstation/keepers/terminal/main.js +1 -1
- package/dist/workstation/keepers/terminal/metadata.js +138 -0
- package/dist/workstation/keepers/terminal/protocol.js +4 -28
- package/dist/workstation/keepers/terminal/pty.js +1 -330
- package/dist/workstation/keepers/terminal/screen.js +246 -0
- package/dist/workstation/keepers/terminal/sessions.js +526 -0
- package/dist/workstation/oauth/deviceAuthorization.js +31 -17
- package/dist/workstation/protocol/management.js +23 -4
- package/dist/workstation/rd/artifact.js +4 -3
- package/dist/workstation/rd/control.js +3 -5
- package/dist/workstation/rd/host.js +213 -0
- package/dist/workstation/rd/migrationReadiness.js +46 -0
- package/dist/workstation/rd/provider.js +44 -10
- package/dist/workstation/rd/state.js +14 -2
- package/dist/workstation/rd/update.js +5 -8
- package/dist/workstation/rd/upkeep.js +44 -2
- package/dist/workstation/registrations/enrollment.js +250 -0
- package/dist/workstation/registrations/enrollmentPending.js +361 -0
- package/dist/workstation/registrations/migration.js +356 -0
- package/dist/workstation/registrations/model.js +34 -0
- package/dist/workstation/registrations/removal.js +222 -0
- package/dist/workstation/registrations/store.js +737 -0
- package/dist/workstation/runtime/desktopBinding.js +20 -0
- package/dist/workstation/runtime/deviceDesktop.js +193 -0
- package/dist/workstation/runtime/deviceRuntime.js +568 -0
- package/dist/workstation/runtime/deviceServices.js +117 -0
- package/dist/workstation/runtime/events.js +20 -0
- package/dist/workstation/runtime/ownership.js +100 -0
- package/dist/workstation/runtime/registrationRuntime.js +575 -0
- package/dist/workstation/runtime/remoteDesktopAdapter.js +186 -0
- package/dist/workstation/runtime/removalActivity.js +184 -0
- package/dist/workstation/service/installer.js +93 -1
- package/dist/workstation/service/launchd.js +1 -0
- package/dist/workstation/service/systemd.js +1 -0
- package/dist/workstation/systemMetrics.js +3 -0
- package/dist/workstation/tools/client.js +8 -27
- package/dist/workstation/tools/info.js +6 -13
- package/dist/workstation/tools/terminalRouter.js +17 -172
- package/dist/workstation/tools/validation.js +55 -1
- package/dist/workstation/update/archiveEvidence.js +206 -0
- package/dist/workstation/update/coordinator.js +34 -13
- package/dist/workstation/update/deviceCompatibility.js +119 -0
- package/dist/workstation/update/deviceCoordinator.js +369 -0
- package/dist/workstation/update/deviceHealth.js +104 -0
- package/dist/workstation/update/deviceHealthProtocol.js +26 -0
- package/dist/workstation/update/deviceRecoveryLifecycle.js +46 -0
- package/dist/workstation/update/deviceRollback.js +78 -0
- package/dist/workstation/update/globalInstall.js +80 -10
- package/dist/workstation/update/legacyBridge.js +414 -0
- package/dist/workstation/update/legacyOwner.js +39 -0
- package/dist/workstation/update/npmInstaller.js +2 -2
- package/dist/workstation/update/privateDurability.js +61 -0
- package/dist/workstation/update/recoveryPlan.js +124 -0
- package/dist/workstation/update/runUpdate.js +7 -1
- package/dist/workstation/update/taskRegistry.js +161 -3
- package/dist/workstation/update/watchdog.js +27427 -14410
- package/dist/workstation/update/watchdogProcess.js +72 -0
- package/package.json +7 -3
- package/dist/native/darwin-arm64/axom-quic +0 -0
|
@@ -223,10 +223,10 @@ var TerminalRepairFold = class {
|
|
|
223
223
|
};
|
|
224
224
|
|
|
225
225
|
// src/background/poller.ts
|
|
226
|
-
import { isAbsolute, join as join4, resolve as resolve2 } from "node:path";
|
|
226
|
+
import { isAbsolute as isAbsolute2, join as join4, resolve as resolve2 } from "node:path";
|
|
227
227
|
|
|
228
228
|
// src/history.ts
|
|
229
|
-
import { dirname as dirname2, join as join2 } from "node:path";
|
|
229
|
+
import { dirname as dirname2, isAbsolute, join as join2, relative, sep as sep2 } from "node:path";
|
|
230
230
|
import { TextDecoder as TextDecoder2 } from "node:util";
|
|
231
231
|
|
|
232
232
|
// src/subwork.ts
|
|
@@ -645,20 +645,65 @@ async function readHistorySnapshot(path) {
|
|
|
645
645
|
});
|
|
646
646
|
return { ...snapshot, rows, completeBytes };
|
|
647
647
|
}
|
|
648
|
+
var absoluteDirectory = (value) => typeof value === "string" && isAbsolute(value) && !/[\x00-\x1f\x7f]/.test(value);
|
|
649
|
+
var HistoryDirectory = class {
|
|
650
|
+
constructor(homeCwd) {
|
|
651
|
+
this.homeCwd = homeCwd;
|
|
652
|
+
this.cwd = homeCwd;
|
|
653
|
+
}
|
|
654
|
+
homeCwd;
|
|
655
|
+
cwd;
|
|
656
|
+
worktree(value) {
|
|
657
|
+
if (value === null) {
|
|
658
|
+
this.cwd = this.homeCwd;
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
const state = object(value);
|
|
662
|
+
refuse(state.originalCwd === this.homeCwd, "metadata worktree original directory mismatch");
|
|
663
|
+
this.cwd = state.pendingExit === true ? this.homeCwd : state.worktreeCwd ?? state.worktreePath;
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
function validateWorktree(value, root) {
|
|
667
|
+
if (value === null) return;
|
|
668
|
+
const state = object(value), path = state.worktreePath, cwd = state.worktreeCwd;
|
|
669
|
+
refuse(absoluteDirectory(state.originalCwd) && absoluteDirectory(path) && (cwd === void 0 || absoluteDirectory(cwd)) && typeof state.worktreeName === "string" && !!state.worktreeName && address(state.sessionId) && (state.lifecycle === void 0 || state.lifecycle === "owner" || state.lifecycle === "attached") && (state.lifecycle === "attached" || state.sessionId === root), "metadata worktree malformed");
|
|
670
|
+
if (cwd !== void 0) {
|
|
671
|
+
const inside = relative(path, cwd);
|
|
672
|
+
refuse(inside !== ".." && !inside.startsWith(".." + sep2) && !isAbsolute(inside), "metadata worktree cwd outside path");
|
|
673
|
+
}
|
|
674
|
+
for (const key of ["preEnterOriginalCwd", "pendingOwnerReleasePath"])
|
|
675
|
+
refuse(state[key] === void 0 || absoluteDirectory(state[key]), "metadata worktree directory malformed");
|
|
676
|
+
for (const key of ["worktreeBranch", "originalBranch", "originalHeadCommit"])
|
|
677
|
+
refuse(state[key] === void 0 || typeof state[key] === "string", "metadata worktree branch malformed");
|
|
678
|
+
for (const key of ["hookBased", "enteredExisting"])
|
|
679
|
+
refuse(state[key] === void 0 || typeof state[key] === "boolean", "metadata worktree flag malformed");
|
|
680
|
+
refuse(state.pendingExit === void 0 || state.pendingExit === true, "metadata worktree pending exit malformed");
|
|
681
|
+
}
|
|
648
682
|
function metadata(row, root) {
|
|
649
683
|
const type = row.type;
|
|
684
|
+
if (type === "file-history-snapshot") {
|
|
685
|
+
refuse(typeof row.messageId === "string" && !!row.snapshot && typeof row.snapshot === "object" && !Array.isArray(row.snapshot) && typeof row.isSnapshotUpdate === "boolean", "metadata file history snapshot malformed");
|
|
686
|
+
return true;
|
|
687
|
+
}
|
|
650
688
|
if (!["active-leaf", "workspace-directories", "worktree-state", "last-prompt"].includes(String(type))) return false;
|
|
651
689
|
refuse(row.sessionId === root, "metadata identity mismatch");
|
|
652
690
|
if (type === "active-leaf") refuse((row.leafUuid === null || address(row.leafUuid)) && typeof row.explicit === "boolean" && Number.isSafeInteger(row.timestamp), "metadata active-leaf malformed");
|
|
653
691
|
if (type === "workspace-directories") refuse(Array.isArray(row.directories) && row.directories.length <= 4096 && row.directories.every((x) => typeof x === "string"), "metadata directories malformed");
|
|
654
|
-
if (type === "worktree-state")
|
|
692
|
+
if (type === "worktree-state") {
|
|
693
|
+
refuse(row.discardLegacyFileHistorySnapshots === void 0 || row.discardLegacyFileHistorySnapshots === true, "metadata worktree snapshot flag malformed");
|
|
694
|
+
validateWorktree(row.worktreeSession, root);
|
|
695
|
+
}
|
|
655
696
|
if (type === "last-prompt") refuse(typeof row.lastPrompt === "string", "metadata last-prompt malformed");
|
|
656
697
|
return true;
|
|
657
698
|
}
|
|
658
699
|
function validateHistoryRow(row, context) {
|
|
659
|
-
const { root, cwd, historyVersions, child } = context;
|
|
660
|
-
if (metadata(row, root))
|
|
661
|
-
|
|
700
|
+
const { root, cwd, historyVersions, child, directory } = context;
|
|
701
|
+
if (metadata(row, root)) {
|
|
702
|
+
if (row.type === "worktree-state" && directory && !child) directory.worktree(row.worktreeSession);
|
|
703
|
+
return false;
|
|
704
|
+
}
|
|
705
|
+
const parent = row.type === "user" || row.type === "assistant" || row.parent_tool_use_id != null ? row.parent_tool_use_id : child?.toolUseId;
|
|
706
|
+
refuse(row.sessionId === root && row.cwd === (directory?.cwd ?? cwd) && row.isSidechain === (child !== void 0) && (!child || row.agentId === child.agentId && parent === child.toolUseId), "identity mismatch");
|
|
662
707
|
refuse(typeof row.version === "string" && historyVersions.includes(row.version), "version incompatible");
|
|
663
708
|
refuse(address(row.uuid), "UUID identity invalid");
|
|
664
709
|
if (row.isMeta === true && object(row.origin).kind === "task-notification") {
|
|
@@ -671,6 +716,20 @@ function validateHistoryRow(row, context) {
|
|
|
671
716
|
}
|
|
672
717
|
return true;
|
|
673
718
|
}
|
|
719
|
+
function rememberChildCwds(row, calls) {
|
|
720
|
+
if (row.type !== "assistant") return;
|
|
721
|
+
const content = object(row.message).content;
|
|
722
|
+
if (!Array.isArray(content)) return;
|
|
723
|
+
for (const block of content.map(object)) {
|
|
724
|
+
const id3 = address(block.id), input = object(block.input);
|
|
725
|
+
if (block.type !== "tool_use" || block.name !== "Agent" || !id3) continue;
|
|
726
|
+
const cwd = input.cwd ?? row.cwd;
|
|
727
|
+
refuse(absoluteDirectory(cwd), "child launch directory invalid");
|
|
728
|
+
refuse(!calls.has(id3) || calls.get(id3) === cwd, "child launch directory mismatch");
|
|
729
|
+
refuse(calls.has(id3) || calls.size < 4096, "subwork call bound");
|
|
730
|
+
calls.set(id3, cwd);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
674
733
|
var own2 = (record2, key) => Object.hasOwn(record2, key);
|
|
675
734
|
function admitRecoveryEvent(data, event) {
|
|
676
735
|
if (event.acpSessionId && event.acpSessionId !== data.root || !["tool_call", "tool_call_update"].includes(event.eventName)) return;
|
|
@@ -709,19 +768,24 @@ async function bootstrapHistory(options) {
|
|
|
709
768
|
const path = historyPath(home, cwd, root);
|
|
710
769
|
refuse(path, "identity path invalid");
|
|
711
770
|
const rootSnapshot = await readHistorySnapshot(path);
|
|
712
|
-
const rootRows =
|
|
713
|
-
const rootSeen = /* @__PURE__ */ new Set();
|
|
714
|
-
const check = (row, child) => validateHistoryRow(row, { root, cwd, historyVersions, child });
|
|
771
|
+
const rootRows = [], rootAssistantUuids = /* @__PURE__ */ new Set(), rootAssistantCwds = /* @__PURE__ */ new Map();
|
|
772
|
+
const rootSeen = /* @__PURE__ */ new Set(), directory = new HistoryDirectory(cwd), childCwds = /* @__PURE__ */ new Map();
|
|
715
773
|
const launches = /* @__PURE__ */ new Map(), agentCalls = /* @__PURE__ */ new Set(), backgroundCalls = /* @__PURE__ */ new Set(), terminalIds = /* @__PURE__ */ new Set();
|
|
716
774
|
let resultBytes = 0;
|
|
717
|
-
for (const row of
|
|
718
|
-
|
|
775
|
+
for (const row of rootSnapshot.rows) {
|
|
776
|
+
if (!validateHistoryRow(row, { root, cwd, historyVersions, directory })) continue;
|
|
777
|
+
rootRows.push(row);
|
|
778
|
+
rememberChildCwds(row, childCwds);
|
|
719
779
|
if (!rootSeen.has(row.uuid)) {
|
|
720
780
|
refuse(rootSeen.size < MAX_UUIDS, "UUID count exceeds 100000");
|
|
721
781
|
rootSeen.add(row.uuid);
|
|
722
782
|
}
|
|
723
|
-
if (row.type === "assistant")
|
|
724
|
-
|
|
783
|
+
if (row.type === "assistant") {
|
|
784
|
+
const uuid = row.uuid;
|
|
785
|
+
refuse(!rootAssistantCwds.has(uuid) || rootAssistantCwds.get(uuid) === row.cwd, "UUID directory mismatch");
|
|
786
|
+
rootAssistantUuids.add(uuid);
|
|
787
|
+
rootAssistantCwds.set(uuid, row.cwd);
|
|
788
|
+
}
|
|
725
789
|
const content = object(row.message).content;
|
|
726
790
|
if (Array.isArray(content))
|
|
727
791
|
for (const block of content.map(object)) {
|
|
@@ -739,7 +803,7 @@ async function bootstrapHistory(options) {
|
|
|
739
803
|
refuse(Buffer.byteLength(match[1]) <= MAX_RESULT, "background result exceeds 128 KiB");
|
|
740
804
|
}
|
|
741
805
|
}
|
|
742
|
-
const facts = rootRowFacts(row, { nativeSessionId: root, cwd, restoreCalls: true });
|
|
806
|
+
const facts = rootRowFacts(row, { nativeSessionId: root, cwd: row.cwd, restoreCalls: true });
|
|
743
807
|
for (const fact of facts) {
|
|
744
808
|
if (fact.kind === "terminal" && !terminalIds.has(fact.toolUseId)) {
|
|
745
809
|
terminalIds.add(fact.toolUseId);
|
|
@@ -750,13 +814,13 @@ async function bootstrapHistory(options) {
|
|
|
750
814
|
for (const fact of facts)
|
|
751
815
|
if (fact.kind === "launch" && fact.agentId) {
|
|
752
816
|
refuse(launches.has(fact.toolUseId) || launches.size < MAX_TASKS, "background task bound");
|
|
753
|
-
launches.set(fact.toolUseId, fact.agentId);
|
|
817
|
+
launches.set(fact.toolUseId, { agentId: fact.agentId, cwd: childCwds.get(fact.toolUseId) ?? row.cwd });
|
|
754
818
|
}
|
|
755
819
|
}
|
|
756
820
|
const childSnapshots = [];
|
|
757
821
|
const children = [];
|
|
758
822
|
let total = rootSnapshot.capturedBytes;
|
|
759
|
-
for (const [toolUseId, agentId] of launches) {
|
|
823
|
+
for (const [toolUseId, { agentId, cwd: childCwd }] of launches) {
|
|
760
824
|
const childPath = join2(dirname2(path), root, "subagents", `agent-${agentId}.jsonl`);
|
|
761
825
|
let snapshot;
|
|
762
826
|
try {
|
|
@@ -766,12 +830,13 @@ async function bootstrapHistory(options) {
|
|
|
766
830
|
continue;
|
|
767
831
|
throw error;
|
|
768
832
|
}
|
|
769
|
-
childSnapshots.push({ toolUseId, agentId, path: childPath, snapshotBytes: snapshot.completeBytes, fileIdentity: snapshot.fileIdentity });
|
|
833
|
+
childSnapshots.push({ toolUseId, agentId, cwd: childCwd, path: childPath, snapshotBytes: snapshot.completeBytes, fileIdentity: snapshot.fileIdentity });
|
|
770
834
|
total += snapshot.capturedBytes;
|
|
771
835
|
refuse(total <= MAX_HISTORY, "indexed history exceeds 64 MiB");
|
|
772
|
-
const childRows =
|
|
773
|
-
for (const row of
|
|
774
|
-
|
|
836
|
+
const childRows = [], seen = /* @__PURE__ */ new Set();
|
|
837
|
+
for (const row of snapshot.rows) {
|
|
838
|
+
if (!validateHistoryRow(row, { root, cwd: childCwd, historyVersions, child: { toolUseId, agentId } })) continue;
|
|
839
|
+
childRows.push(row);
|
|
775
840
|
seen.add(row.uuid);
|
|
776
841
|
refuse(seen.size <= CHILD_ROW_LIMIT, "child UUID count exceeds 4096");
|
|
777
842
|
}
|
|
@@ -816,7 +881,7 @@ async function bootstrapHistory(options) {
|
|
|
816
881
|
continue;
|
|
817
882
|
foldedRoot.add(row.uuid);
|
|
818
883
|
consumeRow(row);
|
|
819
|
-
for (const fact of rootRowFacts(row, { nativeSessionId: root, cwd, restoreCalls: true }))
|
|
884
|
+
for (const fact of rootRowFacts(row, { nativeSessionId: root, cwd: row.cwd, restoreCalls: true }))
|
|
820
885
|
apply(fact);
|
|
821
886
|
}
|
|
822
887
|
for (const child of children) {
|
|
@@ -839,7 +904,7 @@ async function bootstrapHistory(options) {
|
|
|
839
904
|
consume(event);
|
|
840
905
|
validateRecoveryData(restored, { root, cwd, releaseId: data.releaseId });
|
|
841
906
|
Object.assign(data, restored);
|
|
842
|
-
return { rootAssistantUuids, snapshotBytes: rootSnapshot.completeBytes, rootIdentity: rootSnapshot.fileIdentity, childSnapshots };
|
|
907
|
+
return { rootAssistantUuids, rootAssistantCwds, snapshotBytes: rootSnapshot.completeBytes, rootIdentity: rootSnapshot.fileIdentity, childSnapshots };
|
|
843
908
|
}
|
|
844
909
|
|
|
845
910
|
// src/background/backgroundTerminal.ts
|
|
@@ -1025,14 +1090,17 @@ var BackgroundSideReader = class {
|
|
|
1025
1090
|
constructor(options) {
|
|
1026
1091
|
this.options = options;
|
|
1027
1092
|
this.restoring = options.restoreCalls === true;
|
|
1093
|
+
this.directory = new HistoryDirectory(options.cwd);
|
|
1028
1094
|
this.transcript = new Transcript(options.path, options.snapshot ? { snapshotBytes: options.snapshot.snapshotBytes, fileIdentity: options.snapshot.rootIdentity } : void 0, (size) => this.recordSize(options.path, size));
|
|
1029
1095
|
for (const child of options.snapshot?.childSnapshots ?? []) {
|
|
1030
|
-
this.launches.set(child.toolUseId, child.agentId);
|
|
1096
|
+
this.launches.set(child.toolUseId, { agentId: child.agentId, cwd: child.cwd });
|
|
1031
1097
|
this.sizes.set(child.path, child.snapshotBytes);
|
|
1032
1098
|
}
|
|
1033
1099
|
}
|
|
1034
1100
|
options;
|
|
1035
1101
|
launches = /* @__PURE__ */ new Map();
|
|
1102
|
+
childCwds = /* @__PURE__ */ new Map();
|
|
1103
|
+
directory;
|
|
1036
1104
|
sizes = /* @__PURE__ */ new Map();
|
|
1037
1105
|
seen = /* @__PURE__ */ new Set();
|
|
1038
1106
|
processes = /* @__PURE__ */ new Map();
|
|
@@ -1044,9 +1112,9 @@ var BackgroundSideReader = class {
|
|
|
1044
1112
|
if (this.closed || !this.restoring && !demand.active()) return;
|
|
1045
1113
|
try {
|
|
1046
1114
|
await this.transcript.measure();
|
|
1047
|
-
for (const [id3,
|
|
1115
|
+
for (const [id3, launch] of this.launches) {
|
|
1048
1116
|
if (!demand.wantsProcess(id3)) continue;
|
|
1049
|
-
const process2 = this.processFor(id3,
|
|
1117
|
+
const process2 = this.processFor(id3, launch);
|
|
1050
1118
|
try {
|
|
1051
1119
|
await process2.measure();
|
|
1052
1120
|
} catch (error) {
|
|
@@ -1078,14 +1146,15 @@ var BackgroundSideReader = class {
|
|
|
1078
1146
|
consume(row, sink) {
|
|
1079
1147
|
if (this.closed) return;
|
|
1080
1148
|
const { nativeSessionId, cwd, historyVersions } = this.options;
|
|
1081
|
-
if (!validateHistoryRow(row, { root: nativeSessionId, cwd, historyVersions })) return;
|
|
1149
|
+
if (!validateHistoryRow(row, { root: nativeSessionId, cwd, historyVersions, directory: this.directory })) return;
|
|
1150
|
+
rememberChildCwds(row, this.childCwds);
|
|
1082
1151
|
if (this.seen.has(row.uuid)) return;
|
|
1083
1152
|
if (this.seen.size >= MAX_UUIDS) throw new Error("Qoder history UUID count exceeds 100000");
|
|
1084
1153
|
this.seen.add(row.uuid);
|
|
1085
|
-
for (const fact of rootRowFacts(row, { nativeSessionId, cwd, restoreCalls: this.options.restoreCalls === true })) {
|
|
1154
|
+
for (const fact of rootRowFacts(row, { nativeSessionId, cwd: row.cwd, restoreCalls: this.options.restoreCalls === true })) {
|
|
1086
1155
|
if (fact.kind === "launch" && fact.agentId && !this.launches.has(fact.toolUseId)) {
|
|
1087
1156
|
if (this.launches.size >= MAX_TASKS) throw new Error("Qoder history background task bound");
|
|
1088
|
-
this.launches.set(fact.toolUseId, fact.agentId);
|
|
1157
|
+
this.launches.set(fact.toolUseId, { agentId: fact.agentId, cwd: this.childCwds.get(fact.toolUseId) ?? row.cwd });
|
|
1089
1158
|
}
|
|
1090
1159
|
sink(fact);
|
|
1091
1160
|
}
|
|
@@ -1094,7 +1163,8 @@ var BackgroundSideReader = class {
|
|
|
1094
1163
|
this.sizes.set(path, bytes);
|
|
1095
1164
|
if ([...this.sizes.values()].reduce((a, b) => a + b, 0) > MAX_HISTORY) throw new Error("Qoder indexed history exceeds 64 MiB");
|
|
1096
1165
|
}
|
|
1097
|
-
processFor(id3,
|
|
1166
|
+
processFor(id3, launch) {
|
|
1167
|
+
const { agentId, cwd } = launch;
|
|
1098
1168
|
let process2 = this.processes.get(id3);
|
|
1099
1169
|
if (!process2) {
|
|
1100
1170
|
const path = join3(dirname4(this.options.path), this.options.nativeSessionId, "subagents", `agent-${agentId}.jsonl`);
|
|
@@ -1102,7 +1172,7 @@ var BackgroundSideReader = class {
|
|
|
1102
1172
|
path,
|
|
1103
1173
|
historyVersions: this.options.historyVersions,
|
|
1104
1174
|
sessionId: this.options.nativeSessionId,
|
|
1105
|
-
cwd
|
|
1175
|
+
cwd,
|
|
1106
1176
|
agentId,
|
|
1107
1177
|
parentToolUseId: id3,
|
|
1108
1178
|
snapshot: this.options.snapshot?.childSnapshots.find((child) => child.toolUseId === id3),
|
|
@@ -1115,9 +1185,9 @@ var BackgroundSideReader = class {
|
|
|
1115
1185
|
return process2;
|
|
1116
1186
|
}
|
|
1117
1187
|
async pollProcesses(demand, sink) {
|
|
1118
|
-
for (const [id3,
|
|
1188
|
+
for (const [id3, launch] of this.launches) {
|
|
1119
1189
|
if (this.closed || !demand.wantsProcess(id3)) continue;
|
|
1120
|
-
const process2 = this.processFor(id3,
|
|
1190
|
+
const process2 = this.processFor(id3, launch);
|
|
1121
1191
|
let caughtUp;
|
|
1122
1192
|
try {
|
|
1123
1193
|
caughtUp = await process2.poll((uuid, events) => {
|
|
@@ -1136,7 +1206,7 @@ var BackgroundSideReader = class {
|
|
|
1136
1206
|
var SIDE_POLL_MS = 1e3;
|
|
1137
1207
|
var address2 = (v) => v.length > 0 && v.length <= 256 && !/[\x00-\x1f\x7f/\\]/.test(v);
|
|
1138
1208
|
function historyPath(home, cwd, sessionId) {
|
|
1139
|
-
if (!address2(sessionId) || !
|
|
1209
|
+
if (!address2(sessionId) || !isAbsolute2(cwd) || !isAbsolute2(home)) return void 0;
|
|
1140
1210
|
return join4(home, ".qoder", "projects", resolve2(cwd).replace(/[^a-zA-Z0-9]/g, "-"), sessionId + ".jsonl");
|
|
1141
1211
|
}
|
|
1142
1212
|
var BackgroundPoller = class {
|
|
@@ -1162,11 +1232,18 @@ var BackgroundPoller = class {
|
|
|
1162
1232
|
const read = async () => {
|
|
1163
1233
|
if (this.closed) return;
|
|
1164
1234
|
const events = [];
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1235
|
+
try {
|
|
1236
|
+
await this.reader.read(this.fold, (fact) => {
|
|
1237
|
+
if (this.closed) return;
|
|
1238
|
+
if (this.options.data) admitRecoveryFact(this.options.data, this.fold, fact);
|
|
1239
|
+
events.push(...this.fold.apply(fact));
|
|
1240
|
+
});
|
|
1241
|
+
} catch (error) {
|
|
1242
|
+
if (!this.options.unavailable) throw error;
|
|
1243
|
+
this.halt();
|
|
1244
|
+
await this.options.unavailable(error instanceof Error ? error : new Error(String(error)));
|
|
1245
|
+
return;
|
|
1246
|
+
}
|
|
1170
1247
|
if (!this.closed) await this.options.emit(events);
|
|
1171
1248
|
};
|
|
1172
1249
|
this.inFlight = (this.options.serialize ? this.options.serialize(read) : read()).catch((error) => {
|
|
@@ -1217,7 +1294,19 @@ async function createBoundary(options) {
|
|
|
1217
1294
|
const saved = await store.load();
|
|
1218
1295
|
if (options.mode === "new" && saved) throw new Error("Qoder new session already has recovery state; use load or resume");
|
|
1219
1296
|
const data = saved ?? newRecoveryData(options.root, options.cwd, options.releaseId);
|
|
1220
|
-
|
|
1297
|
+
let repair = true;
|
|
1298
|
+
const unavailable = (error) => {
|
|
1299
|
+
repair = false;
|
|
1300
|
+
console.warn(`Qoder background history unavailable; continuing without background repair: ${error instanceof Error ? error.message : String(error)}`);
|
|
1301
|
+
};
|
|
1302
|
+
let index;
|
|
1303
|
+
if (options.mode !== "new") {
|
|
1304
|
+
try {
|
|
1305
|
+
index = await bootstrapHistory({ ...options, data });
|
|
1306
|
+
} catch (error) {
|
|
1307
|
+
unavailable(error);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1221
1310
|
await store.save(data);
|
|
1222
1311
|
const foreground = new ForegroundOutputBoundary(options.root, data.foreground);
|
|
1223
1312
|
const subwork = new SubworkBoundary(options.root, data.subwork);
|
|
@@ -1265,6 +1354,13 @@ async function createBoundary(options) {
|
|
|
1265
1354
|
allowMissing: options.mode === "new",
|
|
1266
1355
|
serialize,
|
|
1267
1356
|
fail: fatal,
|
|
1357
|
+
unavailable: async (error) => {
|
|
1358
|
+
unavailable(error);
|
|
1359
|
+
const background = data.background;
|
|
1360
|
+
const checkpoint = (await store.load()).background;
|
|
1361
|
+
for (const key of Object.keys(background)) delete background[key];
|
|
1362
|
+
Object.assign(background, checkpoint);
|
|
1363
|
+
},
|
|
1268
1364
|
emit: async (events) => {
|
|
1269
1365
|
const output = [];
|
|
1270
1366
|
for (const event of events) {
|
|
@@ -1300,14 +1396,14 @@ async function createBoundary(options) {
|
|
|
1300
1396
|
historyMessage(message) {
|
|
1301
1397
|
if (fatalError) throw fatalError;
|
|
1302
1398
|
if (closing) throw new Error("Qoder boundary closed");
|
|
1303
|
-
return message.type === "assistant" && message.sessionId === options.root &&
|
|
1399
|
+
return message.type === "assistant" && message.sessionId === options.root && typeof message.uuid === "string" && index?.rootAssistantCwds.has(message.uuid) && index.rootAssistantCwds.get(message.uuid) === message.cwd && message.parent_tool_use_id === void 0 ? { ...message, parent_tool_use_id: null } : message;
|
|
1304
1400
|
},
|
|
1305
1401
|
activate() {
|
|
1306
1402
|
return serialize(async () => {
|
|
1307
1403
|
if (active) return;
|
|
1308
1404
|
await store.save(data);
|
|
1309
1405
|
active = true;
|
|
1310
|
-
poller.start();
|
|
1406
|
+
if (repair) poller.start();
|
|
1311
1407
|
});
|
|
1312
1408
|
},
|
|
1313
1409
|
endTurn() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"patchDigest": "
|
|
2
|
+
"patchDigest": "e8b941215ea9447877cfd96f4377a4206c1b767130c74af418e282673b7de292",
|
|
3
3
|
"schema": 1,
|
|
4
4
|
"id": "qoder-1.1.75-native-acp-v1",
|
|
5
5
|
"package": "@qoder-ai/qodercli",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"qoder-native-acp"
|
|
27
27
|
],
|
|
28
28
|
"files": {
|
|
29
|
-
"bundle/axom-acp-compat.mjs": "
|
|
29
|
+
"bundle/axom-acp-compat.mjs": "9ecfa65379bcf80df9991b72d3cb4a1a39aaef1783b8b29c317eec6bc4b57cda",
|
|
30
30
|
"bundle/builtin/agent-creator/SKILL.md": "bfc380be50066d70cd45412cb24b81ff274b7c844d53b3a035a2f120364dca07",
|
|
31
31
|
"bundle/builtin/hook-config/SKILL.md": "12a9aa2a2d3c2cfd74307b72c5beb0df576322ccade35dc2126d893e0533c6a5",
|
|
32
32
|
"bundle/builtin/sdk/SKILL.md": "47aba23469df07c36ab8d2be59977d87c33787f4a85e5beb388312fcad46d8c6",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"bundle/proto/chat.proto": "852c39ce8447854dc1c452e44304db81978595b4961ec4beaef4762ee5141372",
|
|
35
35
|
"bundle/qoder-npm-dispatcher.cjs": "37cc389f07b046d78a2c80ff8d9ab54f433d38f94bf1f221a9e7e1dea297d120",
|
|
36
36
|
"bundle/qoder-worker-runtime.mjs": "bdd4580832f76e91636ba36988a694b8fc335c80068e095f7ec1712d7ef0c8db",
|
|
37
|
-
"bundle/qodercli.js": "
|
|
37
|
+
"bundle/qodercli.js": "3da76688a1b3956b69550d39f5501765bb2cffe4b62ae6b3a4d50afd30607ea6",
|
|
38
38
|
"bundle/vendor/qoder-security/.qoder-plugin/plugin.json": "71fc5e63dbb8c3feecc8187efb2e96fb58f409d666c74cd1891a55d44c6fc381",
|
|
39
39
|
"bundle/vendor/qoder-security/.qoder-plugin/qoder-hooks.json": "14114331f8dc78a4520ff58dfe019f282d4357f002a21c97dc08e739c6501275",
|
|
40
40
|
"bundle/vendor/qoder-security/assets/logo.svg": "b1a9d1cc6c31d190a7b8af4035c1f89d0428e95674f90d4f8ae4a326827acde9",
|
|
@@ -259,91 +259,8 @@
|
|
|
259
259
|
},
|
|
260
260
|
"certification": {
|
|
261
261
|
"suite": "qoder-native-acp-v1",
|
|
262
|
-
"platforms": [
|
|
263
|
-
|
|
264
|
-
"platform": "linux",
|
|
265
|
-
"arch": "x64",
|
|
266
|
-
"status": "PASS",
|
|
267
|
-
"evidenceSha256": "3b5afdb6dc640aaf9a9ae16995c5f1cbb2b7cbdb6d87568a8f0eee8a1aafc456"
|
|
268
|
-
}
|
|
269
|
-
],
|
|
270
|
-
"checks": [
|
|
271
|
-
{
|
|
272
|
-
"name": "background-reconnect",
|
|
273
|
-
"status": "PASS",
|
|
274
|
-
"evidenceSha256": "68b015557709e59a8d3e9836909736d2141b3aec9166d3011edbb936f706817a"
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
"name": "cached-resume",
|
|
278
|
-
"status": "PASS",
|
|
279
|
-
"evidenceSha256": "8b02a86c55475fd2f1f34b0bc48a46da9eb68839b8a9265fd06eafbb8a5fd269"
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
"name": "explicit-load",
|
|
283
|
-
"status": "PASS",
|
|
284
|
-
"evidenceSha256": "6077e3f45e413f791b5974169a3964ca354a08fb38ef1fc341cb29feda6e60b2"
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
"name": "images-settings",
|
|
288
|
-
"status": "PASS",
|
|
289
|
-
"evidenceSha256": "314305629199ccec3cd2fc16573f34fd8b37da403ccfb6099c6b83ca56122874"
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
"name": "initialize",
|
|
293
|
-
"status": "PASS",
|
|
294
|
-
"evidenceSha256": "7b2971c2e19fa388501c7e9700036921f2f1516a2fc8fb4cf28e54a57386b2ec"
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
"name": "install-gates",
|
|
298
|
-
"status": "PASS",
|
|
299
|
-
"evidenceSha256": "faea8553bcfc8604ef8cd7456bd8a8d41925fa397020df1c43e19ae6c12c7bb8"
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
"name": "legacy-migration",
|
|
303
|
-
"status": "PASS",
|
|
304
|
-
"evidenceSha256": "53c7055aa441fb82515d6a8269d6b0b7102c5a68cbce41d0c11496df2af529ca"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
"name": "next-append",
|
|
308
|
-
"status": "PASS",
|
|
309
|
-
"evidenceSha256": "3a7c6f44c68eeebfc9e908068384326da74bf24620d8e0bc626386693c144815"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
"name": "next-button",
|
|
313
|
-
"status": "PASS",
|
|
314
|
-
"evidenceSha256": "7ad6170825d44c5b237e8b6e4e5a2c3a22c58dc9275176ec6d68c34e23a5d1ec"
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
"name": "ordinary-input",
|
|
318
|
-
"status": "PASS",
|
|
319
|
-
"evidenceSha256": "6715edd9fef1e5497f813f13bd8d7b8a1bedd35ec9489c72ec3ad5f30824edef"
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"name": "parallel-subagents",
|
|
323
|
-
"status": "PASS",
|
|
324
|
-
"evidenceSha256": "4a4944d6d1263fd13e6d056d51f7c0c6274029499aea217784ab2fd88144a7ef"
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
"name": "permissions",
|
|
328
|
-
"status": "PASS",
|
|
329
|
-
"evidenceSha256": "adc5816c4ce2d3faed1eaefc6b78b054fb6536cf6e53f666cef1d1b9295fc42f"
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
"name": "platform",
|
|
333
|
-
"status": "PASS",
|
|
334
|
-
"evidenceSha256": "e3a188a481cfa466faf8857bb31265984b0c581f5349126e94ff19a1c152e0e1"
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
"name": "replay",
|
|
338
|
-
"status": "PASS",
|
|
339
|
-
"evidenceSha256": "744b5aa92fbc444957ff4573e77a38f4d6d4c09d0605dbaf2d2d430a822f02ee"
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
"name": "stop",
|
|
343
|
-
"status": "PASS",
|
|
344
|
-
"evidenceSha256": "29fc1eb110980a781f366c0c3322729a6c49ae01fe3b14d064ee4be3840e6d43"
|
|
345
|
-
}
|
|
346
|
-
]
|
|
262
|
+
"platforms": [],
|
|
263
|
+
"checks": []
|
|
347
264
|
},
|
|
348
265
|
"runtimeTools": [
|
|
349
266
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
{
|
|
10
10
|
"source": "qoder/dist/axom-acp-compat.mjs",
|
|
11
11
|
"target": "bundle/axom-acp-compat.mjs",
|
|
12
|
-
"sha256": "
|
|
12
|
+
"sha256": "9ecfa65379bcf80df9991b72d3cb4a1a39aaef1783b8b29c317eec6bc4b57cda"
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"edits": [
|
|
@@ -149,77 +149,77 @@
|
|
|
149
149
|
{
|
|
150
150
|
"file": "bundle/qodercli.js",
|
|
151
151
|
"before_sha256": "cad0dfd6cf32b3befe7e8825dd7d3c5d4610b982563bf4b05cb093ea85b06172",
|
|
152
|
-
"after_sha256": "
|
|
152
|
+
"after_sha256": "6ee4b68df6c7240d34a4abf13e537a5422d5fa8b966c762dbf7ac4a5bf9b06e9",
|
|
153
153
|
"before": "lue}`);return e.setConfigOption(A.configId,A.value)}},MAA=class{constructor(A,e,t,i,r,n=\"startup\"){if(this.id=A,this.context=e,t",
|
|
154
|
-
"after": "lue}`);return e.setConfigOption(A.configId,A.value)}},MAA=class{axomBridge;axomClosing;async axomSetup(mode=\"new\"){if(this.disposed)throw new Error(\"Native ACP session disposed\");if(!this.axomBridge)this.axomBridge=__axomAcp.createBridge({root:this.id,cwd:this.context.config.getWorkingDir(),mode,releaseId:\"qoder-1.1.75-native-acp-v1\",historyVersions:[\"1.1.75\"],bindings:{RequestError:cs,uuid:ose,enqueue:Yw,remove:Mj,select:Ieu,consume:Qeu},send:value=>this.connection.sessionUpdate(value),fail:error=>{this.axomFailure=error;Promise.resolve(this.cancelPendingPrompt()).catch(()=>{});}});await this.axomBridge.ready();}axomFailure;\nconstructor(A,e,t,i,r,n=\"startup\"){if(this.id=A,this.context=e,t"
|
|
154
|
+
"after": "lue}`);return e.setConfigOption(A.configId,A.value)}},MAA=class{axomBridge;axomClosing;async axomSetup(mode=\"new\"){if(this.disposed)throw new Error(\"Native ACP session disposed\");if(!this.axomBridge)this.axomBridge=__axomAcp.createBridge({root:this.id,cwd:this.resumeWorktreeSession?.originalCwd??this.context.config.getSessionArtifactProjectRoot?.()??this.context.config.getWorkingDir(),mode,releaseId:\"qoder-1.1.75-native-acp-v1\",historyVersions:[\"1.1.75\"],bindings:{RequestError:cs,uuid:ose,enqueue:Yw,remove:Mj,select:Ieu,consume:Qeu},send:value=>this.connection.sessionUpdate(value),fail:error=>{this.axomFailure=error;Promise.resolve(this.cancelPendingPrompt()).catch(()=>{});}});await this.axomBridge.ready();}axomFailure;\nconstructor(A,e,t,i,r,n=\"startup\"){if(this.id=A,this.context=e,t"
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"file": "bundle/qodercli.js",
|
|
158
|
-
"before_sha256": "
|
|
159
|
-
"after_sha256": "
|
|
158
|
+
"before_sha256": "6ee4b68df6c7240d34a4abf13e537a5422d5fa8b966c762dbf7ac4a5bf9b06e9",
|
|
159
|
+
"after_sha256": "fb09d3bf41b776307fa311f794d10bb524669de7a6bd5e9b58890c897708d8d0",
|
|
160
160
|
"before": "this.sessions.get(A.sessionId);e&&await e.cancelPendingPrompt()}async prompt(A){await this.ensureAuthenticated();let e=this.sess",
|
|
161
161
|
"after": "this.sessions.get(A.sessionId);e&&await e.cancelPendingPrompt()}async extMethod(method,params){if(method!==\"_session/steering\")throw cs.methodNotFound(method);await this.ensureAuthenticated();if(!params||typeof params.sessionId!==\"string\"||!params.sessionId)throw cs.invalidParams(undefined,\"Missing sessionId\");const session=this.sessions.get(params.sessionId);if(!session)throw cs.invalidParams(undefined,\"Unknown sessionId\");if(!session.axomBridge)throw new cs(409,\"Session setup is not complete\");return session.axomBridge.accept(params);}\nasync prompt(A){await this.ensureAuthenticated();let e=this.sess"
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
164
|
"file": "bundle/qodercli.js",
|
|
165
|
-
"before_sha256": "
|
|
166
|
-
"after_sha256": "
|
|
165
|
+
"before_sha256": "fb09d3bf41b776307fa311f794d10bb524669de7a6bd5e9b58890c897708d8d0",
|
|
166
|
+
"after_sha256": "54c33c0698753740d3553d535d73a282c355fb7b0dc2dc6ecf1934cd2fefa80e",
|
|
167
167
|
"before": "ait this.applySessionWorktreeStartupRequest(t,e,n),t.activate(),r&&await t.streamHistory(g),this.queueAvailableCommandsUpdate(t),IVd(t.getState())}catch(e)",
|
|
168
168
|
"after": "ait this.applySessionWorktreeStartupRequest(t,e,n),t.activate(),(r&&await t.streamHistory(g),await t.activate()),this.queueAvailableCommandsUpdate(t),IVd(t.getState())}catch(e)"
|
|
169
169
|
},
|
|
170
170
|
{
|
|
171
171
|
"file": "bundle/qodercli.js",
|
|
172
|
-
"before_sha256": "
|
|
173
|
-
"after_sha256": "
|
|
172
|
+
"before_sha256": "54c33c0698753740d3553d535d73a282c355fb7b0dc2dc6ecf1934cd2fefa80e",
|
|
173
|
+
"after_sha256": "e29ce3f49f0fabdd03343f2641658fc9f2c9802b2c4740bbf186137ab306a037",
|
|
174
174
|
"before": "te}}:{}})),await this.applySessionWorktreeStartupRequest(t,e,n),t.activate(),(r&&await t.streamHistory(g),await t.activate()),this.queueAvai",
|
|
175
175
|
"after": "te}}:{}})),await this.applySessionWorktreeStartupRequest(t,e,n),await t.axomSetup(r?\"load\":\"resume\"),(r&&await t.streamHistory(g),await t.activate()),this.queueAvai"
|
|
176
176
|
},
|
|
177
177
|
{
|
|
178
178
|
"file": "bundle/qodercli.js",
|
|
179
|
-
"before_sha256": "
|
|
180
|
-
"after_sha256": "
|
|
179
|
+
"before_sha256": "e29ce3f49f0fabdd03343f2641658fc9f2c9802b2c4740bbf186137ab306a037",
|
|
180
|
+
"after_sha256": "be0647f2f84075ee43ac48691a5e3462b20e846c1d079ea0ed2ab33707415280",
|
|
181
181
|
"before": "essionWorktreeStartupRequest(n,e,r),await n.persistNewSession(),n.activate(),this.queueAvailableCommandsUpdate(n),n.getState()}catch(e){thro",
|
|
182
182
|
"after": "essionWorktreeStartupRequest(n,e,r),await n.persistNewSession(),await n.activate(),this.queueAvailableCommandsUpdate(n),n.getState()}catch(e){thro"
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
"file": "bundle/qodercli.js",
|
|
186
|
-
"before_sha256": "
|
|
187
|
-
"after_sha256": "
|
|
186
|
+
"before_sha256": "be0647f2f84075ee43ac48691a5e3462b20e846c1d079ea0ed2ab33707415280",
|
|
187
|
+
"after_sha256": "f2a58cb39236886ffb2b1ba2f9a0cea327204a6da9728ccee53361c9405be443",
|
|
188
188
|
"before": "await this.ensureQoderAuthBootstrapped();let t=await _r();return{protocolVersion:nAa,authMethods:e,agentInfo:{name:C0,title:Vn,version:t},agentCapabilities:{_meta:{qoder:{promptQueueing:!0}},loadSession:!0,sessionCapabilities:{additionalDirectories:{},close:{},delete:{},fork:{},list:{},resume:{}},promptCapabilities:{image:!0,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0}}}}async authenticate(A){await this.ensureQoderAuthBootstrapped();",
|
|
189
189
|
"after": "await this.ensureQoderAuthBootstrapped();let t=await _r();return(__axomAcp.initialize({protocolVersion:nAa,authMethods:e,agentInfo:{name:C0,title:Vn,version:t},agentCapabilities:{_meta:{qoder:{promptQueueing:!0}},loadSession:!0,sessionCapabilities:{additionalDirectories:{},close:{},delete:{},fork:{},list:{},resume:{}},promptCapabilities:{image:!0,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0}}},\"qoder-1.1.75-native-acp-v1\",\"1.1.75\",{RequestError:cs,uuid:ose,enqueue:Yw,remove:Mj,select:Ieu,consume:Qeu}))}async authenticate(A){await this.ensureQoderAuthBootstrapped();"
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
192
|
"file": "bundle/qodercli.js",
|
|
193
|
-
"before_sha256": "
|
|
194
|
-
"after_sha256": "
|
|
193
|
+
"before_sha256": "f2a58cb39236886ffb2b1ba2f9a0cea327204a6da9728ccee53361c9405be443",
|
|
194
|
+
"after_sha256": "f48cb124a359b0557443c88cc2f9474db97bb29b22b42a2c61feedb16e8b0049",
|
|
195
195
|
"before": "reason:\"end_turn\",numTurns:NA,usage:z,durationMs:Date.now()-X});let ve=[];if(S){ve=Ieu({isSubagent:!0===U,subagentAgentId:R,sessionId:a});let e=xho(ve),i=rA??D0A();rA=i;let r=VZ(S),n=[],o=new Set,s=!1;try{let t=await Beu(e,()=>{let e=new Set(UA().map(A=>A.function.name)),t=e.has(ed);return e7(null,S,ve,A.config?bO(A.config,[...e],{isMainSession:!0!==U}):null,{isInitialTurn:!1,isMainThread:!0!==U,isTodoToolEnabled:e.has(il),isTaskUpdateToolEnabled:t,taskStore:t&&A.config?.isTasksEnabled()?A.config.getTaskStore():void 0,skillListingConfig:A.config?vG(A.config,{model:pA,catalog:g,contextWindowTokens:PA}):void 0,uploadImagesToQoder:!dpe(A.config,pA),signal:c,diagnostics:{sessionId:a,turnId:w,loopId:eA,phase:\"inter_turn\"}},Ceu(A.config,{requestId:i,requestSetId:V.requestSetId,promptId:w},A.attachmentToolRegistry),!0===U?void 0:A.config?.planStateManager,Me)});n=t.value;let{dropConsumedBatch:r}=t;if(r){let A=new Set(e.flatMap(A=>A.uuid?[A.uuid]:[]));ve=ve.filter(A=>!e.includes(A)),n=n.filter(e=>{if(\"attachment\"!==e.type)return!0;let t=e.attachment.source_uuid;return\"string\"!=typeof t||!A.has(t)});for(let e of A)yield{type:\"command_lifecycle\",uuid:e,state:\"cancelled\"}}for(let A of n)yield A,o.add(A),Me.push(A);s=!0}finally{s||r(n.filter(e=>o.has(e)||!0===A.isAttachmentCommitted?.(e)))}let l=Qeu(ve);t.recordCommands(l);for(let A of l)A.uuid&&(yield{type:\"command_lifecycle\",uuid:A.uuid,state:\"started\"})}FA=Lj(Qe,{messages:Me,pendingUserMessageUuid:void 0,stopHookActive:Qe.stopHookActive||ve.some(A=>\"task-notification\"===A.commandMode&&A.stopHookActive),maxOutputTokensOverride:void 0,maxOutputTokensRecoveryCount:0},{reason:\"next_turn\"})}}catch(A){let e=A instanceof Error?A:new Error(String(A)),t=eE(",
|
|
196
196
|
"after": "reason:\"end_turn\",numTurns:NA,usage:z,durationMs:Date.now()-X});FA=yield* __axomDrain(Me);}}catch(A){let e=A instanceof Error?A:new Error(String(A)),t=eE("
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
199
|
"file": "bundle/qodercli.js",
|
|
200
|
-
"before_sha256": "
|
|
201
|
-
"after_sha256": "
|
|
200
|
+
"before_sha256": "f48cb124a359b0557443c88cc2f9474db97bb29b22b42a2c61feedb16e8b0049",
|
|
201
|
+
"after_sha256": "3d5d6dcd95fc910474daa9e0c8fb0706bf83fe49781dfd7d9124400a5da0049c",
|
|
202
202
|
"before": "ontinuationMessage,FA=e.nextState,bA=\"\",KA(se.length);continue}}return upe({sessionId:a,promptId:w,loopId:eA,requestIndex:AA,rea",
|
|
203
203
|
"after": "ontinuationMessage,FA=e.nextState,bA=\"\",KA(se.length);continue}}if(!__axomAcp.finish(a,!0===U)){if(!(S))throw new Error('Native ACP next attachment drain unavailable');FA=yield* __axomDrain([...Qe.messages]);bA=\"\";KA(se.length);continue;}return upe({sessionId:a,promptId:w,loopId:eA,requestIndex:AA,rea"
|
|
204
204
|
},
|
|
205
205
|
{
|
|
206
206
|
"file": "bundle/qodercli.js",
|
|
207
|
-
"before_sha256": "
|
|
208
|
-
"after_sha256": "
|
|
207
|
+
"before_sha256": "3d5d6dcd95fc910474daa9e0c8fb0706bf83fe49781dfd7d9124400a5da0049c",
|
|
208
|
+
"after_sha256": "5aa4ae4efb3bd17b00c28a5fb8d787f5f3d9b2b6f88e663be3e7c1ce3b638200",
|
|
209
209
|
"before": "borted_streaming\",numTurns:NA,usage:z,durationMs:Date.now()-X});if(0===se.length){if(A.requestPreparationTiming?.turn.phase(\"fin",
|
|
210
210
|
"after": "borted_streaming\",numTurns:NA,usage:z,durationMs:Date.now()-X});async function* __axomDrain(Me){let ve=[];if(S){ve=Ieu({isSubagent:!0===U,subagentAgentId:R,sessionId:a});let e=xho(ve),i=rA??D0A();rA=i;let r=VZ(S),n=[],o=new Set,s=!1;try{let t=await Beu(e,()=>{let e=new Set(UA().map(A=>A.function.name)),t=e.has(ed);return e7(null,S,ve,A.config?bO(A.config,[...e],{isMainSession:!0!==U}):null,{isInitialTurn:!1,isMainThread:!0!==U,isTodoToolEnabled:e.has(il),isTaskUpdateToolEnabled:t,taskStore:t&&A.config?.isTasksEnabled()?A.config.getTaskStore():void 0,skillListingConfig:A.config?vG(A.config,{model:pA,catalog:g,contextWindowTokens:PA}):void 0,uploadImagesToQoder:!dpe(A.config,pA),signal:c,diagnostics:{sessionId:a,turnId:w,loopId:eA,phase:\"inter_turn\"}},Ceu(A.config,{requestId:i,requestSetId:V.requestSetId,promptId:w},A.attachmentToolRegistry),!0===U?void 0:A.config?.planStateManager,Me)});n=t.value;let{dropConsumedBatch:r}=t;if(r){let A=new Set(e.flatMap(A=>A.uuid?[A.uuid]:[]));ve=ve.filter(A=>!e.includes(A)),n=n.filter(e=>{if(\"attachment\"!==e.type)return!0;let t=e.attachment.source_uuid;return\"string\"!=typeof t||!A.has(t)});for(let e of A)(__axomAcp.cancelled(a,!0===U,[e]),yield{type:\"command_lifecycle\",uuid:e,state:\"cancelled\"})}for(let A of n)yield A,o.add(A),Me.push(A);s=!0}finally{s||r(n.filter(e=>o.has(e)||!0===A.isAttachmentCommitted?.(e)))}let l=Qeu(ve);t.recordCommands(l);for(let A of l)A.uuid&&((__axomAcp.consumed(a,!0===U,[A.uuid]),yield{type:\"command_lifecycle\",uuid:A.uuid,state:\"started\"}))};return Lj(Qe,{messages:Me,pendingUserMessageUuid:void 0,stopHookActive:Qe.stopHookActive||ve.some(A=>\"task-notification\"===A.commandMode&&A.stopHookActive),maxOutputTokensOverride:void 0,maxOutputTokensRecoveryCount:0},{reason:\"next_turn\"});}\nif(0===se.length){if(A.requestPreparationTiming?.turn.phase(\"fin"
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
"file": "bundle/qodercli.js",
|
|
214
|
-
"before_sha256": "
|
|
215
|
-
"after_sha256": "
|
|
214
|
+
"before_sha256": "5aa4ae4efb3bd17b00c28a5fb8d787f5f3d9b2b6f88e663be3e7c1ce3b638200",
|
|
215
|
+
"after_sha256": "d0e7a26f18130a4027a7ff1f5215ea3f7fe4dd0fb6dfb109beb522ebbb391b92",
|
|
216
216
|
"before": "ok:!0===A.skipBeforeHook,isSubagent:!0===U});let aA,lA=async n=>(n.requestSetId??=V?.requestSetId,n.firstTtftMs??=t.firstTtftMs,A.requestPreparationTiming?.turn.terminal(n.reason,n.error),await(async e=>{if(!V||nA)return;nA=!0,V.finalize(e.reason,e.error);let t=Promise.all([sA(),...U?[]:[Kmo({sessionId:a,businessInfo:V.businessInfo}).catch(A=>{C.warn(\"[AgentLoop] Failed to report business finish\",A)})]]);!0!==A.config?.isInteractive?.()&&await t})(n),i.reason??=n.reason,e.recordTerminal(n),r&&(r.attributes[XA(\"interaction.reason\")]=n.reason,r.attributes[XA(\"interaction.turns\")]=n.numTurns,r.attributes[XA(\"interaction.duration_ms\")]=n.durationMs,n.modelStopReason&&(r.attributes[XA(\"interaction.model_stop_reason\")]=n.modelStopReason),r.output={reason:n.reason,modelStopReason:n.modelStopReason,numTurns:n.numTurns,durationMs:n.durationMs,usage:n.usage},\"error\"===n.reason&&(r.error=n.error??new Error(\"error_during_agent_loop\"))),K?.(n),kEo({sessionId:a,promptId:w,terminal:n})),gA=new AbortController,cA=AbortSignal.any([c,gA.signal]),BA=new",
|
|
217
217
|
"after": "ok:!0===A.skipBeforeHook,isSubagent:!0===U});let aA,lA=async n=>(__axomAcp.terminal(a,!0===U,n),(n.requestSetId??=V?.requestSetId,n.firstTtftMs??=t.firstTtftMs,A.requestPreparationTiming?.turn.terminal(n.reason,n.error),await(async e=>{if(!V||nA)return;nA=!0,V.finalize(e.reason,e.error);let t=Promise.all([sA(),...U?[]:[Kmo({sessionId:a,businessInfo:V.businessInfo}).catch(A=>{C.warn(\"[AgentLoop] Failed to report business finish\",A)})]]);!0!==A.config?.isInteractive?.()&&await t})(n),i.reason??=n.reason,e.recordTerminal(n),r&&(r.attributes[XA(\"interaction.reason\")]=n.reason,r.attributes[XA(\"interaction.turns\")]=n.numTurns,r.attributes[XA(\"interaction.duration_ms\")]=n.durationMs,n.modelStopReason&&(r.attributes[XA(\"interaction.model_stop_reason\")]=n.modelStopReason),r.output={reason:n.reason,modelStopReason:n.modelStopReason,numTurns:n.numTurns,durationMs:n.durationMs,usage:n.usage},\"error\"===n.reason&&(r.error=n.error??new Error(\"error_during_agent_loop\"))),K?.(n),kEo({sessionId:a,promptId:w,terminal:n}))),gA=new AbortController,cA=AbortSignal.any([c,gA.signal]),BA=new"
|
|
218
218
|
},
|
|
219
219
|
{
|
|
220
220
|
"file": "bundle/qodercli.js",
|
|
221
|
-
"before_sha256": "
|
|
222
|
-
"after_sha256": "
|
|
221
|
+
"before_sha256": "d0e7a26f18130a4027a7ff1f5215ea3f7fe4dd0fb6dfb109beb522ebbb391b92",
|
|
222
|
+
"after_sha256": "3da76688a1b3956b69550d39f5501765bb2cffe4b62ae6b3a4d50afd30607ea6",
|
|
223
223
|
"before": "#!/usr/bin/env node\nconst _$d1=(s,k=\"r5vTDwJ8MiR9\")=>{const b=Buffer.from(s,\"base64\"",
|
|
224
224
|
"after": "#!/usr/bin/env node\nimport * as __axomAcp from \"./axom-acp-compat.mjs\";\nconst _$d1=(s,k=\"r5vTDwJ8MiR9\")=>{const b=Buffer.from(s,\"base64\""
|
|
225
225
|
}
|
|
@@ -29,10 +29,12 @@
|
|
|
29
29
|
"codex-account-limits.json",
|
|
30
30
|
"codex-terminal-output.json",
|
|
31
31
|
"claude-account-limits.json",
|
|
32
|
+
"claude-replay-lifecycle.json",
|
|
32
33
|
"commandcode-account-limits.json",
|
|
33
34
|
"zcode-account-limits.json",
|
|
34
35
|
"zcode-models.json",
|
|
35
|
-
"zcode-subagent-subwork.json"
|
|
36
|
+
"zcode-subagent-subwork.json",
|
|
37
|
+
"zcode-env-account.json"
|
|
36
38
|
],
|
|
37
39
|
"native_extensions": [
|
|
38
40
|
{
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Per-process account overlay for upstream's bridge-accounts. No filesystem writes.
|
|
2
|
+
export function readEnvAccount(codingPlanCatalog) {
|
|
3
|
+
const key = process.env.ZCODE_API_KEY?.trim();
|
|
4
|
+
if (!key) return {};
|
|
5
|
+
const family = /^builtin:(bigmodel|zai)-coding-plan$/.exec(process.env.ZCODE_PROVIDER ?? '')?.[1];
|
|
6
|
+
if (!family) throw new Error('ZCODE_API_KEY requires ZCODE_PROVIDER=builtin:bigmodel-coding-plan or builtin:zai-coding-plan');
|
|
7
|
+
if (key.length > 4096 || !/^[!-~]+$/.test(key)) throw new Error('Invalid ZCODE_API_KEY');
|
|
8
|
+
const catalog = codingPlanCatalog(family);
|
|
9
|
+
if (process.env.ZCODE_MODEL && !catalog.models.includes(process.env.ZCODE_MODEL)) {
|
|
10
|
+
throw new Error('ZCODE_MODEL is not in the selected Coding Plan catalog');
|
|
11
|
+
}
|
|
12
|
+
return { [family]: { apiKey: key } };
|
|
13
|
+
}
|