sh3-core 0.19.0 → 0.19.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 (58) hide show
  1. package/dist/Sh3.svelte +3 -1
  2. package/dist/actions/menuBarModel.js +8 -0
  3. package/dist/actions/menuBarModel.test.js +61 -0
  4. package/dist/app/admin/ApiKeysView.svelte +6 -5
  5. package/dist/app/store/PermissionConfirmModal.svelte +23 -0
  6. package/dist/app/store/PermissionConfirmModal.svelte.d.ts +1 -0
  7. package/dist/app/store/StoreView.svelte +6 -1
  8. package/dist/chrome/CompactChrome.svelte.test.js +7 -4
  9. package/dist/env/client.d.ts +5 -4
  10. package/dist/env/client.js +11 -17
  11. package/dist/env/serverUrl.d.ts +2 -0
  12. package/dist/env/serverUrl.js +8 -0
  13. package/dist/gestures/gestureRegistry.test.js +1 -0
  14. package/dist/gestures/index.d.ts +17 -0
  15. package/dist/gestures/index.js +27 -0
  16. package/dist/keys/client.js +6 -7
  17. package/dist/keys/revocation-bus.svelte.js +11 -1
  18. package/dist/layout/compact/CarouselTabs.svelte +152 -15
  19. package/dist/layout/compact/CarouselTabs.svelte.test.js +222 -2
  20. package/dist/layout/compact/CompactRenderer.svelte +1 -1
  21. package/dist/layout/compact/CompactRenderer.svelte.test.js +5 -3
  22. package/dist/layout/compact/derive.js +7 -16
  23. package/dist/layout/compact/derive.test.js +30 -9
  24. package/dist/layout/drag.svelte.js +16 -3
  25. package/dist/layout/inspection.d.ts +20 -9
  26. package/dist/layout/inspection.js +66 -11
  27. package/dist/layout/inspection.svelte.test.d.ts +1 -0
  28. package/dist/layout/inspection.svelte.test.js +114 -0
  29. package/dist/layout/store.schemaVersion.test.js +2 -2
  30. package/dist/layout/types.d.ts +11 -8
  31. package/dist/layout/types.js +1 -1
  32. package/dist/layout/types.test.js +2 -2
  33. package/dist/overlays/FloatFrame.svelte +93 -22
  34. package/dist/primitives/ResizableSplitter.svelte +42 -8
  35. package/dist/registry/checkFetch.d.ts +6 -0
  36. package/dist/registry/checkFetch.js +23 -0
  37. package/dist/sh3/views/KeysAndPeers.svelte +4 -3
  38. package/dist/shards/activate-runtime.test.js +99 -1
  39. package/dist/shards/activate.svelte.js +20 -5
  40. package/dist/shards/ctx-fetch.test.js +70 -0
  41. package/dist/shards/registry.d.ts +8 -1
  42. package/dist/shards/registry.js +13 -2
  43. package/dist/shards/registry.test.js +25 -4
  44. package/dist/shards/types.d.ts +30 -1
  45. package/dist/shell-shard/ScrollbackView.svelte +145 -67
  46. package/dist/shell-shard/ScrollbackView.svelte.test.d.ts +1 -0
  47. package/dist/shell-shard/ScrollbackView.svelte.test.js +182 -0
  48. package/dist/shell-shard/dispatch-gating.test.js +38 -2
  49. package/dist/shell-shard/dispatch.js +9 -1
  50. package/dist/shell-shard/registry-resolve.test.js +50 -0
  51. package/dist/shell-shard/registry.d.ts +2 -1
  52. package/dist/shell-shard/registry.js +12 -2
  53. package/dist/shell-shard/verbs/help.js +5 -4
  54. package/dist/shell-shard/verbs/help.svelte.test.js +5 -2
  55. package/dist/verbs/types.d.ts +10 -5
  56. package/dist/version.d.ts +1 -1
  57. package/dist/version.js +1 -1
  58. package/package.json +1 -1
