@north-light/cli 0.3.713 → 0.3.715

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 (109) hide show
  1. package/dist/api/client.d.ts +3 -1
  2. package/dist/api/client.js +2 -2
  3. package/dist/api/contract.d.ts +1 -1
  4. package/dist/api/contract.js +1 -1
  5. package/dist/api/dto/environments.d.ts +4 -0
  6. package/dist/api/dto/execution-start.d.ts +9 -0
  7. package/dist/api/routes.d.ts +1 -0
  8. package/dist/api/routes.js +1 -1
  9. package/dist/clients/attach/input/controller.d.ts +2 -0
  10. package/dist/clients/attach/input/controller.js +1 -1
  11. package/dist/clients/attach/input/local-files.d.ts +3 -1
  12. package/dist/clients/attach/input/local-files.js +8 -3
  13. package/dist/clients/attach/render/chat-view.d.ts +1 -1
  14. package/dist/clients/attach/render/chat-view.js +2 -2
  15. package/dist/clients/attach/session/input-wiring.d.ts +2 -0
  16. package/dist/clients/attach/session/input-wiring.js +1 -1
  17. package/dist/clients/attach/viewer.js +526 -521
  18. package/dist/commands/node/inspect.js +5 -5
  19. package/dist/commands/profile/environment.js +2 -2
  20. package/dist/commands/sys/feedback.js +5 -5
  21. package/dist/core/broker-client/client.js +1 -1
  22. package/dist/core/canvas/canvas.js +1 -1
  23. package/dist/core/canvas/deliveries.js +10 -10
  24. package/dist/core/canvas/executions.d.ts +0 -2
  25. package/dist/core/canvas/executions.js +1 -1
  26. package/dist/core/canvas/schema-pg/029-model-accounts-refresh-claim.sql +3 -0
  27. package/dist/core/canvas/schema-pg/030-environment-pull-request-write.sql +2 -0
  28. package/dist/core/canvas/schema-version.d.ts +1 -1
  29. package/dist/core/canvas/schema-version.js +1 -1
  30. package/dist/core/canvas/types.d.ts +1 -0
  31. package/dist/core/checkout-identities.js +1 -1
  32. package/dist/core/environment-recipe.d.ts +1 -0
  33. package/dist/core/environment-recipe.js +1 -1
  34. package/dist/core/import/load/bind.d.ts +8 -0
  35. package/dist/core/import/load/bind.js +15 -15
  36. package/dist/core/import/load/prepare.d.ts +8 -1
  37. package/dist/core/import/load/prepare.js +9 -7
  38. package/dist/core/import/load/run.js +2 -2
  39. package/dist/core/ledger/rates.d.ts +0 -2
  40. package/dist/core/ledger/rates.js +1 -1
  41. package/dist/core/llm/run.d.ts +1 -1
  42. package/dist/core/pool-credential-store.d.ts +5 -5
  43. package/dist/core/runtime/broker/frame-dispatch.d.ts +2 -0
  44. package/dist/core/runtime/broker/frame-dispatch.js +1 -1
  45. package/dist/core/runtime/broker-wedge.d.ts +1 -2
  46. package/dist/core/runtime/broker-wedge.js +2 -2
  47. package/dist/core/runtime/revive.js +2 -2
  48. package/dist/core/runtime/runner/blaxel/image-build.d.ts +3 -0
  49. package/dist/core/runtime/runner/blaxel/image-build.js +6 -6
  50. package/dist/core/runtime/runner/types.d.ts +0 -2
  51. package/dist/core/runtime/spawn.js +1 -1
  52. package/dist/core/subscription-state.d.ts +3 -3
  53. package/dist/core/subscription-state.js +1 -1
  54. package/dist/daemon/api/handlers/broker-ops.js +1 -1
  55. package/dist/daemon/api/handlers/environments.js +1 -1
  56. package/dist/daemon/api/handlers/feedback.d.ts +2 -0
  57. package/dist/daemon/api/handlers/feedback.js +9 -0
  58. package/dist/daemon/api/handlers/git-credential.d.ts +3 -2
  59. package/dist/daemon/api/handlers/git-credential.js +1 -1
  60. package/dist/daemon/api/operations.js +1 -1
  61. package/dist/daemon/api/server.js +1 -1
  62. package/dist/daemon/fleet.d.ts +1 -12
  63. package/dist/daemon/fleet.js +2 -2
  64. package/dist/daemon/machine-daemon.js +1 -1
  65. package/dist/daemon/machine-link/holder.js +1 -1
  66. package/dist/daemon/reconcilers/broker-supervision.js +3 -3
  67. package/dist/daemon/reconcilers/ledger-storage.js +2 -4
  68. package/dist/daemon/reconcilers/node-lifecycle/tick.js +1 -1
  69. package/package.json +3 -3
  70. package/packages/crouter-api/dist/api/client.js +4 -0
  71. package/packages/crouter-api/dist/api/contract.js +1 -1
  72. package/packages/crouter-api/dist/api/routes.js +1 -0
  73. package/packages/crouter-api/dist/clients/attach/input/controller.js +1 -1
  74. package/packages/crouter-api/dist/clients/attach/input/local-files.js +18 -2
  75. package/packages/crouter-api/dist/clients/attach/render/chat-view.js +9 -8
  76. package/packages/crouter-api/dist/clients/attach/session/input-wiring.js +1 -0
  77. package/packages/crouter-api/dist/clients/attach/viewer.js +15 -0
  78. package/packages/crouter-api/dist/commands/node/inspect.js +4 -3
  79. package/packages/crouter-api/dist/commands/profile/environment.js +6 -2
  80. package/packages/crouter-api/dist/commands/sys/feedback.js +12 -2
  81. package/packages/crouter-api/dist/core/broker-client/client.js +1 -1
  82. package/packages/crouter-api/dist/core/canvas/canvas.js +1 -1
  83. package/packages/crouter-api/dist/core/canvas/deliveries.js +1 -1
  84. package/packages/crouter-api/dist/core/canvas/executions.js +2 -3
  85. package/packages/crouter-api/dist/core/canvas/schema-version.js +1 -1
  86. package/packages/crouter-api/dist/core/checkout-identities.js +1 -1
  87. package/packages/crouter-api/dist/core/environment-recipe.js +3 -0
  88. package/packages/crouter-api/dist/core/import/load/prepare.js +21 -4
  89. package/packages/crouter-api/dist/core/ledger/rates.js +0 -3
  90. package/packages/crouter-api/dist/core/llm/run.js +1 -1
  91. package/packages/crouter-api/dist/core/pool-credential-store.js +5 -5
  92. package/packages/crouter-api/dist/core/runtime/broker-wedge.js +1 -3
  93. package/packages/crouter-api/dist/core/runtime/revive.js +1 -1
  94. package/packages/crouter-api/dist/core/runtime/runner/blaxel/image-build.js +11 -1
  95. package/packages/crouter-api/dist/core/runtime/runner/types.js +1 -1
  96. package/packages/crouter-api/dist/core/runtime/spawn.js +1 -1
  97. package/packages/crouter-api/dist/core/subscription-state.js +70 -81
  98. package/packages/crouter-api/dist/daemon/api/handlers/broker-ops.js +10 -11
  99. package/packages/crouter-api/dist/daemon/api/handlers/git-credential.js +7 -5
  100. package/packages/crouter-api/dist/daemon/api/operations.js +1 -0
  101. package/packages/crouter-api/dist/daemon/machine-link/holder.js +1 -1
  102. package/packages/crouter-api/dist/daemon/reconcilers/broker-supervision.js +4 -4
  103. package/packages/crouter-api/package.json +1 -1
  104. package/packages/crouter-identity/package.json +1 -1
  105. package/packages/crouter-plugin/package.json +3 -3
  106. package/runtime.lock.json +14 -14
  107. package/scripts/install-runtime.mjs +3 -2
  108. package/scripts/sandbox-start.mjs +1 -1
  109. package/scripts/self-update.mjs +5 -1
