@plurnk/plurnk-service 3.0.0 → 3.1.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 (156) hide show
  1. package/.env.defaults +16 -4
  2. package/INSTALL.md +18 -0
  3. package/README.md +3 -0
  4. package/SPEC.md +355 -187
  5. package/dist/build-info.json +1 -1
  6. package/dist/completions/_plurnk-service +13 -0
  7. package/dist/completions/plurnk-service.bash +19 -0
  8. package/dist/completions/plurnk-service.fish +93 -0
  9. package/dist/core/AdmittedTurnExecutor.d.ts +2 -2
  10. package/dist/core/AdmittedTurnExecutor.d.ts.map +1 -1
  11. package/dist/core/AdmittedTurnExecutor.js +16 -24
  12. package/dist/core/AdmittedTurnExecutor.js.map +1 -1
  13. package/dist/core/BudgetReadout.d.ts +7 -2
  14. package/dist/core/BudgetReadout.d.ts.map +1 -1
  15. package/dist/core/BudgetReadout.js +36 -5
  16. package/dist/core/BudgetReadout.js.map +1 -1
  17. package/dist/core/Dispatcher.d.ts +2 -2
  18. package/dist/core/Dispatcher.d.ts.map +1 -1
  19. package/dist/core/Dispatcher.js +43 -39
  20. package/dist/core/Dispatcher.js.map +1 -1
  21. package/dist/core/Engine.d.ts.map +1 -1
  22. package/dist/core/Engine.js +1 -4
  23. package/dist/core/Engine.js.map +1 -1
  24. package/dist/core/EnvFlags.js +1 -1
  25. package/dist/core/EnvFlags.js.map +1 -1
  26. package/dist/core/FabricatedLog.d.ts +1 -0
  27. package/dist/core/FabricatedLog.d.ts.map +1 -1
  28. package/dist/core/FabricatedLog.js +8 -0
  29. package/dist/core/FabricatedLog.js.map +1 -1
  30. package/dist/core/KillHandler.d.ts.map +1 -1
  31. package/dist/core/KillHandler.js +2 -0
  32. package/dist/core/KillHandler.js.map +1 -1
  33. package/dist/core/LiveSubscription.d.ts.map +1 -1
  34. package/dist/core/LiveSubscription.js +14 -2
  35. package/dist/core/LiveSubscription.js.map +1 -1
  36. package/dist/core/LiveSubscriptions.d.ts +3 -1
  37. package/dist/core/LiveSubscriptions.d.ts.map +1 -1
  38. package/dist/core/LiveSubscriptions.js +16 -1
  39. package/dist/core/LiveSubscriptions.js.map +1 -1
  40. package/dist/core/LogBody.d.ts.map +1 -1
  41. package/dist/core/LogBody.js +3 -1
  42. package/dist/core/LogBody.js.map +1 -1
  43. package/dist/core/LoopDriver.d.ts.map +1 -1
  44. package/dist/core/LoopDriver.js +3 -0
  45. package/dist/core/LoopDriver.js.map +1 -1
  46. package/dist/core/LoopLifecycle.sql +1 -0
  47. package/dist/core/MessageResources.sql +31 -0
  48. package/dist/core/PacketBuilder.d.ts +2 -2
  49. package/dist/core/PacketBuilder.d.ts.map +1 -1
  50. package/dist/core/PacketBuilder.js +123 -51
  51. package/dist/core/PacketBuilder.js.map +1 -1
  52. package/dist/core/PacketBuilder.sql +13 -14
  53. package/dist/core/ReplyMetadata.d.ts +10 -0
  54. package/dist/core/ReplyMetadata.d.ts.map +1 -0
  55. package/dist/core/ReplyMetadata.js +20 -0
  56. package/dist/core/ReplyMetadata.js.map +1 -0
  57. package/dist/core/ServiceHelp.d.ts +6 -0
  58. package/dist/core/ServiceHelp.d.ts.map +1 -0
  59. package/dist/core/ServiceHelp.js +35 -0
  60. package/dist/core/ServiceHelp.js.map +1 -0
  61. package/dist/core/StoredPacket.d.ts +1 -0
  62. package/dist/core/StoredPacket.d.ts.map +1 -1
  63. package/dist/core/StoredPacket.js +4 -1
  64. package/dist/core/StoredPacket.js.map +1 -1
  65. package/dist/core/StrikeRail.d.ts.map +1 -1
  66. package/dist/core/StrikeRail.js +2 -2
  67. package/dist/core/StrikeRail.js.map +1 -1
  68. package/dist/core/TokenCalibration.d.ts +2 -2
  69. package/dist/core/TokenCalibration.d.ts.map +1 -1
  70. package/dist/core/TokenCalibration.js +12 -16
  71. package/dist/core/TokenCalibration.js.map +1 -1
  72. package/dist/core/TokenCalibration.sql +29 -6
  73. package/dist/core/TurnDispositionHandler.d.ts +1 -2
  74. package/dist/core/TurnDispositionHandler.d.ts.map +1 -1
  75. package/dist/core/TurnDispositionHandler.js +30 -26
  76. package/dist/core/TurnDispositionHandler.js.map +1 -1
  77. package/dist/core/TurnMaterialization.d.ts.map +1 -1
  78. package/dist/core/TurnMaterialization.js +11 -1
  79. package/dist/core/TurnMaterialization.js.map +1 -1
  80. package/dist/core/TurnOps.d.ts +5 -1
  81. package/dist/core/TurnOps.d.ts.map +1 -1
  82. package/dist/core/TurnOps.js +29 -2
  83. package/dist/core/TurnOps.js.map +1 -1
  84. package/dist/core/TurnRunner.d.ts.map +1 -1
  85. package/dist/core/TurnRunner.js +119 -55
  86. package/dist/core/TurnRunner.js.map +1 -1
  87. package/dist/core/TurnSources.sql +2 -2
  88. package/dist/core/packet-wire.d.ts +7 -1
  89. package/dist/core/packet-wire.d.ts.map +1 -1
  90. package/dist/core/packet-wire.js +87 -27
  91. package/dist/core/packet-wire.js.map +1 -1
  92. package/dist/core/recap-lines.d.ts +4 -0
  93. package/dist/core/recap-lines.d.ts.map +1 -0
  94. package/dist/core/recap-lines.js +11 -0
  95. package/dist/core/recap-lines.js.map +1 -0
  96. package/dist/core/sql-functions.d.ts +2 -0
  97. package/dist/core/sql-functions.d.ts.map +1 -0
  98. package/dist/core/sql-functions.js +5 -0
  99. package/dist/core/sql-functions.js.map +1 -0
  100. package/dist/core/turn-scheduler.d.ts.map +1 -1
  101. package/dist/core/turn-scheduler.js +1 -1
  102. package/dist/core/turn-scheduler.js.map +1 -1
  103. package/dist/evidence/EvidenceReader.d.ts.map +1 -1
  104. package/dist/evidence/EvidenceReader.js +15 -2
  105. package/dist/evidence/EvidenceReader.js.map +1 -1
  106. package/dist/evidence/digest.sql +1 -0
  107. package/dist/man/plurnk-service.1 +488 -0
  108. package/dist/schemes/Env.d.ts +26 -0
  109. package/dist/schemes/Env.d.ts.map +1 -0
  110. package/dist/schemes/Env.js +133 -0
  111. package/dist/schemes/Env.js.map +1 -0
  112. package/dist/schemes/Exec.d.ts.map +1 -1
  113. package/dist/schemes/Exec.js +15 -15
  114. package/dist/schemes/Exec.js.map +1 -1
  115. package/dist/schemes/ExecOutputScheme.d.ts +3 -2
  116. package/dist/schemes/ExecOutputScheme.d.ts.map +1 -1
  117. package/dist/schemes/ExecOutputScheme.js +9 -0
  118. package/dist/schemes/ExecOutputScheme.js.map +1 -1
  119. package/dist/schemes/Log.d.ts.map +1 -1
  120. package/dist/schemes/Log.js +33 -10
  121. package/dist/schemes/Log.js.map +1 -1
  122. package/dist/schemes/Log.sql +9 -0
  123. package/dist/schemes/_entry-find.d.ts +1 -1
  124. package/dist/schemes/_entry-find.d.ts.map +1 -1
  125. package/dist/schemes/_entry-find.js +16 -9
  126. package/dist/schemes/_entry-find.js.map +1 -1
  127. package/dist/schemes/_entry-manifest.js +3 -3
  128. package/dist/schemes/_entry-manifest.js.map +1 -1
  129. package/dist/schemes/exec-abort.js +2 -2
  130. package/dist/schemes/exec-abort.js.map +1 -1
  131. package/dist/server/Daemon.d.ts +1 -0
  132. package/dist/server/Daemon.d.ts.map +1 -1
  133. package/dist/server/Daemon.js +6 -1
  134. package/dist/server/Daemon.js.map +1 -1
  135. package/dist/server/DrainSupervisor.d.ts +1 -0
  136. package/dist/server/DrainSupervisor.d.ts.map +1 -1
  137. package/dist/server/DrainSupervisor.js +4 -1
  138. package/dist/server/DrainSupervisor.js.map +1 -1
  139. package/dist/server/EnvFunctionality.d.ts +4 -2
  140. package/dist/server/EnvFunctionality.d.ts.map +1 -1
  141. package/dist/server/EnvFunctionality.js +4 -1
  142. package/dist/server/EnvFunctionality.js.map +1 -1
  143. package/dist/server/client-input.d.ts.map +1 -1
  144. package/dist/server/client-input.js +12 -3
  145. package/dist/server/client-input.js.map +1 -1
  146. package/dist/server/drain.sql +10 -9
  147. package/dist/service.d.ts.map +1 -1
  148. package/dist/service.js +5 -31
  149. package/dist/service.js.map +1 -1
  150. package/docs/env.md +22 -0
  151. package/migrations/018_worker_owners.sql +1 -0
  152. package/migrations/019_interactive_owners.sql +1 -0
  153. package/migrations/020_log_projection.sql +1 -0
  154. package/migrations/021_packet_roles.sql +86 -0
  155. package/migrations/022_message_completion.sql +24 -0
  156. package/package.json +16 -14
