@north-light/crouter 0.3.162 → 0.3.164

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 (100) hide show
  1. package/dist/builtin-memory/00-runtime-base.md +1 -0
  2. package/dist/builtin-memory/04-orchestration-kernel.md +1 -0
  3. package/dist/builtin-memory/init.md +38 -0
  4. package/dist/builtin-memory/internal/INDEX.md +1 -0
  5. package/dist/builtin-memory/internal/memory-loading.md +45 -0
  6. package/dist/builtin-memory/wedged-child-on-runaway-bash.md +2 -2
  7. package/dist/builtin-pi-packages/pi-crtr-extensions/README.md +0 -1
  8. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/provider-rotation.test.ts +34 -2
  9. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +14 -3
  10. package/dist/clients/attach/__tests__/crtr-output-coverage.test.js +1 -1
  11. package/dist/clients/attach/__tests__/crtr-output.test.js +14 -9
  12. package/dist/clients/attach/__tests__/edit-diff.test.d.ts +1 -0
  13. package/dist/clients/attach/__tests__/edit-diff.test.js +35 -0
  14. package/dist/clients/attach/__tests__/editor-frame-title.test.d.ts +1 -0
  15. package/dist/clients/attach/__tests__/editor-frame-title.test.js +19 -0
  16. package/dist/clients/attach/render/chat-view.js +54 -38
  17. package/dist/clients/attach/render/crtr-output.d.ts +2 -1
  18. package/dist/clients/attach/render/crtr-output.js +33 -4
  19. package/dist/clients/attach/render/edit-diff.d.ts +21 -6
  20. package/dist/clients/attach/render/edit-diff.js +104 -81
  21. package/dist/clients/attach/render/tool-calls.d.ts +21 -20
  22. package/dist/clients/attach/render/tool-calls.js +89 -43
  23. package/dist/clients/attach/session/connection.d.ts +1 -1
  24. package/dist/clients/attach/session/editor-frame.d.ts +5 -1
  25. package/dist/clients/attach/session/editor-frame.js +21 -15
  26. package/dist/clients/attach/session/identity.d.ts +1 -1
  27. package/dist/clients/attach/viewer.js +628 -624
  28. package/dist/commands/__tests__/api-canvas-source.test.d.ts +1 -0
  29. package/dist/commands/__tests__/api-canvas-source.test.js +37 -0
  30. package/dist/commands/__tests__/human.test.js +2 -0
  31. package/dist/commands/__tests__/search-contents.test.d.ts +1 -0
  32. package/dist/commands/__tests__/search-contents.test.js +52 -0
  33. package/dist/commands/api-client.js +1 -0
  34. package/dist/commands/human/prompts.js +2 -2
  35. package/dist/commands/human/shared.d.ts +1 -0
  36. package/dist/commands/human/shared.js +7 -4
  37. package/dist/commands/memory/lint.d.ts +6 -0
  38. package/dist/commands/memory/lint.js +177 -35
  39. package/dist/commands/memory/read.js +22 -1
  40. package/dist/commands/memory/write.js +18 -4
  41. package/dist/commands/memory.js +1 -1
  42. package/dist/commands/search/contents.js +2 -2
  43. package/dist/commands/sys/__tests__/sync-deps.test.js +12 -21
  44. package/dist/commands/sys/__tests__/sync-import.test.js +30 -29
  45. package/dist/commands/sys/setup-wizard.d.ts +8 -1
  46. package/dist/commands/sys/setup-wizard.js +209 -58
  47. package/dist/commands/sys/sync-deps.js +14 -18
  48. package/dist/commands/sys/sync-project-guidance.js +16 -19
  49. package/dist/core/__tests__/migration.test.js +8 -3
  50. package/dist/core/__tests__/on-read-crouter-home-fence.test.js +7 -10
  51. package/dist/core/__tests__/on-read-dedup-resume.test.js +13 -25
  52. package/dist/core/__tests__/on-read-identity.test.js +8 -15
  53. package/dist/core/__tests__/revive.test.js +2 -2
  54. package/dist/core/__tests__/tmux-surface.test.js +10 -4
  55. package/dist/core/__tests__/worktree.test.js +3 -3
  56. package/dist/core/canvas/extensions.d.ts +1 -1
  57. package/dist/core/canvas/extensions.js +18 -11
  58. package/dist/core/canvas/labels.d.ts +4 -5
  59. package/dist/core/canvas/labels.js +9 -9
  60. package/dist/core/command-manifests/schema.js +18 -5
  61. package/dist/core/command.js +17 -7
  62. package/dist/core/configured-clis/invoker.js +2 -0
  63. package/dist/core/help.d.ts +3 -1
  64. package/dist/core/help.js +5 -2
  65. package/dist/core/keybindings/__tests__/resolve.test.js +5 -2
  66. package/dist/core/keybindings/catalog.d.ts +3 -2
  67. package/dist/core/keybindings/catalog.js +34 -25
  68. package/dist/core/keybindings/index.d.ts +1 -1
  69. package/dist/core/keybindings/resolve.js +8 -0
  70. package/dist/core/keybindings/types.d.ts +6 -1
  71. package/dist/core/memory/doc-link-grammar.d.ts +20 -0
  72. package/dist/core/memory/doc-link-grammar.js +110 -0
  73. package/dist/core/memory-resolver.d.ts +5 -0
  74. package/dist/core/memory-resolver.js +12 -1
  75. package/dist/core/runtime/bearings.d.ts +8 -8
  76. package/dist/core/runtime/bearings.js +20 -16
  77. package/dist/core/runtime/broker.js +3 -13
  78. package/dist/core/runtime/canvas-extensions.d.ts +1 -0
  79. package/dist/core/runtime/canvas-extensions.js +2 -0
  80. package/dist/core/runtime/launch.d.ts +1 -1
  81. package/dist/core/runtime/launch.js +1 -1
  82. package/dist/core/runtime/tmux.js +136 -100
  83. package/dist/core/scope.js +4 -5
  84. package/dist/core/substrate/ceiling.d.ts +3 -6
  85. package/dist/core/substrate/ceiling.js +13 -15
  86. package/dist/core/substrate/index.d.ts +2 -3
  87. package/dist/core/substrate/index.js +2 -2
  88. package/dist/core/substrate/on-read.d.ts +4 -13
  89. package/dist/core/substrate/on-read.js +142 -262
  90. package/dist/core/substrate/render.js +4 -4
  91. package/dist/core/substrate/schema.d.ts +3 -2
  92. package/dist/core/substrate/schema.js +5 -5
  93. package/dist/pi-extensions/__tests__/canvas-tool-guide.test.d.ts +1 -0
  94. package/dist/pi-extensions/__tests__/canvas-tool-guide.test.js +96 -0
  95. package/dist/pi-extensions/canvas-doc-substrate.js +7 -8
  96. package/dist/pi-extensions/canvas-tool-guide.d.ts +14 -0
  97. package/dist/pi-extensions/canvas-tool-guide.js +77 -0
  98. package/package.json +2 -2
  99. package/runtime.lock.json +6 -6
  100. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crouter-help.ts +0 -95
