@north-light/crouter 0.3.184 → 0.3.185

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 (61) hide show
  1. package/dist/build-root.js +10 -3
  2. package/dist/builtin-memory/internal/plugins.md +1 -1
  3. package/dist/clients/attach/input/capabilities.js +3 -0
  4. package/dist/clients/attach/slash/dispatch.js +12 -0
  5. package/dist/clients/attach/viewer.js +191 -191
  6. package/dist/commands/pkg/browse/actions.d.ts +7 -0
  7. package/dist/commands/pkg/browse/actions.js +199 -0
  8. package/dist/commands/pkg/browse/catalog.d.ts +9 -0
  9. package/dist/commands/pkg/browse/catalog.js +466 -0
  10. package/dist/commands/pkg/browse/command-view.d.ts +3 -0
  11. package/dist/commands/pkg/browse/command-view.js +191 -0
  12. package/dist/commands/pkg/browse/detail-panel.d.ts +66 -0
  13. package/dist/commands/pkg/browse/detail-panel.js +402 -0
  14. package/dist/commands/pkg/browse/doc-view.d.ts +3 -0
  15. package/dist/commands/pkg/browse/doc-view.js +81 -0
  16. package/dist/commands/pkg/browse/list-panel.d.ts +28 -0
  17. package/dist/commands/pkg/browse/list-panel.js +168 -0
  18. package/dist/commands/pkg/browse/model.d.ts +230 -0
  19. package/dist/commands/pkg/browse/model.js +36 -0
  20. package/dist/commands/pkg/browse/shell.d.ts +93 -0
  21. package/dist/commands/pkg/browse/shell.js +640 -0
  22. package/dist/commands/pkg/browse.d.ts +2 -0
  23. package/dist/commands/pkg/browse.js +27 -0
  24. package/dist/commands/pkg/market-manage.js +13 -4
  25. package/dist/commands/pkg/plugin-manage.js +8 -3
  26. package/dist/commands/pkg.js +2 -1
  27. package/dist/commands/sys/doctor.js +6 -4
  28. package/dist/commands/sys/panels/broker-limits-panel.d.ts +1 -1
  29. package/dist/commands/sys/panels/broker-limits-panel.js +1 -1
  30. package/dist/commands/sys/panels/dependencies-panel.d.ts +1 -1
  31. package/dist/commands/sys/panels/dependencies-panel.js +1 -1
  32. package/dist/commands/sys/panels/keybindings-panel.js +1 -1
  33. package/dist/commands/sys/panels/models-panel.d.ts +1 -1
  34. package/dist/commands/sys/panels/models-panel.js +1 -1
  35. package/dist/commands/sys/panels/plugins-panel.d.ts +1 -1
  36. package/dist/commands/sys/panels/plugins-panel.js +1 -1
  37. package/dist/commands/sys/panels/prefs-panel.d.ts +1 -1
  38. package/dist/commands/sys/panels/prefs-panel.js +1 -1
  39. package/dist/commands/sys/panels/provider-panel.d.ts +1 -1
  40. package/dist/commands/sys/panels/provider-panel.js +1 -1
  41. package/dist/commands/sys/settings-shell.js +1 -1
  42. package/dist/commands/sys/setup-settings-runner.d.ts +7 -18
  43. package/dist/commands/sys/setup-settings-runner.js +3 -52
  44. package/dist/commands/sys/setup-wizard.js +1 -1
  45. package/dist/core/__tests__/serial/command-plugins.test.js +21 -40
  46. package/dist/core/command-manifests/registry.d.ts +10 -3
  47. package/dist/core/command-manifests/registry.js +36 -22
  48. package/dist/core/command-plugins/compose.js +1 -1
  49. package/dist/core/command-plugins/discovery.js +15 -7
  50. package/dist/core/keybindings/catalog.d.ts +1 -1
  51. package/dist/core/keybindings/catalog.js +1 -0
  52. package/dist/core/resolver.d.ts +2 -2
  53. package/dist/core/runtime/tmux-bindings.js +2 -0
  54. package/dist/core/tui/page-host.d.ts +25 -0
  55. package/dist/core/tui/page-host.js +65 -0
  56. package/dist/pi-extensions/canvas-bash-valve.js +45 -1
  57. package/dist/types.d.ts +4 -1
  58. package/package.json +1 -1
  59. package/runtime.lock.json +2 -2
  60. /package/dist/{commands/sys/panels → core/tui}/panel.d.ts +0 -0
  61. /package/dist/{commands/sys/panels → core/tui}/panel.js +0 -0
