@north-light/cli 0.3.674 → 0.3.675

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 (42) hide show
  1. package/dist/clients/attach/session/connection.d.ts +2 -1
  2. package/dist/clients/attach/session/connection.js +1 -1
  3. package/dist/clients/attach/viewer.d.ts +11 -1
  4. package/dist/clients/attach/viewer.js +524 -524
  5. package/dist/commands/person-settings.d.ts +5 -0
  6. package/dist/commands/person-settings.js +1 -1
  7. package/dist/core/graph/reader.d.ts +2 -1
  8. package/dist/core/graph/reader.js +3 -3
  9. package/dist/core/graph/repo-sync/repos.d.ts +24 -3
  10. package/dist/core/graph/repo-sync/repos.js +4 -4
  11. package/dist/core/profiles/select.d.ts +3 -1
  12. package/dist/core/profiles/select.js +25 -25
  13. package/dist/core/runtime/bearings.d.ts +3 -3
  14. package/dist/core/runtime/bearings.js +6 -6
  15. package/dist/core/runtime/boot-root.d.ts +3 -3
  16. package/dist/core/runtime/boot-root.js +6 -4
  17. package/dist/core/runtime/deliver-live.js +1 -1
  18. package/dist/core/runtime/front-door.js +1 -1
  19. package/dist/core/runtime/starting-screen.d.ts +12 -0
  20. package/dist/core/runtime/starting-screen.js +9 -0
  21. package/dist/core/substrate/delivery/deliver.d.ts +1 -1
  22. package/dist/core/substrate/delivery/deliver.js +3 -3
  23. package/dist/core/substrate/subject.d.ts +3 -1
  24. package/dist/core/substrate/subject.js +1 -1
  25. package/dist/daemon/api/handlers/broker-ops.js +1 -1
  26. package/dist/daemon/api/handlers/delivery.js +1 -1
  27. package/package.json +3 -3
  28. package/packages/crouter-api/dist/clients/attach/session/connection.js +3 -2
  29. package/packages/crouter-api/dist/clients/attach/viewer.js +16 -7
  30. package/packages/crouter-api/dist/commands/person-settings.js +10 -3
  31. package/packages/crouter-api/dist/core/graph/reader.js +9 -4
  32. package/packages/crouter-api/dist/core/graph/repo-sync/repos.js +56 -13
  33. package/packages/crouter-api/dist/core/profiles/select.js +17 -7
  34. package/packages/crouter-api/dist/core/runtime/bearings.js +11 -12
  35. package/packages/crouter-api/dist/core/runtime/deliver-live.js +1 -1
  36. package/packages/crouter-api/dist/core/substrate/delivery/deliver.js +3 -3
  37. package/packages/crouter-api/dist/core/substrate/subject.js +4 -4
  38. package/packages/crouter-api/dist/daemon/api/handlers/broker-ops.js +6 -4
  39. package/packages/crouter-api/package.json +1 -1
  40. package/packages/crouter-identity/package.json +1 -1
  41. package/packages/crouter-plugin/package.json +3 -3
  42. package/runtime.lock.json +14 -14
