capix-code 1.3.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 +203 -0
- package/README.md +131 -0
- package/bin/capix-code.cjs +57 -0
- package/dist/customer/config/capix-defaults.json +22 -0
- package/dist/customer/config/defaults.json +248 -0
- package/package.json +79 -0
- package/scripts/assert-artifact.sh +30 -0
- package/scripts/assert-customer-brand.sh +54 -0
- package/scripts/assert-upstream-brand.sh +46 -0
- package/scripts/bootstrap.sh +38 -0
- package/scripts/build-manifest.mjs +219 -0
- package/scripts/build.sh +74 -0
- package/scripts/checksum.sh +8 -0
- package/scripts/dev-install.sh +30 -0
- package/scripts/dev.sh +35 -0
- package/scripts/install-config.sh +66 -0
- package/scripts/install.sh +115 -0
- package/scripts/package-customer.sh +28 -0
- package/scripts/package.sh +84 -0
- package/scripts/postinstall.js +33 -0
- package/scripts/prepare-npm-meta.mjs +12 -0
- package/scripts/prepare-npm-platform.mjs +59 -0
- package/scripts/rebrand.sh +159 -0
- package/scripts/resolve-version.mjs +126 -0
- package/scripts/validate-manifest.mjs +167 -0
- package/scripts/verify-runtime-provider.ts +9 -0
- package/scripts/write-release-entry.mjs +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
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 describing the origin of the Work and
|
|
141
|
+
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 apply, at Your option,
|
|
167
|
+
the terms of this License or an alternative license of Your choice,
|
|
168
|
+
provided that the terms and conditions for the use, redistribution,
|
|
169
|
+
and/or distribution of the Work, Derivative Works thereof, or
|
|
170
|
+
Derivative Works in Object form differ from or supplement the terms
|
|
171
|
+
of this License. If You apply a different license to the Work or
|
|
172
|
+
Derivative Works thereof, You must include in the applicable
|
|
173
|
+
LICENSE file or in the applicable attribution notices (whether in
|
|
174
|
+
the Source or Object form) a copy of the's terms, conditions, and
|
|
175
|
+
limitations that apply to the use of the Work or Derivative Works
|
|
176
|
+
thereof in addition to or instead of those imposed by this License.
|
|
177
|
+
|
|
178
|
+
END OF TERMS AND CONDITIONS
|
|
179
|
+
|
|
180
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
+
|
|
182
|
+
To apply the Apache License to your work, attach the following
|
|
183
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
+
replaced with your own identifying information. (Don't include
|
|
185
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
+
comment syntax for the file format. We also recommend that a
|
|
187
|
+
file or class name and description of purpose be included on the
|
|
188
|
+
same "printed page" as the copyright notice for easier
|
|
189
|
+
identification within third-party archives.
|
|
190
|
+
|
|
191
|
+
Copyright 2026 Capix
|
|
192
|
+
|
|
193
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
you may not use this file except in compliance with the License.
|
|
195
|
+
You may obtain a copy of the License at
|
|
196
|
+
|
|
197
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
|
|
199
|
+
Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
See the License for the specific language governing permissions and
|
|
203
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Capix Code
|
|
2
|
+
|
|
3
|
+
Capix Code is an AI coding agent with the Capix provider pre-configured as the default, adding a Smart Router plugin, brand theming, and Capix network integration. Bundled inside Capix IDE, or installable standalone.
|
|
4
|
+
|
|
5
|
+
## About
|
|
6
|
+
|
|
7
|
+
Capix Code is a complete AI coding agent built on TypeScript/Bun (~640 lines of original TypeScript for the Smart Router plugin, plus configuration, theming, and build scripts). It ships with:
|
|
8
|
+
|
|
9
|
+
- **Capix branding** — the TUI shows the Capix ASCII art banner on launch with brand colors (neon teal `#3DCED6`, green `#14F195`), the Capix brand mark logo, and a full TUI color theme using the brand palette (deep slate-navy canvas, teal accents, green success states)
|
|
10
|
+
- **Built-in Capix provider** — the native Capix runtime provider is the default and routes authenticated requests through the canonical Capix inference gateway. No manual API configuration is needed.
|
|
11
|
+
- **Smart Route (auto mode)** — when using `capix/auto` (the default), a mini-AI classifier analyzes each request and routes it to the best model for the task: a strong reasoning model (Llama 3.3 70B, Gemma 3 27B) for planning/analysis, and a strong coding model (Qwen2.5-Coder, CodeGemma) for writing code. The classifier runs on `capix/supergemma-gemma3-4b` via the Capix gateway (~200ms, cached per session) — imperceptible to the user. Results are cached per session so similar consecutive requests skip the classifier entirely.
|
|
12
|
+
- **Capix model catalog** — 8 pre-listed models including auto-routing (cheapest), Gemma 3 variants (27B/12B/4B), CodeGemma 7B, Qwen2.5-Coder 7B/32B, and Llama 3.3 70B
|
|
13
|
+
- **Auto-connect** — Capix IDE sets `CAPIX_BASE_URL` and `CAPIX_API_KEY` env vars in launched terminals from its SecretStorage, so `capix-code` works with zero additional setup
|
|
14
|
+
- **Dev Token rewards** — every commit you make with Capix Code mints DEV tokens to your wallet. Complete a session, deploy, or record a decision → more tokens. On-chain proof of useful development, exchangeable for SOL or CPX in the future.
|
|
15
|
+
- **Covenant governance** — safe defaults: edit/bash actions require approval, autoupdate disabled (IDE manages updates)
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
Use **[INSTALL.md](INSTALL.md)** for exact checksum and installation commands for
|
|
20
|
+
macOS arm64/x64, Linux arm64/x64, and Windows x64. Customer builds are unsigned;
|
|
21
|
+
always compare the archive against its adjacent SHA-256 file before installation.
|
|
22
|
+
|
|
23
|
+
### Bundled in Capix IDE
|
|
24
|
+
|
|
25
|
+
Capix IDE ships `capix-code` in its PATH. When you click "Capix: Launch Capix Code", the IDE opens a terminal with `CAPIX_BASE_URL`, `CAPIX_API_KEY`, and `CAPIX_MODEL` env vars pre-set from your auto-connected LLM endpoint, then runs `capix-code`.
|
|
26
|
+
|
|
27
|
+
## Quick start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
capix-code login
|
|
31
|
+
capix-code doctor
|
|
32
|
+
capix-code llm-run "Reply with exactly: CAPIX_REMOTE_OK"
|
|
33
|
+
capix-code
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Dev Tokens
|
|
37
|
+
|
|
38
|
+
Every time you do verifiable development with Capix Code, DEV tokens are minted to your wallet:
|
|
39
|
+
|
|
40
|
+
| Action | Reward |
|
|
41
|
+
| ----------------------------------------- | ------- |
|
|
42
|
+
| Commit code | +1 DEV |
|
|
43
|
+
| Deploy an app/agent/LLM | +5 DEV |
|
|
44
|
+
| Complete a productive session (50+ turns) | +10 DEV |
|
|
45
|
+
| Record an architectural decision | +2 DEV |
|
|
46
|
+
| Ship a complete product | +50 DEV |
|
|
47
|
+
|
|
48
|
+
Tokens are on-chain proof of useful work (Solana devnet pre-mainnet). In the future, DEV tokens will be exchangeable for SOL or CPX at launch — rewarding developers who built real products with Capix tools.
|
|
49
|
+
|
|
50
|
+
## How it works
|
|
51
|
+
|
|
52
|
+
Capix Code is a complete AI coding agent built on TypeScript/Bun. The `scripts/bootstrap.sh` clones the full source, then `scripts/rebrand.sh` applies:
|
|
53
|
+
|
|
54
|
+
- Binary name: → `capix-code`
|
|
55
|
+
- Config dirs: `~/.config/capix-code/`
|
|
56
|
+
- Env var prefixes: `CAPIX_CODE_`
|
|
57
|
+
- The Capix provider config (`config/defaults.json`) as the bundled default
|
|
58
|
+
- The Capix TUI theme (`themes/capix.toml`) with brand colors
|
|
59
|
+
- The Capix launch banner (`brand/banner.ts`) with ASCII art + ANSI brand colors
|
|
60
|
+
|
|
61
|
+
## Building from source
|
|
62
|
+
|
|
63
|
+
Requires Node.js 20 or newer, Rust stable, and Bun `1.3.14` exactly. Install the
|
|
64
|
+
pinned Bun release before building and confirm its version.
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
curl -fsSL https://bun.sh/install | bash -s "bun-v1.3.14"
|
|
68
|
+
export PATH="$HOME/.bun/bin:$PATH"
|
|
69
|
+
git clone https://github.com/CapIX-Protocol/Capix-Code.git
|
|
70
|
+
cd CapIX-Code
|
|
71
|
+
test "$(bun --version)" = "1.3.14"
|
|
72
|
+
./scripts/bootstrap.sh
|
|
73
|
+
./scripts/rebrand.sh
|
|
74
|
+
BUN_BIN="$(command -v bun)" ./scripts/dev.sh
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
To build a standalone binary:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
BUN_BIN="$(command -v bun)" ./scripts/build.sh
|
|
81
|
+
# verified customer runtime: dist/customer/bin/capix-code
|
|
82
|
+
dist/customer/bin/capix-code --version
|
|
83
|
+
dist/customer/bin/capix-code doctor
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For CI/cross-platform release builds, tag a version:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
git tag v1.2.1
|
|
90
|
+
git push origin v1.2.1
|
|
91
|
+
# The CI release job builds the native launcher binary (ubuntu-latest) and
|
|
92
|
+
# packages a source tarball with SHA-256 checksums and SBOM (UNSIGNED draft).
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Config
|
|
96
|
+
|
|
97
|
+
The default config (`config/defaults.json`) registers:
|
|
98
|
+
|
|
99
|
+
| Setting | Value |
|
|
100
|
+
| ----------------------- | ------------------------------------------------------------------------------- |
|
|
101
|
+
| Provider ID | `capix` (via `@ai-sdk/openai-compatible`) |
|
|
102
|
+
| Base URL | `CAPIX_BASE_URL` env var (defaults to `https://capix.network/api/v1`) |
|
|
103
|
+
| API Key | `CAPIX_API_KEY` env var |
|
|
104
|
+
| Default Model | `CAPIX_MODEL` env var (defaults to `capix/auto` — smart route) |
|
|
105
|
+
| Smart Route: Classifier | `capix/supergemma-gemma3-4b` via Capix gateway (cached per session) |
|
|
106
|
+
| Smart Route: Reasoning | Live catalog (keyword + memory-matched), fallback `capix/supergemma-gemma3-27b` |
|
|
107
|
+
| Smart Route: Coding | Live catalog (keyword + memory-matched), fallback `capix/supergemma-gemma3-4b` |
|
|
108
|
+
| Small Model | `capix/supergemma-gemma3-4b` (for lightweight tasks like titles) |
|
|
109
|
+
| Permission Mode | `edit: ask`, `bash: ask` (safe defaults) |
|
|
110
|
+
| Autoupdate | Disabled (IDE manages updates) |
|
|
111
|
+
|
|
112
|
+
Override anything in `~/.config/capix-code/capix-code.json` or the project-level `capix-code.json`.
|
|
113
|
+
|
|
114
|
+
## Contributing
|
|
115
|
+
|
|
116
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, commit conventions, and PR workflow.
|
|
117
|
+
|
|
118
|
+
## Security
|
|
119
|
+
|
|
120
|
+
If you discover a security vulnerability, please see [SECURITY.md](SECURITY.md) for reporting instructions. **Do not open a public issue.**
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
Licensed under the Apache License, Version 2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE) for details.
|
|
125
|
+
|
|
126
|
+
Copyright 2026 Capix.
|
|
127
|
+
|
|
128
|
+
## Links
|
|
129
|
+
|
|
130
|
+
- **Capix Protocol** — [capix.network](https://capix.network) · [github.com/Ritzky/Capix-Protocol](https://github.com/Ritzky/Capix-Protocol)
|
|
131
|
+
- **Capix IDE** — [github.com/Ritzky/CapIX-IDE](https://github.com/Ritzky/CapIX-IDE)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require('node:child_process');
|
|
4
|
+
const { chmodSync, cpSync, existsSync, mkdirSync } = require('node:fs');
|
|
5
|
+
const { dirname, join } = require('node:path');
|
|
6
|
+
|
|
7
|
+
const platform = process.platform === 'win32' ? 'windows' : process.platform;
|
|
8
|
+
const packageName = `@capix-code/${platform}-${process.arch}`;
|
|
9
|
+
let root;
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
root = join(dirname(require.resolve(`${packageName}/package.json`)), 'customer');
|
|
13
|
+
} catch {
|
|
14
|
+
const developmentRoot = join(__dirname, '..', 'dist', 'customer');
|
|
15
|
+
if (existsSync(developmentRoot)) root = developmentRoot;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (!root) {
|
|
19
|
+
console.error(`Capix Code does not have a runtime for ${process.platform}-${process.arch}.`);
|
|
20
|
+
console.error(`Reinstall capix-code and ensure ${packageName} is available.`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const suffix = process.platform === 'win32' ? '.exe' : '';
|
|
25
|
+
const launcher = join(root, 'bin', `capix-code${suffix}`);
|
|
26
|
+
|
|
27
|
+
if (!existsSync(launcher)) {
|
|
28
|
+
console.error('Capix Code installation is incomplete. Reinstall the package and try again.');
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const runtimeProvider = join(root, 'runtime', 'node_modules', '@capix', 'runtime-provider');
|
|
34
|
+
if (!existsSync(runtimeProvider)) {
|
|
35
|
+
mkdirSync(join(root, 'runtime', 'node_modules', '@capix'), { recursive: true });
|
|
36
|
+
cpSync(join(root, 'runtime', 'packages', 'runtime-provider'), runtimeProvider, {
|
|
37
|
+
recursive: true,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
chmodSync(launcher, 0o755);
|
|
41
|
+
chmodSync(join(root, 'engine', `capix-engine${suffix}`), 0o755);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error(`Capix Code could not prepare its native runtime: ${error.message}`);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const result = spawnSync(launcher, process.argv.slice(2), {
|
|
48
|
+
stdio: 'inherit',
|
|
49
|
+
env: process.env,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
if (result.error) {
|
|
53
|
+
console.error(`Capix Code could not start: ${result.error.message}`);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
process.exit(result.status ?? 1);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"provider": "capix",
|
|
3
|
+
"model": "capix/auto",
|
|
4
|
+
"apiBaseUrl": "https://www.capix.network/api/v1",
|
|
5
|
+
"inferenceBaseUrl": "https://www.capix.network/api/v1",
|
|
6
|
+
"updateBaseUrl": "https://www.capix.network/api/v1",
|
|
7
|
+
"sandbox": "restricted",
|
|
8
|
+
"telemetry": false,
|
|
9
|
+
"contentLogging": false,
|
|
10
|
+
"settlement": {
|
|
11
|
+
"enabled": false,
|
|
12
|
+
"rpcUrl": "",
|
|
13
|
+
"programId": "",
|
|
14
|
+
"cluster": "localnet"
|
|
15
|
+
},
|
|
16
|
+
"cpx": {
|
|
17
|
+
"mint": "",
|
|
18
|
+
"decimals": 9,
|
|
19
|
+
"pricingSource": "protocol-reference",
|
|
20
|
+
"maxPriceAgeSeconds": 60
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
{
|
|
2
|
+
"provider": {
|
|
3
|
+
"capix": {
|
|
4
|
+
"npm": "@capix/runtime-provider",
|
|
5
|
+
"name": "Capix",
|
|
6
|
+
"options": {
|
|
7
|
+
"headers": {
|
|
8
|
+
"X-Capix-Source": "capix-code"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"models": {
|
|
12
|
+
"auto": {
|
|
13
|
+
"name": "Capix Auto (smart route — picks the best model for the task)",
|
|
14
|
+
"limit": { "context": 128000, "output": 64000 }
|
|
15
|
+
},
|
|
16
|
+
"supergemma-gemma3-27b": {
|
|
17
|
+
"name": "SuperGemma · Gemma 3 27B",
|
|
18
|
+
"limit": { "context": 131072, "output": 32768 }
|
|
19
|
+
},
|
|
20
|
+
"supergemma-gemma3-12b": {
|
|
21
|
+
"name": "SuperGemma · Gemma 3 12B",
|
|
22
|
+
"limit": { "context": 131072, "output": 16384 }
|
|
23
|
+
},
|
|
24
|
+
"supergemma-gemma3-4b": {
|
|
25
|
+
"name": "SuperGemma · Gemma 3 4B",
|
|
26
|
+
"limit": { "context": 131072, "output": 8192 }
|
|
27
|
+
},
|
|
28
|
+
"supergemma-codegemma-7b": {
|
|
29
|
+
"name": "SuperGemma · CodeGemma 7B",
|
|
30
|
+
"limit": { "context": 8192, "output": 8192 }
|
|
31
|
+
},
|
|
32
|
+
"qwen2.5-coder-7b": {
|
|
33
|
+
"name": "Qwen2.5-Coder 7B",
|
|
34
|
+
"limit": { "context": 131072, "output": 16384 }
|
|
35
|
+
},
|
|
36
|
+
"qwen2.5-coder-32b": {
|
|
37
|
+
"name": "Qwen2.5-Coder 32B (AWQ)",
|
|
38
|
+
"limit": { "context": 131072, "output": 32768 }
|
|
39
|
+
},
|
|
40
|
+
"llama-3.3-70b-fp8": {
|
|
41
|
+
"name": "Llama 3.3 70B (FP8)",
|
|
42
|
+
"limit": { "context": 131072, "output": 32768 }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"model": "{env:CAPIX_MODEL:capix/auto}",
|
|
48
|
+
"small_model": "capix/supergemma-gemma3-4b",
|
|
49
|
+
"enabled_providers": ["capix"],
|
|
50
|
+
"permission": {
|
|
51
|
+
"edit": "ask",
|
|
52
|
+
"bash": "ask"
|
|
53
|
+
},
|
|
54
|
+
"mcp": {
|
|
55
|
+
"capix": {
|
|
56
|
+
"type": "local",
|
|
57
|
+
"command": ["npx", "-y", "@capix/mcp", "server", "--stdio"],
|
|
58
|
+
"enabled": true,
|
|
59
|
+
"environment": {}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"share": "manual",
|
|
63
|
+
"autoupdate": false,
|
|
64
|
+
"plugin": ["./src/plugin.ts"],
|
|
65
|
+
"command": {
|
|
66
|
+
"plan": {
|
|
67
|
+
"description": "Create a research-first implementation plan",
|
|
68
|
+
"model": "capix/auto",
|
|
69
|
+
"template": "file://commands/plan.md"
|
|
70
|
+
},
|
|
71
|
+
"agents": {
|
|
72
|
+
"description": "List active agents, their trust levels, generation, and status",
|
|
73
|
+
"template": "file://commands/agents.md"
|
|
74
|
+
},
|
|
75
|
+
"delegate": {
|
|
76
|
+
"description": "Delegate a bounded task to a specialist agent",
|
|
77
|
+
"model": "capix/auto",
|
|
78
|
+
"subtask": true,
|
|
79
|
+
"template": "file://commands/delegate.md"
|
|
80
|
+
},
|
|
81
|
+
"skills": {
|
|
82
|
+
"description": "Browse the skill registry",
|
|
83
|
+
"template": "file://commands/skills.md"
|
|
84
|
+
},
|
|
85
|
+
"covenant": {
|
|
86
|
+
"description": "Show the current Project Covenant and active rules",
|
|
87
|
+
"template": "file://commands/covenant.md"
|
|
88
|
+
},
|
|
89
|
+
"memory": {
|
|
90
|
+
"description": "Search memory — show recent memory nodes by type",
|
|
91
|
+
"template": "file://commands/memory.md"
|
|
92
|
+
},
|
|
93
|
+
"remember": {
|
|
94
|
+
"description": "Write a memory node — persist a decision, fact, constraint, or observation",
|
|
95
|
+
"template": "file://commands/remember.md"
|
|
96
|
+
},
|
|
97
|
+
"forget": {
|
|
98
|
+
"description": "Mark a memory node as superseded",
|
|
99
|
+
"template": "file://commands/forget.md"
|
|
100
|
+
},
|
|
101
|
+
"graph": {
|
|
102
|
+
"description": "Query the knowledge graph — nodes and relationships",
|
|
103
|
+
"template": "file://commands/graph.md"
|
|
104
|
+
},
|
|
105
|
+
"decisions": {
|
|
106
|
+
"description": "List recent decisions from memory — alternatives, evidence, trade-offs",
|
|
107
|
+
"template": "file://commands/decisions.md"
|
|
108
|
+
},
|
|
109
|
+
"checkpoint": {
|
|
110
|
+
"description": "Create a verified checkpoint — repo state, tests, plan, agents, infra, costs",
|
|
111
|
+
"template": "file://commands/checkpoint.md"
|
|
112
|
+
},
|
|
113
|
+
"review": {
|
|
114
|
+
"description": "Run an adversarial code review",
|
|
115
|
+
"model": "capix/auto",
|
|
116
|
+
"template": "file://commands/review.md"
|
|
117
|
+
},
|
|
118
|
+
"verify-checks": {
|
|
119
|
+
"description": "Run verification checks — build, type, lint, test, security, diff",
|
|
120
|
+
"template": "file://commands/verify-checks.md"
|
|
121
|
+
},
|
|
122
|
+
"handoff": {
|
|
123
|
+
"description": "Create an agent handoff / exit report",
|
|
124
|
+
"model": "capix/auto",
|
|
125
|
+
"template": "file://commands/handoff.md"
|
|
126
|
+
},
|
|
127
|
+
"context": {
|
|
128
|
+
"description": "Show the current context budget and what was retrieved and why",
|
|
129
|
+
"template": "file://commands/context.md"
|
|
130
|
+
},
|
|
131
|
+
"compact": {
|
|
132
|
+
"description": "Compact the current session context — preserve critical constraints",
|
|
133
|
+
"template": "file://commands/compact.md"
|
|
134
|
+
},
|
|
135
|
+
"deploy": {
|
|
136
|
+
"description": "Deploy infrastructure via Capix MCP — quote, approve, provision",
|
|
137
|
+
"template": "file://commands/deploy.md"
|
|
138
|
+
},
|
|
139
|
+
"cleanup": {
|
|
140
|
+
"description": "Clean up task resources — destroy infra, reconcile, capture billing",
|
|
141
|
+
"template": "file://commands/cleanup.md"
|
|
142
|
+
},
|
|
143
|
+
"receipts": {
|
|
144
|
+
"description": "List work receipts — useful-work evidence and anchoring status",
|
|
145
|
+
"template": "file://commands/receipts.md"
|
|
146
|
+
},
|
|
147
|
+
"network": {
|
|
148
|
+
"description": "List VPCs, create VPCs, manage subnets, view routes, manage security groups",
|
|
149
|
+
"model": "capix/auto",
|
|
150
|
+
"template": "file://commands/network.md"
|
|
151
|
+
},
|
|
152
|
+
"endpoints": {
|
|
153
|
+
"description": "List endpoints, create endpoints, add custom domains, view endpoint health",
|
|
154
|
+
"model": "capix/auto",
|
|
155
|
+
"template": "file://commands/endpoints.md"
|
|
156
|
+
},
|
|
157
|
+
"ssh": {
|
|
158
|
+
"description": "Connect to a deployment, port forward, revoke an SSH session",
|
|
159
|
+
"model": "capix/auto",
|
|
160
|
+
"template": "file://commands/ssh.md"
|
|
161
|
+
},
|
|
162
|
+
"forward": {
|
|
163
|
+
"description": "Forward a local port to a deployment port",
|
|
164
|
+
"model": "capix/auto",
|
|
165
|
+
"template": "file://commands/forward.md"
|
|
166
|
+
},
|
|
167
|
+
"logs": {
|
|
168
|
+
"description": "Stream deployment logs, filter by level, download",
|
|
169
|
+
"template": "file://commands/logs.md"
|
|
170
|
+
},
|
|
171
|
+
"metrics": {
|
|
172
|
+
"description": "View deployment metrics — CPU, GPU, memory, network",
|
|
173
|
+
"template": "file://commands/metrics.md"
|
|
174
|
+
},
|
|
175
|
+
"stop": {
|
|
176
|
+
"description": "Stop a deployment",
|
|
177
|
+
"model": "capix/auto",
|
|
178
|
+
"template": "file://commands/stop.md"
|
|
179
|
+
},
|
|
180
|
+
"secure": {
|
|
181
|
+
"description": "Deploy a confidential VM/GPU, view TEE status",
|
|
182
|
+
"model": "capix/auto",
|
|
183
|
+
"template": "file://commands/secure.md"
|
|
184
|
+
},
|
|
185
|
+
"attest": {
|
|
186
|
+
"description": "Fetch and verify attestation evidence",
|
|
187
|
+
"template": "file://commands/attest.md"
|
|
188
|
+
},
|
|
189
|
+
"verify-proof": {
|
|
190
|
+
"description": "Verify a proof or attestation",
|
|
191
|
+
"template": "file://commands/verify-proof.md"
|
|
192
|
+
},
|
|
193
|
+
"proofs": {
|
|
194
|
+
"description": "List and inspect zkVM proofs",
|
|
195
|
+
"template": "file://commands/proofs.md"
|
|
196
|
+
},
|
|
197
|
+
"confidential-models": {
|
|
198
|
+
"description": "List and deploy confidential model endpoints",
|
|
199
|
+
"model": "capix/auto",
|
|
200
|
+
"template": "file://commands/confidential-models.md"
|
|
201
|
+
},
|
|
202
|
+
"website": {
|
|
203
|
+
"description": "Deploy a website from a repo, list websites",
|
|
204
|
+
"model": "capix/auto",
|
|
205
|
+
"template": "file://commands/website.md"
|
|
206
|
+
},
|
|
207
|
+
"preview": {
|
|
208
|
+
"description": "Create a preview deployment",
|
|
209
|
+
"model": "capix/auto",
|
|
210
|
+
"template": "file://commands/preview.md"
|
|
211
|
+
},
|
|
212
|
+
"promote": {
|
|
213
|
+
"description": "Promote a preview deployment to production",
|
|
214
|
+
"model": "capix/auto",
|
|
215
|
+
"template": "file://commands/promote.md"
|
|
216
|
+
},
|
|
217
|
+
"rollback": {
|
|
218
|
+
"description": "Rollback to a previous deployment",
|
|
219
|
+
"model": "capix/auto",
|
|
220
|
+
"template": "file://commands/rollback.md"
|
|
221
|
+
},
|
|
222
|
+
"domains": {
|
|
223
|
+
"description": "Add, verify, and remove custom domains",
|
|
224
|
+
"model": "capix/auto",
|
|
225
|
+
"template": "file://commands/domains.md"
|
|
226
|
+
},
|
|
227
|
+
"analytics": {
|
|
228
|
+
"description": "View website analytics",
|
|
229
|
+
"template": "file://commands/analytics.md"
|
|
230
|
+
},
|
|
231
|
+
"open": {
|
|
232
|
+
"description": "Open a deployment in the browser",
|
|
233
|
+
"template": "file://commands/open.md"
|
|
234
|
+
},
|
|
235
|
+
"doctor": {
|
|
236
|
+
"description": "Diagnose Capix Code installation and connection",
|
|
237
|
+
"template": "file://commands/doctor.md"
|
|
238
|
+
},
|
|
239
|
+
"update": {
|
|
240
|
+
"description": "Check for and install Capix Code updates",
|
|
241
|
+
"template": "file://commands/update.md"
|
|
242
|
+
},
|
|
243
|
+
"welcome": {
|
|
244
|
+
"description": "First-run onboarding — sign in, check balance, browse models, get started",
|
|
245
|
+
"template": "file://commands/welcome.md"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|