@caupulican/pi-adaptative 0.85.8 → 0.86.1

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 (232) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/core/agent-paths.d.ts +3 -3
  3. package/dist/core/agent-paths.d.ts.map +1 -1
  4. package/dist/core/agent-paths.js +3 -3
  5. package/dist/core/agent-paths.js.map +1 -1
  6. package/dist/core/agent-session.d.ts +5 -2
  7. package/dist/core/agent-session.d.ts.map +1 -1
  8. package/dist/core/agent-session.js +7 -1
  9. package/dist/core/agent-session.js.map +1 -1
  10. package/dist/core/autonomy/bounded-completion.d.ts.map +1 -1
  11. package/dist/core/autonomy/bounded-completion.js +19 -8
  12. package/dist/core/autonomy/bounded-completion.js.map +1 -1
  13. package/dist/core/autonomy/lane-tool-surface.d.ts +11 -5
  14. package/dist/core/autonomy/lane-tool-surface.d.ts.map +1 -1
  15. package/dist/core/autonomy/lane-tool-surface.js +34 -8
  16. package/dist/core/autonomy/lane-tool-surface.js.map +1 -1
  17. package/dist/core/autonomy/subagent-prompt.d.ts +3 -3
  18. package/dist/core/autonomy/subagent-prompt.js +9 -9
  19. package/dist/core/autonomy/subagent-prompt.js.map +1 -1
  20. package/dist/core/background-lane-controller.d.ts +10 -8
  21. package/dist/core/background-lane-controller.d.ts.map +1 -1
  22. package/dist/core/background-lane-controller.js +23 -13
  23. package/dist/core/background-lane-controller.js.map +1 -1
  24. package/dist/core/bash-execution-controller.d.ts +4 -0
  25. package/dist/core/bash-execution-controller.d.ts.map +1 -1
  26. package/dist/core/bash-execution-controller.js +11 -4
  27. package/dist/core/bash-execution-controller.js.map +1 -1
  28. package/dist/core/bash-executor.d.ts +2 -0
  29. package/dist/core/bash-executor.d.ts.map +1 -1
  30. package/dist/core/bash-executor.js +2 -1
  31. package/dist/core/bash-executor.js.map +1 -1
  32. package/dist/core/capability-contract.d.ts +1 -1
  33. package/dist/core/capability-contract.d.ts.map +1 -1
  34. package/dist/core/capability-contract.js +0 -1
  35. package/dist/core/capability-contract.js.map +1 -1
  36. package/dist/core/default-tool-surface.d.ts +1 -0
  37. package/dist/core/default-tool-surface.d.ts.map +1 -1
  38. package/dist/core/default-tool-surface.js +3 -2
  39. package/dist/core/default-tool-surface.js.map +1 -1
  40. package/dist/core/delegation/worker-agent-control-coordinator.d.ts +27 -8
  41. package/dist/core/delegation/worker-agent-control-coordinator.d.ts.map +1 -1
  42. package/dist/core/delegation/worker-agent-control-coordinator.js +191 -33
  43. package/dist/core/delegation/worker-agent-control-coordinator.js.map +1 -1
  44. package/dist/core/delegation/worker-agent-control.d.ts +45 -6
  45. package/dist/core/delegation/worker-agent-control.d.ts.map +1 -1
  46. package/dist/core/delegation/worker-agent-control.js +110 -13
  47. package/dist/core/delegation/worker-agent-control.js.map +1 -1
  48. package/dist/core/delegation/worker-attempt-executor.d.ts.map +1 -1
  49. package/dist/core/delegation/worker-attempt-executor.js +177 -158
  50. package/dist/core/delegation/worker-attempt-executor.js.map +1 -1
  51. package/dist/core/delegation/worker-authority-resolver.d.ts +23 -0
  52. package/dist/core/delegation/worker-authority-resolver.d.ts.map +1 -0
  53. package/dist/core/delegation/worker-authority-resolver.js +128 -0
  54. package/dist/core/delegation/worker-authority-resolver.js.map +1 -0
  55. package/dist/core/delegation/worker-conversation-store.d.ts.map +1 -1
  56. package/dist/core/delegation/worker-conversation-store.js +1 -1
  57. package/dist/core/delegation/worker-conversation-store.js.map +1 -1
  58. package/dist/core/delegation/worker-delegation-controller.d.ts +7 -1
  59. package/dist/core/delegation/worker-delegation-controller.d.ts.map +1 -1
  60. package/dist/core/delegation/worker-delegation-controller.js +260 -87
  61. package/dist/core/delegation/worker-delegation-controller.js.map +1 -1
  62. package/dist/core/delegation/worker-delegation-request.d.ts +25 -4
  63. package/dist/core/delegation/worker-delegation-request.d.ts.map +1 -1
  64. package/dist/core/delegation/worker-delegation-request.js +90 -1
  65. package/dist/core/delegation/worker-delegation-request.js.map +1 -1
  66. package/dist/core/delegation/worker-execution-policy.d.ts +2 -0
  67. package/dist/core/delegation/worker-execution-policy.d.ts.map +1 -1
  68. package/dist/core/delegation/worker-execution-policy.js +22 -12
  69. package/dist/core/delegation/worker-execution-policy.js.map +1 -1
  70. package/dist/core/delegation/worker-lifecycle.d.ts +1 -0
  71. package/dist/core/delegation/worker-lifecycle.d.ts.map +1 -1
  72. package/dist/core/delegation/worker-lifecycle.js +4 -2
  73. package/dist/core/delegation/worker-lifecycle.js.map +1 -1
  74. package/dist/core/delegation/worker-profile-resolver.d.ts +0 -2
  75. package/dist/core/delegation/worker-profile-resolver.d.ts.map +1 -1
  76. package/dist/core/delegation/worker-profile-resolver.js +8 -35
  77. package/dist/core/delegation/worker-profile-resolver.js.map +1 -1
  78. package/dist/core/delegation/worker-recovery-coordinator.d.ts.map +1 -1
  79. package/dist/core/delegation/worker-recovery-coordinator.js +1 -0
  80. package/dist/core/delegation/worker-recovery-coordinator.js.map +1 -1
  81. package/dist/core/delegation/worker-runner.d.ts +6 -1
  82. package/dist/core/delegation/worker-runner.d.ts.map +1 -1
  83. package/dist/core/delegation/worker-runner.js +20 -6
  84. package/dist/core/delegation/worker-runner.js.map +1 -1
  85. package/dist/core/delegation/worker-tree-budget-coordinator.d.ts +47 -0
  86. package/dist/core/delegation/worker-tree-budget-coordinator.d.ts.map +1 -0
  87. package/dist/core/delegation/worker-tree-budget-coordinator.js +210 -0
  88. package/dist/core/delegation/worker-tree-budget-coordinator.js.map +1 -0
  89. package/dist/core/models/runtime-process.d.ts.map +1 -1
  90. package/dist/core/models/runtime-process.js +5 -18
  91. package/dist/core/models/runtime-process.js.map +1 -1
  92. package/dist/core/orchestration/bounded-string-array.d.ts +11 -0
  93. package/dist/core/orchestration/bounded-string-array.d.ts.map +1 -0
  94. package/dist/core/orchestration/bounded-string-array.js +17 -0
  95. package/dist/core/orchestration/bounded-string-array.js.map +1 -0
  96. package/dist/core/orchestration/capability-gateway.d.ts +16 -0
  97. package/dist/core/orchestration/capability-gateway.d.ts.map +1 -1
  98. package/dist/core/orchestration/capability-gateway.js +38 -0
  99. package/dist/core/orchestration/capability-gateway.js.map +1 -1
  100. package/dist/core/orchestration/contracts.d.ts +11 -3
  101. package/dist/core/orchestration/contracts.d.ts.map +1 -1
  102. package/dist/core/orchestration/contracts.js +0 -1
  103. package/dist/core/orchestration/contracts.js.map +1 -1
  104. package/dist/core/orchestration/delegation-ledger.d.ts +1 -0
  105. package/dist/core/orchestration/delegation-ledger.d.ts.map +1 -1
  106. package/dist/core/orchestration/delegation-ledger.js +3 -0
  107. package/dist/core/orchestration/delegation-ledger.js.map +1 -1
  108. package/dist/core/orchestration/event-store.d.ts +12 -10
  109. package/dist/core/orchestration/event-store.d.ts.map +1 -1
  110. package/dist/core/orchestration/event-store.js +94 -104
  111. package/dist/core/orchestration/event-store.js.map +1 -1
  112. package/dist/core/orchestration/lane-tool-manifests.d.ts +2 -2
  113. package/dist/core/orchestration/lane-tool-manifests.d.ts.map +1 -1
  114. package/dist/core/orchestration/lane-tool-manifests.js +4 -1
  115. package/dist/core/orchestration/lane-tool-manifests.js.map +1 -1
  116. package/dist/core/orchestration/policy-compiler.d.ts.map +1 -1
  117. package/dist/core/orchestration/policy-compiler.js +8 -9
  118. package/dist/core/orchestration/policy-compiler.js.map +1 -1
  119. package/dist/core/orchestration/profile-registry.d.ts.map +1 -1
  120. package/dist/core/orchestration/profile-registry.js +4 -10
  121. package/dist/core/orchestration/profile-registry.js.map +1 -1
  122. package/dist/core/orchestration/task-runtime.d.ts +1 -0
  123. package/dist/core/orchestration/task-runtime.d.ts.map +1 -1
  124. package/dist/core/orchestration/task-runtime.js +58 -3
  125. package/dist/core/orchestration/task-runtime.js.map +1 -1
  126. package/dist/core/orchestration/worker-execution-contract.d.ts.map +1 -1
  127. package/dist/core/orchestration/worker-execution-contract.js +10 -17
  128. package/dist/core/orchestration/worker-execution-contract.js.map +1 -1
  129. package/dist/core/risk-classifier.js +3 -3
  130. package/dist/core/risk-classifier.js.map +1 -1
  131. package/dist/core/runtime-builder.d.ts +4 -1
  132. package/dist/core/runtime-builder.d.ts.map +1 -1
  133. package/dist/core/runtime-builder.js +34 -15
  134. package/dist/core/runtime-builder.js.map +1 -1
  135. package/dist/core/secrets/bitwarden-credential-storage.d.ts +51 -0
  136. package/dist/core/secrets/bitwarden-credential-storage.d.ts.map +1 -0
  137. package/dist/core/secrets/bitwarden-credential-storage.js +345 -0
  138. package/dist/core/secrets/bitwarden-credential-storage.js.map +1 -0
  139. package/dist/core/secrets/credential-exposure-guard.d.ts +8 -4
  140. package/dist/core/secrets/credential-exposure-guard.d.ts.map +1 -1
  141. package/dist/core/secrets/credential-exposure-guard.js +31 -29
  142. package/dist/core/secrets/credential-exposure-guard.js.map +1 -1
  143. package/dist/core/secrets/credential-manager.d.ts +109 -0
  144. package/dist/core/secrets/credential-manager.d.ts.map +1 -0
  145. package/dist/core/secrets/credential-manager.js +384 -0
  146. package/dist/core/secrets/credential-manager.js.map +1 -0
  147. package/dist/core/secrets/credential-project.d.ts +4 -0
  148. package/dist/core/secrets/credential-project.d.ts.map +1 -0
  149. package/dist/core/secrets/credential-project.js +145 -0
  150. package/dist/core/secrets/credential-project.js.map +1 -0
  151. package/dist/core/secrets/secret-dotenv.d.ts +1 -1
  152. package/dist/core/secrets/secret-dotenv.js +1 -1
  153. package/dist/core/secrets/secret-dotenv.js.map +1 -1
  154. package/dist/core/settings-manager.d.ts +4 -2
  155. package/dist/core/settings-manager.d.ts.map +1 -1
  156. package/dist/core/settings-manager.js +9 -5
  157. package/dist/core/settings-manager.js.map +1 -1
  158. package/dist/core/slash-commands.d.ts.map +1 -1
  159. package/dist/core/slash-commands.js +1 -0
  160. package/dist/core/slash-commands.js.map +1 -1
  161. package/dist/core/system-prompt.js +1 -1
  162. package/dist/core/system-prompt.js.map +1 -1
  163. package/dist/core/tool-capability-policy.js +2 -2
  164. package/dist/core/tool-capability-policy.js.map +1 -1
  165. package/dist/core/tools/delegate.d.ts +29 -1
  166. package/dist/core/tools/delegate.d.ts.map +1 -1
  167. package/dist/core/tools/delegate.js +179 -28
  168. package/dist/core/tools/delegate.js.map +1 -1
  169. package/dist/core/tools/git-filter.d.ts +1 -0
  170. package/dist/core/tools/git-filter.d.ts.map +1 -1
  171. package/dist/core/tools/git-filter.js +1 -1
  172. package/dist/core/tools/git-filter.js.map +1 -1
  173. package/dist/core/tools/profile-writer.js +3 -3
  174. package/dist/core/tools/profile-writer.js.map +1 -1
  175. package/dist/core/tools/python.d.ts +2 -0
  176. package/dist/core/tools/python.d.ts.map +1 -1
  177. package/dist/core/tools/python.js +17 -12
  178. package/dist/core/tools/python.js.map +1 -1
  179. package/dist/core/tools/run-process.d.ts +2 -0
  180. package/dist/core/tools/run-process.d.ts.map +1 -1
  181. package/dist/core/tools/run-process.js +7 -3
  182. package/dist/core/tools/run-process.js.map +1 -1
  183. package/dist/core/tools/secret-store.d.ts +8 -18
  184. package/dist/core/tools/secret-store.d.ts.map +1 -1
  185. package/dist/core/tools/secret-store.js +83 -348
  186. package/dist/core/tools/secret-store.js.map +1 -1
  187. package/dist/index.d.ts +3 -1
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +3 -1
  190. package/dist/index.js.map +1 -1
  191. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  192. package/dist/modes/interactive/components/settings-selector.js +35 -14
  193. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  194. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  195. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  196. package/dist/modes/interactive/interactive-mode.js +26 -3
  197. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  198. package/dist/modes/interactive/secret-menu-controller.d.ts +21 -0
  199. package/dist/modes/interactive/secret-menu-controller.d.ts.map +1 -0
  200. package/dist/modes/interactive/secret-menu-controller.js +276 -0
  201. package/dist/modes/interactive/secret-menu-controller.js.map +1 -0
  202. package/dist/utils/tools-manager.d.ts +2 -1
  203. package/dist/utils/tools-manager.d.ts.map +1 -1
  204. package/dist/utils/tools-manager.js +43 -48
  205. package/dist/utils/tools-manager.js.map +1 -1
  206. package/dist/utils/zip-extractor.d.ts +8 -0
  207. package/dist/utils/zip-extractor.d.ts.map +1 -0
  208. package/dist/utils/zip-extractor.js +275 -0
  209. package/dist/utils/zip-extractor.js.map +1 -0
  210. package/docs/harness-architecture.md +34 -22
  211. package/docs/index.md +1 -1
  212. package/docs/resources.md +1 -1
  213. package/docs/settings.md +39 -103
  214. package/docs/usage.md +7 -5
  215. package/docs/worker-profiles.md +9 -7
  216. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  217. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  218. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  219. package/examples/extensions/sandbox/package-lock.json +2 -2
  220. package/examples/extensions/sandbox/package.json +1 -1
  221. package/examples/extensions/with-deps/package-lock.json +2 -2
  222. package/examples/extensions/with-deps/package.json +1 -1
  223. package/npm-shrinkwrap.json +12 -12
  224. package/package.json +4 -4
  225. package/dist/core/secrets/secret-vault-format.d.ts +0 -112
  226. package/dist/core/secrets/secret-vault-format.d.ts.map +0 -1
  227. package/dist/core/secrets/secret-vault-format.js +0 -396
  228. package/dist/core/secrets/secret-vault-format.js.map +0 -1
  229. package/dist/core/secrets/secret-vault.d.ts +0 -72
  230. package/dist/core/secrets/secret-vault.d.ts.map +0 -1
  231. package/dist/core/secrets/secret-vault.js +0 -663
  232. package/dist/core/secrets/secret-vault.js.map +0 -1
