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.
- package/dist/layout/LayoutRenderer.svelte +1 -1
- package/dist/layout/tree-walk.js +6 -1
- package/dist/layout/types.d.ts +7 -0
- package/dist/overlays/FloatFrame.svelte +8 -2
- package/dist/overlays/float.js +6 -3
- package/dist/overlays/float.test.js +71 -0
- package/dist/primitives/widgets/IconToggleGroup.svelte +4 -1
- package/dist/primitives/widgets/Segmented.svelte +4 -1
- package/dist/sh3core-shard/AppInfoView.svelte +154 -0
- package/dist/sh3core-shard/AppInfoView.svelte.d.ts +11 -0
- package/dist/sh3core-shard/appActions.js +23 -5
- package/dist/shell-shard/ScrollbackView.svelte +40 -19
- package/dist/shell-shard/Terminal.svelte +55 -4
- package/dist/shell-shard/contract.d.ts +34 -0
- package/dist/shell-shard/dispatch-custom.test.js +48 -0
- package/dist/shell-shard/dispatch-gating.test.d.ts +1 -0
- package/dist/shell-shard/dispatch-gating.test.js +63 -0
- package/dist/shell-shard/dispatch-invoke.test.d.ts +1 -0
- package/dist/shell-shard/dispatch-invoke.test.js +214 -0
- package/dist/shell-shard/dispatch.d.ts +9 -1
- package/dist/shell-shard/dispatch.js +73 -2
- package/dist/shell-shard/output.d.ts +8 -1
- package/dist/shell-shard/output.js +17 -1
- package/dist/shell-shard/output.test.js +24 -5
- package/dist/shell-shard/registry-resolve.test.d.ts +1 -0
- package/dist/shell-shard/registry-resolve.test.js +26 -0
- package/dist/shell-shard/registry.d.ts +12 -1
- package/dist/shell-shard/registry.js +12 -1
- package/dist/shell-shard/terminal-dispatch.test.js +10 -3
- package/dist/shell-shard/toolbar/slots/BusySlot.svelte +35 -0
- package/dist/shell-shard/toolbar/slots/BusySlot.svelte.d.ts +7 -0
- package/dist/shell-shard/verbs/clear.js +1 -0
- package/dist/shell-shard/verbs/mode.js +1 -0
- package/dist/verbs/types.d.ts +8 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- 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) =>
|
|
19
|
-
|
|
20
|
-
|
|
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>
|
package/dist/verbs/types.d.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
2
|
+
export const VERSION = '0.14.3';
|