@plurnk/plurnk-service 3.2.0 → 4.0.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 (328) hide show
  1. package/.env.defaults +3 -3
  2. package/INSTALL.md +6 -0
  3. package/README.md +2 -2
  4. package/SPEC.md +489 -186
  5. package/dist/build-info.json +1 -1
  6. package/dist/completions/_plurnk-service +1 -1
  7. package/dist/completions/plurnk-service.bash +1 -1
  8. package/dist/completions/plurnk-service.fish +2 -0
  9. package/dist/content/read-projector.js +1 -1
  10. package/dist/content/read-projector.js.map +1 -1
  11. package/dist/core/AdministrativeLoop.d.ts +1 -1
  12. package/dist/core/AdministrativeLoop.d.ts.map +1 -1
  13. package/dist/core/AdministrativeLoop.js +4 -1
  14. package/dist/core/AdministrativeLoop.js.map +1 -1
  15. package/dist/core/AdmittedTurnExecutor.d.ts.map +1 -1
  16. package/dist/core/AdmittedTurnExecutor.js +8 -0
  17. package/dist/core/AdmittedTurnExecutor.js.map +1 -1
  18. package/dist/core/BareBatchRunner.js +2 -1
  19. package/dist/core/BareBatchRunner.js.map +1 -1
  20. package/dist/core/BudgetReadout.d.ts +1 -3
  21. package/dist/core/BudgetReadout.d.ts.map +1 -1
  22. package/dist/core/BudgetReadout.js +43 -46
  23. package/dist/core/BudgetReadout.js.map +1 -1
  24. package/dist/core/ChannelWrite.d.ts +10 -0
  25. package/dist/core/ChannelWrite.d.ts.map +1 -1
  26. package/dist/core/ChannelWrite.js +10 -0
  27. package/dist/core/ChannelWrite.js.map +1 -1
  28. package/dist/core/ChannelWrite.sql +14 -2
  29. package/dist/core/ClientInteractions.d.ts.map +1 -1
  30. package/dist/core/ClientInteractions.js +2 -1
  31. package/dist/core/ClientInteractions.js.map +1 -1
  32. package/dist/core/CoreSchemeServices.d.ts.map +1 -1
  33. package/dist/core/CoreSchemeServices.js +6 -0
  34. package/dist/core/CoreSchemeServices.js.map +1 -1
  35. package/dist/core/DataStatementRunner.js +4 -6
  36. package/dist/core/DataStatementRunner.js.map +1 -1
  37. package/dist/core/Dispatcher.d.ts +3 -7
  38. package/dist/core/Dispatcher.d.ts.map +1 -1
  39. package/dist/core/Dispatcher.js +53 -73
  40. package/dist/core/Dispatcher.js.map +1 -1
  41. package/dist/core/Dispatcher.sql +2 -2
  42. package/dist/core/EditMutations.js +1 -0
  43. package/dist/core/EditMutations.js.map +1 -1
  44. package/dist/core/Engine.d.ts +8 -14
  45. package/dist/core/Engine.d.ts.map +1 -1
  46. package/dist/core/Engine.js +22 -24
  47. package/dist/core/Engine.js.map +1 -1
  48. package/dist/core/Engine.sql +6 -6
  49. package/dist/core/ExecutorRegistry.d.ts +0 -5
  50. package/dist/core/ExecutorRegistry.d.ts.map +1 -1
  51. package/dist/core/ExecutorRegistry.js +10 -18
  52. package/dist/core/ExecutorRegistry.js.map +1 -1
  53. package/dist/core/FileAddress.js +1 -1
  54. package/dist/core/FileAddress.js.map +1 -1
  55. package/dist/core/FilePublication.js +10 -74
  56. package/dist/core/FilePublication.js.map +1 -1
  57. package/dist/core/FileSnapshot.js +36 -100
  58. package/dist/core/FileSnapshot.js.map +1 -1
  59. package/dist/core/HostPaths.d.ts +1 -0
  60. package/dist/core/HostPaths.d.ts.map +1 -1
  61. package/dist/core/HostPaths.js +11 -1
  62. package/dist/core/HostPaths.js.map +1 -1
  63. package/dist/core/KillHandler.js +3 -1
  64. package/dist/core/KillHandler.js.map +1 -1
  65. package/dist/core/LiveSubscription.js +1 -1
  66. package/dist/core/LiveSubscription.js.map +1 -1
  67. package/dist/core/LogBody.js +1 -1
  68. package/dist/core/LogBody.js.map +1 -1
  69. package/dist/core/LogWriter.js +1 -1
  70. package/dist/core/LogWriter.js.map +1 -1
  71. package/dist/core/LoopDriver.d.ts +3 -3
  72. package/dist/core/LoopDriver.d.ts.map +1 -1
  73. package/dist/core/LoopDriver.js +15 -13
  74. package/dist/core/LoopDriver.js.map +1 -1
  75. package/dist/core/LoopLifecycle.d.ts +5 -0
  76. package/dist/core/LoopLifecycle.d.ts.map +1 -1
  77. package/dist/core/LoopLifecycle.js +14 -1
  78. package/dist/core/LoopLifecycle.js.map +1 -1
  79. package/dist/core/LoopLifecycle.sql +11 -2
  80. package/dist/core/MembershipMaterialization.js +2 -2
  81. package/dist/core/MembershipMaterialization.js.map +1 -1
  82. package/dist/core/MessageResources.d.ts +3 -0
  83. package/dist/core/MessageResources.d.ts.map +1 -1
  84. package/dist/core/MessageResources.js +15 -1
  85. package/dist/core/MessageResources.js.map +1 -1
  86. package/dist/core/OperatorConfig.d.ts +1 -2
  87. package/dist/core/OperatorConfig.d.ts.map +1 -1
  88. package/dist/core/OperatorConfig.js +26 -92
  89. package/dist/core/OperatorConfig.js.map +1 -1
  90. package/dist/core/PacketBuilder.d.ts.map +1 -1
  91. package/dist/core/PacketBuilder.js +21 -18
  92. package/dist/core/PacketBuilder.js.map +1 -1
  93. package/dist/core/PacketBuilder.sql +18 -5
  94. package/dist/core/ProblemLog.d.ts +1 -0
  95. package/dist/core/ProblemLog.d.ts.map +1 -1
  96. package/dist/core/ProblemLog.js +2 -2
  97. package/dist/core/ProblemLog.js.map +1 -1
  98. package/dist/core/ProposalLifecycle.d.ts +1 -0
  99. package/dist/core/ProposalLifecycle.d.ts.map +1 -1
  100. package/dist/core/ProposalLifecycle.js +14 -8
  101. package/dist/core/ProposalLifecycle.js.map +1 -1
  102. package/dist/core/ProposalPolicies.d.ts +4 -1
  103. package/dist/core/ProposalPolicies.d.ts.map +1 -1
  104. package/dist/core/ProposalPolicies.js +5 -2
  105. package/dist/core/ProposalPolicies.js.map +1 -1
  106. package/dist/core/ResourceMutations.js +2 -0
  107. package/dist/core/ResourceMutations.js.map +1 -1
  108. package/dist/core/ResourceSelector.js +1 -1
  109. package/dist/core/ResourceSelector.js.map +1 -1
  110. package/dist/core/SchemeRegistry.js +1 -1
  111. package/dist/core/SchemeRegistry.js.map +1 -1
  112. package/dist/core/ServiceHelp.js +1 -1
  113. package/dist/core/ServiceHelp.js.map +1 -1
  114. package/dist/core/ServiceTeardown.js +9 -12
  115. package/dist/core/ServiceTeardown.js.map +1 -1
  116. package/dist/core/StrikeRail.d.ts +2 -1
  117. package/dist/core/StrikeRail.d.ts.map +1 -1
  118. package/dist/core/StrikeRail.js +11 -6
  119. package/dist/core/StrikeRail.js.map +1 -1
  120. package/dist/core/TerminalResult.js +1 -1
  121. package/dist/core/TerminalResult.js.map +1 -1
  122. package/dist/core/TurnDispositionHandler.d.ts +1 -1
  123. package/dist/core/TurnDispositionHandler.d.ts.map +1 -1
  124. package/dist/core/TurnDispositionHandler.js +8 -5
  125. package/dist/core/TurnDispositionHandler.js.map +1 -1
  126. package/dist/core/TurnMaterialization.js +6 -4
  127. package/dist/core/TurnMaterialization.js.map +1 -1
  128. package/dist/core/TurnMaterialization.sql +1 -1
  129. package/dist/core/TurnOps.js +1 -0
  130. package/dist/core/TurnOps.js.map +1 -1
  131. package/dist/core/TurnRunner.d.ts +4 -2
  132. package/dist/core/TurnRunner.d.ts.map +1 -1
  133. package/dist/core/TurnRunner.js +63 -51
  134. package/dist/core/TurnRunner.js.map +1 -1
  135. package/dist/core/WorkerControlHandler.d.ts +2 -0
  136. package/dist/core/WorkerControlHandler.d.ts.map +1 -1
  137. package/dist/core/WorkerControlHandler.js +84 -16
  138. package/dist/core/WorkerControlHandler.js.map +1 -1
  139. package/dist/core/WorkerName.d.ts +0 -4
  140. package/dist/core/WorkerName.d.ts.map +1 -1
  141. package/dist/core/WorkerName.js +5 -30
  142. package/dist/core/WorkerName.js.map +1 -1
  143. package/dist/core/WorkerName.sql +4 -20
  144. package/dist/core/WorkerOwners.d.ts +1 -0
  145. package/dist/core/WorkerOwners.d.ts.map +1 -1
  146. package/dist/core/WorkerOwners.js +6 -0
  147. package/dist/core/WorkerOwners.js.map +1 -1
  148. package/dist/core/WorkerOwners.sql +7 -0
  149. package/dist/core/WorkspaceGate.d.ts +3 -1
  150. package/dist/core/WorkspaceGate.d.ts.map +1 -1
  151. package/dist/core/WorkspaceGate.js +59 -10
  152. package/dist/core/WorkspaceGate.js.map +1 -1
  153. package/dist/core/caps/SchemeCtxImpl.d.ts +3 -0
  154. package/dist/core/caps/SchemeCtxImpl.d.ts.map +1 -1
  155. package/dist/core/caps/SchemeCtxImpl.js +14 -0
  156. package/dist/core/caps/SchemeCtxImpl.js.map +1 -1
  157. package/dist/core/env-catalog.js +1 -1
  158. package/dist/core/env-catalog.js.map +1 -1
  159. package/dist/core/fork.js +1 -1
  160. package/dist/core/fork.js.map +1 -1
  161. package/dist/core/fork.sql +7 -6
  162. package/dist/core/mutation-types.d.ts +1 -0
  163. package/dist/core/mutation-types.d.ts.map +1 -1
  164. package/dist/core/mutation-types.js +4 -1
  165. package/dist/core/mutation-types.js.map +1 -1
  166. package/dist/core/namespace.js +1 -1
  167. package/dist/core/namespace.js.map +1 -1
  168. package/dist/core/packet-wire.d.ts +1 -1
  169. package/dist/core/packet-wire.d.ts.map +1 -1
  170. package/dist/core/packet-wire.js +24 -15
  171. package/dist/core/packet-wire.js.map +1 -1
  172. package/dist/core/plurnk-uri.d.ts +1 -1
  173. package/dist/core/plurnk-uri.d.ts.map +1 -1
  174. package/dist/core/plurnk-uri.js +1 -1
  175. package/dist/core/plurnk-uri.js.map +1 -1
  176. package/dist/core/scheme-types.d.ts +5 -0
  177. package/dist/core/scheme-types.d.ts.map +1 -1
  178. package/dist/core/turn-signals.d.ts +4 -0
  179. package/dist/core/turn-signals.d.ts.map +1 -1
  180. package/dist/core/turn-signals.js +1 -0
  181. package/dist/core/turn-signals.js.map +1 -1
  182. package/dist/core/workspace-settings.js +1 -1
  183. package/dist/core/workspace-settings.js.map +1 -1
  184. package/dist/evidence/EvidenceReader.js +5 -5
  185. package/dist/evidence/EvidenceReader.js.map +1 -1
  186. package/dist/man/plurnk-service.1 +27 -6
  187. package/dist/schemes/Env.d.ts +7 -3
  188. package/dist/schemes/Env.d.ts.map +1 -1
  189. package/dist/schemes/Env.js +12 -6
  190. package/dist/schemes/Env.js.map +1 -1
  191. package/dist/schemes/Exec.d.ts.map +1 -1
  192. package/dist/schemes/Exec.js +37 -25
  193. package/dist/schemes/Exec.js.map +1 -1
  194. package/dist/schemes/ExecOutputScheme.js +3 -3
  195. package/dist/schemes/ExecOutputScheme.js.map +1 -1
  196. package/dist/schemes/ExecutionInput.d.ts +2 -1
  197. package/dist/schemes/ExecutionInput.d.ts.map +1 -1
  198. package/dist/schemes/ExecutionInput.js +45 -7
  199. package/dist/schemes/ExecutionInput.js.map +1 -1
  200. package/dist/schemes/File.d.ts.map +1 -1
  201. package/dist/schemes/File.js +32 -23
  202. package/dist/schemes/File.js.map +1 -1
  203. package/dist/schemes/Log.d.ts.map +1 -1
  204. package/dist/schemes/Log.js +23 -5
  205. package/dist/schemes/Log.js.map +1 -1
  206. package/dist/schemes/Log.sql +24 -1
  207. package/dist/schemes/ResourceTreeScheme.js +2 -5
  208. package/dist/schemes/ResourceTreeScheme.js.map +1 -1
  209. package/dist/schemes/TurnSource.js +1 -1
  210. package/dist/schemes/TurnSource.js.map +1 -1
  211. package/dist/schemes/Worker.d.ts.map +1 -1
  212. package/dist/schemes/Worker.js +10 -3
  213. package/dist/schemes/Worker.js.map +1 -1
  214. package/dist/schemes/_entry-crud.d.ts.map +1 -1
  215. package/dist/schemes/_entry-crud.js +2 -4
  216. package/dist/schemes/_entry-crud.js.map +1 -1
  217. package/dist/schemes/_entry-crud.sql +5 -3
  218. package/dist/schemes/_entry-find.js +3 -3
  219. package/dist/schemes/_entry-find.js.map +1 -1
  220. package/dist/schemes/_entry-manifest.d.ts.map +1 -1
  221. package/dist/schemes/_entry-manifest.js +3 -3
  222. package/dist/schemes/_entry-manifest.js.map +1 -1
  223. package/dist/schemes/_entry-manifest.sql +2 -0
  224. package/dist/schemes/_entry-ops.js +1 -1
  225. package/dist/schemes/_entry-ops.js.map +1 -1
  226. package/dist/schemes/_entry-send.js +1 -1
  227. package/dist/schemes/_entry-send.js.map +1 -1
  228. package/dist/server/ClientReads.d.ts +1 -0
  229. package/dist/server/ClientReads.d.ts.map +1 -1
  230. package/dist/server/ClientReads.js +7 -2
  231. package/dist/server/ClientReads.js.map +1 -1
  232. package/dist/server/Credentials.d.ts +48 -0
  233. package/dist/server/Credentials.d.ts.map +1 -0
  234. package/dist/server/Credentials.js +203 -0
  235. package/dist/server/Credentials.js.map +1 -0
  236. package/dist/server/Daemon.d.ts +44 -39
  237. package/dist/server/Daemon.d.ts.map +1 -1
  238. package/dist/server/Daemon.js +287 -172
  239. package/dist/server/Daemon.js.map +1 -1
  240. package/dist/server/DrainSupervisor.d.ts +8 -3
  241. package/dist/server/DrainSupervisor.d.ts.map +1 -1
  242. package/dist/server/DrainSupervisor.js +44 -32
  243. package/dist/server/DrainSupervisor.js.map +1 -1
  244. package/dist/server/EnvFunctionality.d.ts.map +1 -1
  245. package/dist/server/EnvFunctionality.js +2 -1
  246. package/dist/server/EnvFunctionality.js.map +1 -1
  247. package/dist/server/Functionality.d.ts +4 -2
  248. package/dist/server/Functionality.d.ts.map +1 -1
  249. package/dist/server/Functionality.js +192 -96
  250. package/dist/server/Functionality.js.map +1 -1
  251. package/dist/server/FunctionalityManager.d.ts +1 -4
  252. package/dist/server/FunctionalityManager.d.ts.map +1 -1
  253. package/dist/server/FunctionalityManager.js +6 -6
  254. package/dist/server/FunctionalityManager.js.map +1 -1
  255. package/dist/server/HttpListener.d.ts +1 -1
  256. package/dist/server/HttpListener.d.ts.map +1 -1
  257. package/dist/server/HttpListener.js.map +1 -1
  258. package/dist/server/MembersFunctionality.d.ts +7 -8
  259. package/dist/server/MembersFunctionality.d.ts.map +1 -1
  260. package/dist/server/MembersFunctionality.js +90 -56
  261. package/dist/server/MembersFunctionality.js.map +1 -1
  262. package/dist/server/MessageAbandonment.d.ts +7 -0
  263. package/dist/server/MessageAbandonment.d.ts.map +1 -0
  264. package/dist/server/MessageAbandonment.js +57 -0
  265. package/dist/server/MessageAbandonment.js.map +1 -0
  266. package/dist/server/ModuleHost.d.ts +2 -1
  267. package/dist/server/ModuleHost.d.ts.map +1 -1
  268. package/dist/server/PlurnkSkill.js +4 -7
  269. package/dist/server/PlurnkSkill.js.map +1 -1
  270. package/dist/server/Rollback.d.ts +29 -0
  271. package/dist/server/Rollback.d.ts.map +1 -0
  272. package/dist/server/Rollback.js +111 -0
  273. package/dist/server/Rollback.js.map +1 -0
  274. package/dist/server/WorkerModelResolver.js +1 -0
  275. package/dist/server/WorkerModelResolver.js.map +1 -1
  276. package/dist/server/WorkerReferences.d.ts +14 -0
  277. package/dist/server/WorkerReferences.d.ts.map +1 -0
  278. package/dist/server/WorkerReferences.js +24 -0
  279. package/dist/server/WorkerReferences.js.map +1 -0
  280. package/dist/server/WorkerReferences.sql +31 -0
  281. package/dist/server/WorkspaceCapabilities.d.ts +2 -0
  282. package/dist/server/WorkspaceCapabilities.d.ts.map +1 -1
  283. package/dist/server/WorkspaceCapabilities.js +35 -18
  284. package/dist/server/WorkspaceCapabilities.js.map +1 -1
  285. package/dist/server/WorkspacePlugins.js +1 -0
  286. package/dist/server/WorkspacePlugins.js.map +1 -1
  287. package/dist/server/WorkspaceResidency.d.ts +3 -1
  288. package/dist/server/WorkspaceResidency.d.ts.map +1 -1
  289. package/dist/server/WorkspaceResidency.js +12 -5
  290. package/dist/server/WorkspaceResidency.js.map +1 -1
  291. package/dist/server/client-input.d.ts +2 -0
  292. package/dist/server/client-input.d.ts.map +1 -1
  293. package/dist/server/client-input.js +28 -0
  294. package/dist/server/client-input.js.map +1 -1
  295. package/dist/server/drain.sql +46 -40
  296. package/dist/server/envelope.d.ts +5 -9
  297. package/dist/server/envelope.d.ts.map +1 -1
  298. package/dist/server/envelope.js +21 -84
  299. package/dist/server/envelope.js.map +1 -1
  300. package/dist/server/envelope.sql +17 -17
  301. package/dist/server/lifecycle-recovery.sql +5 -15
  302. package/dist/server/logEntry.d.ts.map +1 -1
  303. package/dist/server/logEntry.js +6 -0
  304. package/dist/server/logEntry.js.map +1 -1
  305. package/dist/server/logEntry.sql +94 -6
  306. package/dist/server/module-discovery.d.ts +1 -1
  307. package/dist/server/module-discovery.d.ts.map +1 -1
  308. package/dist/server/module-discovery.js +1 -0
  309. package/dist/server/module-discovery.js.map +1 -1
  310. package/dist/server/seam-loop.sql +15 -7
  311. package/dist/server/seam-proposal-list.sql +10 -4
  312. package/dist/service.d.ts.map +1 -1
  313. package/dist/service.js +7 -1
  314. package/dist/service.js.map +1 -1
  315. package/docs/members.md +20 -13
  316. package/migrations/002_workers.sql +2 -2
  317. package/migrations/006_log.sql +1 -1
  318. package/migrations/018_worker_owners.sql +1 -1
  319. package/migrations/026_message_obligations.sql +32 -0
  320. package/migrations/027_members_identity.sql +20 -0
  321. package/migrations/028_mutation_patch.sql +20 -0
  322. package/migrations/029_default_worker.sql +9 -0
  323. package/migrations/030_client_workers.sql +105 -0
  324. package/migrations/031_message_openers.sql +83 -0
  325. package/migrations/032_worker_references.sql +29 -0
  326. package/package.json +24 -24
  327. package/plurnk.nginx.conf +71 -0
  328. package/plurnk.service +2 -0
