cherry-works 0.1.0 → 0.2.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/README.md +57 -6
- package/dist/cw.js +2 -1
- package/dist/main.js +1429 -421
- package/dist/portal/main.js +2 -2
- package/dist/portal/styles.css +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -8,7 +8,8 @@ files your coding agent actually reads.
|
|
|
8
8
|
.cw/charter/guide/no-any.md ──cw build──▶ CLAUDE.md
|
|
9
9
|
.cw/charter/sensor/lint.md .claude/rules/…
|
|
10
10
|
.cw/charter/posture/secrets.md .claude/settings.json (hooks, permissions)
|
|
11
|
-
… .claude/skills/…, .claude/
|
|
11
|
+
… .claude/skills/…, .claude/agents/…
|
|
12
|
+
.mcp.json (cw mcp serve)
|
|
12
13
|
```
|
|
13
14
|
|
|
14
15
|
## Why
|
|
@@ -113,17 +114,24 @@ Each kind comes up at a different time:
|
|
|
113
114
|
|---|---|
|
|
114
115
|
| `guide` | a touched file matches one of its `globs`, or on every turn when it has no globs |
|
|
115
116
|
| `sensor` | the `signal` it names is raised, and the harness runs its `run` command |
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `playbook` | one of its `triggers` matches; its body is a sequence of commands |
|
|
117
|
+
| `skill` | one of its `triggers` matches the request, or it is called by name as `/skill-<id>` |
|
|
118
|
+
| `playbook` | one of its `triggers` matches; its body is a sequence of skills |
|
|
119
119
|
| `agent` | it is spawned by identity, with only the `tools` it lists |
|
|
120
120
|
| `posture` | always, wherever the host can be told what to `allow` and `deny` |
|
|
121
121
|
| `corpus` | a primitive's `rationale` cites it, to give the reasoning behind a rule |
|
|
122
122
|
| `mixin` | never on its own; its body is lent to the primitives that pull it in |
|
|
123
|
+
| `mcp` | a primitive's body names it as `mcp:<id>`: a place outside the repository, reached through `cw mcp serve` |
|
|
123
124
|
|
|
124
125
|
`cw kinds <kind>` gives the exact fields each kind takes. An identity is
|
|
125
126
|
`kind:id`, and it names exactly one primitive across the whole charter. If two
|
|
126
127
|
files claim the same identity, the build is refused and both files are named.
|
|
128
|
+
An id is at most 40 characters, and may be grouped with `/`: `mcp:mfbs/billing`
|
|
129
|
+
is kept at `.cw/charter/mcp/mfbs/billing.md`.
|
|
130
|
+
|
|
131
|
+
`cw build` compiles every primitive to `.cw/out/<kind>/<id>.md`: its headers,
|
|
132
|
+
then the bodies of the mixins it pulls in, then its own. What your agent's host
|
|
133
|
+
is given points to that document, so you can open any primitive exactly as the
|
|
134
|
+
agent reads it.
|
|
127
135
|
|
|
128
136
|
## Commands
|
|
129
137
|
|
|
@@ -142,6 +150,8 @@ files claim the same identity, the build is refused and both files are named.
|
|
|
142
150
|
| `cw suite add \| edit \| remove` | Manage test files |
|
|
143
151
|
| `cw vendor add <source> [--ref] \| remove \| list` | Install, update, remove or list vendor sources |
|
|
144
152
|
| `cw portal [--port]` | Open the charter in a browser on this machine |
|
|
153
|
+
| `cw mcp auth [identity] [--status]` | Sign in, as yourself, to every place the charter reaches, or to one again |
|
|
154
|
+
| `cw mcp serve` | Serve every place the charter reaches to your agent, over stdio |
|
|
145
155
|
|
|
146
156
|
`cw doctor` exits with a failure status when the charter has an error, when a
|
|
147
157
|
vendored file was edited in this repository, or when the compiled output no
|
|
@@ -222,6 +232,48 @@ It is installed under `.cw/vendor/<name>/`, pinned to the ref you chose and
|
|
|
222
232
|
committed. Vendored primitives are read-only. To differ from one, write your own
|
|
223
233
|
primitive under a new identity.
|
|
224
234
|
|
|
235
|
+
## Places outside the repository
|
|
236
|
+
|
|
237
|
+
Much of what an agent needs to know is kept elsewhere: another service's code,
|
|
238
|
+
an issue tracker, a wiki. An `mcp` primitive declares one such place, an MCP
|
|
239
|
+
server, and the tools of it your agent may use:
|
|
240
|
+
|
|
241
|
+
```markdown
|
|
242
|
+
---
|
|
243
|
+
kind: mcp
|
|
244
|
+
id: mfbs/billing
|
|
245
|
+
description: Billing service code and pull requests.
|
|
246
|
+
endpoint: https://api.githubcopilot.com/mcp/
|
|
247
|
+
path: moneyforward/billing-service
|
|
248
|
+
auth: ["oauth", "token"]
|
|
249
|
+
tools: ["get_file_contents", "search_code", "list_pull_requests"]
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
The billing service. Look here before changing anything that charges a customer.
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
A place is either an `endpoint` reached over HTTP, or a `command` with its
|
|
256
|
+
`args` that `cw` starts as a local process; a local one takes a token only, in
|
|
257
|
+
the environment variable its `tokenEnv` names. Any primitive points the agent
|
|
258
|
+
at a place by naming it in its body as `mcp:mfbs/billing`.
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
cw build # adds one entry, cw mcp serve, to your agent's .mcp.json
|
|
262
|
+
cw mcp auth # sign in to every place you are not signed in to yet
|
|
263
|
+
cw mcp auth --status
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Every developer signs in as themselves, by browser where the place offers OAuth
|
|
267
|
+
or with a token typed at a hidden prompt. Credentials are kept in the operating
|
|
268
|
+
system's credential store, never in the repository, and renewed without asking
|
|
269
|
+
where the place allows it. `cw mcp serve` is the one MCP server your agent is
|
|
270
|
+
given: it serves the tools each place declares and forwards every call under
|
|
271
|
+
your own credential. A place that is down or not signed in to loses only its own
|
|
272
|
+
tools.
|
|
273
|
+
|
|
274
|
+
A subagent reaches only the places it lists under `tools`: `mcp:<id>` for every
|
|
275
|
+
tool of a place, or `mcp:<id>:<tool>` for one of them.
|
|
276
|
+
|
|
225
277
|
## Your agent can write rules too
|
|
226
278
|
|
|
227
279
|
Every governed repository gets a built-in skill, `skill:cw-author`. It teaches
|
|
@@ -247,7 +299,6 @@ every check and changes nothing. A plain `npm publish` is refused.
|
|
|
247
299
|
The engine follows a hexagonal layout. `src/hexagon/` holds the domain, the
|
|
248
300
|
application use cases and their ports. `src/driver/` holds the CLI and the
|
|
249
301
|
portal that drive it. `src/zdriven/` holds the adapters for files, git and YAML.
|
|
250
|
-
|
|
251
|
-
[specs/plan.md](specs/plan.md).
|
|
302
|
+
What it must do is written in [specs/spec.md](specs/spec.md).
|
|
252
303
|
|
|
253
304
|
This repository is governed by its own charter under [.cw/charter/](.cw/charter/).
|
package/dist/cw.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "cherry-works",
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.2.0",
|
|
7
7
|
description: "The charter engine: resolves a charter and compiles it into what a coding agent reads.",
|
|
8
8
|
keywords: [
|
|
9
9
|
"claude-code",
|
|
@@ -90,6 +90,7 @@ var package_default = {
|
|
|
90
90
|
dependencies: {
|
|
91
91
|
"@hono/node-server": "^2.1.1",
|
|
92
92
|
"@hono/zod-openapi": "^1.6.3",
|
|
93
|
+
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
93
94
|
hono: "^4.13.7",
|
|
94
95
|
picomatch: "^4.0.7",
|
|
95
96
|
prompts: "^2.4.2",
|