agentplane 0.3.13 → 0.3.15

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 (278) hide show
  1. package/assets/RUNNER.md +1 -1
  2. package/assets/agents/ORCHESTRATOR.json +1 -1
  3. package/assets/agents/SKILL_EXTRACTOR.json +31 -0
  4. package/assets/framework.manifest.json +7 -0
  5. package/assets/policy/incidents.md +5 -3
  6. package/assets/policy/workflow.branch_pr.md +10 -5
  7. package/dist/.build-manifest.json +280 -180
  8. package/dist/cli/output.d.ts +29 -0
  9. package/dist/cli/output.d.ts.map +1 -1
  10. package/dist/cli/output.js +33 -0
  11. package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
  12. package/dist/cli/run-cli/command-catalog/core.js +29 -87
  13. package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
  14. package/dist/cli/run-cli/command-catalog/lifecycle.js +4 -12
  15. package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
  16. package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
  17. package/dist/cli/run-cli/command-catalog/project.js +16 -38
  18. package/dist/cli/run-cli/command-catalog/shared.d.ts +9 -6
  19. package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
  20. package/dist/cli/run-cli/command-catalog/shared.js +23 -6
  21. package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
  22. package/dist/cli/run-cli/command-catalog/task.js +6 -18
  23. package/dist/cli/run-cli/command-catalog.d.ts +1 -1
  24. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  25. package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
  26. package/dist/cli/run-cli/commands/init/recipes.js +1 -0
  27. package/dist/cli/run-cli.js +1 -1
  28. package/dist/cli/run-cli.test-helpers.d.ts +1 -74
  29. package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
  30. package/dist/cli/run-cli.test-helpers.js +1 -769
  31. package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
  32. package/dist/commands/branch/cleanup-merged.js +5 -9
  33. package/dist/commands/branch/work-start.command.d.ts.map +1 -1
  34. package/dist/commands/branch/work-start.command.js +1 -0
  35. package/dist/commands/commit.spec.d.ts.map +1 -1
  36. package/dist/commands/commit.spec.js +2 -0
  37. package/dist/commands/doctor/branch-pr.d.ts +1 -1
  38. package/dist/commands/doctor/branch-pr.d.ts.map +1 -1
  39. package/dist/commands/doctor/branch-pr.js +5 -2
  40. package/dist/commands/guard/impl/commands.d.ts.map +1 -1
  41. package/dist/commands/guard/impl/commands.js +4 -1
  42. package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
  43. package/dist/commands/guard/impl/comment-commit.js +2 -1
  44. package/dist/commands/guard/impl/env.d.ts +6 -0
  45. package/dist/commands/guard/impl/env.d.ts.map +1 -1
  46. package/dist/commands/guard/impl/env.js +41 -0
  47. package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
  48. package/dist/commands/pr/internal/auto-commit.js +2 -1
  49. package/dist/commands/pr/internal/sync-branch.d.ts +36 -0
  50. package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -0
  51. package/dist/commands/pr/internal/sync-branch.js +113 -0
  52. package/dist/commands/pr/internal/sync-github.d.ts +28 -0
  53. package/dist/commands/pr/internal/sync-github.d.ts.map +1 -0
  54. package/dist/commands/pr/internal/sync-github.js +178 -0
  55. package/dist/commands/pr/internal/sync-model.d.ts +36 -0
  56. package/dist/commands/pr/internal/sync-model.d.ts.map +1 -0
  57. package/dist/commands/pr/internal/sync-model.js +1 -0
  58. package/dist/commands/pr/internal/sync-open-step.d.ts +10 -0
  59. package/dist/commands/pr/internal/sync-open-step.d.ts.map +1 -0
  60. package/dist/commands/pr/internal/sync-open-step.js +128 -0
  61. package/dist/commands/pr/internal/sync-support.d.ts +7 -0
  62. package/dist/commands/pr/internal/sync-support.d.ts.map +1 -0
  63. package/dist/commands/pr/internal/sync-support.js +29 -0
  64. package/dist/commands/pr/internal/sync-update-step.d.ts +6 -0
  65. package/dist/commands/pr/internal/sync-update-step.d.ts.map +1 -0
  66. package/dist/commands/pr/internal/sync-update-step.js +68 -0
  67. package/dist/commands/pr/internal/sync.d.ts +2 -6
  68. package/dist/commands/pr/internal/sync.d.ts.map +1 -1
  69. package/dist/commands/pr/internal/sync.js +83 -529
  70. package/dist/commands/pr/open.d.ts.map +1 -1
  71. package/dist/commands/pr/open.js +25 -8
  72. package/dist/commands/pr/pr.command.d.ts.map +1 -1
  73. package/dist/commands/pr/pr.command.js +7 -2
  74. package/dist/commands/recipes/impl/apply.d.ts +1 -1
  75. package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
  76. package/dist/commands/recipes/impl/apply.js +1 -2
  77. package/dist/commands/recipes/impl/commands/active.d.ts.map +1 -1
  78. package/dist/commands/recipes/impl/commands/active.js +6 -5
  79. package/dist/commands/recipes/impl/commands/add.d.ts +1 -0
  80. package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -1
  81. package/dist/commands/recipes/impl/commands/add.js +32 -27
  82. package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -1
  83. package/dist/commands/recipes/impl/commands/detach.js +35 -21
  84. package/dist/commands/recipes/impl/commands/disable.d.ts.map +1 -1
  85. package/dist/commands/recipes/impl/commands/disable.js +5 -3
  86. package/dist/commands/recipes/impl/commands/enable.d.ts.map +1 -1
  87. package/dist/commands/recipes/impl/commands/enable.js +5 -3
  88. package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
  89. package/dist/commands/recipes/impl/commands/explain.js +57 -47
  90. package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
  91. package/dist/commands/recipes/impl/commands/info.js +25 -21
  92. package/dist/commands/recipes/impl/commands/install.d.ts +1 -1
  93. package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
  94. package/dist/commands/recipes/impl/commands/install.js +3 -13
  95. package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
  96. package/dist/commands/recipes/impl/commands/list-remote.js +2 -3
  97. package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
  98. package/dist/commands/recipes/impl/commands/list.js +7 -6
  99. package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
  100. package/dist/commands/recipes/impl/commands/remove.js +12 -7
  101. package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -1
  102. package/dist/commands/recipes/impl/commands/update.js +38 -24
  103. package/dist/commands/recipes/impl/index.d.ts +1 -1
  104. package/dist/commands/recipes/impl/index.d.ts.map +1 -1
  105. package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
  106. package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
  107. package/dist/commands/recipes/impl/installed-recipes.js +1 -2
  108. package/dist/commands/recipes/impl/mutation-transaction.d.ts +7 -0
  109. package/dist/commands/recipes/impl/mutation-transaction.d.ts.map +1 -0
  110. package/dist/commands/recipes/impl/mutation-transaction.js +47 -0
  111. package/dist/commands/recipes/impl/overlay-project.d.ts +19 -3
  112. package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -1
  113. package/dist/commands/recipes/impl/overlay-project.js +76 -38
  114. package/dist/commands/recipes/impl/paths.d.ts +0 -3
  115. package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
  116. package/dist/commands/recipes/impl/paths.js +0 -3
  117. package/dist/commands/recipes/impl/project-installed-recipes.d.ts +4 -1
  118. package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
  119. package/dist/commands/recipes/impl/project-installed-recipes.js +6 -4
  120. package/dist/commands/recipes/impl/project-recipe-state.d.ts +1 -1
  121. package/dist/commands/recipes/impl/project-recipe-state.d.ts.map +1 -1
  122. package/dist/commands/recipes/impl/project-registry.d.ts +5 -1
  123. package/dist/commands/recipes/impl/project-registry.d.ts.map +1 -1
  124. package/dist/commands/recipes/impl/project-registry.js +34 -14
  125. package/dist/commands/recipes/impl/resolver.d.ts +1 -1
  126. package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
  127. package/dist/commands/recipes/impl/resolver.js +1 -1
  128. package/dist/commands/recipes/impl/types.d.ts +1 -1
  129. package/dist/commands/recipes/impl/types.d.ts.map +1 -1
  130. package/dist/commands/recipes/impl/version.d.ts +5 -0
  131. package/dist/commands/recipes/impl/version.d.ts.map +1 -0
  132. package/dist/commands/recipes/impl/version.js +9 -0
  133. package/dist/commands/recipes.d.ts +5 -4
  134. package/dist/commands/recipes.d.ts.map +1 -1
  135. package/dist/commands/recipes.js +3 -3
  136. package/dist/commands/release/apply.command.d.ts +1 -1
  137. package/dist/commands/release/apply.command.d.ts.map +1 -1
  138. package/dist/commands/release/apply.command.js +15 -379
  139. package/dist/commands/release/apply.mutation.d.ts +1 -0
  140. package/dist/commands/release/apply.mutation.d.ts.map +1 -1
  141. package/dist/commands/release/apply.mutation.js +24 -1
  142. package/dist/commands/release/apply.pipeline.d.ts +22 -0
  143. package/dist/commands/release/apply.pipeline.d.ts.map +1 -0
  144. package/dist/commands/release/apply.pipeline.js +371 -0
  145. package/dist/commands/release/apply.preflight.d.ts +2 -0
  146. package/dist/commands/release/apply.preflight.d.ts.map +1 -1
  147. package/dist/commands/release/apply.preflight.js +13 -4
  148. package/dist/commands/release/apply.types.d.ts +27 -0
  149. package/dist/commands/release/apply.types.d.ts.map +1 -1
  150. package/dist/commands/release.test-helpers.d.ts +4 -0
  151. package/dist/commands/release.test-helpers.d.ts.map +1 -1
  152. package/dist/commands/release.test-helpers.js +7 -0
  153. package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
  154. package/dist/commands/shared/reconcile-check.js +2 -2
  155. package/dist/commands/shared/task-backend.d.ts +6 -1
  156. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  157. package/dist/commands/shared/task-backend.js +34 -2
  158. package/dist/commands/shared/task-mutation.d.ts.map +1 -1
  159. package/dist/commands/shared/task-mutation.js +4 -4
  160. package/dist/commands/shared/task-store/intents.d.ts +34 -0
  161. package/dist/commands/shared/task-store/intents.d.ts.map +1 -0
  162. package/dist/commands/shared/task-store/intents.js +265 -0
  163. package/dist/commands/shared/task-store/readme.d.ts +28 -0
  164. package/dist/commands/shared/task-store/readme.d.ts.map +1 -0
  165. package/dist/commands/shared/task-store/readme.js +125 -0
  166. package/dist/commands/shared/task-store/store.d.ts +26 -0
  167. package/dist/commands/shared/task-store/store.d.ts.map +1 -0
  168. package/dist/commands/shared/task-store/store.js +105 -0
  169. package/dist/commands/shared/task-store/types.d.ts +94 -0
  170. package/dist/commands/shared/task-store/types.d.ts.map +1 -0
  171. package/dist/commands/shared/task-store/types.js +1 -0
  172. package/dist/commands/shared/task-store.d.ts +3 -109
  173. package/dist/commands/shared/task-store.d.ts.map +1 -1
  174. package/dist/commands/shared/task-store.js +2 -493
  175. package/dist/commands/task/block.d.ts.map +1 -1
  176. package/dist/commands/task/block.js +7 -2
  177. package/dist/commands/task/comment.d.ts.map +1 -1
  178. package/dist/commands/task/comment.js +7 -2
  179. package/dist/commands/task/finish-shared.d.ts.map +1 -1
  180. package/dist/commands/task/finish-shared.js +3 -3
  181. package/dist/commands/task/finish.d.ts.map +1 -1
  182. package/dist/commands/task/finish.js +102 -15
  183. package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
  184. package/dist/commands/task/hosted-close.command.js +23 -2
  185. package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
  186. package/dist/commands/task/hosted-merge-sync.js +9 -4
  187. package/dist/commands/task/list.run.d.ts.map +1 -1
  188. package/dist/commands/task/list.run.js +14 -4
  189. package/dist/commands/task/new.command.d.ts.map +1 -1
  190. package/dist/commands/task/new.command.js +16 -2
  191. package/dist/commands/task/new.js +2 -2
  192. package/dist/commands/task/show.d.ts.map +1 -1
  193. package/dist/commands/task/show.js +3 -3
  194. package/dist/commands/task/update.d.ts.map +1 -1
  195. package/dist/commands/task/update.js +11 -3
  196. package/dist/runner/adapters/codex.d.ts.map +1 -1
  197. package/dist/runner/adapters/codex.js +3 -33
  198. package/dist/runner/adapters/custom.d.ts.map +1 -1
  199. package/dist/runner/adapters/custom.js +3 -30
  200. package/dist/runner/adapters/runtime-shared.d.ts +14 -0
  201. package/dist/runner/adapters/runtime-shared.d.ts.map +1 -0
  202. package/dist/runner/adapters/runtime-shared.js +36 -0
  203. package/dist/runner/context/base-prompt-sources.d.ts +30 -0
  204. package/dist/runner/context/base-prompt-sources.d.ts.map +1 -0
  205. package/dist/runner/context/base-prompt-sources.js +144 -0
  206. package/dist/runner/context/base-prompts.d.ts +3 -22
  207. package/dist/runner/context/base-prompts.d.ts.map +1 -1
  208. package/dist/runner/context/base-prompts.js +6 -450
  209. package/dist/runner/context/overlay-prompt-blocks.d.ts +7 -0
  210. package/dist/runner/context/overlay-prompt-blocks.d.ts.map +1 -0
  211. package/dist/runner/context/overlay-prompt-blocks.js +72 -0
  212. package/dist/runner/context/prompt-block-shared.d.ts +54 -0
  213. package/dist/runner/context/prompt-block-shared.d.ts.map +1 -0
  214. package/dist/runner/context/prompt-block-shared.js +106 -0
  215. package/dist/runner/context/recipe-context.d.ts +2 -1
  216. package/dist/runner/context/recipe-context.d.ts.map +1 -1
  217. package/dist/runner/context/recipe-context.js +2 -1
  218. package/dist/runner/context/recipe-prompt-blocks.d.ts +6 -0
  219. package/dist/runner/context/recipe-prompt-blocks.d.ts.map +1 -0
  220. package/dist/runner/context/recipe-prompt-blocks.js +143 -0
  221. package/dist/runner/usecases/scenario-materialize-task.js +2 -2
  222. package/dist/runner/usecases/task-run-inspect.js +2 -2
  223. package/dist/runner/usecases/task-run-lifecycle-shared.js +2 -2
  224. package/dist/runner/usecases/task-run.d.ts.map +1 -1
  225. package/dist/runner/usecases/task-run.js +4 -2
  226. package/dist/runtime/capabilities/recipe.d.ts +1 -1
  227. package/dist/runtime/capabilities/recipe.d.ts.map +1 -1
  228. package/dist/runtime/execution-context.d.ts +63 -0
  229. package/dist/runtime/execution-context.d.ts.map +1 -0
  230. package/dist/{usecases/context/resolve-context.js → runtime/execution-context.js} +23 -26
  231. package/dist/runtime/incidents/advice-strategy.d.ts +15 -0
  232. package/dist/runtime/incidents/advice-strategy.d.ts.map +1 -0
  233. package/dist/runtime/incidents/advice-strategy.js +54 -0
  234. package/dist/runtime/incidents/plan-strategy.d.ts +9 -0
  235. package/dist/runtime/incidents/plan-strategy.d.ts.map +1 -0
  236. package/dist/runtime/incidents/plan-strategy.js +205 -0
  237. package/dist/runtime/incidents/registry-strategy.d.ts +6 -0
  238. package/dist/runtime/incidents/registry-strategy.d.ts.map +1 -0
  239. package/dist/runtime/incidents/registry-strategy.js +280 -0
  240. package/dist/runtime/incidents/resolve.d.ts +3 -25
  241. package/dist/runtime/incidents/resolve.d.ts.map +1 -1
  242. package/dist/runtime/incidents/resolve.js +3 -683
  243. package/dist/runtime/incidents/shared.d.ts +34 -0
  244. package/dist/runtime/incidents/shared.d.ts.map +1 -0
  245. package/dist/runtime/incidents/shared.js +171 -0
  246. package/dist/testing/cli-harness/recipe-archives.d.ts +28 -0
  247. package/dist/testing/cli-harness/recipe-archives.d.ts.map +1 -0
  248. package/dist/testing/cli-harness/recipe-archives.js +374 -0
  249. package/dist/testing/cli-harness/stdio.d.ts +26 -0
  250. package/dist/testing/cli-harness/stdio.d.ts.map +1 -0
  251. package/dist/testing/cli-harness/stdio.js +84 -0
  252. package/dist/testing/cli-harness.d.ts +25 -0
  253. package/dist/testing/cli-harness.d.ts.map +1 -0
  254. package/dist/testing/cli-harness.js +313 -0
  255. package/dist/testing/index.d.ts +2 -0
  256. package/dist/testing/index.d.ts.map +1 -0
  257. package/dist/testing/index.js +1 -0
  258. package/package.json +7 -4
  259. package/dist/commands/recipes/impl/manifest.d.ts +0 -4
  260. package/dist/commands/recipes/impl/manifest.d.ts.map +0 -1
  261. package/dist/commands/recipes/impl/manifest.js +0 -7
  262. package/dist/commands/recipes/impl/normalize.d.ts +0 -8
  263. package/dist/commands/recipes/impl/normalize.d.ts.map +0 -1
  264. package/dist/commands/recipes/impl/normalize.js +0 -54
  265. package/dist/commands/recipes/impl/scenario.d.ts +0 -16
  266. package/dist/commands/recipes/impl/scenario.d.ts.map +0 -1
  267. package/dist/commands/recipes/impl/scenario.js +0 -262
  268. package/dist/recipes/bundled-recipes.d.ts +0 -17
  269. package/dist/recipes/bundled-recipes.d.ts.map +0 -1
  270. package/dist/recipes/bundled-recipes.js +0 -15
  271. package/dist/usecases/context/resolve-context.d.ts +0 -68
  272. package/dist/usecases/context/resolve-context.d.ts.map +0 -1
  273. package/dist/usecases/task/task-list-usecase.d.ts +0 -9
  274. package/dist/usecases/task/task-list-usecase.d.ts.map +0 -1
  275. package/dist/usecases/task/task-list-usecase.js +0 -17
  276. package/dist/usecases/task/task-new-usecase.d.ts +0 -9
  277. package/dist/usecases/task/task-new-usecase.d.ts.map +0 -1
  278. package/dist/usecases/task/task-new-usecase.js +0 -17
