@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.
Files changed (159) hide show
  1. package/README.md +7 -1
  2. package/dist/axom-patch/cli/README.md +31 -2
  3. package/dist/axom-patch/cli/account-limits/generate.py +2 -2
  4. package/dist/axom-patch/cli/claude-replay-lifecycle.json +16 -0
  5. package/dist/axom-patch/cli/codex-terminal-output.json +2 -2
  6. package/dist/axom-patch/cli/probes/claude-replay-lifecycle.mjs +31 -0
  7. package/dist/axom-patch/cli/probes/codex-terminal-output.mjs +1 -1
  8. package/dist/axom-patch/cli/probes/zcode-env-account.mjs +81 -0
  9. package/dist/axom-patch/cli/probes/zcode-subagent-subwork.mjs +7 -0
  10. package/dist/axom-patch/cli/qoder/dist/axom-acp-compat.mjs +137 -41
  11. package/dist/axom-patch/cli/qoder/releases/1.1.75.json +5 -88
  12. package/dist/axom-patch/cli/qoder-native-acp.json +23 -23
  13. package/dist/axom-patch/cli/runtime.json +3 -1
  14. package/dist/axom-patch/cli/zcode/env-account.mjs +13 -0
  15. package/dist/axom-patch/cli/zcode/generate-env-account.py +52 -0
  16. package/dist/axom-patch/cli/zcode-account-limits.json +7 -7
  17. package/dist/axom-patch/cli/zcode-env-account.json +58 -0
  18. package/dist/axom-patch/cli/zcode-models.json +9 -9
  19. package/dist/axom-patch/cli/zcode-subagent-subwork.json +10 -10
  20. package/dist/cli.js +9 -11
  21. package/dist/commands/auth.js +4 -1
  22. package/dist/commands/update.js +68 -7
  23. package/dist/commands/workstation.js +94 -223
  24. package/dist/commands/workstationRegistrations.js +116 -0
  25. package/dist/credentialBroker.js +13 -2
  26. package/dist/credentials.js +16 -0
  27. package/dist/install/claude/commands.js +2 -2
  28. package/dist/keepers/terminal/keeper.mjs +1089 -673
  29. package/dist/keepers/terminal/manifest.json +4 -4
  30. package/dist/native/darwin-x64/axom-quic +0 -0
  31. package/dist/workstation/acp/acpAgents.js +11 -4
  32. package/dist/workstation/acp/outbox.js +12 -5
  33. package/dist/workstation/acp/permission.js +2 -2
  34. package/dist/workstation/acp/processor/checkpoint.js +4 -3
  35. package/dist/workstation/acp/processor/control.js +2 -2
  36. package/dist/workstation/acp/processor/jsonrpc.js +8 -0
  37. package/dist/workstation/acp/processor/session.js +3 -2
  38. package/dist/workstation/acp/processor/state.js +1 -0
  39. package/dist/workstation/acp/processor/transport/local.js +19 -3
  40. package/dist/workstation/acp/processor/updates.js +25 -0
  41. package/dist/workstation/acp/processorSession.js +12 -1
  42. package/dist/workstation/acp/registry/catalog.js +6 -6
  43. package/dist/workstation/acp/test/keeperWorld.js +4 -3
  44. package/dist/workstation/agentSessions.js +76 -23
  45. package/dist/workstation/channels/agent.js +9 -1
  46. package/dist/workstation/channels/computer.js +27 -4
  47. package/dist/workstation/channels/management.js +36 -5
  48. package/dist/workstation/config.js +18 -6
  49. package/dist/workstation/control/bindingStore.js +4 -0
  50. package/dist/workstation/control/commands.js +1 -0
  51. package/dist/workstation/control/daemonIdentity.js +90 -0
  52. package/dist/workstation/control/deviceCommands.js +191 -0
  53. package/dist/workstation/control/deviceProtocol.js +68 -0
  54. package/dist/workstation/control/locks.js +51 -4
  55. package/dist/workstation/control/rootFormat.js +16 -0
  56. package/dist/workstation/control/runtimeClient.js +60 -5
  57. package/dist/workstation/control/runtimeHost.js +96 -9
  58. package/dist/workstation/control/serverIdentity.js +2 -2
  59. package/dist/workstation/control/updateTransition.js +91 -0
  60. package/dist/workstation/daemon.js +262 -360
  61. package/dist/workstation/daemonctl.js +150 -12
  62. package/dist/workstation/desktopControl/automationDevice.js +219 -0
  63. package/dist/workstation/desktopControl/automationJson.js +74 -0
  64. package/dist/workstation/desktopControl/automationLocalState.js +23 -0
  65. package/dist/workstation/desktopControl/automationPreparation.js +1 -0
  66. package/dist/workstation/desktopControl/automationProtocol.js +253 -0
  67. package/dist/workstation/desktopControl/automationSchema.generated.js +1 -0
  68. package/dist/workstation/desktopControl/automationSession.js +81 -0
  69. package/dist/workstation/desktopControl/automationTransport.js +138 -0
  70. package/dist/workstation/desktopControl/capabilities.js +2 -1
  71. package/dist/workstation/desktopControl/deviceAdmission.js +229 -0
  72. package/dist/workstation/desktopControl/deviceOwnership.js +130 -0
  73. package/dist/workstation/desktopControl/deviceSockets.js +2 -2
  74. package/dist/workstation/desktopControl/helperProcess.js +250 -1
  75. package/dist/workstation/desktopControl/hostGrant.js +65 -0
  76. package/dist/workstation/desktopControl/lobby.js +4 -2
  77. package/dist/workstation/desktopControl/macProvider.js +41 -40
  78. package/dist/workstation/desktopControl/nativeDeviceAdmission.js +207 -0
  79. package/dist/workstation/desktopControl/nativeProvider.js +31 -5
  80. package/dist/workstation/desktopControl/ownershipProtocol.js +31 -0
  81. package/dist/workstation/desktopControl/protocol.js +15 -6
  82. package/dist/workstation/desktopControl/supervisor.js +110 -17
  83. package/dist/workstation/desktopControl/wallpaper.js +26 -6
  84. package/dist/workstation/exec/policy.js +5 -0
  85. package/dist/workstation/files/client.js +10 -1
  86. package/dist/workstation/files/host.js +9 -2
  87. package/dist/workstation/journal.js +5 -2
  88. package/dist/workstation/keepers/acp/client.js +38 -2
  89. package/dist/workstation/keepers/kit/buildVersion.js +35 -11
  90. package/dist/workstation/keepers/kit/client.js +2 -2
  91. package/dist/workstation/keepers/kit/launcher.js +80 -4
  92. package/dist/workstation/keepers/legacy.js +16 -2
  93. package/dist/workstation/keepers/policy.js +5 -34
  94. package/dist/workstation/keepers/terminal/client.js +115 -23
  95. package/dist/workstation/keepers/terminal/exec.js +6 -3
  96. package/dist/workstation/keepers/terminal/frames.js +73 -0
  97. package/dist/workstation/keepers/terminal/generations.js +5 -8
  98. package/dist/workstation/keepers/terminal/gridProtocol.js +16 -0
  99. package/dist/workstation/keepers/terminal/input.js +146 -0
  100. package/dist/workstation/keepers/terminal/keeper.js +22 -8
  101. package/dist/workstation/keepers/terminal/main.js +1 -1
  102. package/dist/workstation/keepers/terminal/metadata.js +138 -0
  103. package/dist/workstation/keepers/terminal/protocol.js +4 -28
  104. package/dist/workstation/keepers/terminal/pty.js +1 -330
  105. package/dist/workstation/keepers/terminal/screen.js +246 -0
  106. package/dist/workstation/keepers/terminal/sessions.js +526 -0
  107. package/dist/workstation/oauth/deviceAuthorization.js +31 -17
  108. package/dist/workstation/protocol/management.js +23 -4
  109. package/dist/workstation/rd/artifact.js +4 -3
  110. package/dist/workstation/rd/control.js +3 -5
  111. package/dist/workstation/rd/host.js +213 -0
  112. package/dist/workstation/rd/migrationReadiness.js +46 -0
  113. package/dist/workstation/rd/provider.js +44 -10
  114. package/dist/workstation/rd/state.js +14 -2
  115. package/dist/workstation/rd/update.js +5 -8
  116. package/dist/workstation/rd/upkeep.js +44 -2
  117. package/dist/workstation/registrations/enrollment.js +250 -0
  118. package/dist/workstation/registrations/enrollmentPending.js +361 -0
  119. package/dist/workstation/registrations/migration.js +356 -0
  120. package/dist/workstation/registrations/model.js +34 -0
  121. package/dist/workstation/registrations/removal.js +222 -0
  122. package/dist/workstation/registrations/store.js +737 -0
  123. package/dist/workstation/runtime/desktopBinding.js +20 -0
  124. package/dist/workstation/runtime/deviceDesktop.js +193 -0
  125. package/dist/workstation/runtime/deviceRuntime.js +568 -0
  126. package/dist/workstation/runtime/deviceServices.js +117 -0
  127. package/dist/workstation/runtime/events.js +20 -0
  128. package/dist/workstation/runtime/ownership.js +100 -0
  129. package/dist/workstation/runtime/registrationRuntime.js +575 -0
  130. package/dist/workstation/runtime/remoteDesktopAdapter.js +186 -0
  131. package/dist/workstation/runtime/removalActivity.js +184 -0
  132. package/dist/workstation/service/installer.js +93 -1
  133. package/dist/workstation/service/launchd.js +1 -0
  134. package/dist/workstation/service/systemd.js +1 -0
  135. package/dist/workstation/systemMetrics.js +3 -0
  136. package/dist/workstation/tools/client.js +8 -27
  137. package/dist/workstation/tools/info.js +6 -13
  138. package/dist/workstation/tools/terminalRouter.js +17 -172
  139. package/dist/workstation/tools/validation.js +55 -1
  140. package/dist/workstation/update/archiveEvidence.js +206 -0
  141. package/dist/workstation/update/coordinator.js +34 -13
  142. package/dist/workstation/update/deviceCompatibility.js +119 -0
  143. package/dist/workstation/update/deviceCoordinator.js +369 -0
  144. package/dist/workstation/update/deviceHealth.js +104 -0
  145. package/dist/workstation/update/deviceHealthProtocol.js +26 -0
  146. package/dist/workstation/update/deviceRecoveryLifecycle.js +46 -0
  147. package/dist/workstation/update/deviceRollback.js +78 -0
  148. package/dist/workstation/update/globalInstall.js +80 -10
  149. package/dist/workstation/update/legacyBridge.js +414 -0
  150. package/dist/workstation/update/legacyOwner.js +39 -0
  151. package/dist/workstation/update/npmInstaller.js +2 -2
  152. package/dist/workstation/update/privateDurability.js +61 -0
  153. package/dist/workstation/update/recoveryPlan.js +124 -0
  154. package/dist/workstation/update/runUpdate.js +7 -1
  155. package/dist/workstation/update/taskRegistry.js +161 -3
  156. package/dist/workstation/update/watchdog.js +27427 -14410
  157. package/dist/workstation/update/watchdogProcess.js +72 -0
  158. package/package.json +7 -3
  159. 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.36",
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