@acid-cat/cli 0.12.0 → 0.13.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 CHANGED
@@ -17,7 +17,7 @@ Install it as a development dependency, and run it with `pnpm exec acid-cat …`
17
17
  pnpm add -D @acid-cat/cli
18
18
  ```
19
19
 
20
- It needs Node.js 24 or later. `acid-cat conform --webmcp <url>` also needs [Playwright](https://playwright.dev) and Chromium.
20
+ It ignores a first argument `--`, which package runners such as `pnpm` and `npx` pass to it: `pnpm acid-cat -- check` is `acid-cat check`. It needs Node.js 24 or later. `acid-cat conform --webmcp <url>` also needs [Playwright](https://playwright.dev) and Chromium.
21
21
 
22
22
  ## Output
23
23
 
@@ -51,7 +51,7 @@ The exit code is 0 if there are no errors. It is 1 if there are errors. With `--
51
51
 
52
52
  - **MCP through HTTP:** `--mcp <url>`. The official MCP client, with revision `2026-07-28`, for tools and outcomes; raw requests for rejections. With `--mcp-handshake`, or `mcpHandshake: true` in code, the checks also test the [`initialize` handshake of earlier revisions](../../spec/bindings/mcp.md#earlier-revisions-through-http): the client of revision `2025-11-25` tests the tools and outcomes again, and raw requests test `initialize` with no session and a notification.
53
53
  - **MCP through stdio:** `--mcp-stdio "<command>"`, or `mcpStdio` in code. The checks start the server as a process. The official MCP client tests the tools and outcomes two times: with revision `2026-07-28`, and with the `initialize` handshake of revision `2025-11-25`. It also tests `notifications/tools/list_changed` and `notifications/cancelled`. Raw lines test the version negotiation, a line that is not JSON, a standard output with only JSON-RPC messages, and the end of standard input.
54
- - **HTTP** and **CLI:** each outcome, each kind of call failure, availability, and rejections. For the CLI, also each kind of flag, including a repeated flag that gives one item of an array for each occurrence, or the whole array as JSON text, and the usage line of each command and of each event, with `[--cursor <string>] [--max-age-ms <integer>]`. An interrupt (`SIGINT`) during a call that holds gives exit code 130. `watch --cursor` starts after the cursor, and a `--max-age-ms` that is not an integer gives exit code 3.
54
+ - **HTTP** and **CLI:** each outcome, each kind of call failure, availability, and rejections. For the CLI, also each kind of flag, including a repeated flag that gives one item of an array for each occurrence, or the whole array as JSON text, and the usage line of each command and of each event, with `[--cursor <string>] [--max-age-ms <integer>]`. An interrupt (`SIGINT`) during a call that holds gives exit code 130, and the call must end and delete its marker file. `watch --cursor` starts after the cursor, and a `--max-age-ms` that is not an integer gives exit code 3.
55
55
  - **WebMCP:** the checks act as the WebMCP host. `--webmcp <url>` opens a page that serves the `app` target in Chromium, through [Playwright](https://playwright.dev), with a test `modelContext`. Install Playwright to use it: `pnpm add -D playwright`, then `pnpm exec playwright install chromium`. In code, `webmcp` can also be a function that installs the implementation on a host in the same process.
56
56
  - **Events:** through HTTP, MCP with each transport, and the CLI. The checks examine the list of the events of the view, the call failures before the first occurrence (an event outside the view, and invalid input), each occurrence against `schemas/occurrence.schema.json` and the payload schema, the order of the occurrences, an occurrence with `truncated: true` (`fixture.ticks` with `gap`: `truncated` in the occurrence through HTTP and the CLI, `notifications/events/active` with `truncated: true` and the cursor before the event through MCP push, and a result with `truncated: true` through MCP poll), the cursor, each end of a subscription (complete and `internal`), and cancellation. Through MCP, they also examine `server/discover`, `events/list` with the delivery modes of the server, `notifications/events/active`, and the subscription id of each message. With `--mcp-handshake`, `initialize` must not declare the events extension. Through WebMCP, no event is a tool.
57
57
  - **Poll delivery:** through MCP with each transport, when `events/list` gives `poll`. If not, the checks give a warning, and `events/poll` must answer `Unsupported`. The checks test each row of the table of [Poll](../../spec/bindings/mcp.md#poll): no cursor with no lease and with a lease, a cursor of the lease, a cursor of another lease with and without a lease of the key, a cursor of push delivery, and a cursor of another lease that has a cursor of the provider, which resumes after it. They also test the form of each result, `maxEvents` and `hasMore`, a `maxEvents` that is not valid, the failures before the first occurrence, which start no lease, and the error `-32603` after a defect. With `--poll-buffer <n>`, or `poll.bufferLimit` in code, they test a cursor older than the buffer: `n` is the buffer size of the deployment, from 1 to 97. With `--poll-lease-ms <ms>`, or `poll.leaseMs`, they test that a lease with no poll ends, and cancels its subscription. The lease time must be shorter than the deadline. A check makes other requests between two polls of a lease, so give a lease time of some seconds, for example 5 seconds. A shorter lease can end between two polls on a busy computer, and the check then fails. Each check uses a new key in its input, so the leases of an earlier run do not change the result.
@@ -61,7 +61,7 @@ The exit code is 0 if there are no errors. It is 1 if there are errors. With `--
61
61
  - `--webhook-other-principal <name>`, or `webhook.otherPrincipal`, gives a second principal, for `Authorization: Bearer <name>`. With it, the check of the limit fills the subscriptions of this principal, which no other check uses, so it expects exactly `n` subscriptions, and then tests that the first principal can still subscribe. Without it, the check uses the first principal, which can still have subscriptions of other checks. The retry check waits for the first retry of the deployment, so the deadline must be longer than that wait. Without these options, a server that does not list `webhook` must answer `events/subscribe` and `events/unsubscribe` with `Unsupported`. Through stdio, it must always do so.
62
62
  - **Properties:** with fast-check, through MCP with each transport and through HTTP: concurrent calls each get exactly their own outcome, and a cancellation changes only its own call.
63
63
 
64
- The checks wait for states that they can observe, not for times. Before a check cancels a call to `fixture.hold`, it waits until `fixture.held` gives the key of the call, or, for the CLI, until the marker file of the call exists. In the same way, before a check signals or cancels a subscription to `fixture.watch`, it waits until `fixture.watching` gives its key, or until its marker file exists. After it cancels the subscription, it waits until the key leaves `fixture.watching`. Each check has one deadline: `--deadline`, or `deadline` in code, in milliseconds. The default is 30 000. A check that does not settle before its deadline fails with "did not settle", and the check stops what it started. This cleanup has a deadline of the same length, so `conform` always returns. The deadline never makes a check pass.
64
+ The checks wait for states that they can observe, not for times. Before a check cancels a call to `fixture.hold`, it waits until `fixture.held` gives the key of the call, or, for the CLI, until the marker file of the call exists. In the same way, before a check signals or cancels a subscription to `fixture.watch`, it waits until `fixture.watching` gives its key, or until its marker file exists. After it cancels the subscription, it waits until the key leaves `fixture.watching`. Through the CLI, after the process exits, it waits until the marker file of the call or the subscription is deleted. A core can exit with 130 when a call does not stop, so the exit code alone does not show that the call ended. Each check has one deadline: `--deadline`, or `deadline` in code, in milliseconds. The default is 30 000. A check that does not settle before its deadline fails with "did not settle", and the check stops what it started. This cleanup has a deadline of the same length, so `conform` always returns. The deadline never makes a check pass.
65
65
 
66
66
  A check of a recommendation (SHOULD) that fails gives a warning, marked `!`, and passes. The exit code is 1 if a check fails. Each AcidCat core runs `conform` in its tests. In code, use `conform()` and `serve()` from `@acid-cat/cli`. This `serve()` is for tests: it listens on `127.0.0.1`, on a free port, with plain HTTP. To serve an application, use the server of its core: `serve` from `@acid-cat/core-ts/node`, `NodeServer` from `@acid-cat/core-effect`, or `remote::serve` from the crate `acid-cat-core`. `createTestHost()` gives the WebMCP host of the checks.
67
67
 
@@ -250,7 +250,7 @@
250
250
  ]
251
251
  },
252
252
  "fixture.hold": {
253
- "description": "Hold until fixture.release releases the key, then return the key. While the call holds, fixture.held gives the key. With a marker, the call writes a file at that path when it starts to hold.",
253
+ "description": "Hold until fixture.release releases the key, then return the key. While the call holds, fixture.held gives the key. With a marker, the call writes a file at that path when it starts to hold, and deletes the file when it ends.",
254
254
  "audience": [
255
255
  "app",
256
256
  "mcp",
@@ -529,7 +529,7 @@
529
529
  }
530
530
  },
531
531
  "fixture.watch": {
532
- "description": "Give an occurrence each time that fixture.signal gets the key. Never end. With a marker, write a file at that path when the subscription starts.",
532
+ "description": "Give an occurrence each time that fixture.signal gets the key. Never end. With a marker, write a file at that path when the subscription starts, and delete the file when it ends.",
533
533
  "audience": [
534
534
  "app",
535
535
  "mcp",
@@ -205,13 +205,14 @@ async function checkCli(command, options) {
205
205
  marker
206
206
  ], signal);
207
207
  const ended = () => child.exitCode !== null || child.signalCode !== null;
208
- await until("the call writes its marker file", async () => existsSync(marker) || ended(), (ready) => ready, signal);
209
- if (!ended()) child.kill("SIGINT");
208
+ const state = await until("the call writes its marker file", async () => existsSync(marker) ? "marked" : ended() ? "ended" : "waiting", (each) => each !== "waiting", signal);
209
+ if (state === "marked") child.kill("SIGINT");
210
210
  const result = await run;
211
- expect(existsSync(marker), `the call must hold before the interrupt, but the command line ended with ${result.code}: ${result.stderr}`);
211
+ expect(state === "marked", `the call must hold before the interrupt, but the command line ended with ${result.code}: ${result.stderr}`);
212
212
  expect(result.signal === null, `the process must exit, not end by the signal ${result.signal}`);
213
213
  expectEqual(result.code, 130, "exit code");
214
214
  expectEqual(result.stdout, "", "standard output");
215
+ await until("the call ends and deletes its marker file", async () => !existsSync(marker), (ended) => ended, signal);
215
216
  } finally {
216
217
  await rm(directory, {
217
218
  recursive: true,
@@ -547,14 +548,15 @@ async function checkWatch(checks, command) {
547
548
  marker
548
549
  ], signal);
549
550
  const ended = () => child.exitCode !== null || child.signalCode !== null;
550
- await until("the subscription writes its marker file", async () => existsSync(marker) || ended(), (ready) => ready, signal);
551
- if (!ended()) child.kill("SIGINT");
551
+ const state = await until("the subscription writes its marker file", async () => existsSync(marker) ? "marked" : ended() ? "ended" : "waiting", (each) => each !== "waiting", signal);
552
+ if (state === "marked") child.kill("SIGINT");
552
553
  const result = await watched;
553
- expect(existsSync(marker), `the subscription must start before the interrupt, but the command line ended with ${result.code}: ${result.stderr}`);
554
+ expect(state === "marked", `the subscription must start before the interrupt, but the command line ended with ${result.code}: ${result.stderr}`);
554
555
  expect(result.signal === null, `the process must exit, not end by the signal ${result.signal}`);
555
556
  expectEqual(result.code, 130, "exit code");
556
557
  expectEqual(result.stdout, "", "standard output");
557
558
  expectEqual(result.stderr, "", "standard error");
559
+ await until("the subscription ends and deletes its marker file", async () => !existsSync(marker), (ended) => ended, signal);
558
560
  } finally {
559
561
  await rm(directory, {
560
562
  recursive: true,
@@ -148,7 +148,7 @@ var fixture_acidcat_default = {
148
148
  "audience": ["app"]
149
149
  },
150
150
  "fixture.hold": {
151
- "description": "Hold until fixture.release releases the key, then return the key. While the call holds, fixture.held gives the key. With a marker, the call writes a file at that path when it starts to hold.",
151
+ "description": "Hold until fixture.release releases the key, then return the key. While the call holds, fixture.held gives the key. With a marker, the call writes a file at that path when it starts to hold, and deletes the file when it ends.",
152
152
  "audience": [
153
153
  "app",
154
154
  "mcp",
@@ -343,7 +343,7 @@ var fixture_acidcat_default = {
343
343
  }
344
344
  },
345
345
  "fixture.watch": {
346
- "description": "Give an occurrence each time that fixture.signal gets the key. Never end. With a marker, write a file at that path when the subscription starts.",
346
+ "description": "Give an occurrence each time that fixture.signal gets the key. Never end. With a marker, write a file at that path when the subscription starts, and delete the file when it ends.",
347
347
  "audience": [
348
348
  "app",
349
349
  "mcp",
@@ -1,3 +1,3 @@
1
1
  // package.json
2
- var version = "0.12.0";
2
+ var version = "0.13.0";
3
3
  export { version };
package/dist/main.js CHANGED
@@ -184,10 +184,13 @@ const conformCommand = Command.make("conform", {
184
184
  yield* Console.log(`\n${results.length - failed} passed, ${failed} failed${warnings === 0 ? "" : `, ${warnings} with a warning`}.`);
185
185
  if (failed > 0) return yield* fail;
186
186
  }, Effect.catchTag("UnreadableFile", reportUnreadable))).pipe(Command.withDescription("Test a running implementation of the conformance fixture through its bindings."));
187
- Command.make("acid-cat").pipe(Command.withDescription("Check, format and view AcidCat catalogs, and test implementations."), Command.withSubcommands([
187
+ const acidCat = Command.make("acid-cat").pipe(Command.withDescription("Check, format and view AcidCat catalogs, and test implementations."), Command.withSubcommands([
188
188
  checkCommand,
189
189
  formatCommand,
190
190
  viewCommand,
191
191
  conformCommand
192
- ])).pipe(Command.run({ version }), Effect.provide(NodeServices.layer), NodeRuntime.runMain);
192
+ ]));
193
+ const args = process.argv.slice(2);
194
+ const programArguments = args[0] === "--" ? args.slice(1) : args;
195
+ Command.runWith(acidCat, { version })(programArguments).pipe(Effect.provide(NodeServices.layer), NodeRuntime.runMain);
193
196
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acid-cat/cli",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "The AcidCat command line: check, format and view catalogs, and test implementations.",
5
5
  "keywords": [
6
6
  "acidcat",
@@ -37,8 +37,8 @@
37
37
  "access": "public"
38
38
  },
39
39
  "dependencies": {
40
- "@acid-cat/catalog": "0.12.0",
41
- "@acid-cat/spec-ts": "0.12.0",
40
+ "@acid-cat/catalog": "0.13.0",
41
+ "@acid-cat/spec-ts": "0.13.0",
42
42
  "@effect/platform-node": "^4.1.3",
43
43
  "@effect/platform-node-shared": "^4.1.3",
44
44
  "@modelcontextprotocol/client": "2.4.0",