agentplane 0.3.9 → 0.3.10
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/AGENTS.md +4 -2
- package/assets/agents/CODER.json +1 -1
- package/assets/policy/dod.core.md +1 -1
- package/assets/policy/governance.md +3 -0
- package/assets/policy/incidents.md +22 -11
- package/assets/policy/workflow.branch_pr.md +2 -0
- package/assets/policy/workflow.direct.md +3 -1
- package/dist/.build-manifest.json +305 -110
- package/dist/cli/bootstrap-guide.d.ts +1 -0
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +19 -1
- package/dist/cli/command-invocations.d.ts.map +1 -1
- package/dist/cli/command-invocations.js +2 -0
- package/dist/cli/command-snippets.d.ts +2 -0
- package/dist/cli/command-snippets.d.ts.map +1 -1
- package/dist/cli/command-snippets.js +2 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +10 -0
- 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/config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/config.js +13 -0
- package/dist/cli/run-cli.js +2 -2
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +4 -0
- package/dist/commands/incidents/advise.command.d.ts +15 -0
- package/dist/commands/incidents/advise.command.d.ts.map +1 -0
- package/dist/commands/incidents/advise.command.js +139 -0
- package/dist/commands/incidents/collect.command.d.ts +11 -0
- package/dist/commands/incidents/collect.command.d.ts.map +1 -0
- package/dist/commands/incidents/collect.command.js +67 -0
- package/dist/commands/incidents/incidents.command.d.ts +5 -0
- package/dist/commands/incidents/incidents.command.d.ts.map +1 -0
- package/dist/commands/incidents/incidents.command.js +21 -0
- package/dist/commands/incidents/shared.d.ts +42 -0
- package/dist/commands/incidents/shared.d.ts.map +1 -0
- package/dist/commands/incidents/shared.js +107 -0
- package/dist/commands/pr/check.d.ts.map +1 -1
- package/dist/commands/pr/check.js +73 -2
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +4 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts +4 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/merge.js +23 -2
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +26 -1
- package/dist/commands/pr/internal/note-store.d.ts +18 -0
- package/dist/commands/pr/internal/note-store.d.ts.map +1 -0
- package/dist/commands/pr/internal/note-store.js +66 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +3 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -1
- package/dist/commands/pr/internal/pr-paths.js +3 -0
- package/dist/commands/pr/internal/review-template.d.ts +24 -4
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -1
- package/dist/commands/pr/internal/review-template.js +188 -33
- package/dist/commands/pr/internal/sync.d.ts +32 -0
- package/dist/commands/pr/internal/sync.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync.js +258 -0
- package/dist/commands/pr/note.d.ts.map +1 -1
- package/dist/commands/pr/note.js +37 -4
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +7 -54
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +6 -3
- package/dist/commands/pr/update.d.ts.map +1 -1
- package/dist/commands/pr/update.js +5 -79
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/cache-prune.js +14 -0
- package/dist/commands/recipes/impl/commands/install.js +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.js +1 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +9 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +9 -0
- package/dist/commands/shared/approval-requirements.d.ts +5 -7
- package/dist/commands/shared/approval-requirements.d.ts.map +1 -1
- package/dist/commands/shared/approval-requirements.js +3 -73
- package/dist/commands/shared/network-approval.d.ts +2 -0
- package/dist/commands/shared/network-approval.d.ts.map +1 -1
- package/dist/commands/shared/network-approval.js +1 -1
- package/dist/commands/shared/pr-meta.d.ts +9 -0
- package/dist/commands/shared/pr-meta.d.ts.map +1 -1
- package/dist/commands/shared/pr-meta.js +27 -3
- package/dist/commands/shared/task-backend.d.ts +2 -0
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-local-freshness.d.ts +13 -0
- package/dist/commands/shared/task-local-freshness.d.ts.map +1 -0
- package/dist/commands/shared/task-local-freshness.js +20 -0
- package/dist/commands/shared/task-mutation.d.ts +2 -0
- package/dist/commands/shared/task-mutation.d.ts.map +1 -1
- package/dist/commands/shared/task-mutation.js +7 -0
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +1 -0
- package/dist/commands/task/close-shared.d.ts.map +1 -1
- package/dist/commands/task/close-shared.js +1 -0
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +5 -2
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +24 -0
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +69 -29
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +1 -0
- package/dist/commands/task/shared/transition-command.d.ts +2 -0
- package/dist/commands/task/shared/transition-command.d.ts.map +1 -1
- package/dist/commands/task/shared/transition-command.js +1 -0
- package/dist/commands/task/start-ready.d.ts.map +1 -1
- package/dist/commands/task/start-ready.js +12 -1
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +11 -0
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +27 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +6 -1
- package/dist/policy/engine.d.ts +3 -1
- package/dist/policy/engine.d.ts.map +1 -1
- package/dist/policy/engine.js +5 -6
- package/dist/policy/taxonomy.d.ts +17 -0
- package/dist/policy/taxonomy.d.ts.map +1 -0
- package/dist/policy/taxonomy.js +302 -0
- package/dist/policy/types.d.ts +2 -1
- package/dist/policy/types.d.ts.map +1 -1
- package/dist/runner/artifacts.d.ts.map +1 -1
- package/dist/runner/artifacts.js +2 -0
- package/dist/runner/context/base-prompts.d.ts +25 -0
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +182 -54
- package/dist/runner/context/recipe-context.d.ts.map +1 -1
- package/dist/runner/context/recipe-context.js +5 -0
- package/dist/runner/types.d.ts +12 -0
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/usecases/scenario-materialize-task.d.ts.map +1 -1
- package/dist/runner/usecases/scenario-materialize-task.js +81 -11
- package/dist/runner/usecases/task-run-inspect.d.ts.map +1 -1
- package/dist/runner/usecases/task-run-inspect.js +9 -7
- package/dist/runner/usecases/task-run-lifecycle-shared.d.ts.map +1 -1
- package/dist/runner/usecases/task-run-lifecycle-shared.js +8 -6
- package/dist/runner/usecases/task-run.d.ts.map +1 -1
- package/dist/runner/usecases/task-run.js +59 -12
- package/dist/runtime/approvals/index.d.ts +3 -0
- package/dist/runtime/approvals/index.d.ts.map +1 -0
- package/dist/runtime/approvals/index.js +1 -0
- package/dist/runtime/approvals/runtime.d.ts +12 -0
- package/dist/runtime/approvals/runtime.d.ts.map +1 -0
- package/dist/runtime/approvals/runtime.js +154 -0
- package/dist/runtime/approvals/types.d.ts +31 -0
- package/dist/runtime/approvals/types.d.ts.map +1 -0
- package/dist/runtime/approvals/types.js +1 -0
- package/dist/runtime/behavior/index.d.ts +3 -0
- package/dist/runtime/behavior/index.d.ts.map +1 -0
- package/dist/runtime/behavior/index.js +1 -0
- package/dist/runtime/behavior/resolve.d.ts +7 -0
- package/dist/runtime/behavior/resolve.d.ts.map +1 -0
- package/dist/runtime/behavior/resolve.js +66 -0
- package/dist/runtime/behavior/types.d.ts +25 -0
- package/dist/runtime/behavior/types.d.ts.map +1 -0
- package/dist/runtime/behavior/types.js +1 -0
- package/dist/runtime/capabilities/backend.d.ts +7 -0
- package/dist/runtime/capabilities/backend.d.ts.map +1 -0
- package/dist/runtime/capabilities/backend.js +104 -0
- package/dist/runtime/capabilities/index.d.ts +6 -0
- package/dist/runtime/capabilities/index.d.ts.map +1 -0
- package/dist/runtime/capabilities/index.js +4 -0
- package/dist/runtime/capabilities/recipe.d.ts +10 -0
- package/dist/runtime/capabilities/recipe.d.ts.map +1 -0
- package/dist/runtime/capabilities/recipe.js +123 -0
- package/dist/runtime/capabilities/registry.d.ts +6 -0
- package/dist/runtime/capabilities/registry.d.ts.map +1 -0
- package/dist/runtime/capabilities/registry.js +69 -0
- package/dist/runtime/capabilities/runner.d.ts +8 -0
- package/dist/runtime/capabilities/runner.d.ts.map +1 -0
- package/dist/runtime/capabilities/runner.js +73 -0
- package/dist/runtime/capabilities/types.d.ts +28 -0
- package/dist/runtime/capabilities/types.d.ts.map +1 -0
- package/dist/runtime/capabilities/types.js +1 -0
- package/dist/runtime/execution-profile/index.d.ts +3 -0
- package/dist/runtime/execution-profile/index.d.ts.map +1 -0
- package/dist/runtime/execution-profile/index.js +1 -0
- package/dist/runtime/execution-profile/resolve.d.ts +9 -0
- package/dist/runtime/execution-profile/resolve.d.ts.map +1 -0
- package/dist/runtime/execution-profile/resolve.js +80 -0
- package/dist/runtime/execution-profile/types.d.ts +27 -0
- package/dist/runtime/execution-profile/types.d.ts.map +1 -0
- package/dist/runtime/execution-profile/types.js +1 -0
- package/dist/runtime/explain/index.d.ts +3 -0
- package/dist/runtime/explain/index.d.ts.map +1 -0
- package/dist/runtime/explain/index.js +1 -0
- package/dist/runtime/explain/resolve.d.ts +14 -0
- package/dist/runtime/explain/resolve.d.ts.map +1 -0
- package/dist/runtime/explain/resolve.js +50 -0
- package/dist/runtime/explain/types.d.ts +28 -0
- package/dist/runtime/explain/types.d.ts.map +1 -0
- package/dist/runtime/explain/types.js +1 -0
- package/dist/runtime/harness/index.d.ts +4 -0
- package/dist/runtime/harness/index.d.ts.map +1 -0
- package/dist/runtime/harness/index.js +2 -0
- package/dist/runtime/harness/resolve-from-command-context.d.ts +4 -0
- package/dist/runtime/harness/resolve-from-command-context.d.ts.map +1 -0
- package/dist/runtime/harness/resolve-from-command-context.js +11 -0
- package/dist/runtime/harness/resolve.d.ts +13 -0
- package/dist/runtime/harness/resolve.d.ts.map +1 -0
- package/dist/runtime/harness/resolve.js +146 -0
- package/dist/runtime/harness/types.d.ts +65 -0
- package/dist/runtime/harness/types.d.ts.map +1 -0
- package/dist/runtime/harness/types.js +1 -0
- package/dist/runtime/incidents/index.d.ts +3 -0
- package/dist/runtime/incidents/index.d.ts.map +1 -0
- package/dist/runtime/incidents/index.js +1 -0
- package/dist/runtime/incidents/resolve.d.ts +26 -0
- package/dist/runtime/incidents/resolve.d.ts.map +1 -0
- package/dist/runtime/incidents/resolve.js +437 -0
- package/dist/runtime/incidents/types.d.ts +72 -0
- package/dist/runtime/incidents/types.d.ts.map +1 -0
- package/dist/runtime/incidents/types.js +1 -0
- package/dist/runtime/protocol/index.d.ts +3 -0
- package/dist/runtime/protocol/index.d.ts.map +1 -0
- package/dist/runtime/protocol/index.js +2 -0
- package/dist/runtime/protocol/resolve.d.ts +16 -0
- package/dist/runtime/protocol/resolve.d.ts.map +1 -0
- package/dist/runtime/protocol/resolve.js +36 -0
- package/dist/runtime/protocol/types.d.ts +36 -0
- package/dist/runtime/protocol/types.d.ts.map +1 -0
- package/dist/runtime/protocol/types.js +1 -0
- package/dist/runtime/task-intake/index.d.ts +3 -0
- package/dist/runtime/task-intake/index.d.ts.map +1 -0
- package/dist/runtime/task-intake/index.js +1 -0
- package/dist/runtime/task-intake/resolve.d.ts +48 -0
- package/dist/runtime/task-intake/resolve.d.ts.map +1 -0
- package/dist/runtime/task-intake/resolve.js +316 -0
- package/dist/runtime/task-intake/types.d.ts +117 -0
- package/dist/runtime/task-intake/types.d.ts.map +1 -0
- package/dist/runtime/task-intake/types.js +1 -0
- package/dist/shared/protected-paths.d.ts +4 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +4 -4
- package/dist/usecases/context/resolve-context.d.ts +55 -6
- package/dist/usecases/context/resolve-context.d.ts.map +1 -1
- package/dist/usecases/context/resolve-context.js +96 -6
- package/dist/usecases/task/task-list-usecase.d.ts.map +1 -1
- package/dist/usecases/task/task-list-usecase.js +8 -2
- package/dist/usecases/task/task-new-usecase.js +4 -4
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { resolveHarnessContract } from "./resolve.js";
|
|
2
|
+
export async function resolveHarnessFromCommandContext(ctx) {
|
|
3
|
+
ctx.memo.harness ??= resolveHarnessContract({
|
|
4
|
+
project: ctx.resolvedProject,
|
|
5
|
+
config: ctx.config,
|
|
6
|
+
backendId: ctx.backendId,
|
|
7
|
+
backendConfigPath: ctx.backendConfigPath,
|
|
8
|
+
backendCapabilities: ctx.taskBackend.capabilities,
|
|
9
|
+
});
|
|
10
|
+
return await ctx.memo.harness;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AgentplaneConfig, type ResolvedProject } from "@agentplaneorg/core";
|
|
2
|
+
import type { TaskBackendCapabilities } from "../../backends/task-backend.js";
|
|
3
|
+
import { type PolicyGatewayFlavor } from "../../shared/policy-gateway.js";
|
|
4
|
+
import type { ResolvedHarnessContract } from "./types.js";
|
|
5
|
+
export declare function resolveHarnessContract(opts: {
|
|
6
|
+
project: ResolvedProject;
|
|
7
|
+
config: AgentplaneConfig;
|
|
8
|
+
backendId: string;
|
|
9
|
+
backendConfigPath: string;
|
|
10
|
+
backendCapabilities?: TaskBackendCapabilities | null;
|
|
11
|
+
fallbackPolicyGatewayFlavor?: PolicyGatewayFlavor;
|
|
12
|
+
}): Promise<ResolvedHarnessContract>;
|
|
13
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/runtime/harness/resolve.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAC;AAQxC,OAAO,KAAK,EAEV,uBAAuB,EAGxB,MAAM,YAAY,CAAC;AA+FpB,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACrD,2BAA2B,CAAC,EAAE,mBAAmB,CAAC;CACnD,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAkFnC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { applyExecutionToApprovals, } from "@agentplaneorg/core";
|
|
3
|
+
import { normalizeGitPathPrefix } from "../../shared/git-path.js";
|
|
4
|
+
import { resolvePolicyGatewayForRepo, } from "../../shared/policy-gateway.js";
|
|
5
|
+
import { CI_PATH_PREFIXES, CONFIG_PATH_PREFIXES, HOOK_PATH_PREFIXES, POLICY_PATH_PREFIXES, } from "../../shared/protected-paths.js";
|
|
6
|
+
function source(id, detail) {
|
|
7
|
+
return { id, detail };
|
|
8
|
+
}
|
|
9
|
+
function mergeSourceRefs(...groups) {
|
|
10
|
+
const out = [];
|
|
11
|
+
const seen = new Set();
|
|
12
|
+
for (const group of groups) {
|
|
13
|
+
for (const entry of group) {
|
|
14
|
+
const key = `${entry.id}:${entry.detail}`;
|
|
15
|
+
if (seen.has(key))
|
|
16
|
+
continue;
|
|
17
|
+
seen.add(key);
|
|
18
|
+
out.push(entry);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return out;
|
|
22
|
+
}
|
|
23
|
+
function mergePathPrefixes(...groups) {
|
|
24
|
+
const out = [];
|
|
25
|
+
const seen = new Set();
|
|
26
|
+
for (const group of groups) {
|
|
27
|
+
for (const candidate of group) {
|
|
28
|
+
const normalized = normalizeGitPathPrefix(candidate);
|
|
29
|
+
if (!normalized || seen.has(normalized))
|
|
30
|
+
continue;
|
|
31
|
+
seen.add(normalized);
|
|
32
|
+
out.push(normalized);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return out.toSorted((left, right) => left.localeCompare(right));
|
|
36
|
+
}
|
|
37
|
+
function backendRestrictions(capabilities) {
|
|
38
|
+
return {
|
|
39
|
+
canonical_source: capabilities?.canonical_source ?? "local",
|
|
40
|
+
projection: capabilities?.projection ?? "canonical",
|
|
41
|
+
projection_read_mode: capabilities?.projection_read_mode ?? "native",
|
|
42
|
+
reads_from_projection_by_default: capabilities?.reads_from_projection_by_default ?? false,
|
|
43
|
+
writes_task_readmes: capabilities?.writes_task_readmes ?? false,
|
|
44
|
+
supports_task_revisions: capabilities?.supports_task_revisions ?? false,
|
|
45
|
+
supports_revision_guarded_writes: capabilities?.supports_revision_guarded_writes ?? false,
|
|
46
|
+
may_access_network_on_read: capabilities?.may_access_network_on_read ?? false,
|
|
47
|
+
may_access_network_on_write: capabilities?.may_access_network_on_write ?? false,
|
|
48
|
+
supports_projection_refresh: capabilities?.supports_projection_refresh ?? false,
|
|
49
|
+
supports_push_sync: capabilities?.supports_push_sync ?? false,
|
|
50
|
+
supports_snapshot_export: capabilities?.supports_snapshot_export ?? false,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function resolveProtectedPaths(opts) {
|
|
54
|
+
const builtinSource = source("builtin", "shared protected path defaults");
|
|
55
|
+
const configSource = source("config", ".agentplane/config.json");
|
|
56
|
+
const gatewaySource = source("policy_gateway", opts.policyGatewayFileName);
|
|
57
|
+
const backendSource = source("backend", opts.backendConfigPath);
|
|
58
|
+
const tasks = mergePathPrefixes([opts.config.paths.tasks_path, opts.config.paths.workflow_dir]);
|
|
59
|
+
const policy = mergePathPrefixes([...POLICY_PATH_PREFIXES], [opts.policyGatewayFileName, opts.config.paths.agents_dir]);
|
|
60
|
+
const backendConfigDir = normalizeGitPathPrefix(path.dirname(opts.backendConfigPath));
|
|
61
|
+
const config = mergePathPrefixes([...CONFIG_PATH_PREFIXES], [opts.backendConfigPath, backendConfigDir]);
|
|
62
|
+
const hooks = mergePathPrefixes([...HOOK_PATH_PREFIXES]);
|
|
63
|
+
const ci = mergePathPrefixes([...CI_PATH_PREFIXES]);
|
|
64
|
+
return {
|
|
65
|
+
groups: { tasks, policy, config, hooks, ci },
|
|
66
|
+
trace: mergeSourceRefs(tasks.length > 0 ? [configSource] : [], policy.length > 0 ? [builtinSource, gatewaySource, configSource] : [], config.length > 0 ? [builtinSource, backendSource] : [], hooks.length > 0 ? [builtinSource] : [], ci.length > 0 ? [builtinSource] : []),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function gatewaySource(fileName) {
|
|
70
|
+
return source("policy_gateway", fileName);
|
|
71
|
+
}
|
|
72
|
+
export async function resolveHarnessContract(opts) {
|
|
73
|
+
const policyGateway = await resolvePolicyGatewayForRepo({
|
|
74
|
+
gitRoot: opts.project.gitRoot,
|
|
75
|
+
fallbackFlavor: opts.fallbackPolicyGatewayFlavor,
|
|
76
|
+
});
|
|
77
|
+
const approvals = applyExecutionToApprovals({
|
|
78
|
+
execution: opts.config.execution,
|
|
79
|
+
approvals: opts.config.agents?.approvals ?? {
|
|
80
|
+
require_plan: false,
|
|
81
|
+
require_network: false,
|
|
82
|
+
require_verify: false,
|
|
83
|
+
require_force: false,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
const protectedPaths = resolveProtectedPaths({
|
|
87
|
+
config: opts.config,
|
|
88
|
+
policyGatewayFileName: policyGateway.fileName,
|
|
89
|
+
backendConfigPath: opts.backendConfigPath,
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
repo: {
|
|
93
|
+
...opts.project,
|
|
94
|
+
policy_gateway: policyGateway,
|
|
95
|
+
tasks_backend_config_path: opts.backendConfigPath,
|
|
96
|
+
},
|
|
97
|
+
workflow: {
|
|
98
|
+
mode: opts.config.workflow_mode,
|
|
99
|
+
status_commit_policy: opts.config.status_commit_policy,
|
|
100
|
+
finish_auto_status_commit: opts.config.finish_auto_status_commit,
|
|
101
|
+
task_prefix: opts.config.branch.task_prefix,
|
|
102
|
+
paths: structuredClone(opts.config.paths),
|
|
103
|
+
},
|
|
104
|
+
task: {
|
|
105
|
+
doc_sections: [...opts.config.tasks.doc.sections],
|
|
106
|
+
required_doc_sections: [...opts.config.tasks.doc.required_sections],
|
|
107
|
+
verify_required_tags: [...opts.config.tasks.verify.required_tags],
|
|
108
|
+
verify_steps_required_tags: [...(opts.config.tasks.verify.require_steps_for_tags ?? [])],
|
|
109
|
+
verify_steps_required_primary: [
|
|
110
|
+
...(opts.config.tasks.verify.require_steps_for_primary ?? []),
|
|
111
|
+
],
|
|
112
|
+
verification_required_primary: [
|
|
113
|
+
...(opts.config.tasks.verify.require_verification_for_primary ?? []),
|
|
114
|
+
],
|
|
115
|
+
spike_tag: opts.config.tasks.verify.spike_tag,
|
|
116
|
+
enforce_verify_steps_on_plan_approve: opts.config.tasks.verify.enforce_on_plan_approve,
|
|
117
|
+
enforce_verify_steps_on_start_without_plan: opts.config.tasks.verify.enforce_on_start_when_no_plan,
|
|
118
|
+
comments: structuredClone(opts.config.tasks.comments),
|
|
119
|
+
closure_commit_requires_approval: opts.config.closure_commit_requires_approval,
|
|
120
|
+
},
|
|
121
|
+
policy: {
|
|
122
|
+
approvals,
|
|
123
|
+
unsafe_actions_requiring_explicit_user_ok: [
|
|
124
|
+
...opts.config.execution.unsafe_actions_requiring_explicit_user_ok,
|
|
125
|
+
],
|
|
126
|
+
protected_paths: protectedPaths.groups,
|
|
127
|
+
},
|
|
128
|
+
execution: structuredClone(opts.config.execution),
|
|
129
|
+
backend: {
|
|
130
|
+
id: opts.backendId,
|
|
131
|
+
config_path: opts.backendConfigPath,
|
|
132
|
+
capabilities: opts.backendCapabilities ? structuredClone(opts.backendCapabilities) : null,
|
|
133
|
+
restrictions: backendRestrictions(opts.backendCapabilities),
|
|
134
|
+
},
|
|
135
|
+
trace: {
|
|
136
|
+
repo: [source("project", opts.project.gitRoot)],
|
|
137
|
+
workflow: [source("config", ".agentplane/config.json")],
|
|
138
|
+
task_contract: [source("config", ".agentplane/config.json")],
|
|
139
|
+
policy_gateway: [gatewaySource(policyGateway.fileName)],
|
|
140
|
+
approval_requirements: mergeSourceRefs([source("config", ".agentplane/config.json")], [source("execution_profile", opts.config.execution.profile)]),
|
|
141
|
+
protected_paths: protectedPaths.trace,
|
|
142
|
+
execution: [source("config", ".agentplane/config.json")],
|
|
143
|
+
backend: mergeSourceRefs([source("backend", opts.backendId)], [source("config", opts.backendConfigPath)]),
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ApprovalSettings, AgentplaneConfig, ResolvedProject } from "@agentplaneorg/core";
|
|
2
|
+
import type { TaskBackendCapabilities } from "../../backends/task-backend.js";
|
|
3
|
+
import type { ProtectedPathKind } from "../../shared/protected-paths.js";
|
|
4
|
+
import type { PolicyGatewayResolution } from "../../shared/policy-gateway.js";
|
|
5
|
+
export type HarnessSourceId = "builtin" | "project" | "config" | "execution_profile" | "policy_gateway" | "backend";
|
|
6
|
+
export type HarnessSourceRef = {
|
|
7
|
+
id: HarnessSourceId;
|
|
8
|
+
detail: string;
|
|
9
|
+
};
|
|
10
|
+
export type HarnessTraceField = "repo" | "workflow" | "task_contract" | "policy_gateway" | "approval_requirements" | "protected_paths" | "execution" | "backend";
|
|
11
|
+
export type ResolvedProtectedPathGroups = Record<ProtectedPathKind, string[]>;
|
|
12
|
+
export type ResolvedHarnessTrace = Record<HarnessTraceField, HarnessSourceRef[]>;
|
|
13
|
+
export type ResolvedHarnessContract = {
|
|
14
|
+
repo: ResolvedProject & {
|
|
15
|
+
policy_gateway: PolicyGatewayResolution;
|
|
16
|
+
tasks_backend_config_path: string;
|
|
17
|
+
};
|
|
18
|
+
workflow: {
|
|
19
|
+
mode: AgentplaneConfig["workflow_mode"];
|
|
20
|
+
status_commit_policy: AgentplaneConfig["status_commit_policy"];
|
|
21
|
+
finish_auto_status_commit: boolean;
|
|
22
|
+
task_prefix: string;
|
|
23
|
+
paths: AgentplaneConfig["paths"];
|
|
24
|
+
};
|
|
25
|
+
task: {
|
|
26
|
+
doc_sections: string[];
|
|
27
|
+
required_doc_sections: string[];
|
|
28
|
+
verify_required_tags: string[];
|
|
29
|
+
verify_steps_required_tags: string[];
|
|
30
|
+
verify_steps_required_primary: string[];
|
|
31
|
+
verification_required_primary: string[];
|
|
32
|
+
spike_tag: string;
|
|
33
|
+
enforce_verify_steps_on_plan_approve: boolean;
|
|
34
|
+
enforce_verify_steps_on_start_without_plan: boolean;
|
|
35
|
+
comments: AgentplaneConfig["tasks"]["comments"];
|
|
36
|
+
closure_commit_requires_approval: boolean;
|
|
37
|
+
};
|
|
38
|
+
policy: {
|
|
39
|
+
approvals: Required<ApprovalSettings>;
|
|
40
|
+
unsafe_actions_requiring_explicit_user_ok: string[];
|
|
41
|
+
protected_paths: ResolvedProtectedPathGroups;
|
|
42
|
+
};
|
|
43
|
+
execution: AgentplaneConfig["execution"];
|
|
44
|
+
backend: {
|
|
45
|
+
id: string;
|
|
46
|
+
config_path: string;
|
|
47
|
+
capabilities: TaskBackendCapabilities | null;
|
|
48
|
+
restrictions: {
|
|
49
|
+
canonical_source: TaskBackendCapabilities["canonical_source"];
|
|
50
|
+
projection: TaskBackendCapabilities["projection"];
|
|
51
|
+
projection_read_mode: TaskBackendCapabilities["projection_read_mode"];
|
|
52
|
+
reads_from_projection_by_default: boolean;
|
|
53
|
+
writes_task_readmes: boolean;
|
|
54
|
+
supports_task_revisions: boolean;
|
|
55
|
+
supports_revision_guarded_writes: boolean;
|
|
56
|
+
may_access_network_on_read: boolean;
|
|
57
|
+
may_access_network_on_write: boolean;
|
|
58
|
+
supports_projection_refresh: boolean;
|
|
59
|
+
supports_push_sync: boolean;
|
|
60
|
+
supports_snapshot_export: boolean;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
trace: ResolvedHarnessTrace;
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/runtime/harness/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { IncidentAdviceMatch, IncidentAdviceQuery, IncidentCollectionPlan, IncidentFindingCandidate, IncidentPromotionDraft, IncidentPromotionIssue, IncidentPromotionTaskContext, IncidentRegistry, IncidentRegistryEntry, IncidentRegistryEntryState, } from "./types.js";
|
|
2
|
+
export { appendIncidentRegistryEntries, buildIncidentAdviceQueryFromTask, createIncidentRegistrySkeleton, extractIncidentCandidatesFromFindings, formatIncidentRegistryEntry, parseIncidentRegistry, planIncidentCollection, renderIncidentAdvice, resolveIncidentAdviceMatches, } from "./resolve.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/incidents/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,EAChC,8BAA8B,EAC9B,qCAAqC,EACrC,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { appendIncidentRegistryEntries, buildIncidentAdviceQueryFromTask, createIncidentRegistrySkeleton, extractIncidentCandidatesFromFindings, formatIncidentRegistryEntry, parseIncidentRegistry, planIncidentCollection, renderIncidentAdvice, resolveIncidentAdviceMatches, } from "./resolve.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IncidentAdviceMatch, IncidentAdviceQuery, IncidentCollectionPlan, IncidentFindingCandidate, IncidentPromotionTaskContext, IncidentRegistry, IncidentRegistryEntry } from "./types.js";
|
|
2
|
+
export declare function createIncidentRegistrySkeleton(): string;
|
|
3
|
+
export declare function parseIncidentRegistry(text: string): IncidentRegistry;
|
|
4
|
+
export declare function formatIncidentRegistryEntry(entry: IncidentRegistryEntry): string;
|
|
5
|
+
export declare function appendIncidentRegistryEntries(currentText: string, entries: readonly IncidentRegistryEntry[]): string;
|
|
6
|
+
export declare function extractIncidentCandidatesFromFindings(findings: string): IncidentFindingCandidate[];
|
|
7
|
+
export declare function planIncidentCollection(opts: {
|
|
8
|
+
task: IncidentPromotionTaskContext;
|
|
9
|
+
findings: string;
|
|
10
|
+
registry: IncidentRegistry;
|
|
11
|
+
now?: Date;
|
|
12
|
+
}): IncidentCollectionPlan;
|
|
13
|
+
export declare function buildIncidentAdviceQueryFromTask(opts: {
|
|
14
|
+
taskId: string;
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
scope?: string | null;
|
|
18
|
+
tags: readonly string[];
|
|
19
|
+
}): IncidentAdviceQuery;
|
|
20
|
+
export declare function resolveIncidentAdviceMatches(opts: {
|
|
21
|
+
query: IncidentAdviceQuery;
|
|
22
|
+
registry: IncidentRegistry;
|
|
23
|
+
limit?: number;
|
|
24
|
+
}): IncidentAdviceMatch[];
|
|
25
|
+
export declare function renderIncidentAdvice(matches: readonly IncidentAdviceMatch[]): string;
|
|
26
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/runtime/incidents/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EAGxB,4BAA4B,EAC5B,gBAAgB,EAChB,qBAAqB,EAEtB,MAAM,YAAY,CAAC;AAuGpB,wBAAgB,8BAA8B,IAAI,MAAM,CAgCvD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAkFpE;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAgBhF;AAED,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,qBAAqB,EAAE,GACxC,MAAM,CAQR;AAED,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,MAAM,GACf,wBAAwB,EAAE,CAwF5B;AA4DD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,IAAI,EAAE,4BAA4B,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,GAAG,sBAAsB,CAiCzB;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB,GAAG,mBAAmB,CAQtB;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,KAAK,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,mBAAmB,EAAE,CA4BxB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,GAAG,MAAM,CAcpF"}
|