@franzzemen/brokenstock-shell 0.9.3 → 0.9.4
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/README.md
CHANGED
|
@@ -15,5 +15,6 @@ Shared Angular shell library for Brokenstock web applications. Provides the foun
|
|
|
15
15
|
- **Injection token configuration:** `SHELL_APP_NAME`, `SHELL_AUTH_URLS`, `SHELL_MENU_ITEMS`, `SHELL_COMMANDS`
|
|
16
16
|
- **Content projection:** App-specific status bar items projected through `<shell-root>` into the status bar
|
|
17
17
|
- **Command pattern:** `@Injectable` classes implementing `CommandDefinition`, registered via `SHELL_COMMANDS` token
|
|
18
|
+
- **Questions and screen keys:** `CommandService.ask` leaves a question open in the terminal (the next line answers it, Esc cancels); `ScreenKeysService` gives a screen keys of its own on its routes (Ctrl allowed, live in the terminal) — see the guide
|
|
18
19
|
- **Signal-based state:** All services use Angular signals; no RxJS in public APIs
|
|
19
20
|
- **Peer dependencies:** Angular 21, Material, CDK, @franzzemen/identity, @franzzemen/utility, zod, rxjs
|
|
@@ -13,7 +13,7 @@ import { gfmHeadingId } from 'marked-gfm-heading-id';
|
|
|
13
13
|
import fm from 'front-matter';
|
|
14
14
|
import { NgClass, CommonModule, DOCUMENT, isPlatformBrowser, DatePipe } from '@angular/common';
|
|
15
15
|
import { Title, Meta } from '@angular/platform-browser';
|
|
16
|
-
import {
|
|
16
|
+
import { array, string } from 'zod/v4';
|
|
17
17
|
import * as i1 from '@angular/material/icon';
|
|
18
18
|
import { MatIconModule } from '@angular/material/icon';
|
|
19
19
|
import * as i2 from '@angular/material/tooltip';
|
|
@@ -2936,6 +2936,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImpor
|
|
|
2936
2936
|
args: [{ providedIn: 'root' }]
|
|
2937
2937
|
}], ctorParameters: () => [] });
|
|
2938
2938
|
|
|
2939
|
+
/*
|
|
2940
|
+
* The only door to zod in the shell (projects review-defects-2026-10.prd.md E20, D25).
|
|
2941
|
+
*
|
|
2942
|
+
* Library files import `* as z` from HERE, never from 'zod', so call sites read as before
|
|
2943
|
+
* (`z.array(z.string())`) but the app's bundler sees a module re-exporting two functions and can
|
|
2944
|
+
* drop the rest. Importing `{z}` from 'zod/v4' hands it the whole library as one object instead:
|
|
2945
|
+
* 454 kB in the browser's first download in a measured test bundle, against 79 kB this way.
|
|
2946
|
+
*
|
|
2947
|
+
* A command needing another zod function adds it below; the compiler refuses anything not listed.
|
|
2948
|
+
* `zod-door.spec.ts` fails if any other library file imports zod directly. Specs are exempt: they
|
|
2949
|
+
* never reach a bundle.
|
|
2950
|
+
*/
|
|
2951
|
+
|
|
2939
2952
|
const FAQ_USAGE = 'faq\n' +
|
|
2940
2953
|
'faq <key>\n' +
|
|
2941
2954
|
'faq search <term>\n' +
|
|
@@ -2956,7 +2969,7 @@ class FaqCommand {
|
|
|
2956
2969
|
this.usage = FAQ_USAGE;
|
|
2957
2970
|
this.requiresAuth = false;
|
|
2958
2971
|
this.scope = 'global';
|
|
2959
|
-
this.argsSchema =
|
|
2972
|
+
this.argsSchema = array(string()).max(50);
|
|
2960
2973
|
}
|
|
2961
2974
|
execute(args) {
|
|
2962
2975
|
const ts = () => new Date();
|
|
@@ -3157,7 +3170,7 @@ class PendingPromptState {
|
|
|
3157
3170
|
}
|
|
3158
3171
|
}
|
|
3159
3172
|
|
|
3160
|
-
const CommandInputSchema =
|
|
3173
|
+
const CommandInputSchema = string().trim().min(1, 'Command cannot be empty');
|
|
3161
3174
|
class CommandService {
|
|
3162
3175
|
#prompts;
|
|
3163
3176
|
/**
|