@plurnk/plurnk-service 0.4.0 → 0.6.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.
Files changed (71) hide show
  1. package/README.md +13 -44
  2. package/SPEC.md +546 -445
  3. package/bin/plurnk-service.js +2 -1
  4. package/dist/core/ChannelWrite.d.ts +5 -0
  5. package/dist/core/ChannelWrite.d.ts.map +1 -1
  6. package/dist/core/ChannelWrite.js.map +1 -1
  7. package/dist/core/Engine.d.ts +8 -5
  8. package/dist/core/Engine.d.ts.map +1 -1
  9. package/dist/core/Engine.js +190 -99
  10. package/dist/core/Engine.js.map +1 -1
  11. package/dist/core/PluginLoader.js +6 -6
  12. package/dist/core/PluginLoader.js.map +1 -1
  13. package/dist/core/ProviderInstantiate.d.ts +4 -0
  14. package/dist/core/ProviderInstantiate.d.ts.map +1 -0
  15. package/dist/core/ProviderInstantiate.js +41 -0
  16. package/dist/core/ProviderInstantiate.js.map +1 -0
  17. package/dist/core/ProviderRegistry.d.ts.map +1 -1
  18. package/dist/core/ProviderRegistry.js +1 -1
  19. package/dist/core/ProviderRegistry.js.map +1 -1
  20. package/dist/core/SchemeRegistry.d.ts +1 -1
  21. package/dist/core/SchemeRegistry.d.ts.map +1 -1
  22. package/dist/core/SchemeRegistry.js +4 -20
  23. package/dist/core/SchemeRegistry.js.map +1 -1
  24. package/dist/core/line-marker.js +3 -3
  25. package/dist/core/line-marker.js.map +1 -1
  26. package/dist/core/matcher.d.ts +4 -6
  27. package/dist/core/matcher.d.ts.map +1 -1
  28. package/dist/core/matcher.js +61 -184
  29. package/dist/core/matcher.js.map +1 -1
  30. package/dist/core/mimetype-binary.js +1 -1
  31. package/dist/core/mimetype-binary.js.map +1 -1
  32. package/dist/core/packet-wire.d.ts.map +1 -1
  33. package/dist/core/packet-wire.js +130 -30
  34. package/dist/core/packet-wire.js.map +1 -1
  35. package/dist/core/scheme-types.d.ts +3 -26
  36. package/dist/core/scheme-types.d.ts.map +1 -1
  37. package/dist/core/scheme-types.js +5 -8
  38. package/dist/core/scheme-types.js.map +1 -1
  39. package/dist/index.d.ts +3 -2
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +14 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/schemes/Exec.d.ts.map +1 -1
  44. package/dist/schemes/Exec.js +12 -24
  45. package/dist/schemes/Exec.js.map +1 -1
  46. package/dist/schemes/File.d.ts +1 -0
  47. package/dist/schemes/File.d.ts.map +1 -1
  48. package/dist/schemes/File.js +11 -5
  49. package/dist/schemes/File.js.map +1 -1
  50. package/dist/schemes/Log.d.ts +1 -0
  51. package/dist/schemes/Log.d.ts.map +1 -1
  52. package/dist/schemes/Log.js +10 -4
  53. package/dist/schemes/Log.js.map +1 -1
  54. package/dist/schemes/_entry-ops.d.ts +1 -1
  55. package/dist/schemes/_entry-ops.d.ts.map +1 -1
  56. package/dist/schemes/_entry-ops.js +15 -20
  57. package/dist/schemes/_entry-ops.js.map +1 -1
  58. package/dist/server/Daemon.d.ts +11 -0
  59. package/dist/server/Daemon.d.ts.map +1 -1
  60. package/dist/server/Daemon.js +18 -0
  61. package/dist/server/Daemon.js.map +1 -1
  62. package/dist/server/MethodRegistry.d.ts +2 -2
  63. package/dist/server/MethodRegistry.d.ts.map +1 -1
  64. package/dist/server/methods/loop_resolve.js +2 -2
  65. package/dist/server/methods/loop_resolve.js.map +1 -1
  66. package/dist/server/methods/loop_run.d.ts.map +1 -1
  67. package/dist/server/methods/loop_run.js +2 -1
  68. package/dist/server/methods/loop_run.js.map +1 -1
  69. package/dist/server/methods/providers_list.js +1 -1
  70. package/dist/server/methods/providers_list.js.map +1 -1
  71. package/package.json +17 -12
package/README.md CHANGED
@@ -1,54 +1,23 @@
1
1
  # plurnk-service
2
2
 
