@procedures/client 0.52.2 → 0.53.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/CHANGELOG.md +60 -0
- package/README.md +11 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/adapters/http/client/batch.d.ts.map +1 -1
- package/dist/adapters/http/client/batch.js +9 -5
- package/dist/adapters/http/client/batch.js.map +1 -1
- package/dist/adapters/http/server/cors.d.ts.map +1 -1
- package/dist/adapters/http/server/cors.js +2 -0
- package/dist/adapters/http/server/cors.js.map +1 -1
- package/dist/adapters/port/transport.d.ts +27 -0
- package/dist/adapters/port/transport.d.ts.map +1 -1
- package/dist/adapters/port/transport.js +30 -0
- package/dist/adapters/port/transport.js.map +1 -1
- package/dist/browser.d.ts +2 -2
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/client/batch-executor.d.ts +3 -0
- package/dist/client/batch-executor.d.ts.map +1 -1
- package/dist/client/batch-executor.js +3 -0
- package/dist/client/batch-executor.js.map +1 -1
- package/dist/client/client.d.ts +2 -0
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +33 -5
- package/dist/client/client.js.map +1 -1
- package/dist/client/middleware/cache.d.ts.map +1 -1
- package/dist/client/middleware/cache.js +2 -0
- package/dist/client/middleware/cache.js.map +1 -1
- package/dist/client/middleware/rate-limit.d.ts.map +1 -1
- package/dist/client/middleware/rate-limit.js +3 -2
- package/dist/client/middleware/rate-limit.js.map +1 -1
- package/dist/events/bus.d.ts +7 -0
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/events/bus.js +22 -4
- package/dist/events/bus.js.map +1 -1
- package/dist/events/publisher.d.ts.map +1 -1
- package/dist/events/publisher.js +4 -3
- package/dist/events/publisher.js.map +1 -1
- package/dist/frame-encoding.d.ts +8 -5
- package/dist/frame-encoding.d.ts.map +1 -1
- package/dist/frame-encoding.js +13 -8
- package/dist/frame-encoding.js.map +1 -1
- package/dist/procedures/interceptors.d.ts +10 -1
- package/dist/procedures/interceptors.d.ts.map +1 -1
- package/dist/procedures/interceptors.js +31 -8
- package/dist/procedures/interceptors.js.map +1 -1
- package/dist/procedures/module.d.ts.map +1 -1
- package/dist/procedures/module.js +7 -2
- package/dist/procedures/module.js.map +1 -1
- package/dist/server/host-policy.d.ts +8 -0
- package/dist/server/host-policy.d.ts.map +1 -1
- package/dist/server/host-policy.js +15 -2
- package/dist/server/host-policy.js.map +1 -1
- package/dist/server/limits.d.ts +1 -0
- package/dist/server/limits.d.ts.map +1 -1
- package/dist/server/limits.js +13 -0
- package/dist/server/limits.js.map +1 -1
- package/dist/server/procedure-server.d.ts +30 -1
- package/dist/server/procedure-server.d.ts.map +1 -1
- package/dist/server/procedure-server.js +68 -6
- package/dist/server/procedure-server.js.map +1 -1
- package/dist/tracing/otel.d.ts +55 -0
- package/dist/tracing/otel.d.ts.map +1 -0
- package/dist/tracing/otel.js +114 -0
- package/dist/tracing/otel.js.map +1 -0
- package/dist/tracing/traceparent.d.ts +40 -12
- package/dist/tracing/traceparent.d.ts.map +1 -1
- package/dist/tracing/traceparent.js +49 -14
- package/dist/tracing/traceparent.js.map +1 -1
- package/package.json +15 -5
- package/src/adapters/http/client/batch.ts +8 -5
- package/src/adapters/http/server/cors.ts +2 -0
- package/src/adapters/port/transport.ts +44 -0
- package/src/browser.ts +2 -2
- package/src/client/batch-executor.ts +3 -0
- package/src/client/client.ts +31 -5
- package/src/client/middleware/cache.ts +2 -0
- package/src/client/middleware/rate-limit.ts +4 -2
- package/src/events/bus.ts +25 -4
- package/src/events/publisher.ts +6 -3
- package/src/frame-encoding.ts +15 -8
- package/src/procedures/interceptors.ts +40 -9
- package/src/procedures/module.ts +10 -2
- package/src/server/host-policy.ts +24 -2
- package/src/server/limits.ts +13 -0
- package/src/server/procedure-server.ts +79 -8
- package/src/tracing/otel.ts +122 -0
- package/src/tracing/traceparent.ts +56 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# @procedures/client
|
|
2
2
|
|
|
3
|
+
## 0.53.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 84f0c78: The mongo store limits its change reads and its passes of the views with `semaphore()` of `@mark1russell7/collections`, the home of the semaphore. The behavior does not change: the permits go to the callers in FIFO order.
|
|
8
|
+
|
|
9
|
+
The class `Semaphore` of `@procedures/client` is deprecated. Use `semaphore(permits)` of `@mark1russell7/collections` in its place. Its `run(task)` replaces `withPermit(fn)`, and its `acquire()` gives the release function. The next MINOR break of `@procedures/client` removes the class.
|
|
10
|
+
- abf290c: `hostPolicy()` takes the option `trustBaggage`, and `procedureServerOptions()` gives it to the `ProcedureServer` (C10). A host made from a policy can now trust the baggage of more callers.
|
|
11
|
+
|
|
12
|
+
## 0.53.0
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- bc98f77: `isW3cIds()`, `parseTraceparent()`, `newTraceId()` and `newSpanId()` check the ids with `isValidTraceId()` and `isValidSpanId()` of `@opentelemetry/api` (decision D7 of otel-ts). The results do not change. An id of only zeros is not valid, and `isW3cIds()` still refuses uppercase digits, as W3C Trace Context requires.
|
|
17
|
+
- 11d9084: The browser entry exports `electronPortOf` and the type `MainPortLike`. The function gives the `PortLike` of a `MessagePortMain` of Electron, whose listener gets an event with the message in `data`. An Electron app can delete its own adapter.
|
|
18
|
+
- d28ccb5: Each handler runs in the context of OpenTelemetry of its caller (roadmap item C10 of otel-ts). Thus its logs, metrics, spans and nested calls carry the ids of the trace of the caller, also on a host with no tracing interceptor.
|
|
19
|
+
|
|
20
|
+
- `ProcedureServer` makes the remote span of the `traceparent` and `tracestate` of the metadata the parent of the handler. It uses the `baggage` of the metadata only from a trusted caller: a local request, a request with the token of the server, or a request that the new option `trustBaggage(request)` names. For another caller, the handler runs with no baggage, also when the HTTP instrumentation of an SDK read a `baggage` header.
|
|
21
|
+
- The MCP face puts the keys `traceparent`, `tracestate` and `baggage` of the `_meta` of a tool call into the metadata of the call. Over Streamable HTTP, the headers with these names apply when `_meta` does not have the key.
|
|
22
|
+
- `mark` sends the environment variables `TRACEPARENT`, `TRACESTATE` and `BAGGAGE` with its call, as the metadata keys `traceparent`, `tracestate` and `baggage`.
|
|
23
|
+
- 735cfcf: A call with no active span continues the trace context that the caller gave in its metadata (roadmap item C19 of otel-ts). Before, with an SDK, the client span of such a call started a new trace, and the propagator wrote that trace over the `traceparent` of the metadata. Thus `mark` in a program with an SDK lost the trace of its variables `TRACEPARENT` and `TRACESTATE`: the baggage came to the handler, but its spans and logs were in another trace. An active span is still the parent when there is one, and each try reads the trace context of the caller, not the trace context of the try before it.
|
|
24
|
+
|
|
25
|
+
The unit tests of `@procedures/mark` use the propagation gate of rigor-testkit on the two entries of `mark`: the MCP face and the CLI call to the CLI server. Each call of the gate runs in the root context, so only the carrier of the entry (`_meta`, or the environment variables) takes the context. The gate found this fault.
|
|
26
|
+
- The packages use the new versions of their dependencies of the owner: `@mark1russell7/service` `^0.8.3`, `@mark1russell7/coeval` `^0.26.1` and `@mark1russell7/docker-sqlite` `^0.3.0`. The range of `@mark1russell7/collections` stays `^0.5.0`: its version 0.7.0 and later remove names that `@procedures/collections` exports.
|
|
27
|
+
- 556d0a8: The packages use `@mark1russell7/service` `^0.8.2` in place of `^0.6.0`. Version 0.7.0 adds the refusal cause `capacity`, and version 0.8.0 refuses a listen backlog of 0. Version 0.8.2 adds the call context of OpenTelemetry. The types `Clock` and `Cancel` of `@mark1russell7/service/clock` do not change: their home is `@mark1russell7/algebra/clock`, and the entry gives them again.
|
|
28
|
+
|
|
29
|
+
A refusal of a call limit with the cause `capacity` gives `RATE_LIMITED` that is not retryable and has no `retry-after`. A take of one unit does not get this cause, because each policy holds 1 unit or more.
|
|
30
|
+
|
|
31
|
+
## 0.52.5
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- 25a5f44: The calls of a client and the invocations of a host use the context of OpenTelemetry (roadmap item C8 of otel-ts, decisions D5 and D6).
|
|
36
|
+
|
|
37
|
+
- `@procedures/client` now depends on `@opentelemetry/api`. The API does nothing until a program registers an SDK, for example with `startNodeTelemetry()` of `@mark1russell7/otel-ts/node`.
|
|
38
|
+
- With an SDK, each try of a call is a client span of the API. The registered propagator writes `traceparent`, `tracestate` and `baggage` into the metadata, with the mark of an internal call. The propagator of otel-ts sends the baggage only on a call with this mark.
|
|
39
|
+
- With an SDK, `tracingInterceptor` takes the span ids from a span of the API: a host span for a call of a host, an internal span for a nested call. The handler runs in the context of its span. The host reads no baggage from the metadata.
|
|
40
|
+
- With no SDK, the behavior does not change: the W3C code of R16 operates.
|
|
41
|
+
- The new option `apiSpans: false` of `tracingInterceptor` turns the spans of the API off. `metricsInterceptor` uses it.
|
|
42
|
+
- `tracestate` and `baggage` are in the default CORS headers, and the cache key does not use them.
|
|
43
|
+
- The W3C exports of `tracing/traceparent.ts` are `@deprecated`. A later MINOR removes them, when the site, MiniMongo, Graph and jarvis register an SDK.
|
|
44
|
+
|
|
45
|
+
## 0.52.4
|
|
46
|
+
|
|
47
|
+
No changes in this release.
|
|
48
|
+
|
|
49
|
+
## 0.52.3
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- db1bcaa: Fixes of the weekly audit of 2026-11-08:
|
|
54
|
+
|
|
55
|
+
- `@procedures/client`: the batch reader of the HTTP client goes on after the abort of a call with a full buffer. Before, the reader waited with no end, and the other calls of the batch waited too.
|
|
56
|
+
- `@procedures/client`: a subscriber that joins after a publish gets the new value of an object that changed and is published again. Before, it could get the text of the first publish.
|
|
57
|
+
- `@procedures/client`: a lazy registry loads no package for a request that the server refuses, or for a path outside the expose rule of the face. A lazy registry warns about at most 1000 paths that are not in its index.
|
|
58
|
+
- `@procedures/client`: an `exclude` entry with a plain dot hides a path whose segment has a dot, as the encoded key does.
|
|
59
|
+
- `@procedures/mongo`: a full answer keeps each item when the stored ids are not strings. A change stream that stops in a split event opens again before the event, and joins all its fragments.
|
|
60
|
+
- `@procedures/restic`: an `sftp:` location with a part after an `@` that starts with `-` gets a refusal.
|
|
61
|
+
- `@procedures/cli-run`: the doc of `cli.run` tells that a value that starts with `@` goes to `mark` as it is.
|
|
62
|
+
|
|
3
63
|
## 0.52.2
|
|
4
64
|
|
|
5
65
|
No changes in this release.
|
package/README.md
CHANGED
|
@@ -135,6 +135,17 @@ A host controls which procedures its callers reach, also through nested calls. S
|
|
|
135
135
|
- A procedure of code declares its nested calls in `metadata.calls`. With `strictCalls`, a procedure that declares nothing calls only exposed procedures.
|
|
136
136
|
- Interceptors run around each invocation and its nested calls: `timeoutInterceptor`, `tracingInterceptor`, `metricsInterceptor`.
|
|
137
137
|
|
|
138
|
+
#### Traces with OpenTelemetry
|
|
139
|
+
|
|
140
|
+
The client uses `@opentelemetry/api` only. The API does nothing until the program registers an SDK, for example with `startNodeTelemetry()` of `@mark1russell7/otel-ts/node`.
|
|
141
|
+
|
|
142
|
+
- With an SDK, each try of a call is a client span. The registered propagator writes `traceparent`, `tracestate` and `baggage` into the metadata of the call.
|
|
143
|
+
- The parent of the client span is the active span. When no span is active, the parent is the `traceparent` and `tracestate` that the caller gave in the metadata of the call. For example, `mark` gives the variables `TRACEPARENT` and `TRACESTATE` of its environment there.
|
|
144
|
+
- The client marks each call as an internal call. The propagator of otel-ts sends the baggage only on an internal call.
|
|
145
|
+
- With an SDK, `tracingInterceptor` makes a host span for a call of a host, and an internal span for a nested call. The handler runs in the context of its span.
|
|
146
|
+
- The host reads no baggage from the metadata. `@procedures/peer` reads it from a trusted caller.
|
|
147
|
+
- With no SDK, the client sends the W3C `traceparent` of its own ids, as before.
|
|
148
|
+
|
|
138
149
|
### 5. Related Packages
|
|
139
150
|
|
|
140
151
|
- `@procedures/collections`: data structures (`List`, `Map`, `Set`, `Queue`) and composable behaviors (LRU, TTL, bounded, evented).
|