@@ -0,0 +1,32 @@
1
+ -- MIGRATE: 26 message obligations
2
+ -- Released in 3.3.0 and frozen ({§db-migrations}): a shape change is the next MIGRATE version, never an edit here.
3
+ -- {§worker-obligations}: a message a worker sent to another worker holds the sender, beside its live children
4
+ -- and open streams, until the recipient completes it ({§message-completion}) or the recipient's loop ends
5
+ -- ({§message-abandonment}). The two liveness views are recreated with that third column; no row changes.
6
+ DROP VIEW IF EXISTS loop_obligations;
7
+ DROP VIEW IF EXISTS worker_obligations;
8
+
9
+ CREATE VIEW worker_obligations AS
10
+ SELECT w.id AS worker_id,
11
+ EXISTS (
12
+ SELECT 1 FROM subscriptions s
13
+ WHERE s.worker_id = w.id AND s.closed_at IS NULL AND s.detached = 0
14
+ ) AS streams,
15
+ EXISTS (
16
+ SELECT 1 FROM workers c JOIN loops l ON l.worker_id = c.id
17
+ WHERE c.parent_worker_id = w.id AND l.status IN (100, 102, 202)
18
+ ) AS workers,
19
+ EXISTS (
20
+ SELECT 1 FROM loop_messages m
21
+ JOIN loops l ON l.id = m.loop_id
22
+ JOIN workers r ON r.id = l.worker_id
23
+ WHERE r.workspace_id = w.workspace_id
24
+ AND m.source = 'worker://' || w.name
25
+ AND l.status IN (100, 102, 202)
26
+ AND NOT EXISTS (SELECT 1 FROM message_completions c WHERE c.message_id = m.id)
27
+ ) AS messages
28
+ FROM workers w;
29
+
30
+ CREATE VIEW loop_obligations AS
31
+ SELECT l.id AS loop_id, held.streams, held.workers, held.messages
32
+ FROM loops l JOIN worker_obligations held ON held.worker_id = l.worker_id;
@@ -0,0 +1,20 @@
1
+ -- MIGRATE: 27 members identity
2
+ -- Released in 3.3.0 and frozen ({§db-migrations}): a shape change is the next MIGRATE version, never an edit here.
3
+ -- {§members-functionality} {§functionality-addressing}: a members definition is its glob. Workspace
4
+ -- definitions are re-keyed by their glob. A service-origin row held only an enabledness override
5
+ -- keyed by the operator's environment alias, which no longer names a definition, so it is dropped;
6
+ -- a state left with no definition is removed, as the coordinator persists none.
7
+ UPDATE workspace_module_state
8
+ SET state = (
9
+ SELECT json_object(
10
+ 'version', 1,
11
+ 'definitions', COALESCE(json_group_object(json_extract(value, '$.definition.glob'), json(value)), json('{}'))
12
+ )
13
+ FROM json_each(workspace_module_state.state, '$.definitions')
14
+ WHERE json_extract(value, '$.origin') = 'workspace'
15
+ )
16
+ WHERE namespace_owner = '@plurnk/plurnk-core/members';
17
+
18
+ DELETE FROM workspace_module_state
19
+ WHERE namespace_owner = '@plurnk/plurnk-core/members'
20
+ AND (SELECT COUNT(*) FROM json_each(workspace_module_state.state, '$.definitions')) = 0;
@@ -0,0 +1,20 @@
1
+ -- MIGRATE: 28 mutation patch
2
+ -- Released in 3.3.0 and frozen ({§db-migrations}): a shape change is the next MIGRATE version, never an edit here.
3
+ -- {§log-mutation-patch}: a settled file mutation's row keeps the unified diff of what it did, for the
4
+ -- life of the row; it is served as the row's `patch` channel and never enters a receipt or a packet.
5
+ -- Rows settled before this version, byte writes and operations that changed no text hold NULL.
6
+ ALTER TABLE log_entries ADD COLUMN patch TEXT;
7
+
8
+ DROP VIEW active_log_entries;
9
+ CREATE VIEW active_log_entries AS
10
+ SELECT le.id, le.version, le.worker_id, le.loop_id, le.turn_id, le.sequence,
11
+ le.at, le.origin, le.source, le.ambient_event_id, le.inherited_history,
12
+ le.deep_hash, le.model_call_id, le.subscription_publication_id,
13
+ le.op, le.signal, le.scheme, le.username, le.password,
14
+ le.hostname, le.port, le.pathname, le.query, le.fragment, le.lineMarker,
15
+ le.tx, le.mimetype_tx,
16
+ le.rx, le.mimetype_rx, le.status_rx, le.weight,
17
+ le.state, le.outcome, le.attrs, le.initial_folded, le.patch, projection.folded
18
+ FROM log_entries le
19
+ JOIN log_entry_projections projection ON projection.log_entry_id = le.id
20
+ WHERE projection.active = 1;
@@ -0,0 +1,9 @@
1
+ -- MIGRATE: 29 default worker
2
+ -- Released in 4.0.0 and frozen ({§db-migrations}).
3
+ -- The column that marks a workspace's one flagged root model worker takes the worker vocabulary.
4
+ -- Renaming it rewrites its CHECK and the partial index in place; the index then takes its name.
5
+ ALTER TABLE workers RENAME COLUMN default_conversation TO default_worker;
6
+
7
+ DROP INDEX workers_workspace_default_conversation;
8
+ CREATE UNIQUE INDEX workers_workspace_default_worker
9
+ ON workers (workspace_id) WHERE default_worker = 1;
@@ -0,0 +1,105 @@
1
+ -- MIGRATE: 30 client workers
2
+ -- Released in 4.0.0 and frozen ({§db-migrations}).
3
+ -- {§connection-lifecycle} A worker is a model's identity: a person's client operations are the workspace's and
4
+ -- journal in its runtime worker. Each client worker's history moves there, and the emptied worker goes.
5
+ -- Rows keep their identity; only their worker, and their loop's place in that worker's numbering, change.
6
+
7
+ -- The runtime worker of every workspace that holds a client worker.
8
+ INSERT INTO workers (workspace_id, name, origin)
9
+ SELECT DISTINCT client.workspace_id, '_plurnk', '_plurnk'
10
+ FROM workers client
11
+ WHERE client.origin = 'client'
12
+ AND NOT EXISTS (SELECT 1 FROM workers runtime WHERE runtime.workspace_id = client.workspace_id AND runtime.origin = '_plurnk');
13
+
14
+ -- {§actor-boundary-client-operations} The person who owned a client worker acted in each of its loops.
15
+ CREATE TEMP TABLE rehomed_workers AS
16
+ SELECT client.id AS client_id, runtime.id AS runtime_id,
17
+ CASE WHEN client.owner = '_plurnk' THEN NULL ELSE client.owner END AS person
18
+ FROM workers client
19
+ JOIN workers runtime ON runtime.workspace_id = client.workspace_id AND runtime.origin = '_plurnk'
20
+ WHERE client.origin = 'client';
21
+
22
+ -- Each client loop follows the runtime worker's own loops, in the order the loops ran.
23
+ CREATE TEMP TABLE rehomed_loops AS
24
+ SELECT l.id AS loop_id, l.worker_id AS client_id, l.sequence AS client_sequence, moved.runtime_id,
25
+ (SELECT coalesce(max(own.sequence), 0) FROM loops own WHERE own.worker_id = moved.runtime_id)
26
+ + row_number() OVER (PARTITION BY moved.runtime_id ORDER BY l.id) AS sequence,
27
+ moved.person
28
+ FROM loops l
29
+ JOIN rehomed_workers moved ON moved.client_id = l.worker_id;
30
+
31
+ UPDATE loops
32
+ SET worker_id = moved.runtime_id,
33
+ sequence = moved.sequence,
34
+ prompt_source = coalesce(loops.prompt_source, moved.person)
35
+ FROM rehomed_loops moved
36
+ WHERE moved.loop_id = loops.id;
37
+
38
+ -- The two identity guards are redeclared verbatim once their rows have moved.
39
+ DROP TRIGGER log_entries_immutable_core;
40
+
41
+ UPDATE log_entries SET worker_id = moved.runtime_id
42
+ FROM rehomed_workers moved
43
+ WHERE moved.client_id = log_entries.worker_id;
44
+
45
+ CREATE TRIGGER log_entries_immutable_core
46
+ BEFORE UPDATE OF
47
+ worker_id, loop_id, turn_id, sequence, at, origin, source, inherited_history, model_call_id,
48
+ op, signal,
49
+ scheme, username, password, hostname,
50
+ port, pathname, query, fragment,
51
+ lineMarker, tx, mimetype_tx, mimetype_rx, initial_folded
52
+ ON log_entries
53
+ BEGIN
54
+ SELECT RAISE(ABORT, 'log_entries core fields are immutable; only lifecycle outcome and derived attachments may change');
55
+ END;
56
+
57
+ -- An execution's source names its row by log coordinate, so it takes its loop's new number.
58
+ DROP TRIGGER subscriptions_identity_update;
59
+
60
+ UPDATE subscriptions
61
+ SET worker_id = moved.runtime_id,
62
+ source = coalesce(
63
+ 'log:///' || (
64
+ SELECT l.sequence FROM rehomed_loops l
65
+ WHERE l.client_id = moved.client_id
66
+ AND l.client_sequence = CAST(substr(subscriptions.source, 8, instr(substr(subscriptions.source, 8), '/') - 1) AS INTEGER)
67
+ ) || substr(subscriptions.source, 7 + instr(substr(subscriptions.source, 8), '/')),
68
+ subscriptions.source)
69
+ FROM rehomed_workers moved
70
+ WHERE moved.client_id = subscriptions.worker_id;
71
+
72
+ CREATE TRIGGER subscriptions_identity_update
73
+ BEFORE UPDATE OF worker_id, entry_id, scheme, source ON subscriptions
74
+ WHEN NEW.entry_id != OLD.entry_id OR NEW.scheme != OLD.scheme OR NEW.source IS NOT OLD.source
75
+ OR (NEW.worker_id IS NOT OLD.worker_id AND NOT (NEW.worker_id IS NULL AND NEW.closed_at IS NOT NULL))
76
+ BEGIN
77
+ SELECT RAISE(ABORT, 'subscription identity is immutable');
78
+ END;
79
+
80
+ UPDATE ambient_events SET producer_worker_id = moved.runtime_id
81
+ FROM rehomed_workers moved
82
+ WHERE moved.client_id = ambient_events.producer_worker_id;
83
+
84
+ UPDATE ambient_events SET recipient_worker_id = moved.runtime_id
85
+ FROM rehomed_workers moved
86
+ WHERE moved.client_id = ambient_events.recipient_worker_id;
87
+
88
+ UPDATE client_interactions SET worker_id = moved.runtime_id
89
+ FROM rehomed_workers moved
90
+ WHERE moved.client_id = client_interactions.worker_id;
91
+
92
+ -- A worker a client worker parented is a root worker, owned as before, as a person's WORK starts one now.
93
+ UPDATE workers SET parent_worker_id = NULL
94
+ WHERE parent_worker_id IN (SELECT client_id FROM rehomed_workers);
95
+
96
+ -- {§env-scheme} A person's environment is the runtime worker's; overrides several persons kept have no one owner.
97
+ DELETE FROM worker_module_state WHERE worker_id IN (SELECT client_id FROM rehomed_workers);
98
+
99
+ DELETE FROM workers WHERE id IN (SELECT client_id FROM rehomed_workers);
100
+
101
+ DROP TABLE rehomed_loops;
102
+ DROP TABLE rehomed_workers;
103
+
104
+ -- No worker carries the default flag any longer.
105
+ DROP INDEX workers_workspace_default_worker;
@@ -0,0 +1,83 @@
1
+ -- MIGRATE: 31 message openers
2
+ -- Released in 4.0.0 and frozen ({§db-migrations}).
3
+ -- {§worker-obligations} A message a worker's own operation sends records that operation, by the row it writes:
4
+ -- its turn and its sequence there. The message's obligation then holds that worker by identity, its reply
5
+ -- reaches that worker, and a child's answer to its first message is its conclusion. A message a person, a
6
+ -- client or the daemon sends names no opener. Messages that predate the record name none either, so they hold
7
+ -- no worker and route no reply.
8
+ ALTER TABLE loop_messages ADD COLUMN opened_turn_id INTEGER REFERENCES turns(id) ON DELETE SET NULL;
9
+ ALTER TABLE loop_messages ADD COLUMN opened_sequence INTEGER CHECK (opened_sequence IS NULL OR opened_sequence >= 1);
10
+
11
+ -- {§methods-invocation}: the delivery that discharges a message finds it from either side.
12
+ CREATE INDEX loop_messages_opener ON loop_messages (opened_turn_id, opened_sequence) WHERE opened_turn_id IS NOT NULL;
13
+ CREATE INDEX message_completions_response ON message_completions (response_id);
14
+
15
+ DROP VIEW IF EXISTS delivered_message_replies;
16
+ DROP VIEW IF EXISTS message_reply_deliveries;
17
+ DROP VIEW IF EXISTS delegated_task_answers;
18
+ DROP VIEW IF EXISTS loop_obligations;
19
+ DROP VIEW IF EXISTS worker_obligations;
20
+
21
+ -- The worker whose own operation sent each message.
22
+ CREATE VIEW message_senders AS
23
+ SELECT m.id AS message_id, sender.worker_id AS sender_worker_id
24
+ FROM loop_messages m
25
+ JOIN turns opened ON opened.id = m.opened_turn_id
26
+ JOIN loops sender ON sender.id = opened.loop_id;
27
+
28
+ CREATE VIEW worker_obligations AS
29
+ SELECT w.id AS worker_id,
30
+ EXISTS (
31
+ SELECT 1 FROM subscriptions s
32
+ WHERE s.worker_id = w.id AND s.closed_at IS NULL AND s.detached = 0
33
+ ) AS streams,
34
+ EXISTS (
35
+ SELECT 1 FROM workers c JOIN loops l ON l.worker_id = c.id
36
+ WHERE c.parent_worker_id = w.id AND l.status IN (100, 102, 202)
37
+ ) AS workers,
38
+ EXISTS (
39
+ SELECT 1 FROM message_senders s
40
+ JOIN loop_messages m ON m.id = s.message_id
41
+ JOIN loops l ON l.id = m.loop_id
42
+ WHERE s.sender_worker_id = w.id
43
+ AND l.status IN (100, 102, 202)
44
+ AND NOT EXISTS (SELECT 1 FROM message_completions c WHERE c.message_id = m.id)
45
+ ) AS messages
46
+ FROM workers w;
47
+
48
+ CREATE VIEW loop_obligations AS
49
+ SELECT l.id AS loop_id, held.streams, held.workers, held.messages
50
+ FROM loops l JOIN worker_obligations held ON held.worker_id = l.worker_id;
51
+
52
+ -- {§message-reply-delivery}: a reply reaches the message's own worker and the worker that sent it.
53
+ CREATE VIEW message_reply_deliveries AS
54
+ SELECT DISTINCT r.id AS source_record_id, r.loop_id, m.workspace_id,
55
+ r.worker_id AS producer_worker_id, m.worker_id AS recipient_worker_id
56
+ FROM log_responses r
57
+ JOIN workers producer ON producer.id = r.worker_id
58
+ JOIN json_each(r.rx, '$.answers') answer
59
+ JOIN message_sources m ON m.path = answer.value AND m.workspace_id = producer.workspace_id
60
+ UNION
61
+ SELECT r.id, r.loop_id, m.workspace_id, r.worker_id, s.sender_worker_id
62
+ FROM log_responses r
63
+ JOIN workers producer ON producer.id = r.worker_id
64
+ JOIN json_each(r.rx, '$.answers') answer
65
+ JOIN message_sources m ON m.path = answer.value AND m.workspace_id = producer.workspace_id
66
+ JOIN message_senders s ON s.message_id = m.id;
67
+
68
+ -- {§worker-scheme-collect}: a child's answer to the first message its parent sent is its conclusion, not a reply.
69
+ CREATE VIEW delegated_task_answers AS
70
+ SELECT r.id AS source_record_id, producer.parent_worker_id AS recipient_worker_id
71
+ FROM log_responses r
72
+ JOIN workers producer ON producer.id = r.worker_id
73
+ JOIN json_each(r.rx, '$.answers') answer
74
+ JOIN message_sources m ON m.path = answer.value AND m.workspace_id = producer.workspace_id
75
+ JOIN message_senders s ON s.message_id = m.id
76
+ WHERE m.loop_id = r.loop_id AND m.ordinal = 1 AND s.sender_worker_id = producer.parent_worker_id;
77
+
78
+ CREATE VIEW delivered_message_replies AS
79
+ SELECT d.* FROM message_reply_deliveries d
80
+ WHERE NOT EXISTS (
81
+ SELECT 1 FROM delegated_task_answers t
82
+ WHERE t.source_record_id = d.source_record_id AND t.recipient_worker_id = d.recipient_worker_id
83
+ );
@@ -0,0 +1,29 @@
1
+ -- MIGRATE: 32 worker references
2
+ -- Released in 4.0.0 and frozen ({§db-migrations}).
3
+ -- {§worker-external-reference} Protocol adapters own the opaque key; core owns its durable target.
4
+ CREATE TABLE worker_references (
5
+ namespace TEXT NOT NULL CHECK (length(namespace) > 0),
6
+ reference TEXT NOT NULL,
7
+ worker_id INTEGER NOT NULL REFERENCES workers(id) ON DELETE CASCADE,
8
+ PRIMARY KEY (namespace, reference)
9
+ ) STRICT, WITHOUT ROWID;
10
+
11
+ CREATE INDEX worker_references_worker ON worker_references (worker_id);
12
+
13
+ CREATE TRIGGER worker_reference_identity
14
+ BEFORE UPDATE ON worker_references
15
+ BEGIN
16
+ SELECT RAISE(ABORT, 'worker reference is immutable');
17
+ END;
18
+
19
+ CREATE TRIGGER worker_reference_model
20
+ BEFORE INSERT ON worker_references
21
+ WHEN EXISTS (SELECT 1 FROM workers WHERE id = NEW.worker_id AND origin != 'model')
22
+ BEGIN
23
+ SELECT RAISE(ABORT, 'worker reference requires a model worker');
24
+ END;
25
+
26
+ CREATE VIEW worker_reference_allocations AS
27
+ SELECT r.namespace, r.reference, s.name AS workspace_name, w.name AS worker_name
28
+ FROM worker_references r JOIN workers w ON w.id = r.worker_id
29
+ JOIN workspaces s ON s.id = w.workspace_id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-service",
3
- "version": "3.2.0",
3
+ "version": "4.0.0",
4
4
  "description": "Plurnk agent runtime — the server / engine / core. Implements the @plurnk/plurnk-contracts contract.",
