@kolisachint/hoocode 0.0.0-stage → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Mario Zechner (original "pi-mono" project — https://github.com/badlogic/pi-mono and https://github.com/earendil-works/pi-mono)
4
+ Copyright (c) 2026 Sachin Koli (HooCode fork — https://github.com/kolisachint/cortexcode)
5
+
6
+ This project ("cortexcode") is a Rust migration of the HooCode / pi-mono project by
7
+ Mario Zechner. All upstream copyright and authorship is preserved. Modifications
8
+ and additions made in this fork are released under the same MIT terms below.
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,184 @@
1
- # Temporary Holding Version
1
+ # cortexcode
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Rust migration of the [HooCode](https://github.com/kolisachint/hoocode-ts) TypeScript coding-agent framework.
4
+
5
+ This is a multi-crate workspace that mirrors the structure of the [pycortex](https://github.com/kolisachint/pycortex) Python migration. Each namespace (`ai`, `agent`, `code`, `tui`) is split into focused, version-locked crates published to crates.io.
6
+
7
+ ## Workspace structure
8
+
9
+ ```
10
+ crates/
11
+ cortexcode/ # Top-level umbrella crate
12
+ cortexcode-ai/ # AI namespace umbrella
13
+ cortexcode-ai-types/
14
+ cortexcode-ai-models/
15
+ ...
16
+ cortexcode-agent/ # Agent namespace umbrella
17
+ cortexcode-agent-core/
18
+ ...
19
+ cortexcode-code/ # Code namespace umbrella
20
+ ...
21
+ cortexcode-tui/ # TUI namespace umbrella
22
+ ...
23
+ ```
24
+
25
+ All crates share a single lockstep version defined in the workspace `Cargo.toml`.
26
+
27
+ ## Installation
28
+
29
+ **macOS / Linux** (no root, no Node):
30
+
31
+ ```bash
32
+ curl -fsSL https://kolisachint.github.io/hoocode/install.sh | sh
33
+ ```
34
+
35
+ It installs `~/.hoocode/bin/hoocode` (and `hoo`), checks the download against the
36
+ release's `SHA256SUMS`, and adds `~/.hoocode/bin` to `PATH`. `--help` lists the
37
+ options (`--version`, `--dir`, `--no-modify-path`).
38
+
39
+ **npm / bun:**
40
+
41
+ ```bash
42
+ npm install -g @kolisachint/hoocode # or: bun add -g @kolisachint/hoocode
43
+ ```
44
+
45
+ The package pulls in only the binary for your platform (macOS or Linux, x64 or
46
+ arm64). There is no Windows build; on Windows use the TypeScript build,
47
+ [hoocode-ts](https://github.com/kolisachint/hoocode-ts).
48
+
49
+ ### From source
50
+
51
+ ### Command names: `hoocode` and `hoocode-ts`
52
+
53
+ This Rust build is installed as **`hoocode`**. The TypeScript original is reached as
54
+ **`hoocode-ts`**, a small shim (`scripts/shims/hoocode-ts`) that runs the npm package
55
+ `@kolisachint/hoocode-agent` (a global npm install if present, otherwise `npx`; set
56
+ `HOOCODE_TS_BIN` to point it anywhere else). Only the installed names changed: the crates,
57
+ the cargo binary (`cortex`), the config directory and the in-app name are unchanged. If you
58
+ also have the TS one installed globally from npm, put the Rust `hoocode` earlier on `PATH`
59
+ (npm's `hoo` alias still runs the TS one).
60
+
61
+ ```bash
62
+ git clone https://github.com/kolisachint/cortexcode
63
+ cd cortexcode
64
+ scripts/install.sh # → ~/.local/bin/hoocode and hoocode-ts
65
+ scripts/install.sh --prefix /usr/local/bin --also-cortex # also keep a `cortex` link
66
+ ```
67
+
68
+ Plain cargo still works and installs the binary as `cortex`:
69
+ `cargo install --path crates/cortexcode-code-main --bin cortex`.
70
+
71
+ ### Pre-built binaries
72
+
73
+ Download `hoocode-<target>.tar.gz` from the
74
+ [GitHub Releases](https://github.com/kolisachint/hoocode/releases) page and check it
75
+ against `SHA256SUMS`. It holds the `hoocode` binary and the `hoocode-ts` shim; put both
76
+ on your `PATH`. Linux builds are static (musl) and run on any distro.
77
+
78
+ ## Usage
79
+
80
+ ```bash
81
+ # Single-shot print mode (text or JSON)
82
+ cortex -p "Explain this codebase"
83
+ cortex -p --mode json "Explain this codebase"
84
+
85
+ # Interactive TUI mode
86
+ cortex
87
+
88
+ # JSON-RPC server mode
89
+ cortex --mode rpc
90
+
91
+ # Subagent mode (used internally by the Task tool)
92
+ cortex --mode subagent --task-id <id>
93
+ ```
94
+
95
+ ## Development
96
+
97
+ ```bash
98
+ # Build the entire workspace
99
+ cargo build
100
+
101
+ # Run checks for all crates
102
+ cargo check --workspace
103
+
104
+ # Run all tests (CI uses nextest; `cargo test --workspace` works too)
105
+ scripts/ci/fetch_hoocode_fixtures.sh # pinned hoocode fixtures a few tests read
106
+ cargo nextest run --workspace
107
+ ```
108
+
109
+ ### Releases
110
+
111
+ Label a PR `rust:patch`, `rust:minor` or `rust:major`; merging it runs the release:
112
+ CI gates (parallel) → version bump, tag and GitHub release → binaries for 4 targets in
113
+ parallel, each uploaded as soon as it is built. Optional labels: `release:skip-gates`
114
+ (skip the gates, the PR's CI already passed) and `release:crates` (also publish to
115
+ crates.io, off by default). Manual runs: Actions → Release.
116
+
117
+ ## Migration status (paused 2026-10-01, ready to use)
118
+
119
+ The port of hoocode **v0.5.89** (commit `a6cd96e7`) is paused, and `cortex` is usable as a
120
+ daily coding agent. Phases 7, 8 and 11 are complete. Phase 10 is complete apart from the
121
+ deferred items listed below. Every remaining task is **deferred** by user decision; none is
122
+ in progress. Status per task: `python3 migration/ledger.py status`.
123
+
124
+ What works (the pinned hoocode behavior, checked against hoocode itself):
125
+
126
+ - **Modes:** interactive TUI, print mode (`-p`, text and `--mode json`), and `--mode rpc`
127
+ (with a Rust `RpcClient`).
128
+ - **Providers:** every catalog provider, plus OAuth logins (`/login`) and `models.json`.
129
+ - **Sessions:** AgentSession with compaction, `/new`, `/resume`, `/fork`, `/tree`,
130
+ `--continue`, `--session`, and `/export <file>.jsonl`.
131
+ - **Tools:** read, bash, edit, write, lexical SearchCodebase, TodoWrite, ask_options, and the
132
+ Yes/No/Always permission prompt.
133
+ - **Agent modes:** ask/plan/build/debug (`/mode`, `/plan`, `/grill`, `/approve`, alt+a).
134
+ - **Subagents:** the Task/TaskOutput tools, the task panel, and the subagent roster.
135
+ - **Resources:** skills, prompt templates and slash commands, AGENTS.md/CLAUDE.md context
136
+ files, themes, settings (`/settings`) and keybindings.
137
+
138
+ Deferred (not available yet, even though `--help` still lists some of them):
139
+
140
+ | Area | Ledger task |
141
+ |---|---|
142
+ | MCP servers (`mcp.json`, stdio/HTTP/SSE, OAuth) | 9.1, 10.11 |
143
+ | `webfetch` / `websearch` (`--enable-webtools`) | 10.2e |
144
+ | Plugins and marketplace (`--enable-plugintools`) | 12.1 |
145
+ | `cortex install/remove/update/list` package manager | 12.2 |
146
+ | Code extensions (`-e`, extension flags) | 12.3 |
147
+ | Semantic and hybrid search (`embsearch`). Search is lexical-only. | 12.4 |
148
+ | `/loop`, `/goal` autonomous loop, cron/scheduler | 12.5 |
149
+ | Warm subagent pool (`--warm-subagents`) | 12.6 |
150
+ | HTML export and `/share`, `/learn`, canvas, `--team`, voice, telemetry, version check | 12.7 |
151
+
152
+ Known parity gaps: tasks 10.2a/b/c/d/f/g, 10.4c and 10.5 pass Level 1 but not Level 2. The
153
+ default-bundle system prompt in hoocode also advertises the SearchHooCode self-knowledge tool
154
+ from 12.4, so model requests differ in that one block.
155
+
156
+ The plan and its rationale are in
157
+ [`docs/design/hoocode-to-cortexcode-migration.md`](docs/design/hoocode-to-cortexcode-migration.md)
158
+ (§0 status, §9 phases), and the handoff log is in `migration/PROGRESS.md`. To resume, take a
159
+ deferred task out of `deferred` and say "continue migration" (see `CLAUDE.md`).
160
+
161
+ ## Quick start
162
+
163
+ ```bash
164
+ cargo install --path crates/cortexcode-code-main --bin cortex # puts `cortex` on PATH
165
+ export ANTHROPIC_API_KEY=... # or any provider key from `cortex --help`, or /login
166
+ cortex # interactive TUI
167
+ cortex -p "Summarize this repo" # one-shot
168
+ ```
169
+
170
+ - Config, auth, sessions and settings live in `~/.cortexcode/agent` (override with
171
+ `CORTEX_CODING_AGENT_DIR`). Project overrides go in `./.cortexcode/`.
172
+ - The settings, `models.json`, `auth.json`, session JSONL and `hoo-config.json` formats match
173
+ hoocode's, so an existing hoocode setup can be copied over.
174
+
175
+ ## Publishing
176
+
177
+ Publishing is driven from GitHub Actions:
178
+
179
+ - `Reserve crates.io names` — one-off workflow that publishes `0.0.1` placeholder crates.
180
+ - `Release` — bump, build, publish, and create a GitHub release.
181
+ - `Merge Release` — auto-releases PRs labeled `rust:patch`, `rust:minor`, or `rust:major`.
182
+ - `Build binaries` — cross-compiles the `cortex` binary for Linux, macOS (Intel/Apple Silicon), and Windows.
183
+
184
+ Crates marked with `[package.metadata.cortex] publish = true` are included in automated releases.
package/bin/hoocode.js ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+ // Runs the native hoocode binary from the platform package npm/bun installed
3
+ // alongside this one (an optionalDependency picked by os/cpu). No postinstall.
4
+
5
+ "use strict";
6
+
7
+ const { spawnSync } = require("node:child_process");
8
+
9
+ const PLATFORMS = {
10
+ "darwin-arm64": "@kolisachint/hoocode-darwin-arm64",
11
+ "darwin-x64": "@kolisachint/hoocode-darwin-x64",
12
+ "linux-arm64": "@kolisachint/hoocode-linux-arm64",
13
+ "linux-x64": "@kolisachint/hoocode-linux-x64",
14
+ };
15
+
16
+ const key = `${process.platform}-${process.arch}`;
17
+ const pkg = PLATFORMS[key];
18
+ if (!pkg) {
19
+ console.error(`hoocode: no prebuilt binary for ${key}.`);
20
+ console.error("Supported: macOS and Linux on x64 and arm64.");
21
+ process.exit(1);
22
+ }
23
+
24
+ let bin;
25
+ try {
26
+ bin = require.resolve(`${pkg}/bin/hoocode`);
27
+ } catch {
28
+ console.error(`hoocode: the platform package ${pkg} is not installed.`);
29
+ console.error("It is an optional dependency; reinstall without --no-optional / --omit=optional:");
30
+ console.error(" npm install -g @kolisachint/hoocode");
31
+ process.exit(1);
32
+ }
33
+
34
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
35
+ if (result.error) {
36
+ console.error(`hoocode: could not start ${bin}: ${result.error.message}`);
37
+ process.exit(1);
38
+ }
39
+ if (result.signal) {
40
+ process.kill(process.pid, result.signal);
41
+ }
42
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,27 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "HooCode, the terminal coding agent (Rust build)",
5
+ "bin": {
6
+ "hoocode": "bin/hoocode.js",
7
+ "hoo": "bin/hoocode.js"
8
+ },
9
+ "files": [
10
+ "bin/hoocode.js"
11
+ ],
12
+ "engines": {
13
+ "node": ">=18"
14
+ },
15
+ "optionalDependencies": {
16
+ "@kolisachint/hoocode-darwin-arm64": "0.1.0",
17
+ "@kolisachint/hoocode-darwin-x64": "0.1.0",
18
+ "@kolisachint/hoocode-linux-arm64": "0.1.0",
19
+ "@kolisachint/hoocode-linux-x64": "0.1.0"
20
+ },
21
+ "license": "MIT",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/kolisachint/hoocode.git"
25
+ },
26
+ "homepage": "https://kolisachint.github.io/hoocode/"
27
+ }