@plurnk/plurnk-service 1.2.0 → 1.3.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 (168) hide show
  1. package/.env.defaults +7 -5
  2. package/README.md +16 -13
  3. package/SPEC.md +72 -130
  4. package/dist/build-info.d.ts +11 -0
  5. package/dist/build-info.d.ts.map +1 -0
  6. package/dist/build-info.js +45 -0
  7. package/dist/build-info.js.map +1 -0
  8. package/dist/build-info.json +1 -0
  9. package/dist/content/index.js +1 -1
  10. package/dist/content/index.js.map +1 -1
  11. package/dist/content/line-marker.js +1 -1
  12. package/dist/content/line-marker.js.map +1 -1
  13. package/dist/content/matcher.js +4 -4
  14. package/dist/content/matcher.js.map +1 -1
  15. package/dist/content/mimetype-binary.js +1 -1
  16. package/dist/content/mimetype-binary.js.map +1 -1
  17. package/dist/content/path-mimetype.js +1 -1
  18. package/dist/content/path-mimetype.js.map +1 -1
  19. package/dist/core/ChannelWrite.d.ts +2 -1
  20. package/dist/core/ChannelWrite.d.ts.map +1 -1
  21. package/dist/core/ChannelWrite.js +6 -19
  22. package/dist/core/ChannelWrite.js.map +1 -1
  23. package/dist/core/ChannelWrite.sql +2 -7
  24. package/dist/core/Dispatcher.d.ts.map +1 -1
  25. package/dist/core/Dispatcher.js +92 -23
  26. package/dist/core/Dispatcher.js.map +1 -1
  27. package/dist/core/Engine.d.ts +9 -0
  28. package/dist/core/Engine.d.ts.map +1 -1
  29. package/dist/core/Engine.js +126 -30
  30. package/dist/core/Engine.js.map +1 -1
  31. package/dist/core/Engine.sql +8 -6
  32. package/dist/core/PacketBuilder.js +1 -1
  33. package/dist/core/PacketBuilder.js.map +1 -1
  34. package/dist/core/PluginLoader.d.ts +1 -0
  35. package/dist/core/PluginLoader.d.ts.map +1 -1
  36. package/dist/core/PluginLoader.js +22 -11
  37. package/dist/core/PluginLoader.js.map +1 -1
  38. package/dist/core/ProposalLifecycle.d.ts.map +1 -1
  39. package/dist/core/ProposalLifecycle.js +11 -6
  40. package/dist/core/ProposalLifecycle.js.map +1 -1
  41. package/dist/core/ProviderInstantiate.d.ts +1 -0
  42. package/dist/core/ProviderInstantiate.d.ts.map +1 -1
  43. package/dist/core/ProviderInstantiate.js +8 -0
  44. package/dist/core/ProviderInstantiate.js.map +1 -1
  45. package/dist/core/SchemeRegistry.d.ts +3 -1
  46. package/dist/core/SchemeRegistry.d.ts.map +1 -1
  47. package/dist/core/SchemeRegistry.js +18 -11
  48. package/dist/core/SchemeRegistry.js.map +1 -1
  49. package/dist/core/caps/DbEntryCaps.d.ts +6 -5
  50. package/dist/core/caps/DbEntryCaps.d.ts.map +1 -1
  51. package/dist/core/caps/DbEntryCaps.js +36 -14
  52. package/dist/core/caps/DbEntryCaps.js.map +1 -1
  53. package/dist/core/caps/DbProjectionCaps.d.ts +11 -0
  54. package/dist/core/caps/DbProjectionCaps.d.ts.map +1 -0
  55. package/dist/core/caps/DbProjectionCaps.js +19 -0
  56. package/dist/core/caps/DbProjectionCaps.js.map +1 -0
  57. package/dist/core/caps/DbSubscriptionCaps.d.ts +3 -1
  58. package/dist/core/caps/DbSubscriptionCaps.d.ts.map +1 -1
  59. package/dist/core/caps/DbSubscriptionCaps.js +12 -3
  60. package/dist/core/caps/DbSubscriptionCaps.js.map +1 -1
  61. package/dist/core/caps/SchemeCtxImpl.d.ts +18 -4
  62. package/dist/core/caps/SchemeCtxImpl.d.ts.map +1 -1
  63. package/dist/core/caps/SchemeCtxImpl.js +26 -12
  64. package/dist/core/caps/SchemeCtxImpl.js.map +1 -1
  65. package/dist/core/fork.sql +4 -4
  66. package/dist/core/git-membership.d.ts.map +1 -1
  67. package/dist/core/git-membership.js +23 -0
  68. package/dist/core/git-membership.js.map +1 -1
  69. package/dist/core/packet-wire.d.ts.map +1 -1
  70. package/dist/core/packet-wire.js +3 -2
  71. package/dist/core/packet-wire.js.map +1 -1
  72. package/dist/core/path-decode.d.ts +1 -0
  73. package/dist/core/path-decode.d.ts.map +1 -1
  74. package/dist/core/path-decode.js +1 -0
  75. package/dist/core/path-decode.js.map +1 -1
  76. package/dist/core/plurnk-uri.d.ts.map +1 -1
  77. package/dist/core/plurnk-uri.js +5 -3
  78. package/dist/core/plurnk-uri.js.map +1 -1
  79. package/dist/core/resolveForLoop.js +1 -1
  80. package/dist/core/resolveForLoop.js.map +1 -1
  81. package/dist/core/results.js +2 -2
  82. package/dist/core/results.js.map +1 -1
  83. package/dist/core/scheme-types.d.ts.map +1 -1
  84. package/dist/core/scheme-types.js +1 -1
  85. package/dist/core/scheme-types.js.map +1 -1
  86. package/dist/core/search-gate.js +2 -2
  87. package/dist/core/search-gate.js.map +1 -1
  88. package/dist/digest/Digest.d.ts.map +1 -1
  89. package/dist/digest/Digest.js +79 -8
  90. package/dist/digest/Digest.js.map +1 -1
  91. package/dist/digest/digest.sql +1 -1
  92. package/dist/schemes/Exec.d.ts +2 -4
  93. package/dist/schemes/Exec.d.ts.map +1 -1
  94. package/dist/schemes/Exec.js +41 -11
  95. package/dist/schemes/Exec.js.map +1 -1
  96. package/dist/schemes/File.d.ts.map +1 -1
  97. package/dist/schemes/File.js +1 -0
  98. package/dist/schemes/File.js.map +1 -1
  99. package/dist/schemes/Log.d.ts.map +1 -1
  100. package/dist/schemes/Log.js +20 -0
  101. package/dist/schemes/Log.js.map +1 -1
  102. package/dist/schemes/Prompt.d.ts +6 -7
  103. package/dist/schemes/Prompt.d.ts.map +1 -1
  104. package/dist/schemes/Prompt.js +4 -5
  105. package/dist/schemes/Prompt.js.map +1 -1
  106. package/dist/schemes/Skill.d.ts +7 -9
  107. package/dist/schemes/Skill.d.ts.map +1 -1
  108. package/dist/schemes/Skill.js +5 -7
  109. package/dist/schemes/Skill.js.map +1 -1
  110. package/dist/schemes/Worker.d.ts.map +1 -1
  111. package/dist/schemes/Worker.js +1 -0
  112. package/dist/schemes/Worker.js.map +1 -1
  113. package/dist/schemes/_entry-chunk.d.ts +4 -1
  114. package/dist/schemes/_entry-chunk.d.ts.map +1 -1
  115. package/dist/schemes/_entry-chunk.js +76 -22
  116. package/dist/schemes/_entry-chunk.js.map +1 -1
  117. package/dist/schemes/_entry-crud.d.ts.map +1 -1
  118. package/dist/schemes/_entry-crud.js +0 -10
  119. package/dist/schemes/_entry-crud.js.map +1 -1
  120. package/dist/schemes/_entry-find.d.ts.map +1 -1
  121. package/dist/schemes/_entry-find.js +9 -8
  122. package/dist/schemes/_entry-find.js.map +1 -1
  123. package/dist/schemes/_entry-find.sql +1 -1
  124. package/dist/schemes/_entry-graph.d.ts +1 -1
  125. package/dist/schemes/_entry-graph.d.ts.map +1 -1
  126. package/dist/schemes/_entry-graph.js +13 -12
  127. package/dist/schemes/_entry-graph.js.map +1 -1
  128. package/dist/schemes/_entry-graph.sql +49 -13
  129. package/dist/schemes/_entry-manifest.d.ts +5 -2
  130. package/dist/schemes/_entry-manifest.d.ts.map +1 -1
  131. package/dist/schemes/_entry-manifest.js +135 -123
  132. package/dist/schemes/_entry-manifest.js.map +1 -1
  133. package/dist/schemes/_entry-ops.d.ts.map +1 -1
  134. package/dist/schemes/_entry-ops.js +0 -4
  135. package/dist/schemes/_entry-ops.js.map +1 -1
  136. package/dist/schemes/_entry-semantic.d.ts +12 -5
  137. package/dist/schemes/_entry-semantic.d.ts.map +1 -1
  138. package/dist/schemes/_entry-semantic.js +57 -70
  139. package/dist/schemes/_entry-semantic.js.map +1 -1
  140. package/dist/schemes/_entry-semantic.sql +22 -53
  141. package/dist/server/Daemon.d.ts +4 -3
  142. package/dist/server/Daemon.d.ts.map +1 -1
  143. package/dist/server/Daemon.js +109 -44
  144. package/dist/server/Daemon.js.map +1 -1
  145. package/dist/server/auto.d.ts +6 -0
  146. package/dist/server/auto.d.ts.map +1 -0
  147. package/dist/server/{yolo.js → auto.js} +15 -16
  148. package/dist/server/auto.js.map +1 -0
  149. package/dist/server/client-input.d.ts +1 -1
  150. package/dist/server/client-input.d.ts.map +1 -1
  151. package/dist/server/client-input.js +11 -4
  152. package/dist/server/client-input.js.map +1 -1
  153. package/dist/server/drain.sql +6 -3
  154. package/dist/server/loopDocs.d.ts.map +1 -1
  155. package/dist/server/loopDocs.js +2 -2
  156. package/dist/server/loopDocs.js.map +1 -1
  157. package/dist/server/noProposals.js +5 -5
  158. package/dist/server/noProposals.js.map +1 -1
  159. package/dist/service.d.ts.map +1 -1
  160. package/dist/service.js +18 -5
  161. package/dist/service.js.map +1 -1
  162. package/migrations/0000-00-00.01_schema.sql +55 -48
  163. package/migrations/0004_loop-provider.sql +3 -0
  164. package/migrations/0005_subscription-published-channel.sql +3 -0
  165. package/package.json +27 -22
  166. package/dist/server/yolo.d.ts +0 -6
  167. package/dist/server/yolo.d.ts.map +0 -1
  168. package/dist/server/yolo.js.map +0 -1