5
5
  "keywords": [
6
6
  "plurnk",
@@ -38,6 +38,7 @@
38
38
  "README.md",
39
39
  "INSTALL.md",
40
40
  "plurnk.service",
41
+ "plurnk.nginx.conf",
41
42
  "SPEC.md"
42
43
  ],
43
44
  "publishConfig": {
@@ -50,14 +51,13 @@
50
51
  "test:lint": "npm run types:sqlrite:check && tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
51
52
  "test:unit": "node --conditions=plurnk-dev --import=./test/setup.ts --env-file-if-exists=.env.defaults --test --test-timeout=30000 scripts/*.test.mjs src/**/*.test.ts",
52
53
  "test:intg": "export PLURNK_TEST_RUN=$(date -u +%Y%m%dT%H%M%SZ); 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 && node ../scripts/reclaim-green-run.mjs core",
53
- "test:mcp:dogfood": "PLURNK_TEST_MCP_DOGFOOD=1 node --conditions=plurnk-dev --import=./test/setup.ts --env-file-if-exists=.env.defaults --test --test-concurrency=1 --test-timeout=120000 test/intg/mcp-agui-composition.test.ts",
54
- "test:a2a:tck": "node scripts/a2a-tck.mjs",
55
54
  "test:live": "bash ../scripts/operator-environment.sh node --conditions=plurnk-dev scripts/live.mjs",
56
55
  "test:live:specimen": "bash ../scripts/operator-environment.sh node --conditions=plurnk-dev scripts/live.mjs --specimen",
57
56
  "test:live:zeropin": "PLURNK_ZERO_PIN=1 npm run test:live",
58
57
  "test:demo": "bash ../scripts/operator-environment.sh node --conditions=plurnk-dev scripts/demo.mjs",
59
58
  "test:demo:specimen": "bash ../scripts/operator-environment.sh node --conditions=plurnk-dev scripts/demo.mjs --specimen",
60
59
  "test:demo:zeropin": "PLURNK_ZERO_PIN=1 npm run test:demo",
60
+ "tier:history": "node --conditions=plurnk-dev scripts/tier-history.mjs",
61
61
  "test:benchlet": "bash ../scripts/operator-environment.sh node scripts/benchlet.mjs",
62
62
  "fixture:demo": "node --conditions=plurnk-dev test/demo/_fixture.ts",
63
63
  "test": "npm run test:lint && npm run test:unit && npm run test:intg",
@@ -73,7 +73,7 @@
73
73
  "build:global:uninstall": "npm uninstall -g @plurnk/plurnk-service",
74
74
  "build:local:install": "node --conditions=plurnk-dev scripts/install-sandbox.mjs install",
75
75
  "build:local:uninstall": "node --conditions=plurnk-dev scripts/install-sandbox.mjs uninstall",
76
- "test:installation": "node --conditions=plurnk-dev scripts/test-installation.mjs",
76
+ "test:installation": "node scripts/test-installation.mjs",
77
77
  "deps:audit": "node --conditions=plurnk-dev scripts/deps-audit.ts",
78
78
  "release:check": "npm run deps:audit && npm run test:installation",
79
79
  "prepublishOnly": "npm run deps:audit && npm run test:installation",
@@ -89,22 +89,22 @@
89
89
  "@opentelemetry/resources": "^2.12.0",
90
90
  "@opentelemetry/sdk-metrics": "^2.12.0",
91
91
  "@opentelemetry/sdk-trace-base": "^2.12.0",
92
- "@plurnk/plurnk-a2a": "3.1.1",
93
- "@plurnk/plurnk-agui": "3.0.0",
94
- "@plurnk/plurnk-contracts": "3.2.0",
95
- "@plurnk/plurnk-parser": "3.0.3",
96
- "@plurnk/plurnk-schedule": "3.0.1",
97
- "@plurnk/plurnk-skills": "3.0.1",
98
- "@plurnk/plurnk-execs": "3.1.1",
99
- "@plurnk/plurnk-execs-common": "2.0.2",
100
- "@plurnk/plurnk-execs-jq": "2.0.2",
101
- "@plurnk/plurnk-execs-sqlite": "2.0.2",
102
- "@plurnk/plurnk-hooks": "2.0.1",
103
- "@plurnk/plurnk-mcp": "3.0.1",
92
+ "@plurnk/plurnk-a2a": "4.0.0",
93
+ "@plurnk/plurnk-agui": "4.0.0",
94
+ "@plurnk/plurnk-contracts": "4.0.0",
95
+ "@plurnk/plurnk-parser": "4.0.0",
96
+ "@plurnk/plurnk-schedule": "3.0.3",
97
+ "@plurnk/plurnk-skills": "3.0.2",
98
+ "@plurnk/plurnk-execs": "4.0.0",
99
+ "@plurnk/plurnk-execs-common": "3.0.0",
100
+ "@plurnk/plurnk-execs-jq": "2.0.3",
101
+ "@plurnk/plurnk-execs-sqlite": "2.0.3",
102
+ "@plurnk/plurnk-hooks": "2.0.2",
103
+ "@plurnk/plurnk-mcp": "3.2.0",
104
104
  "@plurnk/plurnk-meta": "2.1.1",
105
105
  "@plurnk/plurnk-agent-plugins": "2.0.0",
106
- "@plurnk/plurnk-agent-skills": "2.0.1",
107
- "@plurnk/plurnk-mimetypes": "3.0.2",
106
+ "@plurnk/plurnk-agent-skills": "2.0.2",
107
+ "@plurnk/plurnk-mimetypes": "3.0.3",
108
108
  "@plurnk/plurnk-mimetypes-application-ipynb": "2.0.1",
109
109
  "@plurnk/plurnk-mimetypes-application-json": "2.0.1",
110
110
  "@plurnk/plurnk-mimetypes-application-jsonl": "2.0.1",
@@ -146,15 +146,15 @@
146
146
  "@plurnk/plurnk-mimetypes-text-markdown": "2.0.1",
147
147
  "@plurnk/plurnk-mimetypes-text-plain": "2.0.1",
148
148
  "@plurnk/plurnk-models": "3.0.1",
149
- "@plurnk/plurnk-modules": "3.1.0",
150
- "@plurnk/plurnk-providers": "3.0.2",
151
- "@plurnk/plurnk-schemes": "3.1.1",
152
- "@plurnk/plurnk-schemes-http": "2.0.1",
149
+ "@plurnk/plurnk-modules": "4.0.0",
150
+ "@plurnk/plurnk-providers": "3.0.3",
151
+ "@plurnk/plurnk-schemes": "3.2.1",
152
+ "@plurnk/plurnk-schemes-http": "2.0.2",
153
153
  "@possumtech/sqlrite": "^6.6.1",
154
154
  "diff": "^9.0.0",
155
155
  "glob": "^13.0.6",
156
156
  "minimatch": "^10.2.6",
157
- "@plurnk/plurnk-digest": "3.2.0"
157
+ "@plurnk/plurnk-digest": "3.2.1"
158
158
  },
