headlesscode 1.0.2
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/ATTRIBUTION.md +53 -0
- package/CODE_OF_CONDUCT.md +130 -0
- package/CONTRIBUTING.md +107 -0
- package/LICENSE +202 -0
- package/README.md +486 -0
- package/SECURITY.md +211 -0
- package/bin/headlesscode.mjs +83 -0
- package/package.json +63 -0
- package/shared/prompts/review-mode-prompt-short.md +93 -0
- package/shared/prompts/review-mode-prompt.md +281 -0
- package/shared/rules-code/rules.md +22 -0
- package/shared/stacks/cpp/rules.md +30 -0
- package/shared/stacks/fastapi/rules.md +30 -0
- package/shared/stacks/javascript/rules.md +37 -0
- package/shared/stacks/postgresql/rules.md +31 -0
- package/shared/stacks/python/rules.md +35 -0
- package/shared/stacks/react/rules.md +11 -0
- package/shared/stacks/typescript/rules.md +10 -0
- package/src/budget/budget.ts +221 -0
- package/src/budget/concurrency.ts +126 -0
- package/src/budget/cost.ts +309 -0
- package/src/budget/index.ts +8 -0
- package/src/checkpoints/cli.ts +256 -0
- package/src/checkpoints/service.ts +227 -0
- package/src/cli.ts +1535 -0
- package/src/cloud/docker-provider.ts +334 -0
- package/src/cloud/provider.ts +300 -0
- package/src/codeintel/call-graph.ts +78 -0
- package/src/codeintel/find-references.ts +123 -0
- package/src/codeintel/go-to-definition.ts +193 -0
- package/src/codeintel/handlers.ts +190 -0
- package/src/codeintel/import-graph.ts +173 -0
- package/src/codeintel/outline.ts +180 -0
- package/src/codeintel/position.ts +77 -0
- package/src/codeintel/program.ts +350 -0
- package/src/codeintel/rename-symbol.ts +213 -0
- package/src/codeintel/tools.ts +280 -0
- package/src/codemap/build.ts +135 -0
- package/src/codemap/cli.ts +190 -0
- package/src/codemap/extract.ts +339 -0
- package/src/codemap/files.ts +236 -0
- package/src/codemap/fingerprint.ts +65 -0
- package/src/codemap/flows.ts +62 -0
- package/src/codemap/html.ts +451 -0
- package/src/codemap/lock.ts +80 -0
- package/src/codemap/types.ts +101 -0
- package/src/codesearch/airunner-embedder.ts +185 -0
- package/src/codesearch/chunk.ts +339 -0
- package/src/codesearch/cli.ts +223 -0
- package/src/codesearch/embedder.ts +332 -0
- package/src/codesearch/files.ts +280 -0
- package/src/codesearch/index.ts +469 -0
- package/src/codesearch/ollama-embedder.ts +205 -0
- package/src/codesearch/search.ts +141 -0
- package/src/codesearch/types.ts +100 -0
- package/src/config/mode-models.ts +218 -0
- package/src/dashboard/aggregate.ts +364 -0
- package/src/dashboard/chat-thread.ts +141 -0
- package/src/dashboard/checkpoints.ts +124 -0
- package/src/dashboard/cli.ts +193 -0
- package/src/dashboard/codemap.ts +44 -0
- package/src/dashboard/files.ts +121 -0
- package/src/dashboard/page.ts +2803 -0
- package/src/dashboard/self-improvement-metrics.ts +282 -0
- package/src/dashboard/server.ts +1103 -0
- package/src/dashboard/session-launch.ts +310 -0
- package/src/dashboard/timeline.ts +273 -0
- package/src/dashboard/tool-exec.ts +107 -0
- package/src/dashboard/trend-cli.ts +141 -0
- package/src/dashboard/trend.ts +413 -0
- package/src/decision-proxy/cli.ts +261 -0
- package/src/decision-proxy/proxy.ts +569 -0
- package/src/deploy/gate-cli.ts +147 -0
- package/src/deploy/gate.ts +254 -0
- package/src/engine/condense.ts +512 -0
- package/src/engine/events.ts +428 -0
- package/src/engine/handoff.ts +71 -0
- package/src/engine/lazy-tools.ts +160 -0
- package/src/engine/local-explore.ts +653 -0
- package/src/engine/logger.ts +96 -0
- package/src/engine/loop.ts +5517 -0
- package/src/engine/parser.ts +347 -0
- package/src/engine/prompt.ts +860 -0
- package/src/engine/reports.ts +47 -0
- package/src/engine/stacks.ts +448 -0
- package/src/engine/types.ts +291 -0
- package/src/engine/usage.ts +186 -0
- package/src/github/app-auth.ts +161 -0
- package/src/github/cli.ts +448 -0
- package/src/github/installations.ts +133 -0
- package/src/github/pr.ts +321 -0
- package/src/github/provision.ts +118 -0
- package/src/github/push.ts +122 -0
- package/src/index-util.ts +50 -0
- package/src/index.ts +81 -0
- package/src/init/cli.ts +248 -0
- package/src/init/gitignore.ts +74 -0
- package/src/llm/ollama.ts +308 -0
- package/src/llm/openrouter.ts +868 -0
- package/src/llm/preflight.ts +367 -0
- package/src/llm/transcript-capture.ts +84 -0
- package/src/memory/embed.ts +110 -0
- package/src/memory/index.ts +22 -0
- package/src/memory/local.ts +259 -0
- package/src/memory/summarizer.ts +283 -0
- package/src/memory/types.ts +153 -0
- package/src/memory/uwuchat.ts +157 -0
- package/src/migrate/cli.ts +115 -0
- package/src/orchestrator/analyze-cli.ts +104 -0
- package/src/orchestrator/auto-split.ts +206 -0
- package/src/orchestrator/cleanup.ts +1003 -0
- package/src/orchestrator/cli.ts +3571 -0
- package/src/orchestrator/cost-estimate.ts +564 -0
- package/src/orchestrator/cost-history-cli.ts +242 -0
- package/src/orchestrator/cost-history.ts +397 -0
- package/src/orchestrator/git-sync.ts +250 -0
- package/src/orchestrator/index.ts +153 -0
- package/src/orchestrator/log-analysis.ts +0 -0
- package/src/orchestrator/merge-check.ts +108 -0
- package/src/orchestrator/pipeline.ts +411 -0
- package/src/orchestrator/resume.ts +1940 -0
- package/src/orchestrator/reviewer.ts +503 -0
- package/src/orchestrator/split.ts +296 -0
- package/src/orchestrator/state.ts +542 -0
- package/src/orchestrator/status.ts +697 -0
- package/src/orchestrator/verification-gate.ts +134 -0
- package/src/orchestrator/watch.ts +898 -0
- package/src/permissions/commands.ts +1083 -0
- package/src/permissions/config.ts +241 -0
- package/src/permissions/index.ts +12 -0
- package/src/permissions/protected-files.ts +96 -0
- package/src/permissions/store-protection.ts +272 -0
- package/src/project-store.ts +648 -0
- package/src/projects/cli.ts +382 -0
- package/src/qa/qa.ts +487 -0
- package/src/tools/browser/handler.ts +346 -0
- package/src/tools/browser/service.ts +406 -0
- package/src/tools/browser/smoke.ts +78 -0
- package/src/tools/browser/tool.ts +99 -0
- package/src/tools/executor.ts +2575 -0
- package/src/tools/language-detect.ts +183 -0
- package/src/tools/output-summarizer.ts +369 -0
- package/src/tools/run-tests.ts +302 -0
- package/src/tools/set-indentation-tool.ts +49 -0
- package/src/tools/test-selection.ts +160 -0
- package/src/vendor/tests/smoke.ts +103 -0
- package/src/vendor/zoo-code/VENDOR-NOTES.md +213 -0
- package/src/vendor/zoo-code/shim/anthropic.ts +71 -0
- package/src/vendor/zoo-code/shim/openai.d.ts +60 -0
- package/src/vendor/zoo-code/shim/os-name.ts +18 -0
- package/src/vendor/zoo-code/shim/strip-bom.ts +14 -0
- package/src/vendor/zoo-code/shim/vscode.ts +76 -0
- package/src/vendor/zoo-code/src/core/config/CustomModesManager.ts +1015 -0
- package/src/vendor/zoo-code/src/core/diff/strategies/multi-search-replace.ts +670 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/capabilities.ts +46 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/custom-instructions.ts +559 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/index.ts +10 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/markdown-formatting.ts +7 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/modes.ts +35 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/objective.ts +13 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/rules.ts +95 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/skills.ts +105 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/system-info.ts +30 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/tool-use-guidelines.ts +9 -0
- package/src/vendor/zoo-code/src/core/prompts/sections/tool-use.ts +7 -0
- package/src/vendor/zoo-code/src/core/prompts/system.ts +176 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/access_mcp_resource.ts +41 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/apply_diff.ts +40 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/apply_patch.ts +61 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/ask_followup_question.ts +62 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/attempt_completion.ts +33 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/codebase_search.ts +43 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/converters.ts +109 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/edit.ts +48 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/edit_file.ts +72 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/execute_command.ts +54 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/generate_image.ts +51 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/index.ts +75 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/list_files.ts +41 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/mcp_server.ts +75 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/new_task.ts +39 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/read_command_output.ts +81 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/read_file.ts +169 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/run_slash_command.ts +31 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/search_files.ts +50 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/search_replace.ts +51 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/skill.ts +33 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/switch_mode.ts +31 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/update_todo_list.ts +54 -0
- package/src/vendor/zoo-code/src/core/prompts/tools/native-tools/write_to_file.ts +40 -0
- package/src/vendor/zoo-code/src/core/prompts/types.ts +12 -0
- package/src/vendor/zoo-code/src/i18n/index.ts +19 -0
- package/src/vendor/zoo-code/src/integrations/misc/extract-text.ts +81 -0
- package/src/vendor/zoo-code/src/services/checkpoints/RepoPerTaskCheckpointService.ts +15 -0
- package/src/vendor/zoo-code/src/services/checkpoints/ShadowCheckpointService.ts +553 -0
- package/src/vendor/zoo-code/src/services/checkpoints/excludes.ts +212 -0
- package/src/vendor/zoo-code/src/services/checkpoints/index.ts +3 -0
- package/src/vendor/zoo-code/src/services/checkpoints/types.ts +35 -0
- package/src/vendor/zoo-code/src/services/code-index/manager.ts +19 -0
- package/src/vendor/zoo-code/src/services/mcp/McpHub.ts +36 -0
- package/src/vendor/zoo-code/src/services/roo-config/index.ts +441 -0
- package/src/vendor/zoo-code/src/services/search/file-search.ts +143 -0
- package/src/vendor/zoo-code/src/services/skills/SkillsManager.ts +20 -0
- package/src/vendor/zoo-code/src/shared/globalFileNames.ts +9 -0
- package/src/vendor/zoo-code/src/shared/language.ts +43 -0
- package/src/vendor/zoo-code/src/shared/modes.ts +257 -0
- package/src/vendor/zoo-code/src/shared/tools.ts +385 -0
- package/src/vendor/zoo-code/src/utils/fs.ts +39 -0
- package/src/vendor/zoo-code/src/utils/globalContext.ts +22 -0
- package/src/vendor/zoo-code/src/utils/json-schema.ts +16 -0
- package/src/vendor/zoo-code/src/utils/logging.ts +21 -0
- package/src/vendor/zoo-code/src/utils/mcp-name.ts +190 -0
- package/src/vendor/zoo-code/src/utils/object.ts +18 -0
- package/src/vendor/zoo-code/src/utils/path.ts +94 -0
- package/src/vendor/zoo-code/src/utils/shell.ts +376 -0
- package/src/vendor/zoo-code/src/utils/text-normalization.ts +99 -0
- package/src/vendor/zoo-code/types/global-settings.ts +19 -0
- package/src/vendor/zoo-code/types/index.ts +22 -0
- package/src/vendor/zoo-code/types/message.ts +375 -0
- package/src/vendor/zoo-code/types/mode.ts +241 -0
- package/src/vendor/zoo-code/types/todo.ts +19 -0
- package/src/vendor/zoo-code/types/tool-params.ts +116 -0
- package/src/vendor/zoo-code/types/tool.ts +67 -0
- package/src/vendor/zoo-code/types/vscode.ts +84 -0
- package/src/vision/describe.ts +242 -0
- package/src/vision/tool.ts +91 -0
- package/src/watcher/cli.ts +369 -0
- package/src/watcher/github.ts +304 -0
- package/src/watcher/index.ts +59 -0
- package/src/watcher/state.ts +254 -0
- package/src/watcher/watch.ts +562 -0
- package/tsconfig.json +18 -0
package/ATTRIBUTION.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# ATTRIBUTION
|
|
2
|
+
|
|
3
|
+
The following material in this repository is derived from
|
|
4
|
+
**[Zoo Code](https://github.com/Zoo-Code-Org/Zoo-Code)** —
|
|
5
|
+
`Zoo-Code-Org/Zoo-Code`, a Roo Code fork — and is used under the
|
|
6
|
+
**Apache License, Version 2.0**:
|
|
7
|
+
|
|
8
|
+
- **Prompt text** — the system prompt builder
|
|
9
|
+
(`src/vendor/zoo-code/src/core/prompts/system.ts`) and every prompt section
|
|
10
|
+
under `src/vendor/zoo-code/src/core/prompts/sections/` (TOOL USE, RULES,
|
|
11
|
+
OBJECTIVE, CAPABILITIES, MODES, SYSTEM INFORMATION, USER'S CUSTOM
|
|
12
|
+
INSTRUCTIONS, etc.), plus the built-in mode role definitions in
|
|
13
|
+
`src/vendor/zoo-code/types/mode.ts`.
|
|
14
|
+
- **Tool schemas** — the OpenAI `ChatCompletionTool` JSON schema definitions in
|
|
15
|
+
`src/vendor/zoo-code/src/core/prompts/tools/native-tools/` (21 tools) and the
|
|
16
|
+
OpenAI ↔ Anthropic converters (`converters.ts`).
|
|
17
|
+
- **Mode/rules loading logic** — `.roomodes` parsing/merging
|
|
18
|
+
(`src/vendor/zoo-code/src/core/config/CustomModesManager.ts`),
|
|
19
|
+
`.roo/rules-<slug>/`, `.roo/rules/`, and `AGENTS.md` splicing
|
|
20
|
+
(`src/vendor/zoo-code/src/core/prompts/sections/custom-instructions.ts`),
|
|
21
|
+
and the `.roo` directory discovery service
|
|
22
|
+
(`src/vendor/zoo-code/src/services/roo-config/`).
|
|
23
|
+
- **Types and constants** — `ModeConfig`/`DEFAULT_MODES` and the tool/group
|
|
24
|
+
type definitions under `src/vendor/zoo-code/types/`.
|
|
25
|
+
- **Checkpoints** — the shadow-git auto-commit mechanism
|
|
26
|
+
(`src/vendor/zoo-code/src/services/checkpoints/ShadowCheckpointService.ts`,
|
|
27
|
+
`RepoPerTaskCheckpointService.ts`, `types.ts`, `excludes.ts`, `index.ts`),
|
|
28
|
+
which snapshots the workspace into a hidden git repo (via `simple-git`)
|
|
29
|
+
after every tool-executing turn so edits can be reverted; see
|
|
30
|
+
`docs/checkpoints.md`.
|
|
31
|
+
- **Diff-based editing** — the multi-search-replace fuzzy diff engine
|
|
32
|
+
(`src/vendor/zoo-code/src/core/diff/strategies/multi-search-replace.ts`,
|
|
33
|
+
a verbatim copy of `zoo-code/src/core/diff/strategies/multi-search-replace.ts`),
|
|
34
|
+
plus its pure helpers `zoo-code/src/utils/text-normalization.ts` and the
|
|
35
|
+
line-number helpers extracted from
|
|
36
|
+
`zoo-code/src/integrations/misc/extract-text.ts`, and the
|
|
37
|
+
`DEFAULT_DIFF_FUZZY_THRESHOLD` constant from
|
|
38
|
+
`zoo-code/packages/types/src/global-settings.ts`. These back the headless
|
|
39
|
+
harness's `apply_diff` tool (the tool schemas for `apply_diff` /
|
|
40
|
+
`search_replace` / `edit_file` were already vendored under
|
|
41
|
+
`src/vendor/zoo-code/src/core/prompts/tools/native-tools/`).
|
|
42
|
+
|
|
43
|
+
Source: **https://github.com/Zoo-Code-Org/Zoo-Code**
|
|
44
|
+
License: **Apache-2.0** · Copyright **2026 Zoo Code**.
|
|
45
|
+
Inspection commit: `ca9b60fbc7b72a27352b0e2084271c28f2419f94`.
|
|
46
|
+
|
|
47
|
+
A verbatim copy of the Apache License 2.0 is provided in
|
|
48
|
+
[`LICENSE`](./LICENSE). The full inventory of vendored files, local shims, and
|
|
49
|
+
excluded files is in
|
|
50
|
+
[`src/vendor/zoo-code/VENDOR-NOTES.md`](./src/vendor/zoo-code/VENDOR-NOTES.md).
|
|
51
|
+
|
|
52
|
+
This notice is provided in addition to — and does not modify — the terms of the
|
|
53
|
+
Apache License 2.0.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic
|
|
9
|
+
status, nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
- Demonstrating empathy and kindness toward other people
|
|
21
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
- Giving and gracefully accepting constructive feedback
|
|
23
|
+
- Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
- Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
- The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
- Trolling, insulting or derogatory comments, and personal or political
|
|
33
|
+
attacks
|
|
34
|
+
- Public or private harassment
|
|
35
|
+
- Publishing others' private information, such as a physical or email
|
|
36
|
+
address, without their explicit permission
|
|
37
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
38
|
+
professional setting
|
|
39
|
+
|
|
40
|
+
## Enforcement Responsibilities
|
|
41
|
+
|
|
42
|
+
Community leaders are responsible for clarifying and enforcing our standards
|
|
43
|
+
of acceptable behavior and will take appropriate and fair corrective action in
|
|
44
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
45
|
+
or harmful.
|
|
46
|
+
|
|
47
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
48
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
49
|
+
not aligned to this Code of Conduct, and will communicate reasons for
|
|
50
|
+
moderation decisions when appropriate.
|
|
51
|
+
|
|
52
|
+
## Scope
|
|
53
|
+
|
|
54
|
+
This Code of Conduct applies within all community spaces, and also applies
|
|
55
|
+
when an individual is officially representing the community in public spaces.
|
|
56
|
+
Examples of representing our community include using an official e-mail
|
|
57
|
+
address, posting via an official social media account, or acting as an
|
|
58
|
+
appointed representative at an online or offline event.
|
|
59
|
+
|
|
60
|
+
## Enforcement
|
|
61
|
+
|
|
62
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
63
|
+
reported to the community leaders responsible for enforcement at the
|
|
64
|
+
repository maintainers (reachable via the email address on the
|
|
65
|
+
[Capsize-Games/headlesscode](https://github.com/Capsize-Games/headlesscode)
|
|
66
|
+
repository profile). All complaints will be reviewed and investigated promptly
|
|
67
|
+
and fairly.
|
|
68
|
+
|
|
69
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
70
|
+
reporter of any incident.
|
|
71
|
+
|
|
72
|
+
## Enforcement Guidelines
|
|
73
|
+
|
|
74
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
75
|
+
the consequences for any action they deem in violation of this Code of
|
|
76
|
+
Conduct:
|
|
77
|
+
|
|
78
|
+
### 1. Correction
|
|
79
|
+
|
|
80
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
81
|
+
unprofessional or unwelcome in the community.
|
|
82
|
+
|
|
83
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
84
|
+
clarity around the nature of the violation and an explanation of why the
|
|
85
|
+
behavior was inappropriate. A public apology may be requested.
|
|
86
|
+
|
|
87
|
+
### 2. Warning
|
|
88
|
+
|
|
89
|
+
**Community Impact**: A violation through a single incident or series of
|
|
90
|
+
actions.
|
|
91
|
+
|
|
92
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
93
|
+
interaction with the people involved, including unsolicited interaction with
|
|
94
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
95
|
+
includes avoiding interactions in community spaces as well as external
|
|
96
|
+
channels like social media. Violating these terms may lead to a temporary or
|
|
97
|
+
permanent ban.
|
|
98
|
+
|
|
99
|
+
### 3. Temporary Ban
|
|
100
|
+
|
|
101
|
+
**Community Impact**: A serious violation of community standards, including
|
|
102
|
+
sustained inappropriate behavior.
|
|
103
|
+
|
|
104
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
105
|
+
communication with the community for a specified period of time. No public or
|
|
106
|
+
private interaction with the people involved, including unsolicited
|
|
107
|
+
interaction with those enforcing the Code of Conduct, is allowed during this
|
|
108
|
+
period. Violating these terms may lead to a permanent ban.
|
|
109
|
+
|
|
110
|
+
### 4. Permanent Ban
|
|
111
|
+
|
|
112
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
113
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
114
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
115
|
+
|
|
116
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
117
|
+
the community.
|
|
118
|
+
|
|
119
|
+
## Attribution
|
|
120
|
+
|
|
121
|
+
This Code of Conduct is adapted from the
|
|
122
|
+
[Contributor Covenant](https://www.contributor-covenant.org), version 2.1,
|
|
123
|
+
available at
|
|
124
|
+
<https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
|
|
125
|
+
|
|
126
|
+
Community Impact Guidelines were inspired by
|
|
127
|
+
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
|
128
|
+
|
|
129
|
+
For answers to common questions about this Code of Conduct, see the FAQ at
|
|
130
|
+
<https://www.contributor-covenant.org/faq>.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Contributing to headlesscode
|
|
2
|
+
|
|
3
|
+
Thanks for contributing! This file covers how this repository is set up, how
|
|
4
|
+
to run the verification bar, and what a merge-ready change looks like.
|
|
5
|
+
|
|
6
|
+
## What this project is
|
|
7
|
+
|
|
8
|
+
`headlesscode` is a standalone Node/TypeScript CLI that runs a headless
|
|
9
|
+
coding-agent loop, ported from a VS Code extension (vendored verbatim under
|
|
10
|
+
`src/vendor/zoo-code/`, Apache-2.0 — see `ATTRIBUTION.md`). There is **no
|
|
11
|
+
build step**: everything runs directly via `tsx`. Read the docs in `docs/`
|
|
12
|
+
before diving into a subsystem.
|
|
13
|
+
|
|
14
|
+
## Security first
|
|
15
|
+
|
|
16
|
+
This agent **executes arbitrary shell commands as the invoking user** — that
|
|
17
|
+
is its core function. Read [`SECURITY.md`](./SECURITY.md) before running it
|
|
18
|
+
unattended or pointing it at untrusted repositories, and never weaken the
|
|
19
|
+
permission layer without a very explicit reason. If you are adding a feature
|
|
20
|
+
that executes commands or reads secrets, think about the least-privilege
|
|
21
|
+
story as part of the design, not after.
|
|
22
|
+
|
|
23
|
+
## Setup
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install # tsx + typescript + deps; no build step needed
|
|
27
|
+
npm test # full suite (see "Test conventions" below)
|
|
28
|
+
npm run typecheck # npx tsc --noEmit
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`node >= 18` is required (see `engines` in `package.json`).
|
|
32
|
+
|
|
33
|
+
**Optional: the `browser_action` tool's tests.** `src/tools/__tests__/browser-action.test.ts`
|
|
34
|
+
launches a real headless Chromium via Playwright. `npm install` only installs
|
|
35
|
+
the `playwright` npm package, not the browser binary itself — run
|
|
36
|
+
`npx playwright install chromium` once to enable those tests. Without it, the
|
|
37
|
+
suite detects the missing binary, prints a clear skip message, and exits 0
|
|
38
|
+
(this is treated as an environment gap, not a test failure — the rest of
|
|
39
|
+
`npm test` still runs and still gates your change).
|
|
40
|
+
|
|
41
|
+
## Test conventions
|
|
42
|
+
|
|
43
|
+
- **No test framework.** The project deliberately uses no jest/mocha/vitest.
|
|
44
|
+
Tests are plain `.test.ts` files run directly via `tsx` with hand-rolled
|
|
45
|
+
assertions, and the file ends with an `All N tests passed` trailer line.
|
|
46
|
+
Look at any existing file under `src/*/__tests__/` for the exact style
|
|
47
|
+
before writing a new one.
|
|
48
|
+
- **Discovery is automatic.** `npm test` runs `scripts/run-tests.mjs`, which
|
|
49
|
+
globs every `*.test.ts` under `src/` (plus a short explicit list of
|
|
50
|
+
non-test-suffixed check scripts) and runs them sequentially, fail-fast. A
|
|
51
|
+
new test file needs **zero** edits outside the file itself — do not add it
|
|
52
|
+
to `package.json` by hand.
|
|
53
|
+
- **Verification bar for any change to `src/`:**
|
|
54
|
+
1. `npx tsc --noEmit` is clean (respect the strictness `tsconfig.json`
|
|
55
|
+
actually configures — no `any`, `@ts-ignore`, or `!` escapes).
|
|
56
|
+
2. `npm test` passes in full. A targeted run (`npm test -- <substring>` or
|
|
57
|
+
`npx tsx <test-file>`) is fine while iterating, but the full suite is
|
|
58
|
+
the gate.
|
|
59
|
+
- **Orchestrator / watcher / spawn / worker changes** also re-run the
|
|
60
|
+
relevant suites under `scripts/e2e*/run.sh` — these exercise real
|
|
61
|
+
spawn/watch/review flows against a local mock LLM server, not just
|
|
62
|
+
unit-level logic.
|
|
63
|
+
|
|
64
|
+
## Repository conventions
|
|
65
|
+
|
|
66
|
+
- **No new runtime dependencies without a real reason.** The project
|
|
67
|
+
deliberately avoids frameworks and schema libraries for its own
|
|
68
|
+
state/JSON handling (plain `node:fs`/`node:http`, loose JSON validation).
|
|
69
|
+
Prefer the smallest dependency footprint that does the job; ask in the
|
|
70
|
+
issue/PR if you think a dependency is genuinely warranted.
|
|
71
|
+
- **Non-fatal failure pattern for auxiliary subsystems.** Memory recording,
|
|
72
|
+
checkpoint saving, and usage/cost recording all follow the same idiom:
|
|
73
|
+
wrap in try/catch, log a warning via the session's logger, and never let a
|
|
74
|
+
failure in an auxiliary subsystem abort or corrupt the coding session.
|
|
75
|
+
Match that pattern when adding a new auxiliary write path.
|
|
76
|
+
- **Vendoring convention.** Code ported from the upstream VS Code extension
|
|
77
|
+
lives under `src/vendor/zoo-code/`, copied verbatim wherever practical,
|
|
78
|
+
with a corresponding entry in `ATTRIBUTION.md`. VS Code API calls the
|
|
79
|
+
vendored code makes are satisfied by no-op shims under
|
|
80
|
+
`src/vendor/zoo-code/shim/`, wired via `tsconfig.json`'s `paths` — check
|
|
81
|
+
there before assuming something needs a new shim.
|
|
82
|
+
- **Comments are minimal.** Only when the WHY is genuinely non-obvious.
|
|
83
|
+
- **Docs vs. plans.** `docs/*.md` describes how a shipped subsystem works.
|
|
84
|
+
`plans/*.md` are standalone work orders for an external agent to execute —
|
|
85
|
+
each must be fully self-contained and must not reference internal-only
|
|
86
|
+
planning artifacts.
|
|
87
|
+
- **Plan docs cite verified locations.** Every code reference in a
|
|
88
|
+
`plans/*.md` doc must include the real file path AND line
|
|
89
|
+
number/range (e.g. `src/checkpoints/cli.ts:12-30`), verified by actually
|
|
90
|
+
reading or grepping the file at writing time — never recalled from memory.
|
|
91
|
+
|
|
92
|
+
## Working with issues
|
|
93
|
+
|
|
94
|
+
- This repo is developed primarily through **headless workers in parallel git
|
|
95
|
+
worktrees** (see `scripts/spawn-parallel-worktrees.sh`). If you're
|
|
96
|
+
submitting a PR the normal way, the same conventions apply: one logical
|
|
97
|
+
change per commit, reference the issue number in the commit message and PR
|
|
98
|
+
body.
|
|
99
|
+
- **Commit before you're done.** Real, working changes should be committed in
|
|
100
|
+
logical units; a PR is a series of reviewed, individually sensible commits,
|
|
101
|
+
not one giant diff.
|
|
102
|
+
|
|
103
|
+
## Code of conduct
|
|
104
|
+
|
|
105
|
+
All contributors and maintainers are expected to follow our
|
|
106
|
+
[Code of Conduct](./CODE_OF_CONDUCT.md). Be respectful, be constructive, and
|
|
107
|
+
assume good faith — this project is small and every contribution matters.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Zoo Code.
|
|
190
|
+
Copyright 2026 Capsize Games, Inc. and the headlesscode contributors.
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|