@north-light/cli 0.3.752 → 0.3.754
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 +1 -1
- package/bin/runtime-generation-manifest.mjs +3 -10
- package/dist/api/contract.d.ts +1 -1
- package/dist/api/contract.js +1 -1
- package/dist/api/dto/health.d.ts +3 -0
- package/dist/builtin-memory/crouter-sdk/release-notes.md +6 -0
- package/dist/clients/attach/viewer.js +342 -342
- package/dist/commands/sys/daemon.js +1 -1
- package/dist/commands/sys/doctor.js +1 -1
- package/dist/commands/sys/signin.js +2 -3
- package/dist/commands/sys/update.js +1 -1
- package/dist/core/audit.d.ts +2 -0
- package/dist/core/audit.js +2 -2
- package/dist/core/auto-update.js +4 -4
- package/dist/core/canvas/canvas.d.ts +1 -1
- package/dist/core/canvas/canvas.js +26 -19
- package/dist/core/canvas/schema-pg/038-actor.sql +4 -0
- package/dist/core/canvas/schema-version.d.ts +1 -1
- package/dist/core/canvas/schema-version.js +1 -1
- package/dist/core/import/load/copy.js +9 -9
- package/dist/core/import/load/keys.d.ts +5 -0
- package/dist/core/import/load/keys.js +8 -0
- package/dist/core/import/load/prepare.d.ts +3 -0
- package/dist/core/import/load/prepare.js +12 -12
- package/dist/core/import/load/rollback.js +7 -7
- package/dist/core/import/load/run.js +2 -3
- package/dist/core/import/load/verify.js +8 -8
- package/dist/core/ledger/charges.js +1 -1
- package/dist/core/ledger/chunks.js +1 -1
- package/dist/core/ledger/read.js +1 -1
- package/dist/core/ledger/types.d.ts +4 -0
- package/dist/core/providers/audit.js +3 -3
- package/dist/core/providers/call.d.ts +2 -0
- package/dist/core/providers/call.js +1 -1
- package/dist/core/providers/receipts.d.ts +2 -0
- package/dist/core/providers/receipts.js +1 -1
- package/dist/core/self-update.d.ts +1 -4
- package/dist/core/self-update.js +1 -1
- package/dist/daemon/api/handlers/providers.d.ts +2 -0
- package/dist/daemon/api/handlers/providers.js +1 -1
- package/dist/daemon/machine-daemon.js +1 -1
- package/dist/daemon/manage.js +3 -3
- package/dist/daemon/peer/ingress.js +1 -1
- package/docs/sdk/release-notes.md +6 -0
- package/package.json +3 -4
- package/packages/crouter-api/dist/api/contract.js +1 -1
- package/packages/crouter-api/dist/commands/sys/daemon.js +8 -3
- package/packages/crouter-api/dist/commands/sys/doctor.js +0 -9
- package/packages/crouter-api/dist/commands/sys/signin.js +0 -4
- package/packages/crouter-api/dist/commands/sys/update.js +1 -2
- package/packages/crouter-api/dist/core/canvas/canvas.js +14 -4
- package/packages/crouter-api/dist/core/canvas/schema-version.js +1 -1
- package/packages/crouter-api/dist/core/import/load/copy.js +47 -23
- package/packages/crouter-api/dist/core/import/load/keys.js +77 -0
- package/packages/crouter-api/dist/core/import/load/prepare.js +6 -0
- package/packages/crouter-api/dist/core/ledger/charges.js +3 -3
- package/packages/crouter-api/dist/core/ledger/chunks.js +1 -1
- package/packages/crouter-api/dist/core/ledger/read.js +1 -1
- package/packages/crouter-api/dist/core/providers/audit.js +2 -2
- package/packages/crouter-api/dist/core/providers/call.js +2 -2
- package/packages/crouter-api/dist/core/providers/receipts.js +1 -1
- package/packages/crouter-api/dist/core/self-update.js +1 -1
- package/packages/crouter-api/dist/daemon/api/handlers/providers.js +1 -1
- package/packages/crouter-api/dist/daemon/manage.js +3 -2
- package/packages/crouter-api/package.json +1 -1
- package/packages/crouter-identity/package.json +1 -1
- package/packages/crouter-plugin/package.json +3 -3
- package/runtime.lock.json +14 -14
- package/scripts/install-runtime.mjs +2 -2
- package/scripts/self-update.mjs +14 -5
- package/dist/commands/sys/old-package.d.ts +0 -9
- package/dist/commands/sys/old-package.js +0 -1
- package/packages/crouter-api/dist/commands/sys/old-package.js +0 -20
- package/scripts/lib/update-target.mjs +0 -78
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.754",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/cli",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.754",
|
|
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.
|
|
32
|
-
"@north-light/plugin": "0.3.
|
|
31
|
+
"@north-light/identity": "0.3.754",
|
|
32
|
+
"@north-light/plugin": "0.3.754",
|
|
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.
|
|
11905
|
+
"version": "0.3.754",
|
|
11906
11906
|
"license": "UNLICENSED"
|
|
11907
11907
|
},
|
|
11908
11908
|
"packages/crouter-env-docker": {
|
|
11909
11909
|
"name": "@north-light/env-docker",
|
|
11910
|
-
"version": "0.3.
|
|
11910
|
+
"version": "0.3.754",
|
|
11911
11911
|
"license": "UNLICENSED"
|
|
11912
11912
|
},
|
|
11913
11913
|
"packages/crouter-identity": {
|
|
11914
11914
|
"name": "@north-light/identity",
|
|
11915
|
-
"version": "0.3.
|
|
11915
|
+
"version": "0.3.754",
|
|
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.
|
|
11923
|
+
"version": "0.3.754",
|
|
11924
11924
|
"license": "UNLICENSED",
|
|
11925
11925
|
"dependencies": {
|
|
11926
|
-
"@north-light/api": "0.3.
|
|
11927
|
-
"@north-light/identity": "0.3.
|
|
11926
|
+
"@north-light/api": "0.3.754",
|
|
11927
|
+
"@north-light/identity": "0.3.754"
|
|
11928
11928
|
}
|
|
11929
11929
|
},
|
|
11930
11930
|
"packages/crouter-sdk": {
|
|
11931
11931
|
"name": "@north-light/sdk",
|
|
11932
|
-
"version": "0.3.
|
|
11932
|
+
"version": "0.3.754",
|
|
11933
11933
|
"license": "UNLICENSED",
|
|
11934
11934
|
"dependencies": {
|
|
11935
|
-
"@north-light/api": "0.3.
|
|
11936
|
-
"@north-light/identity": "0.3.
|
|
11937
|
-
"@north-light/plugin": "0.3.
|
|
11935
|
+
"@north-light/api": "0.3.754",
|
|
11936
|
+
"@north-light/identity": "0.3.754",
|
|
11937
|
+
"@north-light/plugin": "0.3.754",
|
|
11938
11938
|
"jose": "^6.2.1"
|
|
11939
11939
|
},
|
|
11940
11940
|
"bin": {
|
|
@@ -7,7 +7,7 @@ import { existsSync } from 'node:fs';
|
|
|
7
7
|
import { homedir, hostname, userInfo } from 'node:os';
|
|
8
8
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
9
9
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
10
|
-
import { ENTRY_NAMES, GENERATION_ID,
|
|
10
|
+
import { ENTRY_NAMES, GENERATION_ID, MANIFEST_KEYS, MANIFEST_SCHEMA, PACKAGE_NAME, contained, isKnownPackageName, isSealed, publishedMarkerPath, runtimeHome, sortInventory, validateManifestShape } from '../bin/runtime-generation-manifest.mjs';
|
|
11
11
|
import { patchPiTreeRootOrdering } from './patch-pi-tree-root-ordering.mjs';
|
|
12
12
|
import { smokeValidate } from './runtime-smoke.mjs';
|
|
13
13
|
import { scrubInheritedBrokerEnv, unsafeIsolationReason } from './lib/isolation-env.mjs';
|
|
@@ -599,7 +599,7 @@ async function install() {
|
|
|
599
599
|
const manifest = {
|
|
600
600
|
schema: MANIFEST_SCHEMA,
|
|
601
601
|
id,
|
|
602
|
-
packageName:
|
|
602
|
+
packageName: PACKAGE_NAME,
|
|
603
603
|
packageVersion: pkg.version,
|
|
604
604
|
nodeVersion: process.version,
|
|
605
605
|
platform: process.platform,
|
package/scripts/self-update.mjs
CHANGED
|
@@ -4,20 +4,29 @@ import { mkdirSync, mkdtempSync, readFileSync, rmSync } from 'node:fs';
|
|
|
4
4
|
import { dirname, join } from 'node:path';
|
|
5
5
|
import { tmpdir } from 'node:os';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import { resolveUpdateTarget } from './lib/update-target.mjs';
|
|
8
7
|
|
|
9
8
|
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
10
9
|
const own = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8'));
|
|
11
10
|
const resolving = process.argv.includes('--resolve');
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
const PACKAGE_NAME = own.name;
|
|
12
|
+
|
|
13
|
+
/** `npm view <name> version`, or null when the package is unreachable or unpublished. */
|
|
14
|
+
function latestVersion(name) {
|
|
15
|
+
const res = spawnSync('npm', ['view', name, 'version', '--json'], { encoding: 'utf8' });
|
|
16
|
+
if (res.error || res.status !== 0) return null;
|
|
17
|
+
try {
|
|
18
|
+
const parsed = JSON.parse(res.stdout);
|
|
19
|
+
return typeof parsed === 'string' ? parsed : null;
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
14
24
|
|
|
15
25
|
// `--resolve` reports the package an update would install, for `crtr sys update --check`.
|
|
16
26
|
if (resolving) {
|
|
17
|
-
process.stdout.write(`${JSON.stringify({
|
|
27
|
+
process.stdout.write(`${JSON.stringify({ package: PACKAGE_NAME, latest: latestVersion(PACKAGE_NAME), current: own.version })}\n`);
|
|
18
28
|
process.exit(0);
|
|
19
29
|
}
|
|
20
|
-
if (target.migrating) process.stderr.write(`crtr: moving from ${own.name} to ${target.package} (${target.reason})\n`);
|
|
21
30
|
|
|
22
31
|
function run(command, args, options) {
|
|
23
32
|
const result = spawnSync(command, args, options);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const OLD_PACKAGE = "@crouton-kit/crouter";
|
|
2
|
-
export declare const OLD_PACKAGE_UNINSTALL = "npm uninstall -g @crouton-kit/crouter";
|
|
3
|
-
/** Where a global install of this package sits beside the old one: `<lib>/node_modules/@north-light/cli` → `<lib>/node_modules/@crouton-kit/crouter`. */
|
|
4
|
-
export declare function oldPackageDir(packageRoot: string): string | undefined;
|
|
5
|
-
/** The old package installed next to this one, with the message that names the command that removes it; undefined when it is absent. */
|
|
6
|
-
export declare function oldPackageInstalled(packageRoot?: string): {
|
|
7
|
-
uninstall: string;
|
|
8
|
-
message: string;
|
|
9
|
-
} | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a=Object.defineProperty;var e=(t,n)=>a(t,"name",{value:n,configurable:!0});import{existsSync as d}from"node:fs";import{dirname as c,join as o,sep as r}from"node:path";import{fileURLToPath as m}from"node:url";const i="@crouton-kit/crouter",s=`npm uninstall -g ${i}`;function u(t){const n=`${r}node_modules${r}@north-light${r}cli`,l=t.lastIndexOf(n);return l<0?void 0:o(t.slice(0,l),"node_modules",i)}e(u,"oldPackageDir");function $(t=o(c(m(import.meta.url)),"..","..","..")){const n=u(t);if(!(n===void 0||!d(o(n,"package.json"))))return{uninstall:s,message:`The old ${i} package is still installed at ${n} and owns the \`crtr\` command. Run \`${s}\`, then \`npm i -g @north-light/cli@latest\`.`}}e($,"oldPackageInstalled");export{i as OLD_PACKAGE,s as OLD_PACKAGE_UNINSTALL,u as oldPackageDir,$ as oldPackageInstalled};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// The old `@crouton-kit/crouter` package declares the same `crtr` bin as `@north-light/cli`. npm checks bin ownership before any install script runs,
|
|
2
|
-
// so `npm i -g @north-light/cli` over it fails with EEXIST and no script of ours can prevent that; the old package has to be uninstalled first.
|
|
3
|
-
import { existsSync } from 'node:fs';
|
|
4
|
-
import { dirname, join, sep } from 'node:path';
|
|
5
|
-
import { fileURLToPath } from 'node:url';
|
|
6
|
-
export const OLD_PACKAGE = '@crouton-kit/crouter';
|
|
7
|
-
export const OLD_PACKAGE_UNINSTALL = `npm uninstall -g ${OLD_PACKAGE}`;
|
|
8
|
-
/** Where a global install of this package sits beside the old one: `<lib>/node_modules/@north-light/cli` → `<lib>/node_modules/@crouton-kit/crouter`. */
|
|
9
|
-
export function oldPackageDir(packageRoot) {
|
|
10
|
-
const marker = `${sep}node_modules${sep}@north-light${sep}cli`;
|
|
11
|
-
const at = packageRoot.lastIndexOf(marker);
|
|
12
|
-
return at < 0 ? undefined : join(packageRoot.slice(0, at), 'node_modules', OLD_PACKAGE);
|
|
13
|
-
}
|
|
14
|
-
/** The old package installed next to this one, with the message that names the command that removes it; undefined when it is absent. */
|
|
15
|
-
export function oldPackageInstalled(packageRoot = join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..')) {
|
|
16
|
-
const dir = oldPackageDir(packageRoot);
|
|
17
|
-
if (dir === undefined || !existsSync(join(dir, 'package.json')))
|
|
18
|
-
return undefined;
|
|
19
|
-
return { uninstall: OLD_PACKAGE_UNINSTALL, message: `The old ${OLD_PACKAGE} package is still installed at ${dir} and owns the \`crtr\` command. Run \`${OLD_PACKAGE_UNINSTALL}\`, then \`npm i -g @north-light/cli@latest\`.` };
|
|
20
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// Which npm package a self-update installs from.
|
|
2
|
-
//
|
|
3
|
-
// The CLI moved from `@crouter/cli` to `@north-light/cli`. An install of the old
|
|
4
|
-
// name keeps updating itself, and this module is how it finds the new one: an
|
|
5
|
-
// install named `@crouter/cli` switches to `@north-light/cli` as soon as the old
|
|
6
|
-
// package is deprecated, or the new one is published at the same version or
|
|
7
|
-
// later. An install already named `@north-light/cli` never looks back.
|
|
8
|
-
//
|
|
9
|
-
// The switch needs no `npm install -g`. A self-update stages a runtime
|
|
10
|
-
// generation from the downloaded tarball and leaves the global shim alone, and
|
|
11
|
-
// the shim launches whichever generation is selected (bin/runtime-selector.mjs),
|
|
12
|
-
// so installing a generation from `@north-light/cli` moves the install without
|
|
13
|
-
// touching the old package's files. A generation recorded under the old name
|
|
14
|
-
// stays valid (bin/runtime-generation-manifest.mjs, LEGACY_PACKAGE_NAMES).
|
|
15
|
-
//
|
|
16
|
-
// This file is plain JavaScript and takes npm as a parameter because
|
|
17
|
-
// scripts/self-update.mjs runs it before any compiled code is available, and
|
|
18
|
-
// src/core/self-update.ts reaches it through `self-update.mjs --resolve`.
|
|
19
|
-
import { spawnSync } from 'node:child_process';
|
|
20
|
-
|
|
21
|
-
export const CURRENT_PACKAGE = '@north-light/cli';
|
|
22
|
-
export const LEGACY_PACKAGE = '@crouter/cli';
|
|
23
|
-
|
|
24
|
-
/** Compare `X.Y.Z` release versions; a prerelease suffix is ignored. Returns <0, 0 or >0. */
|
|
25
|
-
export function compareVersions(a, b) {
|
|
26
|
-
const parts = (v) => String(v).split(/[-+]/)[0].split('.').map((n) => Number.parseInt(n, 10) || 0);
|
|
27
|
-
const left = parts(a);
|
|
28
|
-
const right = parts(b);
|
|
29
|
-
for (let i = 0; i < Math.max(left.length, right.length); i++) {
|
|
30
|
-
const delta = (left[i] ?? 0) - (right[i] ?? 0);
|
|
31
|
-
if (delta !== 0) return delta;
|
|
32
|
-
}
|
|
33
|
-
return 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** `npm view <name> version deprecated`, or null when the package is unreachable or unpublished. */
|
|
37
|
-
export function npmView(name) {
|
|
38
|
-
const res = spawnSync('npm', ['view', name, 'version', 'deprecated', '--json'], { encoding: 'utf8' });
|
|
39
|
-
if (res.error || res.status !== 0) return null;
|
|
40
|
-
try {
|
|
41
|
-
const parsed = JSON.parse(res.stdout);
|
|
42
|
-
if (typeof parsed === 'string') return { version: parsed, deprecated: null };
|
|
43
|
-
if (parsed && typeof parsed.version === 'string') {
|
|
44
|
-
return { version: parsed.version, deprecated: typeof parsed.deprecated === 'string' && parsed.deprecated !== '' ? parsed.deprecated : null };
|
|
45
|
-
}
|
|
46
|
-
} catch {
|
|
47
|
-
// A body that is not JSON is the same as no answer.
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Decide the package to update from.
|
|
54
|
-
* @param {string} ownName the installed package's name (package.json `name`)
|
|
55
|
-
* @param {string} ownVersion the installed package's version
|
|
56
|
-
* @param {(name: string) => ({ version: string, deprecated: string | null } | null)} view
|
|
57
|
-
* @param {{ needLatest?: boolean }} [options] `needLatest: false` skips the registry lookup an install of the current name
|
|
58
|
-
* would only use to report a version
|
|
59
|
-
* @returns {{ package: string, latest: string | null, migrating: boolean, reason: string }}
|
|
60
|
-
* `latest` is null when the registry could not be reached.
|
|
61
|
-
*/
|
|
62
|
-
export function resolveUpdateTarget(ownName, ownVersion, view = npmView, { needLatest = true } = {}) {
|
|
63
|
-
if (ownName !== LEGACY_PACKAGE) {
|
|
64
|
-
const own = needLatest ? view(ownName) : null;
|
|
65
|
-
return { package: ownName, latest: own?.version ?? null, migrating: false, reason: 'installed package is current' };
|
|
66
|
-
}
|
|
67
|
-
const old = view(LEGACY_PACKAGE);
|
|
68
|
-
const next = view(CURRENT_PACKAGE);
|
|
69
|
-
if (next !== null) {
|
|
70
|
-
if (old?.deprecated) {
|
|
71
|
-
return { package: CURRENT_PACKAGE, latest: next.version, migrating: true, reason: `${LEGACY_PACKAGE} is deprecated: ${old.deprecated}` };
|
|
72
|
-
}
|
|
73
|
-
if (compareVersions(next.version, old?.version ?? ownVersion) >= 0) {
|
|
74
|
-
return { package: CURRENT_PACKAGE, latest: next.version, migrating: true, reason: `${CURRENT_PACKAGE}@${next.version} is published` };
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return { package: LEGACY_PACKAGE, latest: old?.version ?? null, migrating: false, reason: `${CURRENT_PACKAGE} is not available yet` };
|
|
78
|
-
}
|