@procedures/procedure 0.2.3 → 0.4.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 +56 -0
- package/README.md +7 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/procedures/procedure/new.d.ts +23 -7
- package/dist/procedures/procedure/new.d.ts.map +1 -1
- package/dist/procedures/procedure/new.js +200 -48
- package/dist/procedures/procedure/new.js.map +1 -1
- package/dist/procedures/procedure/registry.d.ts.map +1 -1
- package/dist/procedures/procedure/registry.js +3 -1
- package/dist/procedures/procedure/registry.js.map +1 -1
- package/package.json +3 -3
- package/src/procedures/procedure/new.ts +227 -51
- package/src/procedures/procedure/registry.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# @procedures/procedure
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bae25e2: `procedure.new` puts the procedure into the list that `defineModule` gets: an array literal, a variable of `module.ts`, or a spread of such a variable. Before, a variable list sent the procedure into `registerModules(registry, [...])`. When the list comes from another file or a function, `procedure.new` fails with the reason and writes nothing.
|
|
8
|
+
- Updated dependencies [d919678]
|
|
9
|
+
- Updated dependencies [057d69a]
|
|
10
|
+
- Updated dependencies [b2a1a1e]
|
|
11
|
+
- Updated dependencies [057d69a]
|
|
12
|
+
- Updated dependencies [057d69a]
|
|
13
|
+
- Updated dependencies [057d69a]
|
|
14
|
+
- Updated dependencies [057d69a]
|
|
15
|
+
- Updated dependencies [057d69a]
|
|
16
|
+
- Updated dependencies [afd6a19]
|
|
17
|
+
- Updated dependencies [057d69a]
|
|
18
|
+
- Updated dependencies [4e751da]
|
|
19
|
+
- @procedures/client@0.4.0
|
|
20
|
+
|
|
21
|
+
## 0.3.0
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 956e88b: One manifest type (roadmap R17). `describeRegistry(registry, { expose })` and `describeProcedure` (exported as `describeProcedureEntry`) describe each procedure: the path, the description, the tags, the effects, the JSON Schemas of the input and the output, the calls, an unbounded stream, the command-line metadata, and a hash of the manifest (`procedures.manifest/1`). The new procedure `procedure.manifest` gives it, and it is an MCP tool of the dev tools (63 tools). `procedure.get` gives the JSON Schemas and the effects. The context of a handler has the expose rule of its host (`ctx.expose`), and `procedure.get`, `procedure.list`, `procedure.manifest`, `procedure.export`, `client.lookup`, `mcp.list-tools`, `manifest.generate` and `_discovery.announce` show only the exposed procedures: before, an MCP tool could list the procedures that the host hides. `_discovery.announce` gives the JSON Schemas, and `manifest.generate`, `getProcedureInfos` and the manifest of `mark` use the one description.
|
|
26
|
+
- Updated dependencies [ddea529]
|
|
27
|
+
- Updated dependencies [b2a3e3a]
|
|
28
|
+
- Updated dependencies [a8c47f1]
|
|
29
|
+
- Updated dependencies [381ce3a]
|
|
30
|
+
- Updated dependencies [0c627f8]
|
|
31
|
+
- Updated dependencies [ae7f05f]
|
|
32
|
+
- Updated dependencies [7873940]
|
|
33
|
+
- Updated dependencies [a70d445]
|
|
34
|
+
- Updated dependencies [bc70357]
|
|
35
|
+
- Updated dependencies [07cc998]
|
|
36
|
+
- Updated dependencies [a6b01a9]
|
|
37
|
+
- Updated dependencies [c799cdd]
|
|
38
|
+
- Updated dependencies [540f8d9]
|
|
39
|
+
- Updated dependencies [b6daaec]
|
|
40
|
+
- Updated dependencies [5b9264e]
|
|
41
|
+
- Updated dependencies [956e88b]
|
|
42
|
+
- Updated dependencies [ff62281]
|
|
43
|
+
- Updated dependencies [d81d0ed]
|
|
44
|
+
- Updated dependencies [aa67cc7]
|
|
45
|
+
- Updated dependencies [061fa22]
|
|
46
|
+
- Updated dependencies [cfb9d69]
|
|
47
|
+
- Updated dependencies [43f7de5]
|
|
48
|
+
- Updated dependencies [b07bb50]
|
|
49
|
+
- Updated dependencies [4a3bfa1]
|
|
50
|
+
- Updated dependencies [bd0b626]
|
|
51
|
+
- Updated dependencies [a6be873]
|
|
52
|
+
- Updated dependencies [fb30718]
|
|
53
|
+
- Updated dependencies [c5528e4]
|
|
54
|
+
- Updated dependencies [fee5d9c]
|
|
55
|
+
- Updated dependencies [21f7743]
|
|
56
|
+
- Updated dependencies [31a0b46]
|
|
57
|
+
- @procedures/client@0.3.0
|
|
58
|
+
|
|
3
59
|
## 0.2.3
|
|
4
60
|
|
|
5
61
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -219,7 +219,12 @@ export interface UserCreateOutput {
|
|
|
219
219
|
export { userCreate } from "./create.js";
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
4. **Registration
|
|
222
|
+
4. **Registration**: the imports, the definition, and the item of the list of procedures go into `src/module.ts`. The list is the second argument of `defineModule`:
|
|
223
|
+
- an array literal: `defineModule("@procedures/demo", [userCreateProcedure])`
|
|
224
|
+
- a variable that `src/module.ts` declares as an array: `const procedures = [userCreateProcedure]`
|
|
225
|
+
- a spread of such a variable: `defineModule("@procedures/demo", [...procedures])`. The item goes into the array of the variable.
|
|
226
|
+
|
|
227
|
+
The definition goes before the list that uses it. When the list comes from another file or from a function, `procedure.new` fails and writes nothing. A package of the old kind, without `src/module.ts`, gets the procedure in the `registerProcedures([...])` array of `src/register.ts`:
|
|
223
228
|
```typescript
|
|
224
229
|
import { createProcedure, outputSchema, registerProcedures, zodAdapter } from "@procedures/client";
|
|
225
230
|
import { userCreate } from "./procedures/user/create.js";
|
|
@@ -243,7 +248,7 @@ export function register(): void {
|
|
|
243
248
|
}
|
|
244
249
|
```
|
|
245
250
|
|
|
246
|
-
If
|
|
251
|
+
If the file has no list that `procedure.new` can change, the result has `success: false`, the error gives the reason, and no file changes.
|
|
247
252
|
|
|
248
253
|
#### `procedure.list`
|
|
249
254
|
|