@taf0711/splice 0.1.1 → 0.1.3
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 +159 -397
- package/bin/splice.js +2 -2
- package/package.json +1 -1
- package/scripts/postinstall.mjs +7 -7
package/README.md
CHANGED
|
@@ -1,156 +1,146 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/splice-logo-inverted.svg">
|
|
4
|
+
<img src="docs/assets/splice-logo.svg" alt="splice" width="560">
|
|
5
|
+
</picture>
|
|
3
6
|
</p>
|
|
4
7
|
|
|
5
|
-
<p align="center"><strong>
|
|
8
|
+
<p align="center"><strong>The agent that turns a prompt into a checked change.</strong></p>
|
|
6
9
|
|
|
7
10
|
<p align="center">
|
|
8
11
|
<a href="https://github.com/Taf0711/splice/actions/workflows/ci.yml?branch=main"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/Taf0711/splice/ci.yml?branch=main"></a>
|
|
9
12
|
<a href="https://www.npmjs.com/package/@taf0711/splice"><img alt="npm version" src="https://img.shields.io/npm/v/@taf0711/splice"></a>
|
|
10
13
|
<a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-blue"></a>
|
|
11
14
|
<img alt="Go 1.25+" src="https://img.shields.io/badge/Go-1.25+-00ADD8?logo=go&logoColor=white">
|
|
12
|
-
<img alt="25+ providers" src="https://img.shields.io/badge/providers-25+-34E2EA">
|
|
13
|
-
<br>
|
|
14
|
-
<strong>English</strong> | <a href="README_ZH.md">中文</a>
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
|
-
Splice is
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
through specialized stages (code writer, static analyzer, test generator,
|
|
23
|
-
security auditor, test runner) with a deterministic trajectory monitor that
|
|
24
|
-
catches death spirals before they waste tokens.
|
|
17
|
+
Splice is a local-first coding agent for people who want more than a model in a
|
|
18
|
+
shell loop. It can inspect a repository, edit files, run checks, and use the
|
|
19
|
+
model and provider you choose. For substantial work, it classifies the request,
|
|
20
|
+
assembles only the context a stage needs, and routes the change through a
|
|
21
|
+
specialized execution plan.
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
splice
|
|
28
|
-
splice exec "fix the failing test in ./pkg"
|
|
29
|
-
splice exec --output-format stream-json < turns.jsonl
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Why Splice
|
|
33
|
-
|
|
34
|
-
- **Use the model you want.** Bring OpenAI, Anthropic, Gemini, Groq, OpenRouter,
|
|
35
|
-
DeepSeek, Mistral, xAI, Qwen, Kimi, GitHub Models, Ollama, LM Studio, or any
|
|
36
|
-
OpenAI- or Anthropic-compatible endpoint.
|
|
37
|
-
- **A pipeline, not just a chat.** A request is classified into a tier, turned
|
|
38
|
-
into a typed execution plan, and run through specialized stages whose inputs
|
|
39
|
-
and outputs are Go structs with `Validate()` methods. The orchestrator is the
|
|
40
|
-
foreman: agents never pass data to each other directly, and summaries flow
|
|
41
|
-
forward, not raw outputs.
|
|
42
|
-
- **Deterministic-first.** Anything answerable with code (ripgrep, AST, Bandit,
|
|
43
|
-
pytest, git diff) is answered with code. The LLM is the last resort. The
|
|
44
|
-
context builder pulls real file, directory, and grep results from Zero's tool
|
|
45
|
-
registry so a stage prompt sees the workspace, not a guess.
|
|
46
|
-
- **Trajectory-aware.** A deterministic scorer watches every iteration. Hard
|
|
47
|
-
limit, budget exhaustion, state-hash cycles, oscillation, regression, and
|
|
48
|
-
confidence collapse each escalate explicitly instead of looping silently.
|
|
49
|
-
- **Stay in control.** File writes, shell commands, network access, and
|
|
50
|
-
out-of-workspace writes go through Splice's permission and sandbox policy.
|
|
51
|
-
- **Works in the terminal.** The TUI has model and provider pickers, image
|
|
52
|
-
input, slash commands, live plan and tool rendering, scrollback, themes, and
|
|
53
|
-
resume and fork support.
|
|
54
|
-
- **Works without the TUI.** `splice exec` is scriptable, supports text, JSON,
|
|
55
|
-
and stream-JSON I/O, isolated worktrees, spec-first runs, and meaningful exit
|
|
56
|
-
codes for CI.
|
|
57
|
-
- **Keeps context local.** Sessions are stored on disk, searchable, resumable,
|
|
58
|
-
and never uploaded as telemetry by Splice.
|
|
59
|
-
- **Extensible when you need it.** Use MCP servers, skills, plugins, hooks, and
|
|
60
|
-
specialist subagents from the same CLI.
|
|
61
|
-
|
|
62
|
-
## Install
|
|
63
|
-
|
|
64
|
-
Install via `npm install -g @taf0711/splice` (downloads the matching GitHub Release binary) or download archives directly from [GitHub Releases](https://github.com/Taf0711/splice/releases).
|
|
23
|
+
## Start in three commands
|
|
65
24
|
|
|
66
25
|
```bash
|
|
67
26
|
npm install -g @taf0711/splice
|
|
68
27
|
splice
|
|
69
28
|
```
|
|
70
29
|
|
|
71
|
-
|
|
72
|
-
your platform from GitHub Releases. It will support Linux, macOS, and Windows
|
|
73
|
-
on x64 and arm64.
|
|
74
|
-
|
|
75
|
-
### Bun (planned)
|
|
76
|
-
|
|
77
|
-
Bun does not run dependency lifecycle scripts by default, so the `postinstall`
|
|
78
|
-
that fetches the Splice binary is skipped and the first run fails with
|
|
79
|
-
`No native binary found next to the npm wrapper`.
|
|
80
|
-
|
|
81
|
-
The simplest fix is to trust the package after installing, which runs the
|
|
82
|
-
blocked postinstall. This works for project and global installs:
|
|
30
|
+
Then describe the change. For a direct, scriptable run:
|
|
83
31
|
|
|
84
32
|
```bash
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
bun pm trust @taf0711/splice
|
|
33
|
+
splice exec "fix the failing test in ./pkg"
|
|
34
|
+
```
|
|
88
35
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
36
|
+
The first launch opens setup for a provider and model. See
|
|
37
|
+
[Install](docs/INSTALL.md) for source builds, platform notes, and the optional
|
|
38
|
+
memory sidecar.
|
|
39
|
+
|
|
40
|
+
## Why Splice exists
|
|
41
|
+
|
|
42
|
+
Most coding agents have one long conversation responsible for understanding,
|
|
43
|
+
editing, testing, and deciding whether to continue. Splice separates those
|
|
44
|
+
jobs without turning them into a noisy agent swarm.
|
|
45
|
+
|
|
46
|
+
- **A typed pipeline.** Stages exchange validated Go structures, not loose chat
|
|
47
|
+
transcripts. The orchestrator decides what each stage receives and what runs
|
|
48
|
+
next.
|
|
49
|
+
- **Deterministic first.** Repository reads, search, AST checks, static analysis,
|
|
50
|
+
tests, diffs, and exit codes come from local tools. The model is used where
|
|
51
|
+
judgment is needed, not where a command is more reliable.
|
|
52
|
+
- **Trajectory awareness.** The run monitor detects hard limits, repeated state,
|
|
53
|
+
oscillation, regression, and collapsing confidence. A stuck run surfaces the
|
|
54
|
+
problem instead of spending tokens forever.
|
|
55
|
+
- **Least context by default.** The original request is distilled before it
|
|
56
|
+
reaches later stages. Each stage receives a small summary and the evidence it
|
|
57
|
+
actually needs.
|
|
58
|
+
- **Zero's safety substrate.** File writes, shell commands, network access, and
|
|
59
|
+
additional write roots still pass through Zero's permissions, sandbox, hooks,
|
|
60
|
+
and tool registry.
|
|
61
|
+
- **Local by default.** Sessions and optional memory stay on disk. Splice does
|
|
62
|
+
not add telemetry or require a hosted coordinator.
|
|
63
|
+
|
|
64
|
+
## The Splice loop
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
request
|
|
68
|
+
│
|
|
69
|
+
▼
|
|
70
|
+
classify ──► typed execution plan ──► focused context
|
|
71
|
+
│
|
|
72
|
+
▼
|
|
73
|
+
write ──► analyze ──► test ──► audit
|
|
74
|
+
│
|
|
75
|
+
▼
|
|
76
|
+
trajectory decision
|
|
77
|
+
continue, escalate, or stop
|
|
92
78
|
```
|
|
93
79
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
80
|
+
The pipeline has five request tiers, from trivial to architectural. A normal
|
|
81
|
+
run may use a model-backed code writer and test generator, while static
|
|
82
|
+
analysis, security checks, and test execution stay deterministic and local.
|
|
83
|
+
Every stage has a contract and validation. Malformed output is an error with
|
|
84
|
+
its offending field, not an empty fallback.
|
|
99
85
|
|
|
100
|
-
|
|
86
|
+
## Choose your mode
|
|
101
87
|
|
|
102
|
-
|
|
88
|
+
### Interactive
|
|
103
89
|
|
|
104
90
|
```bash
|
|
105
|
-
|
|
91
|
+
splice
|
|
106
92
|
```
|
|
107
93
|
|
|
108
|
-
|
|
94
|
+
Use the TUI when you want a live conversation, provider and model pickers,
|
|
95
|
+
permission prompts, plan review, themes, image input, session resume, or forked
|
|
96
|
+
exploration.
|
|
109
97
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
98
|
+
A new session starts in design mode. Describe the work, use `/crystallize` to
|
|
99
|
+
turn the conversation into a typed plan, then `/approve` to execute it. If the
|
|
100
|
+
plan is already in your head, use `/exec <prompt>` and go straight to the
|
|
101
|
+
pipeline.
|
|
113
102
|
|
|
114
|
-
|
|
103
|
+
These controls set the appearance:
|
|
115
104
|
|
|
116
|
-
|
|
105
|
+
| Control | Effect |
|
|
106
|
+
|---|---|
|
|
107
|
+
| `NO_COLOR=<anything>` | disables color output |
|
|
108
|
+
| `SPLICE_THEME=<name>` | selects the startup theme (`auto`, `dark`, `light`, or a color theme like `dracula`, `nord`, `gruvbox`, `tokyo-night`, `catppuccin`, `one-dark`, `solarized-dark`, `rose-pine`, `everforest`, `solarized-light`) |
|
|
109
|
+
| `--theme <name>` | selects the TUI theme from the CLI (same names) |
|
|
110
|
+
| `/theme` | opens the theme picker inside the TUI (live preview; `/theme <name>` switches directly) |
|
|
111
|
+
| `SPLICE_NO_FADE=1` | disables streaming fade animation |
|
|
117
112
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
cd splice
|
|
121
|
-
go run ./cmd/splice
|
|
122
|
-
```
|
|
113
|
+
Meaning does not rely on color alone. Diffs, permissions, and statuses also use
|
|
114
|
+
text or glyph markers.
|
|
123
115
|
|
|
124
|
-
|
|
116
|
+
### Headless
|
|
125
117
|
|
|
126
118
|
```bash
|
|
127
|
-
|
|
119
|
+
splice exec "explain internal/agent/loop.go"
|
|
120
|
+
splice exec --use-spec "add rate limiting to the API client"
|
|
121
|
+
splice exec --worktree "try the migration in isolation"
|
|
122
|
+
splice exec --worktree --merge-back "run isolated, then merge the result back"
|
|
123
|
+
splice exec --plan design-plan.json
|
|
128
124
|
```
|
|
129
125
|
|
|
130
|
-
|
|
126
|
+
`splice exec` supports text, JSON, and stream-JSON input and output, isolated
|
|
127
|
+
git worktrees, resumable sessions, and meaningful exit codes for automation.
|
|
128
|
+
For a streaming client:
|
|
131
129
|
|
|
132
130
|
```bash
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
splice exec \
|
|
132
|
+
--input-format stream-json \
|
|
133
|
+
--output-format stream-json < turns.jsonl
|
|
135
134
|
```
|
|
136
135
|
|
|
137
|
-
|
|
138
|
-
(
|
|
139
|
-
Windows source builds can use the main `splice.exe` as their sandbox helper;
|
|
140
|
-
release archives will still ship standalone Windows helper executables.
|
|
141
|
-
|
|
142
|
-
More install details: [docs/INSTALL.md](docs/INSTALL.md).
|
|
136
|
+
The event contract lives in
|
|
137
|
+
[docs/STREAM_JSON_PROTOCOL.md](docs/STREAM_JSON_PROTOCOL.md).
|
|
143
138
|
|
|
144
|
-
##
|
|
139
|
+
## Providers and local models
|
|
145
140
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
splice
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
The setup wizard helps you pick a provider and model. You can also configure
|
|
153
|
-
providers from the command line:
|
|
141
|
+
Bring the provider that fits the job. Splice supports OpenAI, Anthropic,
|
|
142
|
+
Gemini, Groq, OpenRouter, DeepSeek, Mistral, xAI, Qwen, Kimi, GitHub Models,
|
|
143
|
+
Ollama, LM Studio, and OpenAI- or Anthropic-compatible endpoints.
|
|
154
144
|
|
|
155
145
|
```bash
|
|
156
146
|
splice setup
|
|
@@ -159,326 +149,98 @@ splice models list
|
|
|
159
149
|
splice doctor
|
|
160
150
|
```
|
|
161
151
|
|
|
162
|
-
|
|
163
|
-
the key in the wizard:
|
|
152
|
+
Set a provider key before setup or enter it in the wizard:
|
|
164
153
|
|
|
165
154
|
```bash
|
|
166
155
|
export OPENAI_API_KEY=sk-...
|
|
167
156
|
export ANTHROPIC_API_KEY=...
|
|
168
157
|
export GEMINI_API_KEY=...
|
|
169
|
-
export LONGCAT_API_KEY=...
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
To configure Meituan LongCat (LongCat-2.0) directly, run:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
splice providers setup longcat --set-active
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
For local models, run Ollama or LM Studio and then use `splice setup` or
|
|
179
|
-
`splice providers detect`. Model-backed pipeline stages require tool-calling
|
|
180
|
-
support. If a model omits the required typed tool call or returns invalid JSON,
|
|
181
|
-
Splice gives it up to two corrective retries and then reports an actionable
|
|
182
|
-
error. Splice never falls back from a local model to a cloud provider.
|
|
183
|
-
|
|
184
|
-
## Daily Use
|
|
185
|
-
|
|
186
|
-
### Interactive TUI
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
splice
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
Useful controls:
|
|
193
|
-
|
|
194
|
-
| Control | Action |
|
|
195
|
-
|---|---|
|
|
196
|
-
| `Enter` | send the prompt |
|
|
197
|
-
| `/` | open slash-command suggestions |
|
|
198
|
-
| `Shift+Tab` | cycle permission mode |
|
|
199
|
-
| `Ctrl+B` | show/hide the sidebar |
|
|
200
|
-
| `Ctrl+C` | cancel or exit |
|
|
201
|
-
|
|
202
|
-
Common slash commands:
|
|
203
|
-
|
|
204
|
-
| Command | Purpose |
|
|
205
|
-
|---|---|
|
|
206
|
-
| `/model`, `/provider` | switch the active model/provider |
|
|
207
|
-
| `/stages` | route the model-backed code writer and test generator, plus defaults and escalation |
|
|
208
|
-
| `/spec`, `/plan` | draft and review a plan before building |
|
|
209
|
-
| `/image` | attach an image for vision-capable models |
|
|
210
|
-
| `/resume`, `/rewind` | continue or roll back local sessions |
|
|
211
|
-
| `/loop` | repeat a prompt or custom `/command` on an interval (`/loop 5m /babysit-prs`) or self-paced |
|
|
212
|
-
| `/compact`, `/context` | manage context usage |
|
|
213
|
-
| `/permissions`, `/tools` | inspect available tools and policy |
|
|
214
|
-
| `/add-dir` | allow an extra write directory for this session |
|
|
215
|
-
| `/theme`, `/doctor`, `/config` | adjust appearance and inspect setup |
|
|
216
|
-
|
|
217
|
-
### Headless `exec`
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
splice exec "explain internal/agent/loop.go"
|
|
221
|
-
splice exec --model claude-sonnet-4.5 "refactor the config loader"
|
|
222
|
-
splice exec --use-spec "add rate limiting to the API client"
|
|
223
|
-
splice exec --worktree "try the migration in an isolated worktree"
|
|
224
|
-
splice exec --worktree --merge-back "run it isolated, then merge the result back"
|
|
225
|
-
splice exec --plan design-plan.json
|
|
226
|
-
splice exec --resume
|
|
227
|
-
splice exec --fork <session-id> "try the other approach"
|
|
228
158
|
```
|
|
229
159
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
into the source repo with `--no-ff`; a dirty source tree or a merge conflict
|
|
235
|
-
never forces anything, and the recovery branch survives every non-merged case.
|
|
160
|
+
Local models work through Ollama or LM Studio. Model-backed stages require tool
|
|
161
|
+
calling. If a provider returns an invalid typed payload, Splice retries the
|
|
162
|
+
correction and then reports an actionable error. It does not silently switch a
|
|
163
|
+
local run to a cloud provider.
|
|
236
164
|
|
|
237
|
-
|
|
165
|
+
## Safety is part of the workflow
|
|
238
166
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
The stream-JSON contract is documented in
|
|
244
|
-
[docs/STREAM_JSON_PROTOCOL.md](docs/STREAM_JSON_PROTOCOL.md).
|
|
167
|
+
Splice makes side effects visible instead of hiding them behind an autonomous
|
|
168
|
+
mode:
|
|
245
169
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
The flow:
|
|
254
|
-
|
|
255
|
-
1. **Classify.** `ClassifyRequest` inspects the request and assigns one of five
|
|
256
|
-
tiers (trivial, light, standard, substantial, architectural) using
|
|
257
|
-
keyword and risk-domain detection with rune-count thresholds that match the
|
|
258
|
-
Python source.
|
|
259
|
-
2. **Plan.** `BuildExecutionPlan` turns the tier into a typed `ExecutionPlan`
|
|
260
|
-
with per-stage `TokenBudget` allocations. Unknown tiers fail loudly with an
|
|
261
|
-
error, matching Python's `KeyError`.
|
|
262
|
-
3. **Fulfill context.** Before a stage runs, its `ContextRequest` is fulfilled
|
|
263
|
-
deterministically through `FulfillContextRequest`, which calls Zero's real
|
|
264
|
-
`tools.Registry` (`read_file`, `list_directory`, `grep`). All six legal query
|
|
265
|
-
types are handled; payloads are text, truncation is rune-safe, and a failed
|
|
266
|
-
tool becomes an errored `ContextItem` rather than a silent empty payload.
|
|
267
|
-
4. **Run stages.** Each pipeline stage is a typed Go function in
|
|
268
|
-
`internal/splice/stages/`. The code writer and test generator call the
|
|
269
|
-
configured provider. Static analysis, security audit, and test execution are
|
|
270
|
-
model-free and run through deterministic local tools. The `splicerun.Run`
|
|
271
|
-
orchestrator drives them under Zero's full callback contract (streaming,
|
|
272
|
-
usage, tool call/result pairs, permission events) and is wired into headless
|
|
273
|
-
`splice exec`.
|
|
274
|
-
5. **Monitor trajectory.** `ComputeIterationState` builds a state vector from
|
|
275
|
-
stage outputs; `EvaluateTrajectory` scores it and decides continue,
|
|
276
|
-
escalate, rollback, step back, or surface to user. Repeated state hashes
|
|
277
|
-
escalate as a cycle, including empty hashes, so an orchestrator bug surfaces
|
|
278
|
-
loudly instead of looping.
|
|
279
|
-
6. **Iterate or abort.** The orchestrator acts on the trajectory decision.
|
|
280
|
-
Failures are typed, not swallowed: a malformed stage payload names the data
|
|
281
|
-
key and offending index.
|
|
282
|
-
|
|
283
|
-
Everything in `internal/splice/` is deterministic Go with full test coverage:
|
|
284
|
-
JSON round-trip tests cover every `Validate()`-bearing struct, and the context
|
|
285
|
-
builder has an end-to-end test against the real tool registry.
|
|
286
|
-
|
|
287
|
-
## Safety Model
|
|
288
|
-
|
|
289
|
-
Splice is designed to make side effects visible.
|
|
290
|
-
|
|
291
|
-
- Workspace reads are allowed by default.
|
|
292
|
-
- File writes are limited to the workspace unless you grant another directory.
|
|
293
|
-
- Shell commands, network access, destructive commands, and elevated actions are
|
|
294
|
-
permission-gated.
|
|
295
|
-
- `--add-dir <path>` and `/add-dir <path>` grant additional write roots without
|
|
296
|
-
giving the agent the whole filesystem.
|
|
297
|
-
- Unsafe and autonomous modes are explicit opt-ins.
|
|
298
|
-
- Secrets are redacted from tool output and logs where Splice controls the
|
|
299
|
-
surface.
|
|
300
|
-
|
|
301
|
-
Example:
|
|
302
|
-
|
|
303
|
-
```bash
|
|
304
|
-
splice --add-dir ../docs-site
|
|
305
|
-
splice exec --add-dir ../shared "update both repos"
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
Sandbox behavior can be inspected with:
|
|
170
|
+
- workspace reads are allowed by default;
|
|
171
|
+
- writes stay inside the workspace unless you grant another root;
|
|
172
|
+
- shell commands, network access, destructive actions, and elevated actions are
|
|
173
|
+
permission-gated;
|
|
174
|
+
- `--add-dir <path>` grants a specific additional write root;
|
|
175
|
+
- unsafe and autonomous modes are explicit opt-ins;
|
|
176
|
+
- sandbox policy and grants can be inspected before a run.
|
|
309
177
|
|
|
310
178
|
```bash
|
|
311
179
|
splice sandbox policy
|
|
312
180
|
splice sandbox grants list
|
|
181
|
+
splice exec --add-dir ../shared "update both repositories"
|
|
313
182
|
```
|
|
314
183
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
Splice includes local file, search, edit, and shell tools, `web_fetch` for
|
|
318
|
-
public URLs, and MCP support for additional tools.
|
|
319
|
-
|
|
320
|
-
For local dev servers, use shell commands such as `curl` through `exec_command`
|
|
321
|
-
so the normal sandbox and permission policy applies. Long-running commands stay
|
|
322
|
-
attached to a background terminal session and can be listed or stopped from the
|
|
323
|
-
TUI.
|
|
324
|
-
|
|
325
|
-
The npm package will also include browser and terminal helper packages used by
|
|
326
|
-
local browser and terminal tools. Source builds can use the same helpers when
|
|
327
|
-
they are on `PATH` or configured in Splice's local-control settings.
|
|
328
|
-
|
|
329
|
-
## Common Commands
|
|
330
|
-
|
|
331
|
-
```text
|
|
332
|
-
splice interactive TUI
|
|
333
|
-
splice exec one-shot or scripted agent run
|
|
334
|
-
splice setup first-run provider setup
|
|
335
|
-
splice auth OAuth/login helpers for supported providers
|
|
336
|
-
splice login subscription login helpers for supported providers
|
|
337
|
-
splice models model registry and capabilities
|
|
338
|
-
splice providers provider profiles and detection
|
|
339
|
-
splice doctor setup, key, and connectivity checks
|
|
340
|
-
splice context context-budget report
|
|
341
|
-
splice repo-map deterministic repository map
|
|
342
|
-
splice repo-info local repository summary
|
|
343
|
-
splice search | find search local session history
|
|
344
|
-
splice sessions inspect, resume, fork, and rewind sessions
|
|
345
|
-
splice spec manage spec-mode drafts
|
|
346
|
-
splice specialist manage specialist subagents
|
|
347
|
-
splice skills manage markdown instruction skills
|
|
348
|
-
splice plugins manage plugins
|
|
349
|
-
splice hooks manage lifecycle hooks
|
|
350
|
-
splice mcp manage MCP servers and tools
|
|
351
|
-
splice serve --mcp expose Splice tools over MCP stdio
|
|
352
|
-
splice sandbox inspect sandbox policy and grants
|
|
353
|
-
splice worktrees prepare isolated git worktrees
|
|
354
|
-
splice verify detect and run local verification checks
|
|
355
|
-
splice changes inspect and commit local git changes
|
|
356
|
-
splice usage token usage and estimated cost
|
|
357
|
-
splice cron scheduled agent jobs
|
|
358
|
-
splice update check for newer releases
|
|
359
|
-
splice upgrade apply a newer release
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
## Extending Splice
|
|
363
|
-
|
|
364
|
-
### Project and personal instructions
|
|
365
|
-
|
|
366
|
-
Splice appends project-specific guidance to the system prompt from the first
|
|
367
|
-
`AGENTS.md`, `SPLICE.md`, or `.splice/AGENTS.md` file found in each directory
|
|
368
|
-
from the git root down to your current working directory (checked in that order
|
|
369
|
-
per directory). Files are injected general-to-specific, capped at 8 KiB per
|
|
370
|
-
file and 32 KiB total.
|
|
371
|
-
|
|
372
|
-
A personal `SPLICE.md` under
|
|
373
|
-
`config.UserConfigDir()/splice/SPLICE.md`
|
|
374
|
-
(`$XDG_CONFIG_HOME/splice/SPLICE.md` or `~/.config/splice/SPLICE.md` on
|
|
375
|
-
Linux/macOS, `%AppData%\Roaming\splice\SPLICE.md` on Windows) applies across
|
|
376
|
-
every workspace, ahead of any project guidelines.
|
|
377
|
-
|
|
378
|
-
### Plugins
|
|
379
|
-
|
|
380
|
-
Plugins are discovered from
|
|
381
|
-
`~/.config/splice/plugins/<name>/plugin.json` (user scope, `$XDG_CONFIG_HOME`
|
|
382
|
-
or `~/.config` on every OS, independent of the `config.UserConfigDir()` path
|
|
383
|
-
used above) and `<cwd>/.splice/plugins/<name>/plugin.json` (project scope,
|
|
384
|
-
resolved from the current working directory, not the repo root), and managed
|
|
385
|
-
with `splice plugins`. A manifest can declare:
|
|
386
|
-
|
|
387
|
-
- `tools` — custom tools (`command`, `args`, `inputSchema`, and a
|
|
388
|
-
`permission` of `prompt` or `deny`; `allow` is honored only when manifest
|
|
389
|
-
tool auto-approval is enabled)
|
|
390
|
-
- `hooks` — commands run on `beforeTool`, `afterTool`, `sessionStart`, or
|
|
391
|
-
`sessionEnd`
|
|
392
|
-
- `prompts` and `skills` — additional prompt and skill files
|
|
393
|
-
|
|
394
|
-
MCP servers (`splice mcp`) and standalone markdown skills (`splice skills`)
|
|
395
|
-
use the same extension points and can also be wired up outside of a plugin
|
|
396
|
-
manifest.
|
|
184
|
+
Read [SECURITY.md](SECURITY.md) for the threat model and reporting process.
|
|
397
185
|
|
|
398
|
-
##
|
|
186
|
+
## A small CLI surface for big workflows
|
|
399
187
|
|
|
400
|
-
|
|
|
188
|
+
| Command | What it is for |
|
|
401
189
|
|---|---|
|
|
402
|
-
| `
|
|
403
|
-
| `
|
|
404
|
-
|
|
|
405
|
-
|
|
|
406
|
-
| `
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
## Development
|
|
416
|
-
|
|
417
|
-
```bash
|
|
418
|
-
go test ./...
|
|
419
|
-
go run ./cmd/splice-release build
|
|
420
|
-
go run ./cmd/splice-release smoke
|
|
421
|
-
go run ./cmd/splice-perf-bench
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
Cross-compile examples:
|
|
425
|
-
|
|
426
|
-
```bash
|
|
427
|
-
go run ./cmd/splice-release build --goos linux --goarch amd64
|
|
428
|
-
go run ./cmd/splice-release build --goos windows --goarch amd64 --output dist/splice.exe
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
The deterministic pipeline layer lives in `internal/splice/` and is pure Go
|
|
432
|
-
with no provider SDK imports. Its packages:
|
|
433
|
-
|
|
434
|
-
- `internal/splice/schemas/` — typed stage and pipeline structs with
|
|
435
|
-
`Validate()` methods.
|
|
436
|
-
- `internal/splice/classifier.go` — request-to-tier classification.
|
|
437
|
-
- `internal/splice/planner.go` — tier-to-execution-plan, intent distillation.
|
|
438
|
-
- `internal/splice/budget.go` — per-tier token budgets.
|
|
439
|
-
- `internal/splice/trajectory.go` — iteration state, scoring, trajectory
|
|
440
|
-
decisions.
|
|
441
|
-
- `internal/splice/context.go` + `registry_runner.go` — deterministic context
|
|
442
|
-
fulfillment through Zero's tool registry.
|
|
443
|
-
- `internal/splice/stages/`: the stage agents (code writer, static analyzer,
|
|
444
|
-
test generator, security auditor, test runner, design conversation, plan
|
|
445
|
-
critic) with embedded prompts.
|
|
446
|
-
- `internal/splice/run.go`: the `splicerun.Run` orchestrator loop.
|
|
447
|
-
- `internal/splice/design_runner.go`: `RunDesignPlan`, topological task
|
|
448
|
-
sequencing for `splice exec --plan`.
|
|
449
|
-
|
|
450
|
-
Adjacent Splice-specific pieces: `internal/worktrees/` adds `MergeBack` on top
|
|
451
|
-
of Zero's worktree lifecycle, `memd/` is the memory sidecar (its own Go module,
|
|
452
|
-
binary `splice-memd`, SQLite/FTS5 over a Unix socket), and `internal/memd/` is
|
|
453
|
-
the sidecar's HTTP client (complete).
|
|
190
|
+
| `splice` | Interactive TUI |
|
|
191
|
+
| `splice exec` | One-shot and scripted runs |
|
|
192
|
+
| `splice setup` | First-run provider setup |
|
|
193
|
+
| `splice providers` / `models` | Provider profiles and model capabilities |
|
|
194
|
+
| `splice doctor` | Setup and connectivity checks |
|
|
195
|
+
| `splice spec` | Spec-mode drafts |
|
|
196
|
+
| `splice sessions` | Resume, fork, and inspect sessions |
|
|
197
|
+
| `splice specialist` | Specialist subagents |
|
|
198
|
+
| `splice skills` / `plugins` / `hooks` | Extend the agent locally |
|
|
199
|
+
| `splice mcp` | Configure MCP servers and tools |
|
|
200
|
+
| `splice worktrees` | Prepare isolated git worktrees |
|
|
201
|
+
| `splice verify` | Find and run repository checks |
|
|
202
|
+
| `splice update` / `upgrade` | Keep the binary current |
|
|
454
203
|
|
|
455
204
|
## Documentation
|
|
456
205
|
|
|
457
|
-
- [Install](docs/INSTALL.md)
|
|
206
|
+
- [Install Splice](docs/INSTALL.md)
|
|
458
207
|
- [Update flow](docs/UPDATE.md)
|
|
459
208
|
- [Stream-JSON protocol](docs/STREAM_JSON_PROTOCOL.md)
|
|
460
209
|
- [Specialists](docs/SPECIALISTS.md)
|
|
461
210
|
- [GitHub Action](docs/GITHUB_ACTION.md)
|
|
462
211
|
- [Benchmarks](docs/BENCHMARK.md)
|
|
463
212
|
- [Performance](docs/PERFORMANCE.md)
|
|
464
|
-
- [Agent
|
|
213
|
+
- [Agent evaluations](docs/AGENT_EVALS.md)
|
|
214
|
+
- [OAuth logins and subscriptions](docs/oauth-subscriptions.md)
|
|
465
215
|
|
|
466
|
-
##
|
|
216
|
+
## For contributors
|
|
467
217
|
|
|
468
|
-
|
|
469
|
-
|
|
218
|
+
Splice-specific pipeline code lives in `internal/splice/`. It is pure Go and
|
|
219
|
+
keeps provider SDKs out of the pipeline layer. The optional memory sidecar is a
|
|
220
|
+
separate module in `memd/` and communicates over a Unix socket.
|
|
470
221
|
|
|
471
|
-
|
|
222
|
+
```bash
|
|
223
|
+
go test ./...
|
|
224
|
+
go vet ./...
|
|
225
|
+
gofmt -l .
|
|
226
|
+
cd memd && go test ./...
|
|
227
|
+
```
|
|
472
228
|
|
|
473
|
-
|
|
229
|
+
Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a change. The project is
|
|
230
|
+
currently using an issue-first contribution policy.
|
|
474
231
|
|
|
475
|
-
|
|
232
|
+
## Built on Zero's Engine
|
|
233
|
+
|
|
234
|
+
Splice is built on top of [Gitlawb's Zero Engine](https://github.com/gitlawb/zero),
|
|
235
|
+
an open-source MIT-licensed terminal coding agent. Zero provides the TUI,
|
|
236
|
+
provider adapters, sessions, tools, sandbox, permissions, worktrees, MCP,
|
|
237
|
+
skills, plugins, and hooks. Splice keeps that foundation and adds the
|
|
238
|
+
orchestrator-mediated pipeline, typed stage contracts, deterministic checks,
|
|
239
|
+
trajectory monitoring, and the optional memory sidecar.
|
|
476
240
|
|
|
477
|
-
|
|
241
|
+
Upstream Zero code retains its original copyright and license. See
|
|
242
|
+
[LICENSE](LICENSE) and [SECURITY.md](SECURITY.md).
|
|
478
243
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
from the archived Flug prototype. All upstream Zero code retains its original
|
|
483
|
-
copyright and license. See [UPSTREAM.md](UPSTREAM.md) for the full divergence
|
|
484
|
-
list and the upstream sync procedure.
|
|
244
|
+
## License
|
|
245
|
+
|
|
246
|
+
Splice is released under the [MIT License](LICENSE).
|
package/bin/splice.js
CHANGED
|
@@ -82,9 +82,9 @@ if (!existsSync(nativePath)) {
|
|
|
82
82
|
|
|
83
83
|
const env = { ...process.env };
|
|
84
84
|
if (localControlHelpers) {
|
|
85
|
-
env.
|
|
85
|
+
env.SPLICE_LOCAL_CONTROL_HELPERS = localControlHelpers;
|
|
86
86
|
} else {
|
|
87
|
-
delete env.
|
|
87
|
+
delete env.SPLICE_LOCAL_CONTROL_HELPERS;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
const child = spawnSync(nativePath, process.argv.slice(2), {
|
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
// crafted archive cannot write outside the package (no zip-slip).
|
|
13
13
|
//
|
|
14
14
|
// Env overrides (testing / mirrors / locked-down installs):
|
|
15
|
-
//
|
|
15
|
+
// SPLICE_SKIP_DOWNLOAD=1 skip entirely, exit 0 (wrapper will guide if run)
|
|
16
16
|
// SPLICE_INSTALL_DRY_RUN=1 print the resolved plan as JSON, no network, exit 0
|
|
17
17
|
// SPLICE_INSTALL_PLATFORM=… override process.platform (linux|darwin|win32|android)
|
|
18
18
|
// SPLICE_INSTALL_ARCH=… override process.arch (x64|arm64)
|
|
19
19
|
// SPLICE_REPO=owner/name override the GitHub repo (default Taf0711/splice)
|
|
20
|
-
//
|
|
20
|
+
// SPLICE_GITHUB_BASE_URL=… override the download host (default https://github.com)
|
|
21
21
|
|
|
22
22
|
import {
|
|
23
23
|
chmodSync,
|
|
@@ -42,11 +42,11 @@ const pkg = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8'));
|
|
|
42
42
|
const VERSION = pkg.version;
|
|
43
43
|
|
|
44
44
|
const REPO = process.env.SPLICE_REPO || 'Taf0711/splice';
|
|
45
|
-
const BASE = (process.env.
|
|
45
|
+
const BASE = (process.env.SPLICE_GITHUB_BASE_URL || 'https://github.com').replace(/\/+$/, '');
|
|
46
46
|
// The .sha256 is fetched from the same origin as the archive, so TLS authenticity
|
|
47
47
|
// is the only real integrity control — require https unless explicitly overridden
|
|
48
48
|
// for local testing (e.g. a localhost mirror in tests).
|
|
49
|
-
const ALLOW_INSECURE = process.env.
|
|
49
|
+
const ALLOW_INSECURE = process.env.SPLICE_ALLOW_INSECURE_DOWNLOAD === '1';
|
|
50
50
|
const MAX_DOWNLOAD_BYTES = 512 * 1024 * 1024;
|
|
51
51
|
|
|
52
52
|
function fail(message) {
|
|
@@ -86,8 +86,8 @@ function resolveArch(a) {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
if (process.env.
|
|
90
|
-
warnSkip('
|
|
89
|
+
if (process.env.SPLICE_SKIP_DOWNLOAD === '1') {
|
|
90
|
+
warnSkip('SPLICE_SKIP_DOWNLOAD=1 set — skipping native binary download.');
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
const rawPlatform = process.env.SPLICE_INSTALL_PLATFORM || process.platform;
|
|
@@ -174,7 +174,7 @@ async function download(url) {
|
|
|
174
174
|
if (!ALLOW_INSECURE && !url.startsWith('https://')) {
|
|
175
175
|
fail(
|
|
176
176
|
`refusing insecure download origin for ${url}: only https:// is allowed ` +
|
|
177
|
-
`(set
|
|
177
|
+
`(set SPLICE_ALLOW_INSECURE_DOWNLOAD=1 to override for local testing).`,
|
|
178
178
|
);
|
|
179
179
|
}
|
|
180
180
|
let response;
|