subconscious-cli 4.0.2 → 4.0.4

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 CHANGED
@@ -27,7 +27,7 @@ and Pi integrations are installed per agent:
27
27
  ```bash
28
28
  subc cursor install
29
29
  subc copilot install
30
- subc pi install
30
+ subc pi
31
31
  subc <agent> uninstall
32
32
  ```
33
33
 
@@ -70,12 +70,12 @@ The packaged integrations live in `cli/bin/runbook`.
70
70
  | `subc opencode` | Launch OpenCode with the runbook provider, client header, and context/output limits |
71
71
  | `subc cursor install` | Install/update Cursor conversation and compaction hooks |
72
72
  | `subc copilot install` | Install/update the VS Code custom endpoint and Copilot hooks |
73
- | `subc pi install` then `subc pi` | Merge the Pi provider, then launch |
73
+ | `subc pi` | Refresh the Pi provider from the live catalog, then launch |
74
74
 
75
75
  If Claude Code, Codex, or OpenCode is missing, an interactive terminal offers
76
- to install it before launching. Pi requires `subc pi install` first; if its
77
- executable or Subconscious provider is missing, the CLI exits with instructions
78
- instead of installing the binary.
76
+ to install it before launching. Pi refreshes its Subconscious provider on every
77
+ `subc pi` launch while preserving all other providers in `models.json`; its
78
+ executable must already be installed.
79
79
 
80
80
  `subc codex` disables Codex apps and plugin tools for that launch by default so
81
81
  requests remain below the gateway's 128-tool limit. Core coding tools remain