@@ -14,8 +14,15 @@ const GLOBALS = [
14
14
  * into a single leaf, so it must load ONE subtree — not the attach TUI and
15
15
  * every other subtree it never touches. `crtr` cold-start is dominated by Node
16
16
  * module loading; keeping the
17
- * other subtrees off the path is the biggest, lowest-risk win. */
18
- const SUBTREE_LOADERS = {
17
+ * other subtrees off the path is the biggest, lowest-risk win.
18
+ *
19
+ * Null-prototype: `resolveRoot` indexes this by the raw first argv token, so a
20
+ * normal object literal would resolve `Object.prototype` members — `crtr
21
+ * toString` would build a root from a non-loader and report "Valid children:"
22
+ * with nothing after it, and `crtr hasOwnProperty` would die untyped. With no
23
+ * prototype every non-subtree token misses and falls through to the real
24
+ * unknown-path error. */
25
+ const SUBTREE_LOADERS = Object.assign(Object.create(null), {
19
26
  memory: async () => (await import('./commands/memory.js')).registerMemory(),
20
27
  profile: async () => (await import('./commands/profile.js')).registerProfile(),
21
28
  pkg: async () => (await import('./commands/pkg.js')).registerPkg(),
@@ -26,7 +33,7 @@ const SUBTREE_LOADERS = {
26
33
  cron: async () => (await import('./commands/cron.js')).registerCron(),
27
34
  canvas: async () => (await import('./commands/canvas.js')).registerCanvas(),
28
35
  surface: async () => (await import('./commands/surface.js')).registerSurface(),
29
- };
36
+ });
30
37
  /** Every shipped subtree name. Cheap (no module loading) — the front-door
31
38
  * recursion guard and the dispatcher's first-token routing need only names. */
32
39
  export const SUBTREE_NAMES = Object.freeze(Object.keys(SUBTREE_LOADERS));
@@ -8,7 +8,7 @@ file-read-visibility: none
8
8
 
9
9
  # Authoring crtr plugins
10
10
 
11
- A **plugin** is a directory shipping substrate docs (knowledge and preferences) and other artifact types like `rules/` and `agents/`. Plugins are how you package that content for sharing across machines, projects, and people.
11
+ A **plugin** is a directory shipping substrate docs (knowledge and preferences) and other artifact types like `rules/` and `agents/`. Plugins are how you package that content for sharing across machines, projects, and people. A human can inspect marketplaces and their plugin capability surfaces in `crtr pkg browse`; agents use the scriptable `crtr pkg market browse` and `crtr pkg plugin list` leaves.
12
12
 
13
13
  Audience: LLM agents creating or maintaining a crtr plugin.
14
14
 
@@ -73,6 +73,9 @@ export function viewerOperationForSlash(name, builtin, canvas) {
73
73
  case 'resume-node': return 'canvas-resume';
74
74
  case 'context':
75
75
  case 'node-metadata': return 'local-canvas-inspect';
76
+ // `/plugins` configures the local machine, not this node; observers and
77
+ // remote attaches can open its local popup.
78
+ case 'plugins': return undefined;
76
79
  case 'inbox': return 'canvas-inbox';
77
80
  case 'clear':
78
81
  case 'promote':
@@ -41,6 +41,7 @@ export const CANVAS_SLASH_COMMANDS = [
41
41
  { name: 'promote', description: 'Promote this node to an orchestrator — /promote, or /promote <kind> to specialize' },
42
42
  { name: 'resume-node', description: 'Open the canvas navigator (search/scope/sort/tree) and resume the chosen node' },
43
43
  { name: 'context', description: 'Browse this node + its subscriptions’ context dirs in a read-only nvim popup' },
44
+ { name: 'plugins', description: 'Open the interactive plugin browser for this machine' },
44
45
  { name: 'node-metadata', description: 'Inspect this node — identity, lifecycle, runtime, graph, artifacts, paths, and agent surfaces' },
45
46
  { name: 'mcp', description: 'MCP servers — status from the adapter’s config/cache; Enter (or /mcp <server>) connects, reconnects, or re-auths' },
46
47
  { name: 'rename', description: 'Rename this node everywhere — node row, viewer window, session chip, tmux pane: /rename <name>' },
@@ -346,6 +347,8 @@ function dispatchCanvasCommand(name, arg, ctx) {
346
347
  // A read-only nvim explorer over this node's + its subscriptions' context
347
348
  // dirs, as a self-contained popup.
348
349
  return openContext(ctx);
350
+ case 'plugins':
351
+ return openPlugins(ctx);
349
352
  case 'node-metadata':
350
353
  if (ctx.onNodeMetadata)
351
354
  ctx.onNodeMetadata();
@@ -594,6 +597,15 @@ function openContext(ctx) {
594
597
  popup(`crtr node inspect context --node ${shellQuote(nodeId)}`);
595
598
  return true;
596
599
  }
600
+ /** `/plugins`. Opens the local plugin browser as a self-contained popup. */
601
+ function openPlugins(ctx) {
602
+ if (process.env['TMUX'] === undefined) {
603
+ ctx.notify('/plugins needs tmux');
604
+ return true;
605
+ }
606
+ popup('crtr pkg browse');
607
+ return true;
608
+ }
597
609
  /** Open `cmd` as a fire-and-forget tmux display-popup (same geometry as the canvas
598
610
  * extensions). tmux runs the trailing string through `sh -c`; the popup owns its
599
611
  * screen and closes itself when the command exits, dropping back to this pane. */