@kabmo-labs/kabmo 0.16.0 → 0.17.0

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 (131) hide show
  1. package/README.md +2 -2
  2. package/dist/client/index.html +1 -1
  3. package/dist/client/index.js +417 -417
  4. package/dist/client/static/js/index-3ve31rzx.css +1 -0
  5. package/dist/client/static/js/{index-cpydmygd.js → index-rerjq5th.js} +839 -837
  6. package/package.json +1 -1
  7. package/src/client/components/common/code-surface/bracket-guide.test.ts +2 -2
  8. package/src/client/components/common/code-surface/bracket-guide.ts +2 -2
  9. package/src/client/components/common/code-surface/conflict-markers.ts +5 -5
  10. package/src/client/components/common/code-surface/extensions.ts +7 -4
  11. package/src/client/components/common/code-surface/theme.ts +34 -9
  12. package/src/client/components/common/code-surface/whitespace.test.ts +223 -0
  13. package/src/client/components/common/code-surface/whitespace.ts +140 -0
  14. package/src/client/components/common/{server-switcher/index.tsx → server-control/Panel.tsx} +73 -35
  15. package/src/client/components/common/{server-switcher → server-control}/index.test.tsx +98 -37
  16. package/src/client/components/common/server-control/index.tsx +118 -0
  17. package/src/client/components/layout/desktop-layout/TopNavbar.tsx +8 -50
  18. package/src/client/components/mobile/mobile-main-view/Header.tsx +6 -12
  19. package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +41 -13
  20. package/src/client/components/settings/Modal.tsx +9 -3
  21. package/src/client/components/settings/ProjectSelectorDropdown.tsx +19 -9
  22. package/src/client/components/settings/categories/AgentSettings.tsx +27 -6
  23. package/src/client/components/settings/categories/ProjectSettings.tsx +122 -156
  24. package/src/client/components/settings/categories/SkillCatalogSettings.tsx +220 -260
  25. package/src/client/components/settings/categories/SkillSettings.tsx +6 -3
  26. package/src/client/components/settings/categories/agent-settings/SidebarList.tsx +5 -0
  27. package/src/client/components/settings/categories/project-settings/AccentPalette.test.tsx +189 -0
  28. package/src/client/components/settings/categories/project-settings/AccentPalette.tsx +156 -24
  29. package/src/client/components/settings/categories/project-settings/AddProjectModal.tsx +175 -0
  30. package/src/client/components/settings/categories/project-settings/DeleteProjectModal.tsx +107 -0
  31. package/src/client/components/settings/categories/project-settings/DetailsForm.tsx +40 -24
  32. package/src/client/components/settings/categories/project-settings/DetailsHeader.tsx +17 -7
  33. package/src/client/components/settings/categories/project-settings/IconGrid.tsx +164 -69
  34. package/src/client/components/settings/categories/project-settings/ModelDropdown.test.tsx +122 -0
  35. package/src/client/components/settings/categories/project-settings/ModelDropdown.tsx +124 -53
  36. package/src/client/components/settings/categories/project-settings/NameInput.tsx +57 -11
  37. package/src/client/components/settings/categories/project-settings/PathField.tsx +122 -0
  38. package/src/client/components/settings/categories/project-settings/SidebarList.tsx +100 -59
  39. package/src/client/components/settings/categories/skill-catalog/GitImportPanel.tsx +253 -0
  40. package/src/client/components/settings/categories/skill-catalog/SkillCard.tsx +89 -0
  41. package/src/client/components/settings/categories/skill-catalog/SourceRail.tsx +122 -0
  42. package/src/client/components/settings/categories/skill-catalog/catalog-ui.test.tsx +179 -0
  43. package/src/client/components/settings/categories/skill-settings/DetailHeader.tsx +208 -0
  44. package/src/client/components/settings/categories/skill-settings/DetailPane.tsx +137 -232
  45. package/src/client/components/settings/categories/skill-settings/InstructionsEditor.tsx +84 -0
  46. package/src/client/components/settings/categories/skill-settings/SidebarList.tsx +123 -87
  47. package/src/client/components/settings/categories/skill-settings/pane.test.tsx +179 -0
  48. package/src/client/components/settings/categories/skill-settings/row-meta.ts +58 -0
  49. package/src/client/components/workspace/chat-timeline/index.tsx +6 -1
  50. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.test.ts +46 -0
  51. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +15 -6
  52. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.test.ts +29 -0
  53. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +11 -3
  54. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.test.ts +24 -1
  55. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +6 -2
  56. package/src/client/components/workspace/editor/viewers/SvgPreview.tsx +18 -2
  57. package/src/client/components/workspace/editor/viewers/viewers.test.ts +39 -0
  58. package/src/client/components/workspace/file-explorer/ContextMenu.tsx +18 -5
  59. package/src/client/components/workspace/file-explorer/Modals.tsx +15 -1
  60. package/src/client/components/workspace/file-explorer/RowLabel.tsx +68 -0
  61. package/src/client/components/workspace/file-explorer/TreeItem.tsx +47 -57
  62. package/src/client/components/workspace/file-explorer/collapsed-chain.test.ts +167 -0
  63. package/src/client/components/workspace/file-explorer/drag-props.ts +42 -0
  64. package/src/client/components/workspace/file-explorer/drag.test.ts +43 -0
  65. package/src/client/components/workspace/file-explorer/index.tsx +21 -20
  66. package/src/client/data/settings/omp-schema.json +91 -4
  67. package/src/client/data/settings/project.ts +9 -28
  68. package/src/client/data/settings/skill.ts +6 -32
  69. package/src/client/hooks/chat/timeline/pending-model.ts +28 -0
  70. package/src/client/hooks/settings/projects/index.ts +294 -0
  71. package/src/client/hooks/settings/projects.test.ts +237 -0
  72. package/src/client/hooks/settings/skill-catalog.ts +101 -9
  73. package/src/client/hooks/settings/skill-git-import.ts +153 -0
  74. package/src/client/hooks/shell/servers.test.ts +166 -0
  75. package/src/client/hooks/{desktop → shell}/servers.ts +17 -14
  76. package/src/client/hooks/ui/updates/shell-download.ts +1 -1
  77. package/src/client/hooks/ui/updates/shell-update.ts +2 -6
  78. package/src/client/hooks/workspace/file-row-drag.ts +41 -0
  79. package/src/client/hooks/workspace/file-tree-actions.ts +25 -1
  80. package/src/client/hooks/workspace/file-tree-edits.ts +23 -6
  81. package/src/client/hooks/workspace/root-drop-target.ts +77 -0
  82. package/src/client/hooks/workspace/unfolded-chains.ts +165 -0
  83. package/src/client/lib/desktop/dropped-paths.ts +1 -1
  84. package/src/client/lib/desktop/titlebar.test.ts +12 -3
  85. package/src/client/lib/desktop/titlebar.ts +1 -1
  86. package/src/client/lib/shell/desktop.ts +117 -0
  87. package/src/client/lib/shell/servers.ts +75 -0
  88. package/src/client/lib/shell/transport.ts +216 -0
  89. package/src/client/main.tsx +9 -0
  90. package/src/server/lib/fs/git-merge-conflict.test.ts +14 -1
  91. package/src/server/lib/omp/config/skill-sources.ts +49 -0
  92. package/src/server/lib/omp/config/skills-git-install.ts +155 -0
  93. package/src/server/lib/omp/config/skills-git-repo.ts +288 -0
  94. package/src/server/lib/omp/config/skills-git.test.ts +220 -0
  95. package/src/server/lib/workspace/project-model.server.test.ts +102 -0
  96. package/src/server/lib/workspace/project-model.server.ts +47 -0
  97. package/src/server/lib/workspace/project-patch.server.ts +156 -0
  98. package/src/server/routes/agent/new.ts +8 -1
  99. package/src/server/routes/settings/agents.ts +19 -7
  100. package/src/server/routes/settings/projects.ts +53 -19
  101. package/src/server/routes/settings/settings-projects-routes.test.ts +214 -0
  102. package/src/server/routes/settings/settings-store-routes.test.ts +5 -2
  103. package/src/server/routes/settings/skills-catalog-actions.ts +195 -0
  104. package/src/server/routes/settings/skills.test.ts +225 -0
  105. package/src/server/routes/settings/skills.ts +18 -15
  106. package/src/shared/lib/fs/folder-chain.test.ts +81 -1
  107. package/src/shared/lib/fs/folder-chain.ts +84 -0
  108. package/src/shared/lib/omp/config/schema.test.ts +35 -0
  109. package/src/shared/lib/omp/session/job-progress.test.ts +37 -1
  110. package/src/shared/lib/omp/session/job-progress.ts +31 -0
  111. package/src/shared/lib/omp/session/proc.ts +5 -0
  112. package/src/shared/lib/omp/session/wait.ts +5 -0
  113. package/src/shared/lib/ui/mobile-overlay.ts +61 -0
  114. package/src/shared/lib/ui/svg-scope.test.ts +97 -0
  115. package/src/shared/lib/ui/svg-scope.ts +134 -0
  116. package/src/shared/lib/workspace/project-accent.test.ts +69 -0
  117. package/src/shared/lib/workspace/project-accent.ts +63 -0
  118. package/src/shared/lib/workspace/project-icon.ts +40 -0
  119. package/src/shared/lib/workspace/project-model.test.ts +79 -0
  120. package/src/shared/lib/workspace/project-model.ts +64 -0
  121. package/src/shared/types/settings/skill.ts +53 -3
  122. package/src/test-support/file-explorer-disk.test-util.ts +25 -1
  123. package/src/test-support/file-explorer-drag.test-util.ts +88 -0
  124. package/src/test-support/file-explorer.test-util.ts +47 -47
  125. package/dist/client/static/js/index-fjnq2z2d.css +0 -1
  126. package/src/client/components/common/code-surface/indent-guide.ts +0 -104
  127. package/src/client/components/settings/categories/skill-catalog/AddSourceModal.tsx +0 -133
  128. package/src/client/hooks/desktop/servers.test.ts +0 -73
  129. package/src/client/lib/desktop/bridge.ts +0 -203
  130. package/src/shared/lib/code/editor/indent-guide-rule.test.ts +0 -65
  131. package/src/shared/lib/code/editor/indent-guide-rule.ts +0 -47