@@ -1,12 +1,8 @@
1
- -- INIT: schema_version
2
- -- {§db-schema-version-stamp} (#536) — the cross-repo drift gate: external consumers (bench's
3
- -- digest) fail-hard on mismatch instead of rotting silently against a moved schema. ANY change
4
- -- to the schema's SHAPE (tables, columns, identity keys) bumps this integer in the same commit.
5
- -- v2: entries.scheme NOT NULL — the 'file' reserved scheme replaced NULL ({§entry-identity-no-null}, #545).
6
- -- v3: file-class pathnames are bare git-pathspec keys — the leading slash retired ({§fs-canonical-name}, #546).
7
- PRAGMA user_version = 3;
8
-
9
- -- INIT: workspaces
1
+ -- MIGRATE: 1 baseline
2
+ -- The complete v3 schema baseline. SqlRite owns PRAGMA user_version: subsequent
3
+ -- MIGRATE blocks are both the evolution history and the external schema stamp.
4
+
5
+ -- workspaces
10
6
  -- project_root: workspace pointer. NULL = headless (no disk side-effects);
11
7
  -- non-null = absolute path to the client's source tree, supplied at
12
8
  -- workspace.create or workspace.set_root.
@@ -25,7 +21,7 @@ CREATE TABLE IF NOT EXISTS workspaces (
25
21
 
26
22
  CREATE INDEX IF NOT EXISTS sessions_created_at ON workspaces (created_at);
27
23
 
28
- -- INIT: runs
24
+ -- runs
29
25
  CREATE TABLE IF NOT EXISTS workers (
30
26
  id INTEGER NOT NULL PRIMARY KEY,
31
27
  version INTEGER NOT NULL DEFAULT 0 CHECK (version >= 0),
@@ -48,8 +44,8 @@ CREATE INDEX IF NOT EXISTS workers_parent_worker_id ON workers (p
48
44
  -- → worker_live_by_name → 409), never by this index. Indexed for the by-name resolve/spawn lookup.
49
45
  CREATE INDEX IF NOT EXISTS workers_workspace_name ON workers (workspace_id, name);
50
46
 
51
- -- INIT: loops
52
- -- flags: per-loop runtime flags (yolo, noProposals, noWeb, noInteraction,
47
+ -- loops
48
+ -- flags: per-loop runtime flags (auto, noProposals, noWeb, noInteraction,
53
49
  -- mode). JSON column, merged over DEFAULT_LOOP_FLAGS in code so missing
54
50
  -- keys read as their defaults. SchemeRegistry.resolveForLoop gates schemes
55
51
  -- by manifest affinity (proposes / excludedInAsk / requiresWeb / etc).
@@ -96,7 +92,7 @@ BEGIN
96
92
  UPDATE loops SET terminated_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now') WHERE id = NEW.id;
97
93
  END;
98
94
 
99
- -- INIT: turns
95
+ -- turns
100
96
  -- finish_reason / model: provider-call metadata (plurnk-grammar Turn.json).
101
97
  -- Properties of the call, not of the model's emission payload — kept on
102
98
  -- the Turn row alongside usage rather than nested into packet.assistant.
@@ -130,7 +126,21 @@ CREATE TABLE IF NOT EXISTS turns (
130
126
  CREATE UNIQUE INDEX IF NOT EXISTS turns_loop_id_sequence ON turns (loop_id, sequence);
131
127
  CREATE INDEX IF NOT EXISTS turns_timestamp ON turns (timestamp);
132
128
 
133
- -- INIT: entries
129
+ -- derivations
130
+ -- Content-addressed deep projections. Entries point at a COMPLETE artifact by
131
+ -- deep_hash; graph, FTS, and vectors are stored once regardless of how many
132
+ -- workspace/worktree paths carry identical content under the same reader/config.
133
+ -- A building row is unattached and safely replaceable after interruption.
134
+ CREATE TABLE IF NOT EXISTS derivations (
135
+ id INTEGER NOT NULL PRIMARY KEY,
136
+ deep_hash TEXT NOT NULL UNIQUE CHECK (length(deep_hash) > 0),
137
+ state TEXT NOT NULL DEFAULT 'building' CHECK (state IN ('building', 'complete')),
138
+ disposition TEXT CHECK (disposition IN ('vector', 'lexical', 'excluded', 'nonsemantic', 'failed')),
139
+ reason TEXT,
140
+ CHECK ((state = 'building' AND disposition IS NULL) OR (state = 'complete' AND disposition IS NOT NULL))
141
+ ) STRICT;
142
+
143
+ -- entries
134
144
  -- The canonical addressable store. (workspace, owner, scheme, pathname) is the identity
135
145
  -- tuple, and NO component may be NULL: NULLs are distinct under SQL UNIQUE, so a nullable
136
146
  -- component voids the identity index — the #526 disease, re-run on this axis as run59/#545
@@ -175,7 +185,8 @@ CREATE TABLE IF NOT EXISTS entries (
175
185
  updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
176
186
  CHECK (workspace_id IS NOT NULL),
177
187
  FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE,
178
- FOREIGN KEY (owner_id) REFERENCES workers(id) ON DELETE CASCADE
188
+ FOREIGN KEY (owner_id) REFERENCES workers(id) ON DELETE CASCADE,
189
+ FOREIGN KEY (deep_hash) REFERENCES derivations(deep_hash)
179
190
  ) STRICT;
180
191
 
181
192
  -- {§entry-owner} / {§stream-owner-scoped} — ONE identity: the owner is the axis (scope is dead).
@@ -183,14 +194,14 @@ CREATE TABLE IF NOT EXISTS entries (
183
194
  -- loop is seq 1), so identity keys on the owner and identical coordinates are DISTINCT rows (#526).
184
195
  CREATE UNIQUE INDEX IF NOT EXISTS entries_identity ON entries (workspace_id, owner_id, scheme, pathname);
185
196
 
186
- -- INIT: entries_scheme_heal
197
+ -- entries_scheme_heal
187
198
  -- v1→v2 in-place heal ({§entry-identity-no-null}): fold legacy NULL-scheme member rows onto
188
199
  -- the reserved 'file' scheme. Idempotent — a second pass updates zero rows. A v1 db already
189
200
  -- fragmented by the #545 duplicate class fails HERE on the identity index, loudly and by
190
201
  -- design: a fragmented store has no safe automatic merge; recover via a fresh db.
191
202
  UPDATE entries SET scheme = 'file' WHERE scheme IS NULL;
192
203
 
193
- -- INIT: entries_pathname_heal
204
+ -- entries_pathname_heal
194
205
  -- v2→v3 in-place heal ({§fs-canonical-name}): file-class keys migrate to the bare git-pathspec
195
206
  -- form — the leading slash was the retired namespace-origin notation. Idempotent; a db holding
196
207
  -- both spellings of one member fails HERE on the identity index, loudly (fresh-db recovery).
@@ -230,62 +241,58 @@ CREATE TABLE IF NOT EXISTS entry_tags (
230
241
 
231
242
  CREATE INDEX IF NOT EXISTS entry_tags_tag ON entry_tags (tag);
232
243
 
233
- -- INIT: symbol_defs
244
+ -- symbol_defs
234
245
  -- @graph NODES (plurnk-service#186). Code symbol definitions, populated
235
- -- delete-then-insert per entry at write (EntryCrud.writeEntry) from mimetypes'
246
+ -- once per content-addressed derivation from mimetypes'
236
247
  -- `symbols` channel. Qualified path = container ? container || '.' || name : name.
237
248
  CREATE TABLE IF NOT EXISTS symbol_defs (
238
249
  id INTEGER NOT NULL PRIMARY KEY,
239
- workspace_id INTEGER NOT NULL,
240
- entry_id INTEGER NOT NULL,
250
+ derivation_id INTEGER NOT NULL,
241
251
  name TEXT NOT NULL CHECK (length(name) > 0),
242
252
  kind TEXT NOT NULL,
243
253
  container TEXT,
244
254
  line INTEGER NOT NULL,
245
255
  end_line INTEGER,
246
- FOREIGN KEY (entry_id) REFERENCES entries(id) ON DELETE CASCADE
256
+ FOREIGN KEY (derivation_id) REFERENCES derivations(id) ON DELETE CASCADE
247
257
  ) STRICT;
248
258
 
249
- CREATE INDEX IF NOT EXISTS symbol_defs_name ON symbol_defs (workspace_id, name);
259
+ CREATE INDEX IF NOT EXISTS symbol_defs_name ON symbol_defs (name);
250
260
 
251
- -- INIT: symbol_refs
261
+ -- symbol_refs
252
262
  -- @graph EDGES (plurnk-service#186), from mimetypes' `references` channel.
253
263
  -- name = edge TARGET; container = the SOURCE def's full qualified path (the
254
264
  -- @> join key; module-level → NULL); kind ∈ import|call|instantiate|inherit|
255
265
  -- type|use (frozen, edge metadata only — traversal is kind-agnostic).
256
266
  CREATE TABLE IF NOT EXISTS symbol_refs (
257
267
  id INTEGER NOT NULL PRIMARY KEY,
258
- workspace_id INTEGER NOT NULL,
259
- entry_id INTEGER NOT NULL,
268
+ derivation_id INTEGER NOT NULL,
260
269
  name TEXT NOT NULL CHECK (length(name) > 0),
261
270
  kind TEXT NOT NULL,
262
271
  container TEXT,
263
272
  line INTEGER NOT NULL,
264
273
  col INTEGER,
265
- FOREIGN KEY (entry_id) REFERENCES entries(id) ON DELETE CASCADE
274
+ FOREIGN KEY (derivation_id) REFERENCES derivations(id) ON DELETE CASCADE
266
275
  ) STRICT;
267
276
 
268
- CREATE INDEX IF NOT EXISTS symbol_refs_name ON symbol_refs (workspace_id, name);
269
- CREATE INDEX IF NOT EXISTS symbol_refs_source ON symbol_refs (workspace_id, entry_id, container);
277
+ CREATE INDEX IF NOT EXISTS symbol_refs_name ON symbol_refs (name);
278
+ CREATE INDEX IF NOT EXISTS symbol_refs_source ON symbol_refs (derivation_id, container);
270
279
 
271
- -- INIT: entry_fts (~semantic FTS half — plurnk-service#186)
272
- -- Keyword/content index over entry body content; the FTS5 rowid IS entries.id.
273
- -- The ~semantic dialect narrows candidates here (cheap, indexed) then cosine-ranks
274
- -- the narrowed set over the embedding vectors — FTS does the scale-cut, cosine the
275
- -- precise rank, so no ANN/extension is needed. Populated at the gated manifest-add
276
- -- hook alongside symbol_defs/refs: re-indexed only when body content changes.
280
+ -- entry_fts (~semantic FTS half — plurnk-service#186)
281
+ -- Keyword/content index over a derivation's readable content; rowid IS derivations.id.
282
+ -- Explicit keyword fallback when no embedder is installed. Vector search never
283
+ -- consults this table: semantic recall is exhaustive over complete vectors.
277
284
  CREATE VIRTUAL TABLE IF NOT EXISTS entry_fts USING fts5(content);
278
285
 
279
- -- INIT: entry_embeddings (~semantic vector half — plurnk-service#186; Project
280
- -- Semantics chunking). One Float32 vector per CHUNK: an entry tiles into N chunks,
286
+ -- entry_embeddings (~semantic vector half — plurnk-service#186; Project
287
+ -- Semantics chunking). One Float32 vector per CHUNK: a derivation tiles into N chunks,
281
288
  -- each addressed by its <L> line range (line_start..line_end) and embedded
282
289
  -- separately, so a large body is fully searchable instead of truncated at the
283
290
  -- embedder's window. line_start/line_end are stored for Project Findings to expose;
284
- -- the rank currently max-pools an entry's chunks to its pathname. Supplied at the
285
- -- gated manifest-add hook; the fusion (semantic_rank) FTS-narrows then cosine-ranks
286
- -- these. CASCADE-deleted with the entry.
291
+ -- the rank currently max-pools a derivation's chunks, then projects every attached
292
+ -- pathname. semantic_rank exhaustively cosine-ranks these.
293
+ -- CASCADE-deleted with the derivation artifact.
287
294
  CREATE TABLE IF NOT EXISTS entry_embeddings (
288
- entry_id INTEGER NOT NULL,
295
+ derivation_id INTEGER NOT NULL,
289
296
  chunk_seq INTEGER NOT NULL,
290
297
  line_start INTEGER NOT NULL,
291
298
  line_end INTEGER NOT NULL,
@@ -294,11 +301,11 @@ CREATE TABLE IF NOT EXISTS entry_embeddings (
294
301
  -- per row as the dimension/staleness guard: rank filters by the current model so
295
302
  -- a swap never cosine-compares mismatched dimensions.
296
303
  embedding_model TEXT NOT NULL,
297
- PRIMARY KEY (entry_id, chunk_seq),
298
- FOREIGN KEY (entry_id) REFERENCES entries(id) ON DELETE CASCADE
304
+ PRIMARY KEY (derivation_id, chunk_seq),
305
+ FOREIGN KEY (derivation_id) REFERENCES derivations(id) ON DELETE CASCADE
299
306
  ) STRICT;
300
307
 
301
- -- INIT: log_entries
308
+ -- log_entries
302
309
  -- Chronological event store. sequence is 1-based, scoped to the turn —
303
310
  -- resets at each new turn. URI-bit columns are unprefixed (scheme,
304
311
  -- pathname, …). state/outcome/attrs carry the proposal lifecycle —
@@ -398,7 +405,7 @@ BEGIN
398
405
  SELECT RAISE(ABORT, 'log_entries core fields are immutable; only state/outcome/status_rx/rx/expanded may change');
399
406
  END;
400
407
 
401
- -- INIT: schemes_providers
408
+ -- schemes_providers
402
409
  -- Scheme/provider catalog. Schemes are static (registered at boot);
403
410
  -- providers carry per-model metadata for cost accounting and selection.
404
411
  CREATE TABLE IF NOT EXISTS schemes (
@@ -426,7 +433,7 @@ CREATE TABLE IF NOT EXISTS providers (
426
433
 
427
434
  CREATE INDEX IF NOT EXISTS providers_created_at ON providers (created_at);
428
435
 
429
- -- INIT: cost_rollups
436
+ -- cost_rollups
430
437
  -- Triggers maintaining denormalized cost_pico totals on runs and workspaces
431
438
  -- as turns insert/update. Pure denormalization (textbook trigger use);
432
439
  -- no branching state-machine logic lives here.
@@ -474,7 +481,7 @@ BEGIN
474
481
  );
475
482
  END;
476
483
 
477
- -- INIT: subscriptions
484
+ -- subscriptions
478
485
  -- Subscription registry per SPEC §subscriptions. Exists ONLY for cancellation
479
486
  -- routing (SEND[499] → lookup → scheme teardown). Closed rows persist
480
487
  -- for forensics; partial unique index enforces one active subscription
@@ -513,7 +520,7 @@ CREATE INDEX IF NOT EXISTS subscriptions_opened_at ON subscriptions (opened_at);
513
520
 
514
521
  -- (worker_watermarks removed — §env-delta is now pull-from-log, no per-worker snapshot.)
515
522
 
516
- -- INIT: workspace_constraints
523
+ -- workspace_constraints
517
524
  -- SPEC §membership constraint overlay — the client's supersede over git membership.
518
525
  -- Per (workspace, effect, glob/target): `pick` (members git misses, resolved by a
519
526
  -- targeted client-dictated scan), `hide` (drop git-tracked matches), `view` (member
@@ -0,0 +1,3 @@
1
+ -- MIGRATE: 4 loop_provider
2
+ ALTER TABLE loops
3
+ ADD COLUMN provider_spec TEXT NOT NULL DEFAULT 'null' CHECK (json_valid(provider_spec));
@@ -0,0 +1,3 @@
1
+ -- MIGRATE: 5 subscription_published_channel
2
+ ALTER TABLE subscriptions
3
+ ADD COLUMN published_channel TEXT CHECK (published_channel IS NULL OR length(published_channel) > 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-service",
3
- "version": "1.2.0",
3
+ "version": "1.3.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",
@@ -39,10 +39,10 @@
39
39
  "test:lint": "tsc --noEmit",
40
40
  "test:unit": "node --conditions=plurnk-dev --import=./test/setup.ts --env-file-if-exists=.env.defaults --test --test-timeout=30000 src/**/*.test.ts",
41
41
  "test:intg": "PLURNK_SERVICE_FILES_ITEMS=0 node --conditions=plurnk-dev --import=./test/setup.ts --env-file-if-exists=.env.defaults --test --test-concurrency=8 --test-timeout=30000 test/intg/*.test.ts",
42
- "test:live": "PLURNK_SERVICE_EMBED_DISABLE=0 PLURNK_SERVICE_POLICY=../plurnk-meta/PLURNK_PERSONALITY.md node --conditions=plurnk-dev --import=./test/floor.ts --env-file-if-exists=.env.defaults --env-file-if-exists=.env --env-file-if-exists=.env.test --test --test-concurrency=1 test/live/*.test.ts",
43
- "test:live:zeropin": "PLURNK_ZERO_PIN=1 PLURNK_SERVICE_EMBED_DISABLE=0 PLURNK_SERVICE_POLICY=../plurnk-meta/PLURNK_PERSONALITY.md node --conditions=plurnk-dev --import=./test/floor.ts --env-file-if-exists=.env.defaults --env-file-if-exists=.env --env-file-if-exists=.env.test --test --test-concurrency=1 test/live/*.test.ts",
44
- "test:demo": "PLURNK_SERVICE_EMBED_DISABLE=0 PLURNK_SERVICE_POLICY=../plurnk-meta/PLURNK_PERSONALITY.md node --conditions=plurnk-dev --import=./test/floor.ts --env-file-if-exists=.env.defaults --env-file-if-exists=.env --env-file-if-exists=.env.test --test --test-concurrency=1 test/demo/*.test.ts",
45
- "test:demo:zeropin": "PLURNK_ZERO_PIN=1 PLURNK_SERVICE_EMBED_DISABLE=0 PLURNK_SERVICE_POLICY=../plurnk-meta/PLURNK_PERSONALITY.md node --conditions=plurnk-dev --import=./test/floor.ts --env-file-if-exists=.env.defaults --env-file-if-exists=.env --env-file-if-exists=.env.test --test --test-concurrency=1 test/demo/*.test.ts",
42
+ "test:live": "PLURNK_SERVICE_EMBED_DISABLE=0 PLURNK_SERVICE_POLICY=../plurnk-meta/PLURNK_PERSONALITY.md node --conditions=plurnk-dev --import=./test/floor.ts --env-file-if-exists=.env.defaults --env-file-if-exists=$HOME/.plurnk/.env --env-file-if-exists=.env --env-file-if-exists=.env.test --test --test-concurrency=1 test/live/*.test.ts",
43
+ "test:live:zeropin": "PLURNK_ZERO_PIN=1 PLURNK_SERVICE_EMBED_DISABLE=0 PLURNK_SERVICE_POLICY=../plurnk-meta/PLURNK_PERSONALITY.md node --conditions=plurnk-dev --import=./test/floor.ts --env-file-if-exists=.env.defaults --env-file-if-exists=$HOME/.plurnk/.env --env-file-if-exists=.env --env-file-if-exists=.env.test --test --test-concurrency=1 test/live/*.test.ts",
44
+ "test:demo": "PLURNK_SERVICE_EMBED_DISABLE=0 PLURNK_SERVICE_POLICY=../plurnk-meta/PLURNK_PERSONALITY.md node --conditions=plurnk-dev --import=./test/floor.ts --env-file-if-exists=.env.defaults --env-file-if-exists=$HOME/.plurnk/.env --env-file-if-exists=.env --env-file-if-exists=.env.test --test --test-concurrency=1 test/demo/*.test.ts",
45
+ "test:demo:zeropin": "PLURNK_ZERO_PIN=1 PLURNK_SERVICE_EMBED_DISABLE=0 PLURNK_SERVICE_POLICY=../plurnk-meta/PLURNK_PERSONALITY.md node --conditions=plurnk-dev --import=./test/floor.ts --env-file-if-exists=.env.defaults --env-file-if-exists=$HOME/.plurnk/.env --env-file-if-exists=.env --env-file-if-exists=.env.test --test --test-concurrency=1 test/demo/*.test.ts",
46
46
  "test:all": "npm run test:lint && npm run test:unit && npm run test:intg && npm run test:demo",
47
47
  "test:digest": "node --conditions=plurnk-dev bin/digest.ts",
48
48
  "test:digest-failures": "node --conditions=plurnk-dev bin/digest-failures.ts",
@@ -51,7 +51,8 @@
51
51
  "build:clean": "rm -rf dist",
52
52
  "build:dist": "tsc -p tsconfig.build.json",
53
53
  "build:sql": "node --conditions=plurnk-dev scripts/copy-sql.mjs",
54
- "build": "npm run build:clean && npm run build:dist && npm run build:sql",
54
+ "build:info": "node scripts/write-build-info.mjs",
55
+ "build": "npm run build:clean && npm run build:dist && npm run build:sql && npm run build:info",
55
56
  "build:global:install": "npm run build && npm install -g .",
56
57
  "build:global:uninstall": "npm uninstall -g @plurnk/plurnk-service",
57
58
  "build:local:install": "node --conditions=plurnk-dev scripts/install-sandbox.mjs install",
@@ -62,24 +63,28 @@
62
63
  "prepack": "npm run build"
63
64
  },
64
65
  "dependencies": {
65
- "@plurnk/plurnk-agui": "1.2.0",
66
- "@plurnk/plurnk-execs": "1.2.0",
67
- "@plurnk/plurnk-execs-common": "1.2.0",
68
- "@plurnk/plurnk-execs-mcp": "1.2.0",
69
- "@plurnk/plurnk-execs-search": "1.2.0",
70
- "@plurnk/gbnf": "1.2.0",
71
- "@plurnk/plurnk-grammar": "1.2.0",
72
- "@plurnk/plurnk-mimetypes": "1.2.0",
73
- "@plurnk/plurnk-mimetypes-text-html": "1.2.0",
74
- "@plurnk/plurnk-providers": "1.2.0",
75
- "@plurnk/plurnk-schemes": "1.2.0",
76
- "@plurnk/plurnk-schemes-http": "1.2.0",
77
- "@possumtech/sqlrite": "6.3.0",
66
+ "@plurnk/gbnf": "1.3.0",
67
+ "@plurnk/plurnk-agui": "1.3.0",
68
+ "@plurnk/plurnk-execs": "1.3.0",
69
+ "@plurnk/plurnk-execs-common": "1.3.0",
70
+ "@plurnk/plurnk-execs-mcp": "1.3.0",
71
+ "@plurnk/plurnk-execs-search": "1.3.0",
72
+ "@plurnk/plurnk-grammar": "1.3.0",
73
+ "@plurnk/plurnk-meta": "1.3.0",
74
+ "@plurnk/plurnk-mimetypes": "1.3.0",
75
+ "@plurnk/plurnk-mimetypes-embeddings": "1.3.0",
76
+ "@plurnk/plurnk-mimetypes-text-html": "1.3.0",
77
+ "@plurnk/plurnk-providers": "1.3.0",
78
+ "@plurnk/plurnk-providers-cloudflare": "~1.2.0",
79
+ "@plurnk/plurnk-providers-google": "~1.2.0",
80
+ "@plurnk/plurnk-providers-openrouter": "~1.2.0",
81
+ "@plurnk/plurnk-providers-xai": "~1.2.0",
82
+ "@plurnk/plurnk-schemes": "1.3.0",
83
+ "@plurnk/plurnk-schemes-http": "1.3.0",
84
+ "@possumtech/sqlrite": "^6.5.0",
78
85
  "diff": "^9.0.0",
79
86
  "ignore": "7.0.6",
80
- "isomorphic-git": "1.38.10",
81
- "@plurnk/plurnk-mimetypes-embeddings": "1.2.0",
82
- "@plurnk/plurnk-meta": "1.2.0"
87
+ "isomorphic-git": "1.40.0"
83
88
  },
84
89
  "devDependencies": {
85
90
  "@types/diff": "^7.0.2"
@@ -1,6 +0,0 @@
1
- import type Engine from "../core/Engine.ts";
2
- import type { Db } from "../core/Db.ts";
3
- export default class Yolo {
4
- static attachYolo(engine: Engine, _db: Db): void;
5
- }
6
- //# sourceMappingURL=yolo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"yolo.d.ts","sourceRoot":"","sources":["../../src/server/yolo.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,IAAI,CAuB/C;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"yolo.js","sourceRoot":"","sources":["../../src/server/yolo.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6EAA6E;AAC7E,8DAA8D;AAC9D,EAAE;AACF,0CAA0C;AAC1C,EAAE;AACF,uEAAuE;AACvE,sBAAsB;AACtB,EAAE;AACF,iCAAiC;AACjC,yDAAyD;AACzD,qDAAqD;AACrD,0EAA0E;AAC1E,2EAA2E;AAC3E,oEAAoE;AACpE,yEAAyE;AACzE,wBAAwB;AACxB,2EAA2E;AAC3E,qEAAqE;AACrE,EAAE;AACF,2DAA2D;AAC3D,uEAAuE;AACvE,wEAAwE;AACxE,wEAAwE;AACxE,2BAA2B;AAC3B,sEAAsE;AACtE,+EAA+E;AAC/E,EAAE;AACF,kFAAkF;AAClF,yEAAyE;AACzE,0EAA0E;AAC1E,uEAAuE;AACvE,yEAAyE;AACzE,+DAA+D;AAM/D,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,MAAM,CAAC,UAAU,CAAC,MAAc,EAAE,GAAO;QACrC,qCAAqC;QACrC,MAAM,CAAC,iBAAiB,CAAC,CAAC,KAA2B,EAAE,EAAE;YACrD,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI;gBAAE,OAAO;YAC9B,kFAAkF;YAClF,mFAAmF;YACnF,+DAA+D;YAC/D,IAAI,KAAK,CAAC,EAAE,KAAK,MAAM,IAAK,KAAK,CAAC,KAA+B,CAAC,QAAQ,KAAK,SAAS;gBAAE,OAAO;YACjG,IAAI,CAAC;gBACD,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;oBACzB,uEAAuE;oBACvE,yEAAyE;oBACzE,wEAAwE;oBACxE,iEAAiE;oBACjE,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC,CAAC;oBAChG,OAAO;gBACX,CAAC;gBACD,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;YACrE,CAAC;YAAC,MAAM,CAAC;gBACL,wDAAwD;gBACxD,uDAAuD;YAC3D,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}