package/.env.defaults CHANGED
@@ -128,7 +128,7 @@ PLURNK_SERVICE_EFFECT_READ=auto
128
128
  PLURNK_SERVICE_EFFECT_PURE=auto
129
129
  # Brief settlement wait for new streams/completing siblings, ms; 0 = off; quiescence ends it early.
130
130
  PLURNK_SERVICE_OPTIMISTIC_WAIT_MS=5000
131
- # Maximum park before reassessing live work, positive seconds; WAIT <seconds> overrides one park.
131
+ # Maximum park before reassessing live work, positive seconds; WAIT [seconds] overrides one park.
132
132
  PLURNK_SERVICE_WAIT_SEC=300
133
133
  # Ambient environment an EXEC subprocess may inherit from the host: exact names, or one
134
134
  # trailing-* prefix glob. This is a CEILING — a worker or a heading modifier narrows it,
@@ -151,7 +151,10 @@ PLURNK_SERVICE_EDIT_RECEIPT_CONTEXT_LINES=4
151
151
  PLURNK_SERVICE_EDIT_RECEIPT_REMOVED_LINES=40
152
152
  # Paths named per class in the packet's git status; the rest are counted.
153
153
  PLURNK_SERVICE_GIT_STATUS_PATHS=8
154
- # Heaviest retained log rows the Context gauge names, as {path, tokens}; 0 names none.
154
+ # Above this share of the budget, measured before adding either, the Context gauge names its largest rows
155
+ # and a packet within its budget carries the budget_pressure notice ({§context-pressure-notice}).
156
+ PLURNK_SERVICE_BUDGET_PRESSURE=80%
157
+ # Heaviest retained log rows the pressured Context gauge names, as {path, tokens}; 0 names none.
155
158
  PLURNK_SERVICE_BUDGET_LARGEST_ITEMS=5