@@ -252,14 +252,14 @@ async function readDocument(db, reader, raw) {
252
252
  * inside its boot, and a document read goes through the read route. */
253
253
  export const DRY_RUN_ONLY = ['workspace-open', 'document-read'];
254
254
  /** One delivery for a live node. Call inside `withCanvasWrite`. */
255
- export async function deliver(db, reader, req) {
255
+ export async function deliver(db, reader, req, subject) {
256
256
  if (DRY_RUN_ONLY.includes(req.activity))
257
257
  throw new ApiError(400, 'usage', `delivery activity ${req.activity} is available to a dry run only`);
258
258
  const node = nodeOf(reader).node;
259
259
  if (req.activity === 'boot' && req.inherited !== true)
260
260
  await clearLedger(db, node.id);
261
261
  const ledger = await loadLedger(db, node.id);
262
- const ctx = { db, reader, subject: await nodeSubject(db, reader), ledger, channel: 'transcript' };
262
+ const ctx = { db, reader, subject: subject ?? await nodeSubject(db, reader), ledger, channel: 'transcript' };
263
263
  const { result, delivered } = await render(ctx, req);
264
264
  await recordContentDelivery(db, reader, delivered);
265
265
  await saveLedger(db, ledger);
@@ -304,7 +304,7 @@ function resolveProfileId(raw, cwd) {
304
304
  export async function hypotheticalReader(db, h) {
305
305
  const app = await ownerForGrantee(db, h.grantee ?? 'app:terminal');
306
306
  const profileId = resolveProfileId(h.profile, h.cwd);
307
- const view = await viewRepos(db, h.cwd, profileId, async (cwd, person) => await checkoutsForCwd(db, cwd, person), liveLookups(db));
307
+ const view = await viewRepos(db, h.cwd, profileId, async (cwd, person, access) => await checkoutsForCwd(db, cwd, person, access), liveLookups(db));
308
308
  const { repos } = view;
309
309
  const mode = h.mode ?? 'base';
310
310
  const node = {
@@ -15,7 +15,7 @@ export { effectiveScopes, scopeForCwd, profileNameFor } from './subject-fields.j
15
15
  * walking the `parent` chain (canvas-db rows) until a row with no parent (the
16
16
  * root). The root is depth 0. Cycle-guarded (parents must not cycle, but never
17
17
  * loop forever) — mirrors `rootOfSpine` in runtime/placement.ts. */
18
- export async function spineDepth(nodeId) {
18
+ export async function spineDepth(nodeId, own) {
19
19
  let cur = nodeId;
20
20
  const seen = new Set();
21
21
  let hops = 0;
@@ -23,7 +23,7 @@ export async function spineDepth(nodeId) {
23
23
  if (seen.has(cur))
24
24
  break;
25
25
  seen.add(cur);
26
- const row = await getRow(cur);
26
+ const row = cur === nodeId && own !== undefined ? own : await getRow(cur);
27
27
  if (row === null || row.parent == null)
28
28
  break;
29
29
  cur = row.parent;
@@ -34,7 +34,7 @@ export async function spineDepth(nodeId) {
34
34
  /** The repos eligible for the node's rules: those enclosing its cwd, then the repos of its profile's project paths. */
35
35
  async function eligibleRepos(cwd, profileId) {
36
36
  const db = await openDb();
37
- const view = await viewRepos(db, cwd, profileId, async (dir, person) => await checkoutsForCwd(db, dir, person), liveLookups(db));
37
+ const view = await viewRepos(db, cwd, profileId, async (dir, person, access) => await checkoutsForCwd(db, dir, person, access), liveLookups(db));
38
38
  return [...view.repos, ...view.projectRepos];
39
39
  }
40
40
  /** Assemble the node-config subject for `nodeId` from its `NodeMeta` + the
@@ -51,7 +51,7 @@ export async function assembleNodeSubject(nodeId, repos) {
51
51
  hasManager: (meta.parent ?? null) !== null,
52
52
  cwd: meta.cwd,
53
53
  scope: scopeForCwd(meta.cwd),
54
- orchestration: { depth: await spineDepth(nodeId) },
54
+ orchestration: { depth: await spineDepth(nodeId, meta) },
55
55
  profile: profileNameFor(meta.profile_id),
56
56
  app: meta.grantee ?? await appForNode(nodeId),
57
57
  scopes: effectiveScopes(meta.scopes),
@@ -33,6 +33,7 @@ import { runAttachments } from './node-records.js';
33
33
  import { readerForNode, warmNodeRepos } from '../../../core/graph/reader.js';
34
34
  import { checkoutsForCwd } from '../../../core/graph/repo-sync/repos.js';
35
35
  import { deliver } from '../../../core/substrate/delivery/deliver.js';
36
+ import { nodeSubject } from '../../../core/substrate/delivery/corpus.js';
36
37
  import { ensureRunObserver } from '../../runs/observer.js';
37
38
  import { parseNodeTelemetryRecord, writeNodeTelemetryRecord } from './telemetry-record.js';
38
39
  import { mapAsync } from '../../../core/async-array.js';
@@ -300,10 +301,11 @@ async function startupDelivery(nodeId, state, bearings, namesOnly, warmed = fals
300
301
  if (!warmed)
301
302
  await warmNodeRepos(await openDb(), nodeId);
302
303
  return await withCanvasWrite(async (db) => {
303
- const reader = await readerForNode(db, nodeId, async (cwd, person) => await checkoutsForCwd(db, cwd, person));
304
- const names = await deliver(db, reader, { activity: 'names' });
305
- const boot = bootOwed ? await deliver(db, reader, { activity: 'boot', ...(bearings === 'inherited' ? { inherited: true } : {}) }) : undefined;
306
- const system = warm ? undefined : await deliver(db, reader, { activity: 'system-prompt' });
304
+ const reader = await readerForNode(db, nodeId, async (cwd, person, access) => await checkoutsForCwd(db, cwd, person, access));
305
+ const subject = await nodeSubject(db, reader);
306
+ const names = await deliver(db, reader, { activity: 'names' }, subject);
307
+ const boot = bootOwed ? await deliver(db, reader, { activity: 'boot', ...(bearings === 'inherited' ? { inherited: true } : {}) }, subject) : undefined;
308
+ const system = warm ? undefined : await deliver(db, reader, { activity: 'system-prompt' }, subject);
307
309
  return {
308
310
  names: { refs: names.refs, names: names.names },
309
311
  ...(boot === undefined ? {} : { boot: { content: boot.content, ...(boot.inherited === true ? { inherited: true } : {}) } }),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/api",
3
- "version": "0.3.674",
3
+ "version": "0.3.675",
4
4
  "description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "main": "./dist/api/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/identity",
3
- "version": "0.3.674",
3
+ "version": "0.3.675",
4
4
  "description": "Northlight access-token verification and scope rules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/plugin",
3
- "version": "0.3.674",
3
+ "version": "0.3.675",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -27,8 +27,8 @@
27
27
  "postpack": "node ../../scripts/pack-minify.mjs postpack packages/crouter-plugin"
28
28
  },
29
29
  "dependencies": {
30
- "@north-light/api": "0.3.674",
31
- "@north-light/identity": "0.3.674"
30
+ "@north-light/api": "0.3.675",
31
+ "@north-light/identity": "0.3.675"
32
32
  },
33
33
  "license": "UNLICENSED",
34
34
  "publishConfig": {
package/runtime.lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.674",
3
+ "version": "0.3.675",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@north-light/cli",
9
- "version": "0.3.674",
9
+ "version": "0.3.675",
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.674",
32
- "@north-light/plugin": "0.3.674",
31
+ "@north-light/identity": "0.3.675",
32
+ "@north-light/plugin": "0.3.675",
33
33
  "cron-parser": "^5.6.0",
34
34
  "esbuild": "0.28.2",
35
35
  "jose": "^6.2.12",
@@ -10667,17 +10667,17 @@
10667
10667
  },
10668
10668
  "packages/crouter-api": {
10669
10669
  "name": "@north-light/api",
10670
- "version": "0.3.674",
10670
+ "version": "0.3.675",
10671
10671
  "license": "UNLICENSED"
10672
10672
  },
10673
10673
  "packages/crouter-env-docker": {
10674
10674
  "name": "@north-light/env-docker",
10675
- "version": "0.3.674",
10675
+ "version": "0.3.675",
10676
10676
  "license": "UNLICENSED"
10677
10677
  },
10678
10678
  "packages/crouter-identity": {
10679
10679
  "name": "@north-light/identity",
10680
- "version": "0.3.674",
10680
+ "version": "0.3.675",
10681
10681
  "license": "UNLICENSED",
10682
10682
  "dependencies": {
10683
10683
  "jose": "^6.2.1"
@@ -10685,21 +10685,21 @@
10685
10685
  },
10686
10686
  "packages/crouter-plugin": {
10687
10687
  "name": "@north-light/plugin",
10688
- "version": "0.3.674",
10688
+ "version": "0.3.675",
10689
10689
  "license": "UNLICENSED",
10690
10690
  "dependencies": {
10691
- "@north-light/api": "0.3.674",
10692
- "@north-light/identity": "0.3.674"
10691
+ "@north-light/api": "0.3.675",
10692
+ "@north-light/identity": "0.3.675"
10693
10693
  }
10694
10694
  },
10695
10695
  "packages/crouter-sdk": {
10696
10696
  "name": "@north-light/sdk",
10697
- "version": "0.3.674",
10697
+ "version": "0.3.675",
10698
10698
  "license": "UNLICENSED",
10699
10699
  "dependencies": {
10700
- "@north-light/api": "0.3.674",
10701
- "@north-light/identity": "0.3.674",
10702
- "@north-light/plugin": "0.3.674",
10700
+ "@north-light/api": "0.3.675",
10701
+ "@north-light/identity": "0.3.675",
10702
+ "@north-light/plugin": "0.3.675",
10703
10703
  "jose": "^6.2.1"
10704
10704
  },
10705
10705
  "bin": {