@opencoven/coven-code 0.0.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/README.md +145 -0
- package/bin/coven-code-sdk.mjs +12 -0
- package/bin/coven-code.mjs +19 -0
- package/docs/CLI.md +192 -0
- package/docs/CONFIGURATION.md +107 -0
- package/docs/DEVELOPMENT.md +104 -0
- package/docs/DOGFOOD-PROTOCOL.md +263 -0
- package/docs/MCP-SKILLS-PLUGINS.md +127 -0
- package/docs/README.md +38 -0
- package/docs/RELEASE.md +33 -0
- package/docs/SDK.md +107 -0
- package/docs/superpowers/plans/2026-05-25-coven-code-panel-tui.md +904 -0
- package/docs/superpowers/plans/2026-05-25-coven-code-rebrand.md +670 -0
- package/docs/superpowers/specs/2026-05-25-coven-code-panel-tui-design.md +235 -0
- package/docs/superpowers/specs/2026-05-26-slash-first-tui-review.md +63 -0
- package/package.json +36 -0
- package/src/agent/lane.mjs +136 -0
- package/src/agent/local.mjs +95 -0
- package/src/cli/dispatch.mjs +66 -0
- package/src/cli/execute.mjs +588 -0
- package/src/cli/help.mjs +58 -0
- package/src/cli/interactive-core.mjs +302 -0
- package/src/cli/notifications.mjs +13 -0
- package/src/cli/parse.mjs +83 -0
- package/src/cli/reasoning.mjs +45 -0
- package/src/cli/refs.mjs +162 -0
- package/src/cli/repl.mjs +61 -0
- package/src/cli/slash-commands.mjs +357 -0
- package/src/cli/stream-json.mjs +116 -0
- package/src/cli/tui.mjs +757 -0
- package/src/commands/agents.mjs +53 -0
- package/src/commands/config.mjs +27 -0
- package/src/commands/ide.mjs +17 -0
- package/src/commands/login.mjs +84 -0
- package/src/commands/mcp.mjs +176 -0
- package/src/commands/permissions.mjs +328 -0
- package/src/commands/plugins.mjs +86 -0
- package/src/commands/review.mjs +74 -0
- package/src/commands/skill.mjs +23 -0
- package/src/commands/threads.mjs +165 -0
- package/src/commands/tools.mjs +77 -0
- package/src/commands/update.mjs +31 -0
- package/src/commands/usage.mjs +34 -0
- package/src/constants.mjs +46 -0
- package/src/main.mjs +87 -0
- package/src/mcp/discover.mjs +154 -0
- package/src/mcp/permissions.mjs +52 -0
- package/src/mcp/probe.mjs +424 -0
- package/src/mcp/registry.mjs +96 -0
- package/src/plugins/discover.mjs +880 -0
- package/src/sdk-install.mjs +187 -0
- package/src/sdk.mjs +314 -0
- package/src/settings/load.mjs +134 -0
- package/src/settings/paths.mjs +101 -0
- package/src/skills/builtin/building-skills/SKILL.md +20 -0
- package/src/skills/discover.mjs +95 -0
- package/src/threads/store.mjs +176 -0
- package/src/tools/builtin/bash.mjs +110 -0
- package/src/tools/builtin/create-file.mjs +66 -0
- package/src/tools/builtin/edit-file.mjs +76 -0
- package/src/tools/builtin/finder.mjs +73 -0
- package/src/tools/builtin/glob.mjs +74 -0
- package/src/tools/builtin/grep.mjs +82 -0
- package/src/tools/builtin/index.mjs +83 -0
- package/src/tools/builtin/librarian.mjs +97 -0
- package/src/tools/builtin/look-at.mjs +92 -0
- package/src/tools/builtin/mcp.mjs +51 -0
- package/src/tools/builtin/mermaid.mjs +59 -0
- package/src/tools/builtin/oracle.mjs +56 -0
- package/src/tools/builtin/painter.mjs +81 -0
- package/src/tools/builtin/plugin-tool.mjs +53 -0
- package/src/tools/builtin/read-mcp-resource.mjs +63 -0
- package/src/tools/builtin/read-web-page.mjs +72 -0
- package/src/tools/builtin/read.mjs +59 -0
- package/src/tools/builtin/runtime.mjs +215 -0
- package/src/tools/builtin/task.mjs +63 -0
- package/src/tools/builtin/toolbox-tool.mjs +57 -0
- package/src/tools/builtin/undo-edit.mjs +97 -0
- package/src/tools/builtin/web-search.mjs +128 -0
- package/src/tools/toolbox.mjs +273 -0
- package/src/util/fs.mjs +13 -0
- package/src/util/glob.mjs +46 -0
- package/src/util/html.mjs +21 -0
- package/src/util/media.mjs +13 -0
- package/src/util/shell.mjs +24 -0
- package/src/util/table.mjs +11 -0
package/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Coven Code
|
|
2
|
+
|
|
3
|
+
A small Node CLI for local Coven Code workflows. It runs deterministic local
|
|
4
|
+
command, thread, tool, MCP, skill, plugin, and SDK flows so integration behavior
|
|
5
|
+
can be exercised end-to-end without a hosted service.
|
|
6
|
+
|
|
7
|
+
## Quickstart
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm test
|
|
11
|
+
npm start
|
|
12
|
+
npm run coven-code -- --help
|
|
13
|
+
npm run coven-code -- -x "what is 2+2?"
|
|
14
|
+
echo "list markdown files" | npm run coven-code
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The package exposes `coven-code` and `coven-code-sdk` bins.
|
|
18
|
+
|
|
19
|
+
## Documentation
|
|
20
|
+
|
|
21
|
+
- [CLI reference](docs/CLI.md) - commands, flags, interactive mode, execute mode, JSON streaming, and thread workflows
|
|
22
|
+
- [Configuration](docs/CONFIGURATION.md) - settings files, environment variables, precedence, and common examples
|
|
23
|
+
- [MCP, skills, and plugins](docs/MCP-SKILLS-PLUGINS.md) - extension points for tools, MCP servers, skills, and project plugins
|
|
24
|
+
- [SDK](docs/SDK.md) - package exports, install helper, execution API, permissions, and thread helpers
|
|
25
|
+
- [Development](docs/DEVELOPMENT.md) - repository layout, local checks, release notes, and safety expectations
|
|
26
|
+
- [Coven Dogfood Protocol](docs/DOGFOOD-PROTOCOL.md) - daily task packets, harness assignment, handoff, verification, retrospectives, and issue capture
|
|
27
|
+
|
|
28
|
+
## Interactive Mode
|
|
29
|
+
|
|
30
|
+
Running `coven-code` with no arguments in a terminal starts the `neo-blessed`
|
|
31
|
+
panel TUI. Type `/` in the composer to open the slash-command menu with live
|
|
32
|
+
filtering and a details panel for commands, skills, and plugin actions.
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
$ coven-code
|
|
36
|
+
Coven Code 0.0.0-recreate
|
|
37
|
+
/Users/example/project
|
|
38
|
+
[chat] lane tools threads config help mode: smart effort: high
|
|
39
|
+
--------------------------------------------------------------------------------
|
|
40
|
+
Ready. Type a prompt or /help.
|
|
41
|
+
--------------------------------------------------------------------------------
|
|
42
|
+
>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The classic readline REPL remains available for scripts, demos, and compatibility:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
COVEN_CODE_REPL=1 coven-code
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Line history is stored at `${XDG_CONFIG_HOME:-~/.config}/coven-code/repl_history`.
|
|
52
|
+
Use `COVEN_CODE_REPL_HISTORY_FILE` to override the path or
|
|
53
|
+
`COVEN_CODE_REPL_HISTORY=0` to disable history in the classic REPL.
|
|
54
|
+
|
|
55
|
+
`COVEN_CODE_TUI_SCRIPTED=1` is reserved for deterministic tests and automation
|
|
56
|
+
that need to drive the TUI with newline-separated input.
|
|
57
|
+
|
|
58
|
+
## Execute Mode
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
coven-code -x "prompt"
|
|
62
|
+
coven-code -x "see @README.md" </dev/null
|
|
63
|
+
coven-code -x "..." --stream-json
|
|
64
|
+
coven-code -x "..." --stream-json --stream-json-input < msgs.jsonl
|
|
65
|
+
coven-code --continue T-... -x "continue a thread"
|
|
66
|
+
coven-code --toolbox ./toolbox -x "use tb__my_tool"
|
|
67
|
+
coven-code --skills ./skills -x "use the data-map skill"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Settings use the `covenCode.*` prefix. User settings live under
|
|
71
|
+
`${XDG_CONFIG_HOME:-~/.config}/coven-code/settings.json`; workspace settings
|
|
72
|
+
live under `.coven-code/settings.json`.
|
|
73
|
+
|
|
74
|
+
Useful settings and env vars:
|
|
75
|
+
|
|
76
|
+
- `covenCode.fuzzy.alwaysIncludePaths`
|
|
77
|
+
- `covenCode.tools.enable` / `covenCode.tools.disable`
|
|
78
|
+
- `covenCode.permissions`
|
|
79
|
+
- `covenCode.commands.allowlist`
|
|
80
|
+
- `covenCode.mcpServers`
|
|
81
|
+
- `covenCode.mcpPermissions`
|
|
82
|
+
- `covenCode.mcpRegistry.url`
|
|
83
|
+
- `covenCode.notifications.enabled`
|
|
84
|
+
- `covenCode.updates.mode`
|
|
85
|
+
- `covenCode.defaultVisibility`
|
|
86
|
+
- `COVEN_CODE_TOOLBOX`
|
|
87
|
+
- `COVEN_CODE_API_KEY`
|
|
88
|
+
- `COVEN_CODE_SKIP_UPDATE_CHECK`
|
|
89
|
+
- `COVEN_CODE_FORCE_BEL`
|
|
90
|
+
- `COVEN_CODE_CLI_PATH`
|
|
91
|
+
- `COVEN_CODE_HOME`
|
|
92
|
+
|
|
93
|
+
## Implemented Surface
|
|
94
|
+
|
|
95
|
+
Core:
|
|
96
|
+
|
|
97
|
+
- `coven-code --help`, `coven-code --version`
|
|
98
|
+
- panel TUI with transcript, lane status, tabs, status rail, composer, keyboard shortcuts, and command palette
|
|
99
|
+
- lane view for isolated worktree/branch context, harness selection, terminal output, changed files, diff summary, verification state, and PR/merge/cleanup status
|
|
100
|
+
- compatibility REPL with `/new`, `/continue`, `/queue`, `/mode`, `/reasoning`, persistent history, and multiline prompts
|
|
101
|
+
- command-palette aliases for thread archive, visibility, diagnostics, IDE, skills, plugins, and help
|
|
102
|
+
- one-shot execute mode with `-x` / `--execute`
|
|
103
|
+
- `@file`, glob, image, explicit thread, and `@@query` thread-search references
|
|
104
|
+
- `--stream-json`, `--stream-json-thinking`, `--stream-json-input`, and `--reasoning-effort`
|
|
105
|
+
- local persisted threads with labels, visibility, archive state, reports, and maps
|
|
106
|
+
|
|
107
|
+
Tools and permissions:
|
|
108
|
+
|
|
109
|
+
- built-in tools: `Bash`, `Read`, `Grep`, `glob`, `create_file`, `edit_file`, `undo_edit`, `Task`, `oracle`, `librarian`, `painter`, `mermaid`, `look_at`, `web_search`, `read_web_page`, `find_thread`, `finder`, and `read_mcp_resource`
|
|
110
|
+
- `coven-code tools list|make|show|use`
|
|
111
|
+
- toolbox discovery through `COVEN_CODE_TOOLBOX`, `--toolbox`, and `${XDG_CONFIG_HOME:-~/.config}/coven-code/tools`
|
|
112
|
+
- `coven-code permissions list|add|edit|test`
|
|
113
|
+
- delegated permission helpers receive `AGENT=coven-code` and `COVEN_CODE_THREAD_ID`
|
|
114
|
+
|
|
115
|
+
MCP, skills, and plugins:
|
|
116
|
+
|
|
117
|
+
- `coven-code mcp add|list|doctor|approve`
|
|
118
|
+
- remote MCP headers, OAuth credential storage in `~/.coven-code/oauth`, token refresh, Streamable HTTP sessions, and SSE fallback
|
|
119
|
+
- MCP registry enforcement that blocks unlisted servers and fails closed when the registry is unreachable
|
|
120
|
+
- skill discovery from configured roots, `.agents/skills`, legacy `.claude/skills` roots, and built-ins
|
|
121
|
+
- `coven-code skill list|show`
|
|
122
|
+
- project plugins from `.coven-code/plugins/*.ts` and user plugins from `${XDG_CONFIG_HOME:-~/.config}/coven-code/plugins/*.ts`
|
|
123
|
+
- plugin tools, commands, lifecycle events, configuration, status items, UI fallbacks, and helper APIs
|
|
124
|
+
|
|
125
|
+
SDK:
|
|
126
|
+
|
|
127
|
+
- `coven-code-sdk install [--force]`
|
|
128
|
+
- package root exports `execute`, `createUserMessage`, `createPermission`, and `threads`
|
|
129
|
+
- SDK execution streams local `coven-code --stream-json` messages
|
|
130
|
+
- SDK options map to CLI args for cwd, env, mode, reasoning effort, thinking, labels, visibility, archive, continuation, settings, toolbox, skills, MCP config, permissions, enabled tools, system prompt, logging, and permission bypass
|
|
131
|
+
|
|
132
|
+
## Development Checks
|
|
133
|
+
|
|
134
|
+
Run the full local verification gate before committing or publishing:
|
|
135
|
+
|
|
136
|
+
```sh
|
|
137
|
+
git diff --check
|
|
138
|
+
node ./bin/coven-code.mjs --help
|
|
139
|
+
node ./bin/coven-code.mjs -x "what is 2+2?"
|
|
140
|
+
npm test
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The project is intentionally dependency-free at runtime. Keep new behavior
|
|
144
|
+
covered in `test/cli.test.mjs`, avoid hosted-service assumptions, and keep
|
|
145
|
+
examples deterministic.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runInstallCommand } from '../src/sdk-install.mjs';
|
|
3
|
+
|
|
4
|
+
runInstallCommand(process.argv.slice(2))
|
|
5
|
+
.then((exitCode) => {
|
|
6
|
+
process.exit(exitCode);
|
|
7
|
+
})
|
|
8
|
+
.catch((error) => {
|
|
9
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
10
|
+
console.error(message);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { main, UsageError } from '../src/main.mjs';
|
|
3
|
+
import { CLI_NAME } from '../src/constants.mjs';
|
|
4
|
+
|
|
5
|
+
process.stdout.on('error', (error) => {
|
|
6
|
+
if (error?.code === 'EPIPE') process.exit(0);
|
|
7
|
+
throw error;
|
|
8
|
+
});
|
|
9
|
+
process.on('SIGPIPE', () => process.exit(0));
|
|
10
|
+
|
|
11
|
+
main().catch((error) => {
|
|
12
|
+
if (error instanceof UsageError) {
|
|
13
|
+
console.error(`${CLI_NAME}: ${error.message}`);
|
|
14
|
+
console.error(`Run \`${CLI_NAME} --help\` for usage.`);
|
|
15
|
+
process.exit(2);
|
|
16
|
+
}
|
|
17
|
+
console.error(error.stack || String(error));
|
|
18
|
+
process.exit(1);
|
|
19
|
+
});
|
package/docs/CLI.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# CLI Reference
|
|
2
|
+
|
|
3
|
+
## Entry Points
|
|
4
|
+
|
|
5
|
+
During development, run the CLI through npm:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm run coven-code -- --help
|
|
9
|
+
npm run coven-code -- -x "what is 2+2?"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Installed package binaries:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
coven-code --help
|
|
16
|
+
coven-code-sdk install
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The direct local entrypoint is:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
node ./bin/coven-code.mjs
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Interactive Mode
|
|
26
|
+
|
|
27
|
+
Run with no arguments in a TTY:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
coven-code
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The default interactive surface is a full-screen `neo-blessed` panel TUI with a
|
|
34
|
+
transcript, tabs, compact status line, command palette, slash-command menu, and
|
|
35
|
+
composer. It keeps a current local thread and accepts slash commands:
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
Coven Code 0.0.0-recreate
|
|
39
|
+
[chat] lane tools threads config help mode: smart effort: high
|
|
40
|
+
--------------------------------------------------------------------------------
|
|
41
|
+
Ready. Type a prompt or /help.
|
|
42
|
+
--------------------------------------------------------------------------------
|
|
43
|
+
> /help
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Supported interactive behaviors include:
|
|
47
|
+
|
|
48
|
+
- panel tabs for chat, lane, tools, threads, config, and help
|
|
49
|
+
- `/lane refresh` to load current worktree, branch, changed files, and diff summary
|
|
50
|
+
- `/lane harness <smart|deep|rush|large|next>` to select the active lane harness
|
|
51
|
+
- `/lane verify` to run the detected verification command and keep its output in the lane panel
|
|
52
|
+
- `/lane status` and `/lane diff` to inspect the visible lane model
|
|
53
|
+
- `/` opens a filtered command menu with details for built-ins, skills, and
|
|
54
|
+
plugin commands
|
|
55
|
+
- Tab completes the selected slash command; Enter accepts it; Esc closes the menu
|
|
56
|
+
- command palette actions for common thread and tool workflows
|
|
57
|
+
- persistent line history
|
|
58
|
+
- `/new` to start a fresh thread
|
|
59
|
+
- `/continue` to resume a thread
|
|
60
|
+
- `/queue` to queue a follow-up prompt
|
|
61
|
+
- `/mode` to inspect or change the active mode
|
|
62
|
+
- `/reasoning` to inspect or change reasoning effort
|
|
63
|
+
- command aliases for tools, skills, plugins, threads, diagnostics, and IDE
|
|
64
|
+
inspection
|
|
65
|
+
- multiline prompts with trailing backslash continuation
|
|
66
|
+
|
|
67
|
+
Use the classic readline REPL explicitly when a plain prompt is better for
|
|
68
|
+
scripts, demos, or compatibility:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
COVEN_CODE_REPL=1 coven-code
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Disable classic REPL history for demos or tests:
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
COVEN_CODE_REPL_HISTORY=0 coven-code
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`COVEN_CODE_TUI_SCRIPTED=1` is a deterministic test and automation hook for
|
|
81
|
+
feeding newline-separated TUI input. It is not intended as a normal user mode.
|
|
82
|
+
|
|
83
|
+
## Execute Mode
|
|
84
|
+
|
|
85
|
+
Use `--execute` or `-x` for one turn and exit:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
coven-code -x "what is 2+2?"
|
|
89
|
+
coven-code -x "summarize @README.md"
|
|
90
|
+
coven-code --continue T-example -x "continue this thread"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Piped stdin is combined with the prompt:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
echo "list markdown files" | coven-code
|
|
97
|
+
echo "additional context" | coven-code -x "answer using this context"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`-x`, `--stream-json`, `--stream-json-input`, stdin piping, and subcommands
|
|
101
|
+
keep their existing noninteractive behavior; the panel TUI only changes the
|
|
102
|
+
bare no-argument TTY path.
|
|
103
|
+
|
|
104
|
+
## File, Image, Glob, and Thread References
|
|
105
|
+
|
|
106
|
+
Execute prompts can reference local context:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
coven-code -x "summarize @README.md"
|
|
110
|
+
coven-code -x "inspect @docs/*.md"
|
|
111
|
+
coven-code -x "describe @image.png"
|
|
112
|
+
coven-code -x "compare this with @T-existing-thread"
|
|
113
|
+
coven-code -x "continue from @@search words"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Text references are capped to keep prompts bounded. Binary files are skipped
|
|
117
|
+
unless handled as supported media references.
|
|
118
|
+
|
|
119
|
+
## Stream JSON
|
|
120
|
+
|
|
121
|
+
Use `--stream-json` for structured JSONL suitable for frontends and SDKs:
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
coven-code -x "what is 2+2?" --stream-json
|
|
125
|
+
coven-code -x "inspect this" --stream-json --stream-json-thinking
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Use `--stream-json-input` to read user messages from JSONL stdin:
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
coven-code --stream-json --stream-json-input < messages.jsonl
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Stream JSON emits initialization, user, assistant, tool use, tool result, and
|
|
135
|
+
final result messages.
|
|
136
|
+
|
|
137
|
+
## Tools
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
coven-code tools list
|
|
141
|
+
coven-code tools show Bash
|
|
142
|
+
coven-code tools make --bash my-tool
|
|
143
|
+
coven-code tools use tb__my-tool
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Built-in tools include `Bash`, `Read`, `Grep`, `glob`, `create_file`,
|
|
147
|
+
`edit_file`, `undo_edit`, `Task`, `oracle`, `librarian`, `painter`, `mermaid`,
|
|
148
|
+
`look_at`, `web_search`, `read_web_page`, `find_thread`, `finder`, and
|
|
149
|
+
`read_mcp_resource`.
|
|
150
|
+
|
|
151
|
+
## Permissions
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
coven-code permissions list
|
|
155
|
+
coven-code permissions list --builtin
|
|
156
|
+
coven-code permissions add allow Bash command.name git
|
|
157
|
+
coven-code permissions test Bash command.name git
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Permission rules can allow or reject tool calls by tool name, action, command,
|
|
161
|
+
arguments, server names, URLs, and nested context fields.
|
|
162
|
+
|
|
163
|
+
## Threads
|
|
164
|
+
|
|
165
|
+
```sh
|
|
166
|
+
coven-code threads list
|
|
167
|
+
coven-code threads show T-example
|
|
168
|
+
coven-code threads search "query"
|
|
169
|
+
coven-code threads continue T-example -x "follow up"
|
|
170
|
+
coven-code threads archive T-example
|
|
171
|
+
coven-code threads visibility T-example workspace
|
|
172
|
+
coven-code threads map T-example
|
|
173
|
+
coven-code threads report T-example
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Threads are local records that preserve prompts, labels, visibility, archive
|
|
177
|
+
state, diagnostic reports, and reference edges.
|
|
178
|
+
|
|
179
|
+
## Other Commands
|
|
180
|
+
|
|
181
|
+
```sh
|
|
182
|
+
coven-code login
|
|
183
|
+
coven-code update
|
|
184
|
+
coven-code usage
|
|
185
|
+
coven-code review
|
|
186
|
+
coven-code config edit
|
|
187
|
+
coven-code config edit --workspace
|
|
188
|
+
coven-code ide connect
|
|
189
|
+
coven-code agents-md list
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
`agents list` is an alias for `agents-md list`.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
## Settings Files
|
|
4
|
+
|
|
5
|
+
Coven Code reads settings from these places:
|
|
6
|
+
|
|
7
|
+
- user settings: `${XDG_CONFIG_HOME:-~/.config}/coven-code/settings.json`
|
|
8
|
+
- workspace settings: `.coven-code/settings.json`
|
|
9
|
+
- explicit settings file: `--settings-file <path>`
|
|
10
|
+
- managed settings used by tests and embedding environments
|
|
11
|
+
|
|
12
|
+
Settings use the `covenCode.*` namespace.
|
|
13
|
+
|
|
14
|
+
Workspace settings override user settings where both define the same key.
|
|
15
|
+
Managed settings override both. Explicit command-line flags override settings
|
|
16
|
+
for the current run.
|
|
17
|
+
|
|
18
|
+
## Editing Settings
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
coven-code config edit
|
|
22
|
+
coven-code config edit --workspace
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Settings files may use JSONC syntax, including comments and trailing commas.
|
|
26
|
+
|
|
27
|
+
## Common Settings
|
|
28
|
+
|
|
29
|
+
```jsonc
|
|
30
|
+
{
|
|
31
|
+
"covenCode.tools.disable": ["web_search"],
|
|
32
|
+
"covenCode.tools.enable": ["Bash", "Read", "Grep"],
|
|
33
|
+
"covenCode.commands.allowlist": ["git", "npm", "node"],
|
|
34
|
+
"covenCode.permissions": [
|
|
35
|
+
{
|
|
36
|
+
"effect": "allow",
|
|
37
|
+
"tool": "Bash",
|
|
38
|
+
"match": {
|
|
39
|
+
"command.name": "git"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"covenCode.mcpServers": {
|
|
44
|
+
"local-tools": {
|
|
45
|
+
"command": "node",
|
|
46
|
+
"args": ["./tools/server.mjs"]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"covenCode.mcpPermissions": [],
|
|
50
|
+
"covenCode.mcpRegistry.url": "https://example.invalid/registry.json",
|
|
51
|
+
"covenCode.notifications.enabled": true,
|
|
52
|
+
"covenCode.updates.mode": "skip",
|
|
53
|
+
"covenCode.defaultVisibility": "workspace",
|
|
54
|
+
"covenCode.showCosts": true
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Environment Variables
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
COVEN_CODE_API_KEY
|
|
62
|
+
COVEN_CODE_HOME
|
|
63
|
+
COVEN_CODE_CLI_PATH
|
|
64
|
+
COVEN_CODE_TOOLBOX
|
|
65
|
+
COVEN_CODE_REPL_HISTORY
|
|
66
|
+
COVEN_CODE_REPL_HISTORY_FILE
|
|
67
|
+
COVEN_CODE_SKIP_UPDATE_CHECK
|
|
68
|
+
COVEN_CODE_FORCE_BEL
|
|
69
|
+
COVEN_CODE_URL
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`COVEN_CODE_HOME` controls the local state root used by SDK-managed installs
|
|
73
|
+
and tests. `COVEN_CODE_CLI_PATH` points SDK execution at a specific CLI binary.
|
|
74
|
+
|
|
75
|
+
Use isolated state for demos and tests:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
COVEN_CODE_HOME="$(mktemp -d)" \
|
|
79
|
+
XDG_CONFIG_HOME="$(mktemp -d)" \
|
|
80
|
+
COVEN_CODE_REPL_HISTORY=0 \
|
|
81
|
+
COVEN_CODE_SKIP_UPDATE_CHECK=1 \
|
|
82
|
+
npm run coven-code -- -x "what is 2+2?"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Visibility
|
|
86
|
+
|
|
87
|
+
Thread visibility accepts:
|
|
88
|
+
|
|
89
|
+
- `private`
|
|
90
|
+
- `public`
|
|
91
|
+
- `workspace`
|
|
92
|
+
- `group`
|
|
93
|
+
- `unlisted`
|
|
94
|
+
|
|
95
|
+
SDK compatibility maps documented team visibility to workspace visibility.
|
|
96
|
+
|
|
97
|
+
## Permissions Model
|
|
98
|
+
|
|
99
|
+
Permission rules are evaluated before tool execution. Built-in defaults can be
|
|
100
|
+
listed with:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
coven-code permissions list --builtin
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Workspace permission settings override user settings. This keeps repository
|
|
107
|
+
policy close to the project under test.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Development
|
|
2
|
+
|
|
3
|
+
## Requirements
|
|
4
|
+
|
|
5
|
+
- Node.js 20 or newer
|
|
6
|
+
- npm for this package's current lockfile and scripts
|
|
7
|
+
|
|
8
|
+
The runtime intentionally has a small dependency surface. `neo-blessed` owns the
|
|
9
|
+
live panel TUI so Coven Code does not maintain a fragile raw escape-code input
|
|
10
|
+
loop. Keep any future dependency additions similarly narrow and justified.
|
|
11
|
+
|
|
12
|
+
## Repository Layout
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
bin/ CLI entrypoints
|
|
16
|
+
docs/ User-facing documentation
|
|
17
|
+
src/agent/ Local deterministic agent behavior
|
|
18
|
+
src/cli/ Argument parsing, TUI/REPL, references, stream helpers
|
|
19
|
+
src/commands/ Top-level command implementations
|
|
20
|
+
src/mcp/ MCP discovery, permissions, probing, registry checks
|
|
21
|
+
src/plugins/ Project/user plugin discovery and lifecycle
|
|
22
|
+
src/settings/ Settings paths and merge logic
|
|
23
|
+
src/skills/ Skill discovery and built-in skills
|
|
24
|
+
src/threads/ Local thread persistence
|
|
25
|
+
src/tools/ Built-in and toolbox tool surfaces
|
|
26
|
+
test/ Node test suite
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Local Verification
|
|
30
|
+
|
|
31
|
+
Run this before every commit:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
git diff --check
|
|
35
|
+
node ./bin/coven-code.mjs --help
|
|
36
|
+
node ./bin/coven-code.mjs -x "what is 2+2?"
|
|
37
|
+
npm test
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Expected result:
|
|
41
|
+
|
|
42
|
+
- no whitespace errors
|
|
43
|
+
- help renders
|
|
44
|
+
- execute mode prints `4`
|
|
45
|
+
- test suite exits with zero failures
|
|
46
|
+
|
|
47
|
+
## Isolated Demo State
|
|
48
|
+
|
|
49
|
+
Use temporary state when demonstrating the CLI so the run does not write to the
|
|
50
|
+
operator's normal config or REPL history:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
COVEN_CODE_HOME="$(mktemp -d)" \
|
|
54
|
+
XDG_CONFIG_HOME="$(mktemp -d)" \
|
|
55
|
+
COVEN_CODE_REPL_HISTORY=0 \
|
|
56
|
+
COVEN_CODE_SKIP_UPDATE_CHECK=1 \
|
|
57
|
+
npm run coven-code -- -x "what is 2+2?"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For interactive demos, bare `coven-code` opens the `neo-blessed` panel TUI. Use
|
|
61
|
+
`/` in the composer to verify the slash-command menu, filtering, details panel,
|
|
62
|
+
Tab completion, Enter acceptance, and Esc close behavior. Use the classic
|
|
63
|
+
readline surface only when the demo needs a plain prompt:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
COVEN_CODE_REPL=1 \
|
|
67
|
+
COVEN_CODE_REPL_HISTORY=0 \
|
|
68
|
+
COVEN_CODE_SKIP_UPDATE_CHECK=1 \
|
|
69
|
+
npm run coven-code
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`COVEN_CODE_TUI_SCRIPTED=1` is reserved for deterministic TUI tests and
|
|
73
|
+
automation. It feeds newline-separated input through the TUI loop without
|
|
74
|
+
changing execute mode, stream JSON, stdin piping, or subcommand behavior.
|
|
75
|
+
|
|
76
|
+
## Testing Expectations
|
|
77
|
+
|
|
78
|
+
Add or update tests in `test/cli.test.mjs` for any CLI behavior change. TUI
|
|
79
|
+
changes should cover the model/renderer, key handling, scripted smoke path, and
|
|
80
|
+
classic REPL compatibility when needed. Slash-command changes should test the
|
|
81
|
+
catalog source and at least one rendered/filtering TUI state. Prefer
|
|
82
|
+
deterministic local tests over network calls. When a feature integrates with MCP,
|
|
83
|
+
plugins, skills, or toolbox tools, test both discovery and execution paths.
|
|
84
|
+
|
|
85
|
+
## Safety
|
|
86
|
+
|
|
87
|
+
- Do not commit secrets, tokens, generated credentials, or local config state.
|
|
88
|
+
- Keep examples deterministic and local.
|
|
89
|
+
- Keep docs and command help aligned.
|
|
90
|
+
- Do not rely on hosted services for default behavior.
|
|
91
|
+
- Keep private workspace paths and machine-specific URLs out of docs.
|
|
92
|
+
|
|
93
|
+
## Release Notes
|
|
94
|
+
|
|
95
|
+
The package currently uses version `0.0.0` while the CLI surface is rebuilt.
|
|
96
|
+
Before publishing, update versioning deliberately and verify:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
npm test
|
|
100
|
+
npm pack --dry-run
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The `.npmignore` file excludes internal superpowers planning notes while
|
|
104
|
+
including the user-facing docs in this directory.
|