sh3-core 0.14.0 → 0.14.3

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 (37) hide show
  1. package/dist/layout/LayoutRenderer.svelte +1 -1
  2. package/dist/layout/tree-walk.js +6 -1
  3. package/dist/layout/types.d.ts +7 -0
  4. package/dist/overlays/FloatFrame.svelte +8 -2
  5. package/dist/overlays/float.js +6 -3
  6. package/dist/overlays/float.test.js +71 -0
  7. package/dist/primitives/widgets/IconToggleGroup.svelte +4 -1
  8. package/dist/primitives/widgets/Segmented.svelte +4 -1
  9. package/dist/sh3core-shard/AppInfoView.svelte +154 -0
  10. package/dist/sh3core-shard/AppInfoView.svelte.d.ts +11 -0
  11. package/dist/sh3core-shard/appActions.js +23 -5
  12. package/dist/shell-shard/ScrollbackView.svelte +40 -19
  13. package/dist/shell-shard/Terminal.svelte +55 -4
  14. package/dist/shell-shard/contract.d.ts +34 -0
  15. package/dist/shell-shard/dispatch-custom.test.js +48 -0
  16. package/dist/shell-shard/dispatch-gating.test.d.ts +1 -0
  17. package/dist/shell-shard/dispatch-gating.test.js +63 -0
  18. package/dist/shell-shard/dispatch-invoke.test.d.ts +1 -0
  19. package/dist/shell-shard/dispatch-invoke.test.js +214 -0
  20. package/dist/shell-shard/dispatch.d.ts +9 -1
  21. package/dist/shell-shard/dispatch.js +73 -2
  22. package/dist/shell-shard/output.d.ts +8 -1
  23. package/dist/shell-shard/output.js +17 -1
  24. package/dist/shell-shard/output.test.js +24 -5
  25. package/dist/shell-shard/registry-resolve.test.d.ts +1 -0
  26. package/dist/shell-shard/registry-resolve.test.js +26 -0
  27. package/dist/shell-shard/registry.d.ts +12 -1
  28. package/dist/shell-shard/registry.js +12 -1
  29. package/dist/shell-shard/terminal-dispatch.test.js +10 -3
  30. package/dist/shell-shard/toolbar/slots/BusySlot.svelte +35 -0
  31. package/dist/shell-shard/toolbar/slots/BusySlot.svelte.d.ts +7 -0
  32. package/dist/shell-shard/verbs/clear.js +1 -0
  33. package/dist/shell-shard/verbs/mode.js +1 -0
  34. package/dist/verbs/types.d.ts +8 -0
  35. package/dist/version.d.ts +1 -1
  36. package/dist/version.js +1 -1
  37. package/package.json +1 -1
@@ -15,18 +15,25 @@ function scaffold(modeId) {
15
15
  const fs = {};
16
16
  const shell = {};
17
17
  const resolver = {
18
- resolve: (line) => line.startsWith('pwd')
19
- ? { kind: 'local', verb: { name: 'pwd', run: async () => { } }, args: [], line }
20
- : { kind: 'forward', line },
18
+ resolve: (line, opts = {}) => {
19
+ // The test only exercises 'pwd' (sh3-domain) and unknown lines.
20
+ // Under globalOnly, 'pwd' should forward.
21
+ if (line.startsWith('pwd') && !opts.globalOnly) {
22
+ return { kind: 'local', verb: { name: 'pwd', run: async () => { } }, args: [], line };
23
+ }
24
+ return { kind: 'forward', line };
25
+ },
21
26
  };
22
27
  const { dispatch } = makeDispatch({
23
28
  mode: () => mode,
29
+ role: () => (modeId === 'bash' ? 'admin' : 'user'),
24
30
  resolver,
25
31
  scrollback,
26
32
  session,
27
33
  shell,
28
34
  fs,
29
35
  cwd: () => '/',
36
+ busy: () => () => { },
30
37
  });
31
38
  return { dispatch, sent, pushed };
32
39
  }
@@ -0,0 +1,35 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ active: boolean;
4
+ label: string | null;
5
+ }
6
+ let { active, label }: Props = $props();
7
+ </script>
8
+
9
+ {#if active}
10
+ <div class="busy" role="status" aria-live="polite">
11
+ <span class="spinner" aria-hidden="true"></span>
12
+ {#if label}<span class="label">{label}</span>{/if}
13
+ </div>
14
+ {/if}
15
+
16
+ <style>
17
+ .busy {
18
+ display: inline-flex;
19
+ align-items: center;
20
+ gap: 6px;
21
+ color: var(--shell-fg-muted, #aaa);
22
+ font-size: 0.85em;
23
+ }
24
+ .spinner {
25
+ width: 12px;
26
+ height: 12px;
27
+ border: 2px solid var(--shell-fg-muted, #aaa);
28
+ border-top-color: transparent;
29
+ border-radius: 50%;
30
+ animation: busy-spin 0.8s linear infinite;
31
+ }
32
+ @keyframes busy-spin {
33
+ to { transform: rotate(360deg); }
34
+ }
35
+ </style>
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ active: boolean;
3
+ label: string | null;
4
+ }
5
+ declare const BusySlot: import("svelte").Component<Props, {}, "">;
6
+ type BusySlot = ReturnType<typeof BusySlot>;
7
+ export default BusySlot;
@@ -1,6 +1,7 @@
1
1
  export const clearVerb = {
2
2
  name: 'clear',
3
3
  summary: 'Clear the scrollback (local only — other views are unaffected).',
4
+ globalVerb: true,
4
5
  async run(ctx) {
5
6
  ctx.scrollback.clear();
6
7
  },
@@ -1,6 +1,7 @@
1
1
  export const modeVerb = {
2
2
  name: 'mode',
3
3
  summary: 'List or switch shell modes. Usage: mode | mode <id>',
4
+ globalVerb: true,
4
5
  async run(ctx, args) {
5
6
  const ts = Date.now();
6
7
  if (args.length === 0) {
@@ -90,6 +90,14 @@ export interface VerbContext {
90
90
  export interface Verb {
91
91
  name: string;
92
92
  summary: string;
93
+ /**
94
+ * When true, this verb resolves in every shell mode — including bash and
95
+ * external shards' custom modes. Defaults to false: sh3-domain verbs only
96
+ * resolve when `mode.id === 'sh3'`. Reserve this flag for verbs whose
97
+ * action is mode-agnostic (e.g. `clear` clears the local scrollback,
98
+ * `mode` switches modes — both make sense everywhere).
99
+ */
100
+ globalVerb?: boolean;
93
101
  run(ctx: VerbContext, args: string[]): Promise<void>;
94
102
  }
95
103
  export type Resolution = {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Auto-generated from package.json — do not edit manually. */
2
- export declare const VERSION = "0.14.0";
2
+ export declare const VERSION = "0.14.3";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Auto-generated from package.json — do not edit manually. */
2
- export const VERSION = '0.14.0';
2
+ export const VERSION = '0.14.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sh3-core",
3
- "version": "0.14.0",
3
+ "version": "0.14.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"