cherry-works 0.1.0 → 0.2.1

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 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/commands/…
11
+ … .claude/skills/…, .claude/agents/…
12
+ .mcp.json (cw mcp serve)
12
13
  ```
13
14
 
14
15
  ## Why
@@ -79,7 +80,7 @@ The link points at your checkout. After you change the sources, run
79
80
  Inside the git repository you want to govern:
80
81
 
81
82
  ```bash
82
- cw init # asks which agent to compile for, then scaffolds .cw/charter/
83
+ cw init # asks which agent to compile for (claude, selected), scaffolds .cw/charter/ and builds
83
84
  cw kinds guide # what a guide requires
84
85
  cw add guide no-any --header description="No any in TypeScript." --header globs="src/**/*.ts"
85
86
  cw edit guide:no-any # write the body in $VISUAL or $EDITOR
@@ -113,23 +114,30 @@ 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
- | `command` | it is asked for by name, or a request matches its description |
117
- | `skill` | one of its `triggers` matches the request |
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
 
130
138
  | Command | What it does |
131
139
  |---|---|
132
- | `cw init [--agent]` | Set the repository up under a charter |
140
+ | `cw init [--agent]` | Set the repository up under a charter, and build it |
133
141
  | `cw build [--preview]` | Compile the charter, or show what a build would write |
134
142
  | `cw list [--kind] [--min]` | List what the charter holds |
135
143
  | `cw kinds [kind]` | List the kinds, or the fields one of them requires |
@@ -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,9 +232,52 @@ 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
- Every governed repository gets a built-in skill, `skill:cw-author`. It teaches
279
+ Every governed repository gets a built-in skill, `skill:cw-author`, in the
280
+ agent's hands from the moment `cw init` finishes. It teaches
228
281
  the agent to ask `cw kinds` what a kind requires and to write primitives with
229
282
  `cw add`, instead of copying fields from memory.
230
283
 
@@ -247,7 +300,6 @@ every check and changes nothing. A plain `npm publish` is refused.
247
300
  The engine follows a hexagonal layout. `src/hexagon/` holds the domain, the
248
301
  application use cases and their ports. `src/driver/` holds the CLI and the
249
302
  portal that drive it. `src/zdriven/` holds the adapters for files, git and YAML.
250
- The design is written in [specs/spec.md](specs/spec.md) and
251
- [specs/plan.md](specs/plan.md).
303
+ What it must do is written in [specs/spec.md](specs/spec.md).
252
304
 
253
305
  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.1.0",
6
+ version: "0.2.1",
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",