@plurnk/plurnk-service 1.16.5 → 1.18.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 (661) hide show
  1. package/.env.defaults +140 -246
  2. package/INSTALL.md +84 -138
  3. package/README.md +10 -6
  4. package/SPEC.md +2468 -1694
  5. package/dist/Paths.d.ts +2 -0
  6. package/dist/Paths.d.ts.map +1 -1
  7. package/dist/Paths.js +2 -0
  8. package/dist/Paths.js.map +1 -1
  9. package/dist/build-info.d.ts.map +1 -1
  10. package/dist/build-info.js +7 -1
  11. package/dist/build-info.js.map +1 -1
  12. package/dist/build-info.json +1 -1
  13. package/dist/content/body-preview.d.ts +8 -0
  14. package/dist/content/body-preview.d.ts.map +1 -0
  15. package/dist/content/body-preview.js +39 -0
  16. package/dist/content/body-preview.js.map +1 -0
  17. package/dist/content/byte-view.d.ts +1 -4
  18. package/dist/content/byte-view.d.ts.map +1 -1
  19. package/dist/content/byte-view.js.map +1 -1
  20. package/dist/content/edit-collision.d.ts.map +1 -1
  21. package/dist/content/edit-collision.js +3 -4
  22. package/dist/content/edit-collision.js.map +1 -1
  23. package/dist/content/line-anchors.d.ts +2 -2
  24. package/dist/content/line-anchors.d.ts.map +1 -1
  25. package/dist/content/line-anchors.js +4 -3
  26. package/dist/content/line-anchors.js.map +1 -1
  27. package/dist/content/line-selection.d.ts +9 -0
  28. package/dist/content/line-selection.d.ts.map +1 -0
  29. package/dist/content/line-selection.js +29 -0
  30. package/dist/content/line-selection.js.map +1 -0
  31. package/dist/content/matcher.d.ts +0 -1
  32. package/dist/content/matcher.d.ts.map +1 -1
  33. package/dist/content/matcher.js +2 -3
  34. package/dist/content/matcher.js.map +1 -1
  35. package/dist/content/pattern-edits.d.ts +39 -0
  36. package/dist/content/pattern-edits.d.ts.map +1 -0
  37. package/dist/content/pattern-edits.js +121 -0
  38. package/dist/content/pattern-edits.js.map +1 -0
  39. package/dist/content/read-projector.d.ts +18 -9
  40. package/dist/content/read-projector.d.ts.map +1 -1
  41. package/dist/content/read-projector.js +132 -35
  42. package/dist/content/read-projector.js.map +1 -1
  43. package/dist/content/read-resolve.d.ts +4 -1
  44. package/dist/content/read-resolve.d.ts.map +1 -1
  45. package/dist/content/read-resolve.js +42 -7
  46. package/dist/content/read-resolve.js.map +1 -1
  47. package/dist/core/AdmittedTurnExecutor.d.ts +2 -5
  48. package/dist/core/AdmittedTurnExecutor.d.ts.map +1 -1
  49. package/dist/core/AdmittedTurnExecutor.js +96 -88
  50. package/dist/core/AdmittedTurnExecutor.js.map +1 -1
  51. package/dist/core/BareBatchRunner.d.ts +6 -1
  52. package/dist/core/BareBatchRunner.d.ts.map +1 -1
  53. package/dist/core/BareBatchRunner.js +20 -5
  54. package/dist/core/BareBatchRunner.js.map +1 -1
  55. package/dist/core/BudgetReadout.d.ts +2 -3
  56. package/dist/core/BudgetReadout.d.ts.map +1 -1
  57. package/dist/core/BudgetReadout.js +23 -32
  58. package/dist/core/BudgetReadout.js.map +1 -1
  59. package/dist/core/CapabilityPolicies.d.ts +3 -8
  60. package/dist/core/CapabilityPolicies.d.ts.map +1 -1
  61. package/dist/core/CapabilityPolicies.js +2 -28
  62. package/dist/core/CapabilityPolicies.js.map +1 -1
  63. package/dist/core/CapabilityResolver.d.ts +10 -10
  64. package/dist/core/CapabilityResolver.d.ts.map +1 -1
  65. package/dist/core/CapabilityResolver.js +122 -93
  66. package/dist/core/CapabilityResolver.js.map +1 -1
  67. package/dist/core/ChannelWrite.d.ts +15 -11
  68. package/dist/core/ChannelWrite.d.ts.map +1 -1
  69. package/dist/core/ChannelWrite.js +12 -13
  70. package/dist/core/ChannelWrite.js.map +1 -1
  71. package/dist/core/ChannelWrite.sql +99 -9
  72. package/dist/core/ClientInteractions.d.ts.map +1 -1
  73. package/dist/core/ClientInteractions.js +7 -0
  74. package/dist/core/ClientInteractions.js.map +1 -1
  75. package/dist/core/CoreSchemeServices.d.ts +13 -10
  76. package/dist/core/CoreSchemeServices.d.ts.map +1 -1
  77. package/dist/core/CoreSchemeServices.js +13 -5
  78. package/dist/core/CoreSchemeServices.js.map +1 -1
  79. package/dist/core/DataStatementRunner.d.ts +2 -2
  80. package/dist/core/DataStatementRunner.d.ts.map +1 -1
  81. package/dist/core/DataStatementRunner.js +208 -161
  82. package/dist/core/DataStatementRunner.js.map +1 -1
  83. package/dist/core/Dispatcher.d.ts +24 -26
  84. package/dist/core/Dispatcher.d.ts.map +1 -1
  85. package/dist/core/Dispatcher.js +381 -232
  86. package/dist/core/Dispatcher.js.map +1 -1
  87. package/dist/core/Dispatcher.sql +66 -0
  88. package/dist/core/DurableStatement.d.ts.map +1 -1
  89. package/dist/core/DurableStatement.js +2 -1
  90. package/dist/core/DurableStatement.js.map +1 -1
  91. package/dist/core/EditMutations.d.ts +14 -18
  92. package/dist/core/EditMutations.d.ts.map +1 -1
  93. package/dist/core/EditMutations.js +211 -280
  94. package/dist/core/EditMutations.js.map +1 -1
  95. package/dist/core/EditMutations.sql +15 -0
  96. package/dist/core/EditSequence.d.ts +13 -0
  97. package/dist/core/EditSequence.d.ts.map +1 -0
  98. package/dist/core/EditSequence.js +73 -0
  99. package/dist/core/EditSequence.js.map +1 -0
  100. package/dist/core/Engine.d.ts +17 -23
  101. package/dist/core/Engine.d.ts.map +1 -1
  102. package/dist/core/Engine.js +74 -164
  103. package/dist/core/Engine.js.map +1 -1
  104. package/dist/core/Engine.sql +0 -724
  105. package/dist/core/EntryAddressBinding.d.ts +7 -17
  106. package/dist/core/EntryAddressBinding.d.ts.map +1 -1
  107. package/dist/core/EntryAddressBinding.js +12 -72
  108. package/dist/core/EntryAddressBinding.js.map +1 -1
  109. package/dist/core/ExecutionOutputs.d.ts +9 -0
  110. package/dist/core/ExecutionOutputs.d.ts.map +1 -0
  111. package/dist/core/ExecutionOutputs.js +36 -0
  112. package/dist/core/ExecutionOutputs.js.map +1 -0
  113. package/dist/core/ExecutionOutputs.sql +21 -0
  114. package/dist/core/ExecutorRegistry.d.ts +11 -5
  115. package/dist/core/ExecutorRegistry.d.ts.map +1 -1
  116. package/dist/core/ExecutorRegistry.js +37 -32
  117. package/dist/core/ExecutorRegistry.js.map +1 -1
  118. package/dist/core/HostPaths.d.ts +1 -0
  119. package/dist/core/HostPaths.d.ts.map +1 -1
  120. package/dist/core/HostPaths.js +4 -0
  121. package/dist/core/HostPaths.js.map +1 -1
  122. package/dist/core/InferenceCall.d.ts.map +1 -1
  123. package/dist/core/InferenceCall.js +1 -2
  124. package/dist/core/InferenceCall.js.map +1 -1
  125. package/dist/core/InferenceCall.sql +29 -0
  126. package/dist/core/KillHandler.d.ts +1 -0
  127. package/dist/core/KillHandler.d.ts.map +1 -1
  128. package/dist/core/KillHandler.js +24 -21
  129. package/dist/core/KillHandler.js.map +1 -1
  130. package/dist/core/LogBody.d.ts +8 -1
  131. package/dist/core/LogBody.d.ts.map +1 -1
  132. package/dist/core/LogBody.js +44 -12
  133. package/dist/core/LogBody.js.map +1 -1
  134. package/dist/core/LogEntryProjection.d.ts +1 -0
  135. package/dist/core/LogEntryProjection.d.ts.map +1 -1
  136. package/dist/core/LogEntryProjection.js +12 -10
  137. package/dist/core/LogEntryProjection.js.map +1 -1
  138. package/dist/core/LogVisibility.d.ts +1 -0
  139. package/dist/core/LogVisibility.d.ts.map +1 -1
  140. package/dist/core/LogVisibility.js +3 -0
  141. package/dist/core/LogVisibility.js.map +1 -1
  142. package/dist/core/LogWriter.d.ts +2 -3
  143. package/dist/core/LogWriter.d.ts.map +1 -1
  144. package/dist/core/LogWriter.js +31 -36
  145. package/dist/core/LogWriter.js.map +1 -1
  146. package/dist/core/LogWriter.sql +23 -0
  147. package/dist/core/LoopDriver.d.ts +11 -8
  148. package/dist/core/LoopDriver.d.ts.map +1 -1
  149. package/dist/core/LoopDriver.js +161 -189
  150. package/dist/core/LoopDriver.js.map +1 -1
  151. package/dist/core/LoopDriver.sql +11 -0
  152. package/dist/core/LoopLifecycle.d.ts +32 -2
  153. package/dist/core/LoopLifecycle.d.ts.map +1 -1
  154. package/dist/core/LoopLifecycle.js +88 -4
  155. package/dist/core/LoopLifecycle.js.map +1 -1
  156. package/dist/core/LoopLifecycle.sql +145 -28
  157. package/dist/core/LoopPolicyReader.sql +6 -0
  158. package/dist/core/MembershipMaterialization.d.ts.map +1 -1
  159. package/dist/core/MembershipMaterialization.js +6 -28
  160. package/dist/core/MembershipMaterialization.js.map +1 -1
  161. package/dist/core/ModelCall.d.ts.map +1 -1
  162. package/dist/core/ModelCall.js +2 -6
  163. package/dist/core/ModelCall.js.map +1 -1
  164. package/dist/core/ModelCall.sql +41 -0
  165. package/dist/core/MutationEffects.d.ts +5 -3
  166. package/dist/core/MutationEffects.d.ts.map +1 -1
  167. package/dist/core/MutationEffects.js +10 -28
  168. package/dist/core/MutationEffects.js.map +1 -1
  169. package/dist/core/NativeContent.d.ts +6 -0
  170. package/dist/core/NativeContent.d.ts.map +1 -0
  171. package/dist/core/NativeContent.js +16 -0
  172. package/dist/core/NativeContent.js.map +1 -0
  173. package/dist/core/NativeContent.sql +6 -0
  174. package/dist/core/NoticeChannel.js +1 -1
  175. package/dist/core/NoticeChannel.js.map +1 -1
  176. package/dist/core/OperatorConfig.js +5 -5
  177. package/dist/core/OperatorConfig.js.map +1 -1
  178. package/dist/core/PacketBuilder.d.ts +8 -5
  179. package/dist/core/PacketBuilder.d.ts.map +1 -1
  180. package/dist/core/PacketBuilder.js +117 -81
  181. package/dist/core/PacketBuilder.js.map +1 -1
  182. package/dist/core/PacketBuilder.sql +146 -0
  183. package/dist/core/PatternSelection.d.ts +28 -0
  184. package/dist/core/PatternSelection.d.ts.map +1 -0
  185. package/dist/core/PatternSelection.js +42 -0
  186. package/dist/core/PatternSelection.js.map +1 -0
  187. package/dist/core/ProblemLog.d.ts.map +1 -1
  188. package/dist/core/ProblemLog.js +0 -1
  189. package/dist/core/ProblemLog.js.map +1 -1
  190. package/dist/core/PromptFrames.d.ts +12 -0
  191. package/dist/core/PromptFrames.d.ts.map +1 -0
  192. package/dist/core/PromptFrames.js +28 -0
  193. package/dist/core/PromptFrames.js.map +1 -0
  194. package/dist/core/ProposalLifecycle.d.ts +0 -1
  195. package/dist/core/ProposalLifecycle.d.ts.map +1 -1
  196. package/dist/core/ProposalLifecycle.js +26 -23
  197. package/dist/core/ProposalLifecycle.js.map +1 -1
  198. package/dist/core/ProposalLifecycle.sql +33 -0
  199. package/dist/core/ProviderInstantiate.d.ts +1 -1
  200. package/dist/core/ProviderInstantiate.d.ts.map +1 -1
  201. package/dist/core/ProviderInstantiate.js +7 -14
  202. package/dist/core/ProviderInstantiate.js.map +1 -1
  203. package/dist/core/ReasoningView.d.ts +9 -0
  204. package/dist/core/ReasoningView.d.ts.map +1 -0
  205. package/dist/core/ReasoningView.js +47 -0
  206. package/dist/core/ReasoningView.js.map +1 -0
  207. package/dist/core/ResourceBindings.d.ts +16 -0
  208. package/dist/core/ResourceBindings.d.ts.map +1 -0
  209. package/dist/core/ResourceBindings.js +45 -0
  210. package/dist/core/ResourceBindings.js.map +1 -0
  211. package/dist/core/ResourceMutations.d.ts +5 -8
  212. package/dist/core/ResourceMutations.d.ts.map +1 -1
  213. package/dist/core/ResourceMutations.js +6 -7
  214. package/dist/core/ResourceMutations.js.map +1 -1
  215. package/dist/core/ResourceSelector.d.ts +2 -2
  216. package/dist/core/ResourceSelector.d.ts.map +1 -1
  217. package/dist/core/ResourceSelector.js +122 -62
  218. package/dist/core/ResourceSelector.js.map +1 -1
  219. package/dist/core/ResourceTransfers.d.ts +4 -2
  220. package/dist/core/ResourceTransfers.d.ts.map +1 -1
  221. package/dist/core/ResourceTransfers.js +95 -26
  222. package/dist/core/ResourceTransfers.js.map +1 -1
  223. package/dist/core/RuntimeWorker.d.ts +5 -0
  224. package/dist/core/RuntimeWorker.d.ts.map +1 -0
  225. package/dist/core/RuntimeWorker.js +15 -0
  226. package/dist/core/RuntimeWorker.js.map +1 -0
  227. package/dist/core/RuntimeWorker.sql +11 -0
  228. package/dist/core/SchemeRegistry.d.ts +12 -16
  229. package/dist/core/SchemeRegistry.d.ts.map +1 -1
  230. package/dist/core/SchemeRegistry.js +59 -85
  231. package/dist/core/SchemeRegistry.js.map +1 -1
  232. package/dist/core/StoredPacket.d.ts +6 -1
  233. package/dist/core/StoredPacket.d.ts.map +1 -1
  234. package/dist/core/StoredPacket.js +30 -10
  235. package/dist/core/StoredPacket.js.map +1 -1
  236. package/dist/core/StrikeRail.d.ts +11 -8
  237. package/dist/core/StrikeRail.d.ts.map +1 -1
  238. package/dist/core/StrikeRail.js +63 -114
  239. package/dist/core/StrikeRail.js.map +1 -1
  240. package/dist/core/StrikeRail.sql +12 -0
  241. package/dist/core/TerminalResult.d.ts +1 -1
  242. package/dist/core/TerminalResult.d.ts.map +1 -1
  243. package/dist/core/TerminalResult.js +2 -2
  244. package/dist/core/TerminalResult.js.map +1 -1
  245. package/dist/core/TokenCalibration.d.ts +1 -6
  246. package/dist/core/TokenCalibration.d.ts.map +1 -1
  247. package/dist/core/TokenCalibration.js +13 -9
  248. package/dist/core/TokenCalibration.js.map +1 -1
  249. package/dist/core/TokenCalibration.sql +15 -0
  250. package/dist/core/ToolInputSchema.d.ts +6 -0
  251. package/dist/core/ToolInputSchema.d.ts.map +1 -0
  252. package/dist/core/ToolInputSchema.js +43 -0
  253. package/dist/core/ToolInputSchema.js.map +1 -0
  254. package/dist/core/ToolResources.d.ts.map +1 -1
  255. package/dist/core/ToolResources.js +77 -51
  256. package/dist/core/ToolResources.js.map +1 -1
  257. package/dist/core/Turn.d.ts +5 -2
  258. package/dist/core/Turn.d.ts.map +1 -1
  259. package/dist/core/Turn.js +13 -11
  260. package/dist/core/Turn.js.map +1 -1
  261. package/dist/core/Turn.sql +25 -39
  262. package/dist/core/{SendBroadcastHandler.d.ts → TurnDispositionHandler.d.ts} +24 -18
  263. package/dist/core/TurnDispositionHandler.d.ts.map +1 -0
  264. package/dist/core/TurnDispositionHandler.js +206 -0
  265. package/dist/core/TurnDispositionHandler.js.map +1 -0
  266. package/dist/core/TurnMaterialization.d.ts +2 -3
  267. package/dist/core/TurnMaterialization.d.ts.map +1 -1
  268. package/dist/core/TurnMaterialization.js +47 -24
  269. package/dist/core/TurnMaterialization.js.map +1 -1
  270. package/dist/core/TurnMaterialization.sql +44 -0
  271. package/dist/core/TurnOps.d.ts.map +1 -1
  272. package/dist/core/TurnOps.js +8 -64
  273. package/dist/core/TurnOps.js.map +1 -1
  274. package/dist/core/TurnRunner.d.ts +8 -15
  275. package/dist/core/TurnRunner.d.ts.map +1 -1
  276. package/dist/core/TurnRunner.js +1175 -1317
  277. package/dist/core/TurnRunner.js.map +1 -1
  278. package/dist/core/TurnRunner.sql +74 -0
  279. package/dist/core/TurnSources.sql +39 -0
  280. package/dist/core/WorkerControlAddress.d.ts +1 -0
  281. package/dist/core/WorkerControlAddress.d.ts.map +1 -1
  282. package/dist/core/WorkerControlAddress.js +5 -0
  283. package/dist/core/WorkerControlAddress.js.map +1 -1
  284. package/dist/core/WorkerControlHandler.d.ts +1 -3
  285. package/dist/core/WorkerControlHandler.d.ts.map +1 -1
  286. package/dist/core/WorkerControlHandler.js +64 -48
  287. package/dist/core/WorkerControlHandler.js.map +1 -1
  288. package/dist/core/WorkerName.d.ts +11 -12
  289. package/dist/core/WorkerName.d.ts.map +1 -1
  290. package/dist/core/WorkerName.js +40 -47
  291. package/dist/core/WorkerName.js.map +1 -1
  292. package/dist/core/WorkerName.sql +7 -10
  293. package/dist/core/WorkspaceGate.d.ts +1 -1
  294. package/dist/core/WorkspaceGate.d.ts.map +1 -1
  295. package/dist/core/WorkspaceGate.js +33 -10
  296. package/dist/core/WorkspaceGate.js.map +1 -1
  297. package/dist/core/ambient.sql +236 -0
  298. package/dist/core/attachments.d.ts +2 -1
  299. package/dist/core/attachments.d.ts.map +1 -1
  300. package/dist/core/attachments.js +5 -4
  301. package/dist/core/attachments.js.map +1 -1
  302. package/dist/core/caps/CapsResolve.d.ts +2 -3
  303. package/dist/core/caps/CapsResolve.d.ts.map +1 -1
  304. package/dist/core/caps/CapsResolve.js +5 -5
  305. package/dist/core/caps/CapsResolve.js.map +1 -1
  306. package/dist/core/caps/DbChannelCaps.d.ts +1 -1
  307. package/dist/core/caps/DbChannelCaps.d.ts.map +1 -1
  308. package/dist/core/caps/DbChannelCaps.js +4 -6
  309. package/dist/core/caps/DbChannelCaps.js.map +1 -1
  310. package/dist/core/caps/DbEntryCaps.d.ts +2 -1
  311. package/dist/core/caps/DbEntryCaps.d.ts.map +1 -1
  312. package/dist/core/caps/DbEntryCaps.js +11 -17
  313. package/dist/core/caps/DbEntryCaps.js.map +1 -1
  314. package/dist/core/caps/DbNotifyCaps.d.ts +1 -1
  315. package/dist/core/caps/DbNotifyCaps.d.ts.map +1 -1
  316. package/dist/core/caps/DbNotifyCaps.js +3 -5
  317. package/dist/core/caps/DbNotifyCaps.js.map +1 -1
  318. package/dist/core/caps/DbProjectionCaps.js +1 -1
  319. package/dist/core/caps/DbProjectionCaps.js.map +1 -1
  320. package/dist/core/caps/DbSubscriptionCaps.d.ts +1 -1
  321. package/dist/core/caps/DbSubscriptionCaps.d.ts.map +1 -1
  322. package/dist/core/caps/DbSubscriptionCaps.js +5 -7
  323. package/dist/core/caps/DbSubscriptionCaps.js.map +1 -1
  324. package/dist/core/caps/SchemeCtxImpl.d.ts +0 -2
  325. package/dist/core/caps/SchemeCtxImpl.d.ts.map +1 -1
  326. package/dist/core/caps/SchemeCtxImpl.js +4 -20
  327. package/dist/core/caps/SchemeCtxImpl.js.map +1 -1
  328. package/dist/core/env-catalog.d.ts +28 -0
  329. package/dist/core/env-catalog.d.ts.map +1 -0
  330. package/dist/core/env-catalog.js +99 -0
  331. package/dist/core/env-catalog.js.map +1 -0
  332. package/dist/core/env-defaults.d.ts.map +1 -1
  333. package/dist/core/env-defaults.js +4 -2
  334. package/dist/core/env-defaults.js.map +1 -1
  335. package/dist/core/file-materialization.d.ts +4 -1
  336. package/dist/core/file-materialization.d.ts.map +1 -1
  337. package/dist/core/file-materialization.js +15 -1
  338. package/dist/core/file-materialization.js.map +1 -1
  339. package/dist/core/fork.d.ts +1 -6
  340. package/dist/core/fork.d.ts.map +1 -1
  341. package/dist/core/fork.js +9 -153
  342. package/dist/core/fork.js.map +1 -1
  343. package/dist/core/fork.sql +162 -185
  344. package/dist/core/git-env.d.ts +1 -0
  345. package/dist/core/git-env.d.ts.map +1 -1
  346. package/dist/core/git-env.js +39 -2
  347. package/dist/core/git-env.js.map +1 -1
  348. package/dist/core/git-membership.d.ts.map +1 -1
  349. package/dist/core/git-membership.js +64 -48
  350. package/dist/core/git-membership.js.map +1 -1
  351. package/dist/core/git-state.d.ts.map +1 -1
  352. package/dist/core/git-state.js +26 -20
  353. package/dist/core/git-state.js.map +1 -1
  354. package/dist/core/glob_match.d.ts +4 -0
  355. package/dist/core/glob_match.d.ts.map +1 -0
  356. package/dist/core/glob_match.js +7 -0
  357. package/dist/core/glob_match.js.map +1 -0
  358. package/dist/core/maintenance.sql +6 -0
  359. package/dist/core/mutation-types.d.ts +7 -28
  360. package/dist/core/mutation-types.d.ts.map +1 -1
  361. package/dist/core/operation-target-groups.d.ts.map +1 -1
  362. package/dist/core/operation-target-groups.js +2 -1
  363. package/dist/core/operation-target-groups.js.map +1 -1
  364. package/dist/core/packet-inject.d.ts.map +1 -1
  365. package/dist/core/packet-inject.js +2 -3
  366. package/dist/core/packet-inject.js.map +1 -1
  367. package/dist/core/packet-wire.d.ts +8 -6
  368. package/dist/core/packet-wire.d.ts.map +1 -1
  369. package/dist/core/packet-wire.js +381 -388
  370. package/dist/core/packet-wire.js.map +1 -1
  371. package/dist/core/plurnk-uri.d.ts +1 -1
  372. package/dist/core/plurnk-uri.d.ts.map +1 -1
  373. package/dist/core/plurnk-uri.js +5 -12
  374. package/dist/core/plurnk-uri.js.map +1 -1
  375. package/dist/core/scheme-types.d.ts +3 -3
  376. package/dist/core/scheme-types.d.ts.map +1 -1
  377. package/dist/core/scheme-types.js.map +1 -1
  378. package/dist/core/sha256.d.ts +4 -0
  379. package/dist/core/sha256.d.ts.map +1 -0
  380. package/dist/core/sha256.js +6 -0
  381. package/dist/core/sha256.js.map +1 -0
  382. package/dist/core/teaching.js +1 -1
  383. package/dist/core/teaching.js.map +1 -1
  384. package/dist/core/turn-scheduler.d.ts.map +1 -1
  385. package/dist/core/turn-scheduler.js +5 -18
  386. package/dist/core/turn-scheduler.js.map +1 -1
  387. package/dist/core/turn-signals.d.ts +0 -6
  388. package/dist/core/turn-signals.d.ts.map +1 -1
  389. package/dist/core/turn-signals.js +1 -7
  390. package/dist/core/turn-signals.js.map +1 -1
  391. package/dist/core/worker-ops.sql +15 -22
  392. package/dist/core/workspace-settings.d.ts.map +1 -1
  393. package/dist/core/workspace-settings.js +18 -2
  394. package/dist/core/workspace-settings.js.map +1 -1
  395. package/dist/core/workspace-settings.sql +6 -0
  396. package/dist/digest/Digest.d.ts.map +1 -1
  397. package/dist/digest/Digest.js +30 -91
  398. package/dist/digest/Digest.js.map +1 -1
  399. package/dist/digest/DigestRender.d.ts +1 -0
  400. package/dist/digest/DigestRender.d.ts.map +1 -1
  401. package/dist/digest/DigestRender.js +58 -62
  402. package/dist/digest/DigestRender.js.map +1 -1
  403. package/dist/digest/digest-rows.d.ts +16 -32
  404. package/dist/digest/digest-rows.d.ts.map +1 -1
  405. package/dist/digest/digest.sql +54 -20
  406. package/dist/schemes/Exec.d.ts +6 -12
  407. package/dist/schemes/Exec.d.ts.map +1 -1
  408. package/dist/schemes/Exec.js +318 -215
  409. package/dist/schemes/Exec.js.map +1 -1
  410. package/dist/schemes/ExecOutputScheme.d.ts +8 -6
  411. package/dist/schemes/ExecOutputScheme.d.ts.map +1 -1
  412. package/dist/schemes/ExecOutputScheme.js +33 -61
  413. package/dist/schemes/ExecOutputScheme.js.map +1 -1
  414. package/dist/schemes/ExecScheduler.js +2 -2
  415. package/dist/schemes/ExecScheduler.js.map +1 -1
  416. package/dist/schemes/ExecutionInput.d.ts +12 -0
  417. package/dist/schemes/ExecutionInput.d.ts.map +1 -0
  418. package/dist/schemes/ExecutionInput.js +94 -0
  419. package/dist/schemes/ExecutionInput.js.map +1 -0
  420. package/dist/schemes/File.d.ts +5 -2
  421. package/dist/schemes/File.d.ts.map +1 -1
  422. package/dist/schemes/File.js +62 -91
  423. package/dist/schemes/File.js.map +1 -1
  424. package/dist/schemes/Log.d.ts.map +1 -1
  425. package/dist/schemes/Log.js +84 -79
  426. package/dist/schemes/Log.js.map +1 -1
  427. package/dist/schemes/Log.sql +183 -15
  428. package/dist/schemes/Prompt.d.ts.map +1 -1
  429. package/dist/schemes/Prompt.js +3 -12
  430. package/dist/schemes/Prompt.js.map +1 -1
  431. package/dist/schemes/QuestionTool.d.ts +5 -0
  432. package/dist/schemes/QuestionTool.d.ts.map +1 -1
  433. package/dist/schemes/QuestionTool.js +7 -15
  434. package/dist/schemes/QuestionTool.js.map +1 -1
  435. package/dist/schemes/Skill.d.ts +12 -7
  436. package/dist/schemes/Skill.d.ts.map +1 -1
  437. package/dist/schemes/Skill.js +149 -21
  438. package/dist/schemes/Skill.js.map +1 -1
  439. package/dist/schemes/TurnSource.d.ts +12 -0
  440. package/dist/schemes/TurnSource.d.ts.map +1 -0
  441. package/dist/schemes/TurnSource.js +117 -0
  442. package/dist/schemes/TurnSource.js.map +1 -0
  443. package/dist/schemes/Worker.d.ts +3 -3
  444. package/dist/schemes/Worker.d.ts.map +1 -1
  445. package/dist/schemes/Worker.js +61 -208
  446. package/dist/schemes/Worker.js.map +1 -1
  447. package/dist/schemes/_entry-crud.d.ts +12 -15
  448. package/dist/schemes/_entry-crud.d.ts.map +1 -1
  449. package/dist/schemes/_entry-crud.js +63 -63
  450. package/dist/schemes/_entry-crud.js.map +1 -1
  451. package/dist/schemes/_entry-crud.sql +159 -45
  452. package/dist/schemes/_entry-find.d.ts +1 -3
  453. package/dist/schemes/_entry-find.d.ts.map +1 -1
  454. package/dist/schemes/_entry-find.js +111 -112
  455. package/dist/schemes/_entry-find.js.map +1 -1
  456. package/dist/schemes/_entry-find.sql +22 -14
  457. package/dist/schemes/_entry-fts.d.ts +14 -0
  458. package/dist/schemes/_entry-fts.d.ts.map +1 -0
  459. package/dist/schemes/_entry-fts.js +82 -0
  460. package/dist/schemes/_entry-fts.js.map +1 -0
  461. package/dist/schemes/_entry-fts.sql +31 -0
  462. package/dist/schemes/_entry-graph.d.ts.map +1 -1
  463. package/dist/schemes/_entry-graph.js +6 -14
  464. package/dist/schemes/_entry-graph.js.map +1 -1
  465. package/dist/schemes/_entry-graph.sql +29 -44
  466. package/dist/schemes/_entry-manifest.d.ts +2 -1
  467. package/dist/schemes/_entry-manifest.d.ts.map +1 -1
  468. package/dist/schemes/_entry-manifest.js +20 -26
  469. package/dist/schemes/_entry-manifest.js.map +1 -1
  470. package/dist/schemes/_entry-manifest.sql +26 -0
  471. package/dist/schemes/_entry-ops.d.ts +3 -5
  472. package/dist/schemes/_entry-ops.d.ts.map +1 -1
  473. package/dist/schemes/_entry-ops.js +30 -43
  474. package/dist/schemes/_entry-ops.js.map +1 -1
  475. package/dist/schemes/_entry-ops.sql +5 -6
  476. package/dist/schemes/_entry-readable.d.ts +8 -0
  477. package/dist/schemes/_entry-readable.d.ts.map +1 -0
  478. package/dist/schemes/_entry-readable.js +38 -0
  479. package/dist/schemes/_entry-readable.js.map +1 -0
  480. package/dist/schemes/_entry-send.d.ts +1 -1
  481. package/dist/schemes/_entry-send.d.ts.map +1 -1
  482. package/dist/schemes/_entry-send.js +3 -3
  483. package/dist/schemes/_entry-send.js.map +1 -1
  484. package/dist/schemes/_search-index.d.ts +5 -3
  485. package/dist/schemes/_search-index.d.ts.map +1 -1
  486. package/dist/schemes/_search-index.js +169 -160
  487. package/dist/schemes/_search-index.js.map +1 -1
  488. package/dist/schemes/_search-index.sql +47 -0
  489. package/dist/schemes/exec-abort.js +1 -1
  490. package/dist/schemes/exec-abort.js.map +1 -1
  491. package/dist/schemes/exec-env.d.ts +3 -0
  492. package/dist/schemes/exec-env.d.ts.map +1 -1
  493. package/dist/schemes/exec-env.js +66 -15
  494. package/dist/schemes/exec-env.js.map +1 -1
  495. package/dist/schemes/exec-runtime.d.ts +1 -1
  496. package/dist/schemes/exec-runtime.d.ts.map +1 -1
  497. package/dist/schemes/exec-runtime.js +1 -1
  498. package/dist/schemes/exec-runtime.js.map +1 -1
  499. package/dist/server/ClientReads.d.ts +2 -2
  500. package/dist/server/ClientReads.d.ts.map +1 -1
  501. package/dist/server/ClientReads.js +7 -9
  502. package/dist/server/ClientReads.js.map +1 -1
  503. package/dist/server/Daemon.d.ts +15 -21
  504. package/dist/server/Daemon.d.ts.map +1 -1
  505. package/dist/server/Daemon.js +165 -168
  506. package/dist/server/Daemon.js.map +1 -1
  507. package/dist/server/DaemonModule.d.ts +29 -22
  508. package/dist/server/DaemonModule.d.ts.map +1 -1
  509. package/dist/server/DrainSupervisor.d.ts +8 -21
  510. package/dist/server/DrainSupervisor.d.ts.map +1 -1
  511. package/dist/server/DrainSupervisor.js +278 -306
  512. package/dist/server/DrainSupervisor.js.map +1 -1
  513. package/dist/server/EnvFunctionality.d.ts +43 -0
  514. package/dist/server/EnvFunctionality.d.ts.map +1 -0
  515. package/dist/server/EnvFunctionality.js +194 -0
  516. package/dist/server/EnvFunctionality.js.map +1 -0
  517. package/dist/server/Functionality.d.ts +12 -11
  518. package/dist/server/Functionality.d.ts.map +1 -1
  519. package/dist/server/Functionality.js +279 -142
  520. package/dist/server/Functionality.js.map +1 -1
  521. package/dist/server/FunctionalityManager.d.ts +5 -5
  522. package/dist/server/FunctionalityManager.d.ts.map +1 -1
  523. package/dist/server/FunctionalityManager.js +29 -57
  524. package/dist/server/FunctionalityManager.js.map +1 -1
  525. package/dist/server/MembersFunctionality.d.ts +5 -4
  526. package/dist/server/MembersFunctionality.d.ts.map +1 -1
  527. package/dist/server/MembersFunctionality.js +24 -38
  528. package/dist/server/MembersFunctionality.js.map +1 -1
  529. package/dist/server/PlurnkSkill.d.ts +11 -0
  530. package/dist/server/PlurnkSkill.d.ts.map +1 -0
  531. package/dist/server/PlurnkSkill.js +41 -0
  532. package/dist/server/PlurnkSkill.js.map +1 -0
  533. package/dist/server/Retention.d.ts +25 -0
  534. package/dist/server/Retention.d.ts.map +1 -0
  535. package/dist/server/Retention.js +57 -0
  536. package/dist/server/Retention.js.map +1 -0
  537. package/dist/server/Retention.sql +59 -0
  538. package/dist/server/ServiceModules.d.ts +5 -0
  539. package/dist/server/ServiceModules.d.ts.map +1 -0
  540. package/dist/server/ServiceModules.js +10 -0
  541. package/dist/server/ServiceModules.js.map +1 -0
  542. package/dist/server/SkillsFunctionality.d.ts +14 -19
  543. package/dist/server/SkillsFunctionality.d.ts.map +1 -1
  544. package/dist/server/SkillsFunctionality.js +102 -106
  545. package/dist/server/SkillsFunctionality.js.map +1 -1
  546. package/dist/server/WorkerModelResolver.d.ts +4 -0
  547. package/dist/server/WorkerModelResolver.d.ts.map +1 -1
  548. package/dist/server/WorkerModelResolver.js +72 -39
  549. package/dist/server/WorkerModelResolver.js.map +1 -1
  550. package/dist/server/WorkspaceCapabilities.d.ts +21 -0
  551. package/dist/server/WorkspaceCapabilities.d.ts.map +1 -0
  552. package/dist/server/{WorkerCapabilities.js → WorkspaceCapabilities.js} +40 -40
  553. package/dist/server/WorkspaceCapabilities.js.map +1 -0
  554. package/dist/server/WorkspaceResidency.d.ts +38 -0
  555. package/dist/server/WorkspaceResidency.d.ts.map +1 -0
  556. package/dist/server/WorkspaceResidency.js +226 -0
  557. package/dist/server/WorkspaceResidency.js.map +1 -0
  558. package/dist/server/client-input.d.ts +1 -4
  559. package/dist/server/client-input.d.ts.map +1 -1
  560. package/dist/server/client-input.js +5 -46
  561. package/dist/server/client-input.js.map +1 -1
  562. package/dist/server/dispatch-as-plurnk.d.ts.map +1 -1
  563. package/dist/server/dispatch-as-plurnk.js +4 -22
  564. package/dist/server/dispatch-as-plurnk.js.map +1 -1
  565. package/dist/server/drain.sql +66 -43
  566. package/dist/server/envelope.d.ts +8 -1
  567. package/dist/server/envelope.d.ts.map +1 -1
  568. package/dist/server/envelope.js +9 -19
  569. package/dist/server/envelope.js.map +1 -1
  570. package/dist/server/envelope.sql +49 -13
  571. package/dist/server/lifecycle-recovery.sql +18 -20
  572. package/dist/server/logEntry.d.ts +1 -1
  573. package/dist/server/logEntry.d.ts.map +1 -1
  574. package/dist/server/logEntry.js +4 -1
  575. package/dist/server/logEntry.js.map +1 -1
  576. package/dist/server/logEntry.sql +25 -1
  577. package/dist/server/loopDocs.d.ts +2 -2
  578. package/dist/server/loopDocs.d.ts.map +1 -1
  579. package/dist/server/loopDocs.js +38 -31
  580. package/dist/server/loopDocs.js.map +1 -1
  581. package/dist/server/loopDocs.sql +1 -3
  582. package/dist/server/model-catalog.d.ts.map +1 -1
  583. package/dist/server/model-catalog.js +2 -1
  584. package/dist/server/model-catalog.js.map +1 -1
  585. package/dist/server/model-route.d.ts +1 -1
  586. package/dist/server/model-route.d.ts.map +1 -1
  587. package/dist/server/model-route.js +4 -2
  588. package/dist/server/model-route.js.map +1 -1
  589. package/dist/server/seam-entry-read.sql +3 -4
  590. package/dist/server/seam-loop.sql +2 -9
  591. package/dist/server/workspace-capabilities.sql +64 -0
  592. package/dist/service.d.ts.map +1 -1
  593. package/dist/service.js +21 -18
  594. package/dist/service.js.map +1 -1
  595. package/docs/env.md +55 -0
  596. package/docs/members.md +83 -0
  597. package/docs/skills.md +50 -0
  598. package/migrations/001_workspaces.sql +53 -0
  599. package/migrations/002_workers.sql +198 -0
  600. package/migrations/003_loops.sql +326 -0
  601. package/migrations/004_inference.sql +401 -0
  602. package/migrations/005_entries.sql +215 -0
  603. package/migrations/006_log.sql +581 -0
  604. package/migrations/007_subscriptions.sql +175 -0
  605. package/migrations/008_interactions.sql +29 -0
  606. package/package.json +44 -41
  607. package/digest-sql/channel-dispositions/dispositions.sql +0 -15
  608. package/digest-sql/channel-state/state.sql +0 -6
  609. package/digest-sql/curation/curation.sql +0 -6
  610. package/digest-sql/derivations/derivations.sql +0 -4
  611. package/digest-sql/embeddings/embeddings.sql +0 -4
  612. package/digest-sql/entry-dispositions/dispositions.sql +0 -15
  613. package/digest-sql/entry-state/state.sql +0 -6
  614. package/digest-sql/token-counts/token-counts.sql +0 -2
  615. package/dist/core/EmbeddingCall.d.ts +0 -23
  616. package/dist/core/EmbeddingCall.d.ts.map +0 -1
  617. package/dist/core/EmbeddingCall.js +0 -149
  618. package/dist/core/EmbeddingCall.js.map +0 -1
  619. package/dist/core/OverflowTurn.d.ts +0 -11
  620. package/dist/core/OverflowTurn.d.ts.map +0 -1
  621. package/dist/core/OverflowTurn.js +0 -80
  622. package/dist/core/OverflowTurn.js.map +0 -1
  623. package/dist/core/Owner.d.ts +0 -8
  624. package/dist/core/Owner.d.ts.map +0 -1
  625. package/dist/core/Owner.js +0 -46
  626. package/dist/core/Owner.js.map +0 -1
  627. package/dist/core/SendBroadcastHandler.d.ts.map +0 -1
  628. package/dist/core/SendBroadcastHandler.js +0 -159
  629. package/dist/core/SendBroadcastHandler.js.map +0 -1
  630. package/dist/core/VectorPump.d.ts +0 -28
  631. package/dist/core/VectorPump.d.ts.map +0 -1
  632. package/dist/core/VectorPump.js +0 -130
  633. package/dist/core/VectorPump.js.map +0 -1
  634. package/dist/core/owner.sql +0 -11
  635. package/dist/core/worker-settings.d.ts +0 -10
  636. package/dist/core/worker-settings.d.ts.map +0 -1
  637. package/dist/core/worker-settings.js +0 -53
  638. package/dist/core/worker-settings.js.map +0 -1
  639. package/dist/schemes/_entry-chunk.d.ts +0 -14
  640. package/dist/schemes/_entry-chunk.d.ts.map +0 -1
  641. package/dist/schemes/_entry-chunk.js +0 -165
  642. package/dist/schemes/_entry-chunk.js.map +0 -1
  643. package/dist/schemes/_entry-semantic.d.ts +0 -63
  644. package/dist/schemes/_entry-semantic.d.ts.map +0 -1
  645. package/dist/schemes/_entry-semantic.js +0 -299
  646. package/dist/schemes/_entry-semantic.js.map +0 -1
  647. package/dist/schemes/_entry-semantic.sql +0 -99
  648. package/dist/schemes/cosine.d.ts +0 -4
  649. package/dist/schemes/cosine.d.ts.map +0 -1
  650. package/dist/schemes/cosine.js +0 -9
  651. package/dist/schemes/cosine.js.map +0 -1
  652. package/dist/server/WorkerCapabilities.d.ts +0 -21
  653. package/dist/server/WorkerCapabilities.d.ts.map +0 -1
  654. package/dist/server/WorkerCapabilities.js.map +0 -1
  655. package/dist/server/WorkerResidency.d.ts +0 -40
  656. package/dist/server/WorkerResidency.d.ts.map +0 -1
  657. package/dist/server/WorkerResidency.js +0 -283
  658. package/dist/server/WorkerResidency.js.map +0 -1
  659. package/dist/server/seam-log-read.sql +0 -21
  660. package/dist/server/worker-capabilities.sql +0 -28
  661. package/migrations/001_schema.sql +0 -2207
