@north-light/cli 0.3.588 → 0.3.590

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 (80) hide show
  1. package/dist/api/client.d.ts +4 -1
  2. package/dist/api/client.js +1 -1
  3. package/dist/api/contract.d.ts +1 -1
  4. package/dist/api/contract.js +1 -1
  5. package/dist/api/dto/docs.d.ts +5 -0
  6. package/dist/api/dto/settings.d.ts +21 -0
  7. package/dist/build-root.d.ts +2 -0
  8. package/dist/build-root.js +1 -1
  9. package/dist/cli.js +8 -8
  10. package/dist/clients/attach/viewer.js +505 -505
  11. package/dist/commands/pkg/app-installs.d.ts +53 -0
  12. package/dist/commands/pkg/app-installs.js +2 -0
  13. package/dist/commands/pkg/market-inspect.js +1 -1
  14. package/dist/commands/pkg/market-manage.js +1 -1
  15. package/dist/commands/pkg/plugin-inspect.js +1 -1
  16. package/dist/commands/pkg/plugin-manage.js +13 -13
  17. package/dist/core/canvas/schema-pg/011-package-revision.sql +12 -0
  18. package/dist/core/canvas/schema-version.d.ts +1 -1
  19. package/dist/core/canvas/schema-version.js +1 -1
  20. package/dist/core/config.d.ts +1 -0
  21. package/dist/core/config.js +1 -1
  22. package/dist/core/graph/names.js +8 -8
  23. package/dist/core/graph/package-docs.d.ts +6 -15
  24. package/dist/core/graph/package-docs.js +8 -6
  25. package/dist/core/graph/package-publish.d.ts +35 -5
  26. package/dist/core/graph/package-publish.js +3 -3
  27. package/dist/core/graph/package-reconcile.d.ts +20 -1
  28. package/dist/core/graph/package-reconcile.js +3 -1
  29. package/dist/core/import/export/dump.js +4 -3
  30. package/dist/core/import/load/stores.js +2 -2
  31. package/dist/core/installed-plugins.js +1 -1
  32. package/dist/core/packages/directory-sync.d.ts +41 -0
  33. package/dist/core/packages/directory-sync.js +6 -0
  34. package/dist/core/packages/eligibility.d.ts +16 -0
  35. package/dist/core/packages/eligibility.js +4 -0
  36. package/dist/core/packages/launch-kinds.d.ts +6 -0
  37. package/dist/core/packages/launch-kinds.js +2 -0
  38. package/dist/core/packages/source-url.d.ts +3 -0
  39. package/dist/core/packages/source-url.js +1 -0
  40. package/dist/core/permissions/ceiling.d.ts +9 -2
  41. package/dist/core/permissions/ceiling.js +11 -12
  42. package/dist/core/permissions/evaluator.js +2 -2
  43. package/dist/core/runtime/launch-config-worker.js +1 -1
  44. package/dist/core/runtime/launch-target.d.ts +6 -2
  45. package/dist/core/runtime/launch-target.js +1 -1
  46. package/dist/core/runtime/launch.d.ts +8 -1
  47. package/dist/core/runtime/launch.js +2 -2
  48. package/dist/core/runtime/promote.js +1 -1
  49. package/dist/core/runtime/recycle.js +1 -1
  50. package/dist/core/runtime/reset.js +1 -1
  51. package/dist/core/runtime/runner/blaxel/runner.js +3 -3
  52. package/dist/core/runtime/runner/types.d.ts +7 -1
  53. package/dist/core/runtime/spawn.js +2 -2
  54. package/dist/core/runtime/view-socket.d.ts +2 -1
  55. package/dist/core/runtime/view-socket.js +2 -1
  56. package/dist/core/runtime/warm-pool.js +1 -1
  57. package/dist/core/scoped-state/legacy-profiles.js +1 -1
  58. package/dist/core/scoped-state/migrate-app-installs.d.ts +13 -0
  59. package/dist/core/scoped-state/migrate-app-installs.js +1 -0
  60. package/dist/core/scoped-state/person-rows.js +4 -6
  61. package/dist/core/scoped-state/person-store.d.ts +23 -0
  62. package/dist/core/scoped-state/person-store.js +1 -1
  63. package/dist/daemon/api/bridge.js +3 -3
  64. package/dist/daemon/api/handlers/execution-start.d.ts +2 -0
  65. package/dist/daemon/api/handlers/execution-start.js +2 -2
  66. package/dist/daemon/api/handlers/nodes.js +1 -1
  67. package/dist/daemon/api/handlers/package-docs.d.ts +1 -1
  68. package/dist/daemon/api/handlers/package-docs.js +1 -1
  69. package/dist/daemon/api/handlers/settings.d.ts +4 -1
  70. package/dist/daemon/api/handlers/settings.js +1 -1
  71. package/dist/daemon/crtrd.js +19 -19
  72. package/dist/daemon/reconcilers/node-lifecycle/remote-wake.d.ts +2 -1
  73. package/dist/daemon/reconcilers/node-lifecycle/remote-wake.js +1 -1
  74. package/package.json +2 -2
  75. package/packages/crouter-identity/package.json +1 -1
  76. package/runtime.lock.json +13 -13
  77. package/dist/core/graph/package-kinds.d.ts +0 -22
  78. package/dist/core/graph/package-kinds.js +0 -1
  79. package/dist/core/scoped-state/materialized-plugins.d.ts +0 -20
  80. package/dist/core/scoped-state/materialized-plugins.js +0 -1
