@mimir-labs/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +498 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +45 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/context.d.ts +2 -0
- package/dist/commands/context.js +54 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/discover.d.ts +2 -0
- package/dist/commands/discover.js +64 -0
- package/dist/commands/discover.js.map +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.js +69 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/generate.d.ts +2 -0
- package/dist/commands/generate.js +94 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/governance.d.ts +2 -0
- package/dist/commands/governance.js +58 -0
- package/dist/commands/governance.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +68 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/sync.d.ts +2 -0
- package/dist/commands/sync.js +72 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.js +59 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/dx/about/command.d.ts +2 -0
- package/dist/dx/about/command.js +69 -0
- package/dist/dx/about/command.js.map +1 -0
- package/dist/dx/branding/constants.d.ts +6 -0
- package/dist/dx/branding/constants.js +13 -0
- package/dist/dx/branding/constants.js.map +1 -0
- package/dist/dx/command-registry/index.d.ts +25 -0
- package/dist/dx/command-registry/index.js +234 -0
- package/dist/dx/command-registry/index.js.map +1 -0
- package/dist/dx/completion/command.d.ts +2 -0
- package/dist/dx/completion/command.js +45 -0
- package/dist/dx/completion/command.js.map +1 -0
- package/dist/dx/completion/scripts.d.ts +4 -0
- package/dist/dx/completion/scripts.js +143 -0
- package/dist/dx/completion/scripts.js.map +1 -0
- package/dist/dx/help/attach-command-help.d.ts +2 -0
- package/dist/dx/help/attach-command-help.js +13 -0
- package/dist/dx/help/attach-command-help.js.map +1 -0
- package/dist/dx/help/command.d.ts +2 -0
- package/dist/dx/help/command.js +75 -0
- package/dist/dx/help/command.js.map +1 -0
- package/dist/dx/help/formatter.d.ts +2 -0
- package/dist/dx/help/formatter.js +52 -0
- package/dist/dx/help/formatter.js.map +1 -0
- package/dist/dx/output/cli-output.d.ts +11 -0
- package/dist/dx/output/cli-output.js +62 -0
- package/dist/dx/output/cli-output.js.map +1 -0
- package/dist/dx/runtime/options.d.ts +10 -0
- package/dist/dx/runtime/options.js +31 -0
- package/dist/dx/runtime/options.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerDiscoverCommand = registerDiscoverCommand;
|
|
4
|
+
const core_1 = require("@mimir-labs/core");
|
|
5
|
+
const attach_command_help_1 = require("../dx/help/attach-command-help");
|
|
6
|
+
const cli_output_1 = require("../dx/output/cli-output");
|
|
7
|
+
const options_1 = require("../dx/runtime/options");
|
|
8
|
+
function printDiscoverySummary(providers) {
|
|
9
|
+
if (providers.length === 0) {
|
|
10
|
+
(0, cli_output_1.success)("no APS providers found");
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
(0, cli_output_1.success)(`found ${providers.length} APS provider(s)`);
|
|
14
|
+
for (const provider of providers) {
|
|
15
|
+
console.log(provider.name);
|
|
16
|
+
if (provider.resourceCounts.length === 0) {
|
|
17
|
+
console.log(" resources: 0");
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
for (const item of provider.resourceCounts) {
|
|
21
|
+
console.log(` ${item.key}: ${item.count}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (provider.warnings.length > 0) {
|
|
25
|
+
for (const warning of provider.warnings) {
|
|
26
|
+
(0, cli_output_1.warn)(`${provider.name}: ${warning}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
console.log("");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function registerDiscoverCommand(program) {
|
|
33
|
+
const command = program
|
|
34
|
+
.command("discover")
|
|
35
|
+
.description("Discover APS-enabled dependencies and load APS manifests")
|
|
36
|
+
.option("--json", "Emit machine-readable discovery result")
|
|
37
|
+
.action(async (options) => {
|
|
38
|
+
try {
|
|
39
|
+
const result = await (0, core_1.runDiscovery)(process.cwd());
|
|
40
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
41
|
+
(0, cli_output_1.printJson)({
|
|
42
|
+
command: "discover",
|
|
43
|
+
ok: true,
|
|
44
|
+
providers: result.providers,
|
|
45
|
+
unresolvedDependencies: result.unresolvedDependencies
|
|
46
|
+
});
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
printDiscoverySummary(result.providers);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
53
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
54
|
+
(0, cli_output_1.printJson)({ command: "discover", ok: false, error: message });
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
(0, cli_output_1.errorMessage)(`discovery failed: ${message}`);
|
|
58
|
+
}
|
|
59
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
(0, attach_command_help_1.attachCommandHelp)(command, "discover");
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=discover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/commands/discover.ts"],"names":[],"mappings":";;AA0CA,0DAgCC;AAzED,2CAAgD;AAChD,wEAAmE;AACnE,wDA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ACH,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAY,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;YAEjD,IAAI,IAAA,wBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,IAAA,sBAAS,EAAC;oBACR,OAAO,EAAE,UAAU;oBACnB,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,MAAM,CAAC,SAAS;oBAC3B,sBAAsB,EAAE,MAAM,CAAC,sBAAsB;iBACtD,CAAC,CAAC;gBACH,OAAO;YACT,CAAC;YAED,qBAAqB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,IAAI,IAAA,wBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,IAAA,sBAAS,EAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAChE,CAAC;iBAAM,CAAC;gBACN,IAAA,yBAAY,EAAC,qBAAqB,OAAO,EAAE,CAAC,CAAC;YAC/C,CAAC;YACD,IAAA,wBAAW,EAAC,uBAAU,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,IAAA,uCAAiB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerDoctorCommand = registerDoctorCommand;
|
|
4
|
+
const core_1 = require("@mimir-labs/core");
|
|
5
|
+
const attach_command_help_1 = require("../dx/help/attach-command-help");
|
|
6
|
+
const cli_output_1 = require("../dx/output/cli-output");
|
|
7
|
+
const options_1 = require("../dx/runtime/options");
|
|
8
|
+
function registerDoctorCommand(program) {
|
|
9
|
+
const command = program
|
|
10
|
+
.command("doctor")
|
|
11
|
+
.description("Evaluate APS provider maturity (L0-L3)")
|
|
12
|
+
.option("--json", "output machine-readable JSON")
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
try {
|
|
15
|
+
const report = await (0, core_1.runDoctorAssessment)(process.cwd());
|
|
16
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
17
|
+
const anyFail = report.providers.some((provider) => provider.level < provider.maxLevel);
|
|
18
|
+
(0, cli_output_1.printJson)({ command: "doctor", ok: !anyFail, report });
|
|
19
|
+
if (anyFail) {
|
|
20
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
21
|
+
}
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (report.providers.length === 0) {
|
|
25
|
+
(0, cli_output_1.errorMessage)("no APS providers discovered");
|
|
26
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
(0, cli_output_1.success)("doctor report");
|
|
30
|
+
for (const provider of report.providers) {
|
|
31
|
+
console.log(`Provider: ${provider.provider}`);
|
|
32
|
+
console.log(`Maturity: L${provider.level}/${provider.maxLevel}`);
|
|
33
|
+
const failedChecks = provider.checks.filter((check) => check.status === "fail");
|
|
34
|
+
if (failedChecks.length === 0) {
|
|
35
|
+
console.log("Checks: all passed");
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
console.log("Failed checks:");
|
|
39
|
+
for (const check of failedChecks) {
|
|
40
|
+
console.log(`- ${check.name}: ${check.details}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (provider.recommendations.length > 0) {
|
|
44
|
+
console.log("Recommendations:");
|
|
45
|
+
for (const recommendation of provider.recommendations) {
|
|
46
|
+
console.log(`- ${recommendation}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
console.log("");
|
|
50
|
+
}
|
|
51
|
+
const anyFail = report.providers.some((provider) => provider.level < provider.maxLevel);
|
|
52
|
+
if (anyFail) {
|
|
53
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
58
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
59
|
+
(0, cli_output_1.printJson)({ command: "doctor", ok: false, error: message });
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
(0, cli_output_1.errorMessage)(`doctor failed: ${message}`);
|
|
63
|
+
}
|
|
64
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
(0, attach_command_help_1.attachCommandHelp)(command, "doctor");
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":";;AAYA,sDAkEC;AA7ED,2CAAuD;AACvD,wEAAmE;AACnE,wDAMiC;AACjC,mDAAuD;AAEvD,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,wCAAwC,CAAC;SACrD,MAAM,CAAC,QAAQ,EAAE,8BAA8B,CAAC;SAChD,MAAM,CAAC,KAAK,EAAE,OAA2B,EAAE,EAAE;QAC5C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAmB,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;YAExD,IAAI,IAAA,wB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AAC,aAAa,CAAC,CAAC;QACxC,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,IAAA,uCAAiB,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerGenerateCommand = registerGenerateCommand;
|
|
7
|
+
const core_1 = require("@mimir-labs/core");
|
|
8
|
+
const attach_command_help_1 = require("../dx/help/attach-command-help");
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const cli_output_1 = require("../dx/output/cli-output");
|
|
11
|
+
const options_1 = require("../dx/runtime/options");
|
|
12
|
+
function registerGenerateCommand(program) {
|
|
13
|
+
const command = program
|
|
14
|
+
.command("generate")
|
|
15
|
+
.description("Generate APS resources from package evidence")
|
|
16
|
+
.option("--json", "output machine-readable JSON")
|
|
17
|
+
.option("--force", "replace existing generated resources in dist/aps")
|
|
18
|
+
.action(async (options) => {
|
|
19
|
+
try {
|
|
20
|
+
if ((0, options_1.isDryRun)()) {
|
|
21
|
+
const payload = {
|
|
22
|
+
command: "generate",
|
|
23
|
+
dryRun: true,
|
|
24
|
+
ok: true,
|
|
25
|
+
force: Boolean(options.force),
|
|
26
|
+
outputDir: node_path_1.default.join(process.cwd(), "dist", "aps")
|
|
27
|
+
};
|
|
28
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
29
|
+
(0, cli_output_1.printJson)(payload);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
(0, cli_output_1.success)(`dry-run: would generate APS resources in ${payload.outputDir}`);
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const report = await (0, core_1.runGeneration)(process.cwd(), {
|
|
37
|
+
force: options.force
|
|
38
|
+
});
|
|
39
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
40
|
+
(0, cli_output_1.printJson)({ command: "generate", ok: report.validate.valid, report });
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
(0, cli_output_1.success)(`generated APS resources in ${report.outputDir}`);
|
|
44
|
+
console.log(`- generated resources: ${report.generatedResources}`);
|
|
45
|
+
console.log(`- validation valid: ${report.validate.valid}`);
|
|
46
|
+
console.log(`- governance valid: ${report.governance?.valid ?? false}`);
|
|
47
|
+
if (report.warnings.length > 0) {
|
|
48
|
+
for (const warning of report.warnings) {
|
|
49
|
+
(0, cli_output_1.warn)(warning);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (report.missingHumanMetadata.length > 0) {
|
|
53
|
+
(0, cli_output_1.warn)("human metadata is incomplete for some components");
|
|
54
|
+
console.log("Expected human metadata fields: description, whenToUse, whenNotToUse.");
|
|
55
|
+
console.log("Current source behavior:");
|
|
56
|
+
console.log("- description: extracted from README.md component sections when available");
|
|
57
|
+
console.log("- whenToUse/whenNotToUse: not auto-extracted in v1 (manual enrichment required)");
|
|
58
|
+
console.log(`Update generated resource file: ${node_path_1.default.join(report.outputDir, "components.json")}`);
|
|
59
|
+
console.log("Missing human metadata for components:");
|
|
60
|
+
for (const name of report.missingHumanMetadata) {
|
|
61
|
+
console.log(`- ${name}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (report.validate.errors.length > 0) {
|
|
65
|
+
console.log("Validation errors:");
|
|
66
|
+
for (const issue of report.validate.errors) {
|
|
67
|
+
console.log(`- [${issue.code}] ${issue.path}: ${issue.message}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if ((report.governance?.errors.length ?? 0) > 0) {
|
|
71
|
+
console.log("Governance errors:");
|
|
72
|
+
for (const issue of report.governance?.errors ?? []) {
|
|
73
|
+
console.log(`- [${issue.code}] ${issue.path}: ${issue.message}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (!report.validate.valid) {
|
|
78
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
83
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
84
|
+
(0, cli_output_1.printJson)({ command: "generate", ok: false, error: message });
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
(0, cli_output_1.errorMessage)(`generate failed: ${message}`);
|
|
88
|
+
}
|
|
89
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
(0, attach_command_help_1.attachCommandHelp)(command, "generate");
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":";;;;;AAcA,0DAqFC;AAlGD,2CAAiD;AACjD,wEAAmE;AACnE,0DAA6B;AAC7B,wDAOiC;AACjC,mDAAiE;AAEjE,SAAgB,uBAAuB,CAAC,OAAgB;IACtD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,8CAA8C,CAAC;SAC3D,MAAM,CAAC,QAAQ,EAAE,8BAA8B,CAAC;SAChD,MAAM,CAAC,SAAS,EAAE,kDAAkD,CAAC;SACrE,MAAM,CAAC,KAAK,EAAE,OAA4C,EAAE,EAAE;QAC7D,IAAI,CAAC;YACH,IAAI,IAAA,kBAAQ,GAAE,EAAE,CAAC;gBACf,MAAM,OAAO,GAAG;oBACd,OAAO,EAAE,UAAU;oBACnB,MAAM,EAAE,IAAI;oBACZ,EAAE,EAAE,IAAI;oBACR,KA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ClC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,UAAU,EAAE,MAAM,IAAI,EAAE,EAAE,CAAC;wBACpD,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;oBACnE,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;gBAC3B,IAAA,wBAAW,EAAC,uBAAU,CAAC,aAAa,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,IAAI,IAAA,wBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,IAAA,sBAAS,EAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAChE,CAAC;iBAAM,CAAC;gBACN,IAAA,yBAAY,EAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;YAC9C,CAAC;YACD,IAAA,wBAAW,EAAC,uBAAU,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,IAAA,uCAAiB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGovernanceCommand = registerGovernanceCommand;
|
|
4
|
+
const core_1 = require("@mimir-labs/core");
|
|
5
|
+
const attach_command_help_1 = require("../dx/help/attach-command-help");
|
|
6
|
+
const cli_output_1 = require("../dx/output/cli-output");
|
|
7
|
+
const options_1 = require("../dx/runtime/options");
|
|
8
|
+
function registerGovernanceCommand(program) {
|
|
9
|
+
const command = program
|
|
10
|
+
.command("governance")
|
|
11
|
+
.description("Validate APS governance compliance")
|
|
12
|
+
.option("--json", "Emit machine-readable governance result")
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
try {
|
|
15
|
+
const result = await (0, core_1.runGovernanceValidation)(process.cwd());
|
|
16
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
17
|
+
(0, cli_output_1.printJson)({ command: "governance", ok: result.valid, result });
|
|
18
|
+
if (!result.valid) {
|
|
19
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
20
|
+
}
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
(0, cli_output_1.success)("governance validation complete");
|
|
24
|
+
console.log(`- valid: ${result.valid}`);
|
|
25
|
+
console.log(`- errors: ${result.errors.length}`);
|
|
26
|
+
console.log(`- warnings: ${result.warnings.length}`);
|
|
27
|
+
console.log(`- resources checked: ${result.metrics.resourcesChecked}`);
|
|
28
|
+
console.log(`- evidence coverage: ${result.metrics.evidenceCoverage}%`);
|
|
29
|
+
console.log(`- provenance coverage: ${result.metrics.provenanceCoverage}%`);
|
|
30
|
+
if (result.warnings.length > 0) {
|
|
31
|
+
for (const warning of result.warnings) {
|
|
32
|
+
(0, cli_output_1.warn)(`[${warning.code}] ${warning.path}: ${warning.message}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (result.errors.length > 0) {
|
|
36
|
+
(0, cli_output_1.errorMessage)("governance validation failed");
|
|
37
|
+
for (const error of result.errors) {
|
|
38
|
+
console.error(`- [${error.code}] ${error.path}: ${error.message}`);
|
|
39
|
+
}
|
|
40
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
(0, cli_output_1.success)("APS governance validation passed");
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
47
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
48
|
+
(0, cli_output_1.printJson)({ command: "governance", ok: false, error: message });
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
(0, cli_output_1.errorMessage)(`governance validation failed: ${message}`);
|
|
52
|
+
}
|
|
53
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
(0, attach_command_help_1.attachCommandHelp)(command, "governance");
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=governance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance.js","sourceRoot":"","sources":["../../src/commands/governance.ts"],"names":[],"mappings":";;AAaA,8DAqDC;AAjED,2CAA2D;AAC3D,wEAAmE;AACnE,wDAOiC;AACjC,mDAAuD;AAEvD,SAAgB,yBAAyB,CAAC,OAAgB;IACxD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,oCAAoC,CAAC;SACjD,MAAM,CAAC,QAAQ,EAAE,yCAAyC,CAAC;SAC3D,MAAM,CAAC,KAAK,EAAE,OAA2B,EAAE,EAAE;QAC5C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAuB,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;YAE5D,IAAI,IAAA,wBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,IAAA,sBAAS,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;gBAC/D,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;oBAClB,IAAA,wBAAW,EAAC,uBAAU,CAAC,aAA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,CAAC,CAAC;gBACtC,OAAO;YACT,CAAC;YAED,IAAA,oBAAO,EAAC,kCAAkC,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,IAAI,IAAA,wBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,IAAA,sBAAS,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAClE,CAAC;iBAAM,CAAC;gBACN,IAAA,yBAAY,EAAC,iCAAiC,OAAO,EAAE,CAAC,CAAC;YAC3D,CAAC;YACD,IAAA,wBAAW,EAAC,uBAAU,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,IAAA,uCAAiB,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerInitCommand = registerInitCommand;
|
|
4
|
+
const core_1 = require("@mimir-labs/core");
|
|
5
|
+
const attach_command_help_1 = require("../dx/help/attach-command-help");
|
|
6
|
+
const cli_output_1 = require("../dx/output/cli-output");
|
|
7
|
+
const options_1 = require("../dx/runtime/options");
|
|
8
|
+
function registerInitCommand(program) {
|
|
9
|
+
const command = program
|
|
10
|
+
.command("init")
|
|
11
|
+
.description("Initialize APS support in package.json")
|
|
12
|
+
.option("--json", "Emit machine-readable result")
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
try {
|
|
15
|
+
if ((0, options_1.isDryRun)()) {
|
|
16
|
+
const payload = {
|
|
17
|
+
command: "init",
|
|
18
|
+
dryRun: true,
|
|
19
|
+
ok: true,
|
|
20
|
+
plan: ["prepare aps configuration in package.json"]
|
|
21
|
+
};
|
|
22
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
23
|
+
(0, cli_output_1.printJson)(payload);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
(0, cli_output_1.success)("dry-run: would prepare APS configuration in package.json");
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const result = await (0, core_1.prepareApsConfig)(process.cwd());
|
|
31
|
+
if (!result.changed) {
|
|
32
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
33
|
+
(0, cli_output_1.printJson)({ command: "init", ok: true, changed: false, warnings: [] });
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
(0, cli_output_1.success)("APS config already present in package.json. No changes made.");
|
|
37
|
+
}
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (result.legacyAiDetected) {
|
|
41
|
+
(0, cli_output_1.warn)("legacy 'ai' configuration detected. 'aps' has been prepared.");
|
|
42
|
+
}
|
|
43
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
44
|
+
(0, cli_output_1.printJson)({
|
|
45
|
+
command: "init",
|
|
46
|
+
ok: true,
|
|
47
|
+
changed: true,
|
|
48
|
+
warnings: result.legacyAiDetected ? ["legacy-ai-configuration-detected"] : []
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
(0, cli_output_1.success)("APS configuration prepared in package.json.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
57
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
58
|
+
(0, cli_output_1.printJson)({ command: "init", ok: false, error: message });
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
(0, cli_output_1.errorMessage)(`init failed: ${message}`);
|
|
62
|
+
}
|
|
63
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
(0, attach_command_help_1.attachCommandHelp)(command, "init");
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;AAaA,kDA2DC;AAvED,2CAAoD;AACpD,wEAAmE;AACnE,wDAOiC;AACjC,mDAAiE;AAEjE,SAAgB,mBAAmB,CAAC,OAAgB;IAClD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,wCAAwC,CAAC;SACrD,MAAM,CAAC,QAAQ,EAAE,8BAA8B,CAAC;SAChD,MAAM,CAAC,KAAK,EAAE,OAA2B,EAAE,EAAE;QAC5C,IAAI,CAAC;YACH,IAAI,IAAA,kBAAQ,GAAE,EAAE,CAAC;gBACf,MAAM,OAAO,GAAG;oBACd,OAAO,EAAE,MAAM;oBACf,MAAM,EAAE,IAAI;oBACZ,EAAE,EAAE,IAAI;oBACR,IAAI,EAAE,CAAC,2CAA2C,CAAC;iBACpD,CAAC;gBACF,IAAI,IAAA,wBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;oBACjC,IAAA,sBAAS,EAAC,OAAO,CAAC,CAAC;gBACrB,CAAC;qBAAM,CAAC;oBACN,IAAA,oBAAO,EAAC,0DAA0D,CAAC,CAAC;gBACtE,CAAC;gBACD,OAAO;YACT,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,IAAA,uBAAgB,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;YAErD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,IAAI,IAAA,wBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;oBACjC,IAAA,sBAAS,EA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,CAAC;IAEL,IAAA,uCAAiB,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerSyncCommand = registerSyncCommand;
|
|
4
|
+
const core_1 = require("@mimir-labs/core");
|
|
5
|
+
const attach_command_help_1 = require("../dx/help/attach-command-help");
|
|
6
|
+
const cli_output_1 = require("../dx/output/cli-output");
|
|
7
|
+
const options_1 = require("../dx/runtime/options");
|
|
8
|
+
function registerSyncCommand(program) {
|
|
9
|
+
const command = program
|
|
10
|
+
.command("sync")
|
|
11
|
+
.description("Synchronize APS context to configured AI agent adapters")
|
|
12
|
+
.option("--json", "Emit machine-readable sync result")
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
try {
|
|
15
|
+
if ((0, options_1.isDryRun)()) {
|
|
16
|
+
const payload = {
|
|
17
|
+
command: "sync",
|
|
18
|
+
dryRun: true,
|
|
19
|
+
ok: true,
|
|
20
|
+
plan: ["discover providers", "generate context", "sync configured adapters"]
|
|
21
|
+
};
|
|
22
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
23
|
+
(0, cli_output_1.printJson)(payload);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
(0, cli_output_1.success)("dry-run: would discover providers, generate context, and sync adapters");
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const result = await (0, core_1.runSyncWorkflow)(process.cwd());
|
|
31
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
32
|
+
(0, cli_output_1.printJson)({ command: "sync", ok: true, result });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
(0, cli_output_1.success)("sync complete");
|
|
36
|
+
console.log("Providers:");
|
|
37
|
+
if (result.discovery.providers.length === 0) {
|
|
38
|
+
console.log("- none");
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
for (const provider of result.discovery.providers) {
|
|
42
|
+
console.log(`- OK ${provider.name}`);
|
|
43
|
+
for (const warning of provider.warnings) {
|
|
44
|
+
(0, cli_output_1.warn)(`${provider.name}: ${warning}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
console.log("");
|
|
49
|
+
console.log("Adapters:");
|
|
50
|
+
for (const adapterResult of result.adapterResults) {
|
|
51
|
+
console.log(`- OK ${adapterResult.message}`);
|
|
52
|
+
for (const warning of adapterResult.warnings) {
|
|
53
|
+
(0, cli_output_1.warn)(`${adapterResult.adapter}: ${warning}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
console.log("");
|
|
57
|
+
console.log("No user content overwritten.");
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
61
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
62
|
+
(0, cli_output_1.printJson)({ command: "sync", ok: false, error: message });
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
(0, cli_output_1.errorMessage)(`sync failed: ${message}`);
|
|
66
|
+
}
|
|
67
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
(0, attach_command_help_1.attachCommandHelp)(command, "sync");
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":";;AAaA,kDAkEC;AA9ED,2CAAmD;AACnD,wEAAmE;AACnE,wDAOiC;AACjC,mDAAiE;AAEjE,SAAgB,mBAAmB,CAAC,OAAgB;IAClD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,yDAAyD,CAAC;SACtE,MAA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,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerValidateCommand = registerValidateCommand;
|
|
4
|
+
const core_1 = require("@mimir-labs/core");
|
|
5
|
+
const attach_command_help_1 = require("../dx/help/attach-command-help");
|
|
6
|
+
const cli_output_1 = require("../dx/output/cli-output");
|
|
7
|
+
const options_1 = require("../dx/runtime/options");
|
|
8
|
+
function registerValidateCommand(program) {
|
|
9
|
+
const command = program
|
|
10
|
+
.command("validate")
|
|
11
|
+
.description("Validate APS compliance for current package")
|
|
12
|
+
.option("--json", "Emit machine-readable validation result")
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
try {
|
|
15
|
+
const result = await (0, core_1.runValidation)(process.cwd());
|
|
16
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
17
|
+
(0, cli_output_1.printJson)({ command: "validate", ok: result.valid, result });
|
|
18
|
+
if (!result.valid) {
|
|
19
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
20
|
+
}
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
(0, cli_output_1.success)(`validation complete (valid=${result.valid}, errors=${result.errors.length}, warnings=${result.warnings.length})`);
|
|
24
|
+
if (result.validResources.length > 0) {
|
|
25
|
+
console.log("Resources:");
|
|
26
|
+
for (const resource of result.validResources) {
|
|
27
|
+
console.log(`- ${resource}`);
|
|
28
|
+
}
|
|
29
|
+
console.log("");
|
|
30
|
+
}
|
|
31
|
+
if (result.warnings.length > 0) {
|
|
32
|
+
for (const warning of result.warnings) {
|
|
33
|
+
(0, cli_output_1.warn)(warning);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (result.errors.length > 0) {
|
|
37
|
+
(0, cli_output_1.errorMessage)("validation failed");
|
|
38
|
+
for (const error of result.errors) {
|
|
39
|
+
console.error(`- [${error.code}] ${error.path}: ${error.message}`);
|
|
40
|
+
}
|
|
41
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
(0, cli_output_1.success)("APS validation passed");
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
48
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
49
|
+
(0, cli_output_1.printJson)({ command: "validate", ok: false, error: message });
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
(0, cli_output_1.errorMessage)(`validation failed: ${message}`);
|
|
53
|
+
}
|
|
54
|
+
(0, cli_output_1.setExitCode)(cli_output_1.EXIT_CODES.GENERAL_ERROR);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
(0, attach_command_help_1.attachCommandHelp)(command, "validate");
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":";;AAaA,0DAyDC;AArED,2CAAiD;AACjD,wEAAmE;AACnE,wDAOiC;AACjC,mDAAuD;AAEvD,SAAgB,uBAAuB,CAAC,OAAgB;IACtD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,6CAA6C,CAAC;SAC1D,MAAM,CAAC,QAAQ,EAAE,yCAAyC,CAAC;SAC3D,MAAM,CAAC,KAAK,EAAE,OAA2B,EAAE,EAAE;QAC5C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAA,oBAAa,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;YAElD,IAAI,IAAA,wBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,IAAA,sBAA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C,uBAAU,CAAC,aAAa,CAAC,CAAC;gBACtC,OAAO;YACT,CAAC;YAED,IAAA,oBAAO,EAAC,uBAAuB,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,IAAI,IAAA,wBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,IAAA,sBAAS,EAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAChE,CAAC;iBAAM,CAAC;gBACN,IAAA,yBAAY,EAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC;YAChD,CAAC;YACD,IAAA,wBAAW,EAAC,uBAAU,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,IAAA,uCAAiB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerAboutCommand = registerAboutCommand;
|
|
4
|
+
const constants_1 = require("../branding/constants");
|
|
5
|
+
const attach_command_help_1 = require("../help/attach-command-help");
|
|
6
|
+
const cli_output_1 = require("../output/cli-output");
|
|
7
|
+
const options_1 = require("../runtime/options");
|
|
8
|
+
function resolveVersion(command) {
|
|
9
|
+
const value = command.parent?.version();
|
|
10
|
+
return typeof value === "string" && value.trim() !== "" ? value : "unknown";
|
|
11
|
+
}
|
|
12
|
+
function buildAboutPayload(command) {
|
|
13
|
+
return {
|
|
14
|
+
brand: constants_1.CLI_BRAND,
|
|
15
|
+
protocol: constants_1.CLI_PROTOCOL_NAME,
|
|
16
|
+
binary: constants_1.CLI_BINARY_NAME,
|
|
17
|
+
version: resolveVersion(command),
|
|
18
|
+
providerWorkflow: [
|
|
19
|
+
(0, constants_1.cliCommand)("init"),
|
|
20
|
+
(0, constants_1.cliCommand)("generate"),
|
|
21
|
+
(0, constants_1.cliCommand)("validate"),
|
|
22
|
+
(0, constants_1.cliCommand)("governance"),
|
|
23
|
+
(0, constants_1.cliCommand)("doctor")
|
|
24
|
+
],
|
|
25
|
+
consumerWorkflow: [
|
|
26
|
+
"npm install <provider-package>",
|
|
27
|
+
(0, constants_1.cliCommand)("discover"),
|
|
28
|
+
(0, constants_1.cliCommand)("sync")
|
|
29
|
+
],
|
|
30
|
+
docs: constants_1.CLI_DOC_RELATIVE_PATH,
|
|
31
|
+
repository: constants_1.CLI_REPOSITORY_URL
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function registerAboutCommand(program) {
|
|
35
|
+
const command = program
|
|
36
|
+
.command("about")
|
|
37
|
+
.description("Show an overview of APS Protocol and Mimir CLI workflows")
|
|
38
|
+
.option("--json", "Emit machine-readable about information")
|
|
39
|
+
.action((options, actionCommand) => {
|
|
40
|
+
const payload = buildAboutPayload(actionCommand);
|
|
41
|
+
if ((0, options_1.shouldEmitJson)(options.json)) {
|
|
42
|
+
(0, cli_output_1.printJson)({ command: "about", ok: true, about: payload });
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
console.log(`${payload.brand} (${payload.version})`);
|
|
46
|
+
console.log(`Protocol: ${payload.protocol}`);
|
|
47
|
+
console.log("");
|
|
48
|
+
console.log("What it is:");
|
|
49
|
+
console.log(`- ${payload.protocol} is an open specification for publishing structured software knowledge that AI agents can consume consistently.`);
|
|
50
|
+
console.log("");
|
|
51
|
+
console.log("Provider workflow:");
|
|
52
|
+
for (const step of payload.providerWorkflow) {
|
|
53
|
+
console.log(`- ${step}`);
|
|
54
|
+
}
|
|
55
|
+
console.log("- publish package");
|
|
56
|
+
console.log("");
|
|
57
|
+
console.log("Consumer workflow:");
|
|
58
|
+
for (const step of payload.consumerWorkflow) {
|
|
59
|
+
console.log(`- ${step}`);
|
|
60
|
+
}
|
|
61
|
+
console.log("");
|
|
62
|
+
console.log("Docs:");
|
|
63
|
+
console.log(`- ${payload.docs}`);
|
|
64
|
+
console.log("Repository:");
|
|
65
|
+
console.log(`- ${payload.repository}`);
|
|
66
|
+
});
|
|
67
|
+
(0, attach_command_help_1.attachCommandHelp)(command, "about");
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=command.js.map
|