@blade-ai/orca 0.1.1-darwin-arm64

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 ADDED
@@ -0,0 +1,200 @@
1
+ # Orca
2
+
3
+ Orca is a DeepSeek-native coding agent runtime by Blade.
4
+
5
+ A local terminal coding agent built in Rust, focused on DeepSeek reasoning and tool-use semantics. It runs a multi-turn agent loop with SSE streaming, automatic context window management, and HTTP retry with exponential backoff.
6
+
7
+ ## Installation
8
+
9
+ ### npm
10
+
11
+ ```bash
12
+ npm install -g @blade-ai/orca
13
+ orca --version
14
+ ```
15
+
16
+ The npm package installs a small Node.js launcher and the native `orca` binary for supported platforms.
17
+
18
+ Supported npm platforms:
19
+
20
+ - macOS Apple Silicon (`darwin/arm64`)
21
+ - macOS Intel (`darwin/x64`)
22
+ - Linux x64 (`linux/x64`)
23
+ - Linux ARM64 (`linux/arm64`)
24
+
25
+ ### GitHub Releases
26
+
27
+ Download the archive for your platform from the latest GitHub Release, extract it, and place `orca` on your `PATH`.
28
+
29
+ ## Quick Start
30
+
31
+ ```sh
32
+ # Set your API key
33
+ export DEEPSEEK_API_KEY=sk-...
34
+
35
+ # Run a task
36
+ orca exec "fix this test"
37
+
38
+ # With options
39
+ orca exec --approval-mode full-auto "refactor the auth module"
40
+ orca exec --model deepseek-v4-pro "explain this codebase"
41
+ orca exec --verifier "cargo test" "fix the failing test"
42
+ ```
43
+
44
+ ## Configuration
45
+
46
+ Priority chain (highest wins): Environment variables > CLI arguments > Config file > Defaults.
47
+
48
+ ### Environment Variables
49
+
50
+ - `DEEPSEEK_API_KEY` — API key (required)
51
+ - `DEEPSEEK_MODEL` — Model override
52
+ - `DEEPSEEK_BASE_URL` — API base URL override
53
+
54
+ ### Config File
55
+
56
+ `~/.orca/config.toml`:
57
+
58
+ ```toml
59
+ model = "auto"
60
+ api_key = "sk-..."
61
+ base_url = "https://api.deepseek.com"
62
+ ```
63
+
64
+ Hooks may return structured JSON on stdout. `{"action":"deny","reason":"..."}` blocks, `{"action":"modify","modified_target":"..."}` rewrites a tool target, and `{"action":"inject","context":"..."}` adds model context. Plain non-JSON stdout is treated as injected context for compatibility. Supported events are `session_start`, `session_end`, `pre_tool_use`, `post_tool_use`, `pre_model_call`, `post_model_call`, `on_budget_warning`, `pre_compact`, and `post_compact`.
65
+
66
+ Custom tools can be added with TOML descriptors under `~/.orca/tools/`:
67
+
68
+ ```toml
69
+ name = "deploy"
70
+ description = "Deploy the current branch"
71
+ action_kind = "write"
72
+ command = "./scripts/deploy.sh"
73
+ schema = { target = { type = "string", description = "environment" } }
74
+ ```
75
+
76
+ External tool commands run from the workspace directory. The raw JSON arguments are provided on stdin and in `ORCA_TOOL_ARGS`.
77
+
78
+ ### Defaults
79
+
80
+ - Model: `auto` (main loop uses `deepseek-v4-pro`, auxiliary tasks use `deepseek-v4-flash`)
81
+ - Base URL: `https://api.deepseek.com`
82
+ - Approval mode: `suggest`
83
+ - Output format: `text`
84
+ - Max turns: 128
85
+
86
+ ## Command
87
+
88
+ ```sh
89
+ orca exec [options] <prompt>
90
+ orca --mode=server
91
+ ```
92
+
93
+ Options:
94
+
95
+ - `--output-format text|jsonl` — Output format (default: text)
96
+ - `--cwd <path>` — Workspace directory
97
+ - `--approval-mode suggest|auto-edit|full-auto` — Approval policy
98
+ - `--model auto|deepseek-v4-flash|deepseek-v4-pro` — Model to use; `auto` defaults to Pro for the main loop and Flash for auxiliary tasks
99
+ - `--base-url <url>` — API base URL
100
+ - `--verifier <command>` — Post-run verification command
101
+ - `--resume <session|latest>` — Continue from a saved conversation transcript
102
+ - `--fork <session|latest>` — Continue from a saved transcript in a new child session with parent metadata
103
+ - `--continue` / `--last` — Continue from the latest saved conversation transcript
104
+ - `--no-history` — Disable local transcript persistence for this run
105
+ - `--save-history` — Persist transcript even with `--output-format jsonl`
106
+ - top-level `--continue` / `--last` — Open the latest saved conversation in TUI mode
107
+ - top-level `--resume <session|latest>` — Open a saved conversation in TUI mode
108
+ - top-level `--fork <session|latest>` — Fork a saved conversation in TUI mode
109
+ - top-level `--session-picker` — Choose a saved conversation before entering TUI mode
110
+ - top-level `--mode=server` — Read JSONL `submit` requests from stdin and emit protocol events to stdout
111
+
112
+ ## Workflows
113
+
114
+ `orca workflow run <script-or-name>` runs a Claude Code-style dynamic workflow.
115
+ Named workflows resolve from the nearest `.claude/workflows/` directory first,
116
+ then `~/.claude/workflows/`. Project workflows win over user workflows.
117
+
118
+ Workflow scripts are JavaScript modules beginning with:
119
+
120
+ ```js
121
+ export const meta = { name: "audit", description: "Audit code", phases: ["scan"] };
122
+ ```
123
+
124
+ ## Conversation History
125
+
126
+ Text-mode `orca exec` saves local JSONL transcripts under `~/.orca/sessions/YYYY/MM/DD/`.
127
+ JSONL mode is side-effect free by default for harness use; pass `--save-history` when a machine-readable run should also be resumable.
128
+
129
+ ```sh
130
+ orca history list
131
+ orca history list --all
132
+ orca history show latest
133
+ orca history rename latest "short title"
134
+ orca history search "needle"
135
+ orca history compress latest
136
+ orca history archive latest
137
+ orca history delete <session>
138
+ orca exec --resume latest "continue the refactor"
139
+ orca exec --continue "continue the refactor"
140
+ orca exec --fork latest "try another approach"
141
+ orca --session-picker
142
+ ```
143
+
144
+ `--resume` and `--fork` accept a full session ID, a filename/session prefix, or `latest`. Resumed runs create a new transcript that includes the loaded context plus the new turn. Forked runs also write `parent_id` and `forked: true` metadata. Context compaction is persisted as `context.collapsed` records, appends are guarded with file locks on Unix, `history search` uses local ripgrep when available, and `history compress` rewrites large transcripts as `.jsonl.zst` while keeping list/show/search support.
145
+
146
+ In the TUI, `Esc` during an idle composer backtracks to the previous user message and places that prompt back in the input box for editing and re-asking.
147
+
148
+ ## Tools
149
+
150
+ Built-in tools:
151
+
152
+ | Tool | Description |
153
+ |------|-------------|
154
+ | `read_file` | Read file contents (UTF-8, truncated at 8KB) |
155
+ | `list_files` | List directory entries |
156
+ | `grep` | Search with ripgrep (regex, line numbers) |
157
+ | `bash` | Execute shell commands via `sh -c` |
158
+ | `edit` | Exact text replacement in files |
159
+ | `git_status` | Show git working tree status |
160
+ | `subagent` | Run a synchronous child agent for a delegated task |
161
+
162
+ ## Architecture
163
+
164
+ - **Agent Loop**: prompt → model → tool_call → execute → feed result → next turn (up to 128 turns)
165
+ - **Subagents**: Synchronous child agent loops share the parent workspace, provider/model config, and approval policy, then return a concise result to the parent
166
+ - **SSE Streaming**: Real-time reasoning and content deltas via Server-Sent Events
167
+ - **Context Window**: 128K tokens, 80% threshold compaction (preserves system + recent messages)
168
+ - **Conversation History**: Local JSONL transcripts support listing, inspection, resume/fork, full-text search, archive/delete/rename, and zstd compression
169
+ - **HTTP Client**: Singleton with 30s connect / 120s request / 300s streaming timeouts, exponential backoff retry (3 attempts, handles 429/5xx)
170
+ - **Approval Policy**: Read operations always allowed; write/shell actions require interactive confirmation (suggest mode) or auto-allowed based on mode
171
+ - **Verification**: Optional post-completion verifier command with pass/fail status
172
+
173
+ ## Event Stream (JSONL)
174
+
175
+ When `--output-format jsonl` is used, each line is a versioned event:
176
+
177
+ ```json
178
+ {"version":"1","run_id":"run-...","seq":0,"timestamp_ms":1780647978857,"type":"session.started","payload":{}}
179
+ ```
180
+
181
+ Event types: `session.started`, `turn.started`, `assistant.reasoning.delta`, `assistant.message.delta`, `provider.replay.updated`, `approval.requested`, `approval.resolved`, `tool.call.requested`, `tool.call.completed`, `subagent.started`, `subagent.completed`, `verification.started`, `verification.completed`, `error`, `session.completed`.
182
+
183
+ ## Exit Codes
184
+
185
+ - `0`: success
186
+ - `1`: failed
187
+ - `2`: verification failed
188
+ - `3`: approval required or denied
189
+ - `4`: budget exhausted
190
+ - `130`: cancelled
191
+
192
+ ## Tech Stack
193
+
194
+ - Rust 2024 edition
195
+ - clap (CLI), reqwest (blocking HTTP), serde (JSON), toml (config), dirs (XDG paths)
196
+ - Synchronous blocking I/O, suitable for CLI interaction
197
+
198
+ ## Status
199
+
200
+ Production-ready agent loop with DeepSeek streaming provider. All 7 tools implemented, multi-turn conversation with context management, subagents, approval policies, and verification support.
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "license": "MIT",
3
+ "files": [
4
+ "vendor",
5
+ "README.md"
6
+ ],
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/echoVic/blade-deepseek.git"
10
+ },
11
+ "engines": {
12
+ "node": ">=16"
13
+ },
14
+ "name": "@blade-ai/orca",
15
+ "version": "0.1.1-darwin-arm64",
16
+ "description": "Native Orca binary for darwin/arm64.",
17
+ "os": [
18
+ "darwin"
19
+ ],
20
+ "cpu": [
21
+ "arm64"
22
+ ]
23
+ }