@wrongstack/cli 0.313.1 → 0.316.1
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/{acp-LQMSMV32.js → acp-CEQINXWB.js} +2 -2
- package/dist/acp-registry-cache.d.ts +0 -2
- package/dist/acp-server-agent.d.ts +2 -1
- package/dist/arg-parser.d.ts +2 -1
- package/dist/{auth-VQMSZGKE.js → auth-GZ5A5OF5.js} +3 -3
- package/dist/auth-menu/local.d.ts +3 -2
- package/dist/boot/boot-auto-thin.d.ts +44 -0
- package/dist/boot/brain-decision-log.d.ts +2 -1
- package/dist/boot/config-backup-recovery.d.ts +2 -6
- package/dist/boot/dispatch-singleshot.d.ts +2 -1
- package/dist/boot/dispatch-webui.d.ts +5 -1
- package/dist/boot/event-wiring.d.ts +1 -1
- package/dist/boot/execution-mode.d.ts +2 -1
- package/dist/boot/governance-shadow-bridge.d.ts +4 -3
- package/dist/boot/governance-trace-context.d.ts +4 -4
- package/dist/boot/launch-menu.d.ts +2 -2
- package/dist/boot/system-prompt-builder.d.ts +1 -1
- package/dist/boot/system-prompt-menu.d.ts +10 -58
- package/dist/boot/system-prompt.d.ts +3 -3
- package/dist/boot/tool-registry.d.ts +3 -1
- package/dist/boot/tui-coordinator-callbacks.d.ts +2 -1
- package/dist/boot/tui-coordinator-setup.d.ts +3 -2
- package/dist/boot/tui-goal-wiring.d.ts +2 -1
- package/dist/boot/tui-live-sessions.d.ts +3 -1
- package/dist/boot/tui-session-resume.d.ts +82 -10
- package/dist/boot/tui-session-stub-enrich.d.ts +7 -1
- package/dist/boot/tui-settings-adapter.d.ts +3 -2
- package/dist/boot/tui-theme-adapter.d.ts +3 -2
- package/dist/boot/webui-session-child.d.ts +2 -12
- package/dist/boot-auto-thin-BZ675EVT.js +102 -0
- package/dist/boot-config.d.ts +1 -1
- package/dist/brain-menu/panel-service.d.ts +2 -1
- package/dist/chimera-cascade-evidence.d.ts +4 -21
- package/dist/chimera-review-task.d.ts +0 -7
- package/dist/chimera-subagent-ladder.d.ts +2 -2
- package/dist/{chunk-USYOJIV2.js → chunk-32MTOI2I.js} +2 -2
- package/dist/{chunk-CNQZ4HG4.js → chunk-37SPPLUD.js} +57 -8
- package/dist/chunk-ALE5KHCA.js +1 -0
- package/dist/{chunk-GWVLRUVH.js → chunk-G3IMKQRH.js} +25 -6
- package/dist/{chunk-BZJ4MP32.js → chunk-GKHUHAIK.js} +8 -3
- package/dist/{chunk-3JPTNADJ.js → chunk-GPPRNAKW.js} +1 -1
- package/dist/{chunk-KE7E7DPX.js → chunk-HXJYHAR4.js} +1 -1
- package/dist/{chunk-X3N5TS2S.js → chunk-JACOMTIH.js} +2 -76
- package/dist/{chunk-DGXNL7OT.js → chunk-JHUJUIOH.js} +1 -18
- package/dist/{chunk-WOTGMHAH.js → chunk-KG4X5F7Z.js} +1 -1
- package/dist/{chunk-NUIHRGPY.js → chunk-NV3JDK4F.js} +1 -1
- package/dist/{chunk-E3X4KM7T.js → chunk-NZZOYLQ7.js} +5 -10
- package/dist/{chunk-H6C7SO5H.js → chunk-QC5I4VWZ.js} +1 -1
- package/dist/chunk-SXJTVNWF.js +78 -0
- package/dist/{chunk-AOAIPYFB.js → chunk-SYIBTG3X.js} +2 -2
- package/dist/{chunk-PKHGLWUJ.js → chunk-T642Q732.js} +5 -4
- package/dist/{chunk-BGFM3PD7.js → chunk-UZ2TMHNH.js} +1 -1
- package/dist/{chunk-4S52MIIM.js → chunk-VXCCBI2W.js} +2 -2
- package/dist/{chunk-FKWHSFX4.js → chunk-XYKYXFEE.js} +1 -1
- package/dist/cli-entry-point.d.ts +9 -0
- package/dist/cli-eternal-flag.d.ts +1 -1
- package/dist/{cli-main-UOQ2ICUO.js → cli-main-IEAM6SK7.js} +3578 -1626
- package/dist/cli-main-helpers.d.ts +3 -3
- package/dist/config-doctor.d.ts +34 -3
- package/dist/context-limit.d.ts +4 -3
- package/dist/{diag-doctor-OPTB2NWY.js → diag-doctor-LFCCBPMD.js} +3 -3
- package/dist/execute-deps.d.ts +36 -7
- package/dist/{execution-L4CXQEND.js → execution-TZUGCKFU.js} +459 -77
- package/dist/execution-chimera-cascade.d.ts +1 -1
- package/dist/execution-chimera-review.d.ts +1 -1
- package/dist/execution-cleanup.d.ts +2 -1
- package/dist/execution-kanban-dispatch.d.ts +2 -1
- package/dist/execution-repl-fleet-callbacks.d.ts +3 -2
- package/dist/fleet/budget-source.d.ts +2 -1
- package/dist/fleet/host-context.d.ts +8 -1
- package/dist/fleet/host-director-event-bridges.d.ts +28 -3
- package/dist/fleet/host-event-bridge.d.ts +6 -1
- package/dist/fleet/host-explore-companion-registry.d.ts +60 -0
- package/dist/fleet/host-explore-companion.d.ts +7 -3
- package/dist/fleet/host-provider.d.ts +2 -1
- package/dist/fleet/host-session-writer.d.ts +9 -1
- package/dist/fleet/host-shadow-manager.d.ts +82 -20
- package/dist/fleet/host-shadow-pass.d.ts +9 -1
- package/dist/fleet/host-spawn-types.d.ts +9 -0
- package/dist/fleet/host-status.d.ts +2 -1
- package/dist/fleet/host-subagent-factory.d.ts +2 -1
- package/dist/fleet/host-subagent-session-audit.d.ts +56 -0
- package/dist/fleet/host-supervisor.d.ts +11 -1
- package/dist/fleet/host-task-result-report.d.ts +2 -1
- package/dist/fleet/host.d.ts +38 -6
- package/dist/fleet/status-broadcast.d.ts +2 -1
- package/dist/fleet-statusline.d.ts +2 -1
- package/dist/goal-host.d.ts +3 -2
- package/dist/{governance-V2Z42RBE.js → governance-JSGHHA2R.js} +1 -1
- package/dist/governance-hq-telemetry.d.ts +2 -2
- package/dist/{hq-2XIXGAER.js → hq-NDTJRRX3.js} +3 -3
- package/dist/hq-publisher.d.ts +1 -1
- package/dist/hq-recovery-html.d.ts +1 -6
- package/dist/hq-server/auth-state.d.ts +2 -1
- package/dist/hq-server/auth.d.ts +3 -2
- package/dist/hq-server/login-attempt-store.d.ts +2 -1
- package/dist/hq-server/mailbox-gateway-manager.d.ts +2 -1
- package/dist/hq-server/preflight.d.ts +3 -2
- package/dist/hq-server/server-lifecycle.d.ts +2 -1
- package/dist/hq-server/snapshot.d.ts +0 -9
- package/dist/hq-server/startup.d.ts +2 -3
- package/dist/hq-server/types.d.ts +2 -2
- package/dist/hq-server/upgrade-handler.d.ts +2 -1
- package/dist/hq-server/ws-leader.d.ts +0 -6
- package/dist/{hq-server-DBT3OOYD.js → hq-server-OH3SPSE2.js} +3 -13
- package/dist/hq-server.d.ts +1 -6
- package/dist/hq-static-serve.d.ts +2 -1
- package/dist/{hq-ttl-U2FAYFAT.js → hq-ttl-KUO3AU7X.js} +2 -2
- package/dist/{hq-tunnel-RFKGC4HI.js → hq-tunnel-LO55RCZE.js} +1 -1
- package/dist/hq-tunnel.d.ts +2 -1
- package/dist/index.js +113 -109
- package/dist/input-reader.d.ts +2 -1
- package/dist/kanban-dispatch-route.d.ts +27 -2
- package/dist/kanban-hq-sync.d.ts +2 -1
- package/dist/launch-hints.d.ts +2 -1
- package/dist/mailbox-bridge-bootstrap.d.ts +2 -3
- package/dist/{mailbox-serve-5S3PHG5D.js → mailbox-serve-VKQIRCCB.js} +47 -28
- package/dist/{mcp-RRPKNRSN.js → mcp-AQKSASHD.js} +1 -1
- package/dist/mcp-serve.d.ts +2 -1
- package/dist/{modeldiag-H6DKWJ2N.js → modeldiag-4NYBRSFP.js} +1 -1
- package/dist/next-task-predictor.d.ts +3 -2
- package/dist/permission-prompt.d.ts +2 -1
- package/dist/picker.d.ts +0 -18
- package/dist/plugin-management.d.ts +3 -14
- package/dist/{plugin-usage-GCTYOZPH.js → plugin-usage-AP7SJCDA.js} +2 -2
- package/dist/{plugins-EEKHCMBE.js → plugins-HQ5FU2AM.js} +3 -5
- package/dist/preflight.d.ts +2 -1
- package/dist/{proxy-wiring-G26YGP7S.js → proxy-wiring-EQB5X5YH.js} +3 -3
- package/dist/renderer.d.ts +18 -1
- package/dist/repl-client-registration.d.ts +2 -1
- package/dist/repl.d.ts +1 -1
- package/dist/{replay-XU6ZD7GM.js → replay-FJ2JBXUA.js} +1 -1
- package/dist/{sdd-runtime-GFZ3NJKS.js → sdd-runtime-FLKCSTYV.js} +3 -5
- package/dist/services/commit-message.d.ts +2 -1
- package/dist/services/sdd/state.d.ts +0 -2
- package/dist/services/sdd-runtime.d.ts +1 -1
- package/dist/services/statusline-config.d.ts +27 -4
- package/dist/session-event-wiring.d.ts +3 -5
- package/dist/{sessions-config-7Q7QJBKJ.js → sessions-config-P2LK2L32.js} +5 -1
- package/dist/sessions-doctor-EXHAZSSE.js +146 -0
- package/dist/settings-menu.d.ts +2 -1
- package/dist/shutdown-cleanup.d.ts +3 -2
- package/dist/{simpleui-dist-33VO3QHF.js → simpleui-dist-JKNRCRRK.js} +1 -1
- package/dist/simpleui-dist.d.ts +3 -2
- package/dist/slash-commands/brain-council.d.ts +0 -4
- package/dist/slash-commands/brain-status.d.ts +0 -1
- package/dist/slash-commands/command-context.d.ts +16 -2
- package/dist/slash-commands/fix-classifier.d.ts +2 -1
- package/dist/slash-commands/kanban-agent-helpers.d.ts +2 -1
- package/dist/slash-commands/kanban-board-handlers.d.ts +2 -1
- package/dist/slash-commands/kanban-lifecycle-diagnostics.d.ts +2 -1
- package/dist/slash-commands/kanban-task-subcommands.d.ts +0 -1
- package/dist/slash-commands/memory-audience.d.ts +1 -10
- package/dist/slash-commands/memory-flags.d.ts +2 -1
- package/dist/slash-commands/sdd-command-helpers.d.ts +3 -2
- package/dist/slash-commands/sdd.d.ts +2 -2
- package/dist/slash-commands/settings-mutations.d.ts +0 -1
- package/dist/slash-commands/statusline.d.ts +4 -4
- package/dist/slash-commands/telegram-pairing.d.ts +2 -2
- package/dist/slash-commands/telegram-setup.d.ts +2 -1
- package/dist/slash-commands/tier.d.ts +13 -0
- package/dist/subcommands/handlers/acp-connection-gate.d.ts +4 -3
- package/dist/subcommands/handlers/bench-run-help.d.ts +3 -8
- package/dist/subcommands/handlers/daemon-inventory.d.ts +3 -2
- package/dist/subcommands/handlers/governance.d.ts +2 -1
- package/dist/subcommands/handlers/model-smoke-test.d.ts +3 -2
- package/dist/subcommands/handlers/modeldiag-eval.d.ts +0 -4
- package/dist/subcommands/handlers/modeldiag-profiles.d.ts +1 -1
- package/dist/subcommands/handlers/models-add-help.d.ts +3 -8
- package/dist/subcommands/handlers/sessions-doctor.d.ts +3 -0
- package/dist/subcommands/handlers/update.d.ts +1 -1
- package/dist/terminal-format.d.ts +3 -2
- package/dist/tui-resource-menus.d.ts +2 -1
- package/dist/tuneup.d.ts +5 -5
- package/dist/{update-ZXNC6I6G.js → update-XKARO3CY.js} +3 -3
- package/dist/{update-check-WARHSVZA.js → update-check-LICQNYFK.js} +2 -2
- package/dist/update-check.d.ts +1 -1
- package/dist/utils/hq-ttl.d.ts +2 -1
- package/dist/webui-server/connection-handler.d.ts +34 -2
- package/dist/webui-server/prefs-seeding.d.ts +11 -1
- package/dist/webui-server/route-contexts.d.ts +45 -5
- package/dist/webui-server/session-start-payload.d.ts +13 -0
- package/dist/webui-server/setup-events.d.ts +14 -1
- package/dist/{webui-server-I53IYBW4.js → webui-server-LZOEH7O6.js} +374 -169
- package/dist/webui-server-options.d.ts +30 -4
- package/dist/wiring/brain-and-orchestration.d.ts +3 -3
- package/dist/wiring/cli-execute-builder.d.ts +3 -0
- package/dist/wiring/cli-heap-watchdog.d.ts +2 -1
- package/dist/wiring/cli-prompt-and-tools-setup.d.ts +10 -8
- package/dist/wiring/codebase-index.d.ts +2 -1
- package/dist/wiring/command-host-state.d.ts +61 -5
- package/dist/wiring/controllers.d.ts +3 -4
- package/dist/wiring/dep-watcher-bridge.d.ts +3 -2
- package/dist/wiring/dep-watcher.d.ts +2 -1
- package/dist/wiring/design-studio.d.ts +2 -1
- package/dist/wiring/director-setup.d.ts +3 -2
- package/dist/wiring/domain-terms-mirror.d.ts +2 -1
- package/dist/wiring/external-plugins.d.ts +3 -2
- package/dist/wiring/fleet-command-handlers.d.ts +2 -2
- package/dist/wiring/heap-watchdog-setup.d.ts +2 -1
- package/dist/wiring/hq-telemetry.d.ts +3 -2
- package/dist/wiring/lifecycle-plugins.d.ts +2 -2
- package/dist/wiring/management-tools.d.ts +30 -2
- package/dist/wiring/metrics.d.ts +2 -2
- package/dist/wiring/plugins.d.ts +0 -1
- package/dist/wiring/prompt-journal-recorder.d.ts +1 -1
- package/dist/wiring/provider-runtime-setup.d.ts +9 -2
- package/dist/wiring/provider-runtime.d.ts +23 -3
- package/dist/wiring/provider-status.d.ts +2 -1
- package/dist/wiring/provider-utility-tools.d.ts +2 -1
- package/dist/wiring/provider.d.ts +2 -1
- package/dist/wiring/replay-governance-setup.d.ts +2 -1
- package/dist/wiring/replay.d.ts +2 -1
- package/dist/wiring/resume-candidate.d.ts +27 -0
- package/dist/wiring/runtime-controller-deps.d.ts +8 -1
- package/dist/wiring/runtime-dispatch-state.d.ts +2 -1
- package/dist/wiring/runtime-lifecycle-deps.d.ts +2 -1
- package/dist/wiring/runtime-picker-deps.d.ts +2 -1
- package/dist/wiring/session-command-handlers.d.ts +2 -2
- package/dist/wiring/session-establishment.d.ts +2 -1
- package/dist/wiring/session-registry.d.ts +3 -2
- package/dist/wiring/session-runtime.d.ts +1 -1
- package/dist/wiring/slash-commands.d.ts +5 -4
- package/dist/wiring/teardown-registrar.d.ts +3 -2
- package/dist/wiring/vector-memory-setup.d.ts +3 -2
- package/dist/wiring/wrongtrace-hooks.d.ts +1 -1
- package/dist/wiring/wrongtrace-telemetry.d.ts +2 -1
- package/dist/{wrongtrace-telemetry-6M2CCBX5.js → wrongtrace-telemetry-FNLANZ5I.js} +1 -1
- package/package.json +30 -30
- package/dist/auth-menu.d.ts +0 -7
- package/dist/chunk-WHOIR577.js +0 -1
- package/dist/webui-server/terminal-log-view.d.ts +0 -47
- package/dist/wiring/tools.d.ts +0 -29
package/dist/mcp-serve.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type { SubcommandDeps } from './subcommands/contracts.js';
|
|
|
14
14
|
* "flag present but no list" as an error, never as "no whitelist".
|
|
15
15
|
*/
|
|
16
16
|
export declare function parseToolsFlag(flags: Record<string, string | boolean>, positional?: readonly string[]): Set<string> | null;
|
|
17
|
-
|
|
17
|
+
interface SelectedMcpServeContent {
|
|
18
18
|
resources: MCPServerResource[];
|
|
19
19
|
prompts: MCPServerPrompt[];
|
|
20
20
|
}
|
|
@@ -50,4 +50,5 @@ export declare function makeServeContext(cwd: string, projectRoot: string, signa
|
|
|
50
50
|
*/
|
|
51
51
|
export declare function selectExposedTools(registry: ToolRegistry, ctx: Context, policy: PermissionPolicy, whitelist: Set<string> | null): Promise<Tool[]>;
|
|
52
52
|
export declare function serveMcpStdio(deps: SubcommandDeps, positional?: readonly string[]): Promise<number>;
|
|
53
|
+
export {};
|
|
53
54
|
//# sourceMappingURL=mcp-serve.d.ts.map
|
|
@@ -13,7 +13,7 @@ import type { TodoItem } from '@wrongstack/core/agent';
|
|
|
13
13
|
import type { CommitLLMProvider } from './services/commit-message.js';
|
|
14
14
|
/** Provider shape required to predict — same structural contract as commit-llm. */
|
|
15
15
|
export type PredictLLMProvider = CommitLLMProvider;
|
|
16
|
-
|
|
16
|
+
interface PredictionInput {
|
|
17
17
|
/** The user's request that kicked off the turn we just finished. */
|
|
18
18
|
userRequest: string;
|
|
19
19
|
/** The agent's final assistant text for the turn (its summary of what it did). */
|
|
@@ -21,7 +21,7 @@ export interface PredictionInput {
|
|
|
21
21
|
/** The current live todo list, used as a strong signal for what's left. */
|
|
22
22
|
todos: readonly TodoItem[];
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
interface PredictOpts {
|
|
25
25
|
provider: PredictLLMProvider;
|
|
26
26
|
model: string;
|
|
27
27
|
/** Max predictions to return. Default 3. */
|
|
@@ -42,4 +42,5 @@ export declare function parsePredictions(raw: string, max?: number): string[];
|
|
|
42
42
|
* never let prediction break the turn.
|
|
43
43
|
*/
|
|
44
44
|
export declare function predictNextTasks(input: PredictionInput, opts: PredictOpts): Promise<string[]>;
|
|
45
|
+
export {};
|
|
45
46
|
//# sourceMappingURL=next-task-predictor.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputReader, Tool } from '@wrongstack/core/types';
|
|
2
|
-
|
|
2
|
+
type PromptDecision = 'yes' | 'no' | 'always' | 'deny';
|
|
3
3
|
/** Signature the Agent expects for confirming tool calls. */
|
|
4
4
|
export type ConfirmAwaiter = (tool: Tool, input: unknown, toolUseId: string, suggestedPattern: string) => Promise<'yes' | 'no' | 'always' | 'deny'>;
|
|
5
5
|
export declare function makePromptDelegate(reader: InputReader): (tool: Tool, input: unknown, suggestedPattern: string) => Promise<PromptDecision>;
|
|
@@ -8,4 +8,5 @@ export declare function makePromptDelegate(reader: InputReader): (tool: Tool, in
|
|
|
8
8
|
* with the ConfirmAwaiter type signature expected by the Agent.
|
|
9
9
|
*/
|
|
10
10
|
export declare function makeConfirmAwaiter(reader: InputReader): ConfirmAwaiter;
|
|
11
|
+
export {};
|
|
11
12
|
//# sourceMappingURL=permission-prompt.d.ts.map
|
package/dist/picker.d.ts
CHANGED
|
@@ -4,24 +4,6 @@ import type { TerminalRenderer } from './renderer.js';
|
|
|
4
4
|
export { applyPickerKey, type ProviderPickerState } from './picker-key-state.js';
|
|
5
5
|
export { filterModels, LIVE_PICKER_MAX_VISIBLE, renderLiveModelList, } from './picker-model-picker.js';
|
|
6
6
|
export { codexPickerPreamble } from './picker-ui.js';
|
|
7
|
-
/**
|
|
8
|
-
* Filter providers by a free-text query: case-insensitive substring match
|
|
9
|
-
* against the provider id OR display name. An empty/whitespace query returns
|
|
10
|
-
* all providers (as a copy). Input order is preserved. Powers the live
|
|
11
|
-
* type-to-filter provider picker.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Append synthetic entries for the built-in local-server presets
|
|
15
|
-
* (OmniRoute / Ollama / vLLM / LM Studio) that aren't already present in
|
|
16
|
-
* the merged list. These are keyless loopback gateways, so they pass the
|
|
17
|
-
* `isKeylessLocalProvider` filter and become immediately selectable even
|
|
18
|
-
* on a fresh install with no config and no catalog entry — mirroring the
|
|
19
|
-
* `wstack auth local` shortcut. An entry is skipped when an id-match
|
|
20
|
-
* already exists (catalog or saved config), so a user's customized
|
|
21
|
-
* provider always wins over the preset default. Mutates and returns
|
|
22
|
-
* `merged` for call-site convenience. Pure aside from the push.
|
|
23
|
-
*/
|
|
24
|
-
export declare function appendLocalPresetProviders(merged: ResolvedProvider[]): ResolvedProvider[];
|
|
25
7
|
export declare function filterProviders(query: string, providers: ResolvedProvider[]): ResolvedProvider[];
|
|
26
8
|
/**
|
|
27
9
|
* Render the live type-to-filter provider view as one string: the query line,
|
|
@@ -2,16 +2,7 @@ import type { Config, PluginConfig, PluginManagerConfig } from '@wrongstack/core
|
|
|
2
2
|
import { PLUGIN_AUDIT_ENTRIES, type PluginAuditEntry } from '@wrongstack/plugins/plugin-audit-catalog';
|
|
3
3
|
export type { PluginAuditEntry };
|
|
4
4
|
export { PLUGIN_AUDIT_ENTRIES };
|
|
5
|
-
|
|
6
|
-
readonly alias: 'telegram';
|
|
7
|
-
readonly specifier: '@wrongstack/telegram';
|
|
8
|
-
readonly description: 'Telegram bridge for prompts, notifications, and slash commands.';
|
|
9
|
-
}, {
|
|
10
|
-
readonly alias: 'lsp';
|
|
11
|
-
readonly specifier: '@wrongstack/plug-lsp';
|
|
12
|
-
readonly description: 'Language Server Protocol tools for code intelligence.';
|
|
13
|
-
}];
|
|
14
|
-
export interface PluginManagementDeps {
|
|
5
|
+
interface PluginManagementDeps {
|
|
15
6
|
config: Config;
|
|
16
7
|
configPath: string;
|
|
17
8
|
/** Override `~/.wrongstack` for tests. Defaults to the real home dir. */
|
|
@@ -19,12 +10,12 @@ export interface PluginManagementDeps {
|
|
|
19
10
|
/** Injectable package-manager runner for tests. */
|
|
20
11
|
runPackageManager?: ((pm: string, args: readonly string[], cwd: string) => Promise<PackageManagerRunResult>) | undefined;
|
|
21
12
|
}
|
|
22
|
-
|
|
13
|
+
interface PackageManagerRunResult {
|
|
23
14
|
code: number | null;
|
|
24
15
|
stdout: string;
|
|
25
16
|
stderr: string;
|
|
26
17
|
}
|
|
27
|
-
|
|
18
|
+
interface PluginManagementResult {
|
|
28
19
|
code: number;
|
|
29
20
|
level: 'output' | 'info' | 'error';
|
|
30
21
|
message: string;
|
|
@@ -41,8 +32,6 @@ export interface PluginManagementResult {
|
|
|
41
32
|
restartRequired?: boolean | undefined;
|
|
42
33
|
}
|
|
43
34
|
export declare function runPluginManagementCommand(args: string[], deps: PluginManagementDeps): Promise<PluginManagementResult>;
|
|
44
|
-
export declare function resolvePluginSpecifier(input: string): string;
|
|
45
|
-
export declare function renderOfficialPlugins(config?: Config): string;
|
|
46
35
|
export declare function renderConfiguredPlugins(config: Config): string;
|
|
47
36
|
export declare function renderPluginAuditReport(config: Config): string;
|
|
48
37
|
//# sourceMappingURL=plugin-management.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPluginManagementCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QC5I4VWZ.js";
|
|
4
4
|
import {
|
|
5
5
|
restoreFlags
|
|
6
6
|
} from "./chunk-CSAPOCBP.js";
|
|
@@ -41,4 +41,4 @@ export {
|
|
|
41
41
|
pluginCmd,
|
|
42
42
|
usageCmd
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=plugin-usage-
|
|
44
|
+
//# sourceMappingURL=plugin-usage-AP7SJCDA.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
BUILTIN_PLUGIN_CONFIG_NAMES,
|
|
3
2
|
BUILTIN_PLUGIN_FACTORIES,
|
|
4
3
|
DEPRECATED_PLUGIN_NAMES,
|
|
5
4
|
_resetDeprecatedWarningsForTests,
|
|
@@ -7,12 +6,11 @@ import {
|
|
|
7
6
|
pluginNameFromSpec,
|
|
8
7
|
setupPlugins,
|
|
9
8
|
warnIfDeprecatedPluginName
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-GKHUHAIK.js";
|
|
10
|
+
import "./chunk-QC5I4VWZ.js";
|
|
12
11
|
import "./chunk-TYO2OVAD.js";
|
|
13
12
|
import "./chunk-7OCVIDC7.js";
|
|
14
13
|
export {
|
|
15
|
-
BUILTIN_PLUGIN_CONFIG_NAMES,
|
|
16
14
|
BUILTIN_PLUGIN_FACTORIES,
|
|
17
15
|
DEPRECATED_PLUGIN_NAMES,
|
|
18
16
|
_resetDeprecatedWarningsForTests,
|
|
@@ -21,4 +19,4 @@ export {
|
|
|
21
19
|
setupPlugins,
|
|
22
20
|
warnIfDeprecatedPluginName
|
|
23
21
|
};
|
|
24
|
-
//# sourceMappingURL=plugins-
|
|
22
|
+
//# sourceMappingURL=plugins-HQ5FU2AM.js.map
|
package/dist/preflight.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config } from '@wrongstack/core/types';
|
|
2
2
|
import type { UpdateInfo } from './update-check.js';
|
|
3
|
-
|
|
3
|
+
interface PreflightResult {
|
|
4
4
|
/** The (possibly refreshed) update info, after the 2-second
|
|
5
5
|
* quick-check. Undefined if the check was aborted. */
|
|
6
6
|
updateInfo: UpdateInfo | undefined;
|
|
@@ -55,4 +55,5 @@ export declare function applyDebugStreamSeed(config: Config): Promise<void>;
|
|
|
55
55
|
* it back into the `BootContext` for downstream consumers.
|
|
56
56
|
*/
|
|
57
57
|
export declare function runPreflight(config: Config, initialUpdateInfo: UpdateInfo | undefined): Promise<PreflightResult>;
|
|
58
|
+
export {};
|
|
58
59
|
//# sourceMappingURL=preflight.d.ts.map
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
awaitFirstWrongProxyProbe,
|
|
4
4
|
bootstrapWrongProxy,
|
|
5
5
|
shutdownWrongProxy
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-SYIBTG3X.js";
|
|
7
|
+
import "./chunk-G3IMKQRH.js";
|
|
8
8
|
import "./chunk-7OCVIDC7.js";
|
|
9
9
|
export {
|
|
10
10
|
applyWrongProxyPrefs,
|
|
@@ -12,4 +12,4 @@ export {
|
|
|
12
12
|
bootstrapWrongProxy,
|
|
13
13
|
shutdownWrongProxy
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=proxy-wiring-
|
|
15
|
+
//# sourceMappingURL=proxy-wiring-EQB5X5YH.js.map
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContentBlock, Renderer, TextBlock, ToolResultRenderMode } from '@wrongstack/core/types';
|
|
2
|
-
|
|
2
|
+
interface TerminalRendererOptions {
|
|
3
3
|
out?: NodeJS.WriteStream | undefined;
|
|
4
4
|
err?: NodeJS.WriteStream | undefined;
|
|
5
5
|
}
|
|
@@ -61,6 +61,22 @@ export declare class TerminalRenderer implements Renderer {
|
|
|
61
61
|
writeWarning(text: string): void;
|
|
62
62
|
writeError(text: string): void;
|
|
63
63
|
writeInfo(text: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Write text to stderr verbatim: no glyph prefix, no markdown processing.
|
|
66
|
+
*
|
|
67
|
+
* Deliberately stricter than writeWarning/writeError/writeInfo, which emit
|
|
68
|
+
* *diagnostics* and are suppressed only when a TUI owns the terminal (so
|
|
69
|
+
* they survive silent mode). This method is for informational mirrors of
|
|
70
|
+
* stdout output, where the stdout copy already carries the full content —
|
|
71
|
+
* in silent mode the operator asked for machine-only output, so the mirror
|
|
72
|
+
* is dropped rather than leaked onto a quieter stream. It therefore honors
|
|
73
|
+
* the full {@link suppressStdout} gate.
|
|
74
|
+
*
|
|
75
|
+
* Used by `wstack mailbox serve` to route the human-readable startup banner
|
|
76
|
+
* away from stdout, keeping the mailbox_serve_started JSON line cleanly
|
|
77
|
+
* pipeable (`mailbox serve | jq`).
|
|
78
|
+
*/
|
|
79
|
+
writeStderr(text: string): void;
|
|
64
80
|
clear(): void;
|
|
65
81
|
/**
|
|
66
82
|
* Write a flashy agent completion banner for delegate tool results.
|
|
@@ -85,4 +101,5 @@ export declare class TerminalRenderer implements Renderer {
|
|
|
85
101
|
messages?: Array<unknown> | undefined;
|
|
86
102
|
}): void;
|
|
87
103
|
}
|
|
104
|
+
export {};
|
|
88
105
|
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ReplOptions } from './repl-options.js';
|
|
2
|
-
|
|
2
|
+
interface ReplClientRegistration {
|
|
3
3
|
clientId: string;
|
|
4
4
|
close(): void;
|
|
5
5
|
}
|
|
6
6
|
export declare function registerReplClient(opts: ReplOptions): ReplClientRegistration;
|
|
7
|
+
export {};
|
|
7
8
|
//# sourceMappingURL=repl-client-registration.d.ts.map
|
package/dist/repl.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReplOptions } from './repl-options.js';
|
|
2
2
|
export type { ReplOptions } from './repl-options.js';
|
|
3
|
-
export {
|
|
3
|
+
export { parseSuggestionsFromOutput } from './repl-suggestions.js';
|
|
4
4
|
export declare function runRepl(opts: ReplOptions): Promise<number>;
|
|
5
5
|
//# sourceMappingURL=repl.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-ALE5KHCA.js";
|
|
2
2
|
import {
|
|
3
3
|
SDDState,
|
|
4
4
|
advanceToNextTask,
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
getActiveSDDContext,
|
|
11
11
|
getActiveSDDPhase,
|
|
12
12
|
getCurrentExecutingContext,
|
|
13
|
-
getCurrentTask,
|
|
14
13
|
getSessionState,
|
|
15
14
|
getTaskGraphId,
|
|
16
15
|
getTaskListText,
|
|
@@ -23,7 +22,7 @@ import {
|
|
|
23
22
|
trySaveImplementationPlan,
|
|
24
23
|
trySaveSpecFromAIOutput,
|
|
25
24
|
trySaveTasksFromAIOutput
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-JHUJUIOH.js";
|
|
27
26
|
import "./chunk-7OCVIDC7.js";
|
|
28
27
|
export {
|
|
29
28
|
SDDState,
|
|
@@ -36,7 +35,6 @@ export {
|
|
|
36
35
|
getActiveSDDContext,
|
|
37
36
|
getActiveSDDPhase,
|
|
38
37
|
getCurrentExecutingContext,
|
|
39
|
-
getCurrentTask,
|
|
40
38
|
getSessionState,
|
|
41
39
|
getTaskGraphId,
|
|
42
40
|
getTaskListText,
|
|
@@ -51,4 +49,4 @@ export {
|
|
|
51
49
|
trySaveSpecFromAIOutput,
|
|
52
50
|
trySaveTasksFromAIOutput
|
|
53
51
|
};
|
|
54
|
-
//# sourceMappingURL=sdd-runtime-
|
|
52
|
+
//# sourceMappingURL=sdd-runtime-FLKCSTYV.js.map
|
|
@@ -29,7 +29,7 @@ export interface CommitLLMProvider {
|
|
|
29
29
|
model: string;
|
|
30
30
|
}>;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
interface CommitLLMOpts {
|
|
33
33
|
provider: CommitLLMProvider;
|
|
34
34
|
model: string;
|
|
35
35
|
}
|
|
@@ -38,4 +38,5 @@ export interface CommitLLMOpts {
|
|
|
38
38
|
* Falls back to heuristics on failure.
|
|
39
39
|
*/
|
|
40
40
|
export declare function generateCommitMessageWithLLM(diff: string, opts: CommitLLMOpts): Promise<string>;
|
|
41
|
+
export {};
|
|
41
42
|
//# sourceMappingURL=commit-message.d.ts.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Context } from '@wrongstack/core/agent';
|
|
2
2
|
import { type AISpecBuilder, type AISpecPhase, SpecVersioning, type TaskStore, type TaskTracker } from '@wrongstack/sdd';
|
|
3
|
-
/** Key used to store SDD session state in ctx.meta for session isolation. */
|
|
4
|
-
export declare const SDD_META_KEY = "sdd.state";
|
|
5
3
|
/** Single shared SDD session state for the process lifetime. */
|
|
6
4
|
export declare class SDDState {
|
|
7
5
|
private builder;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { findSpec, gatherProjectContext, getActiveBuilder, getActiveSDDContext, getActiveSDDPhase, } from './sdd/project-context.js';
|
|
2
2
|
export { autoDetectTaskCompletion, isExplanatoryText, trySaveImplementationPlan, trySaveSpecFromAIOutput, } from './sdd/spec-detection.js';
|
|
3
3
|
export { getSessionState, SDDState, sddState } from './sdd/state.js';
|
|
4
|
-
export { advanceToNextTask, formatElapsed, getCurrentExecutingContext,
|
|
4
|
+
export { advanceToNextTask, formatElapsed, getCurrentExecutingContext, getTaskGraphId, getTaskListText, getTaskProgress, getTaskTrackerExport as getTaskTracker, getTaskTrackerExport, markTaskCompleted, renderTaskListWithProgress, trySaveTasksFromAIOutput } from './sdd/task-manager.js';
|
|
5
5
|
//# sourceMappingURL=sdd-runtime.d.ts.map
|
|
@@ -1,10 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
import type { StatuslineLines } from '@wrongstack/core/statusline';
|
|
2
|
+
/** On-disk schema version. v1 was a flat boolean map; v2 nests it under
|
|
3
|
+
* `chips` alongside the sparse per-chip `lines` assignment. */
|
|
4
|
+
export declare const STATUSLINE_CONFIG_VERSION = 2;
|
|
5
|
+
export declare const STATUSLINE_CONFIG_KEYS: readonly ['state', 'model', 'context', 'tokens', 'cache', 'cost', 'queue', 'hint', 'index', 'breaker', 'yolo', 'autonomy', 'eternal_stage', 'elapsed', 'project', 'working_dir', 'goal', 'mode', 'auto_proceed', 'git', 'sessions', 'tools', 'theme', 'token_saving', 'processes', 'version', 'dropped_tools', 'prompt_variant', 'side_effects', 'todos', 'plan', 'tasks', 'fleet', 'brain', 'debug_stream', 'enhance', 'next_steps', 'mailbox', 'fleet_agents', 'memory_context'];
|
|
2
6
|
export type StatuslineConfigKey = (typeof STATUSLINE_CONFIG_KEYS)[number];
|
|
3
7
|
export type StatuslineConfig = {
|
|
4
8
|
[K in StatuslineConfigKey]?: boolean | undefined;
|
|
5
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* v2 statusline.json document: the chip on/off map plus the sparse
|
|
12
|
+
* per-chip line assignment (`StatuslineLines` from the framework-free core
|
|
13
|
+
* contract). Absent `lines` keys mean "render on the contract's default
|
|
14
|
+
* line" (`DEFAULT_LINES`).
|
|
15
|
+
*/
|
|
16
|
+
export interface StatuslineDocument {
|
|
17
|
+
version: typeof STATUSLINE_CONFIG_VERSION;
|
|
18
|
+
chips: StatuslineConfig;
|
|
19
|
+
lines: StatuslineLines;
|
|
20
|
+
}
|
|
6
21
|
export declare const DEFAULTS: StatuslineConfig;
|
|
7
|
-
export declare function loadStatuslineConfig(): Promise<
|
|
8
|
-
export declare function ensureStatuslineConfig(): Promise<
|
|
9
|
-
export declare function saveStatuslineConfig(config:
|
|
22
|
+
export declare function loadStatuslineConfig(): Promise<StatuslineDocument>;
|
|
23
|
+
export declare function ensureStatuslineConfig(): Promise<StatuslineDocument>;
|
|
24
|
+
export declare function saveStatuslineConfig(config: StatuslineDocument): Promise<void>;
|
|
25
|
+
/** Load just the per-chip line assignment (defaults to {} when unassigned). */
|
|
26
|
+
export declare function loadStatuslineLines(): Promise<StatuslineLines>;
|
|
27
|
+
/**
|
|
28
|
+
* Persist a new line assignment while preserving the stored chip toggles.
|
|
29
|
+
* Values are re-normalized (unknown keys dropped, clamped) so a malformed
|
|
30
|
+
* caller cannot write garbage to disk.
|
|
31
|
+
*/
|
|
32
|
+
export declare function saveStatuslineLines(lines: StatuslineLines): Promise<void>;
|
|
10
33
|
//# sourceMappingURL=statusline-config.d.ts.map
|
|
@@ -16,7 +16,7 @@ export interface ErrorEntry {
|
|
|
16
16
|
code: string;
|
|
17
17
|
message: string;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
interface WireSessionEventsDeps {
|
|
20
20
|
evOn: (event: string, handler: (...args: any[]) => void) => void;
|
|
21
21
|
/** Concrete bus is required for Chronicle lifecycle subscriptions. */
|
|
22
22
|
events?: EventBus | undefined;
|
|
@@ -42,18 +42,16 @@ export interface WireSessionEventsDeps {
|
|
|
42
42
|
};
|
|
43
43
|
tuiOwnsScreen?: boolean;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
interface WireSessionEventsResult {
|
|
46
46
|
errorRing: ErrorEntry[];
|
|
47
47
|
sessionBridge: SessionEventBridge;
|
|
48
48
|
appendSessionEvent: (sessionId: string | undefined, event: Parameters<SessionEventBridge['append']>[0]) => void;
|
|
49
49
|
chronicleJournal?: ChronicleEventSink | undefined;
|
|
50
50
|
disposeChronicle: () => Promise<void>;
|
|
51
51
|
}
|
|
52
|
-
/** `0` disables auto-purge; positive values are floored at 7 days so a
|
|
53
|
-
* project-committed config cannot flush recent evidence. */
|
|
54
|
-
export declare function resolveChronicleRetentionDays(config: Record<string, unknown>): number;
|
|
55
52
|
/** Wire SessionEventBridge, appendSessionEvent, error ring, and tool-lifecycle
|
|
56
53
|
* session audit events. Returns the sessionBridge (for compaction / audit-level
|
|
57
54
|
* changes) and the error ring array (for /diag). */
|
|
58
55
|
export declare function wireSessionEvents(deps: WireSessionEventsDeps): WireSessionEventsResult;
|
|
56
|
+
export {};
|
|
59
57
|
//# sourceMappingURL=session-event-wiring.d.ts.map
|
|
@@ -243,6 +243,10 @@ var sessionsCmd = async (args, deps) => {
|
|
|
243
243
|
if (sub === "fleet") {
|
|
244
244
|
return sessionsFleetCmd(args.slice(1), deps);
|
|
245
245
|
}
|
|
246
|
+
if (sub === "doctor") {
|
|
247
|
+
const { sessionsDoctorCmd } = await import("./sessions-doctor-EXHAZSSE.js");
|
|
248
|
+
return sessionsDoctorCmd(args.slice(1), deps);
|
|
249
|
+
}
|
|
246
250
|
if (!deps.sessionStore) {
|
|
247
251
|
deps.renderer.writeError("No session store available.");
|
|
248
252
|
return 1;
|
|
@@ -415,4 +419,4 @@ export {
|
|
|
415
419
|
configCmd,
|
|
416
420
|
sessionsCmd
|
|
417
421
|
};
|
|
418
|
-
//# sourceMappingURL=sessions-config-
|
|
422
|
+
//# sourceMappingURL=sessions-config-P2LK2L32.js.map
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import "./chunk-7OCVIDC7.js";
|
|
2
|
+
|
|
3
|
+
// src/subcommands/handlers/sessions-doctor.ts
|
|
4
|
+
import {
|
|
5
|
+
diagnoseSessions,
|
|
6
|
+
repairSessionSummaries
|
|
7
|
+
} from "@wrongstack/core/storage";
|
|
8
|
+
import { color, toErrorMessage } from "@wrongstack/core/utils";
|
|
9
|
+
var ICON = { error: color.red("\u2717"), warn: color.amber("!"), info: color.dim("\xB7") };
|
|
10
|
+
function fmtBytes(bytes) {
|
|
11
|
+
if (bytes >= 1e9) return `${(bytes / 1e9).toFixed(2)} GB`;
|
|
12
|
+
if (bytes >= 1e6) return `${(bytes / 1e6).toFixed(1)} MB`;
|
|
13
|
+
if (bytes >= 1e3) return `${Math.round(bytes / 1e3)} KB`;
|
|
14
|
+
return `${bytes} B`;
|
|
15
|
+
}
|
|
16
|
+
function notable(session) {
|
|
17
|
+
return session.findings.some((f) => f.severity !== "info");
|
|
18
|
+
}
|
|
19
|
+
function renderReport(report, limit) {
|
|
20
|
+
const lines = [
|
|
21
|
+
color.bold("Session doctor"),
|
|
22
|
+
` scanned: ${report.totals.sessions} session(s) in ${report.sessionsDir}`,
|
|
23
|
+
` on disk: ${fmtBytes(report.totals.bytes)}`
|
|
24
|
+
];
|
|
25
|
+
if (report.totals.snapshotBytes > 0) {
|
|
26
|
+
const share = Math.round(
|
|
27
|
+
report.totals.snapshotBytes / Math.max(1, report.totals.bytes) * 100
|
|
28
|
+
);
|
|
29
|
+
lines.push(
|
|
30
|
+
` snapshots: ${fmtBytes(report.totals.snapshotBytes)} (${share}%) \u2014 superseded conversation snapshots, reclaimed by pruning old sessions, never by rewriting them`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
if (report.unreadable.length > 0) {
|
|
34
|
+
lines.push("", color.red(`Unreadable journals (${report.unreadable.length}):`));
|
|
35
|
+
for (const entry of report.unreadable.slice(0, limit)) {
|
|
36
|
+
lines.push(` ${ICON.error} ${color.cyan(entry.id)} \u2014 ${entry.reason}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const counts = Object.entries(report.byCode).sort((a, b) => b[1] - a[1]);
|
|
40
|
+
if (counts.length > 0) {
|
|
41
|
+
lines.push("", color.bold("Findings"));
|
|
42
|
+
for (const [code, count] of counts) lines.push(` ${count.toString().padStart(5)} ${code}`);
|
|
43
|
+
}
|
|
44
|
+
const interesting = report.sessions.filter(notable);
|
|
45
|
+
if (interesting.length > 0) {
|
|
46
|
+
lines.push("", color.bold(`Sessions needing attention (${interesting.length})`));
|
|
47
|
+
for (const session of interesting.slice(0, limit)) {
|
|
48
|
+
lines.push(` ${color.cyan(session.id)} ${color.dim(fmtBytes(session.bytes))}`);
|
|
49
|
+
for (const finding of session.findings) {
|
|
50
|
+
if (finding.severity === "info") continue;
|
|
51
|
+
const fix = finding.fix ? color.dim(` \u2192 fixable: ${finding.fix}`) : "";
|
|
52
|
+
lines.push(` ${ICON[finding.severity]} ${finding.detail}${fix}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (interesting.length > limit) {
|
|
56
|
+
lines.push(color.dim(` \u2026 ${interesting.length - limit} more (raise --limit to see them)`));
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
lines.push("", color.green("No session needs attention."));
|
|
60
|
+
}
|
|
61
|
+
return lines;
|
|
62
|
+
}
|
|
63
|
+
var sessionsDoctorCmd = async (args, deps) => {
|
|
64
|
+
const store = deps.sessionStore;
|
|
65
|
+
const sessionsDir = deps.paths.projectSessions;
|
|
66
|
+
const fix = args.includes("--fix") || deps.flags?.fix === true;
|
|
67
|
+
const asJson = args.includes("--json") || deps.flags?.json === true;
|
|
68
|
+
const rawLimit = deps.flags?.limit ?? (args.includes("--limit") ? args[args.indexOf("--limit") + 1] : void 0);
|
|
69
|
+
const parsedLimit = Number(rawLimit);
|
|
70
|
+
const limit = Number.isInteger(parsedLimit) && parsedLimit > 0 ? parsedLimit : 20;
|
|
71
|
+
let lastTick = 0;
|
|
72
|
+
const report = await diagnoseSessions({
|
|
73
|
+
sessionsDir,
|
|
74
|
+
onProgress: ({ scanned, total, id }) => {
|
|
75
|
+
if (asJson || !id) return;
|
|
76
|
+
const now = Date.now();
|
|
77
|
+
if (now - lastTick < 250) return;
|
|
78
|
+
lastTick = now;
|
|
79
|
+
deps.renderer.write(`\r scanning ${scanned}/${total} \u2026 ${id.slice(0, 48)}\x1B[K`);
|
|
80
|
+
}
|
|
81
|
+
}).catch((error) => {
|
|
82
|
+
deps.renderer.writeError(`Session scan failed: ${toErrorMessage(error)}
|
|
83
|
+
`);
|
|
84
|
+
return null;
|
|
85
|
+
});
|
|
86
|
+
if (!report) return 1;
|
|
87
|
+
if (!asJson) deps.renderer.write("\r\x1B[K");
|
|
88
|
+
if (!fix) {
|
|
89
|
+
if (asJson) {
|
|
90
|
+
deps.renderer.write(`${JSON.stringify(report, null, 2)}
|
|
91
|
+
`);
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
const lines2 = renderReport(report, limit);
|
|
95
|
+
const fixable = report.sessions.filter((s) => s.findings.some((f) => f.fix)).length;
|
|
96
|
+
if (fixable > 0) {
|
|
97
|
+
lines2.push(
|
|
98
|
+
"",
|
|
99
|
+
color.dim(`Run \`wstack sessions doctor --fix\` to repair ${fixable} of them.`)
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
deps.renderer.write(`${lines2.join("\n")}
|
|
103
|
+
`);
|
|
104
|
+
return 0;
|
|
105
|
+
}
|
|
106
|
+
const repair = await repairSessionSummaries({
|
|
107
|
+
report,
|
|
108
|
+
onProgress: ({ repaired, total, id }) => {
|
|
109
|
+
if (asJson || !id) return;
|
|
110
|
+
deps.renderer.write(`\r rebuilding summaries ${repaired}/${total} \u2026 ${id.slice(0, 48)}\x1B[K`);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
if (!asJson) deps.renderer.write("\r\x1B[K");
|
|
114
|
+
let indexed = null;
|
|
115
|
+
if (store?.rebuildIndex) {
|
|
116
|
+
indexed = await store.rebuildIndex().catch((error) => {
|
|
117
|
+
deps.renderer.writeError(`Catalog rebuild failed: ${toErrorMessage(error)}
|
|
118
|
+
`);
|
|
119
|
+
return null;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (asJson) {
|
|
123
|
+
deps.renderer.write(`${JSON.stringify({ report, repair, indexed }, null, 2)}
|
|
124
|
+
`);
|
|
125
|
+
return repair.failed.length > 0 ? 1 : 0;
|
|
126
|
+
}
|
|
127
|
+
const lines = renderReport(report, limit);
|
|
128
|
+
lines.push("", color.bold("Repairs"));
|
|
129
|
+
lines.push(` ${color.green("\u2713")} rebuilt ${repair.repaired.length} summary sidecar(s)`);
|
|
130
|
+
if (indexed !== null) lines.push(` ${color.green("\u2713")} re-indexed ${indexed} session(s)`);
|
|
131
|
+
for (const failure of repair.failed) {
|
|
132
|
+
lines.push(` ${ICON.error} ${color.cyan(failure.id)} \u2014 ${failure.reason}`);
|
|
133
|
+
}
|
|
134
|
+
lines.push(
|
|
135
|
+
color.dim(
|
|
136
|
+
" Journals were not modified. Snapshot bytes are reclaimed with `wstack sessions prune`."
|
|
137
|
+
)
|
|
138
|
+
);
|
|
139
|
+
deps.renderer.write(`${lines.join("\n")}
|
|
140
|
+
`);
|
|
141
|
+
return repair.failed.length > 0 ? 1 : 0;
|
|
142
|
+
};
|
|
143
|
+
export {
|
|
144
|
+
sessionsDoctorCmd
|
|
145
|
+
};
|
|
146
|
+
//# sourceMappingURL=sessions-doctor-EXHAZSSE.js.map
|
package/dist/settings-menu.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type SecretVault } from '@wrongstack/core/types';
|
|
|
3
3
|
/** Configuration and storage dependencies needed to persist a setting.
|
|
4
4
|
* This is safe to call from non-interactive surfaces such as the TUI,
|
|
5
5
|
* headless runs, and the arg-driven `/settings` slash command. */
|
|
6
|
-
|
|
6
|
+
interface PersistSettingDeps {
|
|
7
7
|
configStore: ConfigStore;
|
|
8
8
|
/** Path to the active profile config (~/.wrongstack/profiles/<name>/config.json). */
|
|
9
9
|
profileConfigPath: string;
|
|
@@ -85,4 +85,5 @@ export declare function deriveFsAccessPair(input: {
|
|
|
85
85
|
allowOutsideProjectRoot: boolean;
|
|
86
86
|
restrictToProjectRoot: boolean;
|
|
87
87
|
} | undefined;
|
|
88
|
+
export {};
|
|
88
89
|
//# sourceMappingURL=settings-menu.d.ts.map
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* — registry writes, unsubscribe, dispose, etc. The wrapper only handles the
|
|
20
20
|
* process-exit handshake around it.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
interface ShutdownCleanup {
|
|
23
23
|
/**
|
|
24
24
|
* Async cleanup. Called exactly once across all signals. May throw — errors
|
|
25
25
|
* are swallowed so a stuck cleanup can't wedge the exit path.
|
|
@@ -28,7 +28,7 @@ export interface ShutdownCleanup {
|
|
|
28
28
|
/** Exit code to use on a clean shutdown (default 0). */
|
|
29
29
|
exitCode?: number;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
interface ShutdownHandle {
|
|
32
32
|
/** Install SIGINT + SIGTERM + beforeExit listeners. Idempotent. */
|
|
33
33
|
install: () => void;
|
|
34
34
|
/** Uninstall listeners (for tests). */
|
|
@@ -41,4 +41,5 @@ export interface ShutdownHandle {
|
|
|
41
41
|
* installs signal handlers that call it once and let the event loop drain.
|
|
42
42
|
*/
|
|
43
43
|
export declare function createGracefulShutdown(cleanup: ShutdownCleanup): ShutdownHandle;
|
|
44
|
+
export {};
|
|
44
45
|
//# sourceMappingURL=shutdown-cleanup.d.ts.map
|
package/dist/simpleui-dist.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
interface SimpleUiDistDeps {
|
|
2
2
|
resolvePackageJson?: (id: string) => string;
|
|
3
3
|
exists?: (file: string) => boolean;
|
|
4
4
|
}
|
|
5
5
|
/** Resolve the independent SimpleUI frontend and fail closed if it is unbuilt. */
|
|
6
6
|
export declare function resolveSimpleUiDistDir(deps?: SimpleUiDistDeps): string;
|
|
7
|
-
|
|
7
|
+
interface EnsureSimpleUiDistDeps extends SimpleUiDistDeps {
|
|
8
8
|
/** Override the build command runner (tests). Receives the workspace root cwd. */
|
|
9
9
|
runBuild?: (cwd: string) => void | Promise<void>;
|
|
10
10
|
/** Override the workspace-root finder (tests). Receives the simpleui package dir. */
|
|
@@ -20,4 +20,5 @@ export interface EnsureSimpleUiDistDeps extends SimpleUiDistDeps {
|
|
|
20
20
|
* printed to stderr so the user sees what happened.
|
|
21
21
|
*/
|
|
22
22
|
export declare function ensureSimpleUiDistDir(deps?: EnsureSimpleUiDistDeps): Promise<string>;
|
|
23
|
+
export {};
|
|
23
24
|
//# sourceMappingURL=simpleui-dist.d.ts.map
|