@@ -0,0 +1,167 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * A collapsed folder chain is ONE row standing for several directories, and
8
+ * that is where both reported bugs came from.
9
+ *
10
+ * `dev/src/main/code` is drawn as a single row whose `path` is the DEEPEST
11
+ * directory, so the levels inside its label are not rows at all:
12
+ *
13
+ * - **A drop** on the row landed in `code`, because that was the only path the
14
+ * row could name — dragging something onto `main` was impossible.
15
+ * - **A rename** could only address `code`, so typing `dev2/src/main` moved it
16
+ * out and left `dev/src/main` behind, and renaming `main` was unexpressible.
17
+ *
18
+ * The fix is one mechanism on both paths: the chain is UNFOLDED into a row per
19
+ * directory — on a hovering drag, or from the row's menu — after which every
20
+ * level is an ordinary folder that can be dropped on, renamed and created
21
+ * inside. These specs assert the two reported cases through a real DOM, plus
22
+ * the two halves that keep the unfold honest: Fold puts the chain back, and a
23
+ * rename that PRESERVES the chain keeps it unfolded.
24
+ */
25
+
26
+ import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
27
+ import { createFileExplorerHarness } from '@/test-support/file-explorer.test-util';
28
+
29
+ const panel = createFileExplorerHarness();
30
+
31
+ beforeAll(() => {
32
+ panel.install();
33
+ });
34
+
35
+ afterEach(() => {
36
+ panel.unmount();
37
+ });
38
+
39
+ afterAll(() => {
40
+ panel.restore();
41
+ });
42
+
43
+ /** `dev/src/main/code/a.ts`: four directories, three of them folded away. */
44
+ const CHAIN = {
45
+ '.': { dev: null },
46
+ dev: { src: null },
47
+ 'dev/src': { main: null },
48
+ 'dev/src/main': { code: null },
49
+ 'dev/src/main/code': { 'a.ts': 'file' },
50
+ } as const;
51
+
52
+ describe('Files panel collapsed chains', () => {
53
+ test('dragging onto a level inside the chain drops there, not in the deepest folder', async () => {
54
+ panel.disk = { ...structuredClone(CHAIN), '.': { dev: null, 'moved.ts': 'file' } } as never;
55
+ await panel.mount();
56
+ // One row, naming the whole chain — the levels are not rows yet.
57
+ expect(panel.visibleNames()).toContain('dev/src/main/code');
58
+
59
+ // Hovering the row unfolds it, which is what puts `main` on screen; the
60
+ // drop then lands on the row that names it.
61
+ await panel.hoverRow('moved.ts', 'dev/src/main/code');
62
+ expect(panel.visibleNames()).toContain('main');
63
+
64
+ await panel.dragRow('moved.ts', 'main');
65
+
66
+ expect(panel.transferRequests).toEqual([
67
+ {
68
+ actionType: 'paste',
69
+ sourcePath: 'moved.ts',
70
+ mode: 'cut',
71
+ targetPath: 'dev/src/main',
72
+ targetKind: 'folder',
73
+ root: '/ws',
74
+ },
75
+ ]);
76
+ });
77
+
78
+ test('the row menu unfolds the chain, so every level becomes a row', async () => {
79
+ panel.disk = structuredClone(CHAIN) as never;
80
+ await panel.mount();
81
+
82
+ await panel.rightClickRow('dev/src/main/code');
83
+ expect(panel.buttonLabels()).toContain('Unfold Folders');
84
+ await panel.clickMenuRow('Unfold Folders');
85
+
86
+ // Outermost first: each level is its own row, and the levels above the
87
+ // deepest are drawn open (a hidden row would hide the level below it).
88
+ const names = panel.visibleNames();
89
+ for (const name of ['dev', 'src', 'main', 'code']) expect(names).toContain(name);
90
+ expect(names).not.toContain('dev/src/main/code');
91
+ });
92
+
93
+ test('renaming a folder inside the chain renames THAT folder', async () => {
94
+ panel.disk = structuredClone(CHAIN) as never;
95
+ await panel.mount();
96
+
97
+ await panel.rightClickRow('dev/src/main/code');
98
+ await panel.clickMenuRow('Unfold Folders');
99
+
100
+ await panel.rightClickRow('main');
101
+ await panel.clickMenuRow('Rename');
102
+ // The field names the row's own path, which is what makes `dev2/src/main`
103
+ // mean "move `main`" rather than "move the deepest directory".
104
+ expect(panel.renameInput()?.value).toBe('dev/src/main');
105
+ await panel.submitRename('dev2/src/main');
106
+
107
+ expect(panel.renameRequests.at(-1)).toEqual({
108
+ actionType: 'rename',
109
+ path: 'dev/src/main',
110
+ newPath: 'dev2/src/main',
111
+ root: '/ws',
112
+ });
113
+ // `main` moved with everything under it; `dev` and `dev2` are now separate
114
+ // trees, which is what the paths say.
115
+ expect(panel.disk['dev2/src']).toEqual({ main: null });
116
+ expect(panel.disk['dev2/src/main']).toEqual({ code: null });
117
+ expect(panel.disk['dev2/src/main/code']).toEqual({ 'a.ts': 'file' });
118
+ });
119
+
120
+ test('renaming the chain’s start keeps it unfolded, at its new paths', async () => {
121
+ panel.disk = structuredClone(CHAIN) as never;
122
+ await panel.mount();
123
+
124
+ await panel.rightClickRow('dev/src/main/code');
125
+ await panel.clickMenuRow('Unfold Folders');
126
+ await panel.rightClickRow('dev');
127
+ await panel.clickMenuRow('Rename');
128
+ await panel.submitRename('dev2');
129
+
130
+ const names = panel.visibleNames();
131
+ expect(names).toContain('dev2');
132
+ expect(names).toContain('src');
133
+ expect(names).toContain('main');
134
+ expect(names).toContain('code');
135
+ expect(names).not.toContain('dev');
136
+ });
137
+
138
+ test('Fold Folders puts the chain back into the one row it is listed as', async () => {
139
+ panel.disk = structuredClone(CHAIN) as never;
140
+ await panel.mount();
141
+
142
+ await panel.rightClickRow('dev/src/main/code');
143
+ await panel.clickMenuRow('Unfold Folders');
144
+ await panel.rightClickRow('dev');
145
+ expect(panel.buttonLabels()).toContain('Fold Folders');
146
+ await panel.clickMenuRow('Fold Folders');
147
+
148
+ expect(panel.visibleNames()).toContain('dev/src/main/code');
149
+ expect(panel.visibleNames()).not.toContain('main');
150
+ });
151
+
152
+ test('the rename dialog says which of the two it renames', async () => {
153
+ panel.disk = structuredClone(CHAIN) as never;
154
+ await panel.mount();
155
+
156
+ await panel.rightClickRow('dev/src/main/code');
157
+ await panel.clickMenuRow('Rename');
158
+
159
+ // The row reads as four directories while the rename moves one, and only
160
+ // the dialog can say so — otherwise a path typed from the label leaves the
161
+ // rest of the chain behind.
162
+ const text = panel.documentText();
163
+ expect(text).toContain('this renames');
164
+ expect(text).toContain('dev/src/main/code');
165
+ expect(text).toContain('Unfold Folders');
166
+ });
167
+ });
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The Files panel's drag-and-drop contract, shared by the panel and the row.
8
+ *
9
+ * Split from `TreeItem.tsx` because the panel owns every one of these and each
10
+ * row only forwards them: declaring them once is what stops the two from
11
+ * drifting on which of them a nested row must be handed. The behaviour lives in
12
+ * `useFileRowDrag`; this file names what is handed down.
13
+ */
14
+
15
+ import type { ClipboardTarget } from '@/client/hooks/workspace/file-clipboard';
16
+
17
+ export interface FileTreeDragProps {
18
+ /** The row currently being dragged, or null. Panel state — see `useFileRowDrag`. */
19
+ dragging: ClipboardTarget | null;
20
+ /** A drag of this row started / ended / was dropped on `target`. */
21
+ onDragStart: (target: ClipboardTarget) => void;
22
+ onDragEnd: () => void;
23
+ onDropOn: (target: ClipboardTarget) => void;
24
+ /**
25
+ * Split a collapsed chain row into one row per directory.
26
+ *
27
+ * A chain row's label names directories that are not rows at all, so they
28
+ * cannot be dropped on or renamed. The panel calls this when a drag hovers an
29
+ * accepting row and when the row's own menu asks for it.
30
+ */
31
+ onUnfold?: (target: ClipboardTarget) => void;
32
+ /** Fold an unfolded chain back into the one row it is listed as. */
33
+ onFold?: (deepestPath: string) => void;
34
+ /**
35
+ * Outermost level of each unfolded chain → the chain's deepest path.
36
+ *
37
+ * Only the outermost level offers Fold: it is the row the listing folds, and
38
+ * the one that still reads as the chain's beginning once the levels inside it
39
+ * are drawn separately.
40
+ */
41
+ foldRoots?: ReadonlyMap<string, string>;
42
+ }
@@ -25,6 +25,12 @@
25
25
  * already lives in, or a folder into its own subtree, must not reach the