package/docs/settings.md CHANGED
@@ -148,125 +148,61 @@ Fitness applicability is intentionally split by autonomy level:
148
148
 
149
149
  ### Worker Delegation
150
150
 
151
- Delegation requires an owner-authored orchestration profile. Global profiles live at `~/.pi/agent/profiles/orchestration/<id>.json`; project profiles live at `.pi/profiles/orchestration/<id>.json` and override a global profile with the same ID. Select the foreground architect with `--orchestration-profile <id>` or `activeOrchestrationProfile`. Select a default worker with `workerDelegation.orchestrationProfile`.
151
+ Pi's native delegation runtime is a durable recursive agent tree. A profile is not required. A profile-free root agent starts from the foreground model and the maximum classified core worker surface the host can materialize: `read`, `grep`, `find`, `ls`, `write`, `edit`, `memory`, the platform shell, and `delegate`. Live service switches can revoke memory, writes, or delegation. Every descendant inherits its parent's immutable execution grant and the tree's remaining budget by default.
152
152
 
153
- The profile fixes the role, provider/model, exact thinking level, tools, resource profiles, semantic capabilities, budgets, concurrency, lease duration, and independent-verification requirement. Fixed profiles contain one model. Ordered fallback profiles contain an owner-ordered candidate list; runtime health may advance through that list but cannot invent another model or reasoning level. An architect uses role `orchestrator`, grants only `workflow.delegate`, and lists the exact worker profile IDs it may select in `dispatchProfileIds`. A dispatch outside that list is rejected before creating a model call.
153
+ An agent may set `authority` on `delegate` to choose its child's role label, authenticated model, supported reasoning level, semantic capabilities, tools, read/write paths, and budget. Omitted fields inherit from the parent or selected preset. The host validates the request, resolves the concrete model and tools, intersects execution authority with the immutable parent grant and live global switches, then persists the exact result before the child starts. A descendant can specialize or narrow authority but cannot add an execution capability, tool, path, or budget that the parent did not hold. Roles are descriptive routing and audit labels; the built-in compiler does not impose hidden role ceilings, though an embedding may supply an explicit host ceiling.
154
154
 
