@open-agent-toolkit/cli 0.1.73 → 0.1.76
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/config/dispatch-matrix-recommendation.json +13 -17
- package/assets/docs/cli-utilities/configuration.md +53 -72
- package/assets/docs/cli-utilities/workflow-gates.md +38 -2
- package/assets/docs/provider-sync/commands.md +26 -0
- package/assets/docs/provider-sync/config.md +17 -6
- package/assets/docs/provider-sync/index.md +17 -5
- package/assets/docs/provider-sync/manifest-and-drift.md +39 -1
- package/assets/docs/provider-sync/providers.md +23 -19
- package/assets/docs/provider-sync/scope-and-surface.md +5 -1
- package/assets/docs/reference/file-locations.md +9 -3
- package/assets/docs/reference/oat-directory-structure.md +11 -3
- package/assets/docs/reference/troubleshooting.md +11 -0
- package/assets/docs/workflows/projects/artifacts.md +1 -1
- package/assets/docs/workflows/projects/dispatch-ceiling.md +29 -33
- package/assets/docs/workflows/projects/implementation-execution.md +7 -4
- package/assets/docs/workflows/projects/lifecycle.md +4 -3
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/create-agnostic-skill/SKILL.md +1 -1
- package/assets/skills/create-agnostic-skill/references/docs/skills-guide.md +24 -15
- package/assets/skills/oat-agent-instructions-analyze/references/docs/provider-reference.md +9 -3
- package/assets/skills/oat-agent-instructions-apply/references/docs/provider-reference.md +9 -3
- package/assets/skills/oat-dispatch-subagents/SKILL.md +1 -1
- package/assets/skills/oat-dispatch-subagents/references/provider-cursor.md +27 -15
- package/assets/skills/oat-project-autonomous/SKILL.md +1 -1
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +1 -1
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-implement/references/completion-and-closeout.md +17 -15
- package/assets/skills/oat-project-implement/references/dispatch-and-dry-run.md +15 -9
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-implement/references/phase-execution.md +11 -5
- package/assets/skills/oat-project-import-plan/SKILL.md +30 -8
- package/assets/skills/oat-project-plan/SKILL.md +30 -8
- package/assets/skills/oat-project-plan-writing/SKILL.md +12 -9
- package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-quick-start/SKILL.md +30 -8
- package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-review-provide/SKILL.md +19 -11
- package/assets/skills/oat-project-review-provide-remote/SKILL.md +27 -4
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +55 -0
- package/dist/commands/doctor/index.d.ts +2 -1
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +37 -1
- package/dist/commands/gate/index.d.ts +1 -1
- package/dist/commands/gate/index.d.ts.map +1 -1
- package/dist/commands/gate/index.js +35 -3
- package/dist/commands/init/index.d.ts +7 -3
- package/dist/commands/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +129 -38
- package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
- package/dist/commands/project/dispatch-ceiling/index.js +17 -9
- package/dist/commands/remove/skill/remove-skill.d.ts +2 -0
- package/dist/commands/remove/skill/remove-skill.d.ts.map +1 -1
- package/dist/commands/remove/skill/remove-skill.js +20 -2
- package/dist/commands/shared/adopt-stray.d.ts.map +1 -1
- package/dist/commands/shared/adopt-stray.js +3 -0
- package/dist/commands/shared/codex-strays.d.ts +9 -0
- package/dist/commands/shared/codex-strays.d.ts.map +1 -1
- package/dist/commands/shared/codex-strays.js +4 -0
- package/dist/commands/shared/cursor-skill-disposition.d.ts +17 -0
- package/dist/commands/shared/cursor-skill-disposition.d.ts.map +1 -0
- package/dist/commands/shared/cursor-skill-disposition.js +41 -0
- package/dist/commands/status/index.d.ts +17 -5
- package/dist/commands/status/index.d.ts.map +1 -1
- package/dist/commands/status/index.js +151 -47
- package/dist/commands/sync/apply.d.ts.map +1 -1
- package/dist/commands/sync/apply.js +50 -24
- package/dist/commands/sync/dry-run.d.ts.map +1 -1
- package/dist/commands/sync/dry-run.js +31 -18
- package/dist/commands/sync/index.d.ts.map +1 -1
- package/dist/commands/sync/index.js +34 -25
- package/dist/commands/sync/sync.types.d.ts +26 -11
- package/dist/commands/sync/sync.types.d.ts.map +1 -1
- package/dist/commands/sync/sync.utils.d.ts.map +1 -1
- package/dist/commands/sync/sync.utils.js +3 -2
- package/dist/config/oat-config.d.ts +0 -1
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +26 -23
- package/dist/config/sync-config.d.ts +6 -2
- package/dist/config/sync-config.d.ts.map +1 -1
- package/dist/config/sync-config.js +18 -6
- package/dist/config/user-sync-config.d.ts +11 -0
- package/dist/config/user-sync-config.d.ts.map +1 -0
- package/dist/config/user-sync-config.js +61 -0
- package/dist/drift/strays.d.ts +1 -1
- package/dist/drift/strays.d.ts.map +1 -1
- package/dist/drift/strays.js +2 -1
- package/dist/engine/compute-plan.d.ts.map +1 -1
- package/dist/engine/compute-plan.js +154 -4
- package/dist/engine/engine.types.d.ts +2 -2
- package/dist/engine/engine.types.d.ts.map +1 -1
- package/dist/engine/engine.types.js +1 -0
- package/dist/engine/execute-plan.d.ts.map +1 -1
- package/dist/engine/execute-plan.js +4 -0
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/engine/scanner.d.ts +3 -1
- package/dist/engine/scanner.d.ts.map +1 -1
- package/dist/engine/scanner.js +4 -2
- package/dist/manifest/manifest.types.d.ts +12 -12
- package/dist/providers/ceiling/registry.d.ts +2 -0
- package/dist/providers/ceiling/registry.d.ts.map +1 -1
- package/dist/providers/ceiling/registry.js +20 -4
- package/dist/providers/codex/codec/sync-extension.d.ts +11 -10
- package/dist/providers/codex/codec/sync-extension.d.ts.map +1 -1
- package/dist/providers/codex/codec/sync-extension.js +42 -14
- package/dist/providers/cursor/codec/catalog.d.ts +18 -0
- package/dist/providers/cursor/codec/catalog.d.ts.map +1 -0
- package/dist/providers/cursor/codec/catalog.js +39 -0
- package/dist/providers/cursor/codec/materialize.d.ts +24 -0
- package/dist/providers/cursor/codec/materialize.d.ts.map +1 -0
- package/dist/providers/cursor/codec/materialize.js +166 -0
- package/dist/providers/cursor/codec/shared.d.ts +14 -0
- package/dist/providers/cursor/codec/shared.d.ts.map +1 -0
- package/dist/providers/cursor/codec/shared.js +76 -0
- package/dist/providers/cursor/codec/sync-extension.d.ts +37 -0
- package/dist/providers/cursor/codec/sync-extension.d.ts.map +1 -0
- package/dist/providers/cursor/codec/sync-extension.js +393 -0
- package/dist/providers/cursor/index.d.ts +3 -0
- package/dist/providers/cursor/index.d.ts.map +1 -1
- package/dist/providers/cursor/index.js +3 -0
- package/dist/providers/cursor/paths.d.ts.map +1 -1
- package/dist/providers/cursor/paths.js +6 -4
- package/dist/providers/identity/availability.d.ts +7 -0
- package/dist/providers/identity/availability.d.ts.map +1 -1
- package/dist/providers/identity/availability.js +23 -0
- package/dist/providers/shared/adapter.types.d.ts +6 -0
- package/dist/providers/shared/adapter.types.d.ts.map +1 -1
- package/dist/providers/shared/adapter.utils.d.ts +2 -1
- package/dist/providers/shared/adapter.utils.d.ts.map +1 -1
- package/dist/providers/shared/adapter.utils.js +29 -6
- package/dist/providers/shared/index.d.ts +2 -0
- package/dist/providers/shared/index.d.ts.map +1 -1
- package/dist/providers/shared/index.js +1 -0
- package/dist/providers/shared/materialization-extension.d.ts +44 -0
- package/dist/providers/shared/materialization-extension.d.ts.map +1 -0
- package/dist/providers/shared/materialization-extension.js +26 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/status/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,KAAK,cAAc,
|
|
1
|
+
{"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GAAG,EAAE,aAAa,KACf,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACzE,UAAU,EAAE,CACV,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,KACrC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvB,2BAA2B,EAAE,CAC3B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,KACrC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvB,iBAAiB,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,MAAM,CAAC;CACvD;AAED,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,YAAY,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAkrBD,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAC1C,OAAO,CAoBT"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { basename, join, relative } from 'node:path';
|
|
2
2
|
import { buildCommandContext, } from '../../app/command-context.js';
|
|
3
3
|
import { adoptStrayToCanonical, isAdoptionConflictError, } from '../shared/adopt-stray.js';
|
|
4
|
-
import { detectCodexRoleStrays, regenerateCodexAfterAdoption, } from '../shared/codex-strays.js';
|
|
4
|
+
import { detectCodexRoleStrays, filterMaterializationManagedStrays, regenerateCodexAfterAdoption, } from '../shared/codex-strays.js';
|
|
5
|
+
import { applyCursorSkillDisposition, isCursorSkillCandidate, } from '../shared/cursor-skill-disposition.js';
|
|
5
6
|
import { withScopeOption } from '../shared/scope-option.js';
|
|
6
|
-
import { confirmAction, selectManyWithAbort, } from '../shared/shared.prompts.js';
|
|
7
|
+
import { confirmAction, selectManyWithAbort, selectWithAbort, } from '../shared/shared.prompts.js';
|
|
7
8
|
import { readGlobalOptions, resolveConcreteScopes, } from '../shared/shared.utils.js';
|
|
8
9
|
import { DEFAULT_SYNC_CONFIG, loadSyncConfig, } from '../../config/index.js';
|
|
9
|
-
import {
|
|
10
|
+
import { resolveUserSyncConfig } from '../../config/user-sync-config.js';
|
|
10
11
|
import { detectDrift, detectStrays, filterKnownStrays, } from '../../drift/index.js';
|
|
11
|
-
import { HOOK_DRIFT_WARNING, HOOK_STRAY_INFO,
|
|
12
|
+
import { HOOK_DRIFT_WARNING, HOOK_STRAY_INFO, scanBundledManagedAgents, scanCanonical, } from '../../engine/index.js';
|
|
12
13
|
import { normalizeToPosixPath, resolveProjectRoot, resolveScopeRoot, } from '../../fs/paths.js';
|
|
13
14
|
import { loadManifest, saveManifest } from '../../manifest/manager.js';
|
|
14
15
|
import { claudeAdapter } from '../../providers/claude/index.js';
|
|
@@ -16,8 +17,10 @@ import { codexAdapter } from '../../providers/codex/index.js';
|
|
|
16
17
|
import { applyCodexProjectExtensionPlan, computeCodexProjectExtensionPlan, } from '../../providers/codex/codec/sync-extension.js';
|
|
17
18
|
import { copilotAdapter } from '../../providers/copilot/index.js';
|
|
18
19
|
import { cursorAdapter } from '../../providers/cursor/index.js';
|
|
20
|
+
import { applyCursorProjectExtensionPlan, computeCursorProjectExtensionPlan, } from '../../providers/cursor/codec/sync-extension.js';
|
|
19
21
|
import { geminiAdapter } from '../../providers/gemini/index.js';
|
|
20
22
|
import { getActiveAdapters, getSyncMappings, } from '../../providers/shared/index.js';
|
|
23
|
+
import { getAdoptionSources } from '../../providers/shared/adapter.utils.js';
|
|
21
24
|
import { SCOPE_CONTENT_TYPES, } from '../../shared/types.js';
|
|
22
25
|
import { formatStatusTable } from '../../ui/output.js';
|
|
23
26
|
import { Command } from 'commander';
|
|
@@ -34,10 +37,10 @@ const DEFAULT_DEPENDENCIES = {
|
|
|
34
37
|
async loadSyncConfig(configPath) {
|
|
35
38
|
return loadSyncConfig(configPath, DEFAULT_SYNC_CONFIG);
|
|
36
39
|
},
|
|
37
|
-
|
|
40
|
+
resolveUserSyncConfig,
|
|
38
41
|
saveManifest,
|
|
39
42
|
scanCanonical,
|
|
40
|
-
|
|
43
|
+
scanBundledManagedAgents,
|
|
41
44
|
getAdapters() {
|
|
42
45
|
return [
|
|
43
46
|
claudeAdapter,
|
|
@@ -49,14 +52,19 @@ const DEFAULT_DEPENDENCIES = {
|
|
|
49
52
|
},
|
|
50
53
|
getActiveAdapters,
|
|
51
54
|
getSyncMappings,
|
|
55
|
+
getAdoptionSources,
|
|
52
56
|
detectDrift,
|
|
53
57
|
detectStrays,
|
|
54
58
|
detectCodexRoleStrays,
|
|
55
59
|
computeCodexProjectExtensionPlan,
|
|
56
60
|
applyCodexProjectExtensionPlan,
|
|
61
|
+
computeCursorProjectExtensionPlan,
|
|
62
|
+
applyCursorProjectExtensionPlan,
|
|
57
63
|
selectManyWithAbort,
|
|
64
|
+
selectWithAbort,
|
|
58
65
|
confirmAction,
|
|
59
66
|
adoptStray: adoptStrayDefault,
|
|
67
|
+
applyCursorSkillDisposition,
|
|
60
68
|
formatStatusTable,
|
|
61
69
|
};
|
|
62
70
|
function entryInsideMapping(entryProviderPath, mappingProviderDir) {
|
|
@@ -122,19 +130,52 @@ async function collectScopeReports(scope, context, dependencies) {
|
|
|
122
130
|
const manifestPath = join(scopeRoot, '.oat', 'sync', 'manifest.json');
|
|
123
131
|
const syncConfigPath = join(scopeRoot, '.oat', 'sync', 'config.json');
|
|
124
132
|
const userConfigDir = join(context.home, '.oat');
|
|
125
|
-
const [manifest, canonicalEntries, syncConfig,
|
|
133
|
+
const [manifest, canonicalEntries, syncConfig, userSyncConfig] = await Promise.all([
|
|
126
134
|
dependencies.loadManifest(manifestPath),
|
|
127
135
|
dependencies.scanCanonical(scopeRoot, scope),
|
|
128
136
|
dependencies.loadSyncConfig(syncConfigPath),
|
|
129
|
-
dependencies.
|
|
137
|
+
dependencies.resolveUserSyncConfig(userConfigDir),
|
|
130
138
|
]);
|
|
131
139
|
const adapters = dependencies.getAdapters();
|
|
132
140
|
const activeAdapters = await dependencies.getActiveAdapters(adapters, scopeRoot);
|
|
133
141
|
const reports = [];
|
|
134
142
|
const strayCandidates = [];
|
|
135
143
|
const trackedCanonicalByProvider = new Set(manifest.entries.map((entry) => `${entry.provider}|${normalizeToPosixPath(entry.canonicalPath)}`));
|
|
144
|
+
const activeProviderNames = new Set(activeAdapters.map((adapter) => adapter.name));
|
|
145
|
+
const extensionCanonicalEntries = scope === 'user' &&
|
|
146
|
+
(activeProviderNames.has('codex') || activeProviderNames.has('cursor'))
|
|
147
|
+
? [
|
|
148
|
+
...canonicalEntries,
|
|
149
|
+
...(await dependencies.scanBundledManagedAgents()),
|
|
150
|
+
]
|
|
151
|
+
: canonicalEntries;
|
|
152
|
+
const codexExtensionPlan = activeProviderNames.has('codex')
|
|
153
|
+
? await dependencies.computeCodexProjectExtensionPlan(scopeRoot, extensionCanonicalEntries, undefined, { userConfigDir })
|
|
154
|
+
: undefined;
|
|
155
|
+
const cursorExtensionPlan = activeProviderNames.has('cursor')
|
|
156
|
+
? await dependencies.computeCursorProjectExtensionPlan(scopeRoot, extensionCanonicalEntries, undefined, { userConfigDir })
|
|
157
|
+
: undefined;
|
|
158
|
+
const materializationPlans = [
|
|
159
|
+
...(codexExtensionPlan
|
|
160
|
+
? [
|
|
161
|
+
{
|
|
162
|
+
provider: 'codex',
|
|
163
|
+
operations: codexExtensionPlan.operations.map((operation) => ({
|
|
164
|
+
...operation,
|
|
165
|
+
provider: 'codex',
|
|
166
|
+
entryName: operation.roleName,
|
|
167
|
+
})),
|
|
168
|
+
managedEntries: codexExtensionPlan.managedRoles,
|
|
169
|
+
aggregateHash: codexExtensionPlan.aggregateConfigHash,
|
|
170
|
+
metadata: codexExtensionPlan.metadata,
|
|
171
|
+
},
|
|
172
|
+
]
|
|
173
|
+
: []),
|
|
174
|
+
...(cursorExtensionPlan ? [cursorExtensionPlan] : []),
|
|
175
|
+
];
|
|
136
176
|
for (const adapter of activeAdapters) {
|
|
137
177
|
const mappings = dependencies.getSyncMappings(adapter, scope);
|
|
178
|
+
const adoptionSources = dependencies.getAdoptionSources(adapter, scope);
|
|
138
179
|
const mappingContentTypes = new Set(mappings.map((mapping) => mapping.contentType));
|
|
139
180
|
for (const entry of manifest.entries) {
|
|
140
181
|
if (entry.provider !== adapter.name) {
|
|
@@ -177,9 +218,9 @@ async function collectScopeReports(scope, context, dependencies) {
|
|
|
177
218
|
});
|
|
178
219
|
}
|
|
179
220
|
}
|
|
180
|
-
for (const
|
|
181
|
-
const providerDir = join(scopeRoot,
|
|
182
|
-
const strays = await dependencies.detectStrays(adapter.name, providerDir, manifest, canonicalEntries, mapping);
|
|
221
|
+
for (const source of adoptionSources) {
|
|
222
|
+
const providerDir = join(scopeRoot, source.directory);
|
|
223
|
+
const strays = filterMaterializationManagedStrays((await dependencies.detectStrays(adapter.name, providerDir, manifest, canonicalEntries, source.mapping)).map((report) => ({ provider: adapter.name, report })), materializationPlans).map((candidate) => candidate.report);
|
|
183
224
|
reports.push(...strays);
|
|
184
225
|
for (const stray of strays) {
|
|
185
226
|
if (stray.state.status !== 'stray') {
|
|
@@ -188,29 +229,22 @@ async function collectScopeReports(scope, context, dependencies) {
|
|
|
188
229
|
strayCandidates.push({
|
|
189
230
|
provider: adapter.name,
|
|
190
231
|
report: stray,
|
|
191
|
-
mapping,
|
|
232
|
+
mapping: source.mapping,
|
|
192
233
|
});
|
|
193
234
|
}
|
|
194
235
|
}
|
|
195
236
|
}
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
? [
|
|
199
|
-
...canonicalEntries,
|
|
200
|
-
...(await dependencies.scanBundledManagedCodexAgents()),
|
|
201
|
-
]
|
|
202
|
-
: canonicalEntries;
|
|
203
|
-
const codexExtensionPlan = await dependencies.computeCodexProjectExtensionPlan(scopeRoot, codexCanonicalEntries, undefined, { userConfigDir: join(context.home, '.oat') });
|
|
204
|
-
for (const operation of codexExtensionPlan.operations) {
|
|
237
|
+
for (const extensionPlan of materializationPlans) {
|
|
238
|
+
for (const operation of extensionPlan.operations) {
|
|
205
239
|
if (operation.action === 'skip') {
|
|
206
240
|
continue;
|
|
207
241
|
}
|
|
208
242
|
if (operation.target === 'role') {
|
|
209
243
|
reports.push({
|
|
210
|
-
canonical: operation.
|
|
211
|
-
? `.agents/agents/${operation.
|
|
244
|
+
canonical: operation.entryName
|
|
245
|
+
? `.agents/agents/${operation.entryName}.md`
|
|
212
246
|
: null,
|
|
213
|
-
provider:
|
|
247
|
+
provider: extensionPlan.provider,
|
|
214
248
|
providerPath: operation.path,
|
|
215
249
|
state: operation.action === 'create'
|
|
216
250
|
? { status: 'missing' }
|
|
@@ -220,12 +254,14 @@ async function collectScopeReports(scope, context, dependencies) {
|
|
|
220
254
|
else {
|
|
221
255
|
reports.push({
|
|
222
256
|
canonical: null,
|
|
223
|
-
provider:
|
|
257
|
+
provider: extensionPlan.provider,
|
|
224
258
|
providerPath: operation.path,
|
|
225
259
|
state: { status: 'drifted', reason: 'modified' },
|
|
226
260
|
});
|
|
227
261
|
}
|
|
228
262
|
}
|
|
263
|
+
}
|
|
264
|
+
if (codexExtensionPlan) {
|
|
229
265
|
const codexStrays = await dependencies.detectCodexRoleStrays(scopeRoot, canonicalEntries, new Set(codexExtensionPlan.managedRoles));
|
|
230
266
|
for (const codexStray of codexStrays) {
|
|
231
267
|
const report = {
|
|
@@ -257,16 +293,18 @@ async function collectScopeReports(scope, context, dependencies) {
|
|
|
257
293
|
candidates: strayCandidates,
|
|
258
294
|
knownStrays: {
|
|
259
295
|
project: syncConfig.knownStrays,
|
|
260
|
-
user:
|
|
296
|
+
user: userSyncConfig.knownStrays,
|
|
261
297
|
},
|
|
262
298
|
});
|
|
263
299
|
return {
|
|
264
300
|
scope,
|
|
265
301
|
scopeRoot,
|
|
266
302
|
manifestPath,
|
|
303
|
+
syncConfigPath,
|
|
267
304
|
manifest,
|
|
268
305
|
reports: filtered.reports,
|
|
269
306
|
strayCandidates: filtered.candidates,
|
|
307
|
+
activeAdapterNames: activeAdapters.map((adapter) => adapter.name),
|
|
270
308
|
};
|
|
271
309
|
}
|
|
272
310
|
async function runStatusCommand(context, dependencies, options = {}) {
|
|
@@ -309,44 +347,100 @@ async function runStatusCommand(context, dependencies, options = {}) {
|
|
|
309
347
|
}
|
|
310
348
|
if (summary.stray > 0) {
|
|
311
349
|
if (context.interactive) {
|
|
350
|
+
let migrationAborted = false;
|
|
312
351
|
for (const scopeCollection of scopeCollections) {
|
|
313
352
|
if (scopeCollection.strayCandidates.length === 0) {
|
|
314
353
|
continue;
|
|
315
354
|
}
|
|
316
355
|
let manifestChanged = false;
|
|
317
|
-
const selectedValues = await dependencies.selectManyWithAbort(`Select stray entries to adopt [${scopeCollection.scope}]`, scopeCollection.strayCandidates.map((strayCandidate, index) => ({
|
|
318
|
-
label: formatStrayChoiceLabel(scopeCollection.scope, strayCandidate.report.providerPath, strayCandidate.provider),
|
|
319
|
-
value: String(index),
|
|
320
|
-
description: formatPathForScope(scopeCollection.scope, strayCandidate.report.providerPath),
|
|
321
|
-
})), { interactive: context.interactive });
|
|
322
|
-
const selectedIndices = new Set((selectedValues ?? []).map((value) => Number.parseInt(value, 10)));
|
|
323
356
|
let adoptedCount = 0;
|
|
324
357
|
let codexStrayAdopted = false;
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
358
|
+
const cursorSkillStrays = scopeCollection.strayCandidates.filter(isCursorSkillCandidate);
|
|
359
|
+
const ordinaryStrays = scopeCollection.strayCandidates.filter((stray) => !isCursorSkillCandidate(stray));
|
|
360
|
+
for (const strayCandidate of cursorSkillStrays) {
|
|
361
|
+
const disposition = await dependencies.selectWithAbort(`Migrate Cursor skill [${scopeCollection.scope}]: ${formatPathForScope(scopeCollection.scope, strayCandidate.report.providerPath)}`, [
|
|
362
|
+
{
|
|
363
|
+
label: 'Adopt into canonical',
|
|
364
|
+
value: 'adopt',
|
|
365
|
+
description: `Move to ${strayCandidate.mapping.canonicalDir}.`,
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
label: 'Keep Cursor-only',
|
|
369
|
+
value: 'keep',
|
|
370
|
+
description: 'Leave in .cursor/skills and remember this choice.',
|
|
371
|
+
},
|
|
372
|
+
], { interactive: context.interactive });
|
|
373
|
+
if (disposition === null) {
|
|
374
|
+
migrationAborted = true;
|
|
375
|
+
break;
|
|
328
376
|
}
|
|
329
377
|
try {
|
|
330
|
-
scopeCollection.manifest =
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
378
|
+
scopeCollection.manifest =
|
|
379
|
+
await dependencies.applyCursorSkillDisposition(scopeCollection.scopeRoot, strayCandidate, scopeCollection.manifest, disposition, scopeCollection.syncConfigPath);
|
|
380
|
+
if (disposition === 'adopt') {
|
|
381
|
+
adoptedCount += 1;
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
context.logger.success(`Kept Cursor-only [${scopeCollection.scope}]: ${formatPathForScope(scopeCollection.scope, strayCandidate.report.providerPath)}.`);
|
|
385
|
+
}
|
|
335
386
|
}
|
|
336
387
|
catch (error) {
|
|
337
|
-
if (
|
|
388
|
+
if (error instanceof Error &&
|
|
389
|
+
error.message.startsWith('Cannot keep ')) {
|
|
390
|
+
context.logger.warn(error.message);
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
if (!isAdoptionConflictError(error) || disposition !== 'adopt') {
|
|
338
394
|
throw error;
|
|
339
395
|
}
|
|
340
396
|
const shouldReplace = await dependencies.confirmAction(`Conflict detected for ${formatPathForScope(scopeCollection.scope, strayCandidate.report.providerPath)}. Replace canonical with stray content?`, { interactive: context.interactive });
|
|
341
397
|
if (!shouldReplace) {
|
|
342
|
-
context.logger.warn(`Skipped adopting conflicting
|
|
398
|
+
context.logger.warn(`Skipped adopting conflicting Cursor skill [${scopeCollection.scope}] ${formatPathForScope(scopeCollection.scope, strayCandidate.report.providerPath)}.`);
|
|
343
399
|
continue;
|
|
344
400
|
}
|
|
345
|
-
scopeCollection.manifest =
|
|
401
|
+
scopeCollection.manifest =
|
|
402
|
+
await dependencies.applyCursorSkillDisposition(scopeCollection.scopeRoot, strayCandidate, scopeCollection.manifest, disposition, scopeCollection.syncConfigPath, { replaceCanonical: true });
|
|
346
403
|
adoptedCount += 1;
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (!migrationAborted && ordinaryStrays.length > 0) {
|
|
407
|
+
const selectedValues = await dependencies.selectManyWithAbort(`Select stray entries to adopt [${scopeCollection.scope}]`, ordinaryStrays.map((strayCandidate, index) => ({
|
|
408
|
+
label: formatStrayChoiceLabel(scopeCollection.scope, strayCandidate.report.providerPath, strayCandidate.provider),
|
|
409
|
+
value: String(index),
|
|
410
|
+
description: formatPathForScope(scopeCollection.scope, strayCandidate.report.providerPath),
|
|
411
|
+
})), { interactive: context.interactive });
|
|
412
|
+
if (selectedValues === null) {
|
|
413
|
+
migrationAborted = true;
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
const selectedIndices = new Set(selectedValues.map((value) => Number.parseInt(value, 10)));
|
|
417
|
+
for (const [index, strayCandidate] of ordinaryStrays.entries()) {
|
|
418
|
+
if (!selectedIndices.has(index)) {
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
try {
|
|
422
|
+
scopeCollection.manifest = await dependencies.adoptStray(scopeCollection.scopeRoot, strayCandidate, scopeCollection.manifest);
|
|
423
|
+
adoptedCount += 1;
|
|
424
|
+
manifestChanged = true;
|
|
425
|
+
codexStrayAdopted =
|
|
426
|
+
codexStrayAdopted || strayCandidate.provider === 'codex';
|
|
427
|
+
}
|
|
428
|
+
catch (error) {
|
|
429
|
+
if (!isAdoptionConflictError(error)) {
|
|
430
|
+
throw error;
|
|
431
|
+
}
|
|
432
|
+
const shouldReplace = await dependencies.confirmAction(`Conflict detected for ${formatPathForScope(scopeCollection.scope, strayCandidate.report.providerPath)}. Replace canonical with stray content?`, { interactive: context.interactive });
|
|
433
|
+
if (!shouldReplace) {
|
|
434
|
+
context.logger.warn(`Skipped adopting conflicting stray [${scopeCollection.scope}] ${formatPathForScope(scopeCollection.scope, strayCandidate.report.providerPath)}.`);
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
scopeCollection.manifest = await dependencies.adoptStray(scopeCollection.scopeRoot, strayCandidate, scopeCollection.manifest, { replaceCanonical: true });
|
|
438
|
+
adoptedCount += 1;
|
|
439
|
+
manifestChanged = true;
|
|
440
|
+
codexStrayAdopted =
|
|
441
|
+
codexStrayAdopted || strayCandidate.provider === 'codex';
|
|
442
|
+
}
|
|
443
|
+
}
|
|
350
444
|
}
|
|
351
445
|
}
|
|
352
446
|
if (codexStrayAdopted && scopeCollection.scope === 'project') {
|
|
@@ -356,14 +450,24 @@ async function runStatusCommand(context, dependencies, options = {}) {
|
|
|
356
450
|
computeExtensionPlan: dependencies.computeCodexProjectExtensionPlan,
|
|
357
451
|
applyExtensionPlan: dependencies.applyCodexProjectExtensionPlan,
|
|
358
452
|
});
|
|
453
|
+
if (scopeCollection.activeAdapterNames.includes('cursor')) {
|
|
454
|
+
const canonicalEntries = await dependencies.scanCanonical(scopeCollection.scopeRoot, scopeCollection.scope);
|
|
455
|
+
const cursorPlan = await dependencies.computeCursorProjectExtensionPlan(scopeCollection.scopeRoot, canonicalEntries, undefined, { userConfigDir: join(context.home, '.oat') });
|
|
456
|
+
await dependencies.applyCursorProjectExtensionPlan(scopeCollection.scopeRoot, cursorPlan);
|
|
457
|
+
}
|
|
359
458
|
}
|
|
360
459
|
if (manifestChanged) {
|
|
361
460
|
await dependencies.saveManifest(scopeCollection.manifestPath, scopeCollection.manifest);
|
|
461
|
+
}
|
|
462
|
+
if (adoptedCount > 0) {
|
|
362
463
|
context.logger.success(`Adopted ${adoptedCount} stray entr${adoptedCount === 1 ? 'y' : 'ies'} [${scopeCollection.scope}].`);
|
|
363
464
|
}
|
|
364
|
-
else {
|
|
465
|
+
else if (!migrationAborted) {
|
|
365
466
|
context.logger.info(`No stray entries adopted [${scopeCollection.scope}].`);
|
|
366
467
|
}
|
|
468
|
+
if (migrationAborted) {
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
367
471
|
}
|
|
368
472
|
}
|
|
369
473
|
else if (!context.json) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/apply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EAExB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/apply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EAExB,MAAM,cAAc,CAAC;AAyEtB,wBAAsB,YAAY,CAChC,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,aAAa,EAAE,EAC3B,YAAY,EAAE,uBAAuB,GACpC,OAAO,CAAC,IAAI,CAAC,CAyGf"}
|
|
@@ -2,11 +2,13 @@ import { OAT_VERSION } from '../../shared/oat-version.js';
|
|
|
2
2
|
import { countPlannedOperations } from './sync.utils.js';
|
|
3
3
|
function countSkippedEntries(scopePlans) {
|
|
4
4
|
return scopePlans.reduce((total, scopePlan) => {
|
|
5
|
-
const
|
|
5
|
+
const extensionSkipped = scopePlan.materializationExtensions.reduce((count, extension) => count +
|
|
6
|
+
extension.operations.filter((operation) => operation.action === 'skip')
|
|
7
|
+
.length, 0);
|
|
6
8
|
return (total +
|
|
7
9
|
scopePlan.plan.entries.filter((entry) => entry.operation === 'skip')
|
|
8
10
|
.length +
|
|
9
|
-
|
|
11
|
+
extensionSkipped);
|
|
10
12
|
}, 0);
|
|
11
13
|
}
|
|
12
14
|
function buildSummary(scopePlans, applied, failed) {
|
|
@@ -28,15 +30,19 @@ function formatAppliedOutput(scopePlans, dependencies) {
|
|
|
28
30
|
return scopePlans
|
|
29
31
|
.map((scopePlan) => {
|
|
30
32
|
const syncOutput = dependencies.formatSyncPlan(scopePlan.plan, true);
|
|
31
|
-
|
|
32
|
-
if (!codexExtension) {
|
|
33
|
+
if (scopePlan.materializationExtensions.length === 0) {
|
|
33
34
|
return `Scope: ${scopePlan.scope}\n${syncOutput}`;
|
|
34
35
|
}
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const extensionSections = scopePlan.materializationExtensions.map((extension) => {
|
|
37
|
+
const lines = extension.operations.map((operation) => {
|
|
38
|
+
const entry = operation.entryName
|
|
39
|
+
? ` (${operation.entryName})`
|
|
40
|
+
: '';
|
|
41
|
+
return `- ${operation.provider}:${operation.target}:${operation.action} ${operation.path}${entry} (${operation.reason})`;
|
|
42
|
+
});
|
|
43
|
+
return `${extension.provider} extension (applied)\n${lines.join('\n')}`;
|
|
38
44
|
});
|
|
39
|
-
return `Scope: ${scopePlan.scope}\n${syncOutput}\n\
|
|
45
|
+
return `Scope: ${scopePlan.scope}\n${syncOutput}\n\n${extensionSections.join('\n\n')}`;
|
|
40
46
|
})
|
|
41
47
|
.join('\n\n');
|
|
42
48
|
}
|
|
@@ -45,10 +51,10 @@ export async function runSyncApply(context, scopePlans, dependencies) {
|
|
|
45
51
|
let failed = 0;
|
|
46
52
|
for (const scopePlan of scopePlans) {
|
|
47
53
|
const hasSyncEntries = scopePlan.plan.entries.length > 0 || scopePlan.plan.removals.length > 0;
|
|
48
|
-
const
|
|
54
|
+
const hasExtensionPlannedOperations = scopePlan.materializationExtensionPlans.some((plan) => plan.operations.some((operation) => operation.action !== 'skip'));
|
|
49
55
|
const shouldRefreshManifestVersion = scopePlan.manifest.oatVersion !== OAT_VERSION;
|
|
50
56
|
if (!hasSyncEntries &&
|
|
51
|
-
!
|
|
57
|
+
!hasExtensionPlannedOperations &&
|
|
52
58
|
!shouldRefreshManifestVersion) {
|
|
53
59
|
continue;
|
|
54
60
|
}
|
|
@@ -57,17 +63,22 @@ export async function runSyncApply(context, scopePlans, dependencies) {
|
|
|
57
63
|
applied += result.applied;
|
|
58
64
|
failed += result.failed;
|
|
59
65
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
for (const plan of scopePlan.materializationExtensionPlans) {
|
|
67
|
+
if (!plan.operations.some((operation) => operation.action !== 'skip')) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const extension = dependencies
|
|
71
|
+
.getMaterializationExtensions()
|
|
72
|
+
.find((candidate) => candidate.provider === plan.provider);
|
|
73
|
+
if (!extension) {
|
|
74
|
+
throw new Error(`Materialization extension ${plan.provider} disappeared before apply.`);
|
|
75
|
+
}
|
|
76
|
+
const result = await dependencies.applyMaterializationExtensionPlan(extension, scopePlan.scopeRoot, plan);
|
|
77
|
+
applied += result.applied;
|
|
78
|
+
failed += result.failed;
|
|
79
|
+
const summary = scopePlan.materializationExtensions.find((candidate) => candidate.provider === plan.provider);
|
|
80
|
+
if (summary) {
|
|
81
|
+
Object.assign(summary, result);
|
|
71
82
|
}
|
|
72
83
|
}
|
|
73
84
|
}
|
|
@@ -75,9 +86,23 @@ export async function runSyncApply(context, scopePlans, dependencies) {
|
|
|
75
86
|
const providerMismatches = scopePlans
|
|
76
87
|
.map((scopePlan) => scopePlan.providerMismatches)
|
|
77
88
|
.filter((mismatch) => mismatch !== undefined);
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
.filter((extension) => extension
|
|
89
|
+
const materializationExtensions = scopePlans.flatMap((scopePlan) => scopePlan.materializationExtensions);
|
|
90
|
+
const codexExtensions = materializationExtensions
|
|
91
|
+
.filter((extension) => extension.provider === 'codex')
|
|
92
|
+
.map((extension) => ({
|
|
93
|
+
operations: extension.operations.map((operation) => ({
|
|
94
|
+
action: operation.action,
|
|
95
|
+
target: operation.target,
|
|
96
|
+
path: operation.path,
|
|
97
|
+
reason: operation.reason,
|
|
98
|
+
roleName: operation.entryName,
|
|
99
|
+
})),
|
|
100
|
+
managedRoles: extension.managedEntries,
|
|
101
|
+
aggregateConfigHash: extension.aggregateHash,
|
|
102
|
+
applied: extension.applied,
|
|
103
|
+
failed: extension.failed,
|
|
104
|
+
skipped: extension.skipped,
|
|
105
|
+
}));
|
|
81
106
|
if (context.json) {
|
|
82
107
|
context.logger.json({
|
|
83
108
|
scope: context.scope,
|
|
@@ -85,6 +110,7 @@ export async function runSyncApply(context, scopePlans, dependencies) {
|
|
|
85
110
|
plans: scopePlans.map((scopePlan) => scopePlan.plan),
|
|
86
111
|
summary,
|
|
87
112
|
providerMismatches,
|
|
113
|
+
materializationExtensions,
|
|
88
114
|
codexExtensions,
|
|
89
115
|
});
|
|
90
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dry-run.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/dry-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EAExB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"dry-run.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/dry-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EAExB,MAAM,cAAc,CAAC;AAiEtB,wBAAgB,aAAa,CAC3B,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,aAAa,EAAE,EAC3B,YAAY,EAAE,uBAAuB,GACpC,IAAI,CA2CN"}
|
|
@@ -5,24 +5,25 @@ function summarize(scopePlans) {
|
|
|
5
5
|
applied: 0,
|
|
6
6
|
failed: 0,
|
|
7
7
|
skipped: scopePlans.reduce((total, scopePlan) => {
|
|
8
|
-
const
|
|
8
|
+
const extensionSkipped = scopePlan.materializationExtensions.reduce((count, extension) => count +
|
|
9
|
+
extension.operations.filter((operation) => operation.action === 'skip').length, 0);
|
|
9
10
|
return (total +
|
|
10
11
|
scopePlan.plan.entries.filter((entry) => entry.operation === 'skip')
|
|
11
12
|
.length +
|
|
12
|
-
|
|
13
|
+
extensionSkipped);
|
|
13
14
|
}, 0),
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return
|
|
24
|
-
})
|
|
25
|
-
|
|
17
|
+
function formatMaterializationExtensions(scopePlan) {
|
|
18
|
+
return scopePlan.materializationExtensions
|
|
19
|
+
.map((extension) => {
|
|
20
|
+
const lines = extension.operations.map((operation) => {
|
|
21
|
+
const entry = operation.entryName ? ` (${operation.entryName})` : '';
|
|
22
|
+
return `- ${operation.provider}:${operation.target}:${operation.action} ${operation.path}${entry} (${operation.reason})`;
|
|
23
|
+
});
|
|
24
|
+
return `${extension.provider} extension (dry-run)\n${lines.join('\n')}`;
|
|
25
|
+
})
|
|
26
|
+
.join('\n\n');
|
|
26
27
|
}
|
|
27
28
|
function formatDryRunOutput(scopePlans, dependencies) {
|
|
28
29
|
if (scopePlans.length === 0) {
|
|
@@ -35,9 +36,9 @@ function formatDryRunOutput(scopePlans, dependencies) {
|
|
|
35
36
|
return scopePlans
|
|
36
37
|
.map((scopePlan) => {
|
|
37
38
|
const syncOutput = dependencies.formatSyncPlan(scopePlan.plan, false);
|
|
38
|
-
const
|
|
39
|
-
return
|
|
40
|
-
? `Scope: ${scopePlan.scope}\n${syncOutput}\n\n${
|
|
39
|
+
const extensionOutput = formatMaterializationExtensions(scopePlan);
|
|
40
|
+
return extensionOutput
|
|
41
|
+
? `Scope: ${scopePlan.scope}\n${syncOutput}\n\n${extensionOutput}`
|
|
41
42
|
: `Scope: ${scopePlan.scope}\n${syncOutput}`;
|
|
42
43
|
})
|
|
43
44
|
.join('\n\n');
|
|
@@ -47,9 +48,20 @@ export function runSyncDryRun(context, scopePlans, dependencies) {
|
|
|
47
48
|
const providerMismatches = scopePlans
|
|
48
49
|
.map((scopePlan) => scopePlan.providerMismatches)
|
|
49
50
|
.filter((mismatch) => mismatch !== undefined);
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
.filter((extension) => extension
|
|
51
|
+
const materializationExtensions = scopePlans.flatMap((scopePlan) => scopePlan.materializationExtensions);
|
|
52
|
+
const codexExtensions = materializationExtensions
|
|
53
|
+
.filter((extension) => extension.provider === 'codex')
|
|
54
|
+
.map((extension) => ({
|
|
55
|
+
operations: extension.operations.map((operation) => ({
|
|
56
|
+
action: operation.action,
|
|
57
|
+
target: operation.target,
|
|
58
|
+
path: operation.path,
|
|
59
|
+
reason: operation.reason,
|
|
60
|
+
roleName: operation.entryName,
|
|
61
|
+
})),
|
|
62
|
+
managedRoles: extension.managedEntries,
|
|
63
|
+
aggregateConfigHash: extension.aggregateHash,
|
|
64
|
+
}));
|
|
53
65
|
if (context.json) {
|
|
54
66
|
context.logger.json({
|
|
55
67
|
scope: context.scope,
|
|
@@ -57,6 +69,7 @@ export function runSyncDryRun(context, scopePlans, dependencies) {
|
|
|
57
69
|
plans: scopePlans.map((scopePlan) => scopePlan.plan),
|
|
58
70
|
summary,
|
|
59
71
|
providerMismatches,
|
|
72
|
+
materializationExtensions,
|
|
60
73
|
codexExtensions,
|
|
61
74
|
});
|
|
62
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AA0CA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,OAAO,KAAK,EAEV,uBAAuB,EAExB,MAAM,cAAc,CAAC;AAwUtB,wBAAgB,iBAAiB,CAC/B,SAAS,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAC/C,OAAO,CA6BT"}
|