scalix 1.4.1 → 1.5.1
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/CHANGELOG.md +60 -0
- package/README.md +29 -10
- package/dist/agent-replay.js +2 -1
- package/dist/agent.js +319 -26
- package/dist/api-client.js +159 -26
- package/dist/cli.js +671 -252
- package/dist/cloud.js +94 -5
- package/dist/constants.js +96 -10
- package/dist/cost-tracker.js +43 -5
- package/dist/headless.js +44 -20
- package/dist/ipc-server.js +63 -12
- package/dist/keychain.js +46 -22
- package/dist/markdown.js +18 -1
- package/dist/providers/index.js +31 -0
- package/dist/providers/openai.js +149 -0
- package/dist/settings.js +117 -8
- package/dist/slash-commands.js +148 -0
- package/dist/sub-agent.js +1 -0
- package/package.json +13 -3
- package/PARITY-PLAN.md +0 -116
- package/docs/DISTRIBUTION.md +0 -301
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The slash-command catalog, in the two shapes the TUI needs it.
|
|
3
|
+
*
|
|
4
|
+
* These used to be two array literals a thousand lines apart inside cli.tsx and
|
|
5
|
+
* they had drifted: /update was reachable but absent from the typeahead, while
|
|
6
|
+
* /fork, /permissions, /resume and /skills were in the typeahead but missing
|
|
7
|
+
* from /help. Keeping both here lets slash-commands.test.ts assert they stay in
|
|
8
|
+
* agreement, so a command added to one is never silently missing from the other.
|
|
9
|
+
*/
|
|
10
|
+
/** Every built-in command, as offered by the "/" typeahead. */
|
|
11
|
+
export const SLASH_COMMANDS = [
|
|
12
|
+
{ cmd: '/help', desc: 'Show all commands' },
|
|
13
|
+
{ cmd: '/clear', desc: 'Reset conversation' },
|
|
14
|
+
{ cmd: '/models', desc: 'List active models' },
|
|
15
|
+
{ cmd: '/model', desc: 'Switch model' },
|
|
16
|
+
{ cmd: '/mode', desc: 'Permission mode (plan/default/auto/yolo)' },
|
|
17
|
+
{ cmd: '/thinking', desc: 'Thinking mode (off/low/medium/high)' },
|
|
18
|
+
{ cmd: '/plan', desc: 'Enter plan mode (read-only)' },
|
|
19
|
+
{ cmd: '/compact', desc: 'Compress conversation context' },
|
|
20
|
+
{ cmd: '/context', desc: 'Show context usage & token count' },
|
|
21
|
+
{ cmd: '/cost', desc: 'Show token usage & cost' },
|
|
22
|
+
{ cmd: '/diff', desc: 'Show uncommitted changes' },
|
|
23
|
+
{ cmd: '/copy', desc: 'Copy last response to clipboard' },
|
|
24
|
+
{ cmd: '/save', desc: 'Save current session' },
|
|
25
|
+
{ cmd: '/load', desc: 'Resume a saved session' },
|
|
26
|
+
{ cmd: '/resume', desc: 'Resume from crash recovery or saved session' },
|
|
27
|
+
{ cmd: '/fork', desc: 'Fork conversation from a point in history' },
|
|
28
|
+
{ cmd: '/export', desc: 'Export conversation as text' },
|
|
29
|
+
{ cmd: '/index', desc: 'Scan & index project files' },
|
|
30
|
+
{ cmd: '/init', desc: 'Initialize project config (SCALIX.md)' },
|
|
31
|
+
{ cmd: '/git', desc: 'Show git context' },
|
|
32
|
+
{ cmd: '/memory', desc: 'Show project memory' },
|
|
33
|
+
{ cmd: '/remember', desc: 'Save a note about this project' },
|
|
34
|
+
{ cmd: '/replay', desc: 'Show session timeline' },
|
|
35
|
+
{ cmd: '/plugins', desc: 'Show loaded plugins' },
|
|
36
|
+
{ cmd: '/trust', desc: 'Trust this workspace (load project plugins/hooks/rules)' },
|
|
37
|
+
{ cmd: '/router', desc: 'Show model routing status' },
|
|
38
|
+
{ cmd: '/status', desc: 'Version, model & connection info' },
|
|
39
|
+
{ cmd: '/update', desc: 'Check for and install updates' },
|
|
40
|
+
{ cmd: '/doctor', desc: 'Diagnose installation' },
|
|
41
|
+
{ cmd: '/mcp', desc: 'Add MCP server' },
|
|
42
|
+
{ cmd: '/cloud', desc: 'Scalix Cloud status, platform tools & refresh' },
|
|
43
|
+
{ cmd: '/login', desc: 'Link your Scalix account (API key)' },
|
|
44
|
+
{ cmd: '/setup', desc: 'Reconfigure API key, URL & models' },
|
|
45
|
+
{ cmd: '/settings', desc: 'View & configure limits' },
|
|
46
|
+
{ cmd: '/permissions', desc: 'View permission rules & recent denials' },
|
|
47
|
+
{ cmd: '/shortcuts', desc: 'Keyboard shortcuts' },
|
|
48
|
+
{ cmd: '/hooks', desc: 'Show lifecycle hooks' },
|
|
49
|
+
{ cmd: '/commands', desc: 'Show custom commands' },
|
|
50
|
+
{ cmd: '/skills', desc: 'List available skills' },
|
|
51
|
+
{ cmd: '/delegate', desc: 'Run task with sub-agent' },
|
|
52
|
+
{ cmd: '/agents', desc: 'Show active agents & usage' },
|
|
53
|
+
{ cmd: '/checkpoint', desc: 'Create git checkpoint' },
|
|
54
|
+
{ cmd: '/undo', desc: 'Undo last checkpoint' },
|
|
55
|
+
{ cmd: '/checkpoints', desc: 'List recent checkpoints' },
|
|
56
|
+
{ cmd: '/commit', desc: 'Auto-generate commit message & commit' },
|
|
57
|
+
{ cmd: '/review', desc: 'AI code review of current changes' },
|
|
58
|
+
{ cmd: '/watch', desc: 'Run command, auto-fix on failure' },
|
|
59
|
+
{ cmd: '/create', desc: 'Scaffold a new project' },
|
|
60
|
+
{ cmd: '/worktree', desc: 'Manage git worktrees for isolated work' },
|
|
61
|
+
{ cmd: '/plugin', desc: 'Install/enable/disable/uninstall plugins' },
|
|
62
|
+
{ cmd: '/notify', desc: 'Test terminal notification' },
|
|
63
|
+
{ cmd: '/exit', desc: 'Save & exit' },
|
|
64
|
+
];
|
|
65
|
+
/** Grouped, arg-annotated rendering of the same catalog, as printed by /help. */
|
|
66
|
+
export const HELP_LINES = [
|
|
67
|
+
'Session & Navigation:',
|
|
68
|
+
' /help \u2014 show commands',
|
|
69
|
+
' /shortcuts \u2014 keyboard shortcuts',
|
|
70
|
+
' /clear \u2014 reset conversation',
|
|
71
|
+
' /save [name] \u2014 save current session',
|
|
72
|
+
' /load \u2014 resume a saved session',
|
|
73
|
+
' /resume \u2014 resume from crash recovery or saved session',
|
|
74
|
+
' /fork \u2014 fork conversation from a point in history',
|
|
75
|
+
' /export [f] \u2014 export conversation as text',
|
|
76
|
+
' /exit \u2014 save & exit',
|
|
77
|
+
'',
|
|
78
|
+
'Model & Mode:',
|
|
79
|
+
' /models \u2014 list active models',
|
|
80
|
+
' /model \u2014 switch model',
|
|
81
|
+
' /mode [m] \u2014 permission mode (plan/default/auto/yolo)',
|
|
82
|
+
' /thinking [m] \u2014 thinking mode (off/low/medium/high)',
|
|
83
|
+
' /plan \u2014 enter plan mode (read-only)',
|
|
84
|
+
'',
|
|
85
|
+
'Context & Cost:',
|
|
86
|
+
' /compact \u2014 compress conversation context',
|
|
87
|
+
' /context \u2014 show context usage & token count',
|
|
88
|
+
' /cost \u2014 show token usage & cost',
|
|
89
|
+
'',
|
|
90
|
+
'Code & Git:',
|
|
91
|
+
' /diff \u2014 show uncommitted changes',
|
|
92
|
+
' /commit \u2014 auto-generate commit message & commit',
|
|
93
|
+
' /review \u2014 AI code review of current changes',
|
|
94
|
+
' /checkpoint \u2014 create git checkpoint',
|
|
95
|
+
' /undo \u2014 undo last checkpoint',
|
|
96
|
+
' /checkpoints \u2014 list recent checkpoints',
|
|
97
|
+
' /worktree \u2014 manage git worktrees (list/create/remove/cleanup)',
|
|
98
|
+
' /git \u2014 show git context',
|
|
99
|
+
'',
|
|
100
|
+
'Project:',
|
|
101
|
+
' /init \u2014 initialize project config (SCALIX.md)',
|
|
102
|
+
' /index \u2014 scan & index project files',
|
|
103
|
+
' /memory \u2014 show project memory',
|
|
104
|
+
' /remember <n> \u2014 save a note about this project',
|
|
105
|
+
' /watch <cmd> \u2014 run command, auto-fix on failure',
|
|
106
|
+
' /create <d> \u2014 scaffold a new project',
|
|
107
|
+
' /delegate <t> \u2014 run task with sub-agent',
|
|
108
|
+
' /agents \u2014 show active agents & usage',
|
|
109
|
+
'',
|
|
110
|
+
'Tools & Config:',
|
|
111
|
+
' /copy \u2014 copy last response to clipboard',
|
|
112
|
+
' /cloud \u2014 Scalix Cloud status (/cloud tools, /cloud refresh)',
|
|
113
|
+
' /login \u2014 link your Scalix account (API key)',
|
|
114
|
+
' /status \u2014 show version, model & connection info',
|
|
115
|
+
' /update \u2014 check for and install updates',
|
|
116
|
+
' /doctor \u2014 diagnose installation',
|
|
117
|
+
' /settings \u2014 view & configure limits',
|
|
118
|
+
' /permissions \u2014 view permission rules & recent denials',
|
|
119
|
+
' /skills \u2014 list available skills',
|
|
120
|
+
' /setup \u2014 reconfigure API key, URL & models',
|
|
121
|
+
' /mcp <l> <u> \u2014 add MCP server',
|
|
122
|
+
' /plugins \u2014 show loaded plugins',
|
|
123
|
+
' /plugin \u2014 install/enable/disable/uninstall plugins',
|
|
124
|
+
' /trust \u2014 trust workspace (load project plugins/hooks/rules)',
|
|
125
|
+
' /notify \u2014 test terminal notification',
|
|
126
|
+
' /router \u2014 show model routing status',
|
|
127
|
+
' /replay \u2014 show session timeline',
|
|
128
|
+
' /hooks \u2014 show lifecycle hooks',
|
|
129
|
+
' /commands \u2014 show custom commands',
|
|
130
|
+
'',
|
|
131
|
+
'Input modes:',
|
|
132
|
+
' !<cmd> \u2014 run shell command (e.g. !ls -la)',
|
|
133
|
+
' text\\ \u2014 multiline input (end with \\ to continue)',
|
|
134
|
+
];
|
|
135
|
+
/**
|
|
136
|
+
* Pull the command tokens out of the /help text — the leading "/word" of any
|
|
137
|
+
* indented entry line. Section headers and the "Input modes" rows (!<cmd>,
|
|
138
|
+
* text\\) have no leading slash and are skipped.
|
|
139
|
+
*/
|
|
140
|
+
export function helpCommands(lines = HELP_LINES) {
|
|
141
|
+
const found = [];
|
|
142
|
+
for (const line of lines) {
|
|
143
|
+
const m = /^ {2}(\/[a-z-]+)/.exec(line);
|
|
144
|
+
if (m)
|
|
145
|
+
found.push(m[1]);
|
|
146
|
+
}
|
|
147
|
+
return found;
|
|
148
|
+
}
|
package/dist/sub-agent.js
CHANGED
|
@@ -67,6 +67,7 @@ export async function spawnSubAgent(parentConfig, prompt, options = {}) {
|
|
|
67
67
|
const subAgent = createAgent({
|
|
68
68
|
apiKey: parentConfig.apiKey,
|
|
69
69
|
baseUrl: parentConfig.baseUrl,
|
|
70
|
+
provider: parentConfig.provider,
|
|
70
71
|
model,
|
|
71
72
|
instructions: options.instructions || 'You are a focused research assistant. Be concise and factual. Respond in under 500 words.',
|
|
72
73
|
tools,
|
package/package.json
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scalix",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "AI coding agent for the terminal
|
|
3
|
+
"version": "1.5.1",
|
|
4
|
+
"description": "AI coding agent for the terminal — edit code, run commands, and build with Scalix",
|
|
5
5
|
"main": "dist/headless.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"scalix": "./bin/scalix.js"
|
|
8
8
|
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"bin",
|
|
12
|
+
"CHANGELOG.md",
|
|
13
|
+
".env.example"
|
|
14
|
+
],
|
|
9
15
|
"scripts": {
|
|
10
16
|
"start": "tsx src/cli.tsx",
|
|
11
17
|
"start:headless": "tsx src/headless.ts",
|
|
@@ -19,7 +25,11 @@
|
|
|
19
25
|
"test:e2e": "vitest run --config vitest.config.e2e.ts",
|
|
20
26
|
"check": "npm run typecheck && npm run lint && npm run test",
|
|
21
27
|
"prepublishOnly": "npm run build",
|
|
22
|
-
"release": "npm run build && node scripts/build-release.js"
|
|
28
|
+
"release": "npm run build && node scripts/build-release.js",
|
|
29
|
+
"bench": "tsx bench/src/main.ts",
|
|
30
|
+
"bench:live": "tsx bench/src/main.ts --live",
|
|
31
|
+
"typecheck:bench": "tsc --noEmit -p bench/tsconfig.json",
|
|
32
|
+
"bench:smoke-live": "tsx bench/src/smoke-live.ts"
|
|
23
33
|
},
|
|
24
34
|
"keywords": [
|
|
25
35
|
"ai",
|
package/PARITY-PLAN.md
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
# Scalix Coder — Claude Code Parity Implementation Plan
|
|
2
|
-
|
|
3
|
-
**Status:** In Progress
|
|
4
|
-
**Target:** Full feature and UX parity with Claude Code
|
|
5
|
-
**Estimated Total:** 12-15 days
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Phase 1: Security & Reliability (1-2 days) ✓ COMPLETE
|
|
10
|
-
|
|
11
|
-
- [x] **1.1 Secure credential storage** — macOS Keychain / Linux libsecret via `keychain.ts`, auto-strips key from config file
|
|
12
|
-
- [x] **1.2 Auto-retry with exponential backoff** — Already existed in agent.ts (backoffDelay + circuit breaker)
|
|
13
|
-
- [x] **1.3 Non-streaming fallback** — `forceNonStreaming` flag auto-retries with `stream: false` on stream errors
|
|
14
|
-
|
|
15
|
-
## Phase 2: Chat Experience Parity (3-4 days) ✓ COMPLETE
|
|
16
|
-
|
|
17
|
-
- [x] **2.1 Syntax highlighting in code blocks** — `cli-highlight` integration for 100+ languages + render cache (128 entries)
|
|
18
|
-
- [x] **2.2 Collapsible tool groups** — Auto-groups 3+ consecutive tool items, Ctrl+O toggles expansion
|
|
19
|
-
- [x] **2.3 Multiline input** — Alt+Enter inserts newline (terminal limitation prevents Shift+Enter)
|
|
20
|
-
- [x] **2.4 "Always Allow" in permission prompts** — [A] key auto-allows tool for session, shown in prompt UI
|
|
21
|
-
- [x] **2.5 @-mention typeahead in terminal** — `@` triggers fuzzy file search from project index, Tab/Enter selects
|
|
22
|
-
- [x] **2.6 Ctrl+R reverse history search** — Incremental reverse search with visual indicator, Enter/Esc to accept/cancel
|
|
23
|
-
- [x] **2.7 External editor support** — Ctrl+X Ctrl+E opens $EDITOR with input buffer, loads edited content back
|
|
24
|
-
- [x] **2.8 Markdown render cache** — Content-hash cache (128 entries) prevents re-rendering identical content
|
|
25
|
-
- [x] **2.9 Rate limit warning banner** — Context % in status bar when >50%, rate limit warning on 429 errors, 2-min auto-clear
|
|
26
|
-
- [x] **2.10 Image paste from clipboard** — Ctrl+V detects clipboard images (macOS pngpaste/osascript, Linux xclip), shows `[Image #N]` chips, sends to vision model
|
|
27
|
-
|
|
28
|
-
## Phase 3: Permission & Hook System (2-3 days) ✓ COMPLETE
|
|
29
|
-
|
|
30
|
-
- [x] **3.1 Scoped permissions** — `run_command(git:*)` prefix matching per tool, configurable allow/deny rules in `scopedPermissions` config
|
|
31
|
-
- [x] **3.2 Enhanced hooks — 9 events** — Added Stop, SessionEnd, Notification events (now 9 total)
|
|
32
|
-
- [x] **3.3 Prompt-type hooks** — `type: 'prompt'` hooks with `getPromptHooks()` API, separate from command hooks
|
|
33
|
-
- [x] **3.4 Structured hook I/O** — JSON stdin with event/tool/args, JSON stdout parsing, exit code 2 = block with message
|
|
34
|
-
- [x] **3.5 Matcher patterns** — Pipe-separated `run_command|edit_file`, wildcard `*`, regex `/pattern/` in hook match field
|
|
35
|
-
- [x] **3.6 Permission memory** — "Always Allow" ([A] key) persisted per session, scoped rules in config, shown in `/permissions`
|
|
36
|
-
- [x] **3.7 Recent denials view** — `/permissions` shows last 10 denied tools with timestamps and args
|
|
37
|
-
|
|
38
|
-
## Phase 4: Command & Skills System (2-3 days) ✓ COMPLETE
|
|
39
|
-
|
|
40
|
-
- [x] **4.1 Rich command frontmatter** — Parse `allowed-tools`, `model`, `argument-hint`, `disable-model-invocation` from .md commands
|
|
41
|
-
- [x] **4.2 @file references in commands** — `@path/to/file` includes file content inline in command prompt
|
|
42
|
-
- [x] **4.3 Inline bash execution** — `` !`command` `` syntax executes shell and injects stdout into command prompt
|
|
43
|
-
- [x] **4.4 Positional arguments** — `$1`, `$2`, etc. in addition to existing `$ARGS`
|
|
44
|
-
- [x] **4.5 Skills framework** — `SKILL.md` with frontmatter (name, description, version, paths), progressive 3-level disclosure
|
|
45
|
-
- [x] **4.6 Skill discovery** — `/skills` command lists available skills with descriptions
|
|
46
|
-
- [x] **4.7 Path-triggered skills** — `paths:` frontmatter auto-loads skill when working in matching directories
|
|
47
|
-
- [x] **4.8 Skill resources** — `scripts/`, `references/`, `examples/`, `assets/` directories per skill
|
|
48
|
-
- [x] **4.9 Built-in skills** — feature-dev (7-phase workflow), code-review, commit-push-pr
|
|
49
|
-
|
|
50
|
-
## Phase 5: Session & Conversation (1-2 days) ✓ COMPLETE
|
|
51
|
-
|
|
52
|
-
- [x] **5.1 Auto-save sessions** — Auto-saves crash state after each assistant turn via `saveCrashState()`
|
|
53
|
-
- [x] **5.2 Session resume picker** — `/resume` tries crash recovery first, falls back to interactive session picker
|
|
54
|
-
- [x] **5.3 Session forking** — `/fork [N]` branches conversation from message N in history
|
|
55
|
-
- [x] **5.4 Session diff** — `getSessionDiff()` tracks file modifications (edit_file/write_file) per session
|
|
56
|
-
- [x] **5.5 Crash recovery** — `.crash-recovery.json` auto-saved, detected on startup, resumable via `/resume`
|
|
57
|
-
|
|
58
|
-
## Phase 6: Configuration & Settings (1 day) ✓ COMPLETE
|
|
59
|
-
|
|
60
|
-
- [x] **6.1 Local settings overrides** — `.scalix/settings.local.json` (gitignored) for per-project model/permission/limits overrides
|
|
61
|
-
- [x] **6.2 Managed/organization settings** — `managed-settings.json` for enterprise policy enforcement (permission mode, security, scoped permissions)
|
|
62
|
-
- [x] **6.3 Keybinding customization** — Covered by existing keyboard shortcuts system + Ctrl+X Ctrl+E editor support
|
|
63
|
-
- [x] **6.4 Theme support** — Covered by existing marked-terminal + cli-highlight integration (auto-adapts to terminal colors)
|
|
64
|
-
- [x] **6.5 .scalixignore file** — `.scalixignore` and `.scalix/.ignore` files for excluding paths from project indexing
|
|
65
|
-
|
|
66
|
-
## Phase 7: Advanced Features (1-2 days) ✓ COMPLETE
|
|
67
|
-
|
|
68
|
-
- [x] **7.1 Worktree support** — `--worktree` CLI flag + `/worktree` command (list/create/remove/cleanup), backed by existing `worktree.ts`
|
|
69
|
-
- [x] **7.2 CJK/RTL text support** — `text-utils.ts` with CJK/RTL detection, double-width char handling, `wrapText()`, `applyRTLMarks()`
|
|
70
|
-
- [x] **7.3 IME composition support** — `stringWidth()` for accurate cursor positioning with CJK chars, combining mark handling
|
|
71
|
-
- [x] **7.4 Idle session nudge** — 75-minute idle timer suggests `/clear` or `/compact` when conversation has 10+ messages
|
|
72
|
-
- [x] **7.5 Terminal notification passthrough** — `terminal-notify.ts` with iTerm2/Kitty/Ghostty/tmux OSC support, auto-notify on task completion
|
|
73
|
-
- [x] **7.6 Plugin management commands** — `/plugin install/uninstall/enable/disable/list` with git clone + local symlink support
|
|
74
|
-
- [x] **7.7 Installation channels** — Homebrew formula, curl install script, PowerShell installer (all in `scripts/`)
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Summary
|
|
79
|
-
|
|
80
|
-
| Phase | Items | Est. Days | Priority |
|
|
81
|
-
|-------|-------|-----------|----------|
|
|
82
|
-
| 1. Security & Reliability | 3 | 1-2 | Critical |
|
|
83
|
-
| 2. Chat Experience | 10 | 3-4 | Critical |
|
|
84
|
-
| 3. Permission & Hooks | 7 | 2-3 | Critical |
|
|
85
|
-
| 4. Command & Skills | 9 | 2-3 | Important |
|
|
86
|
-
| 5. Session & Conversation | 5 | 1-2 | Important |
|
|
87
|
-
| 6. Configuration | 5 | 1 | Important |
|
|
88
|
-
| 7. Advanced Features | 7 | 1-2 | Nice to have |
|
|
89
|
-
| **Total** | **46** | **12-15** | |
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Already Ahead (Preserve These Advantages)
|
|
94
|
-
|
|
95
|
-
These features already exceed Claude Code — protect them during implementation:
|
|
96
|
-
|
|
97
|
-
- 40+ built-in tools (browser automation, multi-provider search, vision, voice)
|
|
98
|
-
- Model-agnostic with multi-model complexity routing
|
|
99
|
-
- Dynamic model discovery from API
|
|
100
|
-
- Auto-convention detection and project memory
|
|
101
|
-
- Injection detection with configurable sensitivity
|
|
102
|
-
- Checkpoint/undo system (`/checkpoint`, `/undo`)
|
|
103
|
-
- VS Code: inline chat, tab completion, context menu, 6 @-mention types
|
|
104
|
-
- Session replay (`/replay`)
|
|
105
|
-
- Message queueing during processing
|
|
106
|
-
- Shell escape (`!cmd`) prefix
|
|
107
|
-
- Input stashing (Ctrl+S)
|
|
108
|
-
- Auto-verification after file edits (build/lint check)
|
|
109
|
-
- Multiple output formats (text, json, json-schema, patch, markdown)
|
|
110
|
-
- Gradient banner with ink-big-text
|
|
111
|
-
- Informative status bar (model + tokens + tools + mode + elapsed time + version)
|
|
112
|
-
- Box-drawn diff frames with addition/deletion summary
|
|
113
|
-
- Smart error hints (pattern-matched suggestions)
|
|
114
|
-
- Scroll indicators (↑ more above / ↓ more below)
|
|
115
|
-
- Distinctive ❯ prompt with spinner animation
|
|
116
|
-
- Dynamic placeholder text
|
package/docs/DISTRIBUTION.md
DELETED
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
# Scalix Coder — Distribution Guide
|
|
2
|
-
|
|
3
|
-
This document covers how to build, distribute, and install Scalix Coder for end users **without exposing source code**.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Table of Contents
|
|
8
|
-
|
|
9
|
-
1. [Overview](#overview)
|
|
10
|
-
2. [Building a Release](#building-a-release)
|
|
11
|
-
3. [What's in the Release](#whats-in-the-release)
|
|
12
|
-
4. [Hosting the Release](#hosting-the-release)
|
|
13
|
-
5. [One-Line Installer Setup](#one-line-installer-setup)
|
|
14
|
-
6. [Manual Installation](#manual-installation)
|
|
15
|
-
7. [VS Code Extension](#vs-code-extension)
|
|
16
|
-
8. [Updating Users](#updating-users)
|
|
17
|
-
9. [Troubleshooting](#troubleshooting)
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Overview
|
|
22
|
-
|
|
23
|
-
Scalix Coder is distributed as **compiled JavaScript** — no TypeScript source code is included. Users receive:
|
|
24
|
-
|
|
25
|
-
- Pre-compiled `.js` files (from `dist/`)
|
|
26
|
-
- A CLI entry point (`bin/scalix.js`)
|
|
27
|
-
- One-click install scripts for Windows and Mac/Linux
|
|
28
|
-
- The VS Code extension (`.vsix` file)
|
|
29
|
-
|
|
30
|
-
**What's included:**
|
|
31
|
-
- 31 built-in tools (shell, file, git, web, browser, vision, voice, and more)
|
|
32
|
-
- Security sandbox with path restriction, command blocklist, and injection detection
|
|
33
|
-
- IPC server mode for VS Code extension integration
|
|
34
|
-
|
|
35
|
-
**Requirements for end users:**
|
|
36
|
-
- Node.js 18 or higher
|
|
37
|
-
- npm (comes with Node.js)
|
|
38
|
-
- Windows 10+, macOS 12+, or Linux
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Building a Release
|
|
43
|
-
|
|
44
|
-
From the project root, run:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npm run release
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
This will:
|
|
51
|
-
1. Compile TypeScript to JavaScript (`tsc`)
|
|
52
|
-
2. Package everything into `release/` directory
|
|
53
|
-
3. Create both `.tar.gz` (Mac/Linux) and `.zip` (Windows) archives
|
|
54
|
-
4. Include the VS Code extension `.vsix` if available
|
|
55
|
-
5. Strip `devDependencies` and dev scripts from `package.json`
|
|
56
|
-
|
|
57
|
-
**Output:**
|
|
58
|
-
```
|
|
59
|
-
release/
|
|
60
|
-
├── scalix-coder-v3.0.0/ # Extracted release folder
|
|
61
|
-
│ ├── dist/ # Compiled JavaScript (NO source code)
|
|
62
|
-
│ ├── bin/scalix.js # CLI entry point
|
|
63
|
-
│ ├── package.json # Dependencies only
|
|
64
|
-
│ ├── package-lock.json # Lockfile
|
|
65
|
-
│ ├── install.bat # Windows installer
|
|
66
|
-
│ ├── install.sh # Mac/Linux installer
|
|
67
|
-
│ ├── scalix-coder-0.2.0.vsix # VS Code extension
|
|
68
|
-
│ ├── README.md
|
|
69
|
-
│ ├── LICENSE
|
|
70
|
-
│ └── CHANGELOG.md
|
|
71
|
-
├── scalix-coder-v3.0.0.tar.gz # Mac/Linux archive
|
|
72
|
-
└── scalix-coder-v3.0.0.zip # Windows archive
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## What's in the Release
|
|
78
|
-
|
|
79
|
-
### Included
|
|
80
|
-
| Item | Description |
|
|
81
|
-
|---|---|
|
|
82
|
-
| `dist/*.js` | Compiled JavaScript (agent, tools, CLI, etc.) |
|
|
83
|
-
| `bin/scalix.js` | CLI entry point — runs `dist/cli.js` |
|
|
84
|
-
| `package.json` | Production dependencies only |
|
|
85
|
-
| `install.bat` | One-click Windows installer |
|
|
86
|
-
| `install.sh` | One-click Mac/Linux installer |
|
|
87
|
-
| `*.vsix` | VS Code extension package |
|
|
88
|
-
| `README.md` | User documentation |
|
|
89
|
-
| `LICENSE` | License file |
|
|
90
|
-
|
|
91
|
-
### NOT Included (Protected)
|
|
92
|
-
| Item | Why excluded |
|
|
93
|
-
|---|---|
|
|
94
|
-
| `src/*.ts` / `src/*.tsx` | Source code — proprietary |
|
|
95
|
-
| `tests/` | Internal test suite |
|
|
96
|
-
| `tsconfig.json` | Build configuration |
|
|
97
|
-
| `eslint.config.js` | Lint configuration |
|
|
98
|
-
| `vitest.config.ts` | Test configuration |
|
|
99
|
-
| `scripts/` | Build scripts |
|
|
100
|
-
| `.claude/` | Claude Code settings |
|
|
101
|
-
| `.scalix/` | Project memory |
|
|
102
|
-
| `devDependencies` | Development tools |
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## Hosting the Release
|
|
107
|
-
|
|
108
|
-
Upload the release archives to any file hosting. Options:
|
|
109
|
-
|
|
110
|
-
### Option A: Your Own Website / Server
|
|
111
|
-
```
|
|
112
|
-
https://scalix.world/releases/scalix-coder-v3.0.0.tar.gz
|
|
113
|
-
https://scalix.world/releases/scalix-coder-v3.0.0.zip
|
|
114
|
-
https://scalix.world/install.sh
|
|
115
|
-
https://scalix.world/install.ps1
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Option B: AWS S3 / Google Cloud Storage
|
|
119
|
-
```bash
|
|
120
|
-
# Upload to S3
|
|
121
|
-
aws s3 cp release/scalix-coder-v3.0.0.tar.gz s3://your-bucket/releases/
|
|
122
|
-
aws s3 cp release/scalix-coder-v3.0.0.zip s3://your-bucket/releases/
|
|
123
|
-
aws s3 cp scripts/install-remote.sh s3://your-bucket/install.sh
|
|
124
|
-
aws s3 cp scripts/install-remote.ps1 s3://your-bucket/install.ps1
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Option C: GitHub Releases (on a separate public repo)
|
|
128
|
-
Create a public repo (e.g., `scalix-coder-releases`) and upload the archives as release assets.
|
|
129
|
-
|
|
130
|
-
**After uploading, update the URLs in:**
|
|
131
|
-
- `scripts/install-remote.sh` — change `your-domain.com` to your actual URL
|
|
132
|
-
- `scripts/install-remote.ps1` — change `your-domain.com` to your actual URL
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## One-Line Installer Setup
|
|
137
|
-
|
|
138
|
-
Once files are hosted, users install with a single command:
|
|
139
|
-
|
|
140
|
-
### Mac / Linux
|
|
141
|
-
```bash
|
|
142
|
-
curl -fsSL https://scalix.world/install.sh | bash
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Windows (PowerShell)
|
|
146
|
-
```powershell
|
|
147
|
-
irm https://scalix.world/install.ps1 | iex
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### What the installer does:
|
|
151
|
-
1. Checks Node.js 18+ is installed
|
|
152
|
-
2. Downloads the release archive
|
|
153
|
-
3. Extracts to `~/.scalix-coder/`
|
|
154
|
-
4. Runs `npm install --omit=dev`
|
|
155
|
-
5. Runs `npm link` to register the `scalix` command globally
|
|
156
|
-
6. Done — user types `scalix` in any terminal
|
|
157
|
-
|
|
158
|
-
### Custom Download URL
|
|
159
|
-
Users can override the download URL:
|
|
160
|
-
```bash
|
|
161
|
-
SCALIX_DOWNLOAD_URL=https://internal.company.com/scalix.tar.gz curl -fsSL https://scalix.world/install.sh | bash
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
## Manual Installation
|
|
167
|
-
|
|
168
|
-
If users prefer manual installation:
|
|
169
|
-
|
|
170
|
-
### Windows
|
|
171
|
-
1. Download `scalix-coder-v3.0.0.zip`
|
|
172
|
-
2. Extract the zip file
|
|
173
|
-
3. Open the extracted folder
|
|
174
|
-
4. Double-click `install.bat`
|
|
175
|
-
5. Open any terminal and type `scalix`
|
|
176
|
-
|
|
177
|
-
### Mac / Linux
|
|
178
|
-
```bash
|
|
179
|
-
tar -xzf scalix-coder-v3.0.0.tar.gz
|
|
180
|
-
cd scalix-coder-v3.0.0
|
|
181
|
-
./install.sh
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Manual (No Installer Script)
|
|
185
|
-
```bash
|
|
186
|
-
tar -xzf scalix-coder-v3.0.0.tar.gz
|
|
187
|
-
cd scalix-coder-v3.0.0
|
|
188
|
-
npm install --omit=dev --legacy-peer-deps
|
|
189
|
-
sudo npm link # or without sudo on Windows
|
|
190
|
-
scalix
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
---
|
|
194
|
-
|
|
195
|
-
## VS Code Extension
|
|
196
|
-
|
|
197
|
-
The VS Code extension (`.vsix` file) is bundled in the release.
|
|
198
|
-
|
|
199
|
-
### Install
|
|
200
|
-
1. Open VS Code
|
|
201
|
-
2. Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac)
|
|
202
|
-
3. Type **"Extensions: Install from VSIX"**
|
|
203
|
-
4. Select `scalix-coder-0.2.0.vsix` from the extracted folder
|
|
204
|
-
5. Reload VS Code
|
|
205
|
-
|
|
206
|
-
### Features
|
|
207
|
-
- Sidebar chat panel with AI assistant
|
|
208
|
-
- Right-click: Explain / Fix / Refactor code selection
|
|
209
|
-
- Model picker and mode selector via slash commands
|
|
210
|
-
- Integrated terminal (`Ctrl+Shift+T`)
|
|
211
|
-
- Open chat in editor area (`Ctrl+Shift+K`)
|
|
212
|
-
|
|
213
|
-
### Configure
|
|
214
|
-
1. Press `Ctrl+,` to open Settings
|
|
215
|
-
2. Search for "Scalix"
|
|
216
|
-
3. Enter your API key
|
|
217
|
-
4. Or type `/setup` in the chat
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
## Updating Users
|
|
222
|
-
|
|
223
|
-
When releasing a new version:
|
|
224
|
-
|
|
225
|
-
1. Update `version` in `package.json`
|
|
226
|
-
2. Run `npm run release`
|
|
227
|
-
3. Upload new archives to your hosting (overwrite or add new version)
|
|
228
|
-
4. Update version number in `scripts/install-remote.sh` and `scripts/install-remote.ps1`
|
|
229
|
-
5. Users re-run the one-liner to update:
|
|
230
|
-
```bash
|
|
231
|
-
curl -fsSL https://scalix.world/install.sh | bash
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### Versioning
|
|
235
|
-
- CLI version: `package.json` → `version` (currently `3.1.0`)
|
|
236
|
-
- Extension version: `vscode-extension/package.json` → `version` (currently `0.2.0`)
|
|
237
|
-
- Both versions should be bumped together for coordinated releases
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
## Troubleshooting
|
|
242
|
-
|
|
243
|
-
### "scalix" command not found after install
|
|
244
|
-
```bash
|
|
245
|
-
# Check if npm global bin is in PATH
|
|
246
|
-
npm bin -g
|
|
247
|
-
|
|
248
|
-
# On Mac/Linux, add to ~/.bashrc or ~/.zshrc:
|
|
249
|
-
export PATH="$(npm bin -g):$PATH"
|
|
250
|
-
|
|
251
|
-
# On Windows, npm global bin is usually already in PATH.
|
|
252
|
-
# If not, run install.bat as Administrator.
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
### Permission denied on Mac/Linux
|
|
256
|
-
```bash
|
|
257
|
-
sudo npm link
|
|
258
|
-
# or
|
|
259
|
-
sudo ./install.sh
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
### Node.js version too old
|
|
263
|
-
```bash
|
|
264
|
-
node -v # Must be v18+
|
|
265
|
-
```
|
|
266
|
-
Download latest from https://nodejs.org/
|
|
267
|
-
|
|
268
|
-
### API key not working
|
|
269
|
-
- Run `/setup` in the chat to re-enter your key
|
|
270
|
-
- Or set the environment variable: `export SCALIX_API_KEY=sk-...`
|
|
271
|
-
- Check Settings in VS Code: `Ctrl+,` → search "Scalix"
|
|
272
|
-
|
|
273
|
-
### Rate limited
|
|
274
|
-
The agent retries automatically up to 5 times with backoff. If you still see rate limit errors, wait 60 seconds and try again.
|
|
275
|
-
|
|
276
|
-
---
|
|
277
|
-
|
|
278
|
-
## Security Notes
|
|
279
|
-
|
|
280
|
-
- **No source code** is distributed — only compiled JavaScript
|
|
281
|
-
- API keys are stored locally at `~/.scalix-coder/config.json` (file permissions: 600)
|
|
282
|
-
- Shell commands have a blocklist for destructive patterns
|
|
283
|
-
- Path traversal is blocked — tools cannot access files outside the workspace
|
|
284
|
-
- All buffers and collections are bounded to prevent memory exhaustion
|
|
285
|
-
- Background processes auto-cleanup after 5 minutes
|
|
286
|
-
- The VS Code extension uses VS Code's Content Security Policy for the webview
|
|
287
|
-
- All webview user content is HTML-escaped before rendering
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
## Quick Reference
|
|
292
|
-
|
|
293
|
-
| Task | Command |
|
|
294
|
-
|---|---|
|
|
295
|
-
| Build release | `npm run release` |
|
|
296
|
-
| Build TypeScript | `npm run build` |
|
|
297
|
-
| Run tests | `npm run test` |
|
|
298
|
-
| Type-check | `npm run typecheck` |
|
|
299
|
-
| Lint | `npm run lint` |
|
|
300
|
-
| All checks | `npm run check` |
|
|
301
|
-
| Build VS Code ext | `cd vscode-extension && npm run build && npm run package` |
|