@topogram/cli 0.3.78 → 0.3.80
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/CHANGELOG.md +20 -0
- package/package.json +2 -2
- package/src/agent-brief.js +29 -23
- package/src/agent-ops/query-builders/change-risk/{import-plan.js → extract-plan.js} +1 -1
- package/src/agent-ops/query-builders/change-risk/review-packets.js +5 -5
- package/src/agent-ops/query-builders/change-risk.js +1 -1
- package/src/agent-ops/query-builders/common.js +2 -2
- package/src/agent-ops/query-builders/multi-agent.js +1 -1
- package/src/agent-ops/query-builders/workflow-context-shared.js +4 -4
- package/src/catalog/provenance.js +1 -1
- package/src/cli/catalog-alias.d.ts +2 -0
- package/src/cli/catalog-alias.js +2 -2
- package/src/cli/command-parser.js +2 -0
- package/src/cli/command-parsers/core.js +9 -5
- package/src/cli/command-parsers/extractor.js +40 -0
- package/src/cli/command-parsers/import.js +11 -17
- package/src/cli/command-parsers/project.js +0 -3
- package/src/cli/commands/catalog/copy.js +3 -3
- package/src/cli/commands/catalog/help.js +1 -2
- package/src/cli/commands/catalog/list.js +7 -4
- package/src/cli/commands/catalog/show.js +4 -4
- package/src/cli/commands/copy.js +356 -0
- package/src/cli/commands/doctor.js +1 -1
- package/src/cli/commands/extractor.js +451 -0
- package/src/cli/commands/import/adopt.js +9 -9
- package/src/cli/commands/import/check.js +15 -15
- package/src/cli/commands/import/diff.js +6 -6
- package/src/cli/commands/import/help.js +45 -34
- package/src/cli/commands/import/paths.js +3 -3
- package/src/cli/commands/import/plan.js +8 -8
- package/src/cli/commands/import/refresh.js +25 -24
- package/src/cli/commands/import/status-history.js +4 -4
- package/src/cli/commands/import/workspace.js +24 -18
- package/src/cli/commands/import-runner.js +10 -7
- package/src/cli/commands/import.js +4 -1
- package/src/cli/commands/init.js +67 -0
- package/src/cli/commands/query/{import-adopt.js → extract-adopt.js} +2 -2
- package/src/cli/commands/query/runner/change.js +2 -2
- package/src/cli/commands/query/runner/{import-adopt.js → extract-adopt.js} +9 -9
- package/src/cli/commands/query/runner/index.js +1 -1
- package/src/cli/commands/query/runner/workflow.js +7 -7
- package/src/cli/commands/query/workspace.js +4 -4
- package/src/cli/commands/release-status.js +2 -2
- package/src/cli/commands/source.js +2 -2
- package/src/cli/commands/template/check.js +2 -2
- package/src/cli/commands/template/list-show.js +4 -4
- package/src/cli/dispatcher.js +32 -3
- package/src/cli/help-dispatch.js +33 -8
- package/src/cli/help.js +79 -52
- package/src/cli/migration-guidance.js +9 -0
- package/src/cli/options.js +17 -0
- package/src/extractor/check.js +155 -0
- package/src/extractor/packages.js +295 -0
- package/src/extractor/registry.js +196 -0
- package/src/extractor-policy.js +249 -0
- package/src/generator/check.js +24 -87
- package/src/generator/context/bundle.js +14 -7
- package/src/generator/context/diff.js +8 -1
- package/src/generator/context/digest.js +10 -1
- package/src/generator/context/shared/domain-sdlc.js +5 -1
- package/src/generator/context/shared/relationships.js +20 -5
- package/src/generator/context/shared/summaries.js +26 -0
- package/src/generator/context/shared.d.ts +1 -0
- package/src/generator/context/shared.js +1 -0
- package/src/generator/context/slice/core.js +9 -5
- package/src/generator/context/slice/sdlc.js +31 -2
- package/src/generator/context/task-mode.js +3 -3
- package/src/generator/registry/index.js +16 -75
- package/src/generator-policy.js +9 -57
- package/src/import/core/registry.d.ts +3 -0
- package/src/import/core/registry.js +82 -8
- package/src/import/core/runner/reports.js +4 -4
- package/src/import/core/runner/run.js +2 -0
- package/src/import/core/runner/tracks.js +66 -4
- package/src/import/provenance.js +18 -17
- package/src/init-project.js +215 -0
- package/src/new-project/constants.js +1 -1
- package/src/new-project/create.js +2 -2
- package/src/new-project/project-files.js +7 -7
- package/src/package-adapters/adapter.js +64 -0
- package/src/package-adapters/file-map.js +30 -0
- package/src/package-adapters/index.js +27 -0
- package/src/package-adapters/manifest.js +108 -0
- package/src/package-adapters/policy.js +81 -0
- package/src/package-adapters/spec.js +51 -0
- package/src/reconcile/journeys.js +8 -3
- package/src/record-blocks.js +125 -0
- package/src/resolver/index.js +3 -0
- package/src/resolver/journeys.js +74 -0
- package/src/resolver/normalize.js +25 -0
- package/src/sdlc/adopt.js +1 -1
- package/src/validator/common.js +34 -1
- package/src/validator/index.js +4 -0
- package/src/validator/kinds.d.ts +2 -0
- package/src/validator/kinds.js +34 -1
- package/src/validator/per-kind/journey.js +233 -0
- package/src/workflows/docs-generate.js +4 -1
- package/src/workflows/reconcile/bundle-core/index.js +4 -2
- package/src/workflows/reconcile/canonical-surface.js +4 -1
- package/src/cli/commands/new.js +0 -94
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "../../../../agent-ops/query-builders.js";
|
|
15
15
|
import { parsePath } from "../../../../parser.js";
|
|
16
16
|
import { buildChangePlanContext } from "../change-plan.js";
|
|
17
|
-
import { buildImportPlanForContext } from "../
|
|
17
|
+
import { buildImportPlanForContext } from "../extract-adopt.js";
|
|
18
18
|
import {
|
|
19
19
|
adoptionPlanPath,
|
|
20
20
|
buildTaskMode,
|
|
@@ -57,7 +57,7 @@ export function runChangeQuery(context) {
|
|
|
57
57
|
maintainedRisk: built.importPlan.maintained_risk || null
|
|
58
58
|
});
|
|
59
59
|
return printJson(buildRiskSummaryPayload({
|
|
60
|
-
source: "
|
|
60
|
+
source: "extract-plan",
|
|
61
61
|
risk,
|
|
62
62
|
nextAction: built.importPlan.next_action || null,
|
|
63
63
|
maintainedRisk: built.importPlan.maintained_risk || null
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
buildLaneStatusPayload,
|
|
11
11
|
buildWorkPacketPayload
|
|
12
12
|
} from "../../../../agent-ops/query-builders.js";
|
|
13
|
-
import { buildImportAdoptAgentContext, buildImportPlanForContext } from "../
|
|
13
|
+
import { buildImportAdoptAgentContext, buildImportPlanForContext } from "../extract-adopt.js";
|
|
14
14
|
import { normalizeTopogramPath, printValidationFailure, readJson, resultOk } from "../workspace.js";
|
|
15
15
|
import { printJson } from "./output.js";
|
|
16
16
|
|
|
@@ -25,15 +25,15 @@ import { printJson } from "./output.js";
|
|
|
25
25
|
export function runImportAdoptQuery(context) {
|
|
26
26
|
const queryName = context.commandArgs?.queryName;
|
|
27
27
|
|
|
28
|
-
if (queryName === "
|
|
29
|
-
const built = buildImportPlanForContext(context, "
|
|
28
|
+
if (queryName === "extract-plan") {
|
|
29
|
+
const built = buildImportPlanForContext(context, "extract-plan");
|
|
30
30
|
if (!resultOk(built)) return printValidationFailure(built);
|
|
31
31
|
return printJson(built.importPlan);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if (queryName === "multi-agent-plan") {
|
|
35
|
-
if (context.modeId !== "
|
|
36
|
-
throw new Error("query multi-agent-plan currently supports only --mode
|
|
35
|
+
if (context.modeId !== "extract-adopt") {
|
|
36
|
+
throw new Error("query multi-agent-plan currently supports only --mode extract-adopt.");
|
|
37
37
|
}
|
|
38
38
|
const built = buildImportAdoptAgentContext(context, "multi-agent-plan");
|
|
39
39
|
if (!resultOk(built)) return printValidationFailure(built);
|
|
@@ -41,8 +41,8 @@ export function runImportAdoptQuery(context) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
if (queryName === "work-packet") {
|
|
44
|
-
if (context.modeId !== "
|
|
45
|
-
throw new Error("query work-packet currently supports only --mode
|
|
44
|
+
if (context.modeId !== "extract-adopt") {
|
|
45
|
+
throw new Error("query work-packet currently supports only --mode extract-adopt.");
|
|
46
46
|
}
|
|
47
47
|
if (!context.laneId) {
|
|
48
48
|
throw new Error("query work-packet requires --lane <id>.");
|
|
@@ -57,8 +57,8 @@ export function runImportAdoptQuery(context) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
if (queryName === "lane-status" || queryName === "handoff-status") {
|
|
60
|
-
if (context.modeId !== "
|
|
61
|
-
throw new Error(`query ${queryName} currently supports only --mode
|
|
60
|
+
if (context.modeId !== "extract-adopt") {
|
|
61
|
+
throw new Error(`query ${queryName} currently supports only --mode extract-adopt.`);
|
|
62
62
|
}
|
|
63
63
|
const built = buildImportAdoptAgentContext(context, queryName);
|
|
64
64
|
if (!resultOk(built)) return printValidationFailure(built);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { runArtifactQuery } from "./artifacts.js";
|
|
4
4
|
import { runBoundaryQuery } from "./boundaries.js";
|
|
5
5
|
import { runChangeQuery } from "./change.js";
|
|
6
|
-
import { runImportAdoptQuery } from "./
|
|
6
|
+
import { runImportAdoptQuery } from "./extract-adopt.js";
|
|
7
7
|
import { runWorkflowQuery } from "./workflow.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -46,7 +46,7 @@ export function runWorkflowQuery(context) {
|
|
|
46
46
|
const selectors = selectorOptions(context);
|
|
47
47
|
|
|
48
48
|
if (queryName === "next-action") {
|
|
49
|
-
const result = buildTaskMode(parsePath(context.inputPath), selectors, context.modeId || "
|
|
49
|
+
const result = buildTaskMode(parsePath(context.inputPath), selectors, context.modeId || "extract-adopt", context.fromTopogramPath);
|
|
50
50
|
if (!resultOk(result)) return printValidationFailure(result);
|
|
51
51
|
return printJson({
|
|
52
52
|
type: "next_action_query",
|
|
@@ -72,13 +72,13 @@ export function runWorkflowQuery(context) {
|
|
|
72
72
|
|
|
73
73
|
if (queryName === "workflow-preset-activation") {
|
|
74
74
|
if (!context.modeId) {
|
|
75
|
-
throw new Error("query workflow-preset-activation requires --mode <modeling|maintained-app-edit|
|
|
75
|
+
throw new Error("query workflow-preset-activation requires --mode <modeling|maintained-app-edit|extract-adopt|diff-review|verification>.");
|
|
76
76
|
}
|
|
77
77
|
const topogramRoot = normalizeTopogramPath(context.inputPath);
|
|
78
78
|
const taskModeResult = buildTaskMode(parsePath(context.inputPath), selectors, context.modeId, context.fromTopogramPath);
|
|
79
79
|
if (!resultOk(taskModeResult)) return printValidationFailure(taskModeResult);
|
|
80
80
|
let importPlan = null;
|
|
81
|
-
if (context.modeId === "
|
|
81
|
+
if (context.modeId === "extract-adopt" && fs.existsSync(adoptionPlanPath(topogramRoot))) {
|
|
82
82
|
const workflowPresets = buildWorkflowPresetState({
|
|
83
83
|
workspace: topogramRoot,
|
|
84
84
|
selectors: workflowPresetSelectors(taskModeResult.artifact, context.providerId, context.presetId, "workflow-preset-activation")
|
|
@@ -118,7 +118,7 @@ export function runWorkflowQuery(context) {
|
|
|
118
118
|
*/
|
|
119
119
|
function runSingleAgentPlan(context, selectors) {
|
|
120
120
|
if (!context.modeId) {
|
|
121
|
-
throw new Error("query single-agent-plan requires --mode <modeling|maintained-app-edit|
|
|
121
|
+
throw new Error("query single-agent-plan requires --mode <modeling|maintained-app-edit|extract-adopt|diff-review|verification>.");
|
|
122
122
|
}
|
|
123
123
|
const ast = parsePath(context.inputPath);
|
|
124
124
|
const result = buildTaskMode(ast, selectors, context.modeId, context.fromTopogramPath);
|
|
@@ -134,7 +134,7 @@ function runSingleAgentPlan(context, selectors) {
|
|
|
134
134
|
});
|
|
135
135
|
const topogramRoot = normalizeTopogramPath(context.inputPath);
|
|
136
136
|
let importPlan = null;
|
|
137
|
-
if (context.modeId === "
|
|
137
|
+
if (context.modeId === "extract-adopt" && fs.existsSync(adoptionPlanPath(topogramRoot))) {
|
|
138
138
|
const workflowPresets = buildWorkflowPresetState({
|
|
139
139
|
workspace: topogramRoot,
|
|
140
140
|
selectors: workflowPresetSelectors(result.artifact, context.providerId, context.presetId, "single-agent-plan")
|
|
@@ -163,7 +163,7 @@ function runSingleAgentPlan(context, selectors) {
|
|
|
163
163
|
*/
|
|
164
164
|
function runResolvedWorkflowContext(context, selectors) {
|
|
165
165
|
if (!context.modeId) {
|
|
166
|
-
throw new Error("query resolved-workflow-context requires --mode <modeling|maintained-app-edit|
|
|
166
|
+
throw new Error("query resolved-workflow-context requires --mode <modeling|maintained-app-edit|extract-adopt|diff-review|verification>.");
|
|
167
167
|
}
|
|
168
168
|
const topogramRoot = normalizeTopogramPath(context.inputPath);
|
|
169
169
|
const ast = parsePath(context.inputPath);
|
|
@@ -186,7 +186,7 @@ function runResolvedWorkflowContext(context, selectors) {
|
|
|
186
186
|
maintainedBoundaryArtifact: maintainedBundleResult?.artifact?.maintained_boundary || null
|
|
187
187
|
});
|
|
188
188
|
let importPlan = null;
|
|
189
|
-
if (context.modeId === "
|
|
189
|
+
if (context.modeId === "extract-adopt" && fs.existsSync(adoptionPlanPath(topogramRoot))) {
|
|
190
190
|
const workflowPresets = buildWorkflowPresetState({
|
|
191
191
|
workspace: topogramRoot,
|
|
192
192
|
selectors: workflowPresetSelectors(taskModeResult.artifact, context.providerId, context.presetId, "resolved-workflow-context")
|
|
@@ -29,7 +29,7 @@ export function normalizeTopogramPath(inputPath) {
|
|
|
29
29
|
*/
|
|
30
30
|
export function workflowPresetSelectors(taskModeArtifact, providerId = null, presetId = null, queryFamily = null) {
|
|
31
31
|
const categories = [];
|
|
32
|
-
if (taskModeArtifact?.mode === "
|
|
32
|
+
if (taskModeArtifact?.mode === "extract-adopt") categories.push("provider_adoption");
|
|
33
33
|
if (taskModeArtifact?.mode === "maintained-app-edit") categories.push("maintained_app");
|
|
34
34
|
if ((taskModeArtifact?.verification_targets?.maintained_app_checks || []).length > 0) categories.push("maintained_boundary");
|
|
35
35
|
return {
|
|
@@ -65,7 +65,7 @@ export function generatorTargetsForWorkflowContext(options = {}) {
|
|
|
65
65
|
* @returns {boolean}
|
|
66
66
|
*/
|
|
67
67
|
export function importAdoptOnlyRequested(options = {}) {
|
|
68
|
-
return options.modeId === "
|
|
68
|
+
return options.modeId === "extract-adopt" && !(
|
|
69
69
|
options.capabilityId ||
|
|
70
70
|
options.workflowId ||
|
|
71
71
|
options.projectionId ||
|
|
@@ -267,7 +267,7 @@ export function resolveRecommendedQueryFamily(nextAction, mode) {
|
|
|
267
267
|
case "customize_workflow_preset":
|
|
268
268
|
case "refresh_workflow_preset_customization":
|
|
269
269
|
case "import_declared_workflow_preset":
|
|
270
|
-
return "
|
|
270
|
+
return "extract-plan";
|
|
271
271
|
case "review_diff_impact":
|
|
272
272
|
case "inspect_projection":
|
|
273
273
|
case "inspect_diff":
|
|
@@ -284,7 +284,7 @@ export function resolveRecommendedQueryFamily(nextAction, mode) {
|
|
|
284
284
|
default:
|
|
285
285
|
break;
|
|
286
286
|
}
|
|
287
|
-
if (mode === "
|
|
287
|
+
if (mode === "extract-adopt") return "extract-plan";
|
|
288
288
|
if (mode === "maintained-app-edit") return "maintained-boundary";
|
|
289
289
|
if (mode === "verification") return "verification-targets";
|
|
290
290
|
return "change-plan";
|
|
@@ -290,7 +290,7 @@ export function renderReleaseStatusMarkdown(payload) {
|
|
|
290
290
|
"The external Todo demo is the canonical end-to-end consumer proof for the current catalog-backed workflow:",
|
|
291
291
|
"",
|
|
292
292
|
"```bash",
|
|
293
|
-
"topogram
|
|
293
|
+
"topogram copy todo ./todo-demo",
|
|
294
294
|
"cd ./todo-demo",
|
|
295
295
|
"npm install",
|
|
296
296
|
"npm run check",
|
|
@@ -300,7 +300,7 @@ export function renderReleaseStatusMarkdown(payload) {
|
|
|
300
300
|
"npm run app:runtime",
|
|
301
301
|
"```",
|
|
302
302
|
"",
|
|
303
|
-
"The demo CI also verifies `topogram
|
|
303
|
+
"The demo CI also verifies `topogram copy` from the default public catalog and from the repo-local catalog fixture. That prevents local fixtures from masking a broken published catalog alias."
|
|
304
304
|
);
|
|
305
305
|
const reportDiagnostics = [...matrix.diagnostics];
|
|
306
306
|
if (reportDiagnostics.length > 0) {
|
|
@@ -239,7 +239,7 @@ export function printTopogramSourceStatus(payload) {
|
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
console.log("");
|
|
242
|
-
console.log(`${TOPOGRAM_SOURCE_FILE} records
|
|
242
|
+
console.log(`${TOPOGRAM_SOURCE_FILE} records copy provenance only. Local edits are allowed.`);
|
|
243
243
|
console.log("Template attachment controls update tracking. Detaching makes the project fully owned by this workspace.");
|
|
244
244
|
console.log("Template baseline drift does not block `topogram check` or `topogram generate`.");
|
|
245
245
|
console.log("Implementation trust is separate and can block check/generate when review is required.");
|
|
@@ -250,7 +250,7 @@ export function printTopogramSourceStatus(payload) {
|
|
|
250
250
|
} else if (payload.project?.templateBaseline?.state === "diverged") {
|
|
251
251
|
console.log("Next: local template-derived changes are owned by this project. Run `topogram template update --check` only when reviewing upstream template changes.");
|
|
252
252
|
} else if (!payload.exists) {
|
|
253
|
-
console.log("Next: use `topogram
|
|
253
|
+
console.log("Next: use `topogram copy <id> <target>` for pure topogram provenance, or continue with template/project provenance above.");
|
|
254
254
|
} else {
|
|
255
255
|
console.log("Next: run `topogram check` or `topogram generate`.");
|
|
256
256
|
}
|
|
@@ -124,7 +124,7 @@ function diagnosticForTemplateCreateFailure(message, templateSpec, step) {
|
|
|
124
124
|
code: "template_symlink_unsupported",
|
|
125
125
|
message,
|
|
126
126
|
path: path.isAbsolute(templateSpec) ? templateSpec : null,
|
|
127
|
-
suggestedFix: "Replace template symlinks with real files or directories, then rerun `topogram
|
|
127
|
+
suggestedFix: "Replace template symlinks with real files or directories, then rerun `topogram copy` or `topogram template check`.",
|
|
128
128
|
step
|
|
129
129
|
});
|
|
130
130
|
}
|
|
@@ -132,7 +132,7 @@ function diagnosticForTemplateCreateFailure(message, templateSpec, step) {
|
|
|
132
132
|
code: "template_create_failed",
|
|
133
133
|
message,
|
|
134
134
|
path: path.isAbsolute(templateSpec) ? templateSpec : null,
|
|
135
|
-
suggestedFix: "Fix the template pack so topogram
|
|
135
|
+
suggestedFix: "Fix the template pack so topogram copy can create a starter from it.",
|
|
136
136
|
step
|
|
137
137
|
});
|
|
138
138
|
}
|
|
@@ -81,7 +81,7 @@ function templateListItemFromCatalogEntry(entry, source) {
|
|
|
81
81
|
*/
|
|
82
82
|
export function printTemplateList(payload) {
|
|
83
83
|
console.log("Template starters:");
|
|
84
|
-
console.log("Catalog aliases resolve to versioned package installs. Local paths and full package specs can also be used with `topogram
|
|
84
|
+
console.log("Catalog aliases resolve to versioned package installs. Local paths and full package specs can also be used with `topogram copy`.");
|
|
85
85
|
if (payload.catalog.source) {
|
|
86
86
|
console.log(`Catalog: ${payload.catalog.source} (${payload.catalog.loaded ? "loaded" : "unavailable"})`);
|
|
87
87
|
} else {
|
|
@@ -93,10 +93,10 @@ export function printTemplateList(payload) {
|
|
|
93
93
|
const surfaces = Array.isArray(template.surfaces) && template.surfaces.length > 0
|
|
94
94
|
? template.surfaces.join(", ")
|
|
95
95
|
: "not declared";
|
|
96
|
-
const command = template.recommendedCommand || `topogram
|
|
96
|
+
const command = template.recommendedCommand || `topogram copy ${shellCommandArg(template.id)} ./my-app`;
|
|
97
97
|
console.log(`- ${template.id}@${template.version}${defaultLabel}`);
|
|
98
98
|
console.log(` Source: ${template.source} | Surfaces: ${surfaces} | Stack: ${stack} | Executable implementation: ${template.includesExecutableImplementation ? "yes" : "no"}`);
|
|
99
|
-
console.log(`
|
|
99
|
+
console.log(` Copy: ${command}`);
|
|
100
100
|
}
|
|
101
101
|
for (const diagnostic of payload.diagnostics) {
|
|
102
102
|
console.warn(`Warning: ${diagnostic.message}`);
|
|
@@ -137,7 +137,7 @@ function templateDecisionSummary(template, sourceKind, packageSpec, commands) {
|
|
|
137
137
|
version: template.defaultVersion || template.version || null,
|
|
138
138
|
executableImplementation: executable,
|
|
139
139
|
policyImpact: executable
|
|
140
|
-
? "Copies implementation/ code into the project; topogram
|
|
140
|
+
? "Copies implementation/ code into the project; topogram copy does not execute it, but topogram generate may load it after local trust is recorded."
|
|
141
141
|
: "No executable implementation trust is required for this template.",
|
|
142
142
|
recommendedCommand: commands.primary,
|
|
143
143
|
followUp: commands.followUp,
|
package/src/cli/dispatcher.js
CHANGED
|
@@ -5,12 +5,14 @@ import { buildVersionPayload, printVersion } from "./commands/version.js";
|
|
|
5
5
|
import { runAgentBriefCommand } from "./commands/agent.js";
|
|
6
6
|
import { runCatalogCommand } from "./commands/catalog.js";
|
|
7
7
|
import { runCheckCommand } from "./commands/check.js";
|
|
8
|
+
import { runCopyCommand } from "./commands/copy.js";
|
|
8
9
|
import { runEmitCommand } from "./commands/emit.js";
|
|
9
10
|
import { runGenerateAppCommand } from "./commands/generate.js";
|
|
11
|
+
import { runExtractorCommand } from "./commands/extractor.js";
|
|
10
12
|
import { runGeneratorCommand } from "./commands/generator.js";
|
|
11
13
|
import { runGeneratorPolicyCommand } from "./commands/generator-policy.js";
|
|
12
14
|
import { runImportCommand } from "./commands/import-runner.js";
|
|
13
|
-
import {
|
|
15
|
+
import { runInitProjectCommand } from "./commands/init.js";
|
|
14
16
|
import { runPackageCommand } from "./commands/package.js";
|
|
15
17
|
import { runParseCommand, runResolveCommand } from "./commands/inspect.js";
|
|
16
18
|
import {
|
|
@@ -80,6 +82,8 @@ export async function runCliDispatch(context) {
|
|
|
80
82
|
workflowName,
|
|
81
83
|
workflowId,
|
|
82
84
|
fromValue,
|
|
85
|
+
extractorSpecs,
|
|
86
|
+
extractorPolicyPath,
|
|
83
87
|
adoptValue,
|
|
84
88
|
reasonValue,
|
|
85
89
|
modeId,
|
|
@@ -224,6 +228,15 @@ export async function runCliDispatch(context) {
|
|
|
224
228
|
});
|
|
225
229
|
}
|
|
226
230
|
|
|
231
|
+
if (commandArgs?.extractorCommand || commandArgs?.extractorPolicyCommand) {
|
|
232
|
+
return runExtractorCommand({
|
|
233
|
+
commandArgs,
|
|
234
|
+
inputPath,
|
|
235
|
+
json: emitJson,
|
|
236
|
+
cwd: process.cwd()
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
227
240
|
if (commandArgs?.generatorPolicyCommand) {
|
|
228
241
|
return runGeneratorPolicyCommand({ commandArgs, inputPath, json: emitJson });
|
|
229
242
|
}
|
|
@@ -238,6 +251,16 @@ export async function runCliDispatch(context) {
|
|
|
238
251
|
});
|
|
239
252
|
}
|
|
240
253
|
|
|
254
|
+
if (commandArgs?.copyCommand) {
|
|
255
|
+
return runCopyCommand({
|
|
256
|
+
commandArgs,
|
|
257
|
+
catalogSource,
|
|
258
|
+
requestedVersion,
|
|
259
|
+
json: emitJson,
|
|
260
|
+
cwd: process.cwd()
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
241
264
|
if (commandArgs?.packageCommand) {
|
|
242
265
|
return runPackageCommand({ commandArgs, inputPath, json: emitJson });
|
|
243
266
|
}
|
|
@@ -248,6 +271,8 @@ export async function runCliDispatch(context) {
|
|
|
248
271
|
inputPath,
|
|
249
272
|
outPath,
|
|
250
273
|
fromValue,
|
|
274
|
+
extractorSpecs,
|
|
275
|
+
extractorPolicyPath,
|
|
251
276
|
reasonValue,
|
|
252
277
|
refreshAdopted,
|
|
253
278
|
dryRun: args.includes("--dry-run"),
|
|
@@ -261,8 +286,12 @@ export async function runCliDispatch(context) {
|
|
|
261
286
|
return runSourceCommand({ commandArgs, inputPath, args, json: emitJson });
|
|
262
287
|
}
|
|
263
288
|
|
|
264
|
-
if (commandArgs?.
|
|
265
|
-
return
|
|
289
|
+
if (commandArgs?.initProject) {
|
|
290
|
+
return runInitProjectCommand(effectiveInputPath || ".", {
|
|
291
|
+
json: emitJson,
|
|
292
|
+
cwd: process.cwd(),
|
|
293
|
+
withSdlc: args.includes("--with-sdlc")
|
|
294
|
+
});
|
|
266
295
|
}
|
|
267
296
|
|
|
268
297
|
if (commandArgs?.templateCommand) {
|
package/src/cli/help-dispatch.js
CHANGED
|
@@ -12,11 +12,15 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
printDoctorHelp
|
|
14
14
|
} from "./commands/doctor.js";
|
|
15
|
+
import {
|
|
16
|
+
printExtractorHelp
|
|
17
|
+
} from "./commands/extractor.js";
|
|
15
18
|
import {
|
|
16
19
|
printGeneratorHelp
|
|
17
20
|
} from "./commands/generator.js";
|
|
18
21
|
import {
|
|
19
|
-
|
|
22
|
+
printAdoptHelp,
|
|
23
|
+
printExtractHelp
|
|
20
24
|
} from "./commands/import.js";
|
|
21
25
|
import {
|
|
22
26
|
printPackageHelp
|
|
@@ -42,7 +46,8 @@ import {
|
|
|
42
46
|
import {
|
|
43
47
|
printEmitHelp,
|
|
44
48
|
printGenerateHelp,
|
|
45
|
-
|
|
49
|
+
printInitHelp,
|
|
50
|
+
printCopyHelp,
|
|
46
51
|
printUsage,
|
|
47
52
|
printWidgetHelp
|
|
48
53
|
} from "./help.js";
|
|
@@ -52,8 +57,12 @@ import {
|
|
|
52
57
|
* @returns {boolean}
|
|
53
58
|
*/
|
|
54
59
|
export function printCommandHelp(command) {
|
|
55
|
-
if (command === "
|
|
56
|
-
|
|
60
|
+
if (command === "copy") {
|
|
61
|
+
printCopyHelp();
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
if (command === "init") {
|
|
65
|
+
printInitHelp();
|
|
57
66
|
return true;
|
|
58
67
|
}
|
|
59
68
|
if (command === "generate") {
|
|
@@ -80,6 +89,10 @@ export function printCommandHelp(command) {
|
|
|
80
89
|
printGeneratorHelp();
|
|
81
90
|
return true;
|
|
82
91
|
}
|
|
92
|
+
if (command === "extractor") {
|
|
93
|
+
printExtractorHelp();
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
83
96
|
if (command === "template") {
|
|
84
97
|
printTemplateHelp();
|
|
85
98
|
return true;
|
|
@@ -112,8 +125,12 @@ export function printCommandHelp(command) {
|
|
|
112
125
|
printTrustHelp();
|
|
113
126
|
return true;
|
|
114
127
|
}
|
|
115
|
-
if (command === "
|
|
116
|
-
|
|
128
|
+
if (command === "extract") {
|
|
129
|
+
printExtractHelp();
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
if (command === "adopt") {
|
|
133
|
+
printAdoptHelp();
|
|
117
134
|
return true;
|
|
118
135
|
}
|
|
119
136
|
if (command === "check") {
|
|
@@ -166,12 +183,20 @@ export function handleUnparsedCommandHelp(args) {
|
|
|
166
183
|
printGeneratorHelp();
|
|
167
184
|
return args[1] ? 1 : 0;
|
|
168
185
|
}
|
|
186
|
+
if (args[0] === "extractor") {
|
|
187
|
+
printExtractorHelp();
|
|
188
|
+
return args[1] ? 1 : 0;
|
|
189
|
+
}
|
|
169
190
|
if (args[0] === "template") {
|
|
170
191
|
printTemplateHelp();
|
|
171
192
|
return args[1] ? 1 : 0;
|
|
172
193
|
}
|
|
173
|
-
if (args[0] === "
|
|
174
|
-
|
|
194
|
+
if (args[0] === "extract") {
|
|
195
|
+
printExtractHelp();
|
|
196
|
+
return args[1] ? 1 : 0;
|
|
197
|
+
}
|
|
198
|
+
if (args[0] === "adopt") {
|
|
199
|
+
printAdoptHelp();
|
|
175
200
|
return args[1] ? 1 : 0;
|
|
176
201
|
}
|
|
177
202
|
if (args[0] === "query") {
|