create-agdf 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/bin/create-agdf.js +74 -4
- package/generated/.agdf/control/README.md +1 -0
- package/generated/.github/skills/agdf-delivery-path-search/SKILL.md +14 -0
- package/generated/.github/skills/agdf-runtime-contract.md +30 -0
- package/generated/.opencode/agdf-runtime-contract.md +30 -0
- package/generated/.opencode/agents/agdf-delivery-path-search.md +14 -0
- package/generated/plugins/agdf/.codex-plugin/plugin.json +8 -9
- package/generated/plugins/agdf/LICENSE +201 -0
- package/generated/plugins/agdf/control/README.md +1 -0
- package/generated/plugins/agdf/meta/agdf-plugin.definition.json +9 -10
- package/generated/plugins/agdf/meta/agdf-runtime-contract.md +30 -0
- package/generated/plugins/agdf/skills/delivery-path-search/SKILL.md +14 -0
- package/lib/delivery-path-search/candidate-policy.js +67 -2
- package/lib/delivery-path-search/contracts.js +127 -0
- package/lib/delivery-path-search/evaluators/claude.js +2 -16
- package/lib/delivery-path-search/evaluators/codex.js +2 -16
- package/lib/delivery-path-search/generators/claude.js +40 -0
- package/lib/delivery-path-search/generators/codex.js +38 -0
- package/lib/delivery-path-search/generators/protocol.js +12 -0
- package/lib/delivery-path-search/persistence.js +5 -0
- package/lib/delivery-path-search/search-engine.js +64 -2
- package/lib/delivery-path-search/state-adapter.js +34 -2
- package/lib/delivery-path-search/transports/read-only-guard.js +43 -0
- package/package.json +3 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
export function repositoryState(cwd) {
|
|
4
|
+
try {
|
|
5
|
+
return execFileSync("git", ["status", "--porcelain=v1", "-z"], {
|
|
6
|
+
cwd,
|
|
7
|
+
encoding: "utf8",
|
|
8
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
9
|
+
});
|
|
10
|
+
} catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function guardedExecFileSync(file, args, options = {}) {
|
|
16
|
+
const before = repositoryState(options.cwd);
|
|
17
|
+
let output;
|
|
18
|
+
let failure;
|
|
19
|
+
try {
|
|
20
|
+
output = execFileSync(file, args, {
|
|
21
|
+
...options,
|
|
22
|
+
encoding: options.encoding ?? "utf8",
|
|
23
|
+
stdio: options.stdio ?? ["ignore", "pipe", "pipe"],
|
|
24
|
+
timeout: options.timeout ?? 30000,
|
|
25
|
+
killSignal: "SIGTERM",
|
|
26
|
+
});
|
|
27
|
+
} catch (error) {
|
|
28
|
+
failure = error;
|
|
29
|
+
}
|
|
30
|
+
const after = repositoryState(options.cwd);
|
|
31
|
+
if (before !== null && after !== before) {
|
|
32
|
+
const error = new Error("repository mutation detected during read-only run");
|
|
33
|
+
error.code = "GENERATOR_MUTATION_DETECTED";
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
if (failure?.code === "ETIMEDOUT" || failure?.signal === "SIGTERM") {
|
|
37
|
+
const timeout = new Error("read-only process timed out");
|
|
38
|
+
timeout.code = "GENERATOR_TIMEOUT";
|
|
39
|
+
throw timeout;
|
|
40
|
+
}
|
|
41
|
+
if (failure) throw failure;
|
|
42
|
+
return output;
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-agdf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Bootstrap AGDF repository-local plugin files, Copilot/OpenCode instructions, skills, control files and machine-readable checks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
"sync-package-assets": "node ./scripts/sync-package-assets.js",
|
|
24
24
|
"test:delivery-path-search": "node ./scripts/delivery-path-search-test.js",
|
|
25
25
|
"test:delivery-path-search-unit": "node ./scripts/delivery-path-search-unit-test.js",
|
|
26
|
+
"test:delivery-path-search-generator": "node ./scripts/delivery-path-search-generator-test.js",
|
|
26
27
|
"test:routing": "npm run sync-package-assets && node ./scripts/test-routing.js",
|
|
27
|
-
"smoke-test": "npm run sync-package-assets && npm run test:delivery-path-search && npm run test:delivery-path-search-unit && node ./scripts/smoke-test.js && node ./scripts/test-routing.js",
|
|
28
|
+
"smoke-test": "npm run sync-package-assets && npm run test:delivery-path-search && npm run test:delivery-path-search-unit && npm run test:delivery-path-search-generator && node ./scripts/smoke-test.js && node ./scripts/test-routing.js",
|
|
28
29
|
"prepack": "npm run sync-package-assets"
|
|
29
30
|
},
|
|
30
31
|
"keywords": [
|