155
155
  ```json
156
156
  {
157
- "schemaVersion": 1,
158
- "profileId": "architect",
159
- "description": "Routing-only architect",
160
- "role": "orchestrator",
161
- "modelPolicy": {
162
- "mode": "fixed",
163
- "candidates": [
164
- { "provider": "openai-codex", "modelId": "gpt-5.5", "thinkingLevel": "high" }
165
- ]
166
- },
167
- "capabilityCeiling": ["workflow.delegate"],
168
- "toolNames": ["delegate", "delegate_status"],
169
- "resourceProfileNames": ["architect-minimal"],
170
- "dispatchProfileIds": ["worker-fast", "verifier"],
171
- "budget": { "maxTokens": 16000, "maxWallClockMs": 600000, "maxCostUsd": 2, "maxToolCalls": 20 },
172
- "maxConcurrent": 1,
173
- "leaseTtlMs": 660000,
174
- "requireIndependentVerification": false,
175
- "createdAt": "2026-07-23T00:00:00.000Z",
176
- "updatedAt": "2026-07-23T00:00:00.000Z"
177
- }
178
- ```
179
-
180
- ```json
181
- {
182
- "schemaVersion": 1,
183
- "profileId": "worker-fast",
184
- "description": "Pinned implementation worker",
185
- "role": "implementer",
186
- "modelPolicy": {
187
- "mode": "fixed",
188
- "candidates": [
189
- { "provider": "openai", "modelId": "gpt-5-mini", "thinkingLevel": "minimal" }
190
- ]
191
- },
192
- "capabilityCeiling": ["filesystem.read", "filesystem.write", "worktree.read", "worktree.mutate"],
193
- "toolNames": ["read", "grep", "find", "ls", "write", "edit"],
194
- "resourceProfileNames": ["worker-minimal"],
195
- "dispatchProfileIds": [],
196
- "budget": { "maxTokens": 8000, "maxWallClockMs": 180000, "maxCostUsd": 0.25, "maxAttempts": 2, "maxToolCalls": 12 },
197
- "maxConcurrent": 3,
198
- "leaseTtlMs": 240000,
199
- "requireIndependentVerification": true,
200
- "verificationProfileId": "verifier",
201
- "createdAt": "2026-07-23T00:00:00.000Z",
202
- "updatedAt": "2026-07-23T00:00:00.000Z"
157
+ "action": "start",
158
+ "instructions": "Implement and verify the scheduler change.",
159
+ "authority": {
160
+ "role": "implementer",
161
+ "model": { "provider": "openai-codex", "modelId": "gpt-5.5" },
162
+ "thinkingLevel": "high",
163
+ "capabilities": [
164
+ "filesystem.read",
165
+ "filesystem.write",
166
+ "worktree.read",
167
+ "worktree.mutate",
168
+ "process.exec",
169
+ "memory.query",
170
+ "workflow.delegate"
171
+ ],
172
+ "toolNames": ["read", "grep", "find", "ls", "write", "edit", "memory", "bash", "delegate"],
173
+ "readPaths": ["."],
174
+ "writePaths": ["packages/coding-agent"],
175
+ "budget": { "maxTokens": 32000, "maxCostUsd": 2, "maxToolCalls": 80 }
176
+ }
203
177
  }
204
178
  ```
