subconscious-cli 4.0.18 → 4.1.0-windows.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -1
- package/bin/agents.js +10 -1
- package/bin/auth.js +7 -0
- package/bin/cli.js +28 -0
- package/bin/native/subc-tui-darwin-amd64 +0 -0
- package/bin/native/subc-tui-darwin-arm64 +0 -0
- package/bin/native/subc-tui-linux-amd64 +0 -0
- package/bin/native/subc-tui-linux-arm64 +0 -0
- package/bin/native/subc-tui-windows-amd64.exe +0 -0
- package/bin/native/subc-tui-windows-arm64.exe +0 -0
- package/bin/profiles.js +11 -4
- package/bin/registry.generated.json +2 -1
- package/bin/sessions.js +622 -0
- package/bin/tui.js +17 -0
- package/bin/update-check.js +90 -17
- package/bin/upgrade.js +27 -11
- package/bin/windows/agents.js +87 -0
- package/bin/windows/claude.js +71 -0
- package/bin/windows/common.js +58 -0
- package/bin/windows/hook.cjs +71 -0
- package/bin/windows/install.js +97 -0
- package/bin/windows/launch.js +97 -0
- package/bin/windows/pi-compaction.ts +29 -0
- package/bin/windows/process.js +157 -0
- package/bin/windows/setup.js +168 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ subc <agent> uninstall
|
|
|
35
35
|
Running `subc` with no arguments in a terminal opens the native Go TUI. Use
|
|
36
36
|
the arrow keys and Enter to launch agents or manage the active profile, `p` to
|
|
37
37
|
switch profiles, and `q` to quit. The menu includes dedicated **Usage**,
|
|
38
|
-
**Create profile**, **Set default model**, **Set subagent model**,
|
|
38
|
+
**Create profile**, **Coding sessions**, **Set default model**, **Set subagent model**,
|
|
39
39
|
**Update base URL**, and **Update platform URL** actions.
|
|
40
40
|
Model and URL changes are validated and saved to the active profile without
|
|
41
41
|
leaving the TUI.
|
|
@@ -76,6 +76,75 @@ subc pi
|
|
|
76
76
|
subc dsh
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
+
## Native Windows support
|
|
80
|
+
|
|
81
|
+
Windows has its own implementation in `cli/bin/windows/`, selected only when
|
|
82
|
+
Node runs on Windows. macOS/Linux continue to use the existing, unchanged shell
|
|
83
|
+
runbooks. WSL continues to use the Linux implementation.
|
|
84
|
+
|
|
85
|
+
Use Node.js 22 or 24 and Windows PowerShell 5.1+ (included with Windows), from either
|
|
86
|
+
PowerShell or Command Prompt. The Windows CLI integrations do not require Bash,
|
|
87
|
+
`jq`, `curl`, or WSL. The agents themselves must support your Windows version;
|
|
88
|
+
their own dependencies still apply.
|
|
89
|
+
|
|
90
|
+
```powershell
|
|
91
|
+
npm.cmd install -g subconscious-cli@windows
|
|
92
|
+
subc.cmd login
|
|
93
|
+
subc.cmd claude
|
|
94
|
+
subc codex
|
|
95
|
+
subc opencode
|
|
96
|
+
subc dsh
|
|
97
|
+
subc cursor install
|
|
98
|
+
subc copilot install
|
|
99
|
+
subc pi
|
|
100
|
+
subc config edit notepad
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
This is an opt-in Windows preview; `@latest` remains the stable release. Update
|
|
104
|
+
the preview with `npm.cmd install -g subconscious-cli@windows`.
|
|
105
|
+
|
|
106
|
+
If PowerShell's execution policy blocks npm-generated `.ps1` entry points, use
|
|
107
|
+
`npm.cmd` and `subc.cmd` or run the same commands in Command Prompt. No policy
|
|
108
|
+
change is required. Pi must already be installed; other terminal agents offer
|
|
109
|
+
their Windows installer when missing in an interactive terminal.
|
|
110
|
+
|
|
111
|
+
Native executables and standard npm `.cmd` shims are supported. The launcher
|
|
112
|
+
invokes the underlying executable or Node entry point directly, preserving
|
|
113
|
+
JSON, quotes, Unicode, and multiline arguments. It checks the user's `.local\bin`,
|
|
114
|
+
npm globals, WinGet links, and the system-profile `.local\bin` location reported
|
|
115
|
+
by some elevated Claude installations. It does not change your global PATH.
|
|
116
|
+
Custom batch wrappers are rejected with guidance to use a native executable or
|
|
117
|
+
standard npm package.
|
|
118
|
+
|
|
119
|
+
Login, saved profiles, model discovery, session browsing/resume, self-update,
|
|
120
|
+
and the native TUI use Windows paths and processes. Profile editing defaults to
|
|
121
|
+
Notepad, honors `VISUAL`/`EDITOR`, and supports `code`/`code-insiders` with `--wait`.
|
|
122
|
+
The existing profile location remains `%USERPROFILE%\.subconscious`.
|
|
123
|
+
|
|
124
|
+
Cursor, Copilot, Codex, and Pi setup use native JSON merges and Node hooks. Other
|
|
125
|
+
providers and hooks are preserved; malformed configuration is left unchanged.
|
|
126
|
+
Hook credentials are stored in `subconscious-windows.json` within the agent's
|
|
127
|
+
user directory; treat that file as a secret. Copilot's model provider still uses
|
|
128
|
+
VS Code's secret store and prompts for its key. Its configuration goes under
|
|
129
|
+
`%APPDATA%\Code\User` (or Code - Insiders/VSCodium). Rerun install after moving
|
|
130
|
+
your Node installation, because hooks record the absolute Node executable path.
|
|
131
|
+
|
|
132
|
+
To install the native x64 `sc.exe` preview:
|
|
133
|
+
|
|
134
|
+
```powershell
|
|
135
|
+
$env:SC_CODE_VERSION = '0.1.4-windows.0'
|
|
136
|
+
subc.cmd sc install
|
|
137
|
+
subc.cmd sc
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The installer requires the selected release's Windows asset and SHA-256
|
|
141
|
+
checksum; it reports a clear error if unavailable and never downloads a Unix
|
|
142
|
+
binary as a fallback. Windows ARM64 binaries are not published in this preview.
|
|
143
|
+
|
|
144
|
+
Run `npm run test:windows` from `cli/` for the separate Windows suite. The
|
|
145
|
+
Windows CI job also builds/tests the Go TUI. Existing Unix tests and runbooks
|
|
146
|
+
remain separate and unchanged.
|
|
147
|
+
|
|
79
148
|
## Supported agents
|
|
80
149
|
|
|
81
150
|
The packaged integrations live in `cli/bin/runbook`.
|
|
@@ -91,6 +160,35 @@ The packaged integrations live in `cli/bin/runbook`.
|
|
|
91
160
|
| `subc pi` | Refresh the Pi provider from the live catalog, then launch |
|
|
92
161
|
| `subc dsh` | Launch the DeepSeek Harness Web UI with a temporary provider populated from the live catalog |
|
|
93
162
|
|
|
163
|
+
## Sessions and cross-harness handoff
|
|
164
|
+
|
|
165
|
+
Run `subc` and choose **Coding sessions**, or list the same local catalog from
|
|
166
|
+
the shell:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
subc sessions
|
|
170
|
+
subc sessions resume claude:SESSION_ID
|
|
171
|
+
subc sessions resume claude:SESSION_ID --harness codex
|
|
172
|
+
subc sessions resume codex:SESSION_ID --harness opencode
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
The catalog discovers recent sessions written locally by Claude Code, Codex,
|
|
176
|
+
OpenCode, Pi, and Subconscious Code. It shows each session's originating
|
|
177
|
+
harness, title, last activity, project directory, and model when the harness
|
|
178
|
+
records one. Selecting the original harness uses its native resume mechanism.
|
|
179
|
+
|
|
180
|
+
Selecting Claude Code, Codex, OpenCode, or Pi as a different destination starts
|
|
181
|
+
a new session in the original project directory with a portable handoff. The
|
|
182
|
+
handoff is limited to the newest 24 user/assistant text messages and 24,000
|
|
183
|
+
characters. Tool payloads, tool results, system prompts, and hidden reasoning
|
|
184
|
+
are not copied. Source transcripts remain owned by their original harness and
|
|
185
|
+
are never rewritten.
|
|
186
|
+
|
|
187
|
+
Cursor and GitHub Copilot sessions are not listed because their IDE-owned
|
|
188
|
+
conversation stores do not expose a stable local resume interface. A session
|
|
189
|
+
whose local transcript is missing remains available for native resume but does
|
|
190
|
+
not offer cross-harness destinations.
|
|
191
|
+
|
|
94
192
|
If Subconscious Code, Claude Code, Codex, OpenCode, or DeepSeek Harness is missing, an interactive terminal offers
|
|
95
193
|
to install it before launching. Pi refreshes its Subconscious provider on every
|
|
96
194
|
`subc pi` launch while preserving all other providers in `models.json`; its
|
package/bin/agents.js
CHANGED
|
@@ -19,6 +19,7 @@ import path from 'node:path';
|
|
|
19
19
|
import readline from 'node:readline';
|
|
20
20
|
import { fileURLToPath } from 'node:url';
|
|
21
21
|
import { c } from './colors.js';
|
|
22
|
+
import { runWindowsAgent } from './windows/agents.js';
|
|
22
23
|
import { getApiKey } from './auth.js';
|
|
23
24
|
import {
|
|
24
25
|
isUnsetSetting,
|
|
@@ -170,7 +171,7 @@ const AGENT_HELP = {
|
|
|
170
171
|
'Launches the native Subconscious coding agent with the selected profile gateway, credential, and model.',
|
|
171
172
|
options: [
|
|
172
173
|
['help', 'Show this help'],
|
|
173
|
-
['install', 'Install the latest precompiled Linux or macOS release'],
|
|
174
|
+
['install', process.platform === 'win32' ? 'Install a verified Windows release, when published upstream' : 'Install the latest precompiled Linux or macOS release'],
|
|
174
175
|
['--model MODEL', 'Override the profile model for this launch'],
|
|
175
176
|
['ARGS...', 'Pass arguments directly to Subconscious Code'],
|
|
176
177
|
],
|
|
@@ -976,6 +977,14 @@ export async function runAgent(agent, argv, options = {}) {
|
|
|
976
977
|
return 0;
|
|
977
978
|
}
|
|
978
979
|
|
|
980
|
+
if (process.platform === 'win32') {
|
|
981
|
+
return runWindowsAgent(agent, argv, {
|
|
982
|
+
profile, parseAgentAction, extractModel, requireApiKey,
|
|
983
|
+
resolvedModelsForLaunch, selectLaunchModel, runbookEnv,
|
|
984
|
+
minimumClaudeVersion: MIN_CLAUDE_CODE_VERSION, parseClaudeVersion, claudeVersionNeedsUpgrade,
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
|
|
979
988
|
const parsed = parseAgentAction(agent, argv);
|
|
980
989
|
if (parsed.action !== 'launch') {
|
|
981
990
|
if (!agent.runbook?.setupScript) {
|
package/bin/auth.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import http from 'node:http';
|
|
19
19
|
import crypto from 'node:crypto';
|
|
20
20
|
import { exec } from 'node:child_process';
|
|
21
|
+
import { openWindowsBrowser } from './windows/process.js';
|
|
21
22
|
import fs from 'node:fs/promises';
|
|
22
23
|
import os from 'node:os';
|
|
23
24
|
import path from 'node:path';
|
|
@@ -135,6 +136,12 @@ export function isLoginMissing(status) {
|
|
|
135
136
|
// ── Browser opener ──────────────────────────────────────────────────────
|
|
136
137
|
|
|
137
138
|
function openBrowser(url) {
|
|
139
|
+
if (process.platform === 'win32') {
|
|
140
|
+
void openWindowsBrowser(url).then(code => {
|
|
141
|
+
if (code) throw new Error('Browser could not be opened');
|
|
142
|
+
}).catch(() => console.log(`Please open this URL manually:\n\n ${url}\n`));
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
138
145
|
const cmd =
|
|
139
146
|
process.platform === 'darwin'
|
|
140
147
|
? `open "${url}"`
|
package/bin/cli.js
CHANGED
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
import { resolveModelCatalog } from './models.js';
|
|
45
45
|
import { showUpdateNotice } from './update-check.js';
|
|
46
46
|
import { runTui } from './tui.js';
|
|
47
|
+
import { sessionsCommand } from './sessions.js';
|
|
47
48
|
import { printUsageHelp, usageCommand } from './usage.js';
|
|
48
49
|
|
|
49
50
|
function isHelpArg(arg) {
|
|
@@ -75,6 +76,9 @@ function printHelp() {
|
|
|
75
76
|
${c.cyan}config${c.reset} List profiles, or show/edit one with ${c.dim}-p${c.reset}
|
|
76
77
|
${c.cyan}models${c.reset} List available Subconscious models
|
|
77
78
|
|
|
79
|
+
${c.bold}Sessions${c.reset}
|
|
80
|
+
${c.cyan}sessions${c.reset} Browse and resume local coding sessions across harnesses
|
|
81
|
+
|
|
78
82
|
${c.bold}Coding agents${c.reset}
|
|
79
83
|
${agents}
|
|
80
84
|
|
|
@@ -92,6 +96,8 @@ ${agents}
|
|
|
92
96
|
${c.dim}$${c.reset} subc config help
|
|
93
97
|
${c.dim}$${c.reset} subc -p staging config
|
|
94
98
|
${c.dim}$${c.reset} subc config edit vim
|
|
99
|
+
${c.dim}$${c.reset} subc sessions
|
|
100
|
+
${c.dim}$${c.reset} subc sessions resume claude:SESSION_ID --harness codex
|
|
95
101
|
${c.dim}$${c.reset} subc usage
|
|
96
102
|
${c.dim}$${c.reset} subc usage --json
|
|
97
103
|
${c.dim}$${c.reset} subc claude
|
|
@@ -179,6 +185,17 @@ Usage:
|
|
|
179
185
|
|
|
180
186
|
List available Subconscious models. The default is the profile MODEL,
|
|
181
187
|
or the first live catalog model if MODEL is UNSET.
|
|
188
|
+
`,
|
|
189
|
+
sessions: `
|
|
190
|
+
Usage:
|
|
191
|
+
subc sessions
|
|
192
|
+
subc sessions resume <session-key>
|
|
193
|
+
subc sessions resume <session-key> --harness <claude|codex|opencode|pi>
|
|
194
|
+
subc sessions help
|
|
195
|
+
|
|
196
|
+
List locally stored sessions from supported coding harnesses. Resuming with the
|
|
197
|
+
original harness uses its native session. Choosing another harness starts a new
|
|
198
|
+
session with a bounded, text-only handoff from the source conversation.
|
|
182
199
|
`,
|
|
183
200
|
};
|
|
184
201
|
|
|
@@ -355,6 +372,17 @@ async function main() {
|
|
|
355
372
|
return;
|
|
356
373
|
}
|
|
357
374
|
|
|
375
|
+
if (command === 'sessions') {
|
|
376
|
+
if (isHelpArg(args[1])) {
|
|
377
|
+
console.log(COMMAND_HELP.sessions);
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
const profile = await loadProfile(profileName);
|
|
381
|
+
requireNamedProfile(profile);
|
|
382
|
+
await sessionsCommand(args.slice(1), { profile });
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
|
|
358
386
|
if (command === 'upgrade') {
|
|
359
387
|
if (isHelpArg(args[1])) {
|
|
360
388
|
console.log(COMMAND_HELP.upgrade);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/profiles.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { spawn, execFileSync } from 'node:child_process';
|
|
10
|
+
import { windowsEditor, runWindows } from './windows/process.js';
|
|
10
11
|
import fs from 'node:fs/promises';
|
|
11
12
|
import os from 'node:os';
|
|
12
13
|
import path from 'node:path';
|
|
@@ -658,7 +659,7 @@ export function validateSettingValue(setting, value) {
|
|
|
658
659
|
return null;
|
|
659
660
|
}
|
|
660
661
|
|
|
661
|
-
const ALLOWED_EDITORS = new Set(['vim', 'nano']);
|
|
662
|
+
const ALLOWED_EDITORS = new Set(process.platform === 'win32' ? ['notepad', 'code', 'code-insiders', 'vim', 'nano'] : ['vim', 'nano']);
|
|
662
663
|
|
|
663
664
|
function commandExists(bin) {
|
|
664
665
|
try {
|
|
@@ -695,6 +696,12 @@ async function editProfile(profileName, requestedEditor) {
|
|
|
695
696
|
}
|
|
696
697
|
|
|
697
698
|
const profile = await ensureProfile(profileName);
|
|
699
|
+
if (process.platform === 'win32') {
|
|
700
|
+
const { command, args } = windowsEditor(requestedEditor);
|
|
701
|
+
const code = await runWindows(command, [...args, profile.path]);
|
|
702
|
+
if (code) process.exitCode = code;
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
698
705
|
const { cmd, args } = resolveEditor(requestedEditor);
|
|
699
706
|
await new Promise((resolve, reject) => {
|
|
700
707
|
const child = spawn(cmd, [...args, profile.path], { stdio: 'inherit' });
|
|
@@ -714,8 +721,8 @@ Usage:
|
|
|
714
721
|
subc config
|
|
715
722
|
subc config help
|
|
716
723
|
subc -p NAME config
|
|
717
|
-
subc config edit [vim|nano]
|
|
718
|
-
subc -p NAME config edit [vim|nano]
|
|
724
|
+
subc config edit [${process.platform === 'win32' ? 'notepad|code|code-insiders|vim|nano' : 'vim|nano'}]
|
|
725
|
+
subc -p NAME config edit [${process.platform === 'win32' ? 'notepad|code|code-insiders|vim|nano' : 'vim|nano'}]
|
|
719
726
|
subc config [show|path|list|create|delete]
|
|
720
727
|
[--gateway-url URL] [--platform-url URL] [--api-key KEY]
|
|
721
728
|
[--model MODEL|UNSET]
|
|
@@ -723,7 +730,7 @@ Usage:
|
|
|
723
730
|
|
|
724
731
|
subc config List every profile and its file path
|
|
725
732
|
subc -p NAME config Print that profile's path and env file
|
|
726
|
-
subc config edit Open the selected profile in $VISUAL, $EDITOR, vim, or nano
|
|
733
|
+
subc config edit Open the selected profile in ${process.platform === 'win32' ? 'VISUAL, EDITOR, or Notepad' : '$VISUAL, $EDITOR, vim, or nano'}
|
|
727
734
|
subc config edit vim Open the selected profile in vim
|
|
728
735
|
subc config edit nano Open the selected profile in nano
|
|
729
736
|
subc config path Print the selected profile path
|