@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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { spawn as nodeSpawn, execFile } from 'node:child_process';
|
|
3
|
+
import { promisify } from 'node:util';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
const execute = promisify(execFile);
|
|
6
|
+
export function watchdogUnitName(input) {
|
|
7
|
+
const digest = createHash('sha256').update(path.resolve(input.program)).update('\0').update(path.resolve(input.plan)).digest('hex').slice(0, 32);
|
|
8
|
+
return `axom-update-watchdog-${digest}`;
|
|
9
|
+
}
|
|
10
|
+
/** detached:true changes the Unix session, but cannot escape systemd's service cgroup. Managed
|
|
11
|
+
* Linux watchdogs must belong to a separate user unit before their predecessor can be stopped. */
|
|
12
|
+
export async function launchWatchdogProcess(input, deps = {}) {
|
|
13
|
+
for (const value of [input.nodePath, input.program, input.plan, ...(input.logPath ? [input.logPath] : [])]) {
|
|
14
|
+
if (!path.isAbsolute(value) || /[\u0000-\u001f\u007f]/.test(value))
|
|
15
|
+
throw Error('Watchdog process paths must be absolute without control characters');
|
|
16
|
+
}
|
|
17
|
+
if ((deps.platform ?? process.platform) === 'linux' && input.lifecycle === 'managed') {
|
|
18
|
+
const unit = watchdogUnitName(input);
|
|
19
|
+
const environment = deps.env ?? process.env;
|
|
20
|
+
const run = async (executable, argv) => {
|
|
21
|
+
const result = await (deps.runSystemd ?? (async (exe, args) => execute(exe, args, { env: environment, timeout: 15_000, maxBuffer: 65_536 })))(executable, argv);
|
|
22
|
+
if (result.code !== undefined && result.code !== 0)
|
|
23
|
+
throw Error(`${executable} exited ${result.code}: ${result.stderr ?? ''}`);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
const args = ['--user', '--quiet', '--collect', '--unit', unit, '--property=Type=exec', '--property=Restart=no'];
|
|
27
|
+
for (const name of ['PATH', 'NODE_EXTRA_CA_CERTS', 'NODE_OPTIONS', 'HTTP_PROXY', 'HTTPS_PROXY', 'ALL_PROXY', 'NO_PROXY',
|
|
28
|
+
'http_proxy', 'https_proxy', 'all_proxy', 'no_proxy', 'NPM_CONFIG_USERCONFIG', 'NPM_CONFIG_CACHE', 'npm_config_userconfig', 'npm_config_cache']) {
|
|
29
|
+
if (environment[name] !== undefined)
|
|
30
|
+
args.push(`--setenv=${name}`);
|
|
31
|
+
}
|
|
32
|
+
if (input.logPath)
|
|
33
|
+
args.push(`--property=StandardOutput=append:${input.logPath}`, `--property=StandardError=append:${input.logPath}`);
|
|
34
|
+
args.push('--', input.nodePath, input.program, input.plan);
|
|
35
|
+
let launchError;
|
|
36
|
+
try {
|
|
37
|
+
await run('/usr/bin/systemd-run', args);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
launchError = error;
|
|
41
|
+
}
|
|
42
|
+
// Verify newly launched and existing units identically before authorizing a handoff.
|
|
43
|
+
// busctl's typed JSON preserves argument boundaries, including spaces and quotes.
|
|
44
|
+
try {
|
|
45
|
+
const properties = await run('/usr/bin/systemctl', ['--user', 'show', '--property=ActiveState', '--property=Transient', '--property=MainPID', `${unit}.service`]);
|
|
46
|
+
const values = Object.fromEntries(properties.stdout.trim().split('\n').map(line => line.split('=')));
|
|
47
|
+
if (values.ActiveState !== 'active' || values.Transient !== 'yes')
|
|
48
|
+
throw Error('Watchdog unit is not an active transient service');
|
|
49
|
+
const pid = Number(values.MainPID);
|
|
50
|
+
if (!Number.isSafeInteger(pid) || pid <= 0)
|
|
51
|
+
throw Error('Watchdog unit has no live main process');
|
|
52
|
+
const objectPath = `/org/freedesktop/systemd1/unit/${unit.replace(/-/g, '_2d')}_2eservice`;
|
|
53
|
+
const execution = await run('/usr/bin/busctl', ['--user', '--json=short', 'get-property', 'org.freedesktop.systemd1', objectPath,
|
|
54
|
+
'org.freedesktop.systemd1.Service', 'ExecStart']);
|
|
55
|
+
const value = JSON.parse(execution.stdout);
|
|
56
|
+
const starts = value.data;
|
|
57
|
+
if (value.type !== 'a(sasbttttuii)' || !Array.isArray(starts) || starts.length !== 1 || !Array.isArray(starts[0]) ||
|
|
58
|
+
starts[0][0] !== input.nodePath || JSON.stringify(starts[0][1]) !== JSON.stringify([input.nodePath, input.program, input.plan])) {
|
|
59
|
+
throw Error('Existing watchdog unit has different executable arguments');
|
|
60
|
+
}
|
|
61
|
+
return { kind: 'systemd', unit, pid };
|
|
62
|
+
}
|
|
63
|
+
catch (verificationError) {
|
|
64
|
+
const error = launchError ?? verificationError;
|
|
65
|
+
throw new Error(`Unable to arm independent systemd watchdog ${unit}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const child = (deps.spawn ?? nodeSpawn)(input.nodePath, [input.program, input.plan], { detached: true, shell: false, stdio: 'ignore' });
|
|
69
|
+
await new Promise((resolve, reject) => { child.once('spawn', resolve); child.once('error', reject); });
|
|
70
|
+
child.unref();
|
|
71
|
+
return { kind: 'detached', pid: child.pid };
|
|
72
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platless/axom-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.52",
|
|
4
4
|
"description": "Axomwork CLI - manage Axomwork structures, records and executions over MCP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
26
26
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
27
27
|
"@napi-rs/keyring": "^1.1.3",
|
|
28
|
-
"@xterm/addon-serialize": "^0.14.0",
|
|
29
28
|
"@xterm/headless": "^6.0.0",
|
|
30
29
|
"commander": "^15.0.0",
|
|
31
30
|
"js-yaml": "^4.1.0",
|
|
@@ -48,5 +47,10 @@
|
|
|
48
47
|
"node-pty": "1.2.0-beta.15",
|
|
49
48
|
"playwright-core": "1.63.0"
|
|
50
49
|
},
|
|
51
|
-
"axomPatchBundle": true
|
|
50
|
+
"axomPatchBundle": true,
|
|
51
|
+
"axomWorkstationRootReader": {
|
|
52
|
+
"schemaVersion": 1,
|
|
53
|
+
"rootFormat": 2,
|
|
54
|
+
"legacySourceMapping": true
|
|
55
|
+
}
|
|
52
56
|
}
|
|
Binary file
|