205
179
 
206
- A profile with `requireIndependentVerification: true` must name an owner-authored
207
- `verificationProfileId`. That target must have role `verifier`, cannot require another verifier, and
208
- must also appear in the active architect's `dispatchProfileIds`. After a successful implementation,
209
- the runtime automatically creates a separate durable verifier task. The implementation remains
210
- blocked and sends no terminal parent handoff until the verifier returns a typed accepted or rejected
211
- decision; only an accepted decision backed by trusted criterion-linked review evidence completes it.
212
-
213
- ```json
214
- {
215
- "schemaVersion": 1,
216
- "profileId": "verifier",
217
- "description": "Pinned independent test verifier",
218
- "role": "verifier",
219
- "modelPolicy": {
220
- "mode": "fixed",
221
- "candidates": [
222
- { "provider": "openai", "modelId": "gpt-5-mini", "thinkingLevel": "low" }
223
- ]
224
- },
225
- "capabilityCeiling": ["filesystem.read", "process.exec", "tests.execute"],
226
- "toolNames": ["read", "grep", "find", "ls", "run_process"],
227
- "resourceProfileNames": ["verifier-minimal"],
228
- "dispatchProfileIds": [],
229
- "executionPolicy": {
230
- "allowedExecutables": ["node", "npm", "git"],
231
- "allowedEnvironmentVariables": ["CI"],
232
- "maxOutputBytes": 65536
233
- },
234
- "budget": { "maxTokens": 8000, "maxWallClockMs": 180000, "maxCostUsd": 0.25, "maxToolCalls": 12 },
235
- "maxConcurrent": 2,
236
- "leaseTtlMs": 240000,
237
- "requireIndependentVerification": false,
238
- "createdAt": "2026-07-23T00:00:00.000Z",
239
- "updatedAt": "2026-07-23T00:00:00.000Z"
240
- }
241
- ```
180
+ There is no framework depth or fan-out cap. `workerDelegation.maxConcurrent` is the one global running-agent limit; excess work enters the durable queue. The kernel rejects only an exact recursive cycle when a child repeats the same normalized instructions and effective profile already present in its ancestor chain. Root budgets are cumulative across every descendant and attempt: token, cost, tool-call, active-wall-clock, and attempt usage are reconstructed from durable checkpoints and checked before more work is admitted.
242
181
 
243
- Operator and verifier profiles that grant `process.exec` or `tests.execute` must also declare `executionPolicy`. `run_process` accepts only those exact executables, passes arguments directly without a shell, exposes only baseline plus owner-listed environment variables, terminates on timeout/output overflow, and always waits for a terminal process event.
182
+ Every agent can coordinate the complete session tree through `delegate` actions:
244
183
 
245
- ```json
246
- "executionPolicy": {
247
- "allowedExecutables": ["node", "npm", "git"],
248
- "allowedEnvironmentVariables": ["CI"],
249
- "maxOutputBytes": 65536
250
- }
251
- ```
184
+ - `list` returns durable logical-agent identities, lineage, depth, and state.
185
+ - `transcript` returns exact peer messages with a cursor and a page size of 1-64; pagination is a context bound, not an authority restriction.
186
+ - `send` and `follow_up` carry durable thread, reply, and expected-reply metadata.
187
+ - `wait` is event-driven; `interrupt` is resumable; `resume` keeps the admitted model, transcript, resources, and grant; `cancel` terminates only the selected current task.
252
188
 