package/runtime.lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.588",
3
+ "version": "0.3.590",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@north-light/cli",
9
- "version": "0.3.588",
9
+ "version": "0.3.590",
10
10
  "hasInstallScript": true,
11
11
  "license": "UNLICENSED",
12
12
  "workspaces": [
@@ -28,7 +28,7 @@
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.588",
31
+ "@north-light/identity": "0.3.590",
32
32
  "cron-parser": "^5.6.0",
33
33
  "esbuild": "^0.27.7",
34
34
  "jose": "^6.2.12",
@@ -11956,17 +11956,17 @@
11956
11956
  },
11957
11957
  "packages/crouter-api": {
11958
11958
  "name": "@north-light/api",
11959
- "version": "0.3.588",
11959
+ "version": "0.3.590",
11960
11960
  "license": "UNLICENSED"
11961
11961
  },
11962
11962
  "packages/crouter-env-docker": {
11963
11963
  "name": "@north-light/env-docker",
11964
- "version": "0.3.588",
11964
+ "version": "0.3.590",
11965
11965
  "license": "UNLICENSED"
11966
11966
  },
11967
11967
  "packages/crouter-identity": {
11968
11968
  "name": "@north-light/identity",
11969
- "version": "0.3.588",
11969
+ "version": "0.3.590",
11970
11970
  "license": "UNLICENSED",
11971
11971
  "dependencies": {
11972
11972
  "jose": "^6.2.1"
@@ -11974,21 +11974,21 @@
11974
11974
  },
11975
11975
  "packages/crouter-plugin": {
11976
11976
  "name": "@north-light/plugin",
11977
- "version": "0.3.588",
11977
+ "version": "0.3.590",
11978
11978
  "license": "UNLICENSED",
11979
11979
  "dependencies": {
11980
- "@north-light/api": "0.3.588",
11981
- "@north-light/identity": "0.3.588"
11980
+ "@north-light/api": "0.3.590",
11981
+ "@north-light/identity": "0.3.590"
11982
11982
  }
11983
11983
  },
11984
11984
  "packages/crouter-sdk": {
11985
11985
  "name": "@north-light/sdk",
11986
- "version": "0.3.588",
11986
+ "version": "0.3.590",
11987
11987
  "license": "UNLICENSED",
11988
11988
  "dependencies": {
11989
- "@north-light/api": "0.3.588",
11990
- "@north-light/identity": "0.3.588",
11991
- "@north-light/plugin": "0.3.588",
11989
+ "@north-light/api": "0.3.590",
11990
+ "@north-light/identity": "0.3.590",
11991
+ "@north-light/plugin": "0.3.590",
11992
11992
  "jose": "^6.2.1"
11993
11993
  },
11994
11994
  "bin": {
@@ -1,22 +0,0 @@
1
- import type { CanvasDb } from '../canvas/db.js';
2
- export interface KindsReport {
3
- /** every kind a valid plugin declares that now has its row, and what upserting it did */
4
- applied: Array<{
5
- plugin: string;
6
- kind: string;
7
- outcome: 'inserted' | 'updated' | 'unchanged';
8
- }>;
9
- /** kinds another owner holds; the plugin's other kinds still applied */
10
- refused: Array<{
11
- plugin: string;
12
- kind: string;
13
- code: 'kind_owned';
14
- message: string;
15
- }>;
16
- /** enabled plugins whose manifest or commands are invalid (no kind update, no token); a provider bundle's kinds reconcile without a token, and plugins whose app handle another owner holds */
17
- invalid: Array<{
18
- plugin: string;
19
- error: string;
20
- }>;
21
- }
22
- export declare function reconcilePackageKinds(db: CanvasDb): Promise<KindsReport>;
@@ -1 +0,0 @@
1
- var u=Object.defineProperty;var d=(o,i)=>u(o,"name",{value:i,configurable:!0});import{CrtrError as p}from"../errors.js";import{invalidAppPlugins as l,kindPlugins as f}from"../plugin-app.js";import{upsertKind as g}from"./custom.js";import{ensureOwner as w}from"./objects.js";async function j(o){const i={applied:[],refused:[],invalid:l().map(e=>({plugin:e.plugin.name,error:e.error}))},t=new Set;for(const e of f()){const s=Object.entries(e.manifest.object_kinds??{});if(s.length===0)continue;let c;try{c=await w(o,"app","app",`app:${e.name}`,e.name)}catch(n){if(!(n instanceof p)||n.code!=="conflict")throw n;i.invalid.push({plugin:e.name,error:n.message});continue}for(const[n,a]of s)try{const r=await g(o,{name:n,owner:c,description:a.description,events:a.events,read:a.read===void 0?null:{command:a.read.command},source:"manifest"});if(r.outcome==="skipped")continue;t.add(n),i.applied.push({plugin:e.name,kind:n,outcome:r.outcome})}catch(r){if(!(r instanceof p)||r.code!=="kind_owned")throw r;i.refused.push({plugin:e.name,kind:n,code:"kind_owned",message:r.message})}}const m=await o.prepare("SELECT name FROM object_kinds WHERE source = 'manifest' AND declared = 1").all();for(const{name:e}of m)t.has(e)||await o.prepare("UPDATE object_kinds SET declared = 0 WHERE name = ?").run(e);return i}d(j,"reconcilePackageKinds");export{j as reconcilePackageKinds};
@@ -1,20 +0,0 @@
1
- /** One enabled plugin row of the person's user scope, with its marketplace's url and ref. */
2
- export interface PluginInstall {
3
- name: string;
4
- version: string | null;
5
- sourcePath: string | null;
6
- marketplace: {
7
- name: string;
8
- url: string | null;
9
- ref: string | null;
10
- } | null;
11
- /** A directory provider bundle (`isProviderBundleRow`): a provider call installs it into this process's own plugin directory, so there is nothing to fetch. */
12
- providerBundle: boolean;
13
- }
14
- /** The directory holding this person's materialized plugins as `<dir>/<plugin name>`; undefined when none were materialized. */
15
- export declare function materializedPluginsDir(person: string): string | undefined;
16
- /** Install `installs` for `person` at `revision` into this process's plugin cache, once per (person, revision). When a plugin cannot
17
- * be installed — a source on another machine, a marketplace that does not list it, a failed clone — the failure is held for that person
18
- * and thrown by the next read of their plugins (`materializedPluginsDir`), so a request that never reads plugins, such as the one that
19
- * fixes the settings, still works; the next load retries. */
20
- export declare function materializePlugins(person: string, revision: number, installs: readonly PluginInstall[]): Promise<void>;
@@ -1 +0,0 @@
1
- var z=Object.defineProperty;var u=(e,r)=>z(e,"name",{value:r,configurable:!0});import{cpSync as S,existsSync as d,mkdirSync as b,renameSync as M,rmSync as w}from"node:fs";import{tmpdir as v}from"node:os";import{isAbsolute as $,join as l,relative as A,resolve as P}from"node:path";import{CrtrError as c}from"../errors.js";import{gitAsync as x}from"../git.js";import{readMarketplaceManifest as D}from"../manifest.js";const m=new Map,h=new Map;function Z(e){const r=m.get(e);if(r!==void 0&&"failure"in r)throw r.failure;return r?.dir}u(Z,"materializedPluginsDir");function y(e){return l(v(),"crtr-plugin-cache",e.replace(/[^A-Za-z0-9._-]/g,"_"))}u(y,"cacheRoot");async function _(e,r,o,n){const t=await x(["clone","--depth","1",...r?["--branch",r]:[],e,o]);if(t.status!==0)throw new c("plugin_install_failed",`${n}: git clone ${e} failed: ${t.stderr.trim()}`)}u(_,"cloneInto");async function R(e,r){const o=new Map;b(l(e,"plugins"),{recursive:!0});for(const n of r){if(n.sourcePath!==null)throw new c("plugin_source_unreachable",`${n.name}: its source is ${n.sourcePath} on the machine that registered it, which the control plane cannot read`);const t=n.marketplace;if(n.providerBundle)continue;if(t===null)throw new c("plugin_source_unreachable",`${n.name}: it names neither a marketplace nor a path`);if(t.url===null||t.url==="")throw new c("plugin_source_unreachable",`${n.name}: its marketplace ${t.name} has no url`);const s=`${t.url}\0${t.ref??""}`;let a=o.get(s);a===void 0&&(a=l(e,"marketplaces",String(o.size)),await _(t.url,t.ref,a,`${n.name}: marketplace ${t.name}`),o.set(s,a));const i=D(a)?.plugins.find(k=>k.name===n.name);if(i===void 0)throw new c("plugin_install_failed",`${n.name}: marketplace ${t.name} (${t.url}) does not list it`);const f=l(e,"plugins",n.name);if($(i.source)||/^[a-z][a-z0-9+.-]*:|^git@/i.test(i.source)||i.source.endsWith(".git")){await _(i.source,null,f,n.name);continue}const p=P(a,i.source),g=A(a,p);if(g.startsWith("..")||$(g))throw new c("plugin_install_failed",`${n.name}: its source ${i.source} leaves the marketplace`);if(!d(p))throw new c("plugin_install_failed",`${n.name}: its source ${i.source} is not in marketplace ${t.name}`);S(p,f,{recursive:!0})}w(l(e,"marketplaces"),{recursive:!0,force:!0})}u(R,"installAll");async function q(e,r,o){const n=m.get(e);if(n?.revision===r&&!("failure"in n))return;const t=l(y(e),String(r)),s=`${e}\0${r}`;let a=h.get(s);a===void 0&&(a=(async()=>{if(!d(l(t,"plugins"))){const i=l(y(e),`${r}.${process.pid}.${Date.now()}`);try{await R(i,o);try{M(i,t)}catch(f){if(!d(l(t,"plugins")))throw f}}finally{w(i,{recursive:!0,force:!0})}}return l(t,"plugins")})().finally(()=>h.delete(s)),h.set(s,a));try{m.set(e,{revision:r,dir:await a})}catch(i){if(!(i instanceof c))throw i;m.set(e,{revision:r,failure:i})}}u(q,"materializePlugins");export{q as materializePlugins,Z as materializedPluginsDir};