package/runtime.lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.713",
3
+ "version": "0.3.715",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@north-light/cli",
9
- "version": "0.3.713",
9
+ "version": "0.3.715",
10
10
  "hasInstallScript": true,
11
11
  "license": "UNLICENSED",
12
12
  "workspaces": [
@@ -28,8 +28,8 @@
28
28
  "@milkdown/preset-gfm": "^7.22.3",
29
29
  "@milkdown/prose": "^7.22.3",
30
30
  "@milkdown/utils": "^7.22.3",
31
- "@north-light/identity": "0.3.713",
32
- "@north-light/plugin": "0.3.713",
31
+ "@north-light/identity": "0.3.715",
32
+ "@north-light/plugin": "0.3.715",
33
33
  "cron-parser": "^5.6.0",
34
34
  "esbuild": "0.28.2",
35
35
  "jose": "^6.2.12",
@@ -11902,17 +11902,17 @@
11902
11902
  },
11903
11903
  "packages/crouter-api": {
11904
11904
  "name": "@north-light/api",
11905
- "version": "0.3.713",
11905
+ "version": "0.3.715",
11906
11906
  "license": "UNLICENSED"
11907
11907
  },
11908
11908
  "packages/crouter-env-docker": {
11909
11909
  "name": "@north-light/env-docker",
11910
- "version": "0.3.713",
11910
+ "version": "0.3.715",
11911
11911
  "license": "UNLICENSED"
11912
11912
  },