253
- Each isolated worker gets a fresh classified surface. `delegate`, unrestricted shell, foreground memory/lifecycle tools, and opaque extension tools are not inherited. Read-only memory exists only when the selected profile grants `memory.query`, exposes `memory`, and global memory retrieval is enabled; a delegate call cannot add it. Workers are otherwise read-only unless the global write switch, non-empty path scope, profile capabilities, and profile tool list all grant `write` or `edit`.
189
+ `delegate` returns a lane id immediately. Completion persists a bounded terminal handoff before waking the parent; late output stays in the worker transcript instead of racing into the active foreground transcript. `delegate_status` remains available for bounded lane-result retrieval.
254
190
 
255
- Profiles are provider-independent: every candidate resolves through the model registry, exact model authentication, capability metadata, and the selected model's native or calibrated text-tool protocol. Worker concurrency is counted per profile under the global worker ceiling; every capacity-bound worker is durably queued and drained under both limits, while local workers also queue when they contend with a local foreground. Worker model, thinking, resource, prompt, memory, and tool authority exist only in the selected orchestration profile; delegate calls and worker settings have no parallel override fields.
191
+ Global profiles live at `~/.pi/agent/profiles/orchestration/<id>.json`; project profiles live at `.pi/profiles/orchestration/<id>.json`. They are optional presets for model, reasoning, tools, resources, budget, verification, and prompt defaults. Select one with `profileId` on a call or configure `workerDelegation.orchestrationProfile`. `dispatchProfileIds` is preset-routing metadata, not an admission allowlist. Profile `maxConcurrent` is retained in the authored schema but does not override the global scheduler. `profile_writer` can create an optional immutable session-scoped narrowing when a reusable preset is useful; direct authority selection does not require it.
256
192
 
257
- **Confirmed behavior:** `delegate` returns a lane id immediately instead of waiting for the worker. `delegate_status` shows queued, running, and terminal workers and retrieves bounded terminal output by lane id. Completion records a durable terminal notification before waking the parent; undelivered in-process notifications replay after session resume. The interactive footer shows running/queued counts or the latest terminal lane. Late worker output is stored separately and is never injected into an active foreground transcript.
193
+ A preset with `requireIndependentVerification: true` still names an owner-authored `verificationProfileId`. The runtime creates a separate durable verifier task and accepts the implementation only after a typed verifier decision. A profile using `run_process` must declare `executionPolicy`; that tool launches only listed executables as direct argv. The platform shell is different: it is a real persistent per-agent shell and is not OS/container isolation. Shell commands can exercise the host process, filesystem, network, and credentials available to Pi; direct `write`/`edit` path scopes do not sandbox shell side effects.
258
194
 
259
- Worker writes use **review-after-apply** semantics: a grant-authorized direct `write`/`edit` call or structured-action fallback may mutate the scoped workspace before the parent reviews the result. Both routes pass through the same compiled execution grant, path policy, and cumulative tool budget. The parent review is therefore a post-mutation acceptance step and receives changed files, blockers, the usage report id, and `parent_review_required` for an in-scope changed result. Denied or out-of-scope actions are refused before filesystem mutation; partial application is reported as `blocked`, never clean success.
195
+ Direct `write`/`edit` calls use review-after-apply semantics. The compiled grant and path policy reject out-of-scope direct mutations before they run, while accepted changes are reported to the parent with changed files, blockers, usage identity, and review state.
260
196
 
261
197
  | Setting | Type | Default | Description |
262
198
  |---------|------|---------|-------------|
263
- | `workerDelegation.enabled` | boolean | `true` | Enable bounded delegation on capability-eligible models; explicit `false` is a hard off-switch |
264
- | `workerDelegation.orchestrationProfile` | string | - | Owner-selected default worker profile; an active architect may use only IDs in its `dispatchProfileIds` |
265
- | `workerDelegation.maxUsd` | number | `0.5` | Global safety ceiling intersected with profile/foreground limits; `0` disables only this settings-level ceiling |
266
- | `workerDelegation.maxWallClockMs` | number | `120000` | Global safety ceiling intersected with the profile limit; `0` disables only this settings-level ceiling |
267
- | `workerDelegation.maxConcurrent` | number | `1` | Global concurrency ceiling combined with profile `maxConcurrent` |
268
- | `workerDelegation.writeEnabled` | boolean | `false` | Make `write`/`edit` eligible only when `writePaths` is non-empty and the lane profile grants them |
269
- | `workerDelegation.writePaths` | string[] | `[]` | Relative or absolute path roots enforced for direct child tools and structured-action fallback writes |
199
+ | `workerDelegation.enabled` | boolean | `true` | Enable autonomous recursive agent trees; explicit `false` is a hard off-switch |
200
+ | `workerDelegation.orchestrationProfile` | string | - | Optional default execution preset; agents may replace its defaults within inherited authority |
201
+ | `workerDelegation.maxUsd` | number | `0.5` | Cumulative USD ceiling for one root tree; `0` disables this settings-level ceiling |
202
+ | `workerDelegation.maxWallClockMs` | number | `120000` | Cumulative active wall-clock ceiling for one root tree; `0` disables this settings-level ceiling |
203
+ | `workerDelegation.maxConcurrent` | number | `1` | Global scheduler concurrency; any positive safe integer is accepted, with no depth or fan-out cap |
204
+ | `workerDelegation.writeEnabled` | boolean | `true` | Expose direct `write`/`edit`; explicit `false` revokes them for newly admitted work and narrows resumed grants |
205
+ | `workerDelegation.writePaths` | string[] | `["."]` | Global envelope for direct child writes; an explicit empty array revokes direct `write`/`edit` |
270
206
 
271
207
  ### Tool Repair
272
208
 
package/docs/usage.md CHANGED
@@ -43,15 +43,15 @@ Pasted images are stored under `~/.pi/agent/state/attachments` by default and at
43
43
 
44
44
  When an owner choice materially changes the result, the built-in `ask_question` interaction presents up to four questions together. It supports single choice, multi-select, an unrestricted multi-line custom **Other** answer, clipboard text or image paste, explicit **Skip**, configurable keyboard navigation, cancellation, and a final review before a multi-question answer is submitted. The request is checkpointed before display; `/resume` restores the original tool call, and large answers remain exact in a retrievable artifact while only a bounded projection enters prompt context. TUI and RPC hosts use the same fail-closed typed request. Image paste is refused with a visible explanation when the routed model cannot accept images instead of silently replacing it with a placeholder. Non-interactive sessions fail closed instead of inventing an answer, and worker sessions do not construct the question tool.