@@ -0,0 +1,30 @@
1
+ import type { ResolvedExecutionProfileRuntime } from "../../runtime/execution-profile/index.js";
2
+ import type { ResolvedHarnessContract } from "../../runtime/harness/index.js";
3
+ import { type PolicyGatewayFlavor } from "../../shared/policy-gateway.js";
4
+ import type { RunnerPromptBlock } from "../types.js";
5
+ import { type ResolvedPromptSource } from "./prompt-block-shared.js";
6
+ export declare function resolveOwnerProfilePromptSource(opts: {
7
+ git_root: string;
8
+ agents_dir: string;
9
+ owner_id: string;
10
+ }): Promise<ResolvedPromptSource>;
11
+ export declare function loadOwnerProfilePrompt(opts: {
12
+ git_root: string;
13
+ agents_dir: string;
14
+ owner_id: string;
15
+ }): Promise<RunnerPromptBlock>;
16
+ export declare function resolvePolicyGatewayPromptSource(opts: {
17
+ git_root: string;
18
+ fallback_flavor: PolicyGatewayFlavor;
19
+ harness?: ResolvedHarnessContract;
20
+ }): Promise<ResolvedPromptSource>;
21
+ export declare function loadPolicyGatewayPrompt(opts: {
22
+ git_root: string;
23
+ fallback_flavor: PolicyGatewayFlavor;
24
+ harness?: ResolvedHarnessContract;
25
+ }): Promise<RunnerPromptBlock>;
26
+ export declare function loadExecutionProfilePrompt(opts: {
27
+ execution_profile?: ResolvedExecutionProfileRuntime;
28
+ }): RunnerPromptBlock | null;
29
+ export { loadFrameworkRunnerPrompt } from "./prompt-block-shared.js";
30
+ //# sourceMappingURL=base-prompt-sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-prompt-sources.d.ts","sourceRoot":"","sources":["../../../src/runner/context/base-prompt-sources.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAQL,KAAK,oBAAoB,EAE1B,MAAM,0BAA0B,CAAC;AAiBlC,wBAAsB,+BAA+B,CAAC,IAAI,EAAE;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA4ChC;AAED,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAQ7B;AAED,wBAAsB,gCAAgC,CAAC,IAAI,EAAE;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,mBAAmB,CAAC;IACrC,OAAO,CAAC,EAAE,uBAAuB,CAAC;CACnC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAyChC;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,mBAAmB,CAAC;IACrC,OAAO,CAAC,EAAE,uBAAuB,CAAC;CACnC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAQ7B;AAmBD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,iBAAiB,CAAC,EAAE,+BAA+B,CAAC;CACrD,GAAG,iBAAiB,GAAG,IAAI,CAwB3B;AAED,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,144 @@
1
+ import { readFile, readdir } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { loadAgentTemplates, loadPolicyGatewayTemplate } from "../../agents/agents-template.js";
4
+ import { fileExists } from "../../cli/fs-utils.js";
5
+ import { resolveBehavior } from "../../runtime/behavior/index.js";
6
+ import { resolvePolicyGatewayForRepo, } from "../../shared/policy-gateway.js";
7
+ import { BASE_PROMPT_PRIORITIES, normalizeText, promptBlockFromResolved, promptCandidate, toPromptSource, validateJsonPrompt, } from "./prompt-block-shared.js";
8
+ async function resolveRepoAgentProfilePath(opts) {
9
+ const agentsDir = path.join(opts.git_root, opts.agents_dir);
10
+ if (!(await fileExists(agentsDir)))
11
+ return null;
12
+ const entries = await readdir(agentsDir);
13
+ const wanted = `${opts.owner_id}.json`.toLowerCase();
14
+ const match = entries.find((entry) => entry.endsWith(".json") && entry.toLowerCase() === wanted);
15
+ if (!match)
16
+ return null;
17
+ return path.join(agentsDir, match);
18
+ }
19
+ export async function resolveOwnerProfilePromptSource(opts) {
20
+ const candidates = [];
21
+ const repoProfilePath = await resolveRepoAgentProfilePath(opts);
22
+ if (repoProfilePath) {
23
+ const source = toPromptSource(opts.git_root, repoProfilePath);
24
+ candidates.push(promptCandidate({
25
+ layer: "user",
26
+ source,
27
+ value: {
28
+ source,
29
+ title: `Owner Agent Profile (${opts.owner_id})`,
30
+ content: validateJsonPrompt(source, await readFile(repoProfilePath, "utf8")),
31
+ },
32
+ }));
33
+ }
34
+ const bundledFileName = `${opts.owner_id}.json`;
35
+ const bundledTemplates = await loadAgentTemplates();
36
+ const bundled = bundledTemplates.find((entry) => entry.fileName.toLowerCase() === bundledFileName.toLowerCase());
37
+ if (!bundled) {
38
+ throw new Error(`Bundled agent profile not found: ${bundledFileName}`);
39
+ }
40
+ candidates.push(promptCandidate({
41
+ layer: "builtin",
42
+ source: `bundled:agent-profile:${bundled.fileName}`,
43
+ value: {
44
+ source: `bundled:agent-profile:${bundled.fileName}`,
45
+ title: `Owner Agent Profile (${opts.owner_id})`,
46
+ content: validateJsonPrompt(`bundled:agent-profile:${bundled.fileName}`, bundled.contents),
47
+ },
48
+ order: 10,
49
+ }));
50
+ return resolveBehavior({
51
+ key: `runner.owner_profile:${opts.owner_id}`,
52
+ candidates,
53
+ });
54
+ }
55
+ export async function loadOwnerProfilePrompt(opts) {
56
+ const resolved = await resolveOwnerProfilePromptSource(opts);
57
+ return promptBlockFromResolved({
58
+ id: "base.owner_profile",
59
+ role: "profile",
60
+ priority: BASE_PROMPT_PRIORITIES.owner_profile,
61
+ resolved,
62
+ });
63
+ }
64
+ export async function resolvePolicyGatewayPromptSource(opts) {
65
+ const gateway = opts.harness?.repo.policy_gateway ??
66
+ (await resolvePolicyGatewayForRepo({
67
+ gitRoot: opts.git_root,
68
+ fallbackFlavor: opts.fallback_flavor,
69
+ }));
70
+ const candidates = [];
71
+ if (await fileExists(gateway.absPath)) {
72
+ const source = path.relative(opts.git_root, gateway.absPath).replaceAll("\\", "/");
73
+ candidates.push(promptCandidate({
74
+ layer: "harness",
75
+ source,
76
+ value: {
77
+ source,
78
+ title: `Repository Policy Gateway (${gateway.fileName})`,
79
+ content: normalizeText(await readFile(gateway.absPath, "utf8")),
80
+ },
81
+ }));
82
+ }
83
+ candidates.push(promptCandidate({
84
+ layer: "builtin",
85
+ source: `bundled:policy-gateway:${gateway.fileName}`,
86
+ value: {
87
+ source: `bundled:policy-gateway:${gateway.fileName}`,
88
+ title: `Bundled Policy Gateway Fallback (${gateway.fileName})`,
89
+ content: await loadPolicyGatewayTemplate(gateway.flavor),
90
+ },
91
+ order: 10,
92
+ }));
93
+ return resolveBehavior({
94
+ key: `runner.policy_gateway:${gateway.fileName}`,
95
+ candidates,
96
+ });
97
+ }
98
+ export async function loadPolicyGatewayPrompt(opts) {
99
+ const resolved = await resolvePolicyGatewayPromptSource(opts);
100
+ return promptBlockFromResolved({
101
+ id: "base.policy_gateway",
102
+ role: "policy",
103
+ priority: BASE_PROMPT_PRIORITIES.policy_gateway,
104
+ resolved,
105
+ });
106
+ }
107
+ function renderExecutionProfilePromptContent(runtime) {
108
+ return JSON.stringify({
109
+ profile: runtime.profile,
110
+ reasoning_effort: runtime.reasoning_effort,
111
+ budget: runtime.budget,
112
+ approvals: runtime.approvals,
113
+ stop_conditions: runtime.stop_conditions,
114
+ handoff_conditions: runtime.handoff_conditions,
115
+ unsafe_actions_requiring_explicit_user_ok: runtime.unsafe_actions_requiring_explicit_user_ok,
116
+ runner: runtime.runner,
117
+ }, null, 2);
118
+ }
119
+ export function loadExecutionProfilePrompt(opts) {
120
+ if (!opts.execution_profile)
121
+ return null;
122
+ const source = `runtime:execution-profile:${opts.execution_profile.profile}`;
123
+ const resolved = resolveBehavior({
124
+ key: "runner.execution_profile",
125
+ candidates: [
126
+ promptCandidate({
127
+ layer: "harness",
128
+ source,
129
+ value: {
130
+ source,
131
+ title: `Execution Profile Runtime (${opts.execution_profile.profile})`,
132
+ content: normalizeText(renderExecutionProfilePromptContent(opts.execution_profile)),
133
+ },
134
+ }),
135
+ ],
136
+ });
137
+ return promptBlockFromResolved({
138
+ id: "base.execution_profile",
139
+ role: "policy",
140
+ priority: BASE_PROMPT_PRIORITIES.execution_profile,
141
+ resolved,
142
+ });
143
+ }
144
+ export { loadFrameworkRunnerPrompt } from "./prompt-block-shared.js";
@@ -1,36 +1,17 @@
1
- import { type ResolvedBehavior } from "../../runtime/behavior/index.js";
2
- import { type PolicyGatewayFlavor } from "../../shared/policy-gateway.js";
3
1
  import type { ResolvedExecutionProfileRuntime } from "../../runtime/execution-profile/index.js";