3
- Engine library + admin CLI + daemon for the plurnk agent runtime. Speaks the [plurnk-grammar](https://github.com/plurnk/plurnk-grammar) contract; exposes a [WebSocket JSON-RPC surface](./SPEC.md#13) for clients (the user-facing CLI/TUI lives in [`plurnk`](https://github.com/plurnk/plurnk)).
3
+ LLM agent runtime engine. Consumes [plurnk-grammar](https://github.com/plurnk/plurnk-grammar); exposes WebSocket JSON-RPC for clients. User-facing CLI: [plurnk](https://github.com/plurnk/plurnk).
4
4
 
5
- ## Quick start
5
+ ## Documentation
6
6
 
7
- ```sh
8
- git clone github.com/plurnk/plurnk-service
9
- cd plurnk-service
10
- npm install
11
- ./bin/plurnk-service.js # boots daemon on ws://127.0.0.1:3044
12
- ```
7
+ - [`SPEC.md`](./SPEC.md) — canonical specification. 16 numbered sections. Anchors `{§<id>}` bind to integration tests (`test/intg/spec-anchors.test.ts`).
8
+ - [`AGENTS.md`](./AGENTS.md) — collaboration memory for agents working on this repo (gitignored).
13
9
 
14
- `.env.example` ships with sane defaults; the daemon auto-loads it. Override per-deployment in `.env` or via `--config=<path>`. Run `./bin/plurnk-service.js --help` for the flag surface.
10
+ ## Sibling contracts
15
11
 
16
- To talk to a real model, set in `.env`:
12
+ Author-facing contracts hosted in their own repos. plurnk-service is the consumer; consumption surface section noted.
17
13
 
18
- ```
19
- PLURNK_MODEL_<alias>=<provider>/<model-id>
20
- PLURNK_MODEL=<alias>
21
- OPENAI_BASE_URL=<endpoint> # for openai-family aliases
22
- ```
23
-
24
- Then `npm run test:live` for the end-to-end smoke against your configured model.
25
-
26
- ## Architecture
27
-
28
- - [`SPEC.md`](./SPEC.md) — engine surface, RPC contract, packet shape, op semantics. 15 numbered sections; promise anchors `{§<id>}` link to tests.
29
- - [`MIMETYPES.md`](./MIMETYPES.md) — contract for `@plurnk/plurnk-mimetypes-*` packages.
30
- - [`PROVIDERS.md`](./PROVIDERS.md) — contract for `@plurnk/plurnk-providers-*` packages.
31
- - [`SCHEMES.md`](./SCHEMES.md) — contract for `@plurnk/plurnk-schemes-*` packages.
32
- - [`AGENTS.md`](./AGENTS.md) — collaboration memory for agents working on this repo (gitignored; see SPEC for canonical state).
14
+ | Repo | Domain | Consumption |
15
+ |---|---|---|
16
+ | [plurnk-providers](https://github.com/plurnk/plurnk-providers) | LLM transports + tokenomic primitives | SPEC §2 |
17
+ | [plurnk-schemes](https://github.com/plurnk/plurnk-schemes) | URI scheme handlers | SPEC §3.6 |
18
+ | [plurnk-mimetypes](https://github.com/plurnk/plurnk-mimetypes) | Content interpreters | SPEC §4.5 |
19
+ | [plurnk-execs](https://github.com/plurnk/plurnk-execs) | Runtime executors (EXEC dispatch) | SPEC §10 |
33
20
 
34
21
  ## Tests
35
22
 
36
- ```sh
37
- npm run test:lint # tsc --noEmit
38
- npm run test:intg # integration tests (mock provider, real SQLite)
39
- npm run test:live # live tests (real provider; requires PLURNK_MODEL)
40
- npm run test:demo # demo tests (natural prompts; outcome assertions)
41
- ```
42
-
43
- Four tiers per SPEC §0.7. Cadence:
44
-
45
- - **lint** — every commit (CI enforces).
46
- - **intg** — every commit (CI enforces). Mock provider, real in-memory SQLite. Fast (~2s).
47
- - **live** — before merging significant engine changes. Real provider, structural prompts, wire-level assertions. Catches protocol drift and validates rail behavior against actual model failure modes. ~30–80s per test against gemma.
48
- - **demo** — periodic. Real provider, natural human-style prompts, outcome assertions. Validates the model + sysprompt + grammar trio. Failures indict the trio, not the engine. ~25s per test.
49
-
50
- CI runs lint + intg. live + demo are run locally with real provider config.
51
-
52
- ## License
53
-
54
- MIT.
23
+ Tiers per SPEC §0.7. Scripts: `test:lint`, `test:unit`, `test:intg`, `test:live`, `test:demo`.