@@ -37,6 +37,26 @@ export function resolveEditorFrameStyles(bashMode, thinkingLevel, pal) {
37
37
  titleStyle: thinkingTitleStyle(thinkingLevel, defaultTitleStyle),
38
38
  };
39
39
  }
40
+ /** Render the generated task icon on every non-empty editor title. Session
41
+ * names are persisted independently by pi, so this derives the icon from the
42
+ * canvas identity again whenever a viewer attaches or reloads. */
43
+ export function displayEditorTitle(sessionName, identity) {
44
+ const raw = sessionName ?? '';
45
+ if (raw === '' || identity === undefined)
46
+ return raw;
47
+ const modePrefix = `${modeIcon(identity.mode)} `;
48
+ const withoutMode = raw.startsWith(modePrefix) ? raw.slice(modePrefix.length) : raw;
49
+ const icon = (identity.icon ?? '').trim();
50
+ const iconPrefix = icon === '' ? '' : `${icon} `;
51
+ const withoutTaskIcon = iconPrefix !== '' && withoutMode.startsWith(iconPrefix)
52
+ ? withoutMode.slice(iconPrefix.length)
53
+ : withoutMode;
54
+ const withoutKind = withoutTaskIcon.endsWith(` ${identity.kind}`)
55
+ ? withoutTaskIcon.slice(0, -identity.kind.length - 1)
56
+ : withoutTaskIcon;
57
+ const name = withoutKind === identity.kind ? '' : withoutKind;
58
+ return name === '' || icon === '' ? name : `${icon} ${name}`;
59
+ }
40
60
  /** The editor-chrome collaborator: owns the shell/bash level (`deriveBashMode`
41
61
  * over `editor.onChange` is its ONE writer) and the `/color` chip override,
42
62
  * and paints every frame-attached adornment — border hue, title chip, context
@@ -58,20 +78,6 @@ export function createEditorChrome(ctx, hooks) {
58
78
  const persona = identity ? ` · ${personaLabel(identity)}` : '';
59
79
  editor.contextBadge = `${lifecycle}${dir}${persona}`;
60
80
  };
61
- // Normalize an icon-and-kind session label so persona remains exclusively in
62
- // the bottom-right badge while the viewer is attached.
63
- const displaySessionTitle = (sessionName) => {
64
- const identity = hooks.nodeIdentity();
65
- const raw = sessionName ?? '';
66
- if (raw === '' || identity === undefined)
67
- return raw;
68
- const legacyPrefix = `${modeIcon(identity.mode)} `;
69
- const withoutIcon = raw.startsWith(legacyPrefix) ? raw.slice(legacyPrefix.length) : raw;
70
- const withoutKind = withoutIcon.endsWith(` ${identity.kind}`)
71
- ? withoutIcon.slice(0, -identity.kind.length - 1)
72
- : withoutIcon;
73
- return withoutKind === identity.kind ? '' : withoutKind;
74
- };
75
81
  // Paint the editor border + title chip. Shell/bash mode (leading `!`) wins and
76
82
  // forces the whole frame green (#7); otherwise the hue tracks the thinking
77
83
  // level. One place so the onChange bash toggle and live-state updates agree.
@@ -128,7 +134,7 @@ export function createEditorChrome(ctx, hooks) {
128
134
  },
129
135
  paintFrame,
130
136
  setTitle: (sessionName) => {
131
- editor.title = displaySessionTitle(sessionName);
137
+ editor.title = displayEditorTitle(sessionName, hooks.nodeIdentity());
132
138
  },
133
139
  syncContextBadge: () => syncContextBadge(),
134
140
  pollGit: () => fetchGitInfo(meta.cwd, renderGitInfo),
@@ -1,6 +1,6 @@
1
1
  import type { NodeMeta } from '../../../core/canvas/types.js';
2
2
  import type { AttachSession } from './context.js';
3
- export type NodeIdentity = Pick<NodeMeta, 'kind' | 'mode' | 'lifecycle'> | undefined;
3
+ export type NodeIdentity = Pick<NodeMeta, 'kind' | 'mode' | 'lifecycle' | 'icon'> | undefined;
4
4
  export interface IdentityHooks {
5
5
  /** Drop a late refresh that lands after the viewer is gone. */
6
6
  isTornDown: () => boolean;