@procedures/peer 0.33.0 → 0.34.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 +58 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/input-schemas.d.ts.map +1 -1
- package/dist/input-schemas.js +12 -12
- package/dist/input-schemas.js.map +1 -1
- package/dist/procedures/server.call.d.ts.map +1 -1
- package/dist/procedures/server.call.js +4 -3
- package/dist/procedures/server.call.js.map +1 -1
- package/package.json +5 -5
- package/src/input-schemas.ts +12 -22
- package/src/procedures/server.call.ts +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# @procedures/peer
|
|
2
2
|
|
|
3
|
+
## 0.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d4376c2: A path segment with a dot or a `%` comes back the same after a trip over the wire (roadmap CLI-75, decision D36).
|
|
8
|
+
|
|
9
|
+
Before, the method name of `["collections", "e2e.tabs", "find"]` was `collections.e2e.tabs.find`. The server read it back as four segments, so the call got `NOT_FOUND`. In this release, each segment encodes `%` as `%25` and then `.` as `%2E` before the join:
|
|
10
|
+
|
|
11
|
+
- `pathToMethod(["collections", "e2e.tabs", "find"])` gives `{ service: "collections.e2e%2Etabs", operation: "find" }`, and `methodToPath()` gives the same path again.
|
|
12
|
+
- `pathToKey()`, `keyToPath()`, the body path of an HTTP request and `server.call` use the same encoding.
|
|
13
|
+
- The topic of a collection without a partition encodes the name too: `collectionChangeTopic("e2e.tabs")` gives `collections.e2e%2Etabs`. The topic of a partition already encoded the name (roadmap CLI-42).
|
|
14
|
+
- The decode accepts `%2E` and `%2e`, and it keeps each other `%` sequence. A topic must have the canonical form.
|
|
15
|
+
- A segment without `.` and `%` keeps its text. Thus the method names and the topics of such names do not change.
|
|
16
|
+
|
|
17
|
+
The new exports `encodeSegment()`, `decodeSegment()`, `segmentsToTopic()` and `topicToSegments()` do the encoding. Use them. Do not join or split the segments yourself.
|
|
18
|
+
|
|
19
|
+
Two collections thus do not have the same topic, and `ProcedureServer` accepts a storage of `a.b` next to partitions of `a` (before, roadmap CLI-57 and CLI-70 refused the two together). `CollectionTopicCollisionError` is deprecated, and no server throws it. A later release removes it.
|
|
20
|
+
|
|
21
|
+
MINOR (breaking, pre-1.0): a name with `.` or `%` gets a new method name, a new registry key and a new topic. The MCP tool names do not change.
|
|
22
|
+
|
|
23
|
+
The procedures `fs.read.json` and `fs.write.json` have the paths `["fs", "read", "json"]` and `["fs", "write", "json"]`. Before, their paths were `["fs", "read.json"]` and `["fs", "write.json"]`. With the encoding, those paths get the key `fs.read%2Ejson`, so the key `fs.read.json` of the callers does not find them. With three segments, the method name, the key and the MCP tool name stay the same.
|
|
24
|
+
|
|
25
|
+
The command line of `mark` reads the longest path that names a procedure. Thus `mark fs read json a.json` starts `fs.read.json`, and `mark fs read notes.txt` starts `fs.read`.
|
|
26
|
+
|
|
27
|
+
Migration:
|
|
28
|
+
|
|
29
|
+
- Upgrade the clients and the servers of a name with `.` or `%` together.
|
|
30
|
+
- A caller or a stored program that names the path as the list `["fs", "read.json"]` uses `["fs", "read", "json"]`, and `["fs", "write.json"]` becomes `["fs", "write", "json"]`. The text name `fs.read.json` and the MCP tool name `fs_read_json` do not change.
|
|
31
|
+
- There is no D13 alias at the old list paths. No consumer uses the list form, and an alias would give the MCP tool name `fs_read_json` twice.
|
|
32
|
+
- A host whose `expose`, policy or limit pattern names such a path in text uses the encoded form, for example `collections.e2e%2Etabs.*`.
|
|
33
|
+
- 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`.
|
|
34
|
+
- A subscriber of a dotted collection uses `collectionChangeTopic(name)`. The raw topic `collections.a.b` is the topic of the partition `b` of `a`.
|
|
35
|
+
- Graph: read the collection of a topic with `collectionTopicPartition(topic)`, not with a pattern, for example `/^collections\.([^.]+)\./`.
|
|
36
|
+
- The site, MiniMongo and jarvis: no change, if their collection names have no `.` and no `%`.
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- fa1a61a: Less boilerplate in each procedure definition (dedupe review F1, tracker item O58).
|
|
41
|
+
|
|
42
|
+
PATCH (pre-1.0): this change adds exports and deprecates names. It removes no export and changes no behavior.
|
|
43
|
+
|
|
44
|
+
- `@procedures/client` has the new export `typed<T>()`. It is the one pass-through schema that gives only the type `T`.
|
|
45
|
+
- `@procedures/client` has the new export `definePackage(name, procedures, requires?)`. It gives `{ module, register }` and registers nothing at the call. The new type `PackageDefinition` is its result.
|
|
46
|
+
- `zodAdapter` is deprecated. `input()` and `output()` take each Standard Schema and infer its type, so a zod schema goes in directly.
|
|
47
|
+
- `typedAnySchema` and `outputSchema` are deprecated. Use `typed<T>()`. They give the same pass-through schema.
|
|
48
|
+
- The procedures of the packages give their zod schemas to `input()` and `output()` directly. The `.build() as AnyProcedure` casts are gone. The schemas, the types of the exports and the validation do not change.
|
|
49
|
+
- `mark procedure new` writes `.input(<Name>InputSchema)` and `.output(<Name>OutputSchema)`, without `zodAdapter`.
|
|
50
|
+
|
|
51
|
+
Migration:
|
|
52
|
+
|
|
53
|
+
- The site, MiniMongo, Graph and jarvis: no change at this time. The deprecated names work until the next MINOR.
|
|
54
|
+
- 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> = ...`.
|
|
55
|
+
- Before the next MINOR, replace `typedAnySchema<T>()` and `outputSchema<T>()` with `typed<T>()`.
|
|
56
|
+
- A parse-only object (`{ parse }`) in `zodAdapter` becomes a Standard Schema with a `~standard` property.
|
|
57
|
+
- Updated dependencies [d4376c2]
|
|
58
|
+
- Updated dependencies [fa1a61a]
|
|
59
|
+
- @procedures/client@0.34.0
|
|
60
|
+
|
|
3
61
|
## 0.33.0
|
|
4
62
|
|
|
5
63
|
### Patch Changes
|