45
45
 
46
- Native task steps and worker lanes share the same compact work panel. Steps and agents are grouped separately; durable worker task labels and owner-authored profile ids remain visible after `/resume`. Completed worker output remains untrusted until the parent verifies it through the existing result and review contracts.
46
+ Native task steps and worker agents share the same compact work panel. Steps and agents are grouped separately; durable task labels and admitted preset or adaptive grant IDs remain visible after `/resume`. Completed worker output remains untrusted until the parent verifies it through the existing result and review contracts.
47
47
 
48
48
  ### Secret Store
49
49
 
50
- In an interactive user session, ask the agent to store or adopt a project's dotenv file, for example: `Store this project's credentials in the project-dev secret profile.` The native `secret_store` tool opens a private multiline editor where the owner pastes ordinary plaintext dotenv content. Existing unmanaged dotenv content is prefilled locally for review. The editor disables history, undo, kill-ring, autocomplete, paste collapsing, and external-editor temp files, and clears its buffer on close. Only profile, variable-name, and workspace-binding metadata reaches the model; the plaintext document never enters tool arguments, results, transcripts, or telemetry. Pi collects the vault passphrase through separate masked input and encrypts the bounded profile and bindings under `~/.pi/agent/state/secrets/vault.json`. Only the derived key and explicitly activated profile environment remain cached in the current Pi process; asking the agent to lock the vault or exiting Pi clears them and resets credential-bearing shell state. Worker, print, and RPC sessions cannot use the capture path.
50
+ Run `/secrets` in an owner-controlled TUI. Pi provisions its pinned [Bitwarden Password Manager CLI](https://bitwarden.com/help/cli/) (`bw`) automatically when no system installation is available, then asks for one masked `BW_SESSION` session key. Generate that key with `bw unlock --raw` after signing in to Bitwarden. Pi keeps the key in memory for the current session; it is never placed in model context or passed to model-controlled processes.
51
51
 
52
- The encrypted binding remembers the workspace and relative dotenv filename. Later, the agent can list that metadata and call `secret_store` materialization for the current workspace without asking for a destination again. Once unlocked and materialized, Pi injects the profile into Bash and Python child environments so the agent runs the consuming application normally without reading or sourcing the file. Direct read, edit, search, and shell-inspection attempts against credential files are refused across foreground and worker tool surfaces, and known values are redacted from streamed results and errors.
52
+ The private menu accepts username/password pairs, a pasted token or private key, a dropped absolute key-file path, or multiple variables in dotenv syntax. Pi stores the profile as an encrypted Bitwarden item and writes no local vault or project dotenv. A normalized Git-origin identity binds the profile to the project, so another clone on a synced machine detects the same binding. Repositories without a portable origin use a machine-local opaque project identity. An existing profile can be explicitly bound to additional projects on the same machine.
53
53
 
54
- Every materialized dotenv file is plaintext and mode `0600` on POSIX. Workspace copies must remain ignored by version control. The protection is a model-facing tool boundary, not an OS sandbox: another process running as the same OS user can read the file, and code deliberately granted network or process authority can use the injected credential. Keep execution policy and approval gates appropriate to that authority.
54
+ The model-facing `secret_store` tool can only inspect non-secret profile metadata and activate a profile already authorized for the current project. Activation works without a live TUI in interactive, print, and RPC modes when that Pi process has a valid `BW_SESSION`. Values are injected in memory into Bash, Python, and allowlisted `run_process` variables; exact values are redacted from tool results and owner-shell transcripts. Locking or exiting clears the active environment and session key. This is a model-facing boundary, not an OS sandbox: code intentionally given process or network authority can use an activated credential through its consuming application.
55
55
 
56
56
  ## Slash Commands
57
57
 
@@ -63,6 +63,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
63
63
  | `/model` | Switch models |
64
64
  | `/scoped-models` | Enable/disable models for Ctrl+P cycling |
65
65
  | `/settings` | Thinking level, theme, message delivery, transport |
66
+ | `/secrets` | Connect Bitwarden; add, bind, activate, or remove project credential profiles |
66
67
  | `/resume` | Pick from previous sessions |
67
68
  | `/new` | Start a new session |
68
69
  | `/name <name>` | Set session display name |
@@ -309,10 +310,11 @@ pi --exclude-tools ask_question
309
310
  | `PI_SKIP_VERSION_CHECK` | Skip the Pi version update check at startup. This prevents the `pi.dev` latest-version request |
310
311
  | `PI_TELEMETRY` | Override install/update telemetry: `1`/`true`/`yes` or `0`/`false`/`no`. This does not disable update checks |
311
312
  | `PI_CACHE_RETENTION` | Set to `long` for extended prompt cache where supported |
313
+ | `BW_SESSION` | Optional Bitwarden CLI session key for autonomous activation in a new Pi process |
312
314
  | `VISUAL`, `EDITOR` | External editor for Ctrl+G |
313
315
 
314
316
  ## Design Principles
315
317
 
316
- Pi keeps the core focused and pushes project-specific workflows into extensions, skills, prompt templates, and packages. Core includes the cross-project lifecycle primitives it depends on itself: native goals, task steps, bounded worker delegation, and a platform-selected shell. Broader integrations such as MCP and external-provider teams remain extension/package territory.
318
+ Pi keeps the core focused and pushes project-specific workflows into extensions, skills, prompt templates, and packages. Core includes the cross-project lifecycle primitives it depends on itself: native goals, task steps, durable recursive agent orchestration, and a platform-selected shell. Broader integrations such as MCP and external-provider teams remain extension/package territory.
317
319
 
318
320
  For the full rationale, read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/).
@@ -1,16 +1,18 @@
1
- # Task worker profiles
1
+ # Task worker presets
2
2
 
3
- `profile_writer` lets the foreground orchestrator create the smallest worker profile needed for one bounded task. It does not edit user or project profile files.
3
+ Native delegation does not require a profile. `delegate.authority` can choose a child model, reasoning level, role label, classified tools, capabilities, paths, and budget directly. Omitted fields inherit from the caller, and Pi persists the resulting immutable execution grant.
4
4
 
5
- Task profiles are:
5
+ `profile_writer` remains useful when the foreground orchestrator wants a reusable session-scoped preset. It does not edit user or project profile files. Task presets are:
6
6
 
7
7
  - Derived only from an owner-authorized base profile.
8
8
  - Immutable and assigned a `task-...` ID by Pi.
9
9
  - Stored on the owning session branch, never shared across independent sessions.
10
- - Limited to 32 profiles per session.
10
+ - Limited to 32 presets per session.
11
11
  - Unable to add tools, resources, or budget beyond the base profile.
12
- - Limited to configured, authenticated, non-exhausted models and a thinking level that model supports.
12
+ - Limited to configured, authenticated, non-exhausted models and a reasoning level that model supports.
13
13
 
14
- Use `profile_writer { action: "inspect" }` when the authorized bases or model combinations are unknown. Then call `create` with a concise task and only the fields that need narrowing. Pass the returned profile ID unchanged to `delegate`; never invent one.
14
+ Use `profile_writer { action: "inspect" }` when the reusable bases or model combinations are unknown. Then call `create` with a concise task and only the defaults worth preserving. Pass the returned profile ID unchanged to `delegate`; never invent one.
15
15
 
16
- Workers cannot invoke `profile_writer`, recursively delegate, or expand their admitted contract. A resumed worker retains the exact profile, model, resources, and transcript admitted for that task.
16
+ Worker agents do not invoke `profile_writer`. They receive `delegate` only when their admitted tool set and capability ceiling both retain delegation; a caller can create a non-delegating leaf by narrowing either field. Delegating workers may recursively create descendants, inspect exact paginated peer transcripts, and exchange threaded messages.
17
+
18
+ Pi registers each logical child before scheduler admission, so queued children already have stable agent IDs. A parent that waits yields its scheduler slot until an event-driven state change, and every terminal child writes one bounded, idempotent handoff to its owning parent's mailbox. Active parents receive that handoff without transcript races; idle registered parents resume once. Exact child output remains in the child transcript, and control over interruption, resume, or cancellation is limited to the caller's subtree. A resumed worker retains the exact admitted preset or adaptive grant, model, resources, lineage, and transcript.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.85.8",
3
+ "version": "0.86.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.85.8",
9
+ "version": "0.86.1",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.85.8",
4
+ "version": "0.86.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.85.8",
4
+ "version": "0.86.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
- "version": "0.85.8",
3
+ "version": "0.86.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "0.85.8",
9
+ "version": "0.86.1",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sandbox-runtime": "^0.0.26"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
3
  "private": true,
4
- "version": "0.85.8",
4
+ "version": "0.86.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "0.85.8",
3
+ "version": "0.86.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.85.8",
9
+ "version": "0.86.1",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.85.8",
4
+ "version": "0.86.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@caupulican/pi-adaptative",
3
- "version": "0.85.8",
3
+ "version": "0.86.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@caupulican/pi-adaptative",
9
- "version": "0.85.8",
9
+ "version": "0.86.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@caupulican/pi-agent-core": "^0.85.8",
13
- "@caupulican/pi-ai": "^0.85.8",
14
- "@caupulican/pi-tui": "^0.85.8",
12
+ "@caupulican/pi-agent-core": "^0.86.1",
13
+ "@caupulican/pi-ai": "^0.86.1",
14
+ "@caupulican/pi-tui": "^0.86.1",
15
15
  "@silvia-odwyer/photon-node": "0.3.4",
16
16
  "chalk": "5.6.2",
17
17
  "cross-spawn": "7.0.6",
@@ -547,11 +547,11 @@
547
547
  }
548
548
  },
549
549
  "node_modules/@caupulican/pi-agent-core": {
550
- "version": "0.85.8",
551
- "resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.85.8.tgz",
550
+ "version": "0.86.1",
551
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.86.1.tgz",
552
552
  "license": "MIT",
553
553
  "dependencies": {
554
- "@caupulican/pi-ai": "^0.85.8",
554
+ "@caupulican/pi-ai": "^0.86.1",
555
555
  "ignore": "7.0.5",
556
556
  "typebox": "1.1.38",
557
557
  "yaml": "2.9.0"
@@ -561,8 +561,8 @@
561
561
  }
562
562
  },
563
563
  "node_modules/@caupulican/pi-ai": {
564
- "version": "0.85.8",
565
- "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.85.8.tgz",
564
+ "version": "0.86.1",
565
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.86.1.tgz",
566
566
  "license": "MIT",
567
567
  "dependencies": {
568
568
  "@anthropic-ai/sdk": "0.91.1",
@@ -616,8 +616,8 @@
616
616
  }
617
617
  },
618
618
  "node_modules/@caupulican/pi-tui": {
619
- "version": "0.85.8",
620
- "resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.85.8.tgz",
619
+ "version": "0.86.1",
620
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.86.1.tgz",
621
621
  "license": "MIT",
622
622
  "dependencies": {
623
623
  "get-east-asian-width": "1.6.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caupulican/pi-adaptative",
3
- "version": "0.85.8",
3
+ "version": "0.86.1",
4
4
  "description": "Adaptive fork of Pi coding agent for self-evolving agent harness experiments",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -84,9 +84,9 @@
84
84
  "postinstall": "node scripts/postinstall-python-runtime.mjs"
85
85
  },
86
86
  "dependencies": {
87
- "@caupulican/pi-agent-core": "^0.85.8",
88
- "@caupulican/pi-ai": "^0.85.8",
89
- "@caupulican/pi-tui": "^0.85.8",
87
+ "@caupulican/pi-agent-core": "^0.86.1",
88
+ "@caupulican/pi-ai": "^0.86.1",
89
+ "@caupulican/pi-tui": "^0.86.1",
90
90
  "@silvia-odwyer/photon-node": "0.3.4",
91
91
  "chalk": "5.6.2",
92
92
  "cross-spawn": "7.0.6",
@@ -1,112 +0,0 @@
1
- export declare const VAULT_MARKER = "pi-secret-vault-v1";
2
- export declare const DEFAULT_SCRYPT_N = 32768;
3
- export declare const MAX_VAULT_FILE_BYTES: number;
4
- export declare const MAX_PROFILES = 64;
5
- export declare const MAX_VARIABLES_PER_PROFILE = 64;
6
- export declare const MAX_BINDINGS_PER_PROFILE = 16;
7
- export declare const SECRET_PROFILE_ID_MAX_CHARS = 64;
8
- export declare const SECRET_DESCRIPTION_MAX_CHARS = 240;
9
- export declare const SECRET_PROFILE_ID_PATTERN = "^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,62}[A-Za-z0-9])?$";
10
- export { SECRET_VARIABLE_NAME_MAX_CHARS, SECRET_VARIABLE_NAME_PATTERN } from "./secret-dotenv.ts";
11
- export declare const SECRET_PRINTABLE_METADATA_PATTERN = "^[^\\u0000-\\u001f\\u007f-\\u009f]+$";
12
- export declare const MANAGED_ENV_HEADER_PREFIX = "# pi-secret-store:v1 profile=";
13
- export type SecretVaultErrorCode = "already_initialized" | "ambiguous_binding" | "binding_missing" | "destination_conflict" | "destination_invalid" | "invalid_description" | "invalid_dotenv" | "invalid_passphrase" | "invalid_profile" | "invalid_variable" | "not_initialized" | "not_unlocked" | "profile_limit" | "profile_missing" | "symlink_refused" | "unlock_failed" | "value_too_large" | "variable_limit" | "vault_corrupt" | "vault_too_large";
14
- export declare class SecretVaultError extends Error {
15
- readonly code: SecretVaultErrorCode;
16
- constructor(code: SecretVaultErrorCode, message: string);
17
- }
18
- export interface SecretVariableValue {
19
- name: string;
20
- value: string;
21
- }
22
- export interface SecretProfileSummary {
23
- profile: string;
24
- description?: string;
25
- variableNames: string[];
26
- bindings: SecretBindingSummary[];
27
- createdAt: string;
28
- updatedAt: string;
29
- }
30
- export interface SecretBindingSummary {
31
- workspace: string;
32
- envFile: string;
33
- updatedAt: string;
34
- }
35
- export interface SecretBindingResolution extends SecretBindingSummary {
36
- profile: string;
37
- destination: string;
38
- variableNames: string[];
39
- }
40
- export type SecretEnvDestinationState = "missing" | "managed-profile" | "managed-other" | "unmanaged";
41
- export interface SecretMaterializationResult {
42
- profile: string;
43
- variableNames: string[];
44
- previousState: SecretEnvDestinationState;
45
- }
46
- export interface SecretRemovalResult {
47
- profile: string;
48
- removedProfile: boolean;
49
- removedVariableNames: string[];
50
- managedMaterializationRemoved: boolean;
51
- boundMaterializationsRemoved: number;
52
- }
53
- export interface SecretVaultOptions {
54
- agentDir: string;
55
- /** Test-only cost override. Production callers should retain the default. */
56
- scryptN?: number;
57
- now?: () => Date;
58
- /** Reset credential-bearing child process state after activation, mutation, or lock. */
59
- onEnvironmentChanged?: () => void;
60
- }
61
- export interface VaultKdf {
62
- algorithm: "scrypt";
63
- salt: string;
64
- N: number;
65
- r: number;
66
- p: number;
67
- keyLength: number;
68
- }
69
- export interface VaultCiphertext {
70
- iv: string;
71
- tag: string;
72
- ciphertext: string;
73
- }
74
- export interface VaultEnvelope {
75
- version: 1;
76
- kdf: VaultKdf;
77
- payload: VaultCiphertext;
78
- }
79
- export interface SecretProfileRecord {
80
- profile: string;
81
- description?: string;
82
- createdAt: string;
83
- updatedAt: string;
84
- dotenv: string;
85
- bindings: SecretBindingSummary[];
86
- }
87
- export interface VaultPayload {
88
- marker: typeof VAULT_MARKER;
89
- profiles: SecretProfileRecord[];
90
- }
91
- export declare function validateScryptN(value: number): number;
92
- export declare function createVaultKdf(scryptN: number): VaultKdf;
93
- export declare function parseEnvelope(text: string): VaultEnvelope;
94
- export declare function validateProfileId(profile: string): string;
95
- export declare function validateDescription(description: string | undefined): string | undefined;
96
- export declare function validateBindingWorkspace(workspace: string): string;
97
- export declare function validateBindingEnvFile(envFile: string): string;
98
- export declare function validateVariableName(name: string): string;
99
- export declare function validateSecretValue(value: string): string;
100
- export declare function validateDotenvProfileDocument(document: string): {
101
- document: string;
102
- variables: SecretVariableValue[];
103
- };
104
- export declare function scrubPayload(payload: VaultPayload): void;
105
- export declare function assertPassphrase(passphrase: string, creating: boolean): void;
106
- export declare function sameKdf(left: VaultKdf, right: VaultKdf): boolean;
107
- export declare function deriveKey(passphrase: string, kdf: VaultKdf): Promise<Buffer>;
108
- export declare function decryptPayload(ciphertext: VaultCiphertext, key: Buffer): VaultPayload;
109
- export declare function serializeEnvelope(kdf: VaultKdf, payload: VaultPayload, key: Buffer): string;
110
- export declare function profileSummary(profile: SecretProfileRecord): SecretProfileSummary;
111
- export declare function serializeVariableValues(values: readonly SecretVariableValue[]): string;
112
- //# sourceMappingURL=secret-vault-format.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secret-vault-format.d.ts","sourceRoot":"","sources":["../../../src/core/secrets/secret-vault-format.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,YAAY,uBAAuB,CAAC;AAOjD,eAAO,MAAM,gBAAgB,QAAS,CAAC;AAKvC,eAAO,MAAM,oBAAoB,QAAkB,CAAC;AAEpD,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,yBAAyB,KAAuB,CAAC;AAC9D,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAG3C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,yBAAyB,sDAAsF,CAAC;AAC7H,OAAO,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClG,eAAO,MAAM,iCAAiC,yCAAyC,CAAC;AACxF,eAAO,MAAM,yBAAyB,kCAAkC,CAAC;AAKzE,MAAM,MAAM,oBAAoB,GAC7B,qBAAqB,GACrB,mBAAmB,GACnB,iBAAiB,GACjB,sBAAsB,GACtB,qBAAqB,GACrB,qBAAqB,GACrB,gBAAgB,GAChB,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,GACf,iBAAiB,CAAC;AAErB,qBAAa,gBAAiB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IAEpC,YAAY,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM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