@procedures/peer 0.47.1 → 0.48.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/CHANGELOG.md +49 -30
- package/README.md +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/host/faces.d.ts +2 -2
- package/dist/host/faces.js +1 -1
- package/package.json +6 -6
- package/src/host/faces.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @procedures/peer
|
|
2
2
|
|
|
3
|
+
## 0.48.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [17a18ec]
|
|
8
|
+
- Updated dependencies [06088f9]
|
|
9
|
+
- Updated dependencies [71f9c6e]
|
|
10
|
+
- Updated dependencies [c839add]
|
|
11
|
+
- @procedures/client@0.48.0
|
|
12
|
+
|
|
13
|
+
## 0.47.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [0650616]
|
|
18
|
+
- Updated dependencies [ae1e3fd]
|
|
19
|
+
- Updated dependencies [f1ece74]
|
|
20
|
+
- @procedures/client@0.47.2
|
|
21
|
+
|
|
3
22
|
## 0.47.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -200,8 +219,8 @@
|
|
|
200
219
|
- A host whose `expose`, policy or limit pattern names such a path in text uses the encoded form, for example `collections.e2e%2Etabs.*`.
|
|
201
220
|
- An `mcpExclude` entry, an `expose` deny entry or a limit entry in the old raw form, for example `collections.e2e.tabs.drop`, does not match. The check compares the encoded key, so the procedure becomes visible, or the limit does not apply. Write each such entry in the encoded form, for example `collections.e2e%2Etabs.drop`.
|
|
202
221
|
- A subscriber of a dotted collection uses `collectionChangeTopic(name)`. The raw topic `collections.a.b` is the topic of the partition `b` of `a`.
|
|
203
|
-
-
|
|
204
|
-
-
|
|
222
|
+
- An app: read the collection of a topic with `collectionTopicPartition(topic)`, not with a pattern, for example `/^collections\.([^.]+)\./`.
|
|
223
|
+
- Other apps: no change, if their collection names have no `.` and no `%`.
|
|
205
224
|
|
|
206
225
|
### Patch Changes
|
|
207
226
|
|
|
@@ -218,7 +237,7 @@
|
|
|
218
237
|
|
|
219
238
|
Migration:
|
|
220
239
|
|
|
221
|
-
-
|
|
240
|
+
- Apps: no change at this time. The deprecated names work until the next MINOR.
|
|
222
241
|
- Before the next MINOR, replace `zodAdapter<T>(schema)` with `schema`. To keep the check of a schema against a type, write `const schema: z.ZodType<T> = ...`.
|
|
223
242
|
- Before the next MINOR, replace `typedAnySchema<T>()` and `outputSchema<T>()` with `typed<T>()`.
|
|
224
243
|
- A parse-only object (`{ parse }`) in `zodAdapter` becomes a Standard Schema with a `~standard` property.
|
|
@@ -423,13 +442,13 @@
|
|
|
423
442
|
- A face of your own that gives `mcpFace()` a handler of its own: give the handler `admission: (credentials) => server.admission(credentials)`.
|
|
424
443
|
- An MCP client that a request hook refuses gets 401 at `initialize`. Give it valid credentials for each HTTP request.
|
|
425
444
|
- The site: no change. It has no MCP host, and it used no function of `peer/security.ts`.
|
|
426
|
-
-
|
|
427
|
-
-
|
|
428
|
-
-
|
|
429
|
-
-
|
|
430
|
-
-
|
|
431
|
-
-
|
|
432
|
-
-
|
|
445
|
+
- An app: no change. Its dev host has only the HTTP and WebSocket faces of `createProcedureHost()`. Each request of these faces had one check before.
|
|
446
|
+
- An app: its `mcpFace()` on the procedures host uses a session hook for each HTTP request. In the accounts mode, a request without a session gets `ANONYMOUS`. Thus an MCP client without a session gets no 401 at `initialize`.
|
|
447
|
+
- An app: in the mode `on` (`AUTH_MODE=on`), a request without a tenant token gets 401 at `initialize`. Before, the client opened a session and listed the tools, and each tool call got `UNAUTHORIZED`.
|
|
448
|
+
- An app: accounts that are not ready (the error `UNAVAILABLE` of the hook) give 401 at `initialize`, with `WWW-Authenticate: Bearer`. Before, `initialize` passed, and each tool call got `UNAUTHORIZED`. An MCP client can start its OAuth discovery on this 401.
|
|
449
|
+
- An app: outside the accounts mode, the policy has `allowedOrigins: "*"`. The MCP face takes it, as the HTTP face does. A request with a cookie still needs a named origin. With the default `ambientCredentials: "always"` of its request hook, `"*"` permits no other origin.
|
|
450
|
+
- An app: to keep only the own origin on the MCP face, give `mcpFace({ allowedOrigins: [] })`. Its MCP host over stdio has no change.
|
|
451
|
+
- An app: no change. Its procedures host has only the HTTP face, and its MCP host has only stdio and SDK faces.
|
|
433
452
|
- `mark mcp --http --token` and `@procedures/mcp-dev-tools`: no change for a client. The token is the token of the server, and the server checks each HTTP request one time.
|
|
434
453
|
|
|
435
454
|
### Patch Changes
|
|
@@ -508,9 +527,9 @@
|
|
|
508
527
|
- A script that starts `mark server create` as a server in the foreground: start `mark --server` or `procedure-server` in its place.
|
|
509
528
|
- A program that calls `run()`, `main()` or `executeArgs()` of `@procedures/mark`: no change. It keeps its process. Give `ownsProcess: true` to give the process to the runner, as the bin does.
|
|
510
529
|
- The site: no change. It does not start `mark`.
|
|
511
|
-
-
|
|
512
|
-
-
|
|
513
|
-
-
|
|
530
|
+
- An app: no change. Its dev host starts through `runProcedureHost()`, not through `mark`.
|
|
531
|
+
- An app: no change. It does not start `mark`.
|
|
532
|
+
- An app: no change, unless one of its scripts reads the exit code of an interrupted `mark` command. Then apply the first step.
|
|
514
533
|
- @procedures/client@0.24.0
|
|
515
534
|
|
|
516
535
|
## 0.23.0
|
|
@@ -538,9 +557,9 @@
|
|
|
538
557
|
|
|
539
558
|
Migration:
|
|
540
559
|
|
|
541
|
-
- The site and
|
|
542
|
-
-
|
|
543
|
-
-
|
|
560
|
+
- The site and an app: no change. They have no MCP host.
|
|
561
|
+
- An app: no change. Its MCP hosts have no task store.
|
|
562
|
+
- An app: no change. Its MCP host has no tasks.
|
|
544
563
|
- polite-crawler-mcp: no change. Each request has the host token, so each session is one client. A session with 100 tasks gets fewer tasks only when ten or more sessions are near the limit. To keep the rule of CLI-51, give `new McpTaskStore({ reserve: 0 })`.
|
|
545
564
|
- A host whose clients each have many sessions under one principal: each client keeps at most `maxStored - reserve` tasks. To keep the rule of CLI-51, give `reserve: 0` in `tasks` of the host or in `new McpTaskStore()`.
|
|
546
565
|
- Updated dependencies [f20beb1]
|
|
@@ -622,7 +641,7 @@
|
|
|
622
641
|
|
|
623
642
|
Deprecated: at the timeout of 15 s, `server.start` gives `success: true` with the message "still loading" while the process still starts. From the next MINOR of the client group, a start that is not ready at the timeout gives `success: false`, with the PID of the process that still starts. Read the readiness probe or `mark server status` for the state.
|
|
624
643
|
|
|
625
|
-
|
|
644
|
+
Apps: no change. A host with a listener now also answers the paths under `/_probes`. Before, these paths got 404.
|
|
626
645
|
- @procedures/client@0.17.3
|
|
627
646
|
|
|
628
647
|
## 0.17.2
|
|
@@ -680,7 +699,7 @@
|
|
|
680
699
|
principalOf,
|
|
681
700
|
limits: [
|
|
682
701
|
{
|
|
683
|
-
name: "
|
|
702
|
+
name: "app.writes",
|
|
684
703
|
key: { claim: "tenant" },
|
|
685
704
|
covers: { writes: true },
|
|
686
705
|
policy: { type: "sliding-window", limit: { value: 120, unit: "count" }, window: { value: 1, unit: "min" } },
|
|
@@ -757,9 +776,9 @@
|
|
|
757
776
|
- A caller that finds a cut by the code `INTERNAL_ERROR`: look for `UNAVAILABLE` in its place. Do not retry the call when `retryable` is false.
|
|
758
777
|
- A handler that throws `UNAVAILABLE` with `retryable: false`: its HTTP status is 500 in place of 503. Without the flag, the error is retryable and gets 503. A retry middleware then sends the call again, so give `retryable: false` when the call can have had its effect.
|
|
759
778
|
- The site: no change is necessary. Its code does not read the code of a cut, or the HTTP status 503.
|
|
760
|
-
-
|
|
761
|
-
- The procedures host of
|
|
762
|
-
-
|
|
779
|
+
- An app: no change is necessary. Its code does not read `INTERNAL_ERROR`, `UNAVAILABLE` or the severity of an error.
|
|
780
|
+
- The procedures host of an app (APP-11): no change is necessary. Its code does not read `INTERNAL_ERROR`. Its error "the server has no AGENT_TOKEN" is `UNAVAILABLE` with `retryable: false`, so its HTTP status is 500 in place of 503. No code of the app reads that status.
|
|
781
|
+
- An app: no change is necessary. Its drain test already expects `UNAVAILABLE` with `retryable: false` for a cut procedure call (S6 A12). Its code reads only `NOT_FOUND` and `FORBIDDEN`.
|
|
763
782
|
- The `mark` CLI and `procedure-server`: no change is necessary. The lifecycle test of CI-2 expects `UNAVAILABLE` for the cut of `lifecycle.ticksOnce`.
|
|
764
783
|
|
|
765
784
|
### Patch Changes
|
|
@@ -805,10 +824,10 @@
|
|
|
805
824
|
- A host with an `expose` rule must list the collection procedures that it serves, for example `collections.notes.*`. `host.*` and `events.subscribe` stay always on.
|
|
806
825
|
- An app that pins its own procedures with `registerProcedures()` on a server with an expose rule: list them in the rule. Give `{ alwaysOn: true }` only to a procedure of the host itself.
|
|
807
826
|
- The site: no change is necessary. Its servers have no expose rule.
|
|
808
|
-
-
|
|
827
|
+
- An app: no change is necessary. Its server has an expose rule, but it pins no procedure and serves no collection.
|
|
809
828
|
- The `mark` CLI and `procedure-server`: no change is necessary. They serve no collection, and `--expose` keeps `host.*` and `events.subscribe` on.
|
|
810
|
-
-
|
|
811
|
-
- The procedures host of
|
|
829
|
+
- An app: no change is necessary. Its host has no expose rule.
|
|
830
|
+
- The procedures host of an app (APP-11): no change is necessary. Its rule `["collections.*", "app.*"]` lists the collection procedures. To hide `clear`, an `exclude` of the policy now has an effect.
|
|
812
831
|
|
|
813
832
|
### Patch Changes
|
|
814
833
|
|
|
@@ -827,7 +846,7 @@
|
|
|
827
846
|
|
|
828
847
|
- 9fccd90: `createProcedureHost()` has the new option `controller` (server stack CLI-45). `controller.requires` names the dependencies of the service that each call of the host needs. `host.controllers` gives them, and `host.declare(svc)` declares them on the controller of the host. While a check of one of them fails readiness, the service refuses each call with `UNAVAILABLE`, which a caller can send again. Without the option, the controller needs no dependency, as before.
|
|
829
848
|
|
|
830
|
-
|
|
849
|
+
An app needs this option: its procedure calls need its world store.
|
|
831
850
|
- Updated dependencies [b89e3fe]
|
|
832
851
|
- @procedures/client@0.12.1
|
|
833
852
|
|
|
@@ -856,7 +875,7 @@
|
|
|
856
875
|
|
|
857
876
|
Migration steps:
|
|
858
877
|
|
|
859
|
-
-
|
|
878
|
+
- Apps: no change is necessary. They do not start these entries.
|
|
860
879
|
- A script that starts `procedure-server` or `mark serve` and stops it with a signal: no change is necessary. Wait for the exit, in 10 s at most.
|
|
861
880
|
- A program that embeds the server outside a service: use `startServer()`, which starts it as a peer, and `peer.stop()`.
|
|
862
881
|
|
|
@@ -897,9 +916,9 @@
|
|
|
897
916
|
|
|
898
917
|
Migration steps:
|
|
899
918
|
|
|
900
|
-
- The site and
|
|
901
|
-
- The MCP host of
|
|
902
|
-
-
|
|
919
|
+
- The site and an app: no change is necessary, unless they read `/health` of a peer. Then call `host.info` with the token.
|
|
920
|
+
- The MCP host of an app: no change is necessary. To share the port of its procedures host, mount `mcpFace()` on its listener.
|
|
921
|
+
- Apps under `run()`: build the procedures with `createProcedureHost()`, and call `host.declare(svc)` in the service of the process. Give `listen` for a port of the host, or mount `host.handler` and `host.upgrade` on the listener of the app.
|
|
903
922
|
- A caller of `createPeer()` with a different token for each transport: give one token.
|
|
904
923
|
- A Docker `HEALTHCHECK` or a probe of Kubernetes that read `/health` of a peer: use the probes of the service. Give the service `probeServer({ port, server_retry_after })` on a port of its own, or mount `probeHandler(health, { prefix: "/health" })` on the port of the app. Both come from `@mark1russell7/service/http`, and they answer `/health/startup`, `/health/readiness` and `/health/liveness`. The lockfile check of a client calls `host.info` with the token of the lockfile.
|
|
905
924
|
- A test that read `/health` of a peer: call `host.info` with the token, or check the status 404.
|
|
@@ -982,7 +1001,7 @@
|
|
|
982
1001
|
|
|
983
1002
|
### Patch Changes
|
|
984
1003
|
|
|
985
|
-
- 389b054: A token check no longer tells the length of the token through its time. The peer compares the SHA-256 digests of the two tokens with `timingSafeEqual`. The `tokenMatches` of the client, which runs in a browser too, compares each character of the expected token for each presented token. Before, a token of another length returned at once.
|
|
1004
|
+
- 389b054: A token check no longer tells the length of the token through its time. The peer compares the SHA-256 digests of the two tokens with `timingSafeEqual`. The `tokenMatches` of the client, which runs in a browser too, compares each character of the expected token for each presented token. Before, a token of another length returned at once. A re-audit found it.
|
|
986
1005
|
- Updated dependencies [841d083]
|
|
987
1006
|
- Updated dependencies [389b054]
|
|
988
1007
|
- @procedures/client@0.7.0
|
package/README.md
CHANGED
|
@@ -174,7 +174,7 @@ import { createProcedureHost, httpFace, wsFace, LOCAL_LISTENER_KNOBS } from "@pr
|
|
|
174
174
|
|
|
175
175
|
const read = {
|
|
176
176
|
narrowing: { effects: { writes: [] } },
|
|
177
|
-
expose: ["programs.list", "programs.get", "procedure.get", "client.trace", "
|
|
177
|
+
expose: ["programs.list", "programs.get", "procedure.get", "client.trace", "api.*"],
|
|
178
178
|
};
|
|
179
179
|
const host = createProcedureHost({
|
|
180
180
|
registry,
|