@@ -1,28 +1,34 @@
1
- import { parsePath, PathSyntax } from "@plurnk/plurnk-contracts";
1
+ var _a;
2
+ import { parsePath } from "@plurnk/plurnk-parser";
3
+ import { PathSyntax } from "@plurnk/plurnk-contracts";
2
4
  import { WebFetcher, WebMaterializationError, } from "@plurnk/plurnk-schemes-http";
5
+ import { isWorkerBound } from "../core/ExecutorRegistry.js";
3
6
  import EffectPolicy from "./EffectPolicy.js";
4
7
  import EntryCrud from "./_entry-crud.js";
5
- import Owner from "../core/Owner.js";
6
8
  import EntryFind from "./_entry-find.js";
7
9
  import ChannelWrite from "../core/ChannelWrite.js";
8
10
  import ExecEnv from "./exec-env.js";
11
+ import EnvFunctionality, { ENV_OWNER } from "../server/EnvFunctionality.js";
9
12
  import ExecAbort from "./exec-abort.js";
10
- import { renderAddress } from "../core/plurnk-uri.js";
13
+ import { entryCoordinateOf, generatedPathname, renderAddress } from "../core/plurnk-uri.js";
11
14
  import { writeFile, unlink, stat } from "node:fs/promises";
12
15
  import { tmpdir } from "node:os";
