@wrongstack/cli 1.0.19 → 1.0.24
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-INCNOH42.js → acp-AJWSKWE5.js} +18 -7
- package/dist/arg-parser.d.ts +1 -0
- package/dist/{auth-YXK3EDUL.js → auth-GRBZ7Y3D.js} +61 -15
- package/dist/auth-menu/direct.d.ts +1 -0
- package/dist/auth-menu/local.d.ts +2 -0
- package/dist/auth-menu/oauth-menu.d.ts +3 -1
- package/dist/auth-menu/panel-service.d.ts +20 -0
- package/dist/{bench-YBU6BVQP.js → bench-N5K7Z5O3.js} +2 -2
- package/dist/boot/config-backup-recovery.d.ts +2 -1
- package/dist/boot/dispatch-webui.d.ts +11 -0
- package/dist/boot/short-circuit-desktop.d.ts +1 -0
- package/dist/boot/tui-project-picker-callback.d.ts +1 -1
- package/dist/boot/tui-settings-adapter.d.ts +15 -2
- package/dist/{boot-auto-thin-MANHOYHE.js → boot-auto-thin-6Q56FY3F.js} +3 -2
- package/dist/{chunk-6WRKAACA.js → chunk-2BKFWIER.js} +4 -2
- package/dist/{chunk-JY52HWL6.js → chunk-2EBVTYJR.js} +2 -2
- package/dist/chunk-3OCUS3VN.js +46 -0
- package/dist/chunk-424ORSE7.js +56 -0
- package/dist/{chunk-KEPABQYT.js → chunk-5SEYGOCH.js} +8 -82
- package/dist/chunk-BBHWW6LR.js +549 -0
- package/dist/{chunk-CJTBLTS4.js → chunk-BLD5DSVA.js} +4 -3
- package/dist/{chunk-KK2LB3ZS.js → chunk-DRM7PSW7.js} +9 -5
- package/dist/{chunk-XJ7K67PP.js → chunk-JF2MULWF.js} +17 -10
- package/dist/{chunk-SIS37L3W.js → chunk-L2RVEQWO.js} +211 -193
- package/dist/{chunk-RDHFXOJM.js → chunk-LFMVHT3R.js} +106 -57
- package/dist/chunk-LUMETJFO.js +171 -0
- package/dist/{chunk-C3Z4N6A6.js → chunk-MHEBWVXL.js} +6 -2
- package/dist/{chunk-2ENZU66X.js → chunk-PGKJ2OQP.js} +5 -5
- package/dist/{chunk-672UXYL3.js → chunk-QBBF7GIK.js} +2 -2
- package/dist/{chunk-DE7BZDNK.js → chunk-QFPQXKCG.js} +11 -3
- package/dist/chunk-R4QGL6GB.js +10 -0
- package/dist/chunk-S4FFHDJG.js +93 -0
- package/dist/chunk-SFBFYIOW.js +271 -0
- package/dist/{chunk-JX6KL7OF.js → chunk-SKPDE62W.js} +4 -3
- package/dist/{chunk-RMQNCHGO.js → chunk-U46QR4WR.js} +5 -9
- package/dist/{chunk-B4JLSXZB.js → chunk-WSTVGC2C.js} +73 -45
- package/dist/chunk-YBUCXXYZ.js +36 -0
- package/dist/{chunk-2VMJ3E5Z.js → chunk-YTEOAWOJ.js} +6 -2
- package/dist/{chunk-GPPRNAKW.js → chunk-ZMX5HRLI.js} +2 -2
- package/dist/{chunk-YLQEGYV4.js → chunk-ZZRSG7VK.js} +14 -4
- package/dist/{cli-context-33F74CSZ.js → cli-context-34Q5IJRA.js} +121 -89
- package/dist/cli-entry-point.d.ts +2 -0
- package/dist/{cli-main-FNGMKPBA.js → cli-main-AELJDBGU.js} +1439 -1276
- package/dist/config-doctor.d.ts +10 -2
- package/dist/{config-transfer-2YF3CRTN.js → config-transfer-RUWLDCNK.js} +34 -13
- package/dist/{diag-doctor-ANPRUYFM.js → diag-doctor-WIFJH3XH.js} +2 -2
- package/dist/execute-deps.d.ts +2 -1
- package/dist/{execution-A6WJLSOC.js → execution-PYC5FCS4.js} +303 -256
- package/dist/{hq-XQWQTRDA.js → hq-JTUTFI4L.js} +274 -258
- package/dist/hq-command-controller.d.ts +1 -1
- package/dist/{hq-server-IIBZQZU4.js → hq-server-PC7GZMPT.js} +2 -2
- package/dist/{hq-service-L5INQFM4.js → hq-service-NW56MUP2.js} +11 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -12
- package/dist/kanban-supervisor-67ECABTD.js +7 -0
- package/dist/live-settings-input.d.ts +7 -0
- package/dist/{mailbox-serve-3GFOK2I7.js → mailbox-serve-WDOCH6KR.js} +3 -3
- package/dist/{mcp-DC5WSBOO.js → mcp-LBS45HWZ.js} +4 -4
- package/dist/modeldiag-36OGAL5C.js +828 -0
- package/dist/{per-subcommand-help-DHTYU524.js → per-subcommand-help-XE77MTGJ.js} +3 -3
- package/dist/permission-prompt-mirror.d.ts +1 -1
- package/dist/permission-prompt.d.ts +2 -2
- package/dist/plugin-config.d.ts +12 -0
- package/dist/plugin-management-types.d.ts +31 -0
- package/dist/plugin-management.d.ts +2 -30
- package/dist/plugin-package-install.d.ts +3 -0
- package/dist/{plugin-usage-M6KET4OZ.js → plugin-usage-S5LVGMBW.js} +6 -5
- package/dist/{plugins-WJLW6ULV.js → plugins-RHBIVLI7.js} +4 -3
- package/dist/provider-config-utils.d.ts +1 -6
- package/dist/{providers-models-LFNZ5WI7.js → providers-models-2CFG46RD.js} +41 -31
- package/dist/release-asset-download.d.ts +3 -0
- package/dist/services/dispatch-classifier.d.ts +39 -5
- package/dist/{sessions-config-UL45XKX7.js → sessions-config-IQUH2GXT.js} +13 -5
- package/dist/settings-menu.d.ts +2 -0
- package/dist/short-circuit-flags-SDT53OML.js +10 -0
- package/dist/{simpleui-dist-CXSIDAXZ.js → simpleui-dist-7BQISSEP.js} +7 -3
- package/dist/skill-suggest-L2EVWB6R.js +290 -0
- package/dist/slash-commands/effort.d.ts +1 -1
- package/dist/slash-commands/fallback.d.ts +1 -1
- package/dist/slash-commands/gitid.d.ts +1 -1
- package/dist/slash-commands/jev.d.ts +4 -0
- package/dist/slash-commands/openai-quota.d.ts +15 -0
- package/dist/slash-commands/sdd-task-mutations.d.ts +4 -0
- package/dist/slash-commands/settings-keys.d.ts +2 -0
- package/dist/slash-commands/settings-reset.d.ts +6 -0
- package/dist/standalone-update-MW47J3AK.js +164 -0
- package/dist/standalone-update.d.ts +19 -0
- package/dist/subcommands/handlers/hq-alerts.d.ts +3 -0
- package/dist/subcommands/handlers/hq-audit.d.ts +46 -0
- package/dist/subcommands/handlers/hq-data-dir.d.ts +13 -0
- package/dist/subcommands/handlers/skill-suggest.d.ts +21 -0
- package/dist/subcommands/handlers/typesafe-brain-replay.d.ts +26 -0
- package/dist/subcommands/handlers/typesafe-judgment-check.d.ts +3 -0
- package/dist/subcommands/handlers/typesafe-topic-replay.d.ts +19 -0
- package/dist/subcommands/handlers/typesafe-triage-replay.d.ts +18 -0
- package/dist/subcommands/handlers/typesafe.d.ts +23 -0
- package/dist/{subcommands-XSLXMIDP.js → subcommands-ZTSIN7LG.js} +2 -2
- package/dist/typesafe-HVEVPA6R.js +316 -0
- package/dist/typesafe-brain-replay-C5276FVR.js +222 -0
- package/dist/typesafe-judgment-check-GGYYV5UF.js +29 -0
- package/dist/typesafe-topic-replay-4W73BOLV.js +218 -0
- package/dist/typesafe-triage-replay-FGAW7QM7.js +215 -0
- package/dist/{update-5DPB4YD4.js → update-7XIOEXTD.js} +4 -3
- package/dist/{update-check-BS3DHTSI.js → update-check-2POMBHFB.js} +3 -2
- package/dist/update-check.d.ts +1 -1
- package/dist/version-help-WZ623NWM.js +10 -0
- package/dist/version.d.ts +3 -2
- package/dist/webui-client-observability.d.ts +7 -0
- package/dist/{webui-server-MRPGTTKL.js → webui-server-L2SICPTB.js} +158 -94
- package/dist/webui-server-options.d.ts +11 -0
- package/dist/webui-server.d.ts +15 -1
- package/dist/wiring/domain-glossary.d.ts +5 -4
- package/dist/wiring/plugins.d.ts +1 -1
- package/dist/wiring/provider-persisters.d.ts +24 -0
- package/dist/wiring/provider-runtime.d.ts +9 -1
- package/dist/wiring/runtime-dispatch-state.d.ts +3 -1
- package/package.json +28 -28
- package/dist/chunk-2CZEORLV.js +0 -54
- package/dist/chunk-DR2OXU46.js +0 -174
- package/dist/chunk-JACOMTIH.js +0 -275
- package/dist/chunk-XJXDOF63.js +0 -28
- package/dist/modeldiag-CJSFHZ3J.js +0 -1356
- package/dist/short-circuit-flags-7GQIGMVD.js +0 -10
- package/dist/version-help-WXI42PZ3.js +0 -10
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
renderFocusedHelpToString,
|
|
8
8
|
renderGenericHelp,
|
|
9
9
|
subcommandsWithFocusedHelp
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-SKPDE62W.js";
|
|
11
|
+
import "./chunk-YTEOAWOJ.js";
|
|
12
12
|
export {
|
|
13
13
|
deepSubcommandsWithFocusedHelp,
|
|
14
14
|
renderBlockToString,
|
|
@@ -19,4 +19,4 @@ export {
|
|
|
19
19
|
renderGenericHelp,
|
|
20
20
|
subcommandsWithFocusedHelp
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=per-subcommand-help-
|
|
22
|
+
//# sourceMappingURL=per-subcommand-help-XE77MTGJ.js.map
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import type { ApprovalRegistry } from '@wrongstack/core/hq';
|
|
30
30
|
import type { Tool } from '@wrongstack/core/types';
|
|
31
|
-
type PromptDecision = 'yes' | 'no' | 'always' | 'deny';
|
|
31
|
+
type PromptDecision = 'yes' | 'no' | 'always' | 'always-exact' | 'always-command' | 'always-tool' | 'deny';
|
|
32
32
|
type PromptDelegate = (tool: Tool, input: unknown, suggestedPattern: string) => Promise<PromptDecision>;
|
|
33
33
|
type AbortablePromptDelegate = (tool: Tool, input: unknown, suggestedPattern: string, signal: AbortSignal) => Promise<PromptDecision>;
|
|
34
34
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { InputReader, Tool } from '@wrongstack/core/types';
|
|
2
|
-
type PromptDecision = 'yes' | 'no' | 'always' | 'deny';
|
|
2
|
+
type PromptDecision = 'yes' | 'no' | 'always' | 'always-exact' | 'always-command' | 'always-tool' | 'deny';
|
|
3
3
|
/** Signature the Agent expects for confirming tool calls. */
|
|
4
|
-
export type ConfirmAwaiter = (tool: Tool, input: unknown, toolUseId: string, suggestedPattern: string) => Promise<'yes' | 'no' | 'always' | 'deny'>;
|
|
4
|
+
export type ConfirmAwaiter = (tool: Tool, input: unknown, toolUseId: string, suggestedPattern: string) => Promise<'yes' | 'no' | 'always' | 'always-exact' | 'always-command' | 'always-tool' | 'deny'>;
|
|
5
5
|
/**
|
|
6
6
|
* The terminal approval prompt.
|
|
7
7
|
*
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginConfig } from '@wrongstack/core/types';
|
|
2
|
+
import type { PluginManagementDeps, PluginManagementResult } from './plugin-management-types.js';
|
|
3
|
+
export declare function readConfig(file: string): Promise<Record<string, unknown>>;
|
|
4
|
+
export declare function pluginName(p: string | PluginConfig): string;
|
|
5
|
+
export declare function upsertPlugin(spec: string, opts: {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
path?: string;
|
|
8
|
+
}, deps: PluginManagementDeps, verb: string): Promise<PluginManagementResult>;
|
|
9
|
+
export declare function errorResult(message: string): PluginManagementResult;
|
|
10
|
+
export declare function globalPluginsRoot(deps: PluginManagementDeps): string;
|
|
11
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
12
|
+
//# sourceMappingURL=plugin-config.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Config, PluginConfig, PluginManagerConfig } from '@wrongstack/core/types';
|
|
2
|
+
export interface PluginManagementDeps {
|
|
3
|
+
config: Config;
|
|
4
|
+
configPath: string;
|
|
5
|
+
/** Override `~/.wrongstack` for tests. Defaults to the real home dir. */
|
|
6
|
+
globalRoot?: string | undefined;
|
|
7
|
+
/** Injectable package-manager runner for tests. */
|
|
8
|
+
runPackageManager?: ((pm: string, args: readonly string[], cwd: string) => Promise<PackageManagerRunResult>) | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface PackageManagerRunResult {
|
|
11
|
+
code: number | null;
|
|
12
|
+
stdout: string;
|
|
13
|
+
stderr: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PluginManagementResult {
|
|
16
|
+
code: number;
|
|
17
|
+
level: 'output' | 'info' | 'error';
|
|
18
|
+
message: string;
|
|
19
|
+
patch?: {
|
|
20
|
+
plugins?: (string | PluginConfig)[] | undefined;
|
|
21
|
+
features?: Record<string, unknown>;
|
|
22
|
+
pluginManager?: PluginManagerConfig | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Full replacement `extensions` map (patchConfig is a SHALLOW merge,
|
|
25
|
+
* so per-plugin llm overrides must ship the whole merged object).
|
|
26
|
+
*/
|
|
27
|
+
extensions?: Record<string, Record<string, unknown>> | undefined;
|
|
28
|
+
};
|
|
29
|
+
restartRequired?: boolean | undefined;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=plugin-management-types.d.ts.map
|
|
@@ -1,36 +1,8 @@
|
|
|
1
|
-
import type { Config
|
|
1
|
+
import type { Config } from '@wrongstack/core/types';
|
|
2
2
|
import { PLUGIN_AUDIT_ENTRIES, type PluginAuditEntry } from '@wrongstack/plugins/plugin-audit-catalog';
|
|
3
|
+
import type { PluginManagementDeps, PluginManagementResult } from './plugin-management-types.js';
|
|
3
4
|
export type { PluginAuditEntry };
|
|
4
5
|
export { PLUGIN_AUDIT_ENTRIES };
|
|
5
|
-
interface PluginManagementDeps {
|
|
6
|
-
config: Config;
|
|
7
|
-
configPath: string;
|
|
8
|
-
/** Override `~/.wrongstack` for tests. Defaults to the real home dir. */
|
|
9
|
-
globalRoot?: string | undefined;
|
|
10
|
-
/** Injectable package-manager runner for tests. */
|
|
11
|
-
runPackageManager?: ((pm: string, args: readonly string[], cwd: string) => Promise<PackageManagerRunResult>) | undefined;
|
|
12
|
-
}
|
|
13
|
-
interface PackageManagerRunResult {
|
|
14
|
-
code: number | null;
|
|
15
|
-
stdout: string;
|
|
16
|
-
stderr: string;
|
|
17
|
-
}
|
|
18
|
-
interface PluginManagementResult {
|
|
19
|
-
code: number;
|
|
20
|
-
level: 'output' | 'info' | 'error';
|
|
21
|
-
message: string;
|
|
22
|
-
patch?: {
|
|
23
|
-
plugins?: (string | PluginConfig)[] | undefined;
|
|
24
|
-
features?: Record<string, unknown>;
|
|
25
|
-
pluginManager?: PluginManagerConfig | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Full replacement `extensions` map (patchConfig is a SHALLOW merge,
|
|
28
|
-
* so per-plugin llm overrides must ship the whole merged object).
|
|
29
|
-
*/
|
|
30
|
-
extensions?: Record<string, Record<string, unknown>> | undefined;
|
|
31
|
-
};
|
|
32
|
-
restartRequired?: boolean | undefined;
|
|
33
|
-
}
|
|
34
6
|
export declare function runPluginManagementCommand(args: string[], deps: PluginManagementDeps): Promise<PluginManagementResult>;
|
|
35
7
|
export declare function renderConfiguredPlugins(config: Config): string;
|
|
36
8
|
export declare function renderPluginAuditReport(config: Config): string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PluginManagementDeps, PluginManagementResult } from './plugin-management-types.js';
|
|
2
|
+
export declare function installPluginPackage(spec: string, args: string[], deps: PluginManagementDeps): Promise<PluginManagementResult>;
|
|
3
|
+
//# sourceMappingURL=plugin-package-install.d.ts.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPluginManagementCommand
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
restoreFlags
|
|
6
|
-
} from "./chunk-CSAPOCBP.js";
|
|
3
|
+
} from "./chunk-L2RVEQWO.js";
|
|
7
4
|
import {
|
|
8
5
|
activeProfileConfigPath
|
|
9
6
|
} from "./chunk-YMXXOOFN.js";
|
|
7
|
+
import "./chunk-WSTVGC2C.js";
|
|
8
|
+
import {
|
|
9
|
+
restoreFlags
|
|
10
|
+
} from "./chunk-CSAPOCBP.js";
|
|
10
11
|
|
|
11
12
|
// src/subcommands/handlers/plugin-usage.ts
|
|
12
13
|
var pluginCmd = async (args, deps) => {
|
|
@@ -40,4 +41,4 @@ export {
|
|
|
40
41
|
pluginCmd,
|
|
41
42
|
usageCmd
|
|
42
43
|
};
|
|
43
|
-
//# sourceMappingURL=plugin-usage-
|
|
44
|
+
//# sourceMappingURL=plugin-usage-S5LVGMBW.js.map
|
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
pluginNameFromSpec,
|
|
7
7
|
setupPlugins,
|
|
8
8
|
warnIfDeprecatedPluginName
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JF2MULWF.js";
|
|
10
10
|
import "./chunk-EWKESL4L.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-L2RVEQWO.js";
|
|
12
|
+
import "./chunk-WSTVGC2C.js";
|
|
12
13
|
export {
|
|
13
14
|
BUILTIN_PLUGIN_FACTORIES,
|
|
14
15
|
DEPRECATED_PLUGIN_NAMES,
|
|
@@ -18,4 +19,4 @@ export {
|
|
|
18
19
|
setupPlugins,
|
|
19
20
|
warnIfDeprecatedPluginName
|
|
20
21
|
};
|
|
21
|
-
//# sourceMappingURL=plugins-
|
|
22
|
+
//# sourceMappingURL=plugins-RHBIVLI7.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { expectDefined } from '@wrongstack/core/utils';
|
|
2
2
|
export { expectDefined };
|
|
3
3
|
import type { ProviderApiKey, ProviderConfig, SecretVault } from '@wrongstack/core/types';
|
|
4
|
+
export { clearStaleProviderDefaults } from '@wrongstack/providers';
|
|
4
5
|
/**
|
|
5
6
|
* Normalize a ProviderConfig to the canonical `apiKeys[]` form.
|
|
6
7
|
* Migrates the legacy single-key `apiKey` field on the fly so every
|
|
@@ -26,12 +27,6 @@ export declare function writeKeysBack(cfg: ProviderConfig, keys: ProviderApiKey[
|
|
|
26
27
|
* when present on a freshly-loaded config it may contain a masked value.
|
|
27
28
|
*/
|
|
28
29
|
export declare function resolveActiveApiKey(cfg: ProviderConfig): string | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* Clear top-level provider/model defaults when provider mutations make them
|
|
31
|
-
* stale. This prevents a removed provider, deleted final key, or edited model
|
|
32
|
-
* allowlist from being accepted on the next boot and crashing provider setup.
|
|
33
|
-
*/
|
|
34
|
-
export declare function clearStaleProviderDefaults(config: Record<string, unknown>): void;
|
|
35
30
|
/**
|
|
36
31
|
* Return the label of the active key, or the first key's label if no
|
|
37
32
|
* active is pinned. Returns `undefined` when there are no keys at all.
|
|
@@ -6,15 +6,21 @@ import {
|
|
|
6
6
|
} from "./chunk-YMXXOOFN.js";
|
|
7
7
|
import {
|
|
8
8
|
mutateConfigProviders
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LUMETJFO.js";
|
|
10
10
|
|
|
11
11
|
// src/subcommands/handlers/providers-models.ts
|
|
12
12
|
import * as fs from "node:fs/promises";
|
|
13
|
-
import {
|
|
13
|
+
import { decryptConfigSecretsForRewrite, encryptConfigSecrets } from "@wrongstack/core/security";
|
|
14
14
|
import {
|
|
15
15
|
ConfigError
|
|
16
16
|
} from "@wrongstack/core/types";
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
atomicWrite,
|
|
19
|
+
backupConfigFile,
|
|
20
|
+
color,
|
|
21
|
+
expectDefined,
|
|
22
|
+
withFileLock
|
|
23
|
+
} from "@wrongstack/core/utils";
|
|
18
24
|
var providersCmd = async (args, deps) => {
|
|
19
25
|
const providerFlags = subcommandFlags(args, deps);
|
|
20
26
|
const showAll = providerFlags["all"] === true || providerFlags["all"] === "true";
|
|
@@ -29,6 +35,7 @@ var providersCmd = async (args, deps) => {
|
|
|
29
35
|
"openai-codex": [],
|
|
30
36
|
"github-copilot": [],
|
|
31
37
|
google: [],
|
|
38
|
+
"google-antigravity": [],
|
|
32
39
|
unsupported: []
|
|
33
40
|
};
|
|
34
41
|
for (const p of all) byFamily[p.family].push(p);
|
|
@@ -508,34 +515,37 @@ async function modelsCaps(args, deps) {
|
|
|
508
515
|
async function mutateModelsConfig(deps, mutator) {
|
|
509
516
|
const vault = deps.vault;
|
|
510
517
|
const configPath = activeProfileConfigPath(deps.paths, deps.config);
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
518
|
+
await withFileLock(configPath, async () => {
|
|
519
|
+
let fileExists = true;
|
|
520
|
+
let raw;
|
|
521
|
+
try {
|
|
522
|
+
raw = await fs.readFile(configPath, "utf8");
|
|
523
|
+
} catch (err) {
|
|
524
|
+
if (err.code !== "ENOENT") throw err;
|
|
525
|
+
fileExists = false;
|
|
526
|
+
raw = "{}";
|
|
527
|
+
}
|
|
528
|
+
let parsed;
|
|
529
|
+
try {
|
|
530
|
+
parsed = JSON.parse(raw);
|
|
531
|
+
} catch (err) {
|
|
532
|
+
if (fileExists) {
|
|
533
|
+
throw new ConfigError({
|
|
534
|
+
message: `Refusing to overwrite corrupt config at ${configPath} (${err.message}).`,
|
|
535
|
+
code: "CONFIG_PARSE_FAILED",
|
|
536
|
+
context: { filePath: configPath, operation: "mutateModelsConfig" }
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
parsed = {};
|
|
530
540
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
541
|
+
const decrypted = decryptConfigSecretsForRewrite(parsed, vault);
|
|
542
|
+
const models = decrypted.models ?? {};
|
|
543
|
+
mutator(models);
|
|
544
|
+
decrypted.models = models;
|
|
545
|
+
const encrypted = encryptConfigSecrets(decrypted, vault);
|
|
546
|
+
await backupConfigFile(configPath, { globalRoot: deps.paths.globalRoot });
|
|
547
|
+
await atomicWrite(configPath, JSON.stringify(encrypted, null, 2), { mode: 384 });
|
|
548
|
+
});
|
|
539
549
|
}
|
|
540
550
|
function parseSizeFlag(raw) {
|
|
541
551
|
if (!raw) return void 0;
|
|
@@ -660,4 +670,4 @@ export {
|
|
|
660
670
|
modelsCmd,
|
|
661
671
|
providersCmd
|
|
662
672
|
};
|
|
663
|
-
//# sourceMappingURL=providers-models-
|
|
673
|
+
//# sourceMappingURL=providers-models-2CFG46RD.js.map
|
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Classifier for the smart agent dispatcher.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Two implementations behind one seam:
|
|
5
|
+
*
|
|
6
|
+
* - `makeTypeSafeDispatchClassifier` — one typed `Choice` over the candidate
|
|
7
|
+
* roles plus a `Noul` that can decline. Used when `fleet.dispatch
|
|
8
|
+
* .typesafeClassifier` is on and a `typesafe` account resolves.
|
|
9
|
+
* - `makeLLMClassifier` — the historical path: render a prompt, ask the
|
|
10
|
+
* session provider for prose, regex out the first `{...}`. Still the
|
|
11
|
+
* default, and still the fallback when TypeSafe is unconfigured.
|
|
12
|
+
*
|
|
13
|
+
* Either way the dispatcher only reaches a classifier when its keyword
|
|
14
|
+
* heuristic is ambiguous, so this runs on a minority of dispatches.
|
|
8
15
|
*/
|
|
9
16
|
import type { DispatchClassifier } from '@wrongstack/core/coordination';
|
|
17
|
+
import type { Config } from '@wrongstack/core/types';
|
|
18
|
+
import { type WarnSink } from '@wrongstack/core/typesafe';
|
|
10
19
|
import type { CommitLLMProvider } from './commit-message.js';
|
|
20
|
+
/**
|
|
21
|
+
* Wrap the session provider in the `complete(prompt) => text` shape
|
|
22
|
+
* `makeLLMClassifier` expects. Mirrors `generateCommitMessageWithLLM`.
|
|
23
|
+
*/
|
|
11
24
|
export declare function makeProviderClassifier(provider: CommitLLMProvider, model: string): DispatchClassifier;
|
|
25
|
+
/**
|
|
26
|
+
* Pick the classifier this config asks for.
|
|
27
|
+
*
|
|
28
|
+
* Falls back to the provider classifier — never to nothing — when TypeSafe is
|
|
29
|
+
* requested but unconfigured. A missing API key is a setup problem, not a
|
|
30
|
+
* reason to lose the routing the user already had.
|
|
31
|
+
*/
|
|
32
|
+
export declare function makeDispatchClassifier(deps: {
|
|
33
|
+
config: Config;
|
|
34
|
+
provider: CommitLLMProvider;
|
|
35
|
+
model: string;
|
|
36
|
+
env?: NodeJS.ProcessEnv | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Where the one-time "you asked for this and it is not running" line goes.
|
|
39
|
+
* Only `warn` is required; `debug` carries per-request token accounting when
|
|
40
|
+
* the host has somewhere to put it.
|
|
41
|
+
*/
|
|
42
|
+
logger?: (WarnSink & {
|
|
43
|
+
debug?(message: string): void;
|
|
44
|
+
}) | undefined;
|
|
45
|
+
}): DispatchClassifier;
|
|
12
46
|
//# sourceMappingURL=dispatch-classifier.d.ts.map
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
+
activeProfileConfigPath
|
|
3
|
+
} from "./chunk-YMXXOOFN.js";
|
|
4
|
+
import {
|
|
5
|
+
backupCurrent,
|
|
2
6
|
getHistoryEntry,
|
|
3
7
|
listHistory,
|
|
4
8
|
restoreFromHistory,
|
|
5
9
|
restoreLast
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WSTVGC2C.js";
|
|
7
11
|
import {
|
|
8
12
|
restoreFlags
|
|
9
13
|
} from "./chunk-CSAPOCBP.js";
|
|
10
|
-
import {
|
|
11
|
-
activeProfileConfigPath
|
|
12
|
-
} from "./chunk-YMXXOOFN.js";
|
|
13
14
|
|
|
14
15
|
// src/subcommands/handlers/sessions-config.ts
|
|
15
16
|
import { color as color2, expectDefined } from "@wrongstack/core/utils";
|
|
@@ -322,6 +323,13 @@ var configCmd = async (args, deps) => {
|
|
|
322
323
|
if (sub === "edit") {
|
|
323
324
|
const editor = process.env["EDITOR"] ?? "vi";
|
|
324
325
|
deps.renderer.write(`Run: ${editor} ${activeProfileConfigPath(deps.paths, deps.config)}
|
|
326
|
+
`);
|
|
327
|
+
return 0;
|
|
328
|
+
}
|
|
329
|
+
if (sub === "backup") {
|
|
330
|
+
const profileConfigPath = activeProfileConfigPath(deps.paths, deps.config);
|
|
331
|
+
await backupCurrent(void 0, profileConfigPath);
|
|
332
|
+
deps.renderer.write(`Backed up active profile config: ${profileConfigPath}.last
|
|
325
333
|
`);
|
|
326
334
|
return 0;
|
|
327
335
|
}
|
|
@@ -418,4 +426,4 @@ export {
|
|
|
418
426
|
configCmd,
|
|
419
427
|
sessionsCmd
|
|
420
428
|
};
|
|
421
|
-
//# sourceMappingURL=sessions-config-
|
|
429
|
+
//# sourceMappingURL=sessions-config-IQUH2GXT.js.map
|
package/dist/settings-menu.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ interface PersistSettingDeps {
|
|
|
22
22
|
* from landing in the wrong profile when the mutator changes activeProfile.
|
|
23
23
|
*/
|
|
24
24
|
resolveProfilePath?: ((profileName: string) => string) | undefined;
|
|
25
|
+
/** Skip the live ConfigStore mirror when a caller is persisting a secondary split target. */
|
|
26
|
+
updateStore?: boolean | undefined;
|
|
25
27
|
}
|
|
26
28
|
export declare function resolvePersistPath(deps: PersistSettingDeps): string;
|
|
27
29
|
/**
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
handleHelpVersionShortCircuit
|
|
3
|
+
} from "./chunk-PGKJ2OQP.js";
|
|
4
|
+
import "./chunk-2BKFWIER.js";
|
|
5
|
+
import "./chunk-MHEBWVXL.js";
|
|
6
|
+
import "./chunk-YBUCXXYZ.js";
|
|
7
|
+
export {
|
|
8
|
+
handleHelpVersionShortCircuit
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=short-circuit-flags-SDT53OML.js.map
|
|
@@ -4,9 +4,13 @@ import { spawn } from "node:child_process";
|
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import * as path from "node:path";
|
|
7
|
+
import { wrongstackPackageJsonPath } from "@wrongstack/core/utils";
|
|
8
|
+
function resolveSimpleUiPackageJson(id, req) {
|
|
9
|
+
return wrongstackPackageJsonPath(id.replace(/\/package\.json$/u, ""), (x) => req.resolve(x));
|
|
10
|
+
}
|
|
7
11
|
function resolveSimpleUiDistDir(deps = {}) {
|
|
8
12
|
const requireFromHere = createRequire(import.meta.url);
|
|
9
|
-
const resolvePackageJson = deps.resolvePackageJson ?? ((id) =>
|
|
13
|
+
const resolvePackageJson = deps.resolvePackageJson ?? ((id) => resolveSimpleUiPackageJson(id, requireFromHere));
|
|
10
14
|
const exists = deps.exists ?? existsSync;
|
|
11
15
|
let packageJson;
|
|
12
16
|
try {
|
|
@@ -30,7 +34,7 @@ async function ensureSimpleUiDistDir(deps = {}) {
|
|
|
30
34
|
} catch {
|
|
31
35
|
}
|
|
32
36
|
const requireFromHere = createRequire(import.meta.url);
|
|
33
|
-
const resolvePackageJson = deps.resolvePackageJson ?? ((id) =>
|
|
37
|
+
const resolvePackageJson = deps.resolvePackageJson ?? ((id) => resolveSimpleUiPackageJson(id, requireFromHere));
|
|
34
38
|
let packageDir;
|
|
35
39
|
try {
|
|
36
40
|
packageDir = path.dirname(resolvePackageJson("@wrongstack/simpleui/package.json"));
|
|
@@ -96,4 +100,4 @@ export {
|
|
|
96
100
|
ensureSimpleUiDistDir,
|
|
97
101
|
resolveSimpleUiDistDir
|
|
98
102
|
};
|
|
99
|
-
//# sourceMappingURL=simpleui-dist-
|
|
103
|
+
//# sourceMappingURL=simpleui-dist-7BQISSEP.js.map
|