26
26
  * server: a request would be a move the user did not ask for.
27
27
  *
28
+ * 5. **The blue block belongs to the row under the POINTER, not to every legal
29
+ * target.** It was drawn from `acceptsDrop` — the capability — so a drag
30
+ * painted every folder and file on screen at once and read as "everything is
31
+ * selected" (measured: dragging `a.ts` over `b` and `c` highlighted both).
32
+ * The background's tint had the same bug, over the whole tree.
33
+ *
28
34
  * Driven through the shared harness, so this file and the listing specs exercise
29
35
  * one mount and one HTTP stub.
30
36
  */
@@ -145,4 +151,41 @@ describe('Files panel drag and drop', () => {
145
151
 
146
152
  expect(panel.dirReads).toContain('.');
147
153
  });
154
+
155
+ test('only the row under the pointer is highlighted during a drag', async () => {
156
+ panel.disk = { '.': { 'a.ts': 'file', first: null, second: null }, first: { 'x.ts': 'file' }, second: { 'y.ts': 'file' } };
157
+ await panel.mount();
158
+
159
+ await panel.hoverRow('a.ts', 'first');
160
+
161
+ // `second` would accept the drop just as well, and used to be painted.
162
+ const highlighted = [...panel.container.querySelectorAll('[class*="bg-info"]')]
163
+ .map((el) => el.textContent?.trim() ?? '');
164
+ expect(highlighted).toEqual(['first']);
165
+ });
166
+
167
+ test('the highlight leaves the row when the pointer does, and the drop still lands', async () => {
168
+ // `a.ts` lives INSIDE `dest`, so dropping it on the background is a real
169
+ // move to the root rather than the no-op the rule refuses.
170
+ panel.disk = { '.': { dest: null, other: null }, dest: { 'a.ts': 'file' }, other: {} };
171
+ await panel.mount();
172
+ await panel.clickRow('dest');
173
+
174
+ await panel.hoverRow('a.ts', 'other');
175
+ expect(panel.container.querySelectorAll('[class*="bg-info"]')).toHaveLength(1);
176
+
177
+ // Leaving the row for the background: the row's block goes out and the
178
+ // drop lands at the root, which is where the pointer is.
179
+ await panel.dropOnBackground();
180
+ expect(panel.transferRequests[0]?.targetPath).toBe('.');
181
+ });
182
+
183
+ test('the background is not tinted for the whole gesture', async () => {
184
+ panel.disk = { '.': { 'a.ts': 'file', dest: null }, dest: {} };
185
+ await panel.mount();
186
+
187
+ // The drag is in flight and no row is hovered: nothing to promise yet.
188
+ await panel.startDrag('a.ts');
189
+ expect(panel.container.querySelectorAll('[class*="bg-info"]')).toHaveLength(0);
190
+ });
148
191
  });