4
2
  import type { ResolvedHarnessContract } from "../../runtime/harness/index.js";
5
3
  import type { RunnerPromptBlock, RunnerRecipeContext, RunnerTaskContext } from "../types.js";
6
- type PromptSourcePayload = {
7
- source: string;
8
- title: string;
9
- content: string;
10
- };
11
- type PromptSourceTraceMetadata = {
12
- title: string;
13
- };
14
- type ResolvedPromptSource = ResolvedBehavior<PromptSourcePayload, PromptSourceTraceMetadata>;
15
- export declare function resolveOwnerProfilePromptSource(opts: {
16
- git_root: string;
17
- agents_dir: string;
18
- owner_id: string;
19
- }): Promise<ResolvedPromptSource>;
20
- export declare function resolvePolicyGatewayPromptSource(opts: {
21
- git_root: string;
22
- fallback_flavor: PolicyGatewayFlavor;
23
- harness?: ResolvedHarnessContract;
24
- }): Promise<ResolvedPromptSource>;
4
+ import type { PolicyGatewayFlavor } from "../../shared/policy-gateway.js";
5
+ export { resolveOwnerProfilePromptSource, resolvePolicyGatewayPromptSource, } from "./base-prompt-sources.js";
25
6
  export declare function collectRunnerBasePrompts(opts: {
26
7
  git_root: string;
27
8
  owner_id: string;
28
9
  agents_dir?: string;
29
10
  fallback_policy_gateway_flavor?: PolicyGatewayFlavor;
30
11
  task?: RunnerTaskContext;
12
+ command?: string;
31
13
  recipe?: RunnerRecipeContext;
32
14
  harness?: ResolvedHarnessContract;
33
15
  execution_profile?: ResolvedExecutionProfileRuntime;
34
16
  }): Promise<RunnerPromptBlock[]>;
35
- export {};
36
17
  //# sourceMappingURL=base-prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-prompts.d.ts","sourceRoot":"","sources":["../../../src/runner/context/base-prompts.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KA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