@wrongstack/cli 1.0.32 → 1.0.35
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/data/providers.json +322 -2
- package/dist/{acp-EDGUWU7N.js → acp-T77EAEDB.js} +469 -465
- package/dist/{auth-SUHKFFO4.js → auth-M6LXZTDA.js} +4 -4
- package/dist/auth-menu/openai-codex-oauth.d.ts +1 -1
- package/dist/auth-menu/panel-provider-edits.d.ts +15 -0
- package/dist/auth-menu/panel-service.d.ts +1 -1
- package/dist/auto-discover-providers-JX346GOM.js +7 -0
- package/dist/boot/governance-evidence-candidate.d.ts +1 -2
- package/dist/boot/system-prompt-builder.d.ts +1 -1
- package/dist/boot/tui-project-spawn.d.ts +0 -1
- package/dist/boot/tui-session-resume-contracts.d.ts +95 -0
- package/dist/boot/tui-session-resume.d.ts +2 -88
- package/dist/boot/tui-settings-read.d.ts +3 -0
- package/dist/{boot-auto-thin-K2DHHYIW.js → boot-auto-thin-YMAZI3QL.js} +2 -2
- package/dist/boot-launch-choices.d.ts +22 -0
- package/dist/boot-provider-gate.d.ts +28 -0
- package/dist/boot-subcommand-dispatch.d.ts +24 -0
- package/dist/boot.d.ts +1 -1
- package/dist/chimera-cascade-evidence.d.ts +1 -1
- package/dist/{chunk-TI7KLHYX.js → chunk-2CMMWRQH.js} +81 -80
- package/dist/{chunk-3LEFXLAW.js → chunk-6SIUTX75.js} +36 -36
- package/dist/{chunk-RQ4UBKYH.js → chunk-6Z6C6ZHH.js} +3 -3
- package/dist/{chunk-5EA6OTLJ.js → chunk-AFOH6CHO.js} +2 -2
- package/dist/{chunk-WHEYHDIE.js → chunk-AKESWZH5.js} +2 -1
- package/dist/{chunk-JHUJUIOH.js → chunk-AT2A7RJZ.js} +4 -16
- package/dist/{chunk-U3SS4NRH.js → chunk-BHXAKTBE.js} +1 -1
- package/dist/{chunk-MPQCHBDJ.js → chunk-CJSHS2K7.js} +5 -1
- package/dist/{chunk-P3GRLV47.js → chunk-GZSKLXYG.js} +208 -141
- package/dist/{chunk-4MDRHMX4.js → chunk-KMU7GF7X.js} +3 -26
- package/dist/{chunk-WXJH4F6K.js → chunk-LDV4ERNV.js} +4 -4
- package/dist/{chunk-LIZXJHZQ.js → chunk-LDXXMPMS.js} +13 -13
- package/dist/{chunk-UQUYBDMG.js → chunk-M4G5FO7F.js} +1 -1
- package/dist/{chunk-CFHWIFXL.js → chunk-PA4VBCXS.js} +25 -33
- package/dist/{chunk-5UZBUV2H.js → chunk-RKU66D2O.js} +6 -4
- package/dist/{chunk-PGNERAZL.js → chunk-RWNI5OWT.js} +2 -2
- package/dist/chunk-TGSPCFBT.js +1 -0
- package/dist/{cli-context-ITHGP2CE.js → cli-context-II57EHD2.js} +1555 -1451
- package/dist/cli-initial-tools.d.ts +54 -0
- package/dist/{cli-main-TQGLKB6D.js → cli-main-YR2WJCPL.js} +38062 -37035
- package/dist/cli-main-boot.d.ts +133 -0
- package/dist/cli-main-orchestration.d.ts +170 -0
- package/dist/cli-main-state.d.ts +19 -0
- package/dist/config-doctor.d.ts +1 -1
- package/dist/{config-transfer-UE37X4B5.js → config-transfer-VOIFY7U4.js} +2 -2
- package/dist/{execution-C2IECWF7.js → execution-IBAZ2EIU.js} +138 -124
- package/dist/fleet/host-director-setup.d.ts +41 -0
- package/dist/fleet/host-spawn-types.d.ts +17 -0
- package/dist/fleet/host.d.ts +2 -1
- package/dist/goal-host-prompts.d.ts +5 -0
- package/dist/goal-host-types.d.ts +94 -0
- package/dist/goal-host.d.ts +2 -91
- package/dist/{hq-KBFDKTDD.js → hq-5OIEKB4V.js} +5 -6
- package/dist/hq-server/handle-types.d.ts +1 -1
- package/dist/hq-server/routes/auth-handlers.d.ts +1 -1
- package/dist/hq-server/routes.d.ts +1 -13
- package/dist/hq-server/utils.d.ts +1 -1
- package/dist/{hq-server-AVNKZ2PV.js → hq-server-DU3ZH3X7.js} +3 -3
- package/dist/{hq-service-FGB7BY2D.js → hq-service-LYZV7EK7.js} +3 -3
- package/dist/index.js +4 -4
- package/dist/live-settings-input.d.ts +2 -0
- package/dist/mailbox-bridge-bootstrap.d.ts +1 -4
- package/dist/{modeldiag-PQILD7TN.js → modeldiag-NEPTLFZW.js} +2 -2
- package/dist/picker-effort.d.ts +32 -0
- package/dist/picker-model-picker.d.ts +13 -2
- package/dist/picker-provider-list.d.ts +66 -0
- package/dist/picker.d.ts +12 -12
- package/dist/{providers-models-W57I3QOA.js → providers-models-37DUV2GW.js} +297 -253
- package/dist/repl-suggestions.d.ts +0 -5
- package/dist/{sdd-runtime-PTOSPYI4.js → sdd-runtime-PF72WHLO.js} +3 -20
- package/dist/services/sdd/task-manager.d.ts +1 -12
- package/dist/services/sdd-runtime.d.ts +3 -4
- package/dist/services/statusline-config.d.ts +0 -2
- package/dist/settings-behavior-sections.d.ts +0 -1
- package/dist/short-circuit-flags-EXJBJ5GT.js +10 -0
- package/dist/{skill-suggest-L2EVWB6R.js → skill-suggest-THANK3LV.js} +1 -1
- package/dist/slash-commands/command-context.d.ts +2 -0
- package/dist/slash-commands/fallback-chain-view.d.ts +3 -0
- package/dist/slash-commands/fallback-ref-validation.d.ts +34 -0
- package/dist/slash-commands/goal-refiner.d.ts +10 -2
- package/dist/slash-commands/goals.d.ts +6 -0
- package/dist/slash-commands/kanban-task-completion.d.ts +17 -0
- package/dist/slash-commands/mcp.d.ts +0 -1
- package/dist/slash-commands/memory-purge-domain-terms.d.ts +5 -0
- package/dist/slash-commands/nextsteps-mode.d.ts +13 -0
- package/dist/slash-commands/session-live-status.d.ts +21 -0
- package/dist/slash-commands/session.d.ts +1 -1
- package/dist/slash-commands/settings-feature-ui-mutations.d.ts +8 -0
- package/dist/slash-commands/settings-hq-autonomy-mutations.d.ts +8 -0
- package/dist/slash-commands/settings-persist-deps.d.ts +10 -0
- package/dist/slash-commands/settings-runtime-mutations.d.ts +12 -0
- package/dist/slash-commands/shadow.d.ts +0 -1
- package/dist/slash-commands/tool-auto-thin-commands.d.ts +15 -0
- package/dist/subcommands/handlers/acp-agents.d.ts +9 -0
- package/dist/subcommands/handlers/acp-server.d.ts +7 -0
- package/dist/subcommands/handlers/hq.d.ts +0 -1
- package/dist/subcommands/handlers/providers-models-custom.d.ts +33 -0
- package/dist/subcommands/handlers/providers-models-visibility.d.ts +29 -0
- package/dist/subcommands/handlers/skill-suggest.d.ts +0 -2
- package/dist/{subcommands-QO7VYTSS.js → subcommands-DTKBXLPU.js} +2 -2
- package/dist/{update-J5WHAFPE.js → update-6OEPAEUV.js} +3 -3
- package/dist/utils/win32-cmd.d.ts +1 -1
- package/dist/{version-help-ATOKGMTK.js → version-help-JQGRPDJW.js} +2 -2
- package/dist/webui-server/host-settings.d.ts +17 -0
- package/dist/webui-server/http-bridge.d.ts +32 -0
- package/dist/webui-server/instance-registration.d.ts +19 -0
- package/dist/webui-server/kanban-services.d.ts +9 -0
- package/dist/webui-server/message-router.d.ts +14 -0
- package/dist/webui-server/prefs-seeding.d.ts +1 -2
- package/dist/webui-server/provider-config.d.ts +0 -1
- package/dist/webui-server/provider-plane.d.ts +14 -0
- package/dist/webui-server/session-agents.d.ts +18 -0
- package/dist/webui-server/session-start-live.d.ts +11 -0
- package/dist/webui-server/stream-coalescer.d.ts +1 -1
- package/dist/webui-server/transport.d.ts +12 -0
- package/dist/{webui-server-GQOVLQS3.js → webui-server-6IC3SLZG.js} +1600 -1435
- package/dist/webui-session-maintenance.d.ts +16 -0
- package/dist/wiring/brain-and-orchestration.d.ts +1 -1
- package/dist/wiring/cli-slash-commands-setup.d.ts +1 -0
- package/dist/wiring/command-host-state.d.ts +11 -2
- package/dist/wiring/dep-watcher-bridge.d.ts +8 -1
- package/dist/wiring/session-command-handlers.d.ts +2 -1
- package/dist/worktree-command-host.d.ts +31 -0
- package/package.json +30 -30
- package/dist/auto-discover-providers-QIL34K3U.js +0 -7
- package/dist/chunk-WHOIR577.js +0 -1
- package/dist/short-circuit-flags-6LB3EGF7.js +0 -10
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
runOAuthLoginKind,
|
|
21
21
|
runOAuthLoginMenu,
|
|
22
22
|
validateFamily
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GZSKLXYG.js";
|
|
24
24
|
import {
|
|
25
25
|
renderAuthLocalHelpToString,
|
|
26
26
|
wantsLocalHelp
|
|
27
27
|
} from "./chunk-YTEOAWOJ.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-RKU66D2O.js";
|
|
29
29
|
import {
|
|
30
30
|
loadConfigProviders,
|
|
31
31
|
maskedKey,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
import "./chunk-DAKVBMD4.js";
|
|
45
45
|
import {
|
|
46
46
|
parseAuthFlags
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-CJSHS2K7.js";
|
|
48
48
|
|
|
49
49
|
// src/subcommands/handlers/auth.ts
|
|
50
50
|
import { color as color6 } from "@wrongstack/core/utils";
|
|
@@ -748,4 +748,4 @@ async function runAuthRemove(deps, providerId) {
|
|
|
748
748
|
export {
|
|
749
749
|
authCmd
|
|
750
750
|
};
|
|
751
|
-
//# sourceMappingURL=auth-
|
|
751
|
+
//# sourceMappingURL=auth-M6LXZTDA.js.map
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
import { buildCodexAuthorizeUrl, exchangeCodexAuthorizationCode, refreshCodexTokens } from '@wrongstack/providers/oauth';
|
|
32
32
|
import { type LoopbackServer } from './loopback-server.js';
|
|
33
33
|
import type { AuthMenuDeps } from './types.js';
|
|
34
|
-
export { CODEX_BASE_URL, CODEX_CATALOG_FAMILIES, CODEX_PROVIDER_ID, type CodexTokens, extractAccountId, FALLBACK_CODEX_MODELS, fallbackCodexModelIds, fallbackCodexProviderModels, fetchCodexModels, filterCurrentCodexModelIds, generatePkce, isCodexCatalogModel,
|
|
34
|
+
export { CODEX_BASE_URL, CODEX_CATALOG_FAMILIES, CODEX_PROVIDER_ID, type CodexTokens, extractAccountId, FALLBACK_CODEX_MODELS, fallbackCodexModelIds, fallbackCodexProviderModels, fetchCodexModels, filterCurrentCodexModelIds, generatePkce, isCodexCatalogModel, parseAuthorizationInput, resolveCodexModels, } from '@wrongstack/providers/oauth';
|
|
35
35
|
/** Build the Codex authorize URL. Alias kept for the historical local name. */
|
|
36
36
|
export declare const buildAuthorizeUrl: typeof buildCodexAuthorizeUrl;
|
|
37
37
|
/** Exchange an authorization code (+ PKCE verifier) for tokens. */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AuthModelEdit, AuthProviderEdit, AuthProviderSetup } from '@wrongstack/tui';
|
|
2
|
+
import type { AuthPanelServiceDeps } from './panel-flow-bridge.js';
|
|
3
|
+
interface CreateProviderEditsInput {
|
|
4
|
+
deps: AuthPanelServiceDeps;
|
|
5
|
+
mutate: (mutator: (providers: Record<string, import('@wrongstack/core/types').ProviderConfig>, config: Record<string, unknown>) => string | null) => Promise<string | null>;
|
|
6
|
+
loadProviders: () => Promise<Record<string, import('@wrongstack/core/types').ProviderConfig>>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createProviderEdits({ deps, mutate, loadProviders }: CreateProviderEditsInput): {
|
|
9
|
+
saveProviderSetup(setup: AuthProviderSetup): Promise<string | null>;
|
|
10
|
+
saveProviderEdit(edit: AuthProviderEdit): Promise<string | null>;
|
|
11
|
+
getModelEdit(providerId: string, modelId: string): Promise<AuthModelEdit | null>;
|
|
12
|
+
saveModelEdit(edit: AuthModelEdit): Promise<string | null>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=panel-provider-edits.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { AuthPanelHost } from '@wrongstack/tui';
|
|
1
2
|
import type { AuthPanelServiceDeps } from './panel-flow-bridge.js';
|
|
2
3
|
export type { AuthPanelServiceDeps } from './panel-flow-bridge.js';
|
|
3
4
|
export { plainMaskedKey } from './panel-flow-bridge.js';
|
|
4
|
-
import type { AuthPanelHost } from '@wrongstack/tui';
|
|
5
5
|
export declare function createAuthPanelHost(deps: AuthPanelServiceDeps): AuthPanelHost;
|
|
6
6
|
//# sourceMappingURL=panel-service.d.ts.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { createGovernanceEvidenceCandidate, GOVERNANCE_EVIDENCE_CANDIDATE_SCHEMA_VERSION, } from '@wrongstack/runtime/governance-bootstrap';
|
|
1
|
+
export { createGovernanceEvidenceCandidate, } from '@wrongstack/runtime/governance-bootstrap';
|
|
3
2
|
//# sourceMappingURL=governance-evidence-candidate.d.ts.map
|
|
@@ -35,7 +35,6 @@ interface PathJoiner {
|
|
|
35
35
|
* is typed against.
|
|
36
36
|
*/
|
|
37
37
|
import type { DomainGlossaryListProvider as DomainGlossaryAdapter } from '../wiring/domain-glossary.js';
|
|
38
|
-
export type { DomainGlossaryListProvider } from '../wiring/domain-glossary.js';
|
|
39
38
|
interface BindSystemPromptBuilderDeps {
|
|
40
39
|
/**
|
|
41
40
|
* The `container` from main(). The helper only calls
|
|
@@ -124,4 +123,5 @@ interface BindSystemPromptBuilderDeps {
|
|
|
124
123
|
* matches the pre-refactor inline behavior exactly.
|
|
125
124
|
*/
|
|
126
125
|
export declare function bindSystemPromptBuilder(deps: BindSystemPromptBuilderDeps): void;
|
|
126
|
+
export {};
|
|
127
127
|
//# sourceMappingURL=system-prompt-builder.d.ts.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { Agent } from '@wrongstack/core/agent';
|
|
2
|
+
import type { EventBus } from '@wrongstack/core/kernel';
|
|
3
|
+
import type { ContextSnapshot, SessionLoadProgress, TokenCounter } from '@wrongstack/core/types';
|
|
4
|
+
import type { TuiRuntimeState } from './tui-runtime-state.js';
|
|
5
|
+
export interface SessionResumeContext {
|
|
6
|
+
state: TuiRuntimeState;
|
|
7
|
+
agent: Agent;
|
|
8
|
+
tokenCounter: TokenCounter;
|
|
9
|
+
switchProviderAndModel: ((providerId: string, modelId: string) => string | null | void | Promise<unknown>) | undefined;
|
|
10
|
+
/** App EventBus — forwarded to the re-pointed todos checkpoint for storage.* events. */
|
|
11
|
+
events?: EventBus | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Byte-level parse progress sink for large journals. When provided, the
|
|
14
|
+
* store's JSONL loader throttles it to ~4 updates/sec so the TUI picker
|
|
15
|
+
* hint can stream load progress instead of a static line.
|
|
16
|
+
*/
|
|
17
|
+
onLoadProgress?: ((progress: SessionLoadProgress) => void) | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Why a resume returned `null`.
|
|
20
|
+
*
|
|
21
|
+
* `resumeSession` deliberately keeps returning `null` on failure — every
|
|
22
|
+
* rollback test pins that contract, and a throw escaping mid-rollback would
|
|
23
|
+
* be worse than a clean `null`. But `null` alone reaches the user as a bare
|
|
24
|
+
* "Failed to resume session <id>." with no reason, on every surface, which
|
|
25
|
+
* makes a broken resume undiagnosable. This sink carries the reason (and the
|
|
26
|
+
* STAGE it died at) out to the caller, which turns it into the message the
|
|
27
|
+
* user actually reads.
|
|
28
|
+
*/
|
|
29
|
+
onFailure?: ((failure: SessionResumeFailure) => void) | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Live stage reporter.
|
|
32
|
+
*
|
|
33
|
+
* The same `stage` string the failure sink reports, but emitted as each step
|
|
34
|
+
* BEGINS rather than only when one fails. The TUI turns it into the rolling
|
|
35
|
+
* "what is happening right now" rows of the resume block — without it the
|
|
36
|
+
* only honest thing that surface could show during a multi-second journal
|
|
37
|
+
* parse was a spinner.
|
|
38
|
+
*/
|
|
39
|
+
onStage?: ((stage: string) => void) | undefined;
|
|
40
|
+
}
|
|
41
|
+
/** The stage a failed resume died at, plus the underlying error text. */
|
|
42
|
+
export interface SessionResumeFailure {
|
|
43
|
+
/** Machine-readable step name, e.g. `resolve_id`, `open_writer`, `hydrate`. */
|
|
44
|
+
stage: string;
|
|
45
|
+
/** Error text from the failing step — never empty. */
|
|
46
|
+
message: string;
|
|
47
|
+
}
|
|
48
|
+
export interface SessionResumeResult {
|
|
49
|
+
entries: unknown[];
|
|
50
|
+
nextId: number;
|
|
51
|
+
sessionId: string;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the agent is now WRITING to this session.
|
|
54
|
+
*
|
|
55
|
+
* `false` means the transcript is on screen but ownership was never taken:
|
|
56
|
+
* the session stays read-only and the next prompt continues the session the
|
|
57
|
+
* user was already in. Showing the transcript anyway is deliberate — the
|
|
58
|
+
* expensive, safe half of a resume (read the journal, render the timeline)
|
|
59
|
+
* has no reason to be discarded because the risky half (claim the journal
|
|
60
|
+
* for writing) failed.
|
|
61
|
+
*/
|
|
62
|
+
attached: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Non-fatal problems the user should see, e.g. a sidecar that could not be
|
|
65
|
+
* re-pointed or a provider that is no longer configured. These used to abort
|
|
66
|
+
* the whole resume and roll back a transcript that had already loaded.
|
|
67
|
+
*/
|
|
68
|
+
warnings: string[];
|
|
69
|
+
/**
|
|
70
|
+
* Optional context-window snapshot for the resumed session. `tokens` is a
|
|
71
|
+
* flat `number` — the prompt size of the session's LAST request, read from
|
|
72
|
+
* its journal by `projectLastRequestTokens`. The TUI consumer
|
|
73
|
+
* (`packages/tui/src/reducers/composer.ts:561-577`) reads it as a flat
|
|
74
|
+
* number and gates on `snap.tokens > 0`, so a session that never reached the
|
|
75
|
+
* model reports 0 and simply leaves the chip alone.
|
|
76
|
+
*/
|
|
77
|
+
contextSnapshot?: ContextSnapshot | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Text of the LAST assistant message in the resumed transcript.
|
|
80
|
+
*
|
|
81
|
+
* The caller parses `<nextsteps>` out of it. Deterministic by construction —
|
|
82
|
+
* the TUI's per-entry parser fires on whichever assistant entry happens to
|
|
83
|
+
* mount last during a replay, which is not necessarily the final turn, so a
|
|
84
|
+
* resume needs the authoritative one from the transcript itself.
|
|
85
|
+
*/
|
|
86
|
+
lastAssistantText?: string | undefined;
|
|
87
|
+
}
|
|
88
|
+
/** Flatten a message's content to plain text (string form or text blocks). */
|
|
89
|
+
export declare function messageText(content: unknown): string;
|
|
90
|
+
/** Text of the final assistant turn, or undefined when the session has none. */
|
|
91
|
+
export declare function lastAssistantTextOf(messages: readonly {
|
|
92
|
+
role: string;
|
|
93
|
+
content: unknown;
|
|
94
|
+
}[]): string | undefined;
|
|
95
|
+
//# sourceMappingURL=tui-session-resume-contracts.d.ts.map
|
|
@@ -1,90 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
import type { ContextSnapshot, SessionLoadProgress, TokenCounter } from '@wrongstack/core/types';
|
|
4
|
-
import type { TuiRuntimeState } from './tui-runtime-state.js';
|
|
5
|
-
interface SessionResumeContext {
|
|
6
|
-
state: TuiRuntimeState;
|
|
7
|
-
agent: Agent;
|
|
8
|
-
tokenCounter: TokenCounter;
|
|
9
|
-
switchProviderAndModel: ((providerId: string, modelId: string) => string | null | void | Promise<unknown>) | undefined;
|
|
10
|
-
/** App EventBus — forwarded to the re-pointed todos checkpoint for storage.* events. */
|
|
11
|
-
events?: EventBus | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Byte-level parse progress sink for large journals. When provided, the
|
|
14
|
-
* store's JSONL loader throttles it to ~4 updates/sec so the TUI picker
|
|
15
|
-
* hint can stream load progress instead of a static line.
|
|
16
|
-
*/
|
|
17
|
-
onLoadProgress?: ((progress: SessionLoadProgress) => void) | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* Why a resume returned `null`.
|
|
20
|
-
*
|
|
21
|
-
* `resumeSession` deliberately keeps returning `null` on failure — every
|
|
22
|
-
* rollback test pins that contract, and a throw escaping mid-rollback would
|
|
23
|
-
* be worse than a clean `null`. But `null` alone reaches the user as a bare
|
|
24
|
-
* "Failed to resume session <id>." with no reason, on every surface, which
|
|
25
|
-
* makes a broken resume undiagnosable. This sink carries the reason (and the
|
|
26
|
-
* STAGE it died at) out to the caller, which turns it into the message the
|
|
27
|
-
* user actually reads.
|
|
28
|
-
*/
|
|
29
|
-
onFailure?: ((failure: SessionResumeFailure) => void) | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Live stage reporter.
|
|
32
|
-
*
|
|
33
|
-
* The same `stage` string the failure sink reports, but emitted as each step
|
|
34
|
-
* BEGINS rather than only when one fails. The TUI turns it into the rolling
|
|
35
|
-
* "what is happening right now" rows of the resume block — without it the
|
|
36
|
-
* only honest thing that surface could show during a multi-second journal
|
|
37
|
-
* parse was a spinner.
|
|
38
|
-
*/
|
|
39
|
-
onStage?: ((stage: string) => void) | undefined;
|
|
40
|
-
}
|
|
41
|
-
/** The stage a failed resume died at, plus the underlying error text. */
|
|
42
|
-
export interface SessionResumeFailure {
|
|
43
|
-
/** Machine-readable step name, e.g. `resolve_id`, `open_writer`, `hydrate`. */
|
|
44
|
-
stage: string;
|
|
45
|
-
/** Error text from the failing step — never empty. */
|
|
46
|
-
message: string;
|
|
47
|
-
}
|
|
48
|
-
interface SessionResumeResult {
|
|
49
|
-
entries: unknown[];
|
|
50
|
-
nextId: number;
|
|
51
|
-
sessionId: string;
|
|
52
|
-
/**
|
|
53
|
-
* Whether the agent is now WRITING to this session.
|
|
54
|
-
*
|
|
55
|
-
* `false` means the transcript is on screen but ownership was never taken:
|
|
56
|
-
* the session stays read-only and the next prompt continues the session the
|
|
57
|
-
* user was already in. Showing the transcript anyway is deliberate — the
|
|
58
|
-
* expensive, safe half of a resume (read the journal, render the timeline)
|
|
59
|
-
* has no reason to be discarded because the risky half (claim the journal
|
|
60
|
-
* for writing) failed.
|
|
61
|
-
*/
|
|
62
|
-
attached: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Non-fatal problems the user should see, e.g. a sidecar that could not be
|
|
65
|
-
* re-pointed or a provider that is no longer configured. These used to abort
|
|
66
|
-
* the whole resume and roll back a transcript that had already loaded.
|
|
67
|
-
*/
|
|
68
|
-
warnings: string[];
|
|
69
|
-
/**
|
|
70
|
-
* Optional context-window snapshot for the resumed session. `tokens` is a
|
|
71
|
-
* flat `number` — the prompt size of the session's LAST request, read from
|
|
72
|
-
* its journal by `projectLastRequestTokens`. The TUI consumer
|
|
73
|
-
* (`packages/tui/src/reducers/composer.ts:561-577`) reads it as a flat
|
|
74
|
-
* number and gates on `snap.tokens > 0`, so a session that never reached the
|
|
75
|
-
* model reports 0 and simply leaves the chip alone.
|
|
76
|
-
*/
|
|
77
|
-
contextSnapshot?: ContextSnapshot | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* Text of the LAST assistant message in the resumed transcript.
|
|
80
|
-
*
|
|
81
|
-
* The caller parses `<nextsteps>` out of it. Deterministic by construction —
|
|
82
|
-
* the TUI's per-entry parser fires on whichever assistant entry happens to
|
|
83
|
-
* mount last during a replay, which is not necessarily the final turn, so a
|
|
84
|
-
* resume needs the authoritative one from the transcript itself.
|
|
85
|
-
*/
|
|
86
|
-
lastAssistantText?: string | undefined;
|
|
87
|
-
}
|
|
1
|
+
import { type SessionResumeContext, type SessionResumeResult } from './tui-session-resume-contracts.js';
|
|
2
|
+
export type { SessionResumeFailure } from './tui-session-resume-contracts.js';
|
|
88
3
|
/**
|
|
89
4
|
* Resume a past session by id.
|
|
90
5
|
*
|
|
@@ -102,5 +17,4 @@ interface SessionResumeResult {
|
|
|
102
17
|
* stage and reason.
|
|
103
18
|
*/
|
|
104
19
|
export declare function resumeSession(ctx: SessionResumeContext, sessionId: string): Promise<SessionResumeResult | null>;
|
|
105
|
-
export {};
|
|
106
20
|
//# sourceMappingURL=tui-session-resume.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
persistConfigSetting
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KMU7GF7X.js";
|
|
4
4
|
import {
|
|
5
5
|
activeProfileConfigPath
|
|
6
6
|
} from "./chunk-YMXXOOFN.js";
|
|
@@ -99,4 +99,4 @@ async function runBootAutoThin(deps) {
|
|
|
99
99
|
export {
|
|
100
100
|
runBootAutoThin
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=boot-auto-thin-
|
|
102
|
+
//# sourceMappingURL=boot-auto-thin-YMAZI3QL.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Boot-time launch choices: system-prompt variant, mode, YOLO and autonomy (prompted or defaulted). */
|
|
2
|
+
import type { Config } from '@wrongstack/core/types';
|
|
3
|
+
import { type WstackPaths } from '@wrongstack/core/utils';
|
|
4
|
+
import type { BootPhaseExit } from './boot-provider-gate.js';
|
|
5
|
+
import type { ReadlineInputReader } from './input-reader.js';
|
|
6
|
+
import type { TerminalRenderer } from './renderer.js';
|
|
7
|
+
export interface BootLaunchInput {
|
|
8
|
+
isInteractiveTTY: boolean;
|
|
9
|
+
simpleUiFullAuto: boolean;
|
|
10
|
+
flags: Record<string, string | boolean>;
|
|
11
|
+
config: Config;
|
|
12
|
+
renderer: TerminalRenderer;
|
|
13
|
+
reader: ReadlineInputReader;
|
|
14
|
+
profileConfigPath: string;
|
|
15
|
+
wpaths: WstackPaths;
|
|
16
|
+
projectRoot: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function applyBootLaunchChoices(input: BootLaunchInput): Promise<BootPhaseExit | {
|
|
19
|
+
kind: 'ok';
|
|
20
|
+
config: Config;
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=boot-launch-choices.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boot-time provider + model selection: flags, saved defaults, the first-run
|
|
3
|
+
* credential gate, the "continue with these?" summary and the picker.
|
|
4
|
+
*/
|
|
5
|
+
import type { Config, ModelsRegistry } from '@wrongstack/core/types';
|
|
6
|
+
import { type BootConfigResult } from './boot-config.js';
|
|
7
|
+
import type { ReadlineInputReader } from './input-reader.js';
|
|
8
|
+
import type { TerminalRenderer } from './renderer.js';
|
|
9
|
+
export interface BootProviderInput {
|
|
10
|
+
flags: Record<string, string | boolean>;
|
|
11
|
+
config: Config;
|
|
12
|
+
vault: BootConfigResult['vault'];
|
|
13
|
+
modelsRegistry: ModelsRegistry;
|
|
14
|
+
renderer: TerminalRenderer;
|
|
15
|
+
reader: ReadlineInputReader;
|
|
16
|
+
profileConfigPath: string;
|
|
17
|
+
noInteractiveMode: string | boolean | undefined;
|
|
18
|
+
}
|
|
19
|
+
export type BootPhaseExit = {
|
|
20
|
+
kind: 'exit';
|
|
21
|
+
code: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function resolveBootProviderModel(input: BootProviderInput): Promise<BootPhaseExit | {
|
|
24
|
+
kind: 'ok';
|
|
25
|
+
config: Config;
|
|
26
|
+
vault: BootConfigResult['vault'];
|
|
27
|
+
}>;
|
|
28
|
+
//# sourceMappingURL=boot-provider-gate.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DefaultLogger } from '@wrongstack/core/infrastructure';
|
|
2
|
+
import type { DefaultModelsRegistry } from '@wrongstack/core/models';
|
|
3
|
+
import type { Config, SecretVault } from '@wrongstack/core/types';
|
|
4
|
+
import type { WstackPaths } from '@wrongstack/core/utils';
|
|
5
|
+
import type { ReadlineInputReader } from './input-reader.js';
|
|
6
|
+
import type { TerminalRenderer } from './renderer.js';
|
|
7
|
+
export interface BootSubcommandInput {
|
|
8
|
+
first: string | undefined;
|
|
9
|
+
positional: string[];
|
|
10
|
+
flags: Record<string, string | boolean>;
|
|
11
|
+
config: Config;
|
|
12
|
+
vault: SecretVault;
|
|
13
|
+
wpaths: WstackPaths;
|
|
14
|
+
cwd: string;
|
|
15
|
+
projectRoot: string;
|
|
16
|
+
userHome: string;
|
|
17
|
+
renderer: TerminalRenderer;
|
|
18
|
+
reader: ReadlineInputReader;
|
|
19
|
+
logger: DefaultLogger;
|
|
20
|
+
modelsRegistry: DefaultModelsRegistry;
|
|
21
|
+
}
|
|
22
|
+
/** Run the matching subcommand and return its exit code; undefined when none matches. */
|
|
23
|
+
export declare function dispatchBootSubcommand(input: BootSubcommandInput): Promise<number | undefined>;
|
|
24
|
+
//# sourceMappingURL=boot-subcommand-dispatch.d.ts.map
|
package/dist/boot.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { autoSelectSavedProvider, isHomeDirectory, shouldPrintYoloNotice, } from './boot-provider-selection.js';
|
|
2
1
|
import { DefaultLogger } from '@wrongstack/core/infrastructure';
|
|
3
2
|
import type { Config, ModelsRegistry, SecretVault } from '@wrongstack/core/types';
|
|
4
3
|
import { type WstackPaths } from '@wrongstack/core/utils';
|
|
5
4
|
import { ReadlineInputReader } from './input-reader.js';
|
|
6
5
|
import { TerminalRenderer } from './renderer.js';
|
|
7
6
|
import type { UpdateInfo } from './update-check.js';
|
|
7
|
+
export { autoSelectSavedProvider, isHomeDirectory, shouldPrintYoloNotice, } from './boot-provider-selection.js';
|
|
8
8
|
export interface BootContext {
|
|
9
9
|
config: Config;
|
|
10
10
|
vault: SecretVault;
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
* @module chimera-cascade-evidence
|
|
25
25
|
*/
|
|
26
26
|
import type { CascadeEvidenceCheckResult, CascadeEvidenceStatus } from '@wrongstack/core/plugin';
|
|
27
|
-
export type { CascadeEvidenceCheckResult, CascadeEvidenceStatus, } from '@wrongstack/core/plugin';
|
|
28
27
|
/** One claimed verification check: the exact command and its observed exit code. */
|
|
29
28
|
interface CascadeEvidenceCheck {
|
|
30
29
|
command: string;
|
|
@@ -82,4 +81,5 @@ type RunCommandFn = (command: string, cwd: string, timeoutMs: number) => Promise
|
|
|
82
81
|
* block.
|
|
83
82
|
*/
|
|
84
83
|
export declare function verifyCascadeEvidence(evidence: CascadeEvidence | null | undefined, cwd: string, runCommand?: RunCommandFn, timeoutMs?: number): Promise<CascadeEvidenceVerification>;
|
|
84
|
+
export {};
|
|
85
85
|
//# sourceMappingURL=chimera-cascade-evidence.d.ts.map
|
|
@@ -32,85 +32,6 @@ function unknownRestrictedToolNames(restriction, isRegistered) {
|
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
// src/boot/restricted-mode.ts
|
|
36
|
-
import { lockToProjectRoot, lockYoloOff, ToolCapabilities } from "@wrongstack/core/security";
|
|
37
|
-
var RESTRICTED_ENV = "WRONGSTACK_RESTRICTED";
|
|
38
|
-
var RESTRICTED_DENY_CAPABILITIES = [
|
|
39
|
-
ToolCapabilities.SHELL_ARBITRARY,
|
|
40
|
-
ToolCapabilities.SHELL_RESTRICTED,
|
|
41
|
-
ToolCapabilities.SHELL_EXEC,
|
|
42
|
-
ToolCapabilities.NET_OUTBOUND,
|
|
43
|
-
ToolCapabilities.PACKAGE_INSTALL,
|
|
44
|
-
ToolCapabilities.CONFIG_MUTATE,
|
|
45
|
-
ToolCapabilities.FS_WRITE_OUTSIDE_PROJECT,
|
|
46
|
-
ToolCapabilities.TOOL_MUTATE_ANY,
|
|
47
|
-
ToolCapabilities.MCP_PROXY
|
|
48
|
-
];
|
|
49
|
-
var CONFLICTING_FLAGS = [
|
|
50
|
-
"yolo",
|
|
51
|
-
"yolo-destructive",
|
|
52
|
-
"full-auto",
|
|
53
|
-
"mcp-config",
|
|
54
|
-
// Pre-approving a tool would let writes skip the prompt this mode promises.
|
|
55
|
-
"allowed-tools"
|
|
56
|
-
];
|
|
57
|
-
function isRestrictedMode(flags) {
|
|
58
|
-
return flags["restricted"] === true || process.env[RESTRICTED_ENV] === "1";
|
|
59
|
-
}
|
|
60
|
-
function validateRestrictedMode(flags) {
|
|
61
|
-
if (!isRestrictedMode(flags)) return false;
|
|
62
|
-
const conflict = CONFLICTING_FLAGS.find(
|
|
63
|
-
(name) => flags[name] !== void 0 && flags[name] !== false
|
|
64
|
-
);
|
|
65
|
-
if (conflict) throw new Error(`--${conflict} cannot be combined with --restricted`);
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
function withRestrictedTools(restriction, restricted) {
|
|
69
|
-
if (!restricted) return restriction;
|
|
70
|
-
return {
|
|
71
|
-
...restriction?.only ? { only: restriction.only } : {},
|
|
72
|
-
deny: [...restriction?.deny ?? [], "mcp__*"],
|
|
73
|
-
denyCapabilities: RESTRICTED_DENY_CAPABILITIES,
|
|
74
|
-
requireDeclaredCapabilities: true
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
var RESTRICTED_NOTICE = "Restricted mode: no shell, network, installs or MCP tools; files stay inside the project; YOLO is off.";
|
|
78
|
-
var announced = false;
|
|
79
|
-
function activateRestrictedMode(flags, write) {
|
|
80
|
-
if (!validateRestrictedMode(flags)) return false;
|
|
81
|
-
lockToProjectRoot();
|
|
82
|
-
lockYoloOff();
|
|
83
|
-
process.env[RESTRICTED_ENV] = "1";
|
|
84
|
-
if (!announced) {
|
|
85
|
-
announced = true;
|
|
86
|
-
write(`${RESTRICTED_NOTICE}
|
|
87
|
-
`);
|
|
88
|
-
}
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// src/boot/safe-mode.ts
|
|
93
|
-
var SAFE_MODE_ENV = "WRONGSTACK_SAFE_MODE";
|
|
94
|
-
function isSafeMode(flags) {
|
|
95
|
-
return flags["safe-mode"] === true || process.env[SAFE_MODE_ENV] === "1";
|
|
96
|
-
}
|
|
97
|
-
function propagateSafeMode(flags) {
|
|
98
|
-
const on = isSafeMode(flags);
|
|
99
|
-
if (on) process.env[SAFE_MODE_ENV] = "1";
|
|
100
|
-
return on;
|
|
101
|
-
}
|
|
102
|
-
var SAFE_MODE_NOTICE = "Safe mode: third-party plugins, hooks, configured MCP servers, skills and instruction overrides are off.";
|
|
103
|
-
var announced2 = false;
|
|
104
|
-
function announceSafeMode(flags, write) {
|
|
105
|
-
const on = propagateSafeMode(flags);
|
|
106
|
-
if (on && !announced2) {
|
|
107
|
-
announced2 = true;
|
|
108
|
-
write(`${SAFE_MODE_NOTICE}
|
|
109
|
-
`);
|
|
110
|
-
}
|
|
111
|
-
return on;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
35
|
// src/diff-renderer.ts
|
|
115
36
|
import { color, sanitizeTerminalText } from "@wrongstack/core/utils";
|
|
116
37
|
function diffLineStyle(line) {
|
|
@@ -226,6 +147,86 @@ function renderPayloadPreview(input) {
|
|
|
226
147
|
return typeof diff === "string" && diff ? clipPreview(diff, diffLineStyle) : "";
|
|
227
148
|
}
|
|
228
149
|
|
|
150
|
+
// src/boot/restricted-mode.ts
|
|
151
|
+
import { lockToProjectRoot, lockYoloOff, ToolCapabilities } from "@wrongstack/core/security";
|
|
152
|
+
var RESTRICTED_ENV = "WRONGSTACK_RESTRICTED";
|
|
153
|
+
var RESTRICTED_DENY_CAPABILITIES = [
|
|
154
|
+
ToolCapabilities.SHELL_ARBITRARY,
|
|
155
|
+
ToolCapabilities.SHELL_RESTRICTED,
|
|
156
|
+
ToolCapabilities.SHELL_EXEC,
|
|
157
|
+
ToolCapabilities.NET_OUTBOUND,
|
|
158
|
+
ToolCapabilities.PACKAGE_INSTALL,
|
|
159
|
+
ToolCapabilities.CONFIG_MUTATE,
|
|
160
|
+
ToolCapabilities.FS_WRITE_OUTSIDE_PROJECT,
|
|
161
|
+
ToolCapabilities.TOOL_MUTATE_ANY,
|
|
162
|
+
ToolCapabilities.MCP_PROXY
|
|
163
|
+
];
|
|
164
|
+
var CONFLICTING_FLAGS = [
|
|
165
|
+
"yolo",
|
|
166
|
+
"yolo-plus",
|
|
167
|
+
"yolo-destructive",
|
|
168
|
+
"full-auto",
|
|
169
|
+
"mcp-config",
|
|
170
|
+
// Pre-approving a tool would let writes skip the prompt this mode promises.
|
|
171
|
+
"allowed-tools"
|
|
172
|
+
];
|
|
173
|
+
function isRestrictedMode(flags) {
|
|
174
|
+
return flags["restricted"] === true || process.env[RESTRICTED_ENV] === "1";
|
|
175
|
+
}
|
|
176
|
+
function validateRestrictedMode(flags) {
|
|
177
|
+
if (!isRestrictedMode(flags)) return false;
|
|
178
|
+
const conflict = CONFLICTING_FLAGS.find(
|
|
179
|
+
(name) => flags[name] !== void 0 && flags[name] !== false
|
|
180
|
+
);
|
|
181
|
+
if (conflict) throw new Error(`--${conflict} cannot be combined with --restricted`);
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
function withRestrictedTools(restriction, restricted) {
|
|
185
|
+
if (!restricted) return restriction;
|
|
186
|
+
return {
|
|
187
|
+
...restriction?.only ? { only: restriction.only } : {},
|
|
188
|
+
deny: [...restriction?.deny ?? [], "mcp__*"],
|
|
189
|
+
denyCapabilities: RESTRICTED_DENY_CAPABILITIES,
|
|
190
|
+
requireDeclaredCapabilities: true
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
var RESTRICTED_NOTICE = "Restricted mode: no shell, network, installs or MCP tools; files stay inside the project; YOLO is off.";
|
|
194
|
+
var announced = false;
|
|
195
|
+
function activateRestrictedMode(flags, write) {
|
|
196
|
+
if (!validateRestrictedMode(flags)) return false;
|
|
197
|
+
lockToProjectRoot();
|
|
198
|
+
lockYoloOff();
|
|
199
|
+
process.env[RESTRICTED_ENV] = "1";
|
|
200
|
+
if (!announced) {
|
|
201
|
+
announced = true;
|
|
202
|
+
write(`${RESTRICTED_NOTICE}
|
|
203
|
+
`);
|
|
204
|
+
}
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// src/boot/safe-mode.ts
|
|
209
|
+
var SAFE_MODE_ENV = "WRONGSTACK_SAFE_MODE";
|
|
210
|
+
function isSafeMode(flags) {
|
|
211
|
+
return flags["safe-mode"] === true || process.env[SAFE_MODE_ENV] === "1";
|
|
212
|
+
}
|
|
213
|
+
function propagateSafeMode(flags) {
|
|
214
|
+
const on = isSafeMode(flags);
|
|
215
|
+
if (on) process.env[SAFE_MODE_ENV] = "1";
|
|
216
|
+
return on;
|
|
217
|
+
}
|
|
218
|
+
var SAFE_MODE_NOTICE = "Safe mode: third-party plugins, hooks, configured MCP servers, skills and instruction overrides are off.";
|
|
219
|
+
var announced2 = false;
|
|
220
|
+
function announceSafeMode(flags, write) {
|
|
221
|
+
const on = propagateSafeMode(flags);
|
|
222
|
+
if (on && !announced2) {
|
|
223
|
+
announced2 = true;
|
|
224
|
+
write(`${SAFE_MODE_NOTICE}
|
|
225
|
+
`);
|
|
226
|
+
}
|
|
227
|
+
return on;
|
|
228
|
+
}
|
|
229
|
+
|
|
229
230
|
// src/boot/simpleui-full-auto.ts
|
|
230
231
|
function isSimpleUiFullAuto(flags) {
|
|
231
232
|
return flags["simpleui"] === true && flags["full-auto"] === true;
|
|
@@ -607,4 +608,4 @@ export {
|
|
|
607
608
|
detectProjectFacts,
|
|
608
609
|
renderAgentsTemplate
|
|
609
610
|
};
|
|
610
|
-
//# sourceMappingURL=chunk-
|
|
611
|
+
//# sourceMappingURL=chunk-2CMMWRQH.js.map
|