create-agdf 0.20.0 → 0.20.2
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 +38 -19
- package/generated/.agdf/control/templates/artefacts/SD.md +7 -1
- package/generated/.agdf/control/templates/artefacts/TP.md +4 -0
- package/generated/.opencode/contracts/quality.md +71 -4
- package/generated/.opencode/contracts/sd-definition.md +16 -0
- package/generated/.opencode/contracts/tp-definition.md +6 -0
- package/generated/.opencode/skills/agdf-clean-implementation-review/SKILL.md +2 -0
- package/generated/.opencode/skills/agdf-code-review/SKILL.md +2 -0
- package/generated/.opencode/skills/agdf-qa-gate/SKILL.md +10 -9
- package/generated/.opencode/skills/agdf-sd-definition/SKILL.md +2 -1
- package/generated/.opencode/skills/agdf-task-plan-review/SKILL.md +2 -0
- package/generated/.opencode/skills/agdf-tp-definition/SKILL.md +2 -1
- package/generated/plugins/agdf/.claude-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/control/templates/artefacts/SD.md +7 -1
- package/generated/plugins/agdf/control/templates/artefacts/TP.md +4 -0
- package/generated/plugins/agdf/mcp/server/README.md +5 -5
- package/generated/plugins/agdf/mcp/server/package.json +2 -2
- package/generated/plugins/agdf/mcp/server/src/server.js +21 -8
- package/generated/plugins/agdf/mcp/server/src/ui-capability.js +49 -1
- package/generated/plugins/agdf/meta/agdf-mcp-capability.json +2 -2
- package/generated/plugins/agdf/meta/agdf-plugin.definition.json +106 -13
- package/generated/plugins/agdf/meta/contracts/quality.md +71 -4
- package/generated/plugins/agdf/meta/contracts/sd-definition.md +16 -0
- package/generated/plugins/agdf/meta/contracts/tp-definition.md +6 -0
- package/generated/plugins/agdf/meta/copilot-payload-baseline.json +2 -2
- package/generated/plugins/agdf/meta/distribution-profile-history.json +14 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +106 -13
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +71 -4
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +16 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +6 -0
- package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +10 -2
- package/generated/plugins/agdf/runtime/create-agdf/package.json +1 -1
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +26 -34
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +26 -8
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +140 -9
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +2 -2
- package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-presentation.js +1 -1
- package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
- package/generated/plugins/agdf/skills/clean-implementation-review/SKILL.md +2 -0
- package/generated/plugins/agdf/skills/code-review/SKILL.md +2 -0
- package/generated/plugins/agdf/skills/qa-gate/SKILL.md +10 -9
- package/generated/plugins/agdf/skills/sd-definition/SKILL.md +2 -1
- package/generated/plugins/agdf/skills/task-plan-review/SKILL.md +2 -0
- package/generated/plugins/agdf/skills/tp-definition/SKILL.md +2 -1
- package/generated/plugins/agdf/submission/openai/availability.md +1 -1
- package/generated/plugins/agdf/submission/openai/capability-matrix.json +1 -1
- package/generated/plugins/agdf/submission/openai/release-notes.md +1 -1
- package/generated/plugins/agdf/submission/openai/reviewer-cases.json +1 -1
- package/generated/plugins/copilot/agdf/.agdf-payload-inventory.json +74 -74
- package/generated/plugins/copilot/agdf/control/templates/artefacts/SD.md +7 -1
- package/generated/plugins/copilot/agdf/control/templates/artefacts/TP.md +4 -0
- package/generated/plugins/copilot/agdf/mcp/server/README.md +5 -5
- package/generated/plugins/copilot/agdf/mcp/server/package.json +2 -2
- package/generated/plugins/copilot/agdf/mcp/server/src/server.js +21 -8
- package/generated/plugins/copilot/agdf/mcp/server/src/ui-capability.js +49 -1
- package/generated/plugins/copilot/agdf/meta/agdf-plugin.definition.json +106 -13
- package/generated/plugins/copilot/agdf/meta/distribution-profile-history.json +14 -0
- package/generated/plugins/copilot/agdf/plugin.json +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +106 -13
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +71 -4
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +16 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +6 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +10 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/package.json +1 -1
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +26 -34
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +26 -8
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +140 -9
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +2 -2
- package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-presentation.js +1 -1
- package/generated/plugins/copilot/agdf/runtime/runtime-manifest.json +2 -2
- package/generated/plugins/copilot/agdf/skills/agdf-clean-implementation-review/SKILL.md +2 -0
- package/generated/plugins/copilot/agdf/skills/agdf-code-review/SKILL.md +2 -0
- package/generated/plugins/copilot/agdf/skills/agdf-qa-gate/SKILL.md +10 -9
- package/generated/plugins/copilot/agdf/skills/agdf-sd-definition/SKILL.md +2 -1
- package/generated/plugins/copilot/agdf/skills/agdf-task-plan-review/SKILL.md +2 -0
- package/generated/plugins/copilot/agdf/skills/agdf-tp-definition/SKILL.md +2 -1
- package/generated/plugins/copilot/agdf/skills/contracts/quality.md +71 -4
- package/generated/plugins/copilot/agdf/skills/contracts/sd-definition.md +16 -0
- package/generated/plugins/copilot/agdf/skills/contracts/tp-definition.md +6 -0
- package/generated/submissions/openai/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json +106 -13
- package/generated/submissions/openai/agdf/meta/contracts/quality.md +71 -4
- package/generated/submissions/openai/agdf/meta/contracts/sd-definition.md +16 -0
- package/generated/submissions/openai/agdf/meta/contracts/tp-definition.md +6 -0
- package/generated/submissions/openai/agdf/meta/copilot-payload-baseline.json +2 -2
- package/generated/submissions/openai/agdf/meta/distribution-profile-history.json +14 -0
- package/generated/submissions/openai/agdf/plugin.json +1 -1
- package/generated/submissions/openai/agdf/skills/clean-implementation-review/SKILL.md +2 -0
- package/generated/submissions/openai/agdf/skills/code-review/SKILL.md +2 -0
- package/generated/submissions/openai/agdf/skills/qa-gate/SKILL.md +10 -9
- package/generated/submissions/openai/agdf/skills/sd-definition/SKILL.md +2 -1
- package/generated/submissions/openai/agdf/skills/task-plan-review/SKILL.md +2 -0
- package/generated/submissions/openai/agdf/skills/tp-definition/SKILL.md +2 -1
- package/generated/submissions/openai/agdf/submission/openai/availability.md +1 -1
- package/generated/submissions/openai/agdf/submission/openai/capability-matrix.json +1 -1
- package/generated/submissions/openai/agdf/submission/openai/inventory.json +21 -21
- package/generated/submissions/openai/agdf/submission/openai/listing.json +1 -1
- package/generated/submissions/openai/agdf/submission/openai/readiness.json +2 -2
- package/generated/submissions/openai/agdf/submission/openai/readiness.md +2 -2
- package/generated/submissions/openai/agdf/submission/openai/release-notes.md +1 -1
- package/generated/submissions/openai/agdf/submission/openai/reviewer-cases.json +1 -1
- package/lib/host-adapters/codex/config-source.js +48 -0
- package/lib/mcp-dispatch-runtime.js +10 -2
- package/lib/mcp-lifecycle/adapters/codex.js +40 -29
- package/lib/mcp-lifecycle/adapters/copilot.js +13 -7
- package/lib/mcp-lifecycle/adapters/opencode.js +97 -8
- package/lib/mcp-lifecycle/profile.js +2 -1
- package/package.json +1 -1
- package/runtime/core/lib/control-inspect/contract.js +26 -34
- package/runtime/core/lib/control-inspect/service.js +26 -8
- package/runtime/core/lib/control-state/run-command-contract.js +140 -9
- package/runtime/core/lib/control-state/run-presentation-render.js +2 -2
- package/runtime/core/lib/interaction-presentation.js +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"releaseVersion": "0.20.
|
|
4
|
-
"digest": "
|
|
3
|
+
"releaseVersion": "0.20.2",
|
|
4
|
+
"digest": "2040ebb0706cc87fdc305250e40996bfcca3e6673b3bbc6946120802b851acd1",
|
|
5
5
|
"files": [
|
|
6
6
|
{
|
|
7
7
|
"path": ".codex-plugin/plugin.json",
|
|
8
|
-
"sha256": "
|
|
8
|
+
"sha256": "daf2420e5278f955d52b6d47fc6c679cee928f074631c8a93fc9793251bc413c"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"path": "assets/agdf-icon.svg",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"path": "meta/agdf-plugin.definition.json",
|
|
32
|
-
"sha256": "
|
|
32
|
+
"sha256": "c0d263e644b1a55658954b2eb5bbd260db2436cd5330bb83034c5a831d7b9a3e"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "meta/agdf-runtime-contract.md",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"path": "meta/contracts/quality.md",
|
|
80
|
-
"sha256": "
|
|
80
|
+
"sha256": "75be32ae784d0a8483e9427b701c30302377ee18faa860a005b4ae4d14907197"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
"path": "meta/contracts/request-activation.md",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"path": "meta/contracts/sd-definition.md",
|
|
88
|
-
"sha256": "
|
|
88
|
+
"sha256": "9ec104f39f1e080a78b41c735791dd1520267aa608c64e6a40344885176d15ba"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
"path": "meta/contracts/task-target-resolution.md",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
"path": "meta/contracts/tp-definition.md",
|
|
96
|
-
"sha256": "
|
|
96
|
+
"sha256": "72232f6fc3411e97e752f8aa7d0d993a5c5b3587595e82ef28a5e176208fefb7"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"path": "meta/contracts/ur-definition.md",
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
"path": "meta/copilot-payload-baseline.json",
|
|
104
|
-
"sha256": "
|
|
104
|
+
"sha256": "9c122518c787468112aed3c8a6f25be491a6de13d253b21e9b9a2e66e98de414"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
"path": "meta/distribution-profile-history.json",
|
|
108
|
-
"sha256": "
|
|
108
|
+
"sha256": "0ec135acd06c0acfdc593c05d1e8cc0d8348614ead3ef0f5c3500264c2118e70"
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
"path": "meta/schemas/agent-plugins/1.0.0/mcp.schema.json",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
"path": "plugin.json",
|
|
124
|
-
"sha256": "
|
|
124
|
+
"sha256": "13dfd1623af9de73f02b2858f8a41df02380862e0e956e12b55776bff9e4fc10"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
"path": "skills/brownfield-analysis/SKILL.md",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"path": "skills/clean-implementation-review/SKILL.md",
|
|
136
|
-
"sha256": "
|
|
136
|
+
"sha256": "ad59db78f10035d6439d4ce58743934e68e3a6e94b3384376b5c7346e4d54c78"
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
"path": "skills/clean-implementation-review/help.md",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
"path": "skills/code-review/SKILL.md",
|
|
144
|
-
"sha256": "
|
|
144
|
+
"sha256": "5e31849f6e20b3bae599702c91a8b1159991c6cdef3a8721821e002994d0e574"
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
"path": "skills/code-review/help.md",
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
},
|
|
182
182
|
{
|
|
183
183
|
"path": "skills/qa-gate/SKILL.md",
|
|
184
|
-
"sha256": "
|
|
184
|
+
"sha256": "ad0ebdbc69a1f36e9ccb86991b053baee4063a9fcf9428ae5ea735e5ada229c5"
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
"path": "skills/qa-gate/help.md",
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
199
|
"path": "skills/sd-definition/SKILL.md",
|
|
200
|
-
"sha256": "
|
|
200
|
+
"sha256": "b38cc4320f12aa11a21c14fc9b8bf4f3aa7a45f22bf5262506811106bf2f581f"
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
203
|
"path": "skills/sd-definition/help.md",
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
"path": "skills/task-plan-review/SKILL.md",
|
|
208
|
-
"sha256": "
|
|
208
|
+
"sha256": "8ae9cc237863484a19bdc94c8fc7f3c10b7a13386888bbfb2fc8cdde372aaf01"
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
"path": "skills/task-plan-review/help.md",
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
},
|
|
214
214
|
{
|
|
215
215
|
"path": "skills/tp-definition/SKILL.md",
|
|
216
|
-
"sha256": "
|
|
216
|
+
"sha256": "825f5ba1856f665f0fa89c6fbb2c2cde293bf1f16949ba35a29974cf01896da1"
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
219
|
"path": "skills/tp-definition/help.md",
|
|
@@ -237,23 +237,23 @@
|
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
239
|
"path": "submission/openai/availability.md",
|
|
240
|
-
"sha256": "
|
|
240
|
+
"sha256": "a1b97103f9a692a818b7828c93a6af72c51e0103e0c446252109af4909e534f4"
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
"path": "submission/openai/capability-matrix.json",
|
|
244
|
-
"sha256": "
|
|
244
|
+
"sha256": "97a0e62854f7cdb289d4e0c028596bf009198553594e8747cee9bcbe800a3b89"
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
"path": "submission/openai/listing.json",
|
|
248
|
-
"sha256": "
|
|
248
|
+
"sha256": "10e6840d84d2fbf6e8c829c75af2b6b3ca32bbb261929f67a4be5af86ebe18e1"
|
|
249
249
|
},
|
|
250
250
|
{
|
|
251
251
|
"path": "submission/openai/release-notes.md",
|
|
252
|
-
"sha256": "
|
|
252
|
+
"sha256": "1217ab97ca408d422b358cab4fc1f0409093ea8ddbfd37a49f2be06828b97846"
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
255
|
"path": "submission/openai/reviewer-cases.json",
|
|
256
|
-
"sha256": "
|
|
256
|
+
"sha256": "1fa597b7336879aa764adb0edfb768105b3e4665857a49b62b45bd153246294e"
|
|
257
257
|
}
|
|
258
258
|
]
|
|
259
259
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"releaseVersion": "0.20.
|
|
3
|
+
"releaseVersion": "0.20.2",
|
|
4
4
|
"candidateState": "repository_ready",
|
|
5
5
|
"submissionReady": false,
|
|
6
6
|
"submissionBlockers": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"bundle": {
|
|
18
18
|
"state": "pass",
|
|
19
|
-
"detail": "63 inventoried files; inventory digest
|
|
19
|
+
"detail": "63 inventoried files; inventory digest 2040ebb0706cc87fdc305250e40996bfcca3e6673b3bbc6946120802b851acd1"
|
|
20
20
|
},
|
|
21
21
|
"installed_host": {
|
|
22
22
|
"state": "unverified",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AGDF Public Plugin Readiness
|
|
2
2
|
|
|
3
|
-
- release: `0.20.
|
|
3
|
+
- release: `0.20.2`
|
|
4
4
|
- candidate_state: `repository_ready`
|
|
5
5
|
- submission_ready: `false`
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
| Class | State | Detail |
|
|
10
10
|
|---|---|---|
|
|
11
11
|
| repository | pass | canonical contract and deterministic source checks |
|
|
12
|
-
| bundle | pass | 63 inventoried files; inventory digest
|
|
12
|
+
| bundle | pass | 63 inventoried files; inventory digest 2040ebb0706cc87fdc305250e40996bfcca3e6673b3bbc6946120802b851acd1 |
|
|
13
13
|
| installed_host | unverified | PPD-L02 and PPD-L03 not performed |
|
|
14
14
|
| portal | unverified | unverified |
|
|
15
15
|
| post_publication | unverified | not published |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# AGDF 0.20.
|
|
1
|
+
# AGDF 0.20.2 — Initial OpenAI Public Plugin Candidate
|
|
2
2
|
|
|
3
3
|
This candidate packages the canonical AGDF workflow skills for public discovery in ChatGPT and
|
|
4
4
|
Codex. It helps users assess delivery fit, preserve explicit human approvals, inspect existing-system
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// A bounded lexical view for the adapter's deliberately narrow TOML readers.
|
|
2
|
+
// Keep UTF-16 offsets and line endings so edits and hashes always use original
|
|
3
|
+
// bytes. Comments and multiline string payloads cannot supply tables, enabled
|
|
4
|
+
// fields or ownership markers. This is not a general TOML parser: unsupported
|
|
5
|
+
// MCP shapes still fail the existing structural/ownership checks.
|
|
6
|
+
export function codexConfigSyntax(content) {
|
|
7
|
+
if (Buffer.byteLength(content) > 65_536) throw Error('AGDF_MCP_CODEX_CONFIG_INVALID');
|
|
8
|
+
const syntax = content.split('');
|
|
9
|
+
const hide = (start, end) => {
|
|
10
|
+
for (let i = start; i < end; i++) if (content[i] !== '\n' && content[i] !== '\r') syntax[i] = ' ';
|
|
11
|
+
};
|
|
12
|
+
for (let i = 0; i < content.length;) {
|
|
13
|
+
if (content[i] === '#') {
|
|
14
|
+
const end = content.indexOf('\n', i);
|
|
15
|
+
hide(i, end < 0 ? content.length : end);
|
|
16
|
+
i = end < 0 ? content.length : end;
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const quote = content[i];
|
|
20
|
+
if (quote !== '"' && quote !== "'") { i++; continue; }
|
|
21
|
+
const start = i, multiline = content.startsWith(quote.repeat(3), i);
|
|
22
|
+
i += multiline ? 3 : 1;
|
|
23
|
+
let closed = false;
|
|
24
|
+
while (i < content.length) {
|
|
25
|
+
if (quote === '"' && content[i] === '\\') {
|
|
26
|
+
if (!multiline && /[\r\n]/u.test(content[i + 1] ?? '')) throw Error('AGDF_MCP_CODEX_CONFIG_INVALID');
|
|
27
|
+
i += 2; continue;
|
|
28
|
+
}
|
|
29
|
+
if (!multiline && /[\r\n]/u.test(content[i])) throw Error('AGDF_MCP_CODEX_CONFIG_INVALID');
|
|
30
|
+
if (content[i] !== quote) { i++; continue; }
|
|
31
|
+
if (!multiline) { i++; closed = true; break; }
|
|
32
|
+
let end = i;
|
|
33
|
+
while (content[end] === quote) end++;
|
|
34
|
+
const count = end - i;
|
|
35
|
+
if (count > 5) throw Error('AGDF_MCP_CODEX_CONFIG_INVALID');
|
|
36
|
+
i = end;
|
|
37
|
+
if (count >= 3) { closed = true; break; }
|
|
38
|
+
}
|
|
39
|
+
if (!closed) throw Error('AGDF_MCP_CODEX_CONFIG_INVALID');
|
|
40
|
+
if (multiline) {
|
|
41
|
+
hide(start, i);
|
|
42
|
+
// Keep a non-boolean placeholder so a multiline enabled value is unknown,
|
|
43
|
+
// rather than mistaken for a missing field with its default value.
|
|
44
|
+
syntax[start] = quote; syntax[start + 1] = quote;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return syntax.join('');
|
|
48
|
+
}
|
|
@@ -20,7 +20,7 @@ import { CONTROL_INSPECT_FUNCTION_DEFINITION, parseControlInspectFunctionArgumen
|
|
|
20
20
|
import { createInspectFailureResult } from "#agdf-core/control-inspect/service.js";
|
|
21
21
|
import { assertMcpControlReadBoundary } from "#agdf-core/control-read-boundary.js";
|
|
22
22
|
import { interactionLocales, packageRoot, pluginDefinition } from "./cli/runtime-context.js";
|
|
23
|
-
import { RUN_COMMAND_GROUPS, RUN_COMMAND_LIMITS, commandGroupDefinition, validateRunCommand, runCommandRequestDigest } from '#agdf-core/control-state/run-command-contract.js';
|
|
23
|
+
import { RUN_COMMAND_GROUPS, RUN_COMMAND_LIMITS, commandGroupDefinition, validateRunCommand, validateRunCommandResult, runCommandRequestDigest } from '#agdf-core/control-state/run-command-contract.js';
|
|
24
24
|
import {
|
|
25
25
|
digestDirectory,
|
|
26
26
|
digestMcpDispatcherPackage,
|
|
@@ -30,11 +30,19 @@ import {
|
|
|
30
30
|
|
|
31
31
|
const MCP_RUNTIME_OWNER = "create-agdf:mcp-runtime";
|
|
32
32
|
|
|
33
|
+
// Compose the canonical structural contract at the existing producing/consuming
|
|
34
|
+
// boundary. The descriptor projector stays dependency-free and policy-pure.
|
|
35
|
+
function checkCommandResult(name, result) {
|
|
36
|
+
if (Object.hasOwn(RUN_COMMAND_GROUPS, name) && validateRunCommandResult(result).length) {
|
|
37
|
+
throw Object.assign(new Error('tool_result_invalid'), { facts: { code: 'tool_result_invalid', dispatch: 'unknown' } });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
33
40
|
function errorSupport(cockpit = false) {
|
|
34
41
|
return {
|
|
35
42
|
toolErrorContract: TOOL_ERROR_CONTRACT, responseLimit: SKILL_DISPATCH_MAX_OUTPUT_BYTES,
|
|
36
43
|
projectToolResult(name, input = {}, result, facts) {
|
|
37
44
|
const pack = localePack(interactionLocales, input.presentation_language ?? (cockpit ? 'de' : 'en'));
|
|
45
|
+
checkCommandResult(name, result);
|
|
38
46
|
const { _meta, ...domain } = result;
|
|
39
47
|
const serialize = name === 'agdf_dispatch' ? serializeSkillDispatchResult : name === 'agdf_inspect' ? serializeControlInspectResult : JSON.stringify;
|
|
40
48
|
const checked = JSON.parse(serialize(domain));
|
|
@@ -47,7 +55,7 @@ function errorSupport(cockpit = false) {
|
|
|
47
55
|
}
|
|
48
56
|
return projected;
|
|
49
57
|
},
|
|
50
|
-
consumeToolResult,
|
|
58
|
+
consumeToolResult(name, result) { checkCommandResult(name, result); return consumeToolResult(name, result); },
|
|
51
59
|
normalizeFailure(error, { phase = 'execute' } = {}) {
|
|
52
60
|
if (phase === 'parse' && (error instanceof SkillDispatchInputError || error instanceof TaskTargetInputError || error instanceof ReadSelectionError)) {
|
|
53
61
|
const facts = { code: error instanceof ReadSelectionError ? 'inspect_input_invalid' : 'dispatch_input_invalid', dispatch: 'not_dispatched', ...(error.field ? { field: error.field } : {}) };
|
|
@@ -6,6 +6,7 @@ import { inspectMcpServerPackage, inspectMcpExecutableRoot } from '../package.js
|
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import { dirname, basename, join, isAbsolute, resolve, relative, sep } from "node:path";
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { codexConfigSyntax } from '../../host-adapters/codex/config-source.js';
|
|
9
10
|
import {
|
|
10
11
|
allSourceResult,
|
|
11
12
|
atomicWrite,
|
|
@@ -49,13 +50,13 @@ function section(spec, { createdConfig = false, createdDirectory = false } = {})
|
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
function sectionRange(content, id = 'agdf') {
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
|
|
53
|
+
// Ownership remains limited to generated single-line sections. Ignore table
|
|
54
|
+
// examples inside unrelated TOML strings without rewriting those strings.
|
|
55
|
+
const syntax = codexConfigSyntax(content);
|
|
55
56
|
const escaped = id.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
56
57
|
const exactHeader = `[mcp_servers.${id}]`;
|
|
57
|
-
const headers = [...
|
|
58
|
-
const unsupported =
|
|
58
|
+
const headers = [...syntax.matchAll(new RegExp('^[ \\t]*\\[mcp_servers\\.' + escaped + '\\][ \\t]*\\r?$', 'gm'))];
|
|
59
|
+
const unsupported = syntax.split("\n").some((line) => {
|
|
59
60
|
const trimmed = line.trim();
|
|
60
61
|
if (!trimmed || trimmed.startsWith("#")) return false;
|
|
61
62
|
if (trimmed.startsWith("[")) {
|
|
@@ -71,12 +72,12 @@ function sectionRange(content, id = 'agdf') {
|
|
|
71
72
|
const [header] = headers;
|
|
72
73
|
if (!header) return null;
|
|
73
74
|
const sectionStart = header.index;
|
|
74
|
-
const next = /^[ \t]*\[[^\n]+\][ \t]
|
|
75
|
+
const next = /^[ \t]*\[[^\r\n]+\][ \t]*\r?$/gm;
|
|
75
76
|
next.lastIndex = sectionStart + header[0].length;
|
|
76
|
-
const nextHeader = next.exec(
|
|
77
|
+
const nextHeader = next.exec(syntax);
|
|
77
78
|
let start = sectionStart;
|
|
78
|
-
const marker = content.slice(0, sectionStart).match(/(?:^|\n)(# AGDF-OWNED-MCP: [^\n]+)\n$/);
|
|
79
|
-
if (marker) start = sectionStart - marker[0].length + (marker[0].startsWith(
|
|
79
|
+
const marker = content.slice(0, sectionStart).match(/(?:^|\r?\n)(# AGDF-OWNED-MCP: [^\r\n]+)\r?\n$/);
|
|
80
|
+
if (marker) start = sectionStart - marker[0].length + (marker[0].startsWith('\r\n') ? 2 : marker[0].startsWith('\n') ? 1 : 0);
|
|
80
81
|
return { start, sectionStart, end: nextHeader?.index ?? content.length, marker: marker?.[1] ?? null };
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -215,11 +216,10 @@ export function inspectCodexSetup({ target, env = {}, pluginRoot } = {}) {
|
|
|
215
216
|
for (const source of sources({ scope: 'project', target, env })) {
|
|
216
217
|
try {
|
|
217
218
|
const snapshot = safeSnapshot(source.path);
|
|
218
|
-
|
|
219
|
-
if (/'''|"""/u.test(snapshot.content)) throw Error('unsupported_multiline_source');
|
|
219
|
+
const syntax = codexConfigSyntax(snapshot.content);
|
|
220
220
|
const sourceDigest = createHash('sha256').update(snapshot.content).digest('hex');
|
|
221
221
|
checked.push({ source: source.id, path: source.path, status: snapshot.existed ? 'declared' : 'absent', digest: sourceDigest });
|
|
222
|
-
const sections = [...
|
|
222
|
+
const sections = [...syntax.matchAll(/^[ \t]*\[([^\r\n]+)\][ \t]*\r?$/gm)];
|
|
223
223
|
for (let index = 0; index < sections.length; index++) {
|
|
224
224
|
const header = sections[index][1];
|
|
225
225
|
const id = /^mcp_servers\.([A-Za-z0-9_-]+)$/u.exec(header)?.[1];
|
|
@@ -227,13 +227,13 @@ export function inspectCodexSetup({ target, env = {}, pluginRoot } = {}) {
|
|
|
227
227
|
if (!id && !plugin) continue;
|
|
228
228
|
if (entries.length >= 32) throw Error('bounded_entries');
|
|
229
229
|
const name = plugin ? 'agdf' : id;
|
|
230
|
-
const body =
|
|
230
|
+
const body = syntax.slice(sections[index].index + sections[index][0].length, sections[index + 1]?.index ?? syntax.length);
|
|
231
231
|
const role = plugin ? 'product' : ['agdf-cockpit', 'agdf-cockpit-local'].includes(name) ? 'cockpit'
|
|
232
232
|
: name.startsWith('agdf-test-') || ['agdf-cockpit-draft-check', 'agdf-decision-probe'].includes(name) ? 'diagnostic' : 'legacy_or_conflict';
|
|
233
233
|
const value = key => new RegExp('^' + key + '[ \\t]*=[ \\t]*([^\\n#]+)', 'm').exec(body)?.[1]?.trim();
|
|
234
234
|
const declaredEnabled = value('enabled');
|
|
235
235
|
const enabled = declaredEnabled === 'false' ? false : declaredEnabled === 'true' ? true : declaredEnabled !== undefined || plugin ? null : true;
|
|
236
|
-
const beforeHeader = snapshot.content.slice(0, sections[index].index).match(/(# AGDF-OWNED-MCP: [^\n]+)\n$/u)?.[1];
|
|
236
|
+
const beforeHeader = snapshot.content.slice(0, sections[index].index).match(/(# AGDF-OWNED-MCP: [^\r\n]+)\r?\n$/u)?.[1];
|
|
237
237
|
const mark = identity(beforeHeader);
|
|
238
238
|
const exactIdOwned = mark && (plugin || name === 'agdf' || mark.server_id === name && mark.role === role);
|
|
239
239
|
const timeout = key => { const raw = value(key); return raw && /^\d+(?:\.\d+)?$/u.test(raw) ? Number(raw) : null; };
|
|
@@ -298,6 +298,24 @@ function mcpTable(header) {
|
|
|
298
298
|
return match ? { name: match[1], nested: Boolean(match[2]) } : null;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
function mcpTables(syntax) {
|
|
302
|
+
const headers = [...syntax.matchAll(/^[ \t]*\[([^\r\n]+)\][ \t]*\r?$/gm)], tables = [], seen = new Set();
|
|
303
|
+
for (let i = 0; i < headers.length; i++) {
|
|
304
|
+
const header = headers[i][1], normalized = header.replace(/[\s"'\[\]]/gu, '');
|
|
305
|
+
if (normalized !== 'mcp_servers' && !normalized.startsWith('mcp_servers.')) continue;
|
|
306
|
+
const table = mcpTable(header);
|
|
307
|
+
if (!table || seen.has(header)) throw Error('unsupported_mcp_header');
|
|
308
|
+
seen.add(header);
|
|
309
|
+
tables.push({ ...table, bodyStart: headers[i].index + headers[i][0].length,
|
|
310
|
+
end: headers[i + 1]?.index ?? syntax.length });
|
|
311
|
+
}
|
|
312
|
+
if (syntax.split('\n').some(line => {
|
|
313
|
+
const key = line.match(/^[ \t]*([^=\n]+)=/u)?.[1]?.replace(/[\s"']/gu, '');
|
|
314
|
+
return key === 'mcp_servers' || key?.startsWith('mcp_servers.');
|
|
315
|
+
})) throw Error('unsupported_mcp_assignment');
|
|
316
|
+
return tables;
|
|
317
|
+
}
|
|
318
|
+
|
|
301
319
|
export function inspectCodexCockpitPlugin(pluginRoot) {
|
|
302
320
|
try {
|
|
303
321
|
if (!isAbsolute(pluginRoot) || portablePath(realpathSync(pluginRoot)) !== portablePath(pluginRoot)) throw Error('plugin_path_invalid');
|
|
@@ -390,12 +408,10 @@ export function createCodexCockpitTransition({ target, env = {}, serverId: id, r
|
|
|
390
408
|
}
|
|
391
409
|
// No higher/lower scope same key, aliases or second Cockpit is silently adopted.
|
|
392
410
|
for (const source of snapshots) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
for (const
|
|
397
|
-
const table = mcpTable(`mcp_servers.${header[1]}`);
|
|
398
|
-
if (!table) throw Error('AGDF_MCP_COCKPIT_INVENTORY_UNCONFIRMED');
|
|
411
|
+
let tables;
|
|
412
|
+
try { tables = mcpTables(codexConfigSyntax(source.content)); }
|
|
413
|
+
catch { throw Error('AGDF_MCP_COCKPIT_INVENTORY_UNCONFIRMED'); }
|
|
414
|
+
for (const table of tables) {
|
|
399
415
|
if ([potentialAlias('agdf-cockpit'), potentialAlias('agdf-cockpit-local')].includes(potentialAlias(table.name))
|
|
400
416
|
&& !(source.path === path && table.name === id && !table.nested)) throw Error('AGDF_MCP_COCKPIT_NAME_CONFLICT');
|
|
401
417
|
}
|
|
@@ -437,23 +453,18 @@ export function inspectCodexCockpitAdmission({ target, env = {}, exec, manifestR
|
|
|
437
453
|
for (const source of sources({ scope: 'project', target, env })) {
|
|
438
454
|
try {
|
|
439
455
|
const snapshot = safeSnapshot(source.path), content = snapshot.content;
|
|
440
|
-
|
|
456
|
+
let syntax;
|
|
457
|
+
try { syntax = codexConfigSyntax(content); } catch { throw Error('unsupported_source'); }
|
|
441
458
|
checked.push({ path: source.path, digest: sha(content) });
|
|
442
|
-
const
|
|
443
|
-
for (let i = 0; i < headers.length; i++) {
|
|
444
|
-
const header = headers[i][1];
|
|
445
|
-
if (!header.replace(/[\s"']/gu, '').startsWith('mcp_servers.')) continue;
|
|
446
|
-
const table = mcpTable(header);
|
|
447
|
-
if (!table) throw Error('unsupported_mcp_header');
|
|
459
|
+
for (const table of mcpTables(syntax)) {
|
|
448
460
|
const name = table.name;
|
|
449
461
|
if (potentialAlias(name) !== 'agdf_cockpit') continue;
|
|
450
462
|
if (table.nested) throw Error('unsupported_mcp_header');
|
|
451
|
-
const body =
|
|
463
|
+
const body = syntax.slice(table.bodyStart, table.end);
|
|
452
464
|
const enabled = [...body.matchAll(/^[ \t]*enabled[ \t]*=[ \t]*([^\n#]+)(?:#[^\n]*)?$/gm)];
|
|
453
465
|
if (enabled.length === 1 && enabled[0][1].trim() === 'false') continue;
|
|
454
466
|
conflicts.push({ path: source.path, server_id: name, reason: 'same_key_or_possible_alias' });
|
|
455
467
|
}
|
|
456
|
-
if (/^[ \t]*mcp_servers(?:[. \t]|=)/mu.test(content)) throw Error('unsupported_mcp_assignment');
|
|
457
468
|
} catch (error) { conflicts.push({ path: source.path, reason: error.message }); }
|
|
458
469
|
}
|
|
459
470
|
let nativeProviderStatus = 'unobserved';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { rmSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { SKILL_DISPATCH_FUNCTION_DEFINITION } from '#agdf-core/skill-dispatch/contract.js';
|
|
5
|
+
import { CONTROL_INSPECT_FUNCTION_DEFINITION } from '#agdf-core/control-inspect/contract.js';
|
|
6
|
+
import { RUN_COMMAND_GROUPS } from '#agdf-core/control-state/run-command-contract.js';
|
|
4
7
|
import {
|
|
5
8
|
allSourceResult,
|
|
6
9
|
atomicWrite,
|
|
@@ -16,15 +19,15 @@ const OWNER = "create-agdf:mcp-runtime";
|
|
|
16
19
|
function entry(spec) {
|
|
17
20
|
return { type: "local", command: spec.command, args: [...spec.args],
|
|
18
21
|
env: { AGDF_MCP_OWNER: OWNER, AGDF_MCP_VERSION: spec.version, AGDF_MCP_DIGEST: spec.digest },
|
|
19
|
-
tools: [
|
|
22
|
+
tools: [SKILL_DISPATCH_FUNCTION_DEFINITION.name, CONTROL_INSPECT_FUNCTION_DEFINITION.name, ...Object.keys(RUN_COMMAND_GROUPS)] };
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
function inspectPath(path, expected) {
|
|
25
|
+
function inspectPath(path, expected, allowBare = false) {
|
|
23
26
|
const { config } = readJsonObject(path, "AGDF_MCP_COPILOT_CONFIG_INVALID");
|
|
24
27
|
if (config.mcpServers !== undefined && (!config.mcpServers || typeof config.mcpServers !== "object" || Array.isArray(config.mcpServers))) {
|
|
25
28
|
throw new Error("AGDF_MCP_COPILOT_CONFIG_INVALID");
|
|
26
29
|
}
|
|
27
|
-
const observedEntry = config.mcpServers
|
|
30
|
+
const observedEntry = (config.mcpServers ?? (allowBare ? config : {})).agdf;
|
|
28
31
|
if (observedEntry === undefined) return { status: "absent", path, identity: null };
|
|
29
32
|
const owned = observedEntry?.env?.AGDF_MCP_OWNER === OWNER;
|
|
30
33
|
if (!owned) return { status: "foreign", path, identity: null };
|
|
@@ -56,7 +59,7 @@ function supplementalReadback({ exec, target }) {
|
|
|
56
59
|
function inspect(input) {
|
|
57
60
|
const list = sources(input);
|
|
58
61
|
const selected = list.find((source) => source.selected);
|
|
59
|
-
const states = new Map(list.map((source) => [source.id, inspectPath(source.path, input.spec)]));
|
|
62
|
+
const states = new Map(list.map((source) => [source.id, inspectPath(source.path, input.spec, source.id !== 'user')]));
|
|
60
63
|
return { ...allSourceResult({ sources: list, inspected: states, selectedSource: selected }),
|
|
61
64
|
native_scope: input.scope, native_readback: supplementalReadback(input) };
|
|
62
65
|
}
|
|
@@ -70,10 +73,13 @@ function transaction({ action, scope, target, spec, previousSpec, env }) {
|
|
|
70
73
|
}
|
|
71
74
|
const snapshot = fileSnapshot(current.path);
|
|
72
75
|
const { config } = readJsonObject(current.path, "AGDF_MCP_COPILOT_CONFIG_INVALID");
|
|
73
|
-
const
|
|
76
|
+
const bare = scope === 'project' && config.mcpServers === undefined && snapshot.existed;
|
|
77
|
+
const servers = { ...(bare ? config : config.mcpServers ?? {}) };
|
|
74
78
|
if (action === "enable") servers.agdf = entry(spec); else delete servers.agdf;
|
|
75
|
-
const next = { ...config };
|
|
76
|
-
if (
|
|
79
|
+
const next = bare ? servers : { ...config };
|
|
80
|
+
if (!bare) {
|
|
81
|
+
if (Object.keys(servers).length) next.mcpServers = servers; else delete next.mcpServers;
|
|
82
|
+
}
|
|
77
83
|
const createdByAgdf = spec.reference?.created_config === true;
|
|
78
84
|
const after = action === "disable" && createdByAgdf && Object.keys(next).length === 0
|
|
79
85
|
? null : `${JSON.stringify(next, null, 2)}\n`;
|