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.
- package/assets/RUNNER.md +1 -1
- package/assets/agents/ORCHESTRATOR.json +1 -1
- package/assets/agents/SKILL_EXTRACTOR.json +31 -0
- package/assets/framework.manifest.json +7 -0
- package/assets/policy/incidents.md +5 -3
- package/assets/policy/workflow.branch_pr.md +10 -5
- package/dist/.build-manifest.json +280 -180
- package/dist/cli/output.d.ts +29 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +33 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +29 -87
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +4 -12
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +16 -38
- package/dist/cli/run-cli/command-catalog/shared.d.ts +9 -6
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +23 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +6 -18
- package/dist/cli/run-cli/command-catalog.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/recipes.js +1 -0
- package/dist/cli/run-cli.js +1 -1
- package/dist/cli/run-cli.test-helpers.d.ts +1 -74
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +1 -769
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +5 -9
- package/dist/commands/branch/work-start.command.d.ts.map +1 -1
- package/dist/commands/branch/work-start.command.js +1 -0
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +2 -0
- package/dist/commands/doctor/branch-pr.d.ts +1 -1
- package/dist/commands/doctor/branch-pr.d.ts.map +1 -1
- package/dist/commands/doctor/branch-pr.js +5 -2
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -1
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +2 -1
- package/dist/commands/guard/impl/env.d.ts +6 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +41 -0
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +2 -1
- package/dist/commands/pr/internal/sync-branch.d.ts +36 -0
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-branch.js +113 -0
- package/dist/commands/pr/internal/sync-github.d.ts +28 -0
- package/dist/commands/pr/internal/sync-github.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-github.js +178 -0
- package/dist/commands/pr/internal/sync-model.d.ts +36 -0
- package/dist/commands/pr/internal/sync-model.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-model.js +1 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts +10 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-open-step.js +128 -0
- package/dist/commands/pr/internal/sync-support.d.ts +7 -0
- package/dist/commands/pr/internal/sync-support.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-support.js +29 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts +6 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-update-step.js +68 -0
- package/dist/commands/pr/internal/sync.d.ts +2 -6
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +83 -529
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +25 -8
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +7 -2
- package/dist/commands/recipes/impl/apply.d.ts +1 -1
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +1 -2
- package/dist/commands/recipes/impl/commands/active.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/active.js +6 -5
- package/dist/commands/recipes/impl/commands/add.d.ts +1 -0
- package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/add.js +32 -27
- package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/detach.js +35 -21
- package/dist/commands/recipes/impl/commands/disable.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/disable.js +5 -3
- package/dist/commands/recipes/impl/commands/enable.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/enable.js +5 -3
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +57 -47
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +25 -21
- package/dist/commands/recipes/impl/commands/install.d.ts +1 -1
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +3 -13
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.js +2 -3
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list.js +7 -6
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +12 -7
- package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/update.js +38 -24
- package/dist/commands/recipes/impl/index.d.ts +1 -1
- package/dist/commands/recipes/impl/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.js +1 -2
- package/dist/commands/recipes/impl/mutation-transaction.d.ts +7 -0
- package/dist/commands/recipes/impl/mutation-transaction.d.ts.map +1 -0
- package/dist/commands/recipes/impl/mutation-transaction.js +47 -0
- package/dist/commands/recipes/impl/overlay-project.d.ts +19 -3
- package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -1
- package/dist/commands/recipes/impl/overlay-project.js +76 -38
- package/dist/commands/recipes/impl/paths.d.ts +0 -3
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +0 -3
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +4 -1
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.js +6 -4
- package/dist/commands/recipes/impl/project-recipe-state.d.ts +1 -1
- package/dist/commands/recipes/impl/project-recipe-state.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-registry.d.ts +5 -1
- package/dist/commands/recipes/impl/project-registry.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-registry.js +34 -14
- package/dist/commands/recipes/impl/resolver.d.ts +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
- package/dist/commands/recipes/impl/resolver.js +1 -1
- package/dist/commands/recipes/impl/types.d.ts +1 -1
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/impl/version.d.ts +5 -0
- package/dist/commands/recipes/impl/version.d.ts.map +1 -0
- package/dist/commands/recipes/impl/version.js +9 -0
- package/dist/commands/recipes.d.ts +5 -4
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +3 -3
- package/dist/commands/release/apply.command.d.ts +1 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +15 -379
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +24 -1
- package/dist/commands/release/apply.pipeline.d.ts +22 -0
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline.js +371 -0
- package/dist/commands/release/apply.preflight.d.ts +2 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +13 -4
- package/dist/commands/release/apply.types.d.ts +27 -0
- package/dist/commands/release/apply.types.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.d.ts +4 -0
- package/dist/commands/release.test-helpers.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.js +7 -0
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +2 -2
- package/dist/commands/shared/task-backend.d.ts +6 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -2
- package/dist/commands/shared/task-mutation.d.ts.map +1 -1
- package/dist/commands/shared/task-mutation.js +4 -4
- package/dist/commands/shared/task-store/intents.d.ts +34 -0
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -0
- package/dist/commands/shared/task-store/intents.js +265 -0
- package/dist/commands/shared/task-store/readme.d.ts +28 -0
- package/dist/commands/shared/task-store/readme.d.ts.map +1 -0
- package/dist/commands/shared/task-store/readme.js +125 -0
- package/dist/commands/shared/task-store/store.d.ts +26 -0
- package/dist/commands/shared/task-store/store.d.ts.map +1 -0
- package/dist/commands/shared/task-store/store.js +105 -0
- package/dist/commands/shared/task-store/types.d.ts +94 -0
- package/dist/commands/shared/task-store/types.d.ts.map +1 -0
- package/dist/commands/shared/task-store/types.js +1 -0
- package/dist/commands/shared/task-store.d.ts +3 -109
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +2 -493
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +7 -2
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +7 -2
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +3 -3
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +102 -15
- package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close.command.js +23 -2
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +9 -4
- package/dist/commands/task/list.run.d.ts.map +1 -1
- package/dist/commands/task/list.run.js +14 -4
- package/dist/commands/task/new.command.d.ts.map +1 -1
- package/dist/commands/task/new.command.js +16 -2
- package/dist/commands/task/new.js +2 -2
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +3 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +11 -3
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +3 -33
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +3 -30
- package/dist/runner/adapters/runtime-shared.d.ts +14 -0
- package/dist/runner/adapters/runtime-shared.d.ts.map +1 -0
- package/dist/runner/adapters/runtime-shared.js +36 -0
- package/dist/runner/context/base-prompt-sources.d.ts +30 -0
- package/dist/runner/context/base-prompt-sources.d.ts.map +1 -0
- package/dist/runner/context/base-prompt-sources.js +144 -0
- package/dist/runner/context/base-prompts.d.ts +3 -22
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +6 -450
- package/dist/runner/context/overlay-prompt-blocks.d.ts +7 -0
- package/dist/runner/context/overlay-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/overlay-prompt-blocks.js +72 -0
- package/dist/runner/context/prompt-block-shared.d.ts +54 -0
- package/dist/runner/context/prompt-block-shared.d.ts.map +1 -0
- package/dist/runner/context/prompt-block-shared.js +106 -0
- package/dist/runner/context/recipe-context.d.ts +2 -1
- package/dist/runner/context/recipe-context.d.ts.map +1 -1
- package/dist/runner/context/recipe-context.js +2 -1
- package/dist/runner/context/recipe-prompt-blocks.d.ts +6 -0
- package/dist/runner/context/recipe-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/recipe-prompt-blocks.js +143 -0
- package/dist/runner/usecases/scenario-materialize-task.js +2 -2
- package/dist/runner/usecases/task-run-inspect.js +2 -2
- package/dist/runner/usecases/task-run-lifecycle-shared.js +2 -2
- package/dist/runner/usecases/task-run.d.ts.map +1 -1
- package/dist/runner/usecases/task-run.js +4 -2
- package/dist/runtime/capabilities/recipe.d.ts +1 -1
- package/dist/runtime/capabilities/recipe.d.ts.map +1 -1
- package/dist/runtime/execution-context.d.ts +63 -0
- package/dist/runtime/execution-context.d.ts.map +1 -0
- package/dist/{usecases/context/resolve-context.js → runtime/execution-context.js} +23 -26
- package/dist/runtime/incidents/advice-strategy.d.ts +15 -0
- package/dist/runtime/incidents/advice-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/advice-strategy.js +54 -0
- package/dist/runtime/incidents/plan-strategy.d.ts +9 -0
- package/dist/runtime/incidents/plan-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/plan-strategy.js +205 -0
- package/dist/runtime/incidents/registry-strategy.d.ts +6 -0
- package/dist/runtime/incidents/registry-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/registry-strategy.js +280 -0
- package/dist/runtime/incidents/resolve.d.ts +3 -25
- package/dist/runtime/incidents/resolve.d.ts.map +1 -1
- package/dist/runtime/incidents/resolve.js +3 -683
- package/dist/runtime/incidents/shared.d.ts +34 -0
- package/dist/runtime/incidents/shared.d.ts.map +1 -0
- package/dist/runtime/incidents/shared.js +171 -0
- package/dist/testing/cli-harness/recipe-archives.d.ts +28 -0
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +1 -0
- package/dist/testing/cli-harness/recipe-archives.js +374 -0
- package/dist/testing/cli-harness/stdio.d.ts +26 -0
- package/dist/testing/cli-harness/stdio.d.ts.map +1 -0
- package/dist/testing/cli-harness/stdio.js +84 -0
- package/dist/testing/cli-harness.d.ts +25 -0
- package/dist/testing/cli-harness.d.ts.map +1 -0
- package/dist/testing/cli-harness.js +313 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +1 -0
- package/package.json +7 -4
- package/dist/commands/recipes/impl/manifest.d.ts +0 -4
- package/dist/commands/recipes/impl/manifest.d.ts.map +0 -1
- package/dist/commands/recipes/impl/manifest.js +0 -7
- package/dist/commands/recipes/impl/normalize.d.ts +0 -8
- package/dist/commands/recipes/impl/normalize.d.ts.map +0 -1
- package/dist/commands/recipes/impl/normalize.js +0 -54
- package/dist/commands/recipes/impl/scenario.d.ts +0 -16
- package/dist/commands/recipes/impl/scenario.d.ts.map +0 -1
- package/dist/commands/recipes/impl/scenario.js +0 -262
- package/dist/recipes/bundled-recipes.d.ts +0 -17
- package/dist/recipes/bundled-recipes.d.ts.map +0 -1
- package/dist/recipes/bundled-recipes.js +0 -15
- package/dist/usecases/context/resolve-context.d.ts +0 -68
- package/dist/usecases/context/resolve-context.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.d.ts +0 -9
- package/dist/usecases/task/task-list-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.js +0 -17
- package/dist/usecases/task/task-new-usecase.d.ts +0 -9
- package/dist/usecases/task/task-new-usecase.d.ts.map +0 -1
- 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
|
|
7
|
-
|
|
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":"
|
|
1
|
+
{"version":3,"file":"base-prompts.d.ts","sourceRoot":"","sources":["../../../src/runner/context/base-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAS9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,0BAA0B,CAAC;AAElC,wBAAsB,wBAAwB,CAAC,IAAI,EAAE;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8BAA8B,CAAC,EAAE,mBAAmB,CAAC;IACrD,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC,iBAAiB,CAAC,EAAE,+BAA+B,CAAC;CACrD,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAqC/B"}
|