@plurnk/plurnk-service 0.46.0 → 0.50.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 (70) hide show
  1. package/.env.example +19 -2
  2. package/SPEC.md +10 -4
  3. package/dist/core/Engine.d.ts +1 -0
  4. package/dist/core/Engine.d.ts.map +1 -1
  5. package/dist/core/Engine.js +45 -7
  6. package/dist/core/Engine.js.map +1 -1
  7. package/dist/core/Engine.sql +19 -2
  8. package/dist/core/ExecutorRegistry.d.ts +3 -0
  9. package/dist/core/ExecutorRegistry.d.ts.map +1 -1
  10. package/dist/core/ExecutorRegistry.js.map +1 -1
  11. package/dist/core/SchemeRegistry.d.ts +2 -1
  12. package/dist/core/SchemeRegistry.d.ts.map +1 -1
  13. package/dist/core/SchemeRegistry.js +54 -15
  14. package/dist/core/SchemeRegistry.js.map +1 -1
  15. package/dist/core/packet-inject.d.ts +3 -0
  16. package/dist/core/packet-inject.d.ts.map +1 -0
  17. package/dist/core/packet-inject.js +16 -0
  18. package/dist/core/packet-inject.js.map +1 -0
  19. package/dist/core/session-settings.d.ts +1 -0
  20. package/dist/core/session-settings.d.ts.map +1 -1
  21. package/dist/core/session-settings.js +2 -1
  22. package/dist/core/session-settings.js.map +1 -1
  23. package/dist/core/teaching.d.ts +3 -0
  24. package/dist/core/teaching.d.ts.map +1 -0
  25. package/dist/core/teaching.js +11 -0
  26. package/dist/core/teaching.js.map +1 -0
  27. package/dist/schemes/Exec.d.ts.map +1 -1
  28. package/dist/schemes/Exec.js +11 -5
  29. package/dist/schemes/Exec.js.map +1 -1
  30. package/dist/schemes/ExecOutputScheme.d.ts +20 -0
  31. package/dist/schemes/ExecOutputScheme.d.ts.map +1 -0
  32. package/dist/schemes/ExecOutputScheme.js +38 -0
  33. package/dist/schemes/ExecOutputScheme.js.map +1 -0
  34. package/dist/schemes/Known.d.ts.map +1 -1
  35. package/dist/schemes/Known.js +0 -1
  36. package/dist/schemes/Known.js.map +1 -1
  37. package/dist/schemes/Log.d.ts.map +1 -1
  38. package/dist/schemes/Log.js +0 -1
  39. package/dist/schemes/Log.js.map +1 -1
  40. package/dist/schemes/Run.d.ts.map +1 -1
  41. package/dist/schemes/Run.js +0 -1
  42. package/dist/schemes/Run.js.map +1 -1
  43. package/dist/schemes/Unknown.d.ts.map +1 -1
  44. package/dist/schemes/Unknown.js +0 -1
  45. package/dist/schemes/Unknown.js.map +1 -1
  46. package/dist/schemes/exec-receipt.d.ts +4 -0
  47. package/dist/schemes/exec-receipt.d.ts.map +1 -0
  48. package/dist/schemes/exec-receipt.js +25 -0
  49. package/dist/schemes/exec-receipt.js.map +1 -0
  50. package/dist/server/Daemon.d.ts +1 -0
  51. package/dist/server/Daemon.d.ts.map +1 -1
  52. package/dist/server/Daemon.js +24 -6
  53. package/dist/server/Daemon.js.map +1 -1
  54. package/dist/server/MethodRegistry.d.ts +2 -0
  55. package/dist/server/MethodRegistry.d.ts.map +1 -1
  56. package/dist/server/methods/loop_run.d.ts.map +1 -1
  57. package/dist/server/methods/loop_run.js +7 -1
  58. package/dist/server/methods/loop_run.js.map +1 -1
  59. package/dist/server/methods/providers_list.d.ts.map +1 -1
  60. package/dist/server/methods/providers_list.js +15 -8
  61. package/dist/server/methods/providers_list.js.map +1 -1
  62. package/dist/server/methods/session_create.d.ts.map +1 -1
  63. package/dist/server/methods/session_create.js +9 -1
  64. package/dist/server/methods/session_create.js.map +1 -1
  65. package/docs/known.md +3 -0
  66. package/docs/log.md +25 -0
  67. package/docs/run.md +3 -0
  68. package/docs/unknown.md +3 -0
  69. package/migrations/0000-00-00.01_schema.sql +6 -0
  70. package/package.json +12 -9