159
159
  "devDependencies": {
160
160
  "@a2a-js/sdk": "1.3.0",
@@ -172,5 +172,5 @@
172
172
  "url": "git+https://github.com/plurnk/plurnk-service.git",
173
173
  "directory": "plurnk-core"
174
174
  },
175
- "gitHead": "f96502a26d62a6f87b22950a9e2006348ac8a6bc"
175
+ "gitHead": "9f92ceac0af7bdb64e57ebc73c0288bb0f36b720"
176
176
  }
@@ -0,0 +1,71 @@
1
+ # plurnk-service behind nginx: an example to adapt, never installed by the package.
2
+ # The daemon answers whoever reaches it at whatever address they used and refuses nobody for it.
3
+ # TLS, security headers, sign-in throttling and network allow-lists belong here, in front of it.
4
+ #
5
+ # Install: cp "$(npm root -g)/@plurnk/plurnk-service/plurnk.nginx.conf" /etc/nginx/conf.d/plurnk.conf
6
+ # replace plurnk.example.com and the certificate paths, then: nginx -t && systemctl reload nginx
7
+ # Certificates: certbot --nginx -d plurnk.example.com, or any certificate you hold.
8
+ # The daemon: keep it on loopback (the default PLURNK_HOST=127.0.0.1) so nginx is the one way in, and
9
+ # tell it the public origin, which it cannot see through the TLS in front of it:
10
+ # PLURNK_AGUI_ISSUER=https://plurnk.example.com in ~/.config/plurnk/.env, and
11
+ # PLURNK_A2A_ENDPOINT_URL=https://plurnk.example.com/a2a when PLURNK_A2A_EXPOSE=1.
12
+ # nginx older than 1.25.1: drop `http2 on;` and write `listen 443 ssl http2;` instead.
13
+
14
+ # Sign-in throttling, per real client address: the daemon behind nginx sees only nginx's.
15
+ limit_req_zone $binary_remote_addr zone=plurnk_signin:10m rate=10r/m;
16
+
17
+ server {
18
+ listen 80;
19
+ listen [::]:80;
20
+ server_name plurnk.example.com;
21
+ return 301 https://$host$request_uri;
22
+ }
23
+
24
+ server {
25
+ listen 443 ssl;
26
+ listen [::]:443 ssl;
27
+ http2 on;
28
+ server_name plurnk.example.com;
29
+
30
+ ssl_certificate /etc/letsencrypt/live/plurnk.example.com/fullchain.pem;
31
+ ssl_certificate_key /etc/letsencrypt/live/plurnk.example.com/privkey.pem;
32
+ ssl_protocols TLSv1.2 TLSv1.3;
33
+ ssl_prefer_server_ciphers off;
34
+ ssl_session_timeout 1d;
35
+ ssl_session_cache shared:plurnk_tls:10m;
36
+ ssl_session_tickets off;
37
+
38
+ add_header Strict-Transport-Security "max-age=63072000" always;
39
+ add_header X-Content-Type-Options nosniff always;
40
+ proxy_hide_header X-Frame-Options;
41
+ add_header X-Frame-Options DENY always;
42
+ add_header Referrer-Policy same-origin always;
43
+
44
+ # Optional: admit only your own networks.
45
+ # allow 192.168.1.0/24;
46
+ # allow 10.0.0.0/8;
47
+ # deny all;
48
+
49
+ # Messages and their attachments arrive in request bodies.
50
+ client_max_body_size 64m;
51
+
52
+ proxy_http_version 1.1;
53
+ proxy_set_header Host $host;
54
+ proxy_set_header Connection "";
55
+
56
+ location / {
57
+ proxy_pass http://127.0.0.1:1066;
58
+ # AG-UI answers over server-sent events: a buffered or timed-out stream looks like a hang.
59
+ proxy_buffering off;
60
+ proxy_cache off;
61
+ proxy_read_timeout 1h;
62
+ proxy_send_timeout 1h;
63
+ }
64
+
65
+ # The browser sign-in form takes the operator's password.
66
+ location = /oauth/authorize {
67
+ limit_req zone=plurnk_signin burst=5 nodelay;
68
+ limit_req_status 429;
69
+ proxy_pass http://127.0.0.1:1066;
70
+ }
71
+ }
package/plurnk.service CHANGED
@@ -10,6 +10,8 @@
10
10
  # systemd does not source your interactive shell. Adjust EnvironmentFile for
11
11
  # a non-default XDG_CONFIG_HOME. Preserve the file's private permissions.
12
12
  # Logs land in the user journal: journalctl --user -u plurnk -f
13
+ # Other machines on your network: add Environment=PLURNK_HOST=0.0.0.0 under [Service] and browse to
14
+ # any of this machine's addresses. Beyond a network you trust, front it with plurnk.nginx.conf.
13
15
  [Unit]
14
16
  Description=PLURNK agentic-development daemon
15
17
  After=network.target