package/bin/agents.js CHANGED
@@ -222,10 +222,10 @@ const AGENT_HELP = {
222
222
  pi: {
223
223
  usage: 'subc [-p NAME] pi [help|install|status|uninstall] [Pi arguments...]',
224
224
  behavior:
225
- 'Launches Pi read-only against the provider previously configured by subc pi install.',
225
+ 'Refreshes the persistent Subconscious provider from the live catalog, then launches Pi.',
226
226
  options: [
227
227
  ['help', 'Show this help'],
228
- ['install', 'Merge the Subconscious provider into ~/.pi/agent/models.json'],
228
+ ['install', 'Refresh the Subconscious provider without launching Pi'],
229
229
  ['status', 'Inspect the persistent Pi provider'],
230
230
  ['uninstall', 'Remove only the Subconscious Pi provider and extension'],
231
231
  ['--model MODEL', 'Override the profile model for this launch'],
package/bin/branding.js CHANGED
@@ -1,4 +1,4 @@
1
- import { colorEnabled } from './colors.js';
1
+ import { BRAND_ORANGE, colorEnabled } from './colors.js';
2
2
 
3
3
  // Pre-rendered from assets/imgs/logo.png as portable, 7-bit ASCII art.
4
4
  const LOGO = [
@@ -20,7 +20,6 @@ const LOGO = [
20
20
  ' ###### #####',
21
21
  ].join('\n');
22
22
 
23
- const ORANGE = '\x1b[38;2;255;92;40m';
24
23
  const BOLD = '\x1b[1m';
25
24
  const RESET = '\x1b[0m';
26
25
 
@@ -34,6 +33,6 @@ export function renderBanner(options = {}) {
34
33
  // still get the same logo without ANSI styling.
35
34
  if (!isTTY || term === 'dumb') return ` ${title}`;
36
35
 
37
- const logo = color ? `${ORANGE}${LOGO}${RESET}` : LOGO;
36
+ const logo = color ? `${BRAND_ORANGE}${LOGO}${RESET}` : LOGO;
38
37
  return `${logo}\n\n ${title}`;
39
38
  }
package/bin/colors.js CHANGED
@@ -10,6 +10,11 @@ export const colorEnabled =
10
10
  (forceColor || process.stdout.isTTY === true);
11
11
 
12
12
  const ansi = (code) => (colorEnabled ? `\x1b[${code}m` : '');
13
+ const rgb = (red, green, blue) =>
14
+ colorEnabled ? `\x1b[38;2;${red};${green};${blue}m` : '';
15
+ const bgRgb = (red, green, blue) =>
16
+ colorEnabled ? `\x1b[48;2;${red};${green};${blue}m` : '';
17
+ export const BRAND_ORANGE = '\x1b[38;2;255;92;40m';
13
18
 
14
19
  export const c = {
15
20
  reset: ansi(0),
@@ -20,6 +25,10 @@ export const c = {
20
25
  red: ansi(31),
21
26
  yellow: ansi(33),
22
27
  magenta: ansi(35),
28
+ black: ansi(30),
29
+ orange: colorEnabled ? BRAND_ORANGE : '',
30
+ orangeSoft: rgb(255, 145, 105),
31
+ bgOrange: bgRgb(255, 92, 40),
23
32
  underline: ansi(4),
24
33
  inverse: ansi(7),
25
34
  };
@@ -269,7 +269,7 @@
269
269
  "command": "pi",
270
270
  "name": "Pi",
271
271
  "aliases": [],
272
- "description": "Launch Pi with the Subconscious provider and active profile model configured by subc pi install.",
272
+ "description": "Refresh Pi with the live Subconscious model catalog and launch the active profile model.",
273
273
  "framework": "Pi",
274
274
  "language": "shell",
275
275
  "category": "coding-agent",
@@ -149,7 +149,7 @@ for model_id in "${SUPPORTED_MODELS[@]}"; do
149
149
  fi
150
150
  done
151
151
 
152
- PI_DIR="${HOME}/.pi/agent"
152
+ PI_DIR="${PI_CODING_AGENT_DIR:-${HOME}/.pi/agent}"
153
153
  MODELS_JSON="${PI_DIR}/models.json"
154
154
  EXTENSIONS_DIR="${PI_DIR}/extensions"
155
155
  EXTENSION_DST="${EXTENSIONS_DIR}/subconscious-compaction.ts"
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env bash
2
- # Launch Pi with the Subconscious provider configured by `subc pi install`.
3
- # This script is deliberately read-only: it never installs Pi, writes config,
4
- # or updates the persistent integration.
2
+ # Refresh the Subconscious provider from the live catalog, then launch Pi.
3
+ # Other providers in models.json are preserved.
5
4
 
6
5
  set -euo pipefail
7
6
 
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ GATEWAY_URL="${GATEWAY_URL:-}"
9
+ API_KEY="${PI_API_KEY:-${API_KEY:-}}"
8
10
  MODEL="${MODEL:-subconscious/glm-5.2}"
9
11
  PI_DIR="${PI_CODING_AGENT_DIR:-${HOME}/.pi/agent}"
10
12
  MODELS_JSON="${PI_DIR}/models.json"
11
13
 
12
- if [[ ! -f "$MODELS_JSON" ]] || ! grep -q 'x-subconscious-client' "$MODELS_JSON" 2>/dev/null; then
13
- echo "Pi is not configured for Subconscious. Run 'subc pi install' first." >&2
14
+ if [[ -z "$GATEWAY_URL" || -z "$API_KEY" ]]; then
15
+ echo "error: GATEWAY_URL and API_KEY are required to configure Pi" >&2
14
16
  exit 1
15
17
  fi
16
18
 
17
- if command -v jq >/dev/null 2>&1 && ! jq -e \
18
- --arg model "$MODEL" \
19
- '.providers.subconscious.models[]? | select(.id == $model)' \
20
- "$MODELS_JSON" >/dev/null 2>&1; then
21
- echo "Model '$MODEL' is not present in the Pi catalog. Run 'subc pi install' to refresh it." >&2
22
- exit 1
23
- fi
19
+ "${SCRIPT_DIR}/install.sh" install \
20
+ --gateway-url "$GATEWAY_URL" \
21
+ --api-key "$API_KEY" \
22
+ --model "$MODEL" \
23
+ >/dev/null
24
24
 
25
25
  exec pi --provider subconscious --model "$MODEL" "$@"
@@ -1,11 +1,18 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import { spawn } from 'node:child_process';
3
3
  import readline from 'node:readline';
4
- import { c } from './colors.js';
4
+ import { c, colorEnabled } from './colors.js';
5
5
 
6
6
  export const PACKAGE_NAME = 'subconscious-cli';
7
7
  export const UPDATE_CHECK_TIMEOUT_MS = 1500;
8
8
  const UPDATE_ACTIONS = ['Update now', 'Skip for now'];
9
+ const UPDATE_LOGO = [
10
+ ' ● ●',
11
+ ' ╲ ╱ ',
12
+ '●─── ╳ ───●',
13
+ ' ╱ ╲ ',
14
+ ' ● ●',
15
+ ];
9
16
 
10
17
  function parseVersion(version) {
11
18
  const match = String(version)
@@ -85,18 +92,32 @@ export async function fetchLatestVersion(options = {}) {
85
92
  }
86
93
 
87
94
  export function renderUpdateNotice(installedVersion, latestVersion) {
88
- const title = 'Subconscious CLI update available';
89
- const versions = `${installedVersion} -> ${latestVersion}`;
90
- const width = Math.max(title.length, versions.length);
91
- const border = `+${'-'.repeat(width + 2)}+`;
92
- const row = (text, style = '') =>
93
- `${c.yellow}|${c.reset} ${style}${text.padEnd(width)}${c.reset} ${c.yellow}|${c.reset}`;
95
+ const logoWidth = Math.max(...UPDATE_LOGO.map((line) => line.length));
96
+ const textWidth = 24;
97
+ const gap = ' ';
98
+ const innerWidth = logoWidth + gap.length + textWidth + 2;
99
+ const border = `${c.orange}╭${''.repeat(innerWidth)}╮${c.reset}`;
100
+ const bottom = `${c.orange}╰${'─'.repeat(innerWidth)}╯${c.reset}`;
101
+ const text = [
102
+ { raw: 'Subconscious CLI', value: `${c.orange}${c.bold}Subconscious CLI${c.reset}` },
103
+ { raw: 'Update available', value: `${c.bold}Update available${c.reset}` },
104
+ { raw: '', value: '' },
105
+ {
106
+ raw: `${installedVersion} → ${latestVersion}`,
107
+ value: `${c.dim}${installedVersion}${c.reset} ${c.orange}→${c.reset} ${c.orange}${c.bold}${latestVersion}${c.reset}`,
108
+ },
109
+ { raw: '', value: '' },
110
+ ];
111
+ const row = (logo, copy) => {
112
+ const logoPadding = ' '.repeat(logoWidth - logo.length);
113
+ const textPadding = ' '.repeat(textWidth - copy.raw.length);
114
+ return `${c.orange}│${c.reset} ${c.orange}${logo}${logoPadding}${c.reset}${gap}${copy.value}${textPadding} ${c.orange}│${c.reset}`;
115
+ };
94
116
 
95
117
  return [
96
- ` ${c.yellow}${border}${c.reset}`,
97
- ` ${row(title, c.bold)}`,
98
- ` ${row(versions, c.cyan)}`,
99
- ` ${c.yellow}${border}${c.reset}`,
118
+ ` ${border}`,
119
+ ...UPDATE_LOGO.map((logo, index) => ` ${row(logo, text[index])}`),
120
+ ` ${bottom}`,
100
121
  ].join('\n');
101
122
  }
102
123
 
@@ -110,11 +131,14 @@ export function renderUpdateOptions(selectedIndex = 0, versions = {}) {
110
131
 
111
132
  return UPDATE_ACTIONS.map((label, index) => {
112
133
  const active = index === selectedIndex;
113
- const pointer = active ? `${c.cyan}>${c.reset}` : ' ';
134
+ const pointer = active ? `${c.orange}›${c.reset}` : ' ';
135
+ const activeStyle = colorEnabled
136
+ ? `${c.bgOrange}${c.black}`
137
+ : c.inverse;
114
138
  const option = active
115
- ? `${c.inverse}${c.bold} ${label} ${c.reset}`
139
+ ? `${activeStyle}${c.bold} ${label} ${c.reset}`
116
140
  : ` ${label} `;
117
- const descriptionStyle = active ? c.cyan : c.dim;
141
+ const descriptionStyle = active ? c.orangeSoft : c.dim;
118
142
  return ` ${pointer} ${option}\n ${descriptionStyle}${descriptions[index]}${c.reset}`;
119
143
  }).join('\n');
120
144
  }
@@ -132,7 +156,7 @@ export async function selectUpdateAction(options = {}) {
132
156
  const output = options.output || process.stderr;
133
157
  const initiallyRaw = input.isRaw === true;
134
158
  let selectedIndex = options.selectedIndex ?? 0;
135
- const instructions = ` ${c.dim}Use ↑/↓ to select Enter to confirm${c.reset}`;
159
+ const instructions = ` ${c.dim}Use ${c.orange}↑/↓${c.reset}${c.dim} to select ${c.orange}Enter${c.reset}${c.dim} to confirm${c.reset}`;
136
160
  const render = () =>
137
161
  `${renderUpdateOptions(selectedIndex, {
138
162
  installedVersion: options.installedVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subconscious-cli",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "CLI for Subconscious — run Claude Code, Codex, OpenCode, Cursor, Copilot, and Pi",
5
5
  "bin": {
6
6
  "subc": "bin/cli.js"