create-agdf 0.14.1 → 0.14.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 +8 -2
- package/generated/plugins/agdf/.claude-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/meta/agdf-plugin.definition.json +6 -1
- package/generated/plugins/agdf/meta/copilot-payload-baseline.json +7 -0
- package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +6 -1
- package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/local-validator.js +29 -17
- package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/plugin-provenance.js +50 -1
- package/generated/plugins/agdf/runtime/create-agdf/package.json +1 -1
- package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
- package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +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 +771 -0
- package/generated/plugins/copilot/agdf/LICENSE +201 -0
- package/generated/plugins/copilot/agdf/meta/agdf-agent-router.md +129 -0
- package/generated/plugins/copilot/agdf/meta/agdf-constitution.md +329 -0
- package/generated/plugins/copilot/agdf/meta/agdf-plugin.definition.json +331 -0
- package/generated/plugins/copilot/agdf/meta/agdf-runtime-contract.md +16 -0
- package/generated/plugins/{agdf → copilot/agdf}/plugin.json +1 -1
- package/generated/plugins/copilot/agdf/runtime/agdf-local.js +18 -0
- package/generated/plugins/copilot/agdf/runtime/agdf-session-check.js +97 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/NOTICE +10 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/bin/agdf-validator.js +11 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +512 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +331 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/command-registry.js +144 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/delivery-path-search-command.js +139 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/parse-args.js +173 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/runtime-context.js +83 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +46 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/delivery-map.js +301 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/doctor.js +272 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/gate-check.js +455 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/gate-policy.js +305 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/parent-reconciliation.js +284 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/required-files.js +9 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/run-state.js +217 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/shared.js +345 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/verified-change.js +156 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/aggregate.js +18 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/gate-approval-validator.js +49 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/index.js +7 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/legacy-migration.js +95 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-parser.js +265 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-repository.js +68 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-resolver.js +45 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-writer.js +97 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/candidate-policy.js +99 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/contracts.js +237 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/claude.js +35 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/codex.js +44 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/opencode.js +234 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/prompt.js +13 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/protocol.js +13 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/claude.js +40 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/codex.js +38 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/protocol.js +12 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/persistence.js +39 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/scoring.js +21 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/search-engine.js +155 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/state-adapter.js +161 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/surfaces/capabilities.js +27 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/transports/read-only-guard.js +43 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/interaction-presentation.js +842 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/local-validator.js +239 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/plugin-provenance.js +255 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/validator-application.js +40 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime-check-consent/contract.js +73 -0
- package/generated/plugins/copilot/agdf/runtime/create-agdf/package.json +6 -0
- package/generated/plugins/copilot/agdf/runtime/runtime-manifest.json +8 -0
- package/generated/submissions/openai/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json +6 -1
- package/generated/submissions/openai/agdf/meta/copilot-payload-baseline.json +7 -0
- 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 +13 -9
- 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/installers/local-marketplace.js +112 -30
- package/lib/installers/plugin-installers.js +45 -9
- package/lib/public-plugin/copilot-profile.js +126 -0
- package/lib/release/version-coherence.js +4 -1
- package/lib/runtime/local-validator.js +29 -17
- package/lib/runtime/plugin-provenance.js +50 -1
- package/package.json +3 -2
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-brownfield-analysis/SKILL.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-clean-implementation-review/SKILL.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-code-review/SKILL.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-delivery-closeout/SKILL.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-delivery-path-search/SKILL.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-gate-check/SKILL.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-interaction-locales.json +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-qa-gate/SKILL.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-release-or/SKILL.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-runtime-contract.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-task-plan-review/SKILL.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-ux-intent-definition/SKILL.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/closeout.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/context-graph.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/control-scaffold.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/gate-transition.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/interaction.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/modes.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/quality.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/task-target-resolution.md +0 -0
- /package/generated/plugins/{agdf → copilot/agdf}/hooks/copilot-hooks.json +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"releaseVersion": "0.14.
|
|
4
|
-
"digest": "
|
|
3
|
+
"releaseVersion": "0.14.2",
|
|
4
|
+
"digest": "0c78d217817ca7cec6cd2e8638e3a4fa678a7dc4c954119606f5f954bd1a2ca2",
|
|
5
5
|
"files": [
|
|
6
6
|
{
|
|
7
7
|
"path": ".codex-plugin/plugin.json",
|
|
8
|
-
"sha256": "
|
|
8
|
+
"sha256": "0eccc7ed08162a4f4437c7ccfbdd9145a9034b4ab6de44f5565ca608989d5c4a"
|
|
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": "ba636c3e224125df8f2dedde215b00473174b1a02fdeecbf91da1a262dcde778"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "meta/agdf-runtime-contract.md",
|
|
@@ -75,6 +75,10 @@
|
|
|
75
75
|
"path": "meta/contracts/task-target-resolution.md",
|
|
76
76
|
"sha256": "3d078596b02360c34e40a6529e063b9c89c62c490be374507fb2046543c380e8"
|
|
77
77
|
},
|
|
78
|
+
{
|
|
79
|
+
"path": "meta/copilot-payload-baseline.json",
|
|
80
|
+
"sha256": "ab87e177288c36a056cccc583c78fd57b50fd82517a56276a009345e065ec1d6"
|
|
81
|
+
},
|
|
78
82
|
{
|
|
79
83
|
"path": "skills/brownfield-analysis/SKILL.md",
|
|
80
84
|
"sha256": "4ca65f8efe0b50d6c7b625f6355ec2961fe91affa154b9d1e91dfe1334bcaf99"
|
|
@@ -157,23 +161,23 @@
|
|
|
157
161
|
},
|
|
158
162
|
{
|
|
159
163
|
"path": "submission/openai/availability.md",
|
|
160
|
-
"sha256": "
|
|
164
|
+
"sha256": "57e428da0faf2a48f459796781b4f5b472dc10e1cea957f6078404bf6e7a184b"
|
|
161
165
|
},
|
|
162
166
|
{
|
|
163
167
|
"path": "submission/openai/capability-matrix.json",
|
|
164
|
-
"sha256": "
|
|
168
|
+
"sha256": "203b63da20727ac116fe816893c669725d46ff67388a934fa17cda68ea97f09a"
|
|
165
169
|
},
|
|
166
170
|
{
|
|
167
171
|
"path": "submission/openai/listing.json",
|
|
168
|
-
"sha256": "
|
|
172
|
+
"sha256": "29c2a8865f69e227d746548b487422135b7165c4c5aa4f92ed414b220dd21151"
|
|
169
173
|
},
|
|
170
174
|
{
|
|
171
175
|
"path": "submission/openai/release-notes.md",
|
|
172
|
-
"sha256": "
|
|
176
|
+
"sha256": "fcacfc5c8382ae589871359a3467dafac700822928999e680a106c484cc7044e"
|
|
173
177
|
},
|
|
174
178
|
{
|
|
175
179
|
"path": "submission/openai/reviewer-cases.json",
|
|
176
|
-
"sha256": "
|
|
180
|
+
"sha256": "e1ffc93e955edfab9a95cfaf0437badbf5f4741763cb0161f3de6b0e23c8bb27"
|
|
177
181
|
}
|
|
178
182
|
]
|
|
179
183
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"releaseVersion": "0.14.
|
|
3
|
+
"releaseVersion": "0.14.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": "
|
|
19
|
+
"detail": "44 inventoried files; inventory digest 0c78d217817ca7cec6cd2e8638e3a4fa678a7dc4c954119606f5f954bd1a2ca2"
|
|
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.14.
|
|
3
|
+
- release: `0.14.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 |
|
|
12
|
+
| bundle | pass | 44 inventoried files; inventory digest 0c78d217817ca7cec6cd2e8638e3a4fa678a7dc4c954119606f5f954bd1a2ca2 |
|
|
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.14.
|
|
1
|
+
# AGDF 0.14.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
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
INSTALLATION_PROVENANCE_FILE,
|
|
16
16
|
LEGACY_LOCAL_INSTALL_FILE,
|
|
17
17
|
digestDirectory,
|
|
18
|
+
inspectCopilotPayloadInventory,
|
|
18
19
|
digestNormalizedPluginSource,
|
|
19
20
|
inspectInstallationProvenance,
|
|
20
21
|
validateDistributionProfiles,
|
|
@@ -141,20 +142,39 @@ function claudeMarketplace(definition = pluginDefinition) {
|
|
|
141
142
|
};
|
|
142
143
|
}
|
|
143
144
|
|
|
145
|
+
function copilotMarketplace(definition = pluginDefinition) {
|
|
146
|
+
return {
|
|
147
|
+
name: MARKETPLACE_ID,
|
|
148
|
+
owner: { name: definition.displayName, email: "" },
|
|
149
|
+
metadata: { description: definition.description, version: definition.version },
|
|
150
|
+
plugins: [{
|
|
151
|
+
name: definition.id,
|
|
152
|
+
description: definition.copilotDescription || definition.longDescription,
|
|
153
|
+
version: definition.version,
|
|
154
|
+
source: "./plugins/agdf",
|
|
155
|
+
}],
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
144
159
|
function validateBuiltPlugin(pluginRoot, expectedVersion, expectedCodexInstallVersion = expectedVersion, sourceDigest = "", {
|
|
145
160
|
requireInstallationProvenance = false,
|
|
146
161
|
allowLegacyProvenanceForMigration = false,
|
|
147
162
|
allowPreProvenanceShape = false,
|
|
163
|
+
profileId = "runtime-plugin",
|
|
148
164
|
} = {}) {
|
|
149
165
|
const definition = readJson(join(pluginRoot, "meta", "agdf-plugin.definition.json"), "built plugin definition");
|
|
150
166
|
const runtime = readJson(join(pluginRoot, "runtime", "runtime-manifest.json"), "built runtime manifest");
|
|
151
|
-
const
|
|
152
|
-
const
|
|
167
|
+
const copilotProfile = profileId === "copilot-runtime-plugin";
|
|
168
|
+
const codex = copilotProfile ? null : readJson(join(pluginRoot, ".codex-plugin", "plugin.json"), "built Codex plugin manifest");
|
|
169
|
+
const claude = copilotProfile ? null : readJson(join(pluginRoot, ".claude-plugin", "plugin.json"), "built Claude plugin manifest");
|
|
170
|
+
const copilot = copilotProfile ? readJson(join(pluginRoot, "plugin.json"), "built Copilot plugin manifest") : null;
|
|
153
171
|
for (const required of [
|
|
154
|
-
join(pluginRoot, ".
|
|
155
|
-
|
|
172
|
+
...(copilotProfile ? [join(pluginRoot, "plugin.json"), join(pluginRoot, ".agdf-payload-inventory.json")] : [
|
|
173
|
+
join(pluginRoot, ".codex-plugin", "plugin.json"),
|
|
174
|
+
join(pluginRoot, ".claude-plugin", "plugin.json"),
|
|
175
|
+
join(pluginRoot, "scripts", "check-runtime-integrity.mjs"),
|
|
176
|
+
]),
|
|
156
177
|
join(pluginRoot, "runtime", "agdf-local.js"),
|
|
157
|
-
join(pluginRoot, "scripts", "check-runtime-integrity.mjs"),
|
|
158
178
|
]) {
|
|
159
179
|
if (!existsSync(required)) throw new Error(`Built plugin is incomplete: ${required}`);
|
|
160
180
|
}
|
|
@@ -178,13 +198,20 @@ function validateBuiltPlugin(pluginRoot, expectedVersion, expectedCodexInstallVe
|
|
|
178
198
|
if (profile.status !== "matched" && provenance?.status !== "legacy" && !isPreProvenanceShape) {
|
|
179
199
|
throw new Error("Built plugin distribution profile contract is invalid.");
|
|
180
200
|
}
|
|
181
|
-
if (codex.version !== expectedCodexInstallVersion) {
|
|
201
|
+
if (!copilotProfile && codex.version !== expectedCodexInstallVersion) {
|
|
182
202
|
throw new Error(`Built Codex plugin version mismatch: expected ${expectedCodexInstallVersion}, observed ${codex.version}`);
|
|
183
203
|
}
|
|
184
|
-
if (claude.version !== expectedVersion) {
|
|
204
|
+
if (!copilotProfile && claude.version !== expectedVersion) {
|
|
185
205
|
throw new Error(`Built Claude plugin version mismatch: expected ${expectedVersion}, observed ${claude.version}`);
|
|
186
206
|
}
|
|
187
|
-
if (
|
|
207
|
+
if (copilotProfile && copilot.version !== expectedVersion) {
|
|
208
|
+
throw new Error(`Built Copilot plugin version mismatch: expected ${expectedVersion}, observed ${copilot.version}`);
|
|
209
|
+
}
|
|
210
|
+
const copilotInventory = copilotProfile ? inspectCopilotPayloadInventory(pluginRoot, expectedVersion) : null;
|
|
211
|
+
if (copilotProfile && copilotInventory.status !== "matched") {
|
|
212
|
+
throw new Error(`Built Copilot plugin inventory is invalid: ${copilotInventory.reason}`);
|
|
213
|
+
}
|
|
214
|
+
if (!copilotProfile && expectedCodexInstallVersion !== expectedVersion) {
|
|
188
215
|
if (!isCodexLocalInstallVersion(expectedVersion, expectedCodexInstallVersion, sourceDigest)) {
|
|
189
216
|
throw new Error(`Invalid AGDF Codex local install version: ${expectedCodexInstallVersion}`);
|
|
190
217
|
}
|
|
@@ -199,6 +226,8 @@ function validateBuiltPlugin(pluginRoot, expectedVersion, expectedCodexInstallVe
|
|
|
199
226
|
runtimeManifest: runtime,
|
|
200
227
|
pluginVersion: expectedCodexInstallVersion,
|
|
201
228
|
allowLegacy: allowLegacyProvenanceForMigration,
|
|
229
|
+
profileId,
|
|
230
|
+
inventoryDigest: copilotInventory?.inventoryDigest ?? null,
|
|
202
231
|
});
|
|
203
232
|
if (provenance.status !== "matched"
|
|
204
233
|
&& !(allowLegacyProvenanceForMigration && provenance.status === "legacy")) {
|
|
@@ -208,11 +237,15 @@ function validateBuiltPlugin(pluginRoot, expectedVersion, expectedCodexInstallVe
|
|
|
208
237
|
return definition;
|
|
209
238
|
}
|
|
210
239
|
|
|
211
|
-
function validateMarketplaceRoot(root, definition = pluginDefinition) {
|
|
212
|
-
const
|
|
213
|
-
const
|
|
240
|
+
function validateMarketplaceRoot(root, definition = pluginDefinition, { profileId = "runtime-plugin" } = {}) {
|
|
241
|
+
const copilotProfile = profileId === "copilot-runtime-plugin";
|
|
242
|
+
const codex = copilotProfile ? null : readJson(join(root, ".agents", "plugins", "marketplace.json"), "Codex local marketplace manifest");
|
|
243
|
+
const copilot = copilotProfile ? readJson(join(root, ".github", "plugin", "marketplace.json"), "Copilot local marketplace manifest") : null;
|
|
244
|
+
const claude = copilotProfile ? null : readJson(join(root, ".claude-plugin", "marketplace.json"), "Claude local marketplace manifest");
|
|
214
245
|
const serializedCodex = JSON.stringify(codex);
|
|
215
|
-
const codexShape =
|
|
246
|
+
const codexShape = copilotProfile
|
|
247
|
+
? "current"
|
|
248
|
+
: serializedCodex === JSON.stringify(codexMarketplace(definition))
|
|
216
249
|
? "current"
|
|
217
250
|
: serializedCodex === JSON.stringify(legacyCodexMarketplace(definition))
|
|
218
251
|
? "legacy_full_product_label"
|
|
@@ -220,15 +253,19 @@ function validateMarketplaceRoot(root, definition = pluginDefinition) {
|
|
|
220
253
|
if (codexShape === "invalid") {
|
|
221
254
|
throw new Error(`Codex local marketplace manifest is not owned by ${MARKETPLACE_ID}: ${root}`);
|
|
222
255
|
}
|
|
223
|
-
if (JSON.stringify(claude) !== JSON.stringify(claudeMarketplace(definition))) {
|
|
256
|
+
if (!copilotProfile && JSON.stringify(claude) !== JSON.stringify(claudeMarketplace(definition))) {
|
|
224
257
|
throw new Error(`Claude local marketplace manifest is not owned by ${MARKETPLACE_ID}: ${root}`);
|
|
225
258
|
}
|
|
259
|
+
if (copilotProfile && JSON.stringify(copilot) !== JSON.stringify(copilotMarketplace(definition))) {
|
|
260
|
+
throw new Error(`Copilot local marketplace manifest is not owned by ${MARKETPLACE_ID}: ${root}`);
|
|
261
|
+
}
|
|
226
262
|
return Object.freeze({ codexShape });
|
|
227
263
|
}
|
|
228
264
|
|
|
229
|
-
function classifyExistingMarketplace(stableRoot, marker) {
|
|
265
|
+
function classifyExistingMarketplace(stableRoot, marker, { profileId = "runtime-plugin" } = {}) {
|
|
230
266
|
const existingPluginRoot = join(stableRoot, "plugins", MARKETPLACE_ID);
|
|
231
|
-
const
|
|
267
|
+
const copilotProfile = profileId === "copilot-runtime-plugin";
|
|
268
|
+
const existingCodexInstallVersion = copilotProfile ? marker.version : marker.codex_install_version ?? marker.version;
|
|
232
269
|
if (!isSemanticVersion(marker.version)
|
|
233
270
|
|| !/^[a-f0-9]{64}$/.test(marker.plugin_digest ?? "")) {
|
|
234
271
|
throw new Error(`Refusing invalid AGDF marketplace ownership evidence: ${stableRoot}`);
|
|
@@ -238,7 +275,7 @@ function classifyExistingMarketplace(stableRoot, marker) {
|
|
|
238
275
|
"built plugin definition",
|
|
239
276
|
);
|
|
240
277
|
const hasCurrentProvenance = existsSync(join(existingPluginRoot, INSTALLATION_PROVENANCE_FILE));
|
|
241
|
-
const hasLegacyProvenance = existsSync(join(existingPluginRoot, LEGACY_LOCAL_INSTALL_FILE));
|
|
278
|
+
const hasLegacyProvenance = !copilotProfile && existsSync(join(existingPluginRoot, LEGACY_LOCAL_INSTALL_FILE));
|
|
242
279
|
const preProvenanceCandidate = !hasCurrentProvenance
|
|
243
280
|
&& !hasLegacyProvenance
|
|
244
281
|
&& !Object.hasOwn(definition, "distributionProfiles");
|
|
@@ -249,9 +286,9 @@ function classifyExistingMarketplace(stableRoot, marker) {
|
|
|
249
286
|
marker.source_digest ?? "",
|
|
250
287
|
preProvenanceCandidate
|
|
251
288
|
? { allowPreProvenanceShape: true }
|
|
252
|
-
: { requireInstallationProvenance: true, allowLegacyProvenanceForMigration: true },
|
|
289
|
+
: { requireInstallationProvenance: true, allowLegacyProvenanceForMigration: true, profileId },
|
|
253
290
|
);
|
|
254
|
-
const marketplace = validateMarketplaceRoot(stableRoot, existingDefinition);
|
|
291
|
+
const marketplace = validateMarketplaceRoot(stableRoot, existingDefinition, { profileId });
|
|
255
292
|
if (digestDirectory(existingPluginRoot) !== marker.plugin_digest) {
|
|
256
293
|
throw new Error(`Refusing tampered AGDF marketplace root: ${stableRoot}`);
|
|
257
294
|
}
|
|
@@ -287,25 +324,30 @@ function recoverInterruptedTransaction(stableRoot, stageRoot, backupRoot, failed
|
|
|
287
324
|
|
|
288
325
|
export function prepareLocalMarketplace({
|
|
289
326
|
dataRoot = defaultAgdfDataRoot(),
|
|
290
|
-
builtPluginRoot
|
|
327
|
+
builtPluginRoot,
|
|
291
328
|
expectedVersion = pluginDefinition.version,
|
|
292
329
|
codexInstallVersion = expectedVersion,
|
|
293
330
|
codexRegistrationRevision = null,
|
|
331
|
+
profileId = "runtime-plugin",
|
|
294
332
|
} = {}) {
|
|
295
333
|
dataRoot = resolve(dataRoot);
|
|
334
|
+
const copilotProfile = profileId === "copilot-runtime-plugin";
|
|
335
|
+
if (!builtPluginRoot) builtPluginRoot = copilotProfile
|
|
336
|
+
? join(generatedRoot, "plugins", "copilot", "agdf")
|
|
337
|
+
: join(generatedRoot, "plugins", "agdf");
|
|
296
338
|
builtPluginRoot = resolve(builtPluginRoot);
|
|
297
|
-
const stableRoot = join(dataRoot, "marketplaces", MARKETPLACE_ID);
|
|
339
|
+
const stableRoot = join(dataRoot, "marketplaces", copilotProfile ? "agdf-copilot" : MARKETPLACE_ID);
|
|
298
340
|
const parent = dirname(stableRoot);
|
|
299
341
|
const stageRoot = `${stableRoot}.stage`;
|
|
300
342
|
const backupRoot = `${stableRoot}.backup`;
|
|
301
343
|
const failedRoot = `${stableRoot}.failed`;
|
|
302
344
|
if (!pathInside(dataRoot, stableRoot) || dirname(stableRoot) !== parent) throw new Error(`Unsafe AGDF marketplace root: ${stableRoot}`);
|
|
303
345
|
const sourceDigest = digestPluginSource(builtPluginRoot, expectedVersion);
|
|
304
|
-
if (codexInstallVersion !== expectedVersion
|
|
346
|
+
if (!copilotProfile && codexInstallVersion !== expectedVersion
|
|
305
347
|
&& !isCodexLocalInstallVersion(expectedVersion, codexInstallVersion, sourceDigest)) {
|
|
306
348
|
throw new Error(`Invalid AGDF Codex local install version: ${codexInstallVersion}`);
|
|
307
349
|
}
|
|
308
|
-
const targetDefinition = validateBuiltPlugin(builtPluginRoot, expectedVersion);
|
|
350
|
+
const targetDefinition = validateBuiltPlugin(builtPluginRoot, expectedVersion, expectedVersion, "", { profileId });
|
|
309
351
|
mkdirSync(parent, { recursive: true });
|
|
310
352
|
recoverInterruptedTransaction(stableRoot, stageRoot, backupRoot, failedRoot);
|
|
311
353
|
|
|
@@ -313,6 +355,7 @@ export function prepareLocalMarketplace({
|
|
|
313
355
|
if (existsSync(stableRoot)) {
|
|
314
356
|
try {
|
|
315
357
|
existing = ownership(stableRoot);
|
|
358
|
+
if ((existing.profile_id ?? "runtime-plugin") !== profileId) throw new Error(`AGDF marketplace profile mismatch: ${stableRoot}`);
|
|
316
359
|
} catch (error) {
|
|
317
360
|
throw invalidExistingMarketplace(error);
|
|
318
361
|
}
|
|
@@ -325,7 +368,7 @@ export function prepareLocalMarketplace({
|
|
|
325
368
|
if (existing) {
|
|
326
369
|
let classified;
|
|
327
370
|
try {
|
|
328
|
-
classified = classifyExistingMarketplace(stableRoot, existing);
|
|
371
|
+
classified = classifyExistingMarketplace(stableRoot, existing, { profileId });
|
|
329
372
|
} catch (error) {
|
|
330
373
|
throw invalidExistingMarketplace(error);
|
|
331
374
|
}
|
|
@@ -338,6 +381,7 @@ export function prepareLocalMarketplace({
|
|
|
338
381
|
schema_version: 1,
|
|
339
382
|
owner: "create-agdf",
|
|
340
383
|
marketplace_id: MARKETPLACE_ID,
|
|
384
|
+
profile_id: profileId,
|
|
341
385
|
codex_registration_revision: targetCodexRegistrationRevision,
|
|
342
386
|
version: expectedVersion,
|
|
343
387
|
codex_install_version: codexInstallVersion,
|
|
@@ -348,8 +392,8 @@ export function prepareLocalMarketplace({
|
|
|
348
392
|
});
|
|
349
393
|
const stagedPluginRoot = join(stageRoot, "plugins", MARKETPLACE_ID);
|
|
350
394
|
cpSync(builtPluginRoot, stagedPluginRoot, { recursive: true });
|
|
351
|
-
validateBuiltPlugin(stagedPluginRoot, expectedVersion);
|
|
352
|
-
if (codexInstallVersion !== expectedVersion) {
|
|
395
|
+
validateBuiltPlugin(stagedPluginRoot, expectedVersion, expectedVersion, "", { profileId });
|
|
396
|
+
if (!copilotProfile && codexInstallVersion !== expectedVersion) {
|
|
353
397
|
const codexManifestPath = join(stagedPluginRoot, ".codex-plugin", "plugin.json");
|
|
354
398
|
writeJson(codexManifestPath, { ...readJson(codexManifestPath, "built Codex plugin manifest"), version: codexInstallVersion });
|
|
355
399
|
}
|
|
@@ -357,25 +401,31 @@ export function prepareLocalMarketplace({
|
|
|
357
401
|
writeJson(join(stagedPluginRoot, INSTALLATION_PROVENANCE_FILE), {
|
|
358
402
|
schema_version: 1,
|
|
359
403
|
owner: "create-agdf",
|
|
360
|
-
profile_id:
|
|
404
|
+
profile_id: profileId,
|
|
361
405
|
marketplace_id: MARKETPLACE_ID,
|
|
362
406
|
canonical_version: expectedVersion,
|
|
363
407
|
codex_install_version: codexInstallVersion,
|
|
364
408
|
source_digest: sourceDigest,
|
|
365
409
|
runtime_digest: runtimeManifest.digest,
|
|
410
|
+
...(copilotProfile ? { inventory_digest: inspectCopilotPayloadInventory(stagedPluginRoot, expectedVersion).inventoryDigest } : {}),
|
|
366
411
|
});
|
|
367
412
|
if (existsSync(join(stagedPluginRoot, LEGACY_LOCAL_INSTALL_FILE))) {
|
|
368
413
|
rmSync(join(stagedPluginRoot, LEGACY_LOCAL_INSTALL_FILE));
|
|
369
414
|
}
|
|
370
|
-
validateBuiltPlugin(stagedPluginRoot, expectedVersion, codexInstallVersion, sourceDigest, { requireInstallationProvenance: true });
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
415
|
+
validateBuiltPlugin(stagedPluginRoot, expectedVersion, copilotProfile ? expectedVersion : codexInstallVersion, sourceDigest, { requireInstallationProvenance: true, profileId });
|
|
416
|
+
if (copilotProfile) {
|
|
417
|
+
writeJson(join(stageRoot, ".github", "plugin", "marketplace.json"), copilotMarketplace(targetDefinition));
|
|
418
|
+
} else {
|
|
419
|
+
writeJson(join(stageRoot, ".agents", "plugins", "marketplace.json"), codexMarketplace(targetDefinition));
|
|
420
|
+
writeJson(join(stageRoot, ".claude-plugin", "marketplace.json"), claudeMarketplace(targetDefinition));
|
|
421
|
+
}
|
|
422
|
+
validateMarketplaceRoot(stageRoot, targetDefinition, { profileId });
|
|
374
423
|
const pluginDigest = digestDirectory(stagedPluginRoot);
|
|
375
424
|
const marker = {
|
|
376
425
|
schema_version: 1,
|
|
377
426
|
owner: "create-agdf",
|
|
378
427
|
marketplace_id: MARKETPLACE_ID,
|
|
428
|
+
profile_id: profileId,
|
|
379
429
|
codex_registration_revision: targetCodexRegistrationRevision,
|
|
380
430
|
version: expectedVersion,
|
|
381
431
|
codex_install_version: codexInstallVersion,
|
|
@@ -448,6 +498,10 @@ export function prepareLocalMarketplace({
|
|
|
448
498
|
}
|
|
449
499
|
}
|
|
450
500
|
|
|
501
|
+
export function prepareCopilotMarketplace(options = {}) {
|
|
502
|
+
return prepareLocalMarketplace({ ...options, profileId: "copilot-runtime-plugin", codexInstallVersion: options.expectedVersion ?? pluginDefinition.version });
|
|
503
|
+
}
|
|
504
|
+
|
|
451
505
|
export function inspectLocalMarketplaceProjection({
|
|
452
506
|
dataRoot = defaultAgdfDataRoot(),
|
|
453
507
|
expectedVersion = pluginDefinition.version,
|
|
@@ -478,6 +532,34 @@ export function inspectLocalMarketplaceProjection({
|
|
|
478
532
|
});
|
|
479
533
|
}
|
|
480
534
|
|
|
535
|
+
export function inspectOwnedSharedMarketplaceForCopilotMigration({
|
|
536
|
+
dataRoot = defaultAgdfDataRoot(),
|
|
537
|
+
expectedVersion = pluginDefinition.version,
|
|
538
|
+
} = {}) {
|
|
539
|
+
const root = join(resolve(dataRoot), "marketplaces", MARKETPLACE_ID);
|
|
540
|
+
if (!existsSync(root)) return null;
|
|
541
|
+
const marker = ownership(root);
|
|
542
|
+
if ((marker.profile_id ?? "runtime-plugin") !== "runtime-plugin"
|
|
543
|
+
|| marker.version !== expectedVersion
|
|
544
|
+
|| !/^[a-f0-9]{64}$/.test(marker.plugin_digest ?? "")) {
|
|
545
|
+
throw new Error(`Refusing incompatible AGDF shared marketplace migration source: ${root}`);
|
|
546
|
+
}
|
|
547
|
+
const pluginRoot = join(root, "plugins", MARKETPLACE_ID);
|
|
548
|
+
const definition = readJson(join(pluginRoot, "meta", "agdf-plugin.definition.json"), "shared plugin definition");
|
|
549
|
+
const runtime = readJson(join(pluginRoot, "runtime", "runtime-manifest.json"), "shared runtime manifest");
|
|
550
|
+
const codex = readJson(join(pluginRoot, ".codex-plugin", "plugin.json"), "shared Codex manifest");
|
|
551
|
+
const claude = readJson(join(pluginRoot, ".claude-plugin", "plugin.json"), "shared Claude manifest");
|
|
552
|
+
if (definition.id !== MARKETPLACE_ID
|
|
553
|
+
|| definition.version !== expectedVersion
|
|
554
|
+
|| runtime.version !== expectedVersion
|
|
555
|
+
|| claude.version !== expectedVersion
|
|
556
|
+
|| (codex.version !== expectedVersion && !isCodexLocalInstallVersion(expectedVersion, codex.version))
|
|
557
|
+
|| digestDirectory(pluginRoot) !== marker.plugin_digest) {
|
|
558
|
+
throw new Error(`Refusing stale or tampered AGDF shared marketplace migration source: ${root}`);
|
|
559
|
+
}
|
|
560
|
+
return Object.freeze({ root, pluginRoot, version: marker.version, digest: marker.plugin_digest });
|
|
561
|
+
}
|
|
562
|
+
|
|
481
563
|
function normalizedLegacySource(value) {
|
|
482
564
|
if (typeof value !== "string") return "";
|
|
483
565
|
return value.trim().toLowerCase()
|
|
@@ -4,7 +4,7 @@ import { join, resolve } from "node:path";
|
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { pluginDefinition } from "../cli/runtime-context.js";
|
|
6
6
|
import { digestNormalizedPluginSource } from "../runtime/plugin-provenance.js";
|
|
7
|
-
import { CODEX_REGISTRATION_REVISION, classifyMarketplaceList, inspectLocalMarketplaceProjection, isCodexLocalInstallVersion, prepareLocalMarketplace } from "./local-marketplace.js";
|
|
7
|
+
import { CODEX_REGISTRATION_REVISION, classifyMarketplaceList, inspectLocalMarketplaceProjection, inspectOwnedSharedMarketplaceForCopilotMigration, isCodexLocalInstallVersion, prepareCopilotMarketplace, prepareLocalMarketplace } from "./local-marketplace.js";
|
|
8
8
|
|
|
9
9
|
export const COPILOT_CLI_NPM_PACKAGE = "@github/copilot@1.0.80";
|
|
10
10
|
|
|
@@ -99,7 +99,7 @@ export function installClaudeGlobalPlugin({ exec = execFileSync, prepare = prepa
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
export function installCopilotGlobalPlugin({ exec = execFileSync, packagedCopilotExec = execFileSync, prepare =
|
|
102
|
+
export function installCopilotGlobalPlugin({ exec = execFileSync, packagedCopilotExec = execFileSync, prepare = prepareCopilotMarketplace, dataRoot, pluginRoot } = {}) {
|
|
103
103
|
const expectedVersion = pluginDefinition.version;
|
|
104
104
|
const transaction = pluginRoot ? null : prepare({ expectedVersion, ...(dataRoot ? { dataRoot } : {}) });
|
|
105
105
|
const effectivePluginRoot = pluginRoot ?? transaction?.pluginRoot;
|
|
@@ -139,19 +139,41 @@ export function installCopilotGlobalPlugin({ exec = execFileSync, packagedCopilo
|
|
|
139
139
|
}
|
|
140
140
|
const directInstalled = pluginListHasPlugin(before, "agdf");
|
|
141
141
|
const marketplaceInstalled = pluginListHasPlugin(before, "agdf@agdf");
|
|
142
|
+
let legacySharedProjection = null;
|
|
143
|
+
if (transaction) {
|
|
144
|
+
try { legacySharedProjection = inspectOwnedSharedMarketplaceForCopilotMigration({ ...(dataRoot ? { dataRoot } : {}), expectedVersion }); } catch {}
|
|
145
|
+
}
|
|
142
146
|
let marketplaceAdded = false;
|
|
147
|
+
let legacyMarketplaceRemoved = false;
|
|
148
|
+
let marketplacePluginRemoved = false;
|
|
143
149
|
let directRemoved = false;
|
|
144
150
|
try {
|
|
145
151
|
const nativeOutput = [];
|
|
146
152
|
const marketplaceOutput = runPluginPhase(activeExec, "copilot", ["plugin", "marketplace", "list"], "marketplace", captureOptions());
|
|
147
|
-
const marketplace = classifyCopilotMarketplaceList(
|
|
153
|
+
const marketplace = classifyCopilotMarketplaceList(
|
|
154
|
+
marketplaceOutput,
|
|
155
|
+
transaction?.root ?? resolve(effectivePluginRoot, "..", ".."),
|
|
156
|
+
{ ownedLegacyRoots: legacySharedProjection ? [legacySharedProjection.root] : [] },
|
|
157
|
+
);
|
|
148
158
|
if (marketplace.state === "conflict") {
|
|
149
159
|
throw lifecycleAdapterError("marketplace", `Refusing to replace non-AGDF Copilot marketplace registration agdf (${marketplace.source || "unknown source"}).`);
|
|
150
160
|
}
|
|
151
|
-
if (marketplace.state === "
|
|
161
|
+
if (marketplace.state === "owned_legacy_shared") {
|
|
162
|
+
if (marketplaceInstalled) {
|
|
163
|
+
nativeOutput.push(runPluginPhase(activeExec, "copilot", ["plugin", "uninstall", "agdf@agdf"], "plugin_operation", captureOptions()));
|
|
164
|
+
marketplacePluginRemoved = true;
|
|
165
|
+
}
|
|
166
|
+
nativeOutput.push(runPluginPhase(activeExec, "copilot", ["plugin", "marketplace", "remove", "agdf"], "marketplace", captureOptions()));
|
|
167
|
+
legacyMarketplaceRemoved = true;
|
|
168
|
+
}
|
|
169
|
+
if (["absent", "owned_legacy_shared"].includes(marketplace.state)) {
|
|
152
170
|
nativeOutput.push(runPluginPhase(activeExec, "copilot", ["plugin", "marketplace", "add", transaction?.root ?? resolve(effectivePluginRoot, "..", "..")], "marketplace", captureOptions()));
|
|
153
171
|
marketplaceAdded = true;
|
|
154
172
|
}
|
|
173
|
+
if (marketplace.state === "owned_local_current" && marketplaceInstalled) {
|
|
174
|
+
nativeOutput.push(runPluginPhase(activeExec, "copilot", ["plugin", "uninstall", "agdf@agdf"], "plugin_operation", captureOptions()));
|
|
175
|
+
marketplacePluginRemoved = true;
|
|
176
|
+
}
|
|
155
177
|
if (directInstalled) {
|
|
156
178
|
nativeOutput.push(runPluginPhase(activeExec, "copilot", ["plugin", "uninstall", "agdf"], "plugin_operation", captureOptions()));
|
|
157
179
|
directRemoved = true;
|
|
@@ -169,7 +191,7 @@ export function installCopilotGlobalPlugin({ exec = execFileSync, packagedCopilo
|
|
|
169
191
|
surface: "copilot", operation: directInstalled || marketplaceInstalled ? "update" : "install", expectedVersion,
|
|
170
192
|
installedVersion: installedVersion || null, verificationStatus: installedVersion ? "healthy" : "degraded",
|
|
171
193
|
manualHandoff: false,
|
|
172
|
-
evidence: [...bootstrapEvidence, "durable_local_plugin_stage", "copilot plugin marketplace list", ...(marketplaceAdded ? ["copilot plugin marketplace add"] : ["marketplace:owned_local_current"]), ...(directRemoved ? ["direct_install_migrated"] : []), "copilot plugin install agdf@agdf", "copilot plugin list", `local_plugin_root:${effectivePluginRoot}`, `source_digest:${sourceDigest}`, ...(installedVersion ? [] : ["host_did_not_expose_version"])],
|
|
194
|
+
evidence: [...bootstrapEvidence, "durable_local_plugin_stage", "copilot plugin marketplace list", ...(marketplaceAdded ? ["copilot plugin marketplace add"] : ["marketplace:owned_local_current"]), ...(legacyMarketplaceRemoved ? ["shared_marketplace_registration_migrated"] : []), ...(directRemoved ? ["direct_install_migrated"] : []), "copilot plugin install agdf@agdf", "copilot plugin list", `local_plugin_root:${effectivePluginRoot}`, `source_digest:${sourceDigest}`, ...(installedVersion ? [] : ["host_did_not_expose_version"])],
|
|
173
195
|
pluginRoot: effectivePluginRoot, runtimeDigest: runtimeManifest.digest, sourceDigest, nativeOutput: nativeOutput.filter(Boolean).map(String),
|
|
174
196
|
};
|
|
175
197
|
} catch (error) {
|
|
@@ -188,18 +210,32 @@ export function installCopilotGlobalPlugin({ exec = execFileSync, packagedCopilo
|
|
|
188
210
|
error.evidence = { ...(error.evidence ?? {}), marketplace_recovery: commandErrorText(recoveryError) };
|
|
189
211
|
}
|
|
190
212
|
}
|
|
213
|
+
if (legacyMarketplaceRemoved && legacySharedProjection) {
|
|
214
|
+
try {
|
|
215
|
+
activeExec("copilot", ["plugin", "marketplace", "add", legacySharedProjection.root], captureOptions());
|
|
216
|
+
if (marketplacePluginRemoved) activeExec("copilot", ["plugin", "install", "agdf@agdf"], captureOptions());
|
|
217
|
+
} catch (recoveryError) {
|
|
218
|
+
error.evidence = { ...(error.evidence ?? {}), legacy_marketplace_recovery: commandErrorText(recoveryError) };
|
|
219
|
+
}
|
|
220
|
+
} else if (marketplacePluginRemoved) {
|
|
221
|
+
try {
|
|
222
|
+
activeExec("copilot", ["plugin", "install", "agdf@agdf"], captureOptions());
|
|
223
|
+
} catch (recoveryError) {
|
|
224
|
+
error.evidence = { ...(error.evidence ?? {}), marketplace_plugin_recovery: commandErrorText(recoveryError) };
|
|
225
|
+
}
|
|
226
|
+
}
|
|
191
227
|
throw error;
|
|
192
228
|
}
|
|
193
229
|
}
|
|
194
230
|
|
|
195
|
-
export function classifyCopilotMarketplaceList(output, expectedRoot) {
|
|
231
|
+
export function classifyCopilotMarketplaceList(output, expectedRoot, { ownedLegacyRoots = [] } = {}) {
|
|
196
232
|
const line = String(output || "").split(/\r?\n/).find((entry) => /^\s*[◆•]?\s*agdf\s+\(/.test(entry));
|
|
197
233
|
if (!line) return { state: "absent", source: "" };
|
|
198
234
|
const local = line.match(/\(Local:\s*(.+)\)\s*$/);
|
|
199
235
|
if (!local) return { state: "conflict", source: line.trim() };
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
236
|
+
if (resolve(local[1]) === resolve(expectedRoot)) return { state: "owned_local_current", source: local[1] };
|
|
237
|
+
if (ownedLegacyRoots.some((root) => resolve(root) === resolve(local[1]))) return { state: "owned_legacy_shared", source: local[1] };
|
|
238
|
+
return { state: "conflict", source: local[1] };
|
|
203
239
|
}
|
|
204
240
|
|
|
205
241
|
export function copilotNpmInvocation({ env = process.env, platform = process.platform, execPath = process.execPath } = {}) {
|