13
- import { isAbsolute, join, resolve } from "node:path";
16
+ import { extname, isAbsolute, join, resolve } from "node:path";
14
17
  import { CoreSchemeAdapterBase } from "../core/CoreSchemeServices.js";
15
18
  import ErrorDetail from "../core/ErrorDetail.js";
16
19
  import Results, { OperationFailureError } from "../core/results.js";
17
- import { InvalidOperationResultError, NetworkAddress, } from "@plurnk/plurnk-schemes";
20
+ import { InvalidOperationResultError, NetworkAddress, ResourceNames, } from "@plurnk/plurnk-schemes";
18
21
  import DbProjectionCaps from "../core/caps/DbProjectionCaps.js";
19
22
  import WorkerControlAddress from "../core/WorkerControlAddress.js";
20
23
  import Turn from "../core/Turn.js";
24
+ import RuntimeWorker from "../core/RuntimeWorker.js";
21
25
  import LoopLifecycle from "../core/LoopLifecycle.js";
22
26
  import LogEntryProjection from "../core/LogEntryProjection.js";
23
27
  import LogBody from "../core/LogBody.js";
28
+ import ToolResources from "../core/ToolResources.js";
24
29
  import { setTimeout as delay } from "node:timers/promises";
25
30
  import ExecScheduler from "./ExecScheduler.js";
