cryptoricagent 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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +143 -2
  3. package/dist/index.js +12975 -0
  4. package/package.json +34 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Itz-Npg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,144 @@
1
- # Temporary Holding Version
1
+ # cryptoric
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
+ Cryptoric Chan from your terminal — the same staged agent pipeline that runs
4
+ inside the Cryptoric Agent desktop app, headless.
5
+
6
+ ```bash
7
+ cryptoric # interactive: prompt box, type a task, get a result
8
+ cryptoric run "add a README describing this project" # one shot, for scripts
9
+ ```
10
+
11
+ Inside a session: `/tools` lists what the binary can actually call, `/doctor`
12
+ reports configuration, `/cwd` prints the workspace root, `/exit` leaves.
13
+
14
+ ## What this is
15
+
16
+ ![A real cryptoric session: the wordmark, a task typed into the prompt box, and a BLOCKED verdict because no model provider is configured](docs/cli-session.svg)
17
+
18
+ <sub>A real capture, produced by `node scripts/capture-cli-svg.mjs` driving this
19
+ code with no model provider configured. It is what the CLI actually printed.</sub>
20
+
21
+ The desktop app and this CLI are two **composition roots** over one
22
+ implementation. `AgentRuntime`, the stage pipeline, `ToolRuntime`,
23
+ `PermissionPolicy`, every tool definition, the skills registry, the model gateway
24
+ and the system prompts are all shared source files. Only the edges differ:
25
+
26
+ | | Desktop app | CLI |
27
+ |---|---|---|
28
+ | State | OS `userDataDir` | `CRYPTORIC_HOME`, default `~/.cryptoric` |
29
+ | API key | OS-encrypted keychain | `CRYPTORIC_API_KEY` environment variable |
30
+ | Approvals | an on-screen queue | stdin, or `--yes` / `--deny` |
31
+ | Browser | `WebContentsView` inside a window | **not available** |
32
+ | Progress | React UI | stderr text, `--json` for machines |
33
+
34
+ There is no second implementation of the agent to drift. If the pipeline
35
+ changes in `src/main/services/agent/`, the CLI changes with it.
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ npm install -g cryptoricagent
41
+ ```
42
+
43
+ Or run it without installing:
44
+
45
+ ```bash
46
+ npx cryptoricagent run "..."
47
+ ```
48
+
49
+ ## Commands
50
+
51
+ ```
52
+ cryptoric run "<task>" Run the agent pipeline on a task
53
+ cryptoric tools List the tools this CLI actually has
54
+ cryptoric doctor Report environment and configuration
55
+ cryptoric help Full usage
56
+ ```
57
+
58
+ ### Run options
59
+
60
+ | Flag | Meaning |
61
+ |---|---|
62
+ | `--cwd <dir>` | Project root to work in. Default: current directory |
63
+ | `--yes` | Pre-approve gated operations, **including destructive ones** |
64
+ | `--deny` | Refuse gated operations; gated work reports `BLOCKED` |
65
+ | `--json` | Machine-readable result on stdout, progress on stderr |
66
+ | `--provider <name>` | Model provider override |
67
+ | `--endpoint <url>` | Model endpoint override |
68
+ | `--model <id>` | Model id override |
69
+ | `--timeout <seconds>` | Wall-clock cap. Default 1800 |
70
+
71
+ ## Exit codes
72
+
73
+ The pipeline distinguishes five outcomes, so the exit code does too. Collapsing
74
+ them to `0` and `1` would throw away the distinction the desktop app works to
75
+ preserve.
76
+
77
+ | Code | Verdict | Meaning |
78
+ |---|---|---|
79
+ | 0 | `COMPLETED` | The work was done and change was observed |
80
+ | 1 | `FAILED` | The run happened and did not succeed |
81
+ | 2 | `BLOCKED` | It could not proceed without a decision |
82
+ | 3 | `CANCELLED` | Interrupted |
83
+ | 4 | `PARTIAL` | Work done, verification unfinished |
84
+ | 64 | — | The command line was wrong |
85
+
86
+ A run with **no observed file change is never `COMPLETED`.** If you ask for an
87
+ edit and no bytes change, you get `2 BLOCKED` and a reason, not a green tick.
88
+
89
+ ## Configuration
90
+
91
+ Without these three variables the CLI still runs, and runs the deterministic
92
+ stages (project detection, environment probing, skill routing). It will tell you
93
+ it is doing so rather than pretending an agent is at work.
94
+
95
+ | Variable | Purpose |
96
+ |---|---|
97
+ | `CRYPTORIC_API_KEY` | API key for the provider |
98
+ | `CRYPTORIC_PROVIDER` | Provider name (default `openrouter`) |
99
+ | `CRYPTORIC_ENDPOINT` | Provider endpoint URL |
100
+ | `CRYPTORIC_MODEL` | Model id |
101
+ | `CRYPTORIC_HOME` | State directory |
102
+ | `CRYPTORIC_DAILY_BUDGET_COINS` | Daily spend ceiling |
103
+
104
+ The API key is read from the environment and **never written to disk** by this
105
+ process. There is no keychain here, and the CLI does not create one.
106
+
107
+ ## Approvals
108
+
109
+ Gated operations prompt on stdin. When stdin is **not** a terminal the CLI
110
+ refuses and says so — an absent human is not consent. In CI, pass `--deny` to
111
+ get deterministic refusals or `--yes` to pre-approve.
112
+
113
+ ## What this cannot do
114
+
115
+ Stated plainly, because the alternative is finding out later:
116
+
117
+ - **No browser.** Browser tools are backed by `WebContentsView`, which needs a
118
+ window. They are not registered at all, so `cryptoric tools` does not list
119
+ them. Use the desktop app for anything that needs a real browser.
120
+ - **No interactive terminal UI.** Long-running commands run as managed
121
+ processes; their output is written to stderr as it arrives.
122
+ - **No App Store / TestFlight distribution.** The iOS companion builds and
123
+ tests in CI; shipping it needs an Apple Developer account.
124
+
125
+ ## Developing
126
+
127
+ ```bash
128
+ npm run typecheck:node # from the repo root
129
+ node cli/build.mjs # bundle to cli/dist/index.js
130
+ ```
131
+
132
+ The build fails if an Electron module ever reaches the CLI entry point, and
133
+ `tests/unit/cli-surface.test.ts` fails if the shared agent layer imports Electron
134
+ or if the system prompts are duplicated. Those two properties are what make this
135
+ a second surface instead of a fork.
136
+
137
+ ## Publishing
138
+
139
+ ```bash
140
+ npm publish
141
+ ```
142
+
143
+ Run from this directory. `prepack` builds the bundle, so the published tarball
144
+ is runnable without a separate build step.