@wrongstack/cli 0.313.1 → 0.316.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/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 +31 -31
- 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
|
@@ -9,7 +9,13 @@ export declare function containedJsonlPath(sessionsDir: string, id: string): str
|
|
|
9
9
|
* Enrichment can *raise* a stub's lastActivityAt to its real kill time, so
|
|
10
10
|
* ordering must happen after enrichment — otherwise stale-ordered stubs crowd
|
|
11
11
|
* richer sessions out of the top-N window. Fetch a pool ~3x the requested
|
|
12
|
-
* limit, enrich, re-sort most-recent-first (store COALESCE
|
|
12
|
+
* limit, enrich, drop the empties, re-sort most-recent-first (store COALESCE
|
|
13
|
+
* order), slice.
|
|
14
|
+
*
|
|
15
|
+
* Order matters twice over: the empties are dropped AFTER enrichment (which is
|
|
16
|
+
* what gives a crashed session its evidence of activity) and BEFORE the slice
|
|
17
|
+
* (so the picker still fills up to `limit` with real sessions instead of
|
|
18
|
+
* returning a short list full of holes).
|
|
13
19
|
*/
|
|
14
20
|
export declare function selectPickerSessions(storeList: (limit: number) => Promise<SessionSummary[]>, sessionsDir: string, limit: number): Promise<SessionSummary[]>;
|
|
15
21
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ConfigStore, FleetChatVerbosity } from '@wrongstack/core/types';
|
|
2
2
|
import { type WstackPaths } from '@wrongstack/core/utils';
|
|
3
3
|
import type { LiveSettingsInput } from '../live-settings-input.js';
|
|
4
|
-
|
|
4
|
+
interface SettingsAdapterContext {
|
|
5
5
|
configStore: ConfigStore;
|
|
6
6
|
wpaths: WstackPaths;
|
|
7
7
|
fleetStreamController: {
|
|
@@ -9,7 +9,7 @@ export interface SettingsAdapterContext {
|
|
|
9
9
|
} | undefined;
|
|
10
10
|
applyLiveSettings: ((s: LiveSettingsInput) => void) | undefined;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interface SettingsAdapter {
|
|
13
13
|
getSettings: () => Record<string, unknown>;
|
|
14
14
|
saveSettings: (s: LiveSettingsInput) => Promise<string | null>;
|
|
15
15
|
}
|
|
@@ -21,4 +21,5 @@ export interface SettingsAdapter {
|
|
|
21
21
|
* syncs the in-memory store, and applies runtime effects immediately.
|
|
22
22
|
*/
|
|
23
23
|
export declare function createSettingsAdapter(ctx: SettingsAdapterContext): SettingsAdapter;
|
|
24
|
+
export {};
|
|
24
25
|
//# sourceMappingURL=tui-settings-adapter.d.ts.map
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { ConfigStore, ThemePresetId } from '@wrongstack/core/types';
|
|
16
16
|
import { type WstackPaths } from '@wrongstack/core/utils';
|
|
17
|
-
|
|
17
|
+
interface ThemeAdapterDeps {
|
|
18
18
|
configStore: ConfigStore;
|
|
19
19
|
wpaths: Pick<WstackPaths, 'profileConfig'>;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
interface ThemeAdapter {
|
|
22
22
|
/** Read the live preset (memory-backed). Returns undefined when unset. */
|
|
23
23
|
getThemePreset: () => ThemePresetId | undefined;
|
|
24
24
|
/**
|
|
@@ -30,4 +30,5 @@ export interface ThemeAdapter {
|
|
|
30
30
|
saveThemePreset: (preset: ThemePresetId) => Promise<void>;
|
|
31
31
|
}
|
|
32
32
|
export declare function createThemeAdapter({ configStore, wpaths }: ThemeAdapterDeps): ThemeAdapter;
|
|
33
|
+
export {};
|
|
33
34
|
//# sourceMappingURL=tui-theme-adapter.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const WEBUI_SESSION_CHILD_PROTOCOL_VERSION = 1;
|
|
2
2
|
export declare const WEBUI_SESSION_CHILD_CAPABILITIES: readonly ['multi-session-child', 'single-port-http-ws', 'session-affinity', 'graceful-shutdown'];
|
|
3
|
-
|
|
3
|
+
type WebuiSessionChildPhase = 'validate_args' | 'boot_config' | 'claim_session' | 'create_session' | 'resume_session' | 'bind_port' | 'register_instance' | 'register_session' | 'start_server' | 'unknown';
|
|
4
4
|
export interface WebuiSessionChildOptions {
|
|
5
5
|
enabled: boolean;
|
|
6
6
|
projectRoot: string;
|
|
@@ -66,17 +66,6 @@ export interface WebuiSessionChildReadyPayload {
|
|
|
66
66
|
};
|
|
67
67
|
capabilities: string[];
|
|
68
68
|
}
|
|
69
|
-
export interface WebuiSessionChildErrorPayload {
|
|
70
|
-
type: 'webui.session_child.error';
|
|
71
|
-
protocolVersion: number;
|
|
72
|
-
runtimeId?: string | undefined;
|
|
73
|
-
parentShellId?: string | undefined;
|
|
74
|
-
pid: number;
|
|
75
|
-
phase: WebuiSessionChildPhase;
|
|
76
|
-
recoverable: boolean;
|
|
77
|
-
message: string;
|
|
78
|
-
details?: Record<string, unknown> | undefined;
|
|
79
|
-
}
|
|
80
69
|
export declare function parseWebuiSessionChildOptions(flags: Record<string, string | boolean>): WebuiSessionChildOptions | null;
|
|
81
70
|
export declare function writeWebuiSessionChildReady(readyFile: string, payload: WebuiSessionChildReadyPayload): Promise<void>;
|
|
82
71
|
export declare function writeWebuiSessionChildError(readyFile: string, input: {
|
|
@@ -88,4 +77,5 @@ export declare function writeWebuiSessionChildError(readyFile: string, input: {
|
|
|
88
77
|
error: unknown;
|
|
89
78
|
details?: Record<string, unknown> | undefined;
|
|
90
79
|
}): Promise<void>;
|
|
80
|
+
export {};
|
|
91
81
|
//# sourceMappingURL=webui-session-child.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {
|
|
2
|
+
persistConfigSetting
|
|
3
|
+
} from "./chunk-JACOMTIH.js";
|
|
4
|
+
import {
|
|
5
|
+
activeProfileConfigPath
|
|
6
|
+
} from "./chunk-YMXXOOFN.js";
|
|
7
|
+
import "./chunk-7OCVIDC7.js";
|
|
8
|
+
|
|
9
|
+
// src/boot/boot-auto-thin.ts
|
|
10
|
+
import {
|
|
11
|
+
createToolUsageSource,
|
|
12
|
+
filterUnderused
|
|
13
|
+
} from "@wrongstack/core/observability";
|
|
14
|
+
import { noOpVault } from "@wrongstack/core/security";
|
|
15
|
+
import { toErrorMessage } from "@wrongstack/core/utils";
|
|
16
|
+
function resolvePolicy(config) {
|
|
17
|
+
return {
|
|
18
|
+
idleDays: typeof config.idleDays === "number" && config.idleDays > 0 ? config.idleDays : 30,
|
|
19
|
+
minInvocations: typeof config.minInvocations === "number" && config.minInvocations >= 0 ? config.minInvocations : 3
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function neverAutoThinFilter(candidates, never) {
|
|
23
|
+
if (!never || never.length === 0) return candidates.slice();
|
|
24
|
+
const blocked = new Set(never);
|
|
25
|
+
return candidates.filter((c) => !blocked.has(c.name));
|
|
26
|
+
}
|
|
27
|
+
async function runBootAutoThin(deps) {
|
|
28
|
+
const policy = resolvePolicy(deps.config);
|
|
29
|
+
const source = createToolUsageSource({
|
|
30
|
+
...deps.chronicle ? { chronicle: deps.chronicle } : {},
|
|
31
|
+
...deps.bridge ? { bridge: deps.bridge } : {},
|
|
32
|
+
...deps.now ? { now: deps.now } : {}
|
|
33
|
+
});
|
|
34
|
+
let raw = [];
|
|
35
|
+
try {
|
|
36
|
+
raw = await source.candidates(policy);
|
|
37
|
+
} catch (_error) {
|
|
38
|
+
return {
|
|
39
|
+
candidates: [],
|
|
40
|
+
applied: [],
|
|
41
|
+
skipped: [],
|
|
42
|
+
source: "none"
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const filtered = neverAutoThinFilter(
|
|
46
|
+
filterUnderused(raw, policy, (deps.now ?? Date.now)()),
|
|
47
|
+
deps.config.neverAutoThin
|
|
48
|
+
);
|
|
49
|
+
if (deps.dryRun) {
|
|
50
|
+
return {
|
|
51
|
+
candidates: filtered,
|
|
52
|
+
applied: [],
|
|
53
|
+
skipped: [],
|
|
54
|
+
source: source.kind
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const { thinned, skipped } = deps.toolRegistry.thinUnderused(
|
|
58
|
+
filtered.map((c) => c.name),
|
|
59
|
+
"boot-time auto-thin"
|
|
60
|
+
);
|
|
61
|
+
if (thinned.length === 0) {
|
|
62
|
+
return { candidates: filtered, applied: [], skipped, source: source.kind };
|
|
63
|
+
}
|
|
64
|
+
const at = Date.now();
|
|
65
|
+
const current = deps.configStore.get().tools ?? {};
|
|
66
|
+
const nextDisabled = new Set(current.disabledTools ?? []);
|
|
67
|
+
const nextMeta = { ...current.disabledToolMeta ?? {} };
|
|
68
|
+
for (const name of thinned) {
|
|
69
|
+
nextDisabled.add(name);
|
|
70
|
+
nextMeta[name] = { reason: "auto-thinned", at, caller: "boot-time auto-thin" };
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const paths = deps.configStore.paths;
|
|
74
|
+
if (paths) {
|
|
75
|
+
await persistConfigSetting(
|
|
76
|
+
{
|
|
77
|
+
configStore: deps.configStore,
|
|
78
|
+
profileConfigPath: activeProfileConfigPath(paths, deps.configStore.get()),
|
|
79
|
+
inProjectConfigPath: paths.inProjectConfig,
|
|
80
|
+
vault: noOpVault
|
|
81
|
+
},
|
|
82
|
+
(cfg) => {
|
|
83
|
+
cfg.tools = {
|
|
84
|
+
...cfg.tools ?? {},
|
|
85
|
+
disabledTools: [...nextDisabled],
|
|
86
|
+
disabledToolMeta: nextMeta
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
} catch (error) {
|
|
92
|
+
deps.events.emit("error", {
|
|
93
|
+
err: new Error(`autoThin persist failed: ${toErrorMessage(error)}`),
|
|
94
|
+
phase: "autothin-boot"
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return { candidates: filtered, applied: thinned, skipped, source: source.kind };
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
runBootAutoThin
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=boot-auto-thin-BZ675EVT.js.map
|
package/dist/boot-config.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { DefaultPathResolver } from '@wrongstack/core/infrastructure';
|
|
|
2
2
|
import { bootConfig as coreBootConfig } from '@wrongstack/core/infrastructure';
|
|
3
3
|
import type { Config } from '@wrongstack/core/types';
|
|
4
4
|
import type { WstackPaths } from '@wrongstack/core/utils';
|
|
5
|
-
|
|
5
|
+
interface BootPaths {
|
|
6
6
|
cwd: string;
|
|
7
7
|
projectRoot: string;
|
|
8
8
|
userHome: string;
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { BrainRuntime } from '@wrongstack/core/execution';
|
|
10
10
|
import type { BrainPanelHost } from '@wrongstack/tui';
|
|
11
|
-
|
|
11
|
+
interface BrainPanelServiceDeps {
|
|
12
12
|
brainRuntime: BrainRuntime;
|
|
13
13
|
}
|
|
14
14
|
export declare function createBrainPanelHost(deps: BrainPanelServiceDeps): BrainPanelHost;
|
|
15
|
+
export {};
|
|
15
16
|
//# sourceMappingURL=panel-service.d.ts.map
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
import type { CascadeEvidenceCheckResult, CascadeEvidenceStatus } from '@wrongstack/core/plugin';
|
|
27
27
|
export type { CascadeEvidenceCheckResult, CascadeEvidenceStatus, } from '@wrongstack/core/plugin';
|
|
28
28
|
/** One claimed verification check: the exact command and its observed exit code. */
|
|
29
|
-
|
|
29
|
+
interface CascadeEvidenceCheck {
|
|
30
30
|
command: string;
|
|
31
31
|
exitCode: number;
|
|
32
32
|
/** Optional truncated output the agent chose to include (informational). */
|
|
@@ -39,7 +39,7 @@ export interface CascadeEvidence {
|
|
|
39
39
|
tests?: CascadeEvidenceCheck | undefined;
|
|
40
40
|
}
|
|
41
41
|
/** Result of verifying a cascade agent's claimed evidence. */
|
|
42
|
-
|
|
42
|
+
interface CascadeEvidenceVerification {
|
|
43
43
|
status: CascadeEvidenceStatus;
|
|
44
44
|
checks: CascadeEvidenceCheckResult[];
|
|
45
45
|
}
|
|
@@ -62,27 +62,10 @@ export declare function extractCascadeEvidence(text: string | null | undefined):
|
|
|
62
62
|
* and reported as a mismatch (like a non-zero exit).
|
|
63
63
|
*/
|
|
64
64
|
export declare const CASCADE_EVIDENCE_COMMAND_TIMEOUT_MS = 120000;
|
|
65
|
-
|
|
66
|
-
export declare const CASCADE_EVIDENCE_UNSAFE_EXIT = 126;
|
|
67
|
-
/** Exit code used when the re-run times out or cannot execute. */
|
|
68
|
-
export declare const CASCADE_EVIDENCE_RUN_ERROR_EXIT = 127;
|
|
69
|
-
export interface RunCommandResult {
|
|
65
|
+
interface RunCommandResult {
|
|
70
66
|
exitCode: number;
|
|
71
67
|
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Validate a claimed command against the safety contract: first token must be
|
|
75
|
-
* an allowlisted executable and every token must be a bare word/path (no shell
|
|
76
|
-
* metacharacters). Shell-free spawning is the second layer — even a validated
|
|
77
|
-
* command is run with `shell: false`.
|
|
78
|
-
*/
|
|
79
|
-
export declare function isSafeCascadeCommand(command: string): boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Run a single verification command against the working tree without a shell.
|
|
82
|
-
* Never throws — every failure mode (unsafe, timeout, spawn error) resolves to
|
|
83
|
-
* an exit code so the caller's comparison stays uniform.
|
|
84
|
-
*/
|
|
85
|
-
export declare const runCascadeVerificationCommand: RunCommandFn;
|
|
68
|
+
type RunCommandFn = (command: string, cwd: string, timeoutMs: number) => Promise<RunCommandResult>;
|
|
86
69
|
/**
|
|
87
70
|
* Verify a cascade agent's claimed evidence by re-running each command against
|
|
88
71
|
* the working tree and comparing exit codes.
|
|
@@ -2,12 +2,5 @@ import type { CascadeAgentKind, ChimeraCascadeNeededPayload, ChimeraReviewNeeded
|
|
|
2
2
|
export declare function truncateAtCodePointBoundary(text: string, maxCodeUnits: number): string;
|
|
3
3
|
export declare function isChimeraAllClearReview(text: string): boolean;
|
|
4
4
|
export declare function buildChimeraReviewTaskDescription(p: ChimeraReviewNeededPayload): string;
|
|
5
|
-
/**
|
|
6
|
-
* The machine-evidence contract every cascade fix agent must satisfy before
|
|
7
|
-
* its work counts as verified. The agent runs the real verification commands
|
|
8
|
-
* and returns a JSON block with the exact commands and their exit codes; the
|
|
9
|
-
* re-review step re-runs those commands and compares.
|
|
10
|
-
*/
|
|
11
|
-
export declare const CASCADE_EVIDENCE_INSTRUCTIONS: string;
|
|
12
5
|
export declare function buildChimeraCascadeTaskDescription(agentKind: CascadeAgentKind, p: ChimeraCascadeNeededPayload): string;
|
|
13
6
|
//# sourceMappingURL=chimera-review-task.d.ts.map
|
|
@@ -18,7 +18,7 @@ export interface LadderAttemptFailure {
|
|
|
18
18
|
/** Tool calls the rung made before dying — non-zero means it may have acted. */
|
|
19
19
|
toolCalls: number;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
interface LadderRunOutcome {
|
|
22
22
|
/** Terminal result, when a rung produced one. */
|
|
23
23
|
result?: TaskResult | undefined;
|
|
24
24
|
/** Winning subagent, left alive only when `keepWinnerAlive` is set. */
|
|
@@ -30,7 +30,7 @@ export interface LadderRunOutcome {
|
|
|
30
30
|
/** Exception from the final rung, when it threw rather than returned. */
|
|
31
31
|
lastError?: unknown;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
interface LadderRunOptions {
|
|
34
34
|
director: Director;
|
|
35
35
|
ladder: readonly ReviewerAttempt[];
|
|
36
36
|
/** Build the spawn config for a rung. Must apply the rung's model itself. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LOCAL_LLM_PRESETS,
|
|
3
3
|
runLiveProviderPicker
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-T642Q732.js";
|
|
5
5
|
import {
|
|
6
6
|
openBrowser,
|
|
7
7
|
runCodexOAuthLogin,
|
|
@@ -1374,4 +1374,4 @@ export {
|
|
|
1374
1374
|
addCustomProvider,
|
|
1375
1375
|
addKeyForProvider
|
|
1376
1376
|
};
|
|
1377
|
-
//# sourceMappingURL=chunk-
|
|
1377
|
+
//# sourceMappingURL=chunk-32MTOI2I.js.map
|
|
@@ -44,11 +44,32 @@ async function refreshAcpRegistry(paths, opts) {
|
|
|
44
44
|
|
|
45
45
|
// src/wiring/provider-runtime.ts
|
|
46
46
|
import { makeProviderFromConfig } from "@wrongstack/providers";
|
|
47
|
-
import {
|
|
48
|
-
|
|
47
|
+
import {
|
|
48
|
+
getProxyConfig,
|
|
49
|
+
isProxyEligible,
|
|
50
|
+
rewriteBaseUrl,
|
|
51
|
+
sanitizeUrlForLog,
|
|
52
|
+
shouldRewriteFor
|
|
53
|
+
} from "@wrongstack/core/wiring/proxy-rewrite";
|
|
54
|
+
function resolveProviderCfg(config, providerId, opts) {
|
|
49
55
|
const savedCfg = config.providers?.[providerId];
|
|
50
56
|
const rawBaseUrl = savedCfg?.baseUrl ?? config.baseUrl;
|
|
51
|
-
|
|
57
|
+
let rewriteReason = "no-base-url";
|
|
58
|
+
let baseUrl = rawBaseUrl;
|
|
59
|
+
if (rawBaseUrl && shouldRewriteFor(providerId)) {
|
|
60
|
+
const rewritten = rewriteBaseUrl(rawBaseUrl, currentProxyBaseUrl());
|
|
61
|
+
if (rewritten !== rawBaseUrl) {
|
|
62
|
+
rewriteReason = "applied";
|
|
63
|
+
baseUrl = rewritten;
|
|
64
|
+
} else {
|
|
65
|
+
rewriteReason = passthroughReason(rawBaseUrl);
|
|
66
|
+
}
|
|
67
|
+
} else if (rawBaseUrl) {
|
|
68
|
+
rewriteReason = proxySkipReason(providerId);
|
|
69
|
+
}
|
|
70
|
+
opts?.logger?.info(
|
|
71
|
+
`WrongProxy rewrite ${rewriteReason} for provider '${providerId}': ${sanitizeUrlForLog(rawBaseUrl) || "<none>"} -> ${sanitizeUrlForLog(baseUrl) || "<none>"}`
|
|
72
|
+
);
|
|
52
73
|
const cfg = {
|
|
53
74
|
...savedCfg,
|
|
54
75
|
apiKey: savedCfg?.apiKey ?? config.apiKey,
|
|
@@ -58,14 +79,39 @@ function resolveProviderCfg(config, providerId) {
|
|
|
58
79
|
const factoryType = savedCfg?.type ?? providerId;
|
|
59
80
|
return { cfg, factoryType };
|
|
60
81
|
}
|
|
82
|
+
function passthroughReason(rawBaseUrl) {
|
|
83
|
+
if (!rawBaseUrl.includes("://")) return "no-scheme";
|
|
84
|
+
const proxyRoot = currentProxyBaseUrl().replace(/\/+$/, "");
|
|
85
|
+
if (proxyRoot && rawBaseUrl.startsWith(`${proxyRoot}/proxy/`)) {
|
|
86
|
+
return "already-rewritten";
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
const parsed = new URL(rawBaseUrl);
|
|
90
|
+
const host = parsed.hostname;
|
|
91
|
+
const isLoopback = host === "localhost" || host === "127.0.0.1" || host === "[::1]";
|
|
92
|
+
if (isLoopback && parsed.port !== "") return "loopback";
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
95
|
+
return "ineligible";
|
|
96
|
+
}
|
|
97
|
+
function proxySkipReason(providerId) {
|
|
98
|
+
const cfg = getProxyConfig();
|
|
99
|
+
if (!cfg.enabled) return "disabled";
|
|
100
|
+
if (!cfg.url) return "no-proxy-url";
|
|
101
|
+
if (!cfg.active) return "inactive";
|
|
102
|
+
if (!isProxyEligible(providerId)) return "excluded";
|
|
103
|
+
return "unknown";
|
|
104
|
+
}
|
|
61
105
|
function currentProxyBaseUrl() {
|
|
62
106
|
return getProxyConfig().url;
|
|
63
107
|
}
|
|
64
|
-
function resolveProviderCfgWithProxy(config, providerId) {
|
|
65
|
-
return resolveProviderCfg(config, providerId);
|
|
108
|
+
function resolveProviderCfgWithProxy(config, providerId, opts) {
|
|
109
|
+
return resolveProviderCfg(config, providerId, opts);
|
|
66
110
|
}
|
|
67
111
|
function buildProviderForId(args, providerId) {
|
|
68
|
-
const { cfg, factoryType } = resolveProviderCfg(args.config, providerId
|
|
112
|
+
const { cfg, factoryType } = resolveProviderCfg(args.config, providerId, {
|
|
113
|
+
logger: args.logger
|
|
114
|
+
});
|
|
69
115
|
const useRegistry = !!args.config.features.modelsRegistry && args.providerRegistry.has(factoryType);
|
|
70
116
|
return useRegistry ? args.providerRegistry.create(cfg, factoryType) : makeProviderFromConfig(
|
|
71
117
|
providerId,
|
|
@@ -207,7 +253,10 @@ Try \`wstack models refresh\` once you have network access, or run with --no-fea
|
|
|
207
253
|
}
|
|
208
254
|
const { cfg: providerConfig, factoryType } = resolveProviderCfgWithProxy(
|
|
209
255
|
config,
|
|
210
|
-
config.provider
|
|
256
|
+
config.provider,
|
|
257
|
+
// Boot-time rewrite decision — the first "is traffic proxied?" line in
|
|
258
|
+
// wrongstack.log. info-level only; skips log too (they answer WHY).
|
|
259
|
+
{ logger }
|
|
211
260
|
);
|
|
212
261
|
let provider;
|
|
213
262
|
try {
|
|
@@ -245,4 +294,4 @@ export {
|
|
|
245
294
|
setupProvider,
|
|
246
295
|
createGracefulShutdown
|
|
247
296
|
};
|
|
248
|
-
//# sourceMappingURL=chunk-
|
|
297
|
+
//# sourceMappingURL=chunk-37SPPLUD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-ALE5KHCA.js.map
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
// src/wiring/proxy-probe.ts
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
applyProxyConfig,
|
|
5
|
+
getProxyConfig,
|
|
6
|
+
logProxyTransition
|
|
7
|
+
} from "@wrongstack/core/wiring/proxy-rewrite";
|
|
4
8
|
var DEFAULT_INTERVAL_MS = 3e4;
|
|
5
9
|
var DEFAULT_TIMEOUT_MS = 2e3;
|
|
6
10
|
var HEALTH_PATH = "/api/health";
|
|
@@ -16,6 +20,7 @@ function startProxyProbe(opts = {}) {
|
|
|
16
20
|
const fetchImpl = opts.fetchImpl ?? globalThis.fetch;
|
|
17
21
|
const setIntervalImpl = opts.setIntervalImpl ?? setInterval;
|
|
18
22
|
const clearIntervalImpl = opts.clearIntervalImpl ?? clearInterval;
|
|
23
|
+
const logTransition = logProxyTransition;
|
|
19
24
|
const deactivateAfterFailures = typeof opts.deactivateAfterFailures === "number" && Number.isFinite(opts.deactivateAfterFailures) ? Math.max(1, Math.trunc(opts.deactivateAfterFailures)) : DEFAULT_DEACTIVATE_AFTER_FAILURES;
|
|
20
25
|
const state = {
|
|
21
26
|
currentAbort: void 0,
|
|
@@ -31,7 +36,8 @@ function startProxyProbe(opts = {}) {
|
|
|
31
36
|
state.consecutiveFailures = 0;
|
|
32
37
|
if (state.currentAbort) state.currentAbort.abort();
|
|
33
38
|
state.currentAbort = void 0;
|
|
34
|
-
applyProxyConfig({ active: false });
|
|
39
|
+
const prev = applyProxyConfig({ active: false });
|
|
40
|
+
if (prev.active) logTransition(false, "toggle off or URL unset");
|
|
35
41
|
return false;
|
|
36
42
|
}
|
|
37
43
|
if (state.currentAbort) state.currentAbort.abort();
|
|
@@ -58,11 +64,18 @@ function startProxyProbe(opts = {}) {
|
|
|
58
64
|
if (stillRelevant) {
|
|
59
65
|
if (ok) {
|
|
60
66
|
state.consecutiveFailures = 0;
|
|
61
|
-
applyProxyConfig({ active: true });
|
|
67
|
+
const prev = applyProxyConfig({ active: true });
|
|
68
|
+
if (!prev.active) logTransition(true, "health check ok");
|
|
62
69
|
} else {
|
|
63
70
|
state.consecutiveFailures += 1;
|
|
64
71
|
if (state.consecutiveFailures >= deactivateAfterFailures) {
|
|
65
|
-
applyProxyConfig({ active: false });
|
|
72
|
+
const prev = applyProxyConfig({ active: false });
|
|
73
|
+
if (prev.active) {
|
|
74
|
+
logTransition(
|
|
75
|
+
false,
|
|
76
|
+
`${state.consecutiveFailures} consecutive failed health checks (last: HTTP ${res.status})`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
66
79
|
}
|
|
67
80
|
}
|
|
68
81
|
}
|
|
@@ -73,7 +86,13 @@ function startProxyProbe(opts = {}) {
|
|
|
73
86
|
if (stillRelevant && (timedOut || !abort.signal.aborted)) {
|
|
74
87
|
state.consecutiveFailures += 1;
|
|
75
88
|
if (state.consecutiveFailures >= deactivateAfterFailures) {
|
|
76
|
-
applyProxyConfig({ active: false });
|
|
89
|
+
const prev = applyProxyConfig({ active: false });
|
|
90
|
+
if (prev.active) {
|
|
91
|
+
logTransition(
|
|
92
|
+
false,
|
|
93
|
+
`${state.consecutiveFailures} consecutive failed health checks (last: ${timedOut ? `timeout after ${timeoutMs}ms` : "network error"})`
|
|
94
|
+
);
|
|
95
|
+
}
|
|
77
96
|
}
|
|
78
97
|
}
|
|
79
98
|
return false;
|
|
@@ -117,4 +136,4 @@ function buildHealthUrl(rawBase) {
|
|
|
117
136
|
export {
|
|
118
137
|
startProxyProbe
|
|
119
138
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
139
|
+
//# sourceMappingURL=chunk-G3IMKQRH.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PLUGIN_AUDIT_ENTRIES,
|
|
3
3
|
loadExternalPlugins
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QC5I4VWZ.js";
|
|
5
5
|
import {
|
|
6
6
|
patchConfig
|
|
7
7
|
} from "./chunk-TYO2OVAD.js";
|
|
@@ -219,6 +219,12 @@ async function setupPlugins(params) {
|
|
|
219
219
|
llm: params.llm,
|
|
220
220
|
sessionWriter: {
|
|
221
221
|
transcriptPath: sessionWriter.transcriptPath,
|
|
222
|
+
// Plugins declare an open event shape, so this crosses from an
|
|
223
|
+
// untyped record into the closed `SessionEvent` union. `unknown`
|
|
224
|
+
// is the honest intermediate: a direct assertion only compiled
|
|
225
|
+
// while some union member happened to overlap structurally, which
|
|
226
|
+
// is not a check — it silently stopped being one the moment the
|
|
227
|
+
// union changed shape.
|
|
222
228
|
append: (e) => sessionWriter.append(e)
|
|
223
229
|
},
|
|
224
230
|
metricsSink,
|
|
@@ -248,7 +254,6 @@ function buildPluginOptions(config, plugins) {
|
|
|
248
254
|
|
|
249
255
|
export {
|
|
250
256
|
DEPRECATED_PLUGIN_NAMES,
|
|
251
|
-
BUILTIN_PLUGIN_CONFIG_NAMES,
|
|
252
257
|
_resetDeprecatedWarningsForTests,
|
|
253
258
|
warnIfDeprecatedPluginName,
|
|
254
259
|
pluginNameFromSpec,
|
|
@@ -256,4 +261,4 @@ export {
|
|
|
256
261
|
BUILTIN_PLUGIN_FACTORIES,
|
|
257
262
|
setupPlugins
|
|
258
263
|
};
|
|
259
|
-
//# sourceMappingURL=chunk-
|
|
264
|
+
//# sourceMappingURL=chunk-GKHUHAIK.js.map
|
|
@@ -263,72 +263,6 @@ function deriveFsAccessPair(input) {
|
|
|
263
263
|
return void 0;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
// src/services/suggestion-store.ts
|
|
267
|
-
var sharedSuggestions = [];
|
|
268
|
-
var sharedAutoSuggestions = [];
|
|
269
|
-
function setSuggestions(suggestions) {
|
|
270
|
-
sharedSuggestions = suggestions;
|
|
271
|
-
}
|
|
272
|
-
function setAutoSuggestions(suggestions) {
|
|
273
|
-
sharedAutoSuggestions = suggestions;
|
|
274
|
-
}
|
|
275
|
-
function getSuggestions() {
|
|
276
|
-
return sharedSuggestions;
|
|
277
|
-
}
|
|
278
|
-
function removeSuggestions(indices) {
|
|
279
|
-
if (indices.length === 0) return;
|
|
280
|
-
const set = new Set(indices);
|
|
281
|
-
sharedSuggestions = sharedSuggestions.filter((_, i) => !set.has(i));
|
|
282
|
-
sharedAutoSuggestions = [];
|
|
283
|
-
}
|
|
284
|
-
function clearSuggestions() {
|
|
285
|
-
sharedSuggestions = [];
|
|
286
|
-
sharedAutoSuggestions = [];
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// src/tui-thinking-word.ts
|
|
290
|
-
var DEFAULT_TUI_THINKING_WORD = "thinking";
|
|
291
|
-
var MAX_TUI_THINKING_WORD_LENGTH = 16;
|
|
292
|
-
function normalizeTuiThinkingWord(value) {
|
|
293
|
-
if (typeof value !== "string") return DEFAULT_TUI_THINKING_WORD;
|
|
294
|
-
const word = value.trim();
|
|
295
|
-
if (word.length === 0 || word.length > MAX_TUI_THINKING_WORD_LENGTH) {
|
|
296
|
-
return DEFAULT_TUI_THINKING_WORD;
|
|
297
|
-
}
|
|
298
|
-
if (!/^[\p{L}\p{N}_-]+$/u.test(word)) return DEFAULT_TUI_THINKING_WORD;
|
|
299
|
-
return word;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
// src/services/run-git.ts
|
|
303
|
-
import { spawn } from "node:child_process";
|
|
304
|
-
import { toErrorMessage } from "@wrongstack/core/utils";
|
|
305
|
-
async function runGit(args, cwd) {
|
|
306
|
-
try {
|
|
307
|
-
return await new Promise((resolve, reject) => {
|
|
308
|
-
const child = spawn("git", args, {
|
|
309
|
-
cwd,
|
|
310
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
311
|
-
signal: AbortSignal.timeout(3e4),
|
|
312
|
-
windowsHide: true
|
|
313
|
-
});
|
|
314
|
-
let stdout = "";
|
|
315
|
-
let stderr = "";
|
|
316
|
-
child.stdout?.on("data", (d) => {
|
|
317
|
-
stdout += d;
|
|
318
|
-
});
|
|
319
|
-
child.stderr?.on("data", (d) => {
|
|
320
|
-
stderr += d;
|
|
321
|
-
});
|
|
322
|
-
child.on("error", (err) => {
|
|
323
|
-
reject(new Error(`Failed to run git: ${err.message}`));
|
|
324
|
-
});
|
|
325
|
-
child.on("close", (code) => resolve({ stdout, stderr, code: code ?? 0 }));
|
|
326
|
-
});
|
|
327
|
-
} catch (err) {
|
|
328
|
-
throw new Error(toErrorMessage(err));
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
266
|
export {
|
|
333
267
|
resolvePersistPath,
|
|
334
268
|
resolveActualTarget,
|
|
@@ -336,14 +270,6 @@ export {
|
|
|
336
270
|
persistAutonomySetting,
|
|
337
271
|
persistConfigSetting,
|
|
338
272
|
persistTelegramConfig,
|
|
339
|
-
deriveFsAccessPair
|
|
340
|
-
setSuggestions,
|
|
341
|
-
setAutoSuggestions,
|
|
342
|
-
getSuggestions,
|
|
343
|
-
removeSuggestions,
|
|
344
|
-
clearSuggestions,
|
|
345
|
-
MAX_TUI_THINKING_WORD_LENGTH,
|
|
346
|
-
normalizeTuiThinkingWord,
|
|
347
|
-
runGit
|
|
273
|
+
deriveFsAccessPair
|
|
348
274
|
};
|
|
349
|
-
//# sourceMappingURL=chunk-
|
|
275
|
+
//# sourceMappingURL=chunk-JACOMTIH.js.map
|
|
@@ -285,22 +285,6 @@ function getTaskProgress() {
|
|
|
285
285
|
if (!tracker) return null;
|
|
286
286
|
return tracker.getProgress();
|
|
287
287
|
}
|
|
288
|
-
function getCurrentTask() {
|
|
289
|
-
const tracker = sddState.getTaskTracker();
|
|
290
|
-
if (!tracker) return null;
|
|
291
|
-
const nodes = tracker.getAllNodes({ status: ["in_progress"] });
|
|
292
|
-
if (nodes.length === 0) return null;
|
|
293
|
-
const n = expectDefined(nodes[0]);
|
|
294
|
-
return {
|
|
295
|
-
id: n.id,
|
|
296
|
-
title: n.title,
|
|
297
|
-
description: n.description,
|
|
298
|
-
priority: n.priority,
|
|
299
|
-
estimateHours: n.estimateHours ?? 0,
|
|
300
|
-
tags: n.tags ?? [],
|
|
301
|
-
startedAt: n.startedAt
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
288
|
function advanceToNextTask() {
|
|
305
289
|
const tracker = sddState.getTaskTracker();
|
|
306
290
|
if (!tracker) return false;
|
|
@@ -425,7 +409,6 @@ export {
|
|
|
425
409
|
formatElapsed,
|
|
426
410
|
trySaveTasksFromAIOutput,
|
|
427
411
|
getTaskProgress,
|
|
428
|
-
getCurrentTask,
|
|
429
412
|
advanceToNextTask,
|
|
430
413
|
getTaskListText,
|
|
431
414
|
renderTaskListWithProgress,
|
|
@@ -435,4 +418,4 @@ export {
|
|
|
435
418
|
getTaskGraphId,
|
|
436
419
|
getTaskTrackerExport
|
|
437
420
|
};
|
|
438
|
-
//# sourceMappingURL=chunk-
|
|
421
|
+
//# sourceMappingURL=chunk-JHUJUIOH.js.map
|