@wrongstack/tui 0.282.0 → 0.282.2

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
@@ -23,7 +23,7 @@ const exitCode = await runTui({
23
23
  slashRegistry, // SlashCommandRegistry
24
24
  attachments: new DefaultAttachmentStore(),
25
25
  events: new DefaultEventBus(),
26
- model: 'claude-sonnet-4-6',
26
+ model: 'anthropic-test-model',
27
27
  banner: true,
28
28
  yolo: false,
29
29
  appVersion: '0.1.6',
@@ -40,7 +40,7 @@ process.exit(exitCode);
40
40
 
41
41
  ```
42
42
  ┌─ banner ─────────────────────────────────────────────┐
43
- │ wrongstack 0.1.6 — anthropic · claude-sonnet-4-6 │
43
+ │ wrongstack 0.1.6 — anthropic · anthropic-test-model │
44
44
  └──────────────────────────────────────────────────────┘
45
45
  user> refactor auth.ts to async/await
46
46
  ⠋ thinking (3 tools used · 4.2k tokens · 1.3s)
package/dist/index.d.ts CHANGED
@@ -213,6 +213,16 @@ interface ProviderOption {
213
213
  modelsLabel?: string | undefined;
214
214
  }
215
215
 
216
+ interface McpPickerItem {
217
+ name: string;
218
+ enabled: boolean;
219
+ status: string;
220
+ transport: string;
221
+ description?: string | undefined;
222
+ toolCount: number;
223
+ lazy?: boolean | undefined;
224
+ }
225
+
216
226
  interface PluginPickerItem {
217
227
  name: string;
218
228
  enabled: boolean;
@@ -220,14 +230,24 @@ interface PluginPickerItem {
220
230
  summary: string;
221
231
  /**
222
232
  * When false the row is locked: the picker renders a 🔒 marker and ignores
223
- * Enter/←/→ on it. Core plugins (security, prompts, skills, sync, git, …)
224
- * and the critical guard plugins (secret-scanner, branch-guard) set this
225
- * to false so they stay visible in the menu but cannot be toggled off —
226
- * matching the rationale in `PLUGIN_AUDIT_ENTRIES`.
233
+ * Enter/←/→ on it. The current built-in audit list is fully toggleable, but
234
+ * the component keeps this marker for future or externally supplied locked
235
+ * rows.
227
236
  */
228
237
  lockable?: boolean | undefined;
229
238
  }
230
239
 
240
+ interface ToolPickerItem {
241
+ name: string;
242
+ owner: string;
243
+ category: string;
244
+ enabled: boolean;
245
+ mutating: boolean;
246
+ permission: string;
247
+ descMode: 'extend' | 'simple';
248
+ description: string;
249
+ }
250
+
231
251
  /** Context window mode options — cyclable via ←/→. */
232
252
  declare const CONTEXT_MODES: readonly ["balanced", "frugal", "deep", "archival"];
233
253
  type ContextMode = (typeof CONTEXT_MODES)[number];
@@ -622,6 +642,51 @@ interface RunTuiOptions {
622
642
  message?: string | undefined;
623
643
  error?: string | undefined;
624
644
  }>) | undefined;
645
+ /** Load MCP server rows for the interactive MCP picker. */
646
+ getMcpServers?: (() => McpPickerItem[]) | undefined;
647
+ /** Toggle one MCP server (enable/disable) from the interactive picker. */
648
+ onMcpToggle?: ((name: string) => Promise<{
649
+ items: McpPickerItem[];
650
+ message?: string | undefined;
651
+ error?: string | undefined;
652
+ }>) | undefined;
653
+ /** Restart one MCP server from the interactive picker. */
654
+ onMcpRestart?: ((name: string) => Promise<{
655
+ items: McpPickerItem[];
656
+ message?: string | undefined;
657
+ error?: string | undefined;
658
+ }>) | undefined;
659
+ /** Load tool rows for the interactive tool picker. */
660
+ getToolsItems?: (() => ToolPickerItem[]) | undefined;
661
+ /** Toggle one tool (enable/disable) from the interactive tool picker. */
662
+ onToolToggle?: ((name: string) => Promise<{
663
+ items: ToolPickerItem[];
664
+ message?: string | undefined;
665
+ error?: string | undefined;
666
+ }>) | undefined;
667
+ /** Get current brain risk level and decision log for the Brain panel. */
668
+ getBrainData?: (() => {
669
+ riskLevel: 'off' | 'low' | 'medium' | 'high' | 'all';
670
+ log: Array<{
671
+ kind: string;
672
+ question: string;
673
+ outcome: string;
674
+ age: string;
675
+ }>;
676
+ }) | undefined;
677
+ /** Set brain risk ceiling from the Brain panel. */
678
+ onBrainRiskLevel?: ((level: 'off' | 'low' | 'medium' | 'high' | 'all') => string | undefined) | undefined;
679
+ /** Get current Shadow Agent state. */
680
+ getShadowData?: (() => {
681
+ activeId: string | null;
682
+ running: boolean;
683
+ model: string;
684
+ intervalMs: number;
685
+ }) | undefined;
686
+ /** Start Shadow Agent. Returns message or error. */
687
+ onShadowStart?: (() => Promise<string | undefined>) | undefined;
688
+ /** Stop Shadow Agent. Returns message or error. */
689
+ onShadowStop?: (() => Promise<string | undefined>) | undefined;
625
690
  /**
626
691
  * Host for the interactive `/auth` panel (provider/key management, OAuth
627
692
  * sign-in, local-server add). The CLI builds this from its vault +
@@ -842,22 +907,20 @@ declare function replaySessionEvents(events: SessionEvent[], startId: number): H
842
907
  * Unified next-steps suggestion parser.
843
908
  *
844
909
  * Three code paths feed into the suggestion store:
845
- * 1. TUI rendering — entry.tsx parses "💡 Next steps" or "<next_steps>" from assistant output
846
- * 2. REPL store — repl.ts parses "💡 Next steps" or "<next_steps>" from final agent output
910
+ * 1. TUI rendering — entry.tsx parses only "<nextsteps>" from assistant output
911
+ * 2. REPL store — repl.ts parses only "<nextsteps>" from final agent output
847
912
  * 3. /suggest output — suggest.ts parses LLM-generated numbered lists
848
913
  *
849
914
  * Heading mode (`requireHeading = true`):
850
- * strict=true — only 💡 emoji heading or <next_steps> tag (TUI rendering)
851
- * strict=false — 💡, ##, plain "Next steps", or <next_steps> headings (REPL store)
915
+ * Assistant-output paths accept only balanced <nextsteps>...</nextsteps> blocks.
916
+ * Loose headings like "Next steps:" are intentionally ignored so `/next` only
917
+ * activates for the canonical machine-readable format.
852
918
  *
853
919
  * Raw mode (`requireHeading = false`):
854
920
  * Parses numbered/bullet items from anywhere in text (subagent /suggest output).
855
921
  *
856
- * Supported formats:
857
- * 💡 Next steps (old emoji format)
858
- * ## Next steps (markdown heading)
859
- * Next steps (plain text)
860
- * <next_steps> (new XML tag format - preferred)
922
+ * Supported assistant-output format:
923
+ * <nextsteps> (canonical XML tag format)
861
924
  */
862
925
  interface ParsedNextStep {
863
926
  index: number;
@@ -871,7 +934,7 @@ interface ParseNextStepsResult {
871
934
  /** Flat string array — what gets stored in the suggestion store. */
872
935
  texts: string[];
873
936
  /**
874
- * Content with the entire "💡 Next steps" or "<next_steps>" block removed.
937
+ * Content with the entire canonical "<nextsteps>" block removed.
875
938
  * Used by entry.tsx to strip suggestions from the rendered message body.
876
939
  */
877
940
  stripped: string;
@@ -879,12 +942,11 @@ interface ParseNextStepsResult {
879
942
  autoTexts: string[];
880
943
  }
881
944
  /**
882
- * Parse "<next_steps>" or "💡 Next steps" blocks from assistant output (or raw numbered lines).
945
+ * Parse canonical "<nextsteps>" blocks from assistant output (or raw numbered lines).
883
946
  *
884
947
  * @param content — raw assistant message text or subagent output
885
- * @param strict — when true, accepts 💡 emoji heading OR <next_steps> XML tag (TUI rendering).
886
- * when false, also accepts ## / plain "Next steps" headings (REPL store).
887
- * @param requireHeading — when true, a heading must precede the item list.
948
+ * @param strict — retained for compatibility; assistant-output paths always require the canonical XML tag.
949
+ * @param requireHeading — when true, a canonical XML tag must precede the item list.
888
950
  * when false, numbered/bullet items are parsed from anywhere in text
889
951
  * (used by /suggest subagent output which has no heading).
890
952
  */