31
+ import ExecutionInput from "./ExecutionInput.js";
26
32
  import { execRouteOf } from "./exec-runtime.js";
27
33
  // Executors are discovered + probed at boot into ExecutorRegistry and reach
28
34
  // the scheme through ctx.executors ({§exec-registry-resolves}). Each runtime tag
@@ -49,68 +55,50 @@ const resourceSourceOf = (target) => {
49
55
  return null;
50
56
  return target.raw;
51
57
  };
52
- // EXEC's pathname is <runtime>/<loop_seq>/<turn_seq>/<sequence> (stamped by
53
- // Dispatcher.#writeLog). Exec owns this convention, so it — not the client — turns
54
- // the pathname into the entry's coordinate, mirrored onto stream payloads so
55
- // clients read fields instead of parsing the URI. The
56
- // coordinate is the numeric triple before the `/EXEC` op segment ({§log-coordinate-hierarchy}:
57
- // every item address is loop/turn/item/OP); any other pathname yields undefined (no
58
- // coordinate on the wire).
59
- // {§notifications-stream-event-on-channel-change}, {§notifications-stream-concluded}
60
- const coordinateFromPathname = (pathname) => {
61
- const seg = pathname.split("/").filter(Boolean);
62
- if (seg.length < 4 || seg.at(-1) !== "EXEC")
63
- return undefined;
64
- const [loop_seq, turn_seq, sequence] = seg.slice(-4, -1).map(Number);
65
- if (![loop_seq, turn_seq, sequence].every(Number.isInteger))
66
- return undefined;
67
- return { loop_seq, turn_seq, sequence };
68
- };
69
- // {§stream-owner-scoped} — resolve a stream statement's authority to the owning worker and hand
70
- // back the statement authority-stripped (the storage path is the bare loop coordinate; the owner
71
- // rides the owner_id column, never the pathname). Empty authority = the CALLING worker — your own
72
- // streams need no qualifier, so a fan-out sibling's identical coordinate can never be yours
73
- // ({§stream-owner-scoped}).
74
- // A named authority = that worker's streams, any worker of the workspace (#394); an unknown
75
- // name resolves null → the face 404s.
76
- export const resolveStreamStatement = async (statement, ctx) => {
77
- const t = statement.target;
78
- const hostname = t !== null && t.kind === "url" ? t.hostname : null;
79
- const ownerId = await Owner.resolveStreamOwner(hostname, ctx);
80
- if (ownerId === null)
81
- return null;
82
- if (hostname === null || t === null || t.kind !== "url")
83
- return { statement, ownerId };
84
- return { statement: { ...statement, target: { ...t, hostname: null } }, ownerId };
85
- };
86
- export default class Exec extends CoreSchemeAdapterBase {
58
+ class Exec extends CoreSchemeAdapterBase {
59
+ // {§exec-env-scoped} — the environment one spawn receives: the ambient ceiling, then the Worker's
60
+ // own `env` state over it ({§env-functionality}), read here rather than held anywhere. No row is
61
+ // the ordinary case: a Worker that never set anything.
62
+ static async #composedEnv(db, workerId, modifier) {
63
+ const ambient = ExecEnv.scoped();
64
+ const row = await db.worker_module_state_get.get({ worker_id: workerId, namespace_owner: ENV_OWNER });
65
+ return EnvFunctionality.compose(ambient, row === undefined ? { version: 1, definitions: {} } : JSON.parse(row.state), modifier);
66
+ }
67
+ // The record goes on the output the spawn produces ({§execution-output-identity}) — the log row
68
+ // is the model's proposal and stays immutable. An output that is not there is a defect in the
69
+ // provenance chain, never a spawn that quietly runs unrecorded.
70
+ static async #recordEnv(db, entryId, record) {
71
+ const { changes } = await db.execution_record_env.run({ entry_id: entryId, env: JSON.stringify(record) });
72
+ if (changes !== 1)
73
+ throw new Error(`spawn output entry ${entryId} is not there to record the environment on`);
74
+ }
87
75
  // The slot contract, stated when a resource source cannot be read: the resource IS the
88
- // program and the body its stdin; a command belongs beneath a targetless heading.
76
+ // program and the body its stdin; a targetless invocation takes a command body.
89
77
  static sourceRecovery(source, upstream) {
90
- const contract = `\`### EXEC0 (${source})\` runs that resource as the program (its content is the program; the body is its stdin). To run a command in the workspace, write it beneath a targetless \`### EXEC0\`.`;
78
+ const contract = `The target \`${source}\` names the program resource; the body is its stdin. Without a target, the body is the command.`;
91
79
  return typeof upstream === "string" && upstream.length > 0 ? `${contract} ${upstream}` : contract;
92
80
  }