156
159
  # First page of everything that comes back unasked in size: a READ or FIND without a scope, a stream's
157
160
  # delivery, a peer worker's message, a receipt the model did not author ({§markerless-first-page}).
@@ -159,12 +162,17 @@ PLURNK_SERVICE_BUDGET_LARGEST_ITEMS=5
159
162
  PLURNK_SERVICE_PREVIEW_LINES=100
160
163
  # Independent bound on the same page, Unicode code points; CRLF counts as one separator.
161
164
  PLURNK_SERVICE_PREVIEW_CHARS=16000
165
+ # Assistant replay ({§emission-history}): none, latest, or all eligible turns from this loop, each as the
166
+ # NOTEs it wrote, in the model's voice; every other operation is omitted. The context wall may omit
167
+ # the whole section; source evidence never changes.
168
+ PLURNK_SERVICE_EMISSION_HISTORY=all
162
169
  # Optional reasoning memory ({§reasoning-row}): 1 adds the turn's preview before its emission or results,
163
170
  # only when room remains after all requested results and diagnostics. Otherwise omit it silently. 0 disables it.
164
- PLURNK_SERVICE_REASONING_ROWS=1
171
+ PLURNK_SERVICE_REASONING_ROWS=0
165
172
  # The row's page ({§reasoning-row}): reasoning that fits it lands whole; longer reasoning lands as its last page,
