@acid-cat/cli 0.10.2 → 0.11.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 +3 -3
- package/dist/json/package.json.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ The AcidCat command line. npm package: `@acid-cat/cli`. It gives the `acid-cat`
|
|
|
6
6
|
acid-cat check [--strict] <catalog.json ...> # check catalogs
|
|
7
7
|
acid-cat format [--write] <catalog.json ...> # write catalogs in canonical form
|
|
8
8
|
acid-cat view <catalog.json> <target> # write the view of one target
|
|
9
|
-
acid-cat conform --mcp <url> [--mcp-handshake] --mcp-stdio "<command>" --http <url> --cli "<command>" --webmcp <url> [--deadline <ms>] # test an implementation
|
|
9
|
+
acid-cat conform --mcp <url> [--mcp-handshake] --mcp-stdio "<command>" --http <url> --cli "<command>" --webmcp <url> [--deadline <ms>] [--max-bytes <n>] # test an implementation
|
|
10
10
|
[--poll-buffer <n>] [--poll-lease-ms <ms>] [--webhook-principal <name> --webhook-cert <file> --webhook-key <file>]
|
|
11
11
|
[--webhook-other-principal <name>] [--webhook-min-ttl-ms <ms>] [--webhook-max-ttl-ms <ms>] [--webhook-max-subscriptions <n>]
|
|
12
12
|
```
|
|
@@ -45,7 +45,7 @@ The exit code is 0 if there are no errors. It is 1 if there are errors. With `--
|
|
|
45
45
|
- **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.
|
|
46
46
|
- **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.
|
|
47
47
|
- **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.
|
|
48
|
-
- **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. Each check uses a new key in its input, so the leases of an earlier run do not change the result.
|
|
48
|
+
- **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.
|
|
49
49
|
- **Webhook delivery:** through MCP over HTTP, with `--webhook-principal <name>`, `--webhook-cert <file>` and `--webhook-key <file>` together, or `webhook: { principal, cert, key }` in code, with the PEM text. The checks run an HTTPS receiver on `127.0.0.1` with this certificate. Configure the deployment under test for the test: it trusts the certificate, allows deliveries to private addresses, and gives the principal `<name>` to a request with the header `Authorization: Bearer <name>`. The checks test `Forbidden` with no principal, `-32602` for a URL that is not `https` and for a secret that is not valid, the verification and `challenge_failed`, the form of the result of `events/subscribe` and its subscription id, the headers, the signature and the body of each delivery, the order of the deliveries, a renewal that signs with the old and the new secret, `events/unsubscribe` and a second `events/unsubscribe`, a retry with the same `webhook-id` after a status 500, a 410 that abandons a delivery, the control message `gap` with the watermark before an occurrence with `truncated: true`, the control message `terminated`, and the lifetime that the server grants for a `ttlMs` below the minimum, above the maximum, `null` and absent.
|
|
50
50
|
- `--webhook-min-ttl-ms <ms>` and `--webhook-max-ttl-ms <ms>`, or `webhook.minTtlMs` and `webhook.maxTtlMs`, give the lifetimes of the deployment. The defaults are those of the specification: 60 000 and 3 600 000. With `--webhook-min-ttl-ms`, which must be shorter than the deadline, the checks also test that a subscription with no renewal ends at the end of its lifetime, and gets no more deliveries.
|
|
51
51
|
- `--webhook-max-subscriptions <n>`, or `webhook.maxSubscriptions`, gives the limit of subscriptions of one principal. With it, the checks subscribe until the server answers `ResourceExhausted` (`-32025`, with `data: { limit: "subscriptions", max }`), then renew one subscription.
|
|
@@ -54,7 +54,7 @@ The exit code is 0 if there are no errors. It is 1 if there are errors. With `--
|
|
|
54
54
|
|
|
55
55
|
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.
|
|
56
56
|
|
|
57
|
-
A check of a recommendation (SHOULD) that fails gives a warning, marked `!`, and passes. The exit code is 1 if a check fails.
|
|
57
|
+
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.
|
|
58
58
|
|
|
59
59
|
## Implementation
|
|
60
60
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acid-cat/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
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.
|
|
41
|
-
"@acid-cat/spec-ts": "0.
|
|
40
|
+
"@acid-cat/catalog": "0.11.1",
|
|
41
|
+
"@acid-cat/spec-ts": "0.11.1",
|
|
42
42
|
"@effect/platform-node": "^4.1.3",
|
|
43
43
|
"@effect/platform-node-shared": "^4.1.3",
|
|
44
44
|
"@modelcontextprotocol/client": "2.4.0",
|