93
81
  static manifest = {
94
82
  name: "exec",
95
- authority: "owner",
83
+ authority: "namespace",
96
84
  channels: { stdout: "text/stream", stderr: "text/stream" },
97
85
  defaultChannel: "stdout",
98
86
  category: "data",
99
- entryOwner: "worker",
100
- inherit: "none",
101
87
  writableBy: ["model", "client"],
102
88
  volatile: true,
103
89
  modelVisible: true,
104
90
  metadataModifier: true,
105
- documentation: "Runs a registered executable tool — `### EXEC0 [executor] (program) <timeout minutes,poll minutes>\nbody` — using its `worker://~/_plurnk/tools/` invocation contract. Output streams into the worker's `<executor>:///<loop>/<turn>/<seq>` entry on that tool's own channels. A host-effecting invocation proposes for review before it runs; a read-only or pure one runs ungated. While it runs, Child Streams reports channel size and growth and READ can inspect any range; when it finishes, one terminal READ becomes visible automatically.",
91
+ documentation: "The opening fence names a registered executor or MCP service; its target, body, metadata, and timing follow that tool's invocation contract. Output streams into the workspace's `<executor>:///<id>` entry on that tool's own channels. A host-effecting invocation proposes for review before it runs; a read-only or pure one runs ungated. While it runs, the packet's `## Delegation` streams list reports channel size and growth and READ can inspect any range; when it finishes, one terminal READ becomes visible automatically.",
106
92
  };
107
93
  // The web-fetch the entry sink calls on content:null ({§exec-entry-sink}).
108
94
  // Default = schemes-http's checked WebFetcher; injectable for tests.
109
95
  #fetchWeb;
110
96
  #scheduler;