11913
11913
  "packages/crouter-identity": {
11914
11914
  "name": "@north-light/identity",
11915
- "version": "0.3.713",
11915
+ "version": "0.3.715",
11916
11916
  "license": "UNLICENSED",
11917
11917
  "dependencies": {
11918
11918
  "jose": "^6.2.1"
@@ -11920,21 +11920,21 @@
11920
11920
  },
11921
11921
  "packages/crouter-plugin": {
11922
11922
  "name": "@north-light/plugin",
11923
- "version": "0.3.713",
11923
+ "version": "0.3.715",
11924
11924
  "license": "UNLICENSED",
11925
11925
  "dependencies": {
11926
- "@north-light/api": "0.3.713",
11927
- "@north-light/identity": "0.3.713"
11926
+ "@north-light/api": "0.3.715",
11927
+ "@north-light/identity": "0.3.715"
11928
11928
  }
11929
11929
  },
11930
11930
  "packages/crouter-sdk": {
11931
11931
  "name": "@north-light/sdk",
11932
- "version": "0.3.713",
11932
+ "version": "0.3.715",
11933
11933
  "license": "UNLICENSED",
11934
11934
  "dependencies": {
11935
- "@north-light/api": "0.3.713",
11936
- "@north-light/identity": "0.3.713",
11937
- "@north-light/plugin": "0.3.713",
11935
+ "@north-light/api": "0.3.715",
11936
+ "@north-light/identity": "0.3.715",
11937
+ "@north-light/plugin": "0.3.715",
11938
11938
  "jose": "^6.2.1"
11939
11939
  },
11940
11940
  "bin": {
@@ -409,7 +409,7 @@ async function acquireLock() {
409
409
  if (error?.code !== 'EEXIST') throw error;
410
410
  const owner = await readLockOwner(LOCK);
411
411
  if (owner && (await ownerIsAlive(owner))) {
412
- throw new Error(`runtime installer lock is held by a live process: pid=${owner.pid} started=${owner.startTime || 'unknown'} host=${owner.hostname || 'unknown'}; refusing to install concurrently`);
412
+ throw Object.assign(new Error(`runtime installer lock is held by a live process: pid=${owner.pid} started=${owner.startTime || 'unknown'} host=${owner.hostname || 'unknown'}; refusing to install concurrently`), { lockHeld: true });
413
413
  }
414
414
  if (!owner) {
415
415
  let stat;
@@ -666,5 +666,6 @@ async function install() {
666
666
 
667
667
  install().catch((error) => {
668
668
  process.stderr.write(`runtime installation failed: ${error.stack || error.message}\n`);
669
- process.exitCode = 1;
669
+ // 75 (EX_TEMPFAIL): another install holds the lock and nothing else is wrong, so the caller may retry soon (the machine daemon's self-update does).
670
+ process.exitCode = error?.lockHeld ? 75 : 1;
670
671
  });
@@ -538,7 +538,7 @@ async function start(env) {
538
538
 
539
539
  // 5.9 the broker, with the token on fd 3 and not in its environment.
540
540
  const brokerEnv = { ...env, ...launch.env, HOME: home, PI_CODING_AGENT_DIR: agentDir, CRTR_HOME: root, CRTR_RUNTIME_HOME: join(root, 'runtime'),
541
- CRTR_FRONT_DOOR: '1', CRTR_EXECUTION_ID: executionId, CRTR_API_URL: apiUrl, CRTR_NO_AUTO_INIT: '1',
541
+ CRTR_FRONT_DOOR: '1', CRTR_EXECUTION_ID: executionId, CRTR_API_URL: apiUrl, CRTR_FEEDBACK_ENDPOINT: `${apiUrl.replace(/\/$/, '')}/v1/feedback`, CRTR_NO_AUTO_INIT: '1',
542
542
  CRTR_PLUGINS_REVISION: String(bundle.plugins_revision), ...(environmentId ? { CRTR_ENVIRONMENT_ID: environmentId } : {}), ...(scopesFile ? { CRTR_SCOPES_FILE: scopesFile } : {}),
543
543
  PATH: `${join(releaseDir, 'bin')}:${env.PATH ?? '/usr/local/bin:/usr/bin:/bin'}` };
544
544
  for (const name of ['CRTR_NODE_TOKEN', 'CRTR_RELEASE_URL', 'CRTR_RELEASE_SHA256', 'CRTR_BOOT_START_UP', 'CRTR_BOOT_RELEASE_UP', 'CRTR_BOOT_RELEASE_SOURCE', 'CRTR_BOOT_RG']) delete brokerEnv[name];
@@ -22,7 +22,7 @@ if (target.migrating) process.stderr.write(`crtr: moving from ${own.name} to ${t
22
22
  function run(command, args, options) {
23
23
  const result = spawnSync(command, args, options);
24
24
  if (result.error) throw new Error(`${command} ${args.join(' ')}: ${result.error.message}`);
25
- if (result.status !== 0) throw new Error(`${command} ${args.join(' ')} failed (${result.status ?? result.signal ?? 'unknown'})`);
25
+ if (result.status !== 0) throw Object.assign(new Error(`${command} ${args.join(' ')} failed (${result.status ?? result.signal ?? 'unknown'})`), { status: result.status });
26
26
  return result;
27
27
  }
28
28
 
@@ -44,6 +44,10 @@ try {
44
44
  mkdirSync(release);
45
45
  run('tar', ['-xzf', archive, '--strip-components=1', '-C', release]);
46
46
  run(process.execPath, [join(release, 'scripts', 'install-runtime.mjs'), release], { stdio: 'inherit' });
47
+ } catch (error) {
48
+ // The installer's 75 (its lock is held by another install) is passed on as this script's exit status; every other failure exits 1.
49
+ process.stderr.write(`${error.stack || error.message}\n`);
50
+ process.exitCode = error?.status === 75 ? 75 : 1;
47
51
  } finally {
48
52
  rmSync(temporary, { recursive: true, force: true });
49
53
  }