166
173
  # this many lines within PLURNK_SERVICE_PREVIEW_CHARS, because a turn's conclusions and plan sit at its end; the
167
- # rest stays readable at reasoning://. Unset/empty = the shared page, PLURNK_SERVICE_PREVIEW_LINES.
174
+ # rest stays readable at reasoning://. -1 returns the complete reasoning without either preview bound,
175
+ # still only if it fits. Unset/empty = the shared page, PLURNK_SERVICE_PREVIEW_LINES; 0 is invalid.
168
176
  # PLURNK_SERVICE_REASONING_TRAILING_LINES=40
169
177
  # Code points of an entry's prose summary the catalog shows whole.
170
178
  PLURNK_SERVICE_CATALOG_SUMMARY_CHARS=256
@@ -193,6 +201,10 @@ PLURNK_SERVICE_ROOTS=project,plurnk,global
193
201
  # PLURNK_SERVICE_POLICY=
194
202
  # Recap file, relative to the package root; unset = packaged recap.md; empty file omits the section.
195
203
  # PLURNK_SERVICE_RECAP=
204
+ # Recap lines, one per key: PLURNK_SERVICE_RECAP_LINE_<alias>=<line> ({§recap-lines}). Each opens with YOU MUST,
205
+ # YOU MUST NOT, YOU MUST ONLY, YOU SHOULD, YOU SHOULD NOT or YOU MAY and renders as one callout, in alias order,
206
+ # ahead of the Recap source. An empty value turns a shipped line off.
207
+ # PLURNK_SERVICE_RECAP_LINE_<alias>=
196
208
 
197
209
  # --- Search indexing ---
198
210
  # Comma-separated globs excluded from derivation, not READ. No slash = basename; slash = pathname.
package/INSTALL.md CHANGED
@@ -101,6 +101,24 @@ Extension settings remain environment/configuration values; they do not extend t
101
101
  service CLI. Boolean flags use `1` and `0`. An empty value is not an unset value;
102
102
  the owning declaration specifies its meaning.
103
103
 
104
+ ## Manual and shell completions
105
+
106
+ The installed package includes a generated manual and static completions. They
107
+ require no running daemon. Find the global npm package at
108
+ `$(npm root -g)/@plurnk/plurnk-service`; the paths below are relative to it.
109
+
110
+ | Artifact | Use |
111
+ | --- | --- |
112
+ | `dist/man/plurnk-service.1` | Open with `man /path/to/plurnk-service.1`, or copy into a directory on `MANPATH` (commonly `~/.local/share/man/man1/`). |
113
+ | `dist/completions/plurnk-service.bash` | Source from your Bash configuration. |
114
+ | `dist/completions/_plurnk-service` | Copy into a directory on Zsh's `fpath` before `compinit`. |
115
+ | `dist/completions/plurnk-service.fish` | Copy into `~/.config/fish/completions/`, or the corresponding `XDG_CONFIG_HOME` location. |
116
+
117
+ Completion offers command names, long options and filenames. Configuration
118
+ values remain in `plurnk-service config defaults`, not a separate static catalog.
119
+ Package installation does not edit shell configuration or install these files
120
+ outside the package.
121
+
104
122
  ## Choose the right scope
105
123
 
106
124
  | Change | Owner and effect |
package/README.md CHANGED
@@ -5,6 +5,9 @@ operation dispatch. Its client surface is AG-UI over HTTP/SSE through
5
5
  `@plurnk/plurnk-agui`. The user-facing CLI lives in
6
6
  [plurnk](https://github.com/plurnk/plurnk).
7
7
 
8
+ See [installation and configuration](INSTALL.md), including the packaged
9
+ [manual and shell completions](INSTALL.md#manual-and-shell-completions).
10
+
8
11
  ## What an agent can do
9
12
 
10
13
  The exact model-facing language and operation set are owned by