97
+ #inputTimeoutMs;
111
98
  constructor(fetchWeb) {
112
99
  super();
113
100
  this.#scheduler = new ExecScheduler();
101
+ this.#inputTimeoutMs = ExecutionInput.configuredTimeout();
114
102
  if (fetchWeb === undefined) {
115
103
  const webFetcher = new WebFetcher();
116
104
  this.#fetchWeb = (url, opts) => webFetcher.fetch(url, opts);
@@ -138,11 +126,6 @@ export default class Exec extends CoreSchemeAdapterBase {
138
126
  return true;
139
127
  return false;
140
128
  }
141
- // {§exec-timeout} — a `<-1>` spawn is nobody's obligation: terminals, joins, and optimistic
142
- // settlement look past it.
143
- isDetachedSpawn(subscriptionId) {
144
- return this.#activeAborts.get(subscriptionId)?.detached === true;
145
- }
146
129
  // {§exec-timeout} — a `<-1>` spawn ends with the daemon: nothing else ever aborts it, so the
147
130
  // stop sequence reaps it (bounded housekeeping) before the streaming drain barrier.
148
131
  abortDetached() {
@@ -160,7 +143,7 @@ export default class Exec extends CoreSchemeAdapterBase {
160
143
  .map(([subscriptionId]) => {
161
144
  const spawn = this.#activeSpawns.get(subscriptionId);
162
145
  if (spawn === undefined) {
163
- throw new Error(`Active EXEC subscription ${subscriptionId} has no spawn settlement promise.`);
146
+ throw new Error(`Active execution subscription ${subscriptionId} has no spawn settlement promise.`);
164
147
  }
165
148
  return spawn;
166
149
  });
@@ -186,18 +169,13 @@ export default class Exec extends CoreSchemeAdapterBase {
186
169
  async kill(pathname, scope, ctx, scheme = "exec") {
187
170
  const core = this.coreContext(ctx);
188
171
  for (const entry of this.#activeAborts.values()) {
189
- if (entry.workerId === core.workerId && entry.pathname === pathname) {
172
+ if (entry.workspaceId === core.workspaceId && entry.pathname === pathname && (scheme === "exec" || entry.runtime === scheme)) {
190
173
  entry.controller.abort(ExecAbort.killReason(null));
191
174
  return { status: 200 };
192
175
  }
193
176
  }
194
- // Not running — settle the outcome from the closed subscription's status, scoped to the
195
- // caller's own subscription (coordinates duplicate across workers, {§stream-owner-scoped}).
196
- // The error answers in the model's OWN runtime-tag address (sh:///…), never the retired
197
- // internal `exec` machinery ({§fs-answer-in-canon}) — the model KILLs what it addressed.
198
177
  const terminal = await ChannelWrite.execTerminalStatus(core.db, {
199
178
  workspaceId: core.workspaceId,
200
- workerId: core.workerId,
201
179
  scheme,
202
180
  authority: "",
203
181
  pathname,
@@ -218,29 +196,29 @@ export default class Exec extends CoreSchemeAdapterBase {
218
196
  retryable: false,
219
197
  });
220
198
  }
221
- // EXEC op handler — the actual model-facing entry point per plurnk.md.
222
- // `### EXEC0 [runtime] (target)\nbody` → runtime-owned invocation buckets.
199
+ // Execution handler — the model-facing entry point per plurnk.md.
200
+ // Named executable fences lower to runtime-owned invocation buckets.
223
201
  //
224
202
  // Proposes (status=202) with attrs={runtime, cwd, body, pathname}.
225
203
  // applyResolution spawns the subprocess; output streams into the
226
204
  // coordinate-stamped <runtime>:///<pathname> entry's stdout/stderr channels
227
- // (e.g. sh:///1/1/2/EXEC, {§exec}). The model READs that entry on a subsequent turn.
205
+ // (e.g. sh:///1/1/2/sh, {§exec}). The model READs that entry on a subsequent turn.
228
206
  async exec(statement, ctx) {
229
207
  const core = this.coreContext(ctx);
230
208
  const body = statement.body ?? "";
231
209
  if (core.executors === undefined)
232
210
  throw new Error("exec dispatched without an executor registry");
233
- // {§exec-executor-slot}: the bracket names the executor; the path is its program.
211
+ // {§exec-executor-slot}: the fence names the executor; the path is its program.
234
212
  const route = execRouteOf(statement);
235
213
  const runtime = route.runtime;
236
214
  // {§exec-registry-resolves} — a non-empty tag selects exactly one registered executable
237
215
  // tool. Unknown tags are not reinterpreted as shell command words: that would make the
238
- // executed command differ from the authored body. Bare EXEC remains the default-shell form.
239
- const resolved = core.executors.entry(runtime, core.functionalityWorkerId);
216
+ // executed command differ from the authored body.
217
+ const resolved = core.executors.entry(runtime, core.workspaceId);
240
218
  if (resolved === undefined) {
241
- return Results.failure("scheme:exec", "executor-not-registered", 400, `\`[${runtime}]\` names no registered executor for this worker. Executors are taught under \`worker://~/_plurnk/tools/\`; a bare \`### EXEC0\` is the shell.`, {}, {
219
+ return Results.failure("scheme:exec", "executor-not-registered", 400, `No executor or MCP service named \`${runtime}\` is registered for this worker.`, {}, {
242
220
  requestedRuntime: runtime,
243
- executors: core.executors.availableRuntimes(core.functionalityWorkerId),
221
+ executors: core.executors.availableRuntimes(core.workspaceId),
244
222
  retryable: false,
245
223
  });
246
224
  }
@@ -251,7 +229,7 @@ export default class Exec extends CoreSchemeAdapterBase {
251
229
  retryable: false,
252
230
  });
253
231
  }
254
- const registry = core.executors.toolRegistry(runtime, core.functionalityWorkerId);
232
+ const registry = core.executors.toolRegistry(runtime, core.workspaceId);
255
233
  const exactTarget = route.target === null ? null : route.target.raw;
256
234
  const registeredTool = registry?.tools.find((tool) => tool.target === exactTarget);
257
235
  if (registry !== null && registeredTool === undefined) {
@@ -262,7 +240,7 @@ export default class Exec extends CoreSchemeAdapterBase {
262
240
  runtime,
263
241
  availableTargetCount: availableTargets.length,
264
242
  ...(availableTargets.length === 0 ? {} : {
265
- recovery: `Select a target documented under worker://~/_plurnk/tools/${runtime}/.`,
243
+ recovery: `Select a target documented under worker:///_plurnk/tools/${runtime}/.`,
266
244
  }),
267
245
  retryable: false,
268
246
  });
@@ -273,7 +251,7 @@ export default class Exec extends CoreSchemeAdapterBase {
273
251
  const hasTarget = execTarget !== null;
274
252
  const refuse = (code, detail, recovery, extensions = {}) => Results.failure("scheme:exec", code, 400, detail, {}, { runtime, recovery, retryable: false, ...extensions });
275
253
  if (invocation.body.required && !hasBody) {
276
- return refuse("body-required", `Executable tool '${runtime}' requires a ${invocation.body.role} body.`, `Provide the ${invocation.body.role} in the EXEC body.`);
254
+ return refuse("body-required", `Executable tool '${runtime}' requires a ${invocation.body.role} body.`, `Provide the ${invocation.body.role} in the ${runtime} body.`);
277
255
  }
278
256
  if (invocation.target === undefined && hasTarget) {
279
257
  return refuse("target-not-supported", `Executable tool '${runtime}' does not accept a target.`, `Remove the target and provide the ${invocation.body.role} in the body.`);
@@ -307,7 +285,7 @@ export default class Exec extends CoreSchemeAdapterBase {
307
285
  else if (targetDecl.kind === "resource" || targetDecl.kind === "script") {
308
286
  resourceSource = resourceSourceOf(execTarget);
309
287
  if (resourceSource === null) {
310
- throw new Error(`EXEC '${runtime}' resource target could not be classified`);
288
+ throw new Error(`'${runtime}' resource target could not be classified`);
311
289
  }
312
290
  }
313
291
  else {
@@ -315,46 +293,47 @@ export default class Exec extends CoreSchemeAdapterBase {
315
293
  }
316
294
  }
317
295
  }
318
- // {§exec-executor-slot} — the path names the program; `{cwd=<directory>}` names where it
319
- // runs. A relative directory resolves against the project root, or the shell's own cwd
320
- // when the workspace has none.
321
- const runRoot = projectRoot ?? process.cwd();
322
- // Metadata on a resource-address target belongs to the source scheme ({§exec-target-routing});
323
- // on a local program it names the working directory and nothing else.
324
- for (const block of resourceSource === null ? statement.metadata ?? [] : []) {
325
- const named = /^cwd=(.+)$/.exec(block.trim());
326
- if (named === null) {
327
- return refuse("metadata-unsupported", `EXEC accepts only \`{cwd=<directory>}\` metadata; got \`{${block}}\`.`, "Name the working directory as `{cwd=sub}`; everything else belongs in the body.", { metadata: block });
328
- }
329
- const inspected = isAbsolute(named[1]) ? named[1] : resolve(runRoot, named[1]);
330
- let isDirectory = false;
331
- try {
332
- isDirectory = (await stat(inspected)).isDirectory();
333
- }
334
- catch (cause) {
335
- if (cause?.code !== "ENOENT")
336
- throw cause;
337
- }
338
- if (!isDirectory) {
339
- return refuse("cwd-not-found", `EXEC working directory '${named[1]}' is not an existing directory.`, "Name an existing directory in `{cwd=…}`.", { cwd: named[1] });
296
+ // {§env-option} — the fence's own environment is the service's key: refused here by name,
297
+ // so the model learns why, never dropped at the spawn. The executor never sees it.
298
+ try {
299
+ EnvFunctionality.modifier(statement.metadata);
300
+ }
301
+ catch (cause) {
302
+ if (!(cause instanceof OperationFailureError))
303
+ throw cause;
304
+ return cause.result;
305
+ }
306
+ // {§executor-metadata} Options belong to the invoked executor for every source kind.
307
+ const executor = resolved.executor;
308
+ if (executor.prepare !== undefined) {
309
+ const prepared = Results.assert(await executor.prepare({
310
+ runtime, body, target: resourceSource ?? target, cwd, metadata: statement.metadata,
311
+ }));
312
+ if (prepared.status >= 400)
313
+ return prepared;
314
+ if (prepared.status !== 200 || (prepared.cwd !== null && (typeof prepared.cwd !== "string" || !isAbsolute(prepared.cwd)))) {
315
+ throw new InvalidOperationResultError(`Executable tool '${runtime}' returned invalid invocation preparation.`);
340
316
  }
341
- cwd = inspected;
317
+ cwd = prepared.cwd;
318
+ }
319
+ else if ((statement.metadata?.length ?? 0) > 0) {
320
+ return Results.failure("scheme:exec", "metadata-unsupported", 400, `Executable tool '${runtime}' does not accept metadata.`, {}, { runtime, retryable: false });
342
321
  }
343
322
  // A `script` target must be an existing file; other kinds pass through as declared.
344
323
  if (target !== null && targetDecl?.kind === "script") {
345
- const inspected = isAbsolute(target) ? target : resolve(cwd, target);
324
+ const inspected = isAbsolute(target) ? target : resolve(cwd ?? process.cwd(), target);
346
325
  let kind = "missing";
347
326
  try {
348
327
  kind = (await stat(inspected)).isDirectory() ? "directory" : "file";
349
328
  }
350
329
  catch (cause) {
351
330
  if (cause?.code !== "ENOENT") {
352
- console.error(`EXEC target classification failed for '${inspected}':`, cause);
353
- return Results.failure("scheme:exec", "target-classification-failed", 500, `EXEC target '${target}' could not be inspected: ${ErrorDetail.preview(cause)}`, {}, { target, stage: "target-classification" });
331
+ console.error(`Execution target classification failed for '${inspected}':`, cause);
332
+ return Results.failure("scheme:exec", "target-classification-failed", 500, `${runtime} target '${target}' could not be inspected: ${ErrorDetail.preview(cause)}`, {}, { target, stage: "target-classification" });
354
333
  }
355
334
  }
356
335
  if (kind === "directory") {
357
- return refuse("target-not-a-program", `EXEC target '${target}' is a directory, not a program.`, "Run in a directory with `{cwd=<directory>}` and put the command in the body.", { target });
336
+ return refuse("target-not-a-program", `${runtime} target '${target}' is a directory, not a program.`, "Run in a directory with `[{\"cwd\": \"<directory>\"}]` and put the command in the body.", { target });
358
337
  }
359
338
  if (kind === "missing") {
360
339
  // The target is not a script here, but it may be a registered tool of another
@@ -362,12 +341,12 @@ export default class Exec extends CoreSchemeAdapterBase {
362
341
  const executors = core.executors;
363
342
  const ownerRuntimes = executors === undefined
364
343
  ? []
365
- : executors.availableRuntimes(core.functionalityWorkerId)
366
- .filter((tag) => executors.toolRegistry(tag, core.functionalityWorkerId)?.tools.some((tool) => tool.target === target) === true);
344
+ : executors.availableRuntimes(core.workspaceId)
345
+ .filter((tag) => executors.toolRegistry(tag, core.workspaceId)?.tools.some((tool) => tool.target === target) === true);
367
346
  const recovery = ownerRuntimes.length === 0
368
- ? "Name an existing script as the program, or place a shell command beneath a bare `### EXEC0`."
369
- : `Run the registered tool with \`### EXEC0 [${ownerRuntimes[0]}] (${target})\`.`;
370
- return refuse("target-not-found", "The EXEC program does not resolve as a script or a registered tool for this executor.", recovery, { target, ...(ownerRuntimes.length === 0 ? {} : { toolRuntimes: ownerRuntimes }) });
347
+ ? `The target must name an existing program resource. A targetless ${runtime} takes the command in its body.`
348
+ : `The tool \`${target}\` is registered under executor \`${ownerRuntimes[0]}\`; use that name on the opening fence.`;
349
+ return refuse("target-not-found", `The ${runtime} program does not resolve as a script or a registered tool for this executor.`, recovery, { target, ...(ownerRuntimes.length === 0 ? {} : { toolRuntimes: ownerRuntimes }) });
371
350
  }
372
351
  }
373
352
  if (!hasBody && target === null && resourceSource === null) {
@@ -379,11 +358,8 @@ export default class Exec extends CoreSchemeAdapterBase {
379
358
  const effect = resolved.executor.effect(effectTarget);
380
359
  // cwd is the workspace project_root unless target routing selected a
381
360
  // directory override. {§exec-target-routing}, {§executor-sinks}
382
- // Pathname is assigned by Dispatcher.#writeLog as <runtime>/<loop_seq>/
383
- // <turn_seq>/<sequence> (executor-domain + coordinate, e.g. sh/1/1/2).
384
- // `pathname` is stamped into attrs at log-write time; applyResolution
385
- // reads it back here.
386
- // EXEC repurposes the `<L>` slot as `<timeout, poll>` (MINUTES, held in seconds): mark[0] caps the spawn's
361
+ // The log writer claims the workspace output address before proposal application.
362
+ // An execution repurposes the `<L>` slot as `<timeout, poll>` (MINUTES, held in seconds): mark[0] caps the spawn's
387
363
  // lifetime, mark[1] sets the hibernation poll-wake cadence ({§exec-poll}). N>0 → deadline (504);
388
364
  // -1 / absent → unbounded (loop-life bounded); 0 → turn-scoped (reaped at the next pre-turn,
389
365
  // never surviving into the subsequent turn).
@@ -404,6 +380,69 @@ export default class Exec extends CoreSchemeAdapterBase {
404
380
  const preview = runtime !== "" ? `[${runtime}] ${previewInput}` : `$ ${previewInput}`;
405
381
  return { status: 202, body: preview, attrs }; // host runtime proposes with 202 — {§exec-host-proposes}
406
382
  }
383
+ async #inputRecipient(statement, ctx, runtime) {
384
+ const core = this.coreContext(ctx);
385
+ const target = statement.target;
386
+ const failure = (code, status, detail) => ({
387
+ failure: Results.failure("scheme:exec", code, status, detail, {}, { retryable: false }),
388
+ });
389
+ if (target?.kind !== "url" || target.scheme !== runtime || target.fragment !== null
390
+ || target.query !== null || statement.lineMarker !== null) {
391
+ return failure("invalid-input-target", 400, "SEND input addresses an execution, without a channel or scope.");
392
+ }
393
+ const coordinate = entryCoordinateOf(target, "namespace");
394
+ const found = [...this.#activeAborts.entries()].find(([, entry]) => entry.workspaceId === core.workspaceId && entry.runtime === runtime && entry.pathname === coordinate.pathname);
395
+ if (found !== undefined) {
396
+ if (core.executors?.entry(runtime, core.workspaceId)?.executor !== found[1].executor) {
397
+ return failure("input-unavailable", 409, "This execution's input receiver is no longer enabled.");
398
+ }
399
+ return { found };
400
+ }
401
+ const terminal = await ChannelWrite.execTerminalStatus(core.db, {
402
+ workspaceId: core.workspaceId, scheme: runtime, ...coordinate,
403
+ });
404
+ return terminal === null
405
+ ? failure("stream-not-found", 404, "No execution exists at the requested address.")
406
+ : failure("input-closed", 410, "Execution input is closed.");
407
+ }
408
+ async sendInput(statement, ctx, runtime) {
409
+ const recipient = await this.#inputRecipient(statement, ctx, runtime);
410
+ if ("failure" in recipient)
411
+ return recipient.failure;
412
+ const [subscriptionId, entry] = recipient.found;
413
+ const unavailable = entry.input.unavailable();
414
+ if (unavailable !== null)
415
+ return unavailable;
416
+ const denied = await this.capabilityDenial(entry.invocation, ctx);
417
+ if (denied !== null)
418
+ return denied;
419
+ return {
420
+ status: 202,
421
+ attrs: { inputSubscription: subscriptionId, inputBody: statement.body?.raw ?? "", inputTarget: statement.target.raw, effect: entry.effect },
422
+ };
423
+ }
424
+ async applyInput(args, ctx, runtime) {
425
+ const attrs = args.attrs;
426
+ if (typeof attrs.inputSubscription !== "number" || typeof attrs.inputBody !== "string" || typeof attrs.inputTarget !== "string") {
427
+ throw new InvalidOperationResultError("Execution input proposal is missing its invocation or body.");
428
+ }
429
+ const body = args.body ?? attrs.inputBody;
430
+ const statement = {
431
+ op: "SEND", aside: null, metadata: args.metadata === null ? null : [...args.metadata],
432
+ target: parsePath(attrs.inputTarget), lineMarker: null, body: { raw: body, json: null }, position: { line: 1, column: 1 },
433
+ };
434
+ const recipient = await this.#inputRecipient(statement, ctx, runtime);
435
+ if ("failure" in recipient)
436
+ return recipient.failure;
437
+ const [subscriptionId, entry] = recipient.found;
438
+ if (subscriptionId !== attrs.inputSubscription) {
439
+ return Results.failure("scheme:exec", "input-closed", 410, "The proposed execution input is no longer live.", {}, { retryable: false });
440
+ }
441
+ const denied = await this.capabilityDenial(statement, ctx) ?? await this.capabilityDenial(entry.invocation, ctx);
442
+ if (denied !== null)
443
+ return denied;
444
+ return entry.input.deliver(body, args.metadata, ctx.signal);
445
+ }
407
446
  async applyResolution(args, ctx) {
408
447
  const core = this.coreContext(ctx);
409
448
  const attrs = args.attrs;
@@ -414,63 +453,74 @@ export default class Exec extends CoreSchemeAdapterBase {
414
453
  let target = (typeof attrs.target === "string" && attrs.target.length > 0) ? attrs.target : null;
415
454
  const effect = attrs.effect;
416
455
  if (typeof pathname !== "string" || pathname.length === 0) {
417
- throw new InvalidOperationResultError("The accepted EXEC proposal is missing its stream pathname.");
456
+ throw new InvalidOperationResultError("The accepted execution proposal is missing its stream pathname.");
418
457
  }
419
458
  if (!EffectPolicy.isEffect(effect)) {
420
- throw new InvalidOperationResultError("The accepted EXEC proposal is missing its canonical effect fact.");
459
+ throw new InvalidOperationResultError("The accepted execution proposal is missing its canonical effect fact.");
421
460
  }
422
- // Every non-file resource becomes a temporary executor target after
423
- // acceptance; body presence never changes the target's role.
461
+ const invocation = {
462
+ runtime: runtime, aside: null, metadata: null,
463
+ target: attrs.resourceSource ? parsePath(attrs.resourceSource) : target === null ? null : parsePath(target),
464
+ lineMarker: null, body, position: { line: 1, column: 1 },
465
+ };
466
+ // {§exec-source-temporary} Admission precedes source realization. Native
467
+ // files retain their environment; only standalone sources need a copy.
424
468
  let tempPath = null;
425
469
  if (attrs.resourceSource !== undefined) {
426
470
  const sourceTarget = parsePath(attrs.resourceSource);
427
471
  if (sourceTarget?.kind !== "url" || sourceTarget.scheme === null || sourceTarget.scheme === "file") {
428
- throw new InvalidOperationResultError("The accepted EXEC proposal has an invalid scheme source address.");
472
+ throw new InvalidOperationResultError("The accepted execution proposal has an invalid scheme source address.");
429
473
  }
430
- const read = await this.readExecSource({
474
+ const source = await this.readExecSource({
431
475
  op: "READ",
432
- delimiter: "",
433
- annotation: null,
476
+ aside: null,
434
477
  target: sourceTarget,
435
- metadata: args.metadata === null ? null : [...args.metadata],
478
+ metadata: null,
436
479
  lineMarker: { marks: [1, -1] },
480
+ matcher: null,
437
481
  body: null,
438
482
  position: { line: 0, column: 0 },
439
483
  }, core);
484
+ const read = source.result;
440
485
  if (read.status >= 400) {
441
- // {§exec-target-routing} — the failure stays the owning READ's (#163); the EXEC
486
+ // {§exec-target-routing} — the failure stays the owning READ's (#163); the execution
442
487
  // contract rides its recovery, because a stream address in the target slot is
443
488
  // almost always a command that belonged beneath a targetless heading (#425 F4).
444
489
  const problem = read.problem === undefined ? undefined : {
445
490
  ...read.problem,
446
- recovery: Exec.sourceRecovery(attrs.resourceSource, read.problem.recovery),
491
+ recovery: _a.sourceRecovery(attrs.resourceSource, read.problem.recovery),
447
492
  };
448
493
  return Results.assert({ ...read, outcome: "scheme_source_read_failed", ...(problem === undefined ? {} : { problem }) });
449
494
  }
450
495
  const content = read.content;
451
496
  if (typeof content !== "string") {
452
- return Results.failure("scheme:exec", "source-content-unavailable", 422, `Scheme '${sourceTarget.scheme}' did not supply content for the EXEC source.`, { outcome: "scheme_source_content_unavailable" }, {
497
+ return Results.failure("scheme:exec", "source-content-unavailable", 422, `Scheme '${sourceTarget.scheme}' did not supply content for the ${runtime} source.`, { outcome: "scheme_source_content_unavailable" }, {
453
498
  scheme: sourceTarget.scheme,
454
499
  sourceStatus: read.status,
455
500
  retryable: false,
456
501
  });
457
502
  }
458
- tempPath = join(tmpdir(), `plurnk-exec-${crypto.randomUUID()}`);
459
- await writeFile(tempPath, content, { encoding: "utf8", flag: "wx", mode: 0o600 });
460
- target = tempPath;
503
+ if (source.nativePath !== null) {
504
+ target = source.nativePath;
505
+ }
506
+ else {
507
+ tempPath = join(tmpdir(), `plurnk-exec-${crypto.randomUUID()}${extname(sourceTarget.pathname)}`);
508
+ await writeFile(tempPath, content, { encoding: "utf8", flag: "wx", mode: 0o600 });
509
+ target = tempPath;
510
+ }
461
511
  }
462
512
  if (body.length === 0 && target === null) {
463
- throw new InvalidOperationResultError("The accepted EXEC proposal has neither a body nor a realized target.");
513
+ throw new InvalidOperationResultError("The accepted execution proposal has neither a body nor a realized target.");
464
514
  }
465
515
  // Resolve the runtime's executor from the boot registry, then seed
466
516
  // channels from its declared topology ({§executor-channels}). Each executor declares its own
467
517
  // shape (subprocess → stdout/stderr; search → results; etc.).
468
518
  if (core.executors === undefined) {
469
- throw new InvalidOperationResultError("An accepted EXEC proposal has no executor registry.");
519
+ throw new InvalidOperationResultError("An accepted execution proposal has no executor registry.");
470
520
  }
471
- const resolved = core.executors.entry(runtime, core.functionalityWorkerId);
521
+ const resolved = core.executors.entry(runtime, core.workspaceId);
472
522
  if (resolved === undefined) {
473
- throw new InvalidOperationResultError(`The '${runtime}' executor disappeared after its EXEC proposal.`);
523
+ throw new InvalidOperationResultError(`The '${runtime}' executor disappeared after its proposal.`);
474
524
  }
475
525
  // {§executor-effect}, {§exec-hold-until-concluded}, #107: the admitted
476
526
  // effect fact rides the hold predicate unchanged through application.
@@ -485,7 +535,9 @@ export default class Exec extends CoreSchemeAdapterBase {
485
535
  const seed = { channels: seedChannels };
486
536
  // {§exec} — the stream entry's scheme IS the runtime tag (sh/node), so it addresses by
487
537
  // tag authority (sh:///l/t/s). The engine registers each runtime tag → this handler.
488
- const { entryId } = await EntryCrud.writeEntry({ authority: "", pathname }, seed, core, runtime, core.workerId);
538
+ const { entryId } = await EntryCrud.writeEntry({ authority: "", pathname }, seed, core, runtime, {
539
+ defaultChannel: resolved.executor.defaultChannel, output: true,
540
+ });
489
541
  if (entryId === null) {
490
542
  return Results.failure("scheme:exec", "stream-entry-write-failed", 500, `The ${runtime} stream entry could not be created.`, {
491
543
  outcome: "entry_write_failed",
@@ -500,6 +552,10 @@ export default class Exec extends CoreSchemeAdapterBase {
500
552
  handle: runtime !== "" ? `${runtime}: ${body !== "" ? body : target ?? ""}` : body,
501
553
  pollSeconds: typeof attrs.pollSec === "number" ? attrs.pollSec : null, // {§exec-poll} — hibernation wake cadence
502
554
  turnScoped: attrs.turnScoped === true, // {§exec-poll} — `<0>` reaped at the next pre-turn
555
+ detached: attrs.detached === true, // {§worker-obligations} — `<-1>` is nobody's obligation
556
+ publishedChannel: resolved.executor.publishedChannel,
557
+ source: attrs.coordinate === undefined ? undefined
558
+ : `log:///${attrs.coordinate.loop_seq}/${attrs.coordinate.turn_seq}/${attrs.coordinate.sequence}/${runtime}`,
503
559
  });
504
560
  const controller = new AbortController();
505
561
  let unlink = () => { };
@@ -521,7 +577,8 @@ export default class Exec extends CoreSchemeAdapterBase {
521
577
  if (parent.aborted)
522
578
  controller.abort(ExecAbort.teardownReason());
523
579
  }
524
- this.#activeAborts.set(subscriptionId, { workerId: core.workerId, turnId: core.turnId, pathname, runtime, effect, controller, unlink, detached: attrs.detached === true });
580
+ const input = new ExecutionInput(controller.signal, this.#inputTimeoutMs);
581
+ this.#activeAborts.set(subscriptionId, { workspaceId: core.workspaceId, workerId: core.workerId, turnId: core.turnId, pathname, runtime, effect, controller, unlink, detached: attrs.detached === true, input, invocation, executor: resolved.executor });
525
582
  this.liveSubscriptions().register(subscriptionId, {
526
583
  cancel: () => controller.abort(ExecAbort.teardownReason()),
527
584
  });
@@ -530,8 +587,8 @@ export default class Exec extends CoreSchemeAdapterBase {
530
587
  try {
531
588
  return await this.#runExecutor({
532
589
  executor: resolved.executor,
533
- runtime, body, cwd, target, ctx: core, pathname,
534
- entryId, subscriptionId, signal: controller.signal, controller, tempPath,
590
+ runtime, body, cwd, target, metadata: args.metadata, ctx: core, pathname, coordinate: attrs.coordinate,
591
+ entryId, subscriptionId, signal: controller.signal, controller, tempPath, input,
535
592
  timeoutSec: typeof attrs.timeoutSec === "number" ? attrs.timeoutSec : null,
536
593
  });
537
594
  }
@@ -567,11 +624,45 @@ export default class Exec extends CoreSchemeAdapterBase {
567
624
  // a setState("closed") that races a prior write() can flip the
568
625
  // notify's reported state to "closed" before the chunk event fires
569
626
  // as "active." Chain through a single promise queue to serialize.
627
+ // {§exec-tool-fall-through} — a bare shell command whose program is really the name of a tool
628
+ // of an enabled runtime (`brave_web_search {…}` under the default shell) dies with the shell's
629
+ // exit 127. The failure receipt states that fact at the failure site, with the invocation the
630
+ // registry actually publishes, so the model recovers in one turn instead of by rereading docs.
631
+ #namedToolFallThrough(result, runtime, body, ctx) {
632
+ const core = this.coreContext(ctx);
633
+ const executors = core.executors;
634
+ if (executors === undefined || result.problem === undefined)
635
+ return result;
636
+ const program = body.trim().split(/\s+/u, 1)[0] ?? "";
637
+ if (program.length === 0)
638
+ return result;
639
+ const owners = executors.availableRuntimes(core.workspaceId)
640
+ .filter((tag) => tag !== runtime
641
+ && executors.toolRegistry(tag, core.workspaceId)?.tools.some((tool) => tool.target === program) === true);
642
+ if (owners.length === 0)
643
+ return result;
644
+ const owner = owners[0];
645
+ // The tool's own document, where its family publishes it ({§tools-resource-materialization}).
646
+ const root = executors.entry(owner, core.workspaceId)?.resourcesPath ?? "/plurnk";
647
+ const contract = `worker://${generatedPathname(`${root}/${owner}/${ToolResources.targetSegment(program)}.md`)}`;
648
+ return {
649
+ ...result,
650
+ problem: {
651
+ ...result.problem,
652
+ detail: `'${runtime}' exited with code 127; \`${program}\` is a registered tool of \`${owner}\`.`,
653
+ recovery: `Use the \`${owner}\` fence with target \`(${program})\` and JSON input in the body; contract: ${contract}.`,
654
+ toolRuntimes: owners,
655
+ tool: program,
656
+ },
657
+ };
658
+ }
570
659
  async #runExecutor(opts) {
571
- const { executor, runtime, body, cwd, target, ctx, pathname, entryId, subscriptionId, signal, controller, timeoutSec, tempPath } = opts;
660
+ const { runtime, body, cwd, target, metadata, ctx, pathname, entryId, subscriptionId, signal, controller, timeoutSec, tempPath, input, coordinate } = opts;
661
+ // {§functionality-model-projection} — a Core-owned manager acts for the invoking Worker. The
662
+ // framework's ExecArgs carries no Worker identity, so Core binds it here, at the operation.
663
+ const executor = isWorkerBound(opts.executor) ? opts.executor.forWorker(ctx.workerId) : opts.executor;
572
664
  const db = ctx.db;
573
- const coordinate = coordinateFromPathname(pathname);
574
- // grammar 0.74.20 EXEC `<T>` — kill the spawn after T seconds. unref'd so a pending timer never
665
+ // an execution's `<T>` — kill the spawn after T seconds. unref'd so a pending timer never
575
666
  // holds the process open; cleared in finally so a spawn that finishes first leaves no timer.
576
667
  let timedOut = false;
577
668
  const timeoutTimer = timeoutSec !== null
@@ -607,7 +698,14 @@ export default class Exec extends CoreSchemeAdapterBase {
607
698
  callerSource = WorkerControlAddress.render(caller.name);
608
699
  return callerSource;
609
700
  };
610
- const entrySink = (path, content, opts) => {
701
+ const publishedNames = new ResourceNames();
702
+ const entrySink = (requestedPath, content, opts) => {
703
+ let path = requestedPath;
704
+ if (path === null) {
705
+ if (content === null)
706
+ return Promise.reject(new Error("entry(): an invocation resource requires supplied content"));
707
+ path = renderAddress({ scheme: runtime, authority: "", pathname: `${pathname}/resources/${publishedNames.allocate(opts.name)}` });
708
+ }
611
709
  const parsed = parsePath(path);
612
710
  if (parsed === null || parsed.kind !== "url")
613
711
  return Promise.reject(new Error(`entry(): '${path.slice(0, 80)}' is not a URL`));
@@ -619,7 +717,9 @@ export default class Exec extends CoreSchemeAdapterBase {
619
717
  const fetchAddress = address !== null && (address.scheme === "http" || address.scheme === "https")
620
718
  ? address
621
719
  : null;
622
- const binding = this.bindEntryAddress(parsed, ctx);
720
+ const binding = requestedPath === null
721
+ ? Promise.resolve({ address: { scheme: runtime, authority: "", pathname: parsed.pathname }, result: null })
722
+ : this.bindEntryAddress(parsed, ctx);
623
723
  // {§exec-entry-sink}/{§web-search-retrieval} — start content:null
624
724
  // acquisition before the write chain so fetches run in parallel;
625
725
  // only durable entry writes serialize. A null result rejects the sink.
@@ -629,12 +729,12 @@ export default class Exec extends CoreSchemeAdapterBase {
629
729
  return Promise.reject(new Error("entry(): content:null requires an http(s):// URL"));
630
730
  materialized = this.#fetchWeb(fetchAddress.url, { signal });
631
731
  }
632
- else {
732
+ else if (typeof content === "string" && requestedPath !== null) {
633
733
  materialized = Promise.resolve({
634
734
  url: fetchAddress?.url ?? "http://localhost",
635
735
  body: content,
636
736
  mimetype: opts.mimetype,
637
- allowTavily: false,
737
+ allowConfiguredMaterializer: false,
638
738
  });
639
739
  }
640
740
  const op = async () => {
@@ -647,42 +747,53 @@ export default class Exec extends CoreSchemeAdapterBase {
647
747
  if (resolved.address === null) {
648
748
  throw new Error(`entry(): '${path.slice(0, 80)}' did not resolve to an entry address`);
649
749
  }
650
- const { authority, pathname, scheme, ownerId } = resolved.address;
750
+ const { authority, pathname, scheme } = resolved.address;
651
751
  const coordinate = { authority, pathname };
652
- const fetched = await materialized;
653
- if (fetched === null)
654
- throw new Error(`entry(): '${path.slice(0, 80)}' is dead`);
655
- let web;
656
- try {
657
- web = await WebFetcher.materialize(fetched, new DbProjectionCaps(ctx));
752
+ let channels;
753
+ let decisive;
754
+ let source;
755
+ if (materialized === undefined) {
756
+ if (content === null)
757
+ throw new Error("entry(): missing supplied content");
758
+ const body = typeof content === "string" ? { content, mimetype: opts.mimetype }
759
+ : { content: "", bytes: content, mimetype: opts.mimetype };
760
+ const channel = requestedPath === null ? executor.defaultChannel : ctx.defaultChannelFor?.(scheme);
761
+ if (channel === undefined)
762
+ throw new Error(`entry(): no default channel for '${scheme}'`);
763
+ channels = { [channel]: body };
764
+ decisive = typeof content === "string" ? content : `${opts.mimetype}; ${content.byteLength} bytes`;
765
+ source = decisive;
658
766
  }
659
- catch (error) {
660
- if (!signal.aborted && error instanceof WebMaterializationError) {
661
- console.error("entry() web materialization failed", { path, error });
767
+ else {
768
+ const fetched = await materialized;
769
+ if (fetched === null)
770
+ throw new Error(`entry(): '${path.slice(0, 80)}' is dead`);
771
+ let web;
772
+ try {
773
+ web = await WebFetcher.materialize(fetched, new DbProjectionCaps(ctx));
662
774
  }
663
- throw error;
664
- }
665
- if (web === null)
666
- throw new Error(`entry(): '${path.slice(0, 80)}' has no readable projection`);
667
- if (web.body === undefined) {
668
- throw new Error(web.bodyOutcome.failure?.detail
669
- ?? `entry(): '${path.slice(0, 80)}' produced no readable body`);
775
+ catch (error) {
776
+ if (!signal.aborted && error instanceof WebMaterializationError) {
777
+ console.error("entry() web materialization failed", { path, error });
778
+ }
779
+ throw error;
780
+ }
781
+ if (web === null)
782
+ throw new Error(`entry(): '${path.slice(0, 80)}' has no readable projection`);
783
+ if (web.body === undefined)
784
+ throw new Error(web.bodyOutcome.failure?.detail ?? `entry(): '${path.slice(0, 80)}' produced no readable body`);
785
+ channels = WebFetcher.materializedChannels(web, content === null && fetchAddress !== null ? { url: fetchAddress.url, method: "GET" } : undefined);
786
+ decisive = web.body.content;
787
+ source = web.html?.content ?? decisive;
670
788
  }
671
- // {§exec-entry-sink}/{§html-materialization} The shared
672
- // materializer owns the decisive projection and its provenance.
673
- const channels = WebFetcher.materializedChannels(web, content === null && fetchAddress !== null
674
- ? { url: fetchAddress.url, method: "GET" }
675
- : undefined);
676
- const decisive = web.body.content;
677
- const source = web.html?.content ?? decisive;
678
789
  const causalSource = await resolveCallerSource();
679
- const written = Results.assert(await EntryCrud.writeEntry(coordinate, { channels }, ctx, scheme, ownerId));
790
+ const written = Results.assert(await EntryCrud.writeEntry(coordinate, { channels }, ctx, scheme, {
791
+ defaultChannel: requestedPath === null ? executor.defaultChannel : ctx.defaultChannelFor?.(scheme),
792
+ output: requestedPath === null,
793
+ }));
680
794
  if (narration === null) {
681
- const worker = await db.envelope_get_worker_by_name.get({ workspace_id: ctx.workspaceId, name: "plurnk" })
682
- ?? await db.envelope_insert_worker.get({ workspace_id: ctx.workspaceId, name: "plurnk", origin: "_plurnk" });
683
- if (worker === undefined)
684
- throw new Error("entry(): plurnk worker resolution returned no row");
685
- const loop = await db.envelope_insert_client_loop.get({ worker_id: worker.id });
795
+ const workerId = await RuntimeWorker.ensure(db, ctx.workspaceId);
796
+ const loop = await db.envelope_insert_client_loop.get({ worker_id: workerId });
686
797
  if (loop === undefined)
687
798
  throw new Error("entry(): loop insert returned no row");
688
799
  const turn = await Turn.open(db, {
@@ -691,7 +802,7 @@ export default class Exec extends CoreSchemeAdapterBase {
691
802
  kind: "operation",
692
803
  });
693
804
  narration = {
694
- workerId: worker.id,
805
+ workerId,
695
806
  loopId: loop.id,
696
807
  loopSeq: loop.sequence,
697
808
  turnId: turn.id,
@@ -721,7 +832,7 @@ export default class Exec extends CoreSchemeAdapterBase {
721
832
  const logRow = await db.engine_insert_log_entry.get({
722
833
  worker_id: narration.workerId, loop_id: narration.loopId, turn_id: narration.turnId, sequence,
723
834
  origin: "_plurnk", source: causalSource, model_call_id: null,
724
- op: "EDIT", delimiter: "", signal: null,
835
+ op: "EDIT", signal: null,
725
836
  scheme, username: null, password: null,
726
837
  hostname: address === null ? null : parsed.hostname,
727
838
  port: address === null ? null : parsed.port,
@@ -757,34 +868,37 @@ export default class Exec extends CoreSchemeAdapterBase {
757
868
  return run;
758
869
  };
759
870
  const executionFailures = [];
871
+ const cancelled = (exitCode) => Results.failure("scheme:exec", "execution-cancelled", 499, `Execution of '${runtime}' was cancelled by the service.`, exitCode === undefined ? {} : { exitCode }, { runtime, stage: "execution", retryable: false });
760
872
  try {
761
873
  if (signal.aborted) {
762
- result = Results.failure("scheme:exec", "execution-cancelled", 499, `Execution of '${runtime}' was cancelled by the service.`, {}, {
763
- runtime,
764
- stage: "execution",
765
- retryable: false,
766
- });
874
+ result = cancelled();
767
875
  }
768
876
  else
769
877
  try {
878
+ const composed = await _a.#composedEnv(db, ctx.workerId, EnvFunctionality.modifier(metadata));
879
+ await _a.#recordEnv(db, entryId, composed.record);
770
880
  const reported = await executor.run({
771
- runtime, body, cwd, target, signal,
881
+ registerInput: (receiver) => input.register(receiver),
882
+ runtime, body, cwd, target, metadata, signal,
772
883
  entry: entrySink,
773
884
  interact: (request) => {
774
885
  if (ctx.requestInteraction === undefined) {
775
- throw new Error("EXEC client interaction capability is unavailable.");
886
+ throw new Error("The execution's client interaction capability is unavailable.");
776
887
  }
777
- return ctx.requestInteraction(request);
888
+ return ctx.requestInteraction(request, signal);
778
889
  },
779
- env: ExecEnv.scoped(), // SPEC {§exec} {§exec-env-scoped} — never plurnk's own secrets
890
+ env: composed.env, // SPEC {§exec} {§exec-env-scoped}
780
891
  write: (channel, chunk, mimetype) => enqueue(() => ChannelWrite.appendToChannel(db, {
892
+ producerWorkerId: ctx.workerId,
781
893
  entryId, channel, chunk, mimetype, notify: ctx.streamEventNotify, coordinate,
782
894
  })),
783
895
  setState: (channel, state) => enqueue(() => ChannelWrite.setChannelState(db, {
896
+ producerWorkerId: ctx.workerId,
784
897
  entryId, channel, state, notify: ctx.streamEventNotify, coordinate,
785
898
  })),
786
899
  emit: (event) => ctx.pushNotice?.(event),
787
900
  });
901
+ input.close();
788
902
  // Drain the queue so the subscription doesn't close before
789
903
  // final chunk events / state transitions have committed.
790
904
  await queue;
@@ -801,14 +915,19 @@ export default class Exec extends CoreSchemeAdapterBase {
801
915
  }
802
916
  }
803
917
  catch (cause) {
804
- // A rejecting driver must still CONCLUDE its stream — uncaught, the subscription sat
805
- // open forever and the floating spawn promise was an unhandled rejection.
806
- console.error(`Executor '${runtime}' threw outside its operation result contract:`, cause);
807
- result = Results.failure("scheme:exec", "executor-threw", 500, `The '${runtime}' executor failed outside its operation result contract.`, {}, {
808
- runtime,
809
- stage: "execution",
810
- retryable: false,
811
- });
918
+ input.close();
919
+ // {§executor-results} — an abort rejection is not an executor crash.
920
+ if (signal.aborted && (cause === signal.reason || (cause instanceof Error && cause.name === "AbortError"))) {
921
+ result = cancelled();
922
+ }
923
+ else {
924
+ console.error(`Executor '${runtime}' threw outside its operation result contract:`, cause);
925
+ result = Results.failure("scheme:exec", "executor-threw", 500, `The '${runtime}' executor failed outside its operation result contract.`, {}, {
926
+ runtime,
927
+ stage: "execution",
928
+ retryable: false,
929
+ });
930
+ }
812
931
  }
813
932
  const exitCode = typeof result.exitCode === "number" ? result.exitCode : null;
814
933
  // A timeout aborts the spawn → the executor reports 499; replace the
@@ -824,11 +943,10 @@ export default class Exec extends CoreSchemeAdapterBase {
824
943
  // spawn we reaped did not succeed, whatever it resolved under abort.
825
944
  }
826
945
  else if (signal.aborted && result.status < 400) {
827
- result = Results.failure("scheme:exec", "execution-cancelled", 499, `Execution of '${runtime}' was cancelled by the service.`, exitCode === null ? {} : { exitCode }, {
828
- runtime,
829
- stage: "execution",
830
- retryable: false,
831
- });
946
+ result = cancelled(exitCode ?? undefined);
947
+ }
948
+ else if (result.status >= 400 && exitCode === 127 && target === null) {
949
+ result = this.#namedToolFallThrough(result, runtime, body, ctx);
832
950
  }
833
951
  exitLabel = timedOut
834
952
  ? `timed out after ${(timeoutSec ?? 0) / 60}m`
@@ -883,7 +1001,7 @@ export default class Exec extends CoreSchemeAdapterBase {
883
1001
  // executor result, but an exceptional failure remains observable.
884
1002
  if (tempPath !== null) {
885
1003
  await unlink(tempPath).catch((cause) => {
886
- console.error(`EXEC source temporary cleanup failed for '${tempPath}':`, cause);
1004
+ console.error(`Execution source temporary cleanup failed for '${tempPath}':`, cause);
887
1005
  });
888
1006
  }
889
1007
  this.#activeAborts.get(subscriptionId)?.unlink();
@@ -895,7 +1013,7 @@ export default class Exec extends CoreSchemeAdapterBase {
895
1013
  if (ctx.wakeWorkerNotify !== undefined) {
896
1014
  ctx.wakeWorkerNotify({
897
1015
  workspaceId: ctx.workspaceId, workerId: ctx.workerId,
898
- entryOwnerId: ctx.workerId, entryId, target: `${runtime}://${pathname}`, subscriptionId, result,
1016
+ entryId, target: `${runtime}://${pathname}`, subscriptionId, result,
899
1017
  scheme: runtime,
900
1018
  summary: `${runtime}://${pathname} completed (${exitLabel}); stdout=${stdoutLength} bytes, stderr=${stderrLength} bytes`,
901
1019
  ...coordinate,
@@ -904,49 +1022,34 @@ export default class Exec extends CoreSchemeAdapterBase {
904
1022
  if (finalizationErrors.length === 1)
905
1023
  throw finalizationErrors[0];
906
1024
  if (finalizationErrors.length > 1) {
907
- throw new AggregateError(finalizationErrors, `EXEC narration ${completedNarration?.turnId ?? "unknown"} failed to settle`);
1025
+ throw new AggregateError(finalizationErrors, `Execution narration ${completedNarration?.turnId ?? "unknown"} failed to settle`);
908
1026
  }
909
1027
  }
910
1028
  return result;
911
1029
  }
912
- async resolveEntryAddress(target, ctx) {
913
- if (target.kind !== "url")
914
- return null;
915
- const ownerId = await Owner.resolveStreamOwner(target.hostname, this.coreContext(ctx));
916
- return ownerId === null
917
- ? Results.failure("scheme:exec", "stream-not-found", 404, "No visible stream exists at the requested address.")
918
- : ownerId === ctx.workerId
919
- ? { authority: "", pathname: target.pathname }
920
- : Results.failure("scheme:exec", "stream-not-found", 404, "The internal exec surface does not address another Worker's stream; use its runtime scheme.");
921
- }
922
1030
  async find(statement, ctx) {
923
1031
  const core = this.coreContext(ctx);
924
- const owner = await resolveStreamStatement(statement, core);
925
- if (owner === null) {
926
- return Results.failure("scheme:exec", "stream-not-found", 404, "No visible stream exists at the requested address.", {
927
- content: null, mimetype: null, results: [], itemsWeightTotal: 0, returnedItemsWeightTotal: 0,
928
- matchingPathCount: 0, matchLocationCount: 0,
929
- });
930
- }
931
- return EntryFind.findWorkspaceEntries(owner.statement, core, Exec.manifest, { ownerId: owner.ownerId });
1032
+ return EntryFind.findWorkspaceEntries(statement, core, _a.manifest, {});
932
1033
  }
933
1034
  async readEntry(pathname, ctx) {
934
1035
  const core = this.coreContext(ctx);
935
1036
  return "entries" in ctx
936
1037
  ? ctx.entries.read(pathname)
937
- : EntryCrud.readEntry({ authority: "", pathname }, core, Exec.manifest.name, core.workerId);
1038
+ : EntryCrud.readEntry({ authority: "", pathname }, core, _a.manifest.name);
938
1039
  }
939
1040
  async writeEntry(pathname, entry, ctx) {
940
1041
  const core = this.coreContext(ctx);
941
1042
  return "entries" in ctx
942
1043
  ? ctx.entries.write(pathname, entry)
943
- : EntryCrud.writeEntry({ authority: "", pathname }, entry, core, Exec.manifest.name, core.workerId);
1044
+ : EntryCrud.writeEntry({ authority: "", pathname }, entry, core, _a.manifest.name);
944
1045
  }
945
1046
  async deleteEntry(pathname, ctx) {
946
1047
  const core = this.coreContext(ctx);
947
1048
  return "entries" in ctx
948
1049
  ? ctx.entries.delete(pathname)
949
- : EntryCrud.deleteEntry({ authority: "", pathname }, core, Exec.manifest.name, core.workerId);
1050
+ : EntryCrud.deleteEntry({ authority: "", pathname }, core, _a.manifest.name);
950
1051
  }
951
1052
  }
1053
+ _a = Exec;
1054
+ export default Exec;
952
1055
  //# sourceMappingURL=Exec.js.map