@@ -11,6 +11,7 @@ import { useFileListing } from '@/client/hooks/workspace/file-listing';
11
11
  import { useFileCreate } from '@/client/hooks/workspace/file-create';
12
12
  import { useFileClipboard, type ClipboardTarget } from '@/client/hooks/workspace/file-clipboard';
13
13
  import { useFileTreeEdits } from '@/client/hooks/workspace/file-tree-edits';
14
+ import { useUnfoldedChains } from '@/client/hooks/workspace/unfolded-chains';
14
15
  import { filterFileTree } from '@/client/components/workspace/file-explorer/filter';
15
16
  import { useRepoList, useRepoScope } from '@/client/hooks/workspace/repo-scope';
16
17
  import { useRealtimeTopic } from '@/client/hooks/ui/realtime';
@@ -18,6 +19,8 @@ import { useToasts } from '@/client/hooks/ui/toasts';
18
19
  import { useTouchDevice } from '@/client/hooks/ui/touch-device';
19
20
  import { ToastStack } from '@/client/components/common/ToastStack';
20
21
  import { fsTopic } from '@/shared/lib/realtime/protocol';
22
+ import { unfoldChains } from '@/shared/lib/fs/folder-chain';
23
+ import { useRootDropTarget } from '@/client/hooks/workspace/root-drop-target';
21
24
 
22
25
  export function FileExplorer({ className = '', enabled = true, rootPath, onOpenFile, refreshKey = 0, onRefresh }: { className?: string, enabled?: boolean, rootPath?: string, onOpenFile?: (file: any) => void, refreshKey?: number, onRefresh?: () => void }) {
23
26
  const [searchQuery, setSearchQuery] = useSessionState<string>('files.searchQuery', '');
@@ -117,8 +120,15 @@ export function FileExplorer({ className = '', enabled = true, rootPath, onOpenF
117
120
  setExpandedPaths,
118
121
  setStoredExpandedPaths,
119
122
  reload: refresh,
123
+ onMoved: (fromPath, toPath) => rekeyUnfold(fromPath, toPath),
120
124
  });
121
125
 
126
+ // A collapsed chain row is ONE row standing for several directories, so the
127
+ // levels inside its label have no row to drop on (a drop lands in the deepest
128
+ // directory) and no row to rename. Unfolding — on a hovering drag, or from the
129
+ // row's own menu — turns each level back into a row.
130
+ const { unfolded, unfold, fold, rekey: rekeyUnfold } = useUnfoldedChains({ scope: listing.scope, setExpandedPaths, setStoredExpandedPaths });
131
+
122
132
  // One clipboard for the whole tree, owned here and passed down: a
123
133
  // subscription per row would be hundreds of listeners for a value that
124
134
  // changes on a right-click.
@@ -156,11 +166,7 @@ export function FileExplorer({ className = '', enabled = true, rootPath, onOpenF
156
166
  */
157
167
  const [dragging, setDragging] = useState<ClipboardTarget | null>(null);
158
168
 
159
- /**
160
- * Whether the listing root may accept the drag in flight — the background is
161
- * a drop target like any other, and the rule is the same one a row uses.
162
- */
163
- const rootAcceptsDrop = Boolean(dragging) && clipboard.moveRefusalFor(dragging!, rootTarget) === null;
169
+ const root = useRootDropTarget({ dragging, clipboard, target: rootTarget });
164
170
 
165
171
  // The root's own "New File": the panel background is the one target whose
166
172
  // create belongs at the tree's top, and it is the only action the root menu
@@ -186,7 +192,8 @@ export function FileExplorer({ className = '', enabled = true, rootPath, onOpenF
186
192
 
187
193
  const tree = listing.files;
188
194
 
189
- const files = filterFileTree(tree, searchQuery);
195
+ const projected = unfoldChains(tree, unfolded);
196
+ const files = filterFileTree(projected.nodes, searchQuery);
190
197
  // The button spins for this panel's own read OR a topic push: the server
191
198
  // republishes `fs:` on every tool call, so the tree moved with nothing on
192
199
  // screen saying so otherwise.
@@ -210,7 +217,7 @@ export function FileExplorer({ className = '', enabled = true, rootPath, onOpenF
210
217
  <div
211
218
  className={`flex-1 scrollbar-overlay-container p-2 font-mono text-[11px] text-ink/80 ${
212
219
  touch ? 'file-tree-touch' : ''
213
- } ${rootAcceptsDrop ? 'bg-info/[0.06]' : ''}`}
220
+ } ${root.highlighted ? 'bg-info/[0.06]' : ''}`}
214
221
  onContextMenu={(e) => {
215
222
  // The panel's own background. A row stops propagation before this
216
223
  // runs, so this handler only ever sees a right-click that named NO
@@ -218,19 +225,10 @@ export function FileExplorer({ className = '', enabled = true, rootPath, onOpenF
218
225
  e.preventDefault();
219
226
  setRootMenu({ x: e.clientX, y: e.clientY });
220
227
  }}
221
- onDragOver={(e) => {
222
- // The background is the LISTING ROOT's drop target — the only way to
223
- // move an entry back out of a folder, since a drop on a file lands in
224
- // that file's own directory instead.
225
- if (!rootAcceptsDrop) return;
226
- e.preventDefault();
227
- if (e.dataTransfer) e.dataTransfer.dropEffect = 'move';
228
- }}
229
- onDrop={(e) => {
230
- if (!rootAcceptsDrop) return;
231
- e.preventDefault();
232
- clipboard.move(dragging!, rootTarget);
233
- }}
228
+ onDragEnter={root.onDragEnter}
229
+ onDragLeave={root.onDragLeave}
230
+ onDragOver={root.onDragOver}
231
+ onDrop={root.onDrop}
234
232
  >
235
233
  {listing.isLoading && files.length === 0 ? (
236
234
  <div className="p-4 text-center text-ink/40">
@@ -265,6 +263,9 @@ export function FileExplorer({ className = '', enabled = true, rootPath, onOpenF
265
263
  if (!dragging) return;
266
264
  clipboard.move(dragging, target);
267
265
  }}
266
+ onUnfold={unfold}
267
+ onFold={fold}
268
+ foldRoots={projected.roots}
268
269
  touch={touch}
269
270
  />
270
271
  ))
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "@oh-my-pi/pi-coding-agent 10 tabs / 574 settings",
2
+ "source": "@oh-my-pi/pi-coding-agent 10 tabs / 579 settings",
3
3
  "tabs": [
4
4
  {
5
5
  "id": "appearance",
@@ -2291,7 +2291,7 @@
2291
2291
  {
2292
2292
  "value": "ultrafast",
2293
2293
  "label": "Ultrafast",
2294
- "description": "Lowest-latency serving; OpenAI API preview access, or Codex models that advertise it"
2294
+ "description": "Lowest-latency serving; OpenAI API preview access, or Codex and relay models that advertise it"
2295
2295
  }
2296
2296
  ]
2297
2297
  }
@@ -3155,6 +3155,16 @@
3155
3155
  "description": "Store Muse Code results on Meta's servers so a turn whose connection drops is recovered instead of re-run. Stored runs keep prompts and outputs on Meta's side."
3156
3156
  }
3157
3157
  },
3158
+ "providers.openai-codex.daybreak": {
3159
+ "type": "boolean",
3160
+ "default": true,
3161
+ "ui": {
3162
+ "tab": "providers",
3163
+ "group": "Protocol",
3164
+ "label": "Codex Daybreak Blue",
3165
+ "description": "Automatically request the Daybreak Blue cyber access program on ChatGPT accounts eligible for it. OpenAI may use content from Daybreak Blue sessions to improve its models. Does not cover dedicated Daybreak Blue models (gpt-daybreak-blue-*), which may still run as Daybreak sessions."
3166
+ }
3167
+ },
3158
3168
  "providers.cacheRetention": {
3159
3169
  "type": "enum",
3160
3170
  "default": "auto",
@@ -6644,7 +6654,7 @@
6644
6654
  "tab": "tools",
6645
6655
  "group": "Execution",
6646
6656
  "label": "Live Job Widgets",
6647
- "description": "Draw a live widget for each running background job (charts, bars, status grids derived from its output) in the wait card, the jobs pill and the jobs sheet. The `widget` model role (default: `smol`) writes one spec per job; updates need no further model calls"
6657
+ "description": "Draw a live widget for each running background job (charts, bars, status grids derived from its output) in the wait card, the jobs pill and the jobs sheet, and caption long shell commands with one line on what they do. The `widget` model role (default: `smol`) writes one spec and at most one caption per job; updates need no further model calls"
6648
6658
  }
6649
6659
  },
6650
6660
  "tools.xdev": {
@@ -7343,6 +7353,50 @@
7343
7353
  "description": "Expose the optional effort parameter on task spawns, allowing callers to override each subagent's thinking level"
7344
7354
  }
7345
7355
  },
7356
+ "task.perCallModel": {
7357
+ "type": "enum",
7358
+ "default": "off",
7359
+ "values": [
7360
+ "off",
7361
+ "eval",
7362
+ "on"
7363
+ ],
7364
+ "ui": {
7365
+ "tab": "tasks",
7366
+ "group": "Subagents",
7367
+ "label": "Per-Call Model",
7368
+ "description": "Whether a subagent call may pick its model with one exact provider/model-id[@upstream][:level] selector. An @upstream pin is part of the model identity and is supported only by aggregators. Only models the configuration already routes to are accepted. Project settings can turn it off but not on, and never approve a model.",
7369
+ "options": [
7370
+ {
7371
+ "value": "off",
7372
+ "label": "Off",
7373
+ "description": "Reject `model` on task items and eval agent()/workpool()"
7374
+ },
7375
+ {
7376
+ "value": "eval",
7377
+ "label": "Eval only",
7378
+ "description": "Accept `model` in eval agent() and workpool() only"
7379
+ },
7380
+ {
7381
+ "value": "on",
7382
+ "label": "On",
7383
+ "description": "Accept `model` on task items and in eval agent()/workpool()"
7384
+ }
7385
+ ]
7386
+ }
7387
+ },
7388
+ "task.perCallModelAllow": {
7389
+ "type": "array",
7390
+ "default": [],
7391
+ "ui": {
7392
+ "tab": "tasks",
7393
+ "group": "Subagents",
7394
+ "label": "Per-Call Model Allowlist",
7395
+ "editor": "json",
7396
+ "condition": "perCallModelAllowNotProject",
7397
+ "description": "Exact selectors: `provider/model-id`, including `@upstream` only for a pinned OpenRouter/Vercel route (e.g. `openrouter/x@y`). When set, a per-call model must also be listed here. Empty: every model the configuration grants. A project list can only narrow this one."
7398
+ }
7399
+ },
7346
7400
  "task.maxConcurrency": {
7347
7401
  "type": "number",
7348
7402
  "default": 32,
@@ -7536,7 +7590,7 @@
7536
7590
  "tab": "tasks",
7537
7591
  "group": "Subagents",
7538
7592
  "label": "Maximum Per-Spawn Effort",
7539
- "description": "Maximum reasoning effort allowed for the task tool's per-spawn effort hint. Lower values prevent callers from escalating subagents above this ceiling; the default preserves the model's full range.",
7593
+ "description": "Maximum reasoning effort allowed for the task tool's per-spawn effort hint or a per-call model. An explicit `:level` is clamped to the highest supported effort at or below this ceiling, and an omitted `:level` inherits the agent's thinking level capped at this value; cold revival re-applies the cap. Unset, `:inherit` and `:off` keep their existing meaning. A per-call model must support an effort at or below this ceiling; the default preserves the model's full range.",
7540
7594
  "options": [
7541
7595
  {
7542
7596
  "value": "minimal",
@@ -7733,6 +7787,39 @@
7733
7787
  "description": "Refresh generated session titles after todo init replans unless the title was set by the user"
7734
7788
  }
7735
7789
  },
7790
+ "title.refreshAfterPrompts": {
7791
+ "type": "number",
7792
+ "default": 0,
7793
+ "ui": {
7794
+ "tab": "tasks",
7795
+ "group": "Modes",
7796
+ "label": "Refresh Title After Prompts",
7797
+ "description": "Every this many operator prompts, ask the judge model whether a generated session title still fits the conversation, and regenerate it if not",
7798
+ "options": [
7799
+ {
7800
+ "value": "0",
7801
+ "label": "Off",
7802
+ "description": "Default"
7803
+ },
7804
+ {
7805
+ "value": "1",
7806
+ "label": "Every prompt"
7807
+ },
7808
+ {
7809
+ "value": "3",
7810
+ "label": "Every 3 prompts"
7811
+ },
7812
+ {
7813
+ "value": "5",
7814
+ "label": "Every 5 prompts"
7815
+ },
7816
+ {
7817
+ "value": "10",
7818
+ "label": "Every 10 prompts"
7819
+ }
7820
+ ]
7821
+ }
7822
+ },
7736
7823
  "skills.registryUrl": {
7737
7824
  "type": "string",
7738
7825
  "default": "https://skills.omp.sh",
@@ -1,5 +1,13 @@
1
- import type { AccentColorOption, ProjectConfigItem } from '@/shared/types';
1
+ import type { ProjectConfigItem } from '@/shared/types';
2
2
 
3
+ /**
4
+ * Legacy seed rows for the one-shot migration off `omp_projects_config`.
5
+ *
6
+ * Read ONLY by `migrateLegacyProjectSettings`: when the legacy row exists but
7
+ * is not an array, that migration falls back to this list. Nothing else may
8
+ * read it — the live project list comes from the `workspace_folders` table, and
9
+ * the accent palette lives in `@/shared/lib/workspace/project-accent`.
10
+ */
3
11
  export const DEFAULT_PROJECTS_LIST: ProjectConfigItem[] = [
4
12
  { id: 'proj-workspace', name: 'Workspace', path: '/Users/rajebdev/JatisMobile/Workspace', model: 'Not selected', accentColor: '#a3e635', icon: 'default' },
5
13
  { id: 'proj-drrealhandler', name: 'drrealhandler', path: '/Users/rajebdev/JatisMobile/drrealhandler', model: 'Not selected', accentColor: '#94a3b8', icon: 'default' },
@@ -29,30 +37,3 @@ export const DEFAULT_PROJECTS_LIST: ProjectConfigItem[] = [
29
37
  { id: 'proj-ompweb', name: 'ompweb', path: '/Users/rajebdev/JatisMobile/ompweb', model: 'Not selected', accentColor: '#f43f5e', icon: 'default' },
30
38
  { id: 'proj-kabmo', name: 'kabmo', path: '/Users/rajebdev/JatisMobile/kabmo', model: 'Not selected', accentColor: '#38bdf8', icon: 'default' },
31
39
  ];
32
-
33
- export const ACCENT_COLOR_OPTIONS: AccentColorOption[] = [
34
- { label: 'None', value: '', bgHex: 'transparent' },
35
- { label: 'Sky Blue', value: '#38bdf8', bgHex: '#38bdf8' },
36
- { label: 'Light Green', value: '#a3e635', bgHex: '#a3e635' },
37
- { label: 'Coral', value: '#f87171', bgHex: '#f87171' },
38
- { label: 'Amber', value: '#fbbf24', bgHex: '#fbbf24' },
39
- { label: 'Teal', value: '#2dd4bf', bgHex: '#2dd4bf' },
40
- { label: 'Slate', value: '#94a3b8', bgHex: '#94a3b8' },
41
- { label: 'Rose', value: '#f43f5e', bgHex: '#f43f5e' },
42
- { label: 'Vivid Blue', value: '#3b82f6', bgHex: '#3b82f6' },
43
- { label: 'Lime Green', value: '#84cc16', bgHex: '#84cc16' },
44
- ];
45
-
46
- export const AVAILABLE_PROJECT_MODELS: string[] = [
47
- 'Not selected',
48
- 'DeepSeek-V3',
49
- 'DeepSeek-R1',
50
- 'Claude 3.5 Sonnet',
51
- 'Claude 3.7 Sonnet',
52
- 'GPT-4o',
53
- 'GPT-4o-mini',
54
- 'Gemini 2.5 Flash',
55
- 'Gemini 2.5 Pro',
56
- 'Qwen 2.5 Coder 32B',
57
- 'Llama 3.3 70B',
58
- ];
@@ -153,38 +153,12 @@ description: "Automated pre-flight security review, secret leak inspection, and
153
153
  ];
154
154
 
155
155
  export const DEFAULT_CATALOG_SOURCES: SkillCatalogSource[] = [
156
- {
157
- id: 'anthropic',
158
- name: 'Anthropic',
159
- repo: 'anthropics/skills',
160
- stars: '175K',
161
- updatedAt: 'Updated 3d ago',
162
- skillCount: 20,
163
- },
164
- {
165
- id: 'openai',
166
- name: 'OpenAI',
167
- repo: 'openai/skills',
168
- stars: '26K',
169
- updatedAt: 'Updated 7w ago',
170
- skillCount: 14,
171
- },
172
- {
173
- id: 'cursor',
174
- name: 'Cursor',
175
- repo: 'cursor/plugins',
176
- stars: '7K',
177
- updatedAt: 'Updated 2d ago',
178
- skillCount: 18,
179
- },
180
- {
181
- id: 'matt-pocock',
182
- name: 'Matt Pocock',
183
- repo: 'mattpocock/skills',
184
- stars: '255K',
185
- updatedAt: 'Updated 2d ago',
186
- skillCount: 12,
187
- },
156
+ // `skillCount: null` — these counts are NOT known until a scan runs, and the
157
+ // card says "Not scanned" rather than printing an invented number.
158
+ { id: 'anthropic', name: 'Anthropic', repo: 'anthropics/skills', skillCount: null },
159
+ { id: 'openai', name: 'OpenAI', repo: 'openai/skills', skillCount: null },
160
+ { id: 'cursor', name: 'Cursor', repo: 'cursor/plugins', skillCount: null },
161
+ { id: 'matt-pocock', name: 'Matt Pocock', repo: 'mattpocock/skills', skillCount: null },
188
162
  ];
189
163
 
190
164
  export const DEFAULT_CATALOG_SKILLS: CatalogSkillItem[] = [
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The model a PENDING chat will start on.
8
+ *
9
+ * The composer on a `new-…` chat has no session to read a model from, so its
10
+ * pill showed Kabmo's registry default while `POST /api/agent/new` applies the
11
+ * workspace's own default first. The two disagreed for exactly the project the
12
+ * user had configured a default for. This resolves the same value the spawn
13
+ * does, from the folder row the composer is bound to.
14
+ */
15
+
16
+ import { useMemo } from 'preact/hooks';
17
+ import type { SelectedModel, WorkspaceFolderData } from '@/shared/types';
18
+ import { parseProjectModel } from '@/shared/lib/workspace/project-model';
19
+
20
+ export function usePendingProjectModel(
21
+ folders: WorkspaceFolderData[],
22
+ selectedFolderId: number | null,
23
+ ): SelectedModel | null {
24
+ return useMemo(() => {
25
+ const folder = folders.find((row) => String(row.id) === String(selectedFolderId));
26
+ return parseProjectModel(folder?.model);
27
+ }, [folders, selectedFolderId]);
28
+ }