@@ -21,19 +21,29 @@ export class VerbRegistry {
21
21
  * @param opts.globalOnly When true, only verbs declared with `globalVerb:
22
22
  * true` resolve locally; everything else forwards. Used by the dispatch
23
23
  * path to gate sh3-domain verbs to sh3 mode while keeping framework
24
- * controls (clear, mode) reachable from every mode.
24
+ * controls (clear, mode) reachable from every mode. The leading-`/`
25
+ * escape ignores this flag — slash means "resolve as if in sh3 mode."
25
26
  */
26
27
  resolve(line, opts = {}) {
27
28
  const trimmed = line.trim();
28
29
  if (!trimmed)
29
30
  return { kind: 'forward', line };
30
- // Escape hatch: '$ <rest>' always forwards
31
+ // Escape hatch: '$ <rest>' always forwards (used to call into bash from sh3)
31
32
  if (trimmed.startsWith('$ ')) {
32
33
  return { kind: 'forward', line: trimmed.slice(2) };
33
34
  }
34
35
  if (trimmed === '$') {
35
36
  return { kind: 'forward', line: '' };
36
37
  }
38
+ // Inverse escape: '/' makes the line resolve against sh3 verbs regardless
39
+ // of the active mode. `/foo args` ≡ `foo args` typed in sh3 mode.
40
+ // Whitespace after the slash is tolerated. `/` alone is a no-op forward.
41
+ if (trimmed.startsWith('/')) {
42
+ const body = trimmed.slice(1).trimStart();
43
+ if (!body)
44
+ return { kind: 'forward', line: '' };
45
+ return this.resolve(body, { globalOnly: false });
46
+ }
37
47
  // First whitespace-separated token
38
48
  const space = trimmed.indexOf(' ');
39
49
  const head = space === -1 ? trimmed : trimmed.slice(0, space);
@@ -9,10 +9,11 @@ export function makeHelpVerb() {
9
9
  summary: 'List verbs or show detail for one.',
10
10
  globalVerb: true,
11
11
  async run(ctx) {
12
- const inSh3 = ctx.sh3.getMode().id === 'sh3';
13
- const rows = listVerbs()
14
- .filter((v) => inSh3 || v.globalVerb === true)
15
- .map((v) => ({ name: v.name, summary: v.summary }));
12
+ // Lists every registered verb regardless of the active mode — the
13
+ // `/<verb>` escape (see registry.resolve) makes any sh3 verb reachable
14
+ // from any mode, so filtering the listing down to globalVerb-flagged
15
+ // entries would understate what the user can actually run.
16
+ const rows = listVerbs().map((v) => ({ name: v.name, summary: v.summary }));
16
17
  ctx.scrollback.push({
17
18
  kind: 'rich',
18
19
  componentKey: HELP_TABLE_KEY,
@@ -35,7 +35,7 @@ describe('help verb', () => {
35
35
  expect(names).toContain('mode');
36
36
  expect(names).toContain('help');
37
37
  });
38
- it('lists only globalVerb-flagged verbs in a custom mode', async () => {
38
+ it('lists every registered verb in a custom mode (slash escape makes all sh3 verbs reachable)', async () => {
39
39
  const help = makeHelpVerb();
40
40
  const { ctx, pushed } = makeCtx('gemini');
41
41
  await help.run(ctx, []);
@@ -44,7 +44,10 @@ describe('help verb', () => {
44
44
  expect(names).toContain('clear');
45
45
  expect(names).toContain('mode');
46
46
  expect(names).toContain('help');
47
- expect(names).not.toContain('apps');
47
+ // sh3-domain verbs now appear in the listing too — users invoke them
48
+ // via /apps from non-sh3 modes; hiding them would understate the
49
+ // surface that's actually callable.
50
+ expect(names).toContain('apps');
48
51
  });
49
52
  it('is flagged globalVerb so it resolves in custom modes', () => {
50
53
  const help = makeHelpVerb();
@@ -216,11 +216,16 @@ export interface Verb {
216
216
  name: string;
217
217
  summary: string;
218
218
  /**
219
- * When true, this verb resolves in every sh3 mode — including bash and
220
- * external shards' custom modes. Defaults to false: sh3-domain verbs only
221
- * resolve when `mode.id === 'sh3'`. Reserve this flag for verbs whose
222
- * action is mode-agnostic (e.g. `clear` clears the local scrollback,
223
- * `mode` switches modes — both make sense everywhere).
219
+ * @deprecated Prefer the `/<verb>` user escape (resolver.ts `/` branch),
220
+ * which lets any sh3 verb be invoked from bash or custom modes without
221
+ * the author opting in. The flag still works for one minor cycle so
222
+ * existing shards keep resolving their flagged verbs without the slash.
223
+ *
224
+ * When true (legacy behavior), this verb resolves in every sh3 mode —
225
+ * including bash and external shards' custom modes. Defaults to false:
226
+ * sh3-domain verbs only resolve when `mode.id === 'sh3'`. Reserve this
227
+ * flag for verbs whose action is mode-agnostic (e.g. `clear` clears the
228
+ * local scrollback, `mode` switches modes — both make sense everywhere).
224
229
  */
225
230
  globalVerb?: boolean;
226
231
  /**
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.19.0";
2
+ export declare const VERSION = "0.19.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.19.0';
2
+ export const VERSION = '0.19.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sh3-core",
3
- "version": "0.19.0",
3
+ "version": "0.19.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"