package/docs/log.md ADDED
@@ -0,0 +1,25 @@
1
+ # `log://` — your run's event history, and how to manage it
2
+
3
+ Every operation you emit is recorded as a row at `log:///<loop>/<turn>/<seq>`. The log is your working memory's ledger — what you've done and what came back. READ a row to recover an earlier op's actual result body (chain a matcher to extract a value). The engine writes it; you read and CURATE it.
4
+
5
+ ## The two budget surfaces
6
+
7
+ You manage working-memory tokens across two surfaces:
8
+
9
+ - **The log** — every operation, in order. The curatable surface.
10
+ - **`plurnk:///manifest.json`** — the directory of every entry available to READ. Discovery, not history.
11
+
12
+ ## Curation — OPEN, FOLD, KILL
13
+
14
+ Your context carries a `tokensFree` budget; keeping it lean keeps your reasoning sharp, because irrelevant tokens degrade signal. Three moves, all on the log:
15
+
16
+ - **FOLD** a row → contracts it to its one-line summary, reclaiming the body's tokens. Non-destructive: a folded row stays listed and re-OPENable. Your primary hygiene tool — fold a row the moment its body has served its purpose.
17
+ - **OPEN** a folded row → restores its full body, spending from `tokensFree`. Use it to revisit a result you folded too early.
18
+ - **KILL** a row → erases it. Sparingly, for rows whose very existence (not just body) is noise.
19
+
20
+ ## Patterns
21
+
22
+ - **Fold-as-you-go.** Once you've extracted what you need from a large READ or EXEC result, FOLD it. Don't carry raw bodies you've already digested.
23
+ - **Bulk fold.** `FOLD(log:///**/get)<101,200>` collapses a range of matching rows in one move — clear a burst of exploratory reads once they've paid out.
24
+ - **Recover on demand.** Folded ≠ gone. If a later turn needs a folded result, OPEN it (or READ the row directly with a matcher).
25
+ - **Don't wait for the grinder.** When `tokensFree` runs low the engine's budget grinder folds for you to fit the turn — but it's a mechanical last resort. Curating deliberately keeps the rows YOU value and avoids the overflow in the first place.
package/docs/run.md ADDED
@@ -0,0 +1,3 @@
1
+ # `run://` — sibling agent runs
2
+
3
+ Sister agent runs in this session. `run:///.` is you; `run:///<name>` is a sibling. EDIT(run:///name):prompt SPAWNS a new sibling seeded with that prompt; SEND(run:///name):msg messages a sibling, waking it if idle; COPY(run:///.):prompt FORKS — branches a run with your log so far, then continues it with the prompt; KILL(run:///name) ENDS a sibling. Siblings share this session's files and entries; only the conversation log is private to each.
@@ -0,0 +1,3 @@
1
+ # `unknown://` — the catch-all scheme
2
+
3
+ The catch-all an address falls into when its scheme isn't one you recognize. It behaves like `known:///` — the unrecognized URI still becomes an addressable entry you can EDIT, READ, FIND, and SEND — so a typo or an unmodeled scheme degrades to a usable entry rather than an error.
@@ -49,6 +49,12 @@ CREATE TABLE IF NOT EXISTS loops (
49
49
  status INTEGER NOT NULL DEFAULT 102 CHECK (status IN (100, 102, 200, 202, 413, 429, 499, 500, 508)),
50
50
  prompt TEXT NOT NULL,
51
51
  flags TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(flags)),
52
+ -- #249 — attribution tags of the loop's active plugins (string[] JSON); the activity tagged
53
+ -- with what its plugins offer. Same set the engine rides on each turn's generate() wire.
54
+ attributions TEXT NOT NULL DEFAULT '[]' CHECK (json_valid(attributions)),
55
+ -- #260 — client-passed @file paths foisted as turn-0 READs (string[] JSON). The daemon owns the
56
+ -- workspace, so it READs them in instead of the client inlining bytes (co-location law).
57
+ open_paths TEXT NOT NULL DEFAULT '[]' CHECK (json_valid(open_paths)),
52
58
  -- §run-scheme loop-termination delta: terminated_at is stamped by the trigger
53
59
  -- below when status crosses into terminal (every death-path, uniformly);
54
60
  -- terminal_message is the deliverable — the SEND[200] body or the abandonment
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-service",
3
- "version": "0.46.0",
3
+ "version": "0.50.0",
4
4
  "description": "Plurnk agent runtime — the server / engine / core. Implements the @plurnk/plurnk-grammar contract.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -20,6 +20,7 @@
20
20
  "files": [
21
21
  ".env.example",
22
22
  "dist/**/*",
23
+ "docs/**/*",
23
24
  "migrations/**/*.sql",
24
25
  "requirements.md",
25
26
  "README.md",
@@ -48,18 +49,20 @@
48
49
  "build:local:install": "node scripts/install-sandbox.mjs install",
49
50
  "build:local:uninstall": "node scripts/install-sandbox.mjs uninstall",
50
51
  "test:installation": "node scripts/test-installation.mjs",
51
- "prepare": "npm run build"
52
+ "deps:audit": "node scripts/deps-audit.ts",
53
+ "prepare": "npm run build",
54
+ "prepublishOnly": "npm run deps:audit"
52
55
  },
53
56
  "dependencies": {
54
- "@plurnk/plurnk-execs": "0.4.13",
55
- "@plurnk/plurnk-execs-all": "0.1.5",
56
- "@plurnk/plurnk-grammar": "0.73.3",
57
- "@plurnk/plurnk-mimetypes": "0.15.21",
58
- "@plurnk/plurnk-mimetypes-all": "0.5.1",
57
+ "@plurnk/plurnk-execs": "0.4.15",
58
+ "@plurnk/plurnk-execs-all": "0.1.6",
59
+ "@plurnk/plurnk-grammar": "0.73.8",
60
+ "@plurnk/plurnk-mimetypes": "0.15.23",
61
+ "@plurnk/plurnk-mimetypes-all": "0.5.2",
59
62
  "@plurnk/plurnk-providers": "0.13.0",
60
63
  "@plurnk/plurnk-providers-all": "0.8.0",
61
- "@plurnk/plurnk-schemes": "0.29.2",
62
- "@plurnk/plurnk-schemes-all": "0.1.14",
64
+ "@plurnk/plurnk-schemes": "0.29.5",
65
+ "@plurnk/plurnk-schemes-all": "0.1.19",
63
66
  "@possumtech/sqlrite": "5.2.0",
64
67
  "diff": "^9.0.0",
65
68
  "ws": "^8.20.1"