sh3-core 0.6.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 (242) hide show
  1. package/README.md +9 -0
  2. package/dist/Shell.svelte +283 -0
  3. package/dist/Shell.svelte.d.ts +5 -0
  4. package/dist/api.d.ts +28 -0
  5. package/dist/api.js +50 -0
  6. package/dist/app/admin/ApiKeysView.svelte +169 -0
  7. package/dist/app/admin/ApiKeysView.svelte.d.ts +3 -0
  8. package/dist/app/admin/AuthSettingsView.svelte +105 -0
  9. package/dist/app/admin/AuthSettingsView.svelte.d.ts +3 -0
  10. package/dist/app/admin/SystemView.svelte +73 -0
  11. package/dist/app/admin/SystemView.svelte.d.ts +3 -0
  12. package/dist/app/admin/UsersView.svelte +188 -0
  13. package/dist/app/admin/UsersView.svelte.d.ts +3 -0
  14. package/dist/app/admin/adminApp.d.ts +7 -0
  15. package/dist/app/admin/adminApp.js +25 -0
  16. package/dist/app/admin/adminShard.svelte.d.ts +4 -0
  17. package/dist/app/admin/adminShard.svelte.js +62 -0
  18. package/dist/app/store/InstalledView.svelte +246 -0
  19. package/dist/app/store/InstalledView.svelte.d.ts +3 -0
  20. package/dist/app/store/StoreView.svelte +522 -0
  21. package/dist/app/store/StoreView.svelte.d.ts +3 -0
  22. package/dist/app/store/storeApp.d.ts +10 -0
  23. package/dist/app/store/storeApp.js +26 -0
  24. package/dist/app/store/storeShard.svelte.d.ts +38 -0
  25. package/dist/app/store/storeShard.svelte.js +218 -0
  26. package/dist/apps/lifecycle.d.ts +42 -0
  27. package/dist/apps/lifecycle.js +184 -0
  28. package/dist/apps/registry.svelte.d.ts +40 -0
  29. package/dist/apps/registry.svelte.js +59 -0
  30. package/dist/apps/terminal/manifest.d.ts +8 -0
  31. package/dist/apps/terminal/manifest.js +13 -0
  32. package/dist/apps/terminal/terminal-app.d.ts +7 -0
  33. package/dist/apps/terminal/terminal-app.js +14 -0
  34. package/dist/apps/types.d.ts +93 -0
  35. package/dist/apps/types.js +10 -0
  36. package/dist/artifact.d.ts +32 -0
  37. package/dist/artifact.js +1 -0
  38. package/dist/assets/SH3.png +0 -0
  39. package/dist/assets/icons.svg +1126 -0
  40. package/dist/assets.d.ts +13 -0
  41. package/dist/auth/GuestBanner.svelte +134 -0
  42. package/dist/auth/GuestBanner.svelte.d.ts +3 -0
  43. package/dist/auth/SignInWall.svelte +203 -0
  44. package/dist/auth/SignInWall.svelte.d.ts +7 -0
  45. package/dist/auth/auth.svelte.d.ts +69 -0
  46. package/dist/auth/auth.svelte.js +165 -0
  47. package/dist/auth/index.d.ts +2 -0
  48. package/dist/auth/index.js +1 -0
  49. package/dist/auth/types.d.ts +41 -0
  50. package/dist/auth/types.js +6 -0
  51. package/dist/build.d.ts +49 -0
  52. package/dist/build.js +236 -0
  53. package/dist/contract.d.ts +20 -0
  54. package/dist/contract.js +28 -0
  55. package/dist/createShell.d.ts +24 -0
  56. package/dist/createShell.js +131 -0
  57. package/dist/documents/backends.d.ts +17 -0
  58. package/dist/documents/backends.js +156 -0
  59. package/dist/documents/config.d.ts +7 -0
  60. package/dist/documents/config.js +27 -0
  61. package/dist/documents/handle.d.ts +6 -0
  62. package/dist/documents/handle.js +154 -0
  63. package/dist/documents/http-backend.d.ts +22 -0
  64. package/dist/documents/http-backend.js +78 -0
  65. package/dist/documents/index.d.ts +6 -0
  66. package/dist/documents/index.js +8 -0
  67. package/dist/documents/notifications.d.ts +9 -0
  68. package/dist/documents/notifications.js +39 -0
  69. package/dist/documents/types.d.ts +97 -0
  70. package/dist/documents/types.js +12 -0
  71. package/dist/env/client.d.ts +44 -0
  72. package/dist/env/client.js +106 -0
  73. package/dist/env/index.d.ts +2 -0
  74. package/dist/env/index.js +1 -0
  75. package/dist/env/types.d.ts +12 -0
  76. package/dist/env/types.js +8 -0
  77. package/dist/host-entry.d.ts +13 -0
  78. package/dist/host-entry.js +17 -0
  79. package/dist/host.d.ts +15 -0
  80. package/dist/host.js +86 -0
  81. package/dist/index.d.ts +4 -0
  82. package/dist/index.js +14 -0
  83. package/dist/layout/DragPreview.svelte +63 -0
  84. package/dist/layout/DragPreview.svelte.d.ts +3 -0
  85. package/dist/layout/LayoutRenderer.svelte +262 -0
  86. package/dist/layout/LayoutRenderer.svelte.d.ts +6 -0
  87. package/dist/layout/SlotContainer.svelte +140 -0
  88. package/dist/layout/SlotContainer.svelte.d.ts +8 -0
  89. package/dist/layout/SlotDropZone.svelte +122 -0
  90. package/dist/layout/SlotDropZone.svelte.d.ts +8 -0
  91. package/dist/layout/drag.svelte.d.ts +45 -0
  92. package/dist/layout/drag.svelte.js +200 -0
  93. package/dist/layout/inspection.d.ts +72 -0
  94. package/dist/layout/inspection.js +209 -0
  95. package/dist/layout/ops.d.ts +100 -0
  96. package/dist/layout/ops.js +310 -0
  97. package/dist/layout/slotHostPool.svelte.d.ts +36 -0
  98. package/dist/layout/slotHostPool.svelte.js +229 -0
  99. package/dist/layout/store.svelte.d.ts +39 -0
  100. package/dist/layout/store.svelte.js +153 -0
  101. package/dist/layout/tree-walk.d.ts +15 -0
  102. package/dist/layout/tree-walk.js +33 -0
  103. package/dist/layout/types.d.ts +108 -0
  104. package/dist/layout/types.js +25 -0
  105. package/dist/migrations/shell-rename.d.ts +16 -0
  106. package/dist/migrations/shell-rename.js +48 -0
  107. package/dist/overlays/ModalFrame.svelte +87 -0
  108. package/dist/overlays/ModalFrame.svelte.d.ts +10 -0
  109. package/dist/overlays/PopupFrame.svelte +85 -0
  110. package/dist/overlays/PopupFrame.svelte.d.ts +10 -0
  111. package/dist/overlays/ToastItem.svelte +77 -0
  112. package/dist/overlays/ToastItem.svelte.d.ts +9 -0
  113. package/dist/overlays/focusTrap.d.ts +1 -0
  114. package/dist/overlays/focusTrap.js +64 -0
  115. package/dist/overlays/modal.d.ts +9 -0
  116. package/dist/overlays/modal.js +141 -0
  117. package/dist/overlays/popup.d.ts +9 -0
  118. package/dist/overlays/popup.js +108 -0
  119. package/dist/overlays/roots.d.ts +4 -0
  120. package/dist/overlays/roots.js +31 -0
  121. package/dist/overlays/toast.d.ts +6 -0
  122. package/dist/overlays/toast.js +93 -0
  123. package/dist/overlays/types.d.ts +31 -0
  124. package/dist/overlays/types.js +15 -0
  125. package/dist/platform/index.d.ts +10 -0
  126. package/dist/platform/index.js +33 -0
  127. package/dist/platform/tauri-backend.d.ts +15 -0
  128. package/dist/platform/tauri-backend.js +58 -0
  129. package/dist/primitives/.gitkeep +0 -0
  130. package/dist/primitives/ResizableSplitter.svelte +333 -0
  131. package/dist/primitives/ResizableSplitter.svelte.d.ts +35 -0
  132. package/dist/primitives/TabbedPanel.svelte +305 -0
  133. package/dist/primitives/TabbedPanel.svelte.d.ts +50 -0
  134. package/dist/primitives/base.css +42 -0
  135. package/dist/registry/client.d.ts +74 -0
  136. package/dist/registry/client.js +117 -0
  137. package/dist/registry/index.d.ts +13 -0
  138. package/dist/registry/index.js +14 -0
  139. package/dist/registry/installer.d.ts +53 -0
  140. package/dist/registry/installer.js +168 -0
  141. package/dist/registry/integrity.d.ts +32 -0
  142. package/dist/registry/integrity.js +92 -0
  143. package/dist/registry/loader.d.ts +50 -0
  144. package/dist/registry/loader.js +145 -0
  145. package/dist/registry/schema.d.ts +47 -0
  146. package/dist/registry/schema.js +185 -0
  147. package/dist/registry/storage.d.ts +37 -0
  148. package/dist/registry/storage.js +101 -0
  149. package/dist/registry/types.d.ts +262 -0
  150. package/dist/registry/types.js +14 -0
  151. package/dist/server-shard/types.d.ts +67 -0
  152. package/dist/server-shard/types.js +13 -0
  153. package/dist/sh3core-shard/ShellHome.svelte +192 -0
  154. package/dist/sh3core-shard/ShellHome.svelte.d.ts +3 -0
  155. package/dist/sh3core-shard/ShellTitle.svelte +171 -0
  156. package/dist/sh3core-shard/ShellTitle.svelte.d.ts +3 -0
  157. package/dist/sh3core-shard/sh3coreShard.svelte.d.ts +2 -0
  158. package/dist/sh3core-shard/sh3coreShard.svelte.js +53 -0
  159. package/dist/shards/activate.svelte.d.ts +52 -0
  160. package/dist/shards/activate.svelte.js +186 -0
  161. package/dist/shards/registry.d.ts +4 -0
  162. package/dist/shards/registry.js +28 -0
  163. package/dist/shards/types.d.ts +207 -0
  164. package/dist/shards/types.js +20 -0
  165. package/dist/shell-shard/InputLine.svelte +133 -0
  166. package/dist/shell-shard/InputLine.svelte.d.ts +11 -0
  167. package/dist/shell-shard/ScrollbackView.svelte +47 -0
  168. package/dist/shell-shard/ScrollbackView.svelte.d.ts +7 -0
  169. package/dist/shell-shard/Terminal.svelte +122 -0
  170. package/dist/shell-shard/Terminal.svelte.d.ts +8 -0
  171. package/dist/shell-shard/entries/PromptEntry.svelte +25 -0
  172. package/dist/shell-shard/entries/PromptEntry.svelte.d.ts +7 -0
  173. package/dist/shell-shard/entries/RichEntry.svelte +19 -0
  174. package/dist/shell-shard/entries/RichEntry.svelte.d.ts +8 -0
  175. package/dist/shell-shard/entries/StatusEntry.svelte +22 -0
  176. package/dist/shell-shard/entries/StatusEntry.svelte.d.ts +7 -0
  177. package/dist/shell-shard/entries/TextEntry.svelte +25 -0
  178. package/dist/shell-shard/entries/TextEntry.svelte.d.ts +7 -0
  179. package/dist/shell-shard/manifest.d.ts +2 -0
  180. package/dist/shell-shard/manifest.js +11 -0
  181. package/dist/shell-shard/protocol.d.ts +90 -0
  182. package/dist/shell-shard/protocol.js +11 -0
  183. package/dist/shell-shard/registry.d.ts +69 -0
  184. package/dist/shell-shard/registry.js +47 -0
  185. package/dist/shell-shard/rich/AppCard.svelte +25 -0
  186. package/dist/shell-shard/rich/AppCard.svelte.d.ts +10 -0
  187. package/dist/shell-shard/rich/AppsTable.svelte +29 -0
  188. package/dist/shell-shard/rich/AppsTable.svelte.d.ts +12 -0
  189. package/dist/shell-shard/rich/EnvTable.svelte +27 -0
  190. package/dist/shell-shard/rich/EnvTable.svelte.d.ts +8 -0
  191. package/dist/shell-shard/rich/HelpTable.svelte +29 -0
  192. package/dist/shell-shard/rich/HelpTable.svelte.d.ts +12 -0
  193. package/dist/shell-shard/rich/HistoryList.svelte +37 -0
  194. package/dist/shell-shard/rich/HistoryList.svelte.d.ts +9 -0
  195. package/dist/shell-shard/rich/ShardsTable.svelte +28 -0
  196. package/dist/shell-shard/rich/ShardsTable.svelte.d.ts +12 -0
  197. package/dist/shell-shard/rich/ViewsTable.svelte +31 -0
  198. package/dist/shell-shard/rich/ViewsTable.svelte.d.ts +13 -0
  199. package/dist/shell-shard/rich/ZoneTree.svelte +19 -0
  200. package/dist/shell-shard/rich/ZoneTree.svelte.d.ts +8 -0
  201. package/dist/shell-shard/rich/ZonesTable.svelte +27 -0
  202. package/dist/shell-shard/rich/ZonesTable.svelte.d.ts +11 -0
  203. package/dist/shell-shard/scrollback.svelte.d.ts +36 -0
  204. package/dist/shell-shard/scrollback.svelte.js +43 -0
  205. package/dist/shell-shard/session-client.svelte.d.ts +23 -0
  206. package/dist/shell-shard/session-client.svelte.js +120 -0
  207. package/dist/shell-shard/shellShard.svelte.d.ts +2 -0
  208. package/dist/shell-shard/shellShard.svelte.js +139 -0
  209. package/dist/shell-shard/verbs/apps.d.ts +3 -0
  210. package/dist/shell-shard/verbs/apps.js +50 -0
  211. package/dist/shell-shard/verbs/clear.d.ts +2 -0
  212. package/dist/shell-shard/verbs/clear.js +7 -0
  213. package/dist/shell-shard/verbs/help.d.ts +2 -0
  214. package/dist/shell-shard/verbs/help.js +21 -0
  215. package/dist/shell-shard/verbs/history.d.ts +2 -0
  216. package/dist/shell-shard/verbs/history.js +20 -0
  217. package/dist/shell-shard/verbs/index.d.ts +2 -0
  218. package/dist/shell-shard/verbs/index.js +29 -0
  219. package/dist/shell-shard/verbs/session.d.ts +5 -0
  220. package/dist/shell-shard/verbs/session.js +65 -0
  221. package/dist/shell-shard/verbs/shards.d.ts +2 -0
  222. package/dist/shell-shard/verbs/shards.js +14 -0
  223. package/dist/shell-shard/verbs/views.d.ts +4 -0
  224. package/dist/shell-shard/verbs/views.js +90 -0
  225. package/dist/shell-shard/verbs/zones.d.ts +3 -0
  226. package/dist/shell-shard/verbs/zones.js +38 -0
  227. package/dist/shellRuntime.svelte.d.ts +27 -0
  228. package/dist/shellRuntime.svelte.js +27 -0
  229. package/dist/state/backends.d.ts +26 -0
  230. package/dist/state/backends.js +99 -0
  231. package/dist/state/manage.d.ts +14 -0
  232. package/dist/state/manage.js +40 -0
  233. package/dist/state/types.d.ts +55 -0
  234. package/dist/state/types.js +17 -0
  235. package/dist/state/zones.svelte.d.ts +53 -0
  236. package/dist/state/zones.svelte.js +141 -0
  237. package/dist/theme.d.ts +28 -0
  238. package/dist/theme.js +92 -0
  239. package/dist/tokens.css +102 -0
  240. package/dist/version.d.ts +2 -0
  241. package/dist/version.js +2 -0
  242. package/package.json +60 -0
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ stream: 'stdout' | 'stderr';
4
+ chunks: string[];
5
+ }
6
+ let { stream, chunks }: Props = $props();
7
+
8
+ // v1: strip ANSI escapes; render plain text. ANSI-to-HTML is deferred.
9
+ const ANSI_RE = /\x1b\[[0-9;?]*[ -/]*[@-~]/g;
10
+ const text = $derived(chunks.join('').replace(ANSI_RE, ''));
11
+ </script>
12
+
13
+ <pre class="shell-text" class:stderr={stream === 'stderr'}>{text}</pre>
14
+
15
+ <style>
16
+ .shell-text {
17
+ margin: 0;
18
+ padding: 0 8px;
19
+ font-family: var(--shell-font-mono, monospace);
20
+ white-space: pre-wrap;
21
+ word-break: break-word;
22
+ color: var(--shell-fg, #ddd);
23
+ }
24
+ .shell-text.stderr { color: var(--shell-fg-error, #f88); }
25
+ </style>
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ stream: 'stdout' | 'stderr';
3
+ chunks: string[];
4
+ }
5
+ declare const TextEntry: import("svelte").Component<Props, {}, "">;
6
+ type TextEntry = ReturnType<typeof TextEntry>;
7
+ export default TextEntry;
@@ -0,0 +1,2 @@
1
+ import type { ShardManifest } from '../api';
2
+ export declare const manifest: ShardManifest;
@@ -0,0 +1,11 @@
1
+ export const manifest = {
2
+ id: 'shell',
3
+ label: 'Shell',
4
+ version: '0.1.0',
5
+ views: [{ id: 'shell:terminal', label: 'Shell' }],
6
+ // serverBundle intentionally omitted — this shard is a framework built-in
7
+ // and is statically mounted at sh3-server boot. The existing contract in
8
+ // sh3-core/src/shards/types.ts documents that framework-shipped shards do
9
+ // not use this field.
10
+ permissions: [],
11
+ };
@@ -0,0 +1,90 @@
1
+ export declare const PROTOCOL_VERSION: 1;
2
+ export type ClientMessage =
3
+ /** Sent on WS open. Optional cursor for replay resume after a reconnect. */
4
+ {
5
+ t: 'hello';
6
+ replayFrom?: number;
7
+ }
8
+ /** A line the client could not resolve locally. */
9
+ | {
10
+ t: 'submit';
11
+ line: string;
12
+ }
13
+ /** Ctrl+C / Ctrl+D while a process runs. */
14
+ | {
15
+ t: 'signal';
16
+ sig: 'SIGINT' | 'EOF';
17
+ }
18
+ /** Local verb dispatch — tell the server to append to shared history. */
19
+ | {
20
+ t: 'history-log';
21
+ line: string;
22
+ }
23
+ /** Ask the server for its current cwd. */
24
+ | {
25
+ t: 'cwd-query';
26
+ };
27
+ export type ServerMessage =
28
+ /** Sent once on successful attach, immediately after hello. */
29
+ {
30
+ t: 'welcome';
31
+ userId: string;
32
+ cwd: string;
33
+ env: Record<string, string>;
34
+ seq: number;
35
+ }
36
+ /** Recent ring contents, sent after welcome (or on explicit replayFrom). */
37
+ | {
38
+ t: 'replay';
39
+ events: ServerEvent[];
40
+ }
41
+ /** Persisted history for up-arrow navigation. */
42
+ | {
43
+ t: 'history';
44
+ lines: string[];
45
+ }
46
+ /** Live event. */
47
+ | {
48
+ t: 'event';
49
+ event: ServerEvent;
50
+ }
51
+ /** Proactive cwd update after a successful cd. */
52
+ | {
53
+ t: 'cwd';
54
+ cwd: string;
55
+ }
56
+ /** Protocol-level error — not the same as a stderr event. */
57
+ | {
58
+ t: 'error';
59
+ message: string;
60
+ code?: string;
61
+ };
62
+ export type ServerEvent = {
63
+ seq: number;
64
+ kind: 'prompt';
65
+ line: string;
66
+ cwd: string;
67
+ ts: number;
68
+ } | {
69
+ seq: number;
70
+ kind: 'stdout';
71
+ data: string;
72
+ ts: number;
73
+ } | {
74
+ seq: number;
75
+ kind: 'stderr';
76
+ data: string;
77
+ ts: number;
78
+ } | {
79
+ seq: number;
80
+ kind: 'exit';
81
+ code: number | null;
82
+ signal: string | null;
83
+ ts: number;
84
+ } | {
85
+ seq: number;
86
+ kind: 'status';
87
+ text: string;
88
+ level: 'info' | 'warn' | 'error';
89
+ ts: number;
90
+ };
@@ -0,0 +1,11 @@
1
+ /*
2
+ * shell-shard WebSocket protocol.
3
+ *
4
+ * Shared by the sh3-core client half (`src/shell-shard/`) and the
5
+ * sh3-server server half (`packages/sh3-server/src/shell-shard/`). Type-
6
+ * only module — no runtime imports, safe to load from either side.
7
+ *
8
+ * See docs/superpowers/specs/2026-04-10-shell-shard-design.md § WebSocket
9
+ * protocol for the authoritative description.
10
+ */
11
+ export const PROTOCOL_VERSION = 1;
@@ -0,0 +1,69 @@
1
+ import type { Scrollback } from './scrollback.svelte';
2
+ import type { SessionClient } from './session-client.svelte';
3
+ export interface ShellApi {
4
+ listApps(): Array<{
5
+ id: string;
6
+ label: string;
7
+ }>;
8
+ getActiveApp(): {
9
+ id: string;
10
+ label: string;
11
+ } | null;
12
+ launchApp(id: string): void;
13
+ listShards(): Array<{
14
+ id: string;
15
+ label: string;
16
+ version: string;
17
+ }>;
18
+ listViewsInCurrentLayout(): Array<{
19
+ slotId: string;
20
+ viewId: string;
21
+ label: string;
22
+ }>;
23
+ openViewInCurrentLayout(viewId: string): {
24
+ ok: boolean;
25
+ error?: string;
26
+ };
27
+ closeSlot(slotId: string): {
28
+ ok: boolean;
29
+ error?: string;
30
+ };
31
+ listZones(shardId?: string): Array<{
32
+ shardId: string;
33
+ zones: string[];
34
+ }>;
35
+ readZone(shardId: string, zoneName: string): unknown;
36
+ whoAmI(): {
37
+ userId: string;
38
+ admin: boolean;
39
+ };
40
+ }
41
+ export interface VerbContext {
42
+ shell: ShellApi;
43
+ scrollback: Scrollback;
44
+ session: SessionClient;
45
+ cwd: string;
46
+ /** Invoke another registered verb programmatically (used by rich-entry clicks). */
47
+ dispatch(line: string): Promise<void>;
48
+ }
49
+ export interface Verb {
50
+ name: string;
51
+ summary: string;
52
+ run(ctx: VerbContext, args: string[]): Promise<void>;
53
+ }
54
+ export type Resolution = {
55
+ kind: 'local';
56
+ verb: Verb;
57
+ args: string[];
58
+ line: string;
59
+ } | {
60
+ kind: 'forward';
61
+ line: string;
62
+ };
63
+ export declare class VerbRegistry {
64
+ private readonly verbs;
65
+ register(verb: Verb): void;
66
+ list(): Verb[];
67
+ get(name: string): Verb | undefined;
68
+ resolve(line: string): Resolution;
69
+ }
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Verb registry for shell-shard.
3
+ *
4
+ * v1 is internal to shell-shard (not a contribution kind). Holds a map of
5
+ * verb name → Verb definition. Resolution:
6
+ * 1. If first token matches a registered verb → { kind: 'local', verb, args }
7
+ * 2. If first token is '$' → { kind: 'forward', line: rest } (escape hatch)
8
+ * 3. Otherwise → { kind: 'forward', line } (unknown, ship to server)
9
+ *
10
+ * Future: other shards register verbs via a new contribution kind.
11
+ */
12
+ export class VerbRegistry {
13
+ constructor() {
14
+ this.verbs = new Map();
15
+ }
16
+ register(verb) {
17
+ this.verbs.set(verb.name, verb);
18
+ }
19
+ list() {
20
+ return Array.from(this.verbs.values()).sort((a, b) => a.name.localeCompare(b.name));
21
+ }
22
+ get(name) {
23
+ return this.verbs.get(name);
24
+ }
25
+ resolve(line) {
26
+ const trimmed = line.trim();
27
+ if (!trimmed)
28
+ return { kind: 'forward', line };
29
+ // Escape hatch: '$ <rest>' always forwards
30
+ if (trimmed.startsWith('$ ')) {
31
+ return { kind: 'forward', line: trimmed.slice(2) };
32
+ }
33
+ if (trimmed === '$') {
34
+ return { kind: 'forward', line: '' };
35
+ }
36
+ // First whitespace-separated token
37
+ const space = trimmed.indexOf(' ');
38
+ const head = space === -1 ? trimmed : trimmed.slice(0, space);
39
+ const rest = space === -1 ? '' : trimmed.slice(space + 1);
40
+ const verb = this.verbs.get(head);
41
+ if (!verb)
42
+ return { kind: 'forward', line };
43
+ // Simple space-split for args — verbs can re-tokenize if they need quoting
44
+ const args = rest.length ? rest.split(/\s+/) : [];
45
+ return { kind: 'local', verb, args, line };
46
+ }
47
+ }
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ data: { id: string; label: string; shards: string[] };
4
+ }
5
+ let { data }: Props = $props();
6
+ </script>
7
+
8
+ <div class="shell-rich-appcard">
9
+ <h3>{data.label}</h3>
10
+ <p><strong>ID:</strong> {data.id}</p>
11
+ <p><strong>Shards:</strong> {data.shards.join(', ')}</p>
12
+ </div>
13
+
14
+ <style>
15
+ .shell-rich-appcard {
16
+ padding: 8px;
17
+ border: 1px solid var(--shell-border, #444);
18
+ }
19
+ .shell-rich-appcard h3 {
20
+ margin: 0 0 8px 0;
21
+ }
22
+ .shell-rich-appcard p {
23
+ margin: 4px 0;
24
+ }
25
+ </style>
@@ -0,0 +1,10 @@
1
+ interface Props {
2
+ data: {
3
+ id: string;
4
+ label: string;
5
+ shards: string[];
6
+ };
7
+ }
8
+ declare const AppCard: import("svelte").Component<Props, {}, "">;
9
+ type AppCard = ReturnType<typeof AppCard>;
10
+ export default AppCard;
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ data: { apps: Array<{ id: string; label: string }>; onClickApp: (id: string) => void };
4
+ }
5
+ let { data }: Props = $props();
6
+ </script>
7
+
8
+ <div class="shell-rich-apps">
9
+ <table>
10
+ <thead>
11
+ <tr><th>ID</th><th>Label</th></tr>
12
+ </thead>
13
+ <tbody>
14
+ {#each data.apps as app (app.id)}
15
+ <tr>
16
+ <td><button type="button" onclick={() => data.onClickApp(app.id)}>{app.id}</button></td>
17
+ <td>{app.label}</td>
18
+ </tr>
19
+ {/each}
20
+ </tbody>
21
+ </table>
22
+ </div>
23
+
24
+ <style>
25
+ .shell-rich-apps table { border-collapse: collapse; width: 100%; }
26
+ .shell-rich-apps th, .shell-rich-apps td { padding: 2px 8px; text-align: left; }
27
+ .shell-rich-apps button { background: none; border: 0; color: var(--shell-link, #6cf); cursor: pointer; padding: 0; font: inherit; }
28
+ .shell-rich-apps button:hover { text-decoration: underline; }
29
+ </style>
@@ -0,0 +1,12 @@
1
+ interface Props {
2
+ data: {
3
+ apps: Array<{
4
+ id: string;
5
+ label: string;
6
+ }>;
7
+ onClickApp: (id: string) => void;
8
+ };
9
+ }
10
+ declare const AppsTable: import("svelte").Component<Props, {}, "">;
11
+ type AppsTable = ReturnType<typeof AppsTable>;
12
+ export default AppsTable;
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ data: { env: Record<string, string> };
4
+ }
5
+ let { data }: Props = $props();
6
+ </script>
7
+
8
+ <div class="shell-rich-env">
9
+ <table>
10
+ <thead>
11
+ <tr><th>Key</th><th>Value</th></tr>
12
+ </thead>
13
+ <tbody>
14
+ {#each Object.entries(data.env) as [key, value] (key)}
15
+ <tr>
16
+ <td>{key}</td>
17
+ <td>{value}</td>
18
+ </tr>
19
+ {/each}
20
+ </tbody>
21
+ </table>
22
+ </div>
23
+
24
+ <style>
25
+ .shell-rich-env table { border-collapse: collapse; width: 100%; }
26
+ .shell-rich-env th, .shell-rich-env td { padding: 2px 8px; text-align: left; }
27
+ </style>
@@ -0,0 +1,8 @@
1
+ interface Props {
2
+ data: {
3
+ env: Record<string, string>;
4
+ };
5
+ }
6
+ declare const EnvTable: import("svelte").Component<Props, {}, "">;
7
+ type EnvTable = ReturnType<typeof EnvTable>;
8
+ export default EnvTable;
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ data: { rows: Array<{ name: string; summary: string }>; onClickName: (name: string) => void };
4
+ }
5
+ let { data }: Props = $props();
6
+ </script>
7
+
8
+ <div class="shell-rich-help">
9
+ <table>
10
+ <thead>
11
+ <tr><th>Name</th><th>Summary</th></tr>
12
+ </thead>
13
+ <tbody>
14
+ {#each data.rows as row (row.name)}
15
+ <tr>
16
+ <td><button type="button" onclick={() => data.onClickName(row.name)}>{row.name}</button></td>
17
+ <td>{row.summary}</td>
18
+ </tr>
19
+ {/each}
20
+ </tbody>
21
+ </table>
22
+ </div>
23
+
24
+ <style>
25
+ .shell-rich-help table { border-collapse: collapse; width: 100%; }
26
+ .shell-rich-help th, .shell-rich-help td { padding: 2px 8px; text-align: left; }
27
+ .shell-rich-help button { background: none; border: 0; color: var(--shell-link, #6cf); cursor: pointer; padding: 0; font: inherit; }
28
+ .shell-rich-help button:hover { text-decoration: underline; }
29
+ </style>
@@ -0,0 +1,12 @@
1
+ interface Props {
2
+ data: {
3
+ rows: Array<{
4
+ name: string;
5
+ summary: string;
6
+ }>;
7
+ onClickName: (name: string) => void;
8
+ };
9
+ }
10
+ declare const HelpTable: import("svelte").Component<Props, {}, "">;
11
+ type HelpTable = ReturnType<typeof HelpTable>;
12
+ export default HelpTable;
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ data: { lines: string[]; onClickLine: (line: string) => void };
4
+ }
5
+ let { data }: Props = $props();
6
+ </script>
7
+
8
+ <div class="shell-rich-history">
9
+ <ol>
10
+ {#each data.lines as line, i (i)}
11
+ <li><button type="button" onclick={() => data.onClickLine(line)}>{line}</button></li>
12
+ {/each}
13
+ </ol>
14
+ </div>
15
+
16
+ <style>
17
+ .shell-rich-history ol {
18
+ list-style-position: inside;
19
+ margin: 0;
20
+ padding: 0;
21
+ }
22
+ .shell-rich-history li {
23
+ padding: 2px 0;
24
+ }
25
+ .shell-rich-history button {
26
+ background: none;
27
+ border: 0;
28
+ color: var(--shell-link, #6cf);
29
+ cursor: pointer;
30
+ padding: 0;
31
+ font: inherit;
32
+ text-align: left;
33
+ }
34
+ .shell-rich-history button:hover {
35
+ text-decoration: underline;
36
+ }
37
+ </style>
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ data: {
3
+ lines: string[];
4
+ onClickLine: (line: string) => void;
5
+ };
6
+ }
7
+ declare const HistoryList: import("svelte").Component<Props, {}, "">;
8
+ type HistoryList = ReturnType<typeof HistoryList>;
9
+ export default HistoryList;
@@ -0,0 +1,28 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ data: { shards: Array<{ id: string; label: string; version: string }> };
4
+ }
5
+ let { data }: Props = $props();
6
+ </script>
7
+
8
+ <div class="shell-rich-shards">
9
+ <table>
10
+ <thead>
11
+ <tr><th>ID</th><th>Label</th><th>Version</th></tr>
12
+ </thead>
13
+ <tbody>
14
+ {#each data.shards as shard (shard.id)}
15
+ <tr>
16
+ <td>{shard.id}</td>
17
+ <td>{shard.label}</td>
18
+ <td>{shard.version}</td>
19
+ </tr>
20
+ {/each}
21
+ </tbody>
22
+ </table>
23
+ </div>
24
+
25
+ <style>
26
+ .shell-rich-shards table { border-collapse: collapse; width: 100%; }
27
+ .shell-rich-shards th, .shell-rich-shards td { padding: 2px 8px; text-align: left; }
28
+ </style>
@@ -0,0 +1,12 @@
1
+ interface Props {
2
+ data: {
3
+ shards: Array<{
4
+ id: string;
5
+ label: string;
6
+ version: string;
7
+ }>;
8
+ };
9
+ }
10
+ declare const ShardsTable: import("svelte").Component<Props, {}, "">;
11
+ type ShardsTable = ReturnType<typeof ShardsTable>;
12
+ export default ShardsTable;
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ data: { views: Array<{ slotId: string; viewId: string; label: string }>; onClose: (slotId: string) => void };
4
+ }
5
+ let { data }: Props = $props();
6
+ </script>
7
+
8
+ <div class="shell-rich-views">
9
+ <table>
10
+ <thead>
11
+ <tr><th>Slot ID</th><th>View ID</th><th>Label</th><th>Action</th></tr>
12
+ </thead>
13
+ <tbody>
14
+ {#each data.views as view (view.slotId)}
15
+ <tr>
16
+ <td>{view.slotId}</td>
17
+ <td>{view.viewId}</td>
18
+ <td>{view.label}</td>
19
+ <td><button type="button" onclick={() => data.onClose(view.slotId)}>Close</button></td>
20
+ </tr>
21
+ {/each}
22
+ </tbody>
23
+ </table>
24
+ </div>
25
+
26
+ <style>
27
+ .shell-rich-views table { border-collapse: collapse; width: 100%; }
28
+ .shell-rich-views th, .shell-rich-views td { padding: 2px 8px; text-align: left; }
29
+ .shell-rich-views button { background: none; border: 0; color: var(--shell-link, #6cf); cursor: pointer; padding: 0; font: inherit; }
30
+ .shell-rich-views button:hover { text-decoration: underline; }
31
+ </style>
@@ -0,0 +1,13 @@
1
+ interface Props {
2
+ data: {
3
+ views: Array<{
4
+ slotId: string;
5
+ viewId: string;
6
+ label: string;
7
+ }>;
8
+ onClose: (slotId: string) => void;
9
+ };
10
+ }
11
+ declare const ViewsTable: import("svelte").Component<Props, {}, "">;
12
+ type ViewsTable = ReturnType<typeof ViewsTable>;
13
+ export default ViewsTable;
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ data: { value: unknown };
4
+ }
5
+ let { data }: Props = $props();
6
+ </script>
7
+
8
+ <div class="shell-rich-zonetree">
9
+ <pre>{JSON.stringify(data.value, null, 2)}</pre>
10
+ </div>
11
+
12
+ <style>
13
+ .shell-rich-zonetree pre {
14
+ overflow: auto;
15
+ padding: 8px;
16
+ background: var(--shell-bg, #000);
17
+ color: var(--shell-fg, #fff);
18
+ }
19
+ </style>
@@ -0,0 +1,8 @@
1
+ interface Props {
2
+ data: {
3
+ value: unknown;
4
+ };
5
+ }
6
+ declare const ZoneTree: import("svelte").Component<Props, {}, "">;
7
+ type ZoneTree = ReturnType<typeof ZoneTree>;
8
+ export default ZoneTree;
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ data: { rows: Array<{ shardId: string; zones: string[] }> };
4
+ }
5
+ let { data }: Props = $props();
6
+ </script>
7
+
8
+ <div class="shell-rich-zones">
9
+ <table>
10
+ <thead>
11
+ <tr><th>Shard ID</th><th>Zones</th></tr>
12
+ </thead>
13
+ <tbody>
14
+ {#each data.rows as row (row.shardId)}
15
+ <tr>
16
+ <td>{row.shardId}</td>
17
+ <td>{row.zones.join(', ')}</td>
18
+ </tr>
19
+ {/each}
20
+ </tbody>
21
+ </table>
22
+ </div>
23
+
24
+ <style>
25
+ .shell-rich-zones table { border-collapse: collapse; width: 100%; }
26
+ .shell-rich-zones th, .shell-rich-zones td { padding: 2px 8px; text-align: left; }
27
+ </style>
@@ -0,0 +1,11 @@
1
+ interface Props {
2
+ data: {
3
+ rows: Array<{
4
+ shardId: string;
5
+ zones: string[];
6
+ }>;
7
+ };
8
+ }
9
+ declare const ZonesTable: import("svelte").Component<Props, {}, "">;
10
+ type ZonesTable = ReturnType<typeof ZonesTable>;
11
+ export default ZonesTable;
@@ -0,0 +1,36 @@
1
+ import type { Component } from 'svelte';
2
+ export type RichComponent = Component<any>;
3
+ export type ScrollbackEntry = {
4
+ kind: 'prompt';
5
+ id: string;
6
+ cwd: string;
7
+ line: string;
8
+ ts: number;
9
+ } | {
10
+ kind: 'text';
11
+ id: string;
12
+ stream: 'stdout' | 'stderr';
13
+ chunks: string[];
14
+ ts: number;
15
+ } | {
16
+ kind: 'rich';
17
+ id: string;
18
+ component: RichComponent;
19
+ props: Record<string, unknown>;
20
+ ts: number;
21
+ } | {
22
+ kind: 'status';
23
+ id: string;
24
+ text: string;
25
+ level: 'info' | 'warn' | 'error';
26
+ ts: number;
27
+ };
28
+ type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never;
29
+ export declare class Scrollback {
30
+ entries: ScrollbackEntry[];
31
+ private readonly cap;
32
+ constructor(cap?: number);
33
+ push(entry: DistributiveOmit<ScrollbackEntry, 'id'>): void;
34
+ clear(): void;
35
+ }
36
+ export {};