@shrkcrft/cli 0.1.0-alpha.28 → 0.1.0-alpha.29
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/dist/commands/baseline.command.d.ts.map +1 -1
- package/dist/commands/baseline.command.js +42 -11
- package/dist/commands/changelog-data.d.ts.map +1 -1
- package/dist/commands/changelog-data.js +20 -0
- package/dist/commands/check.command.d.ts.map +1 -1
- package/dist/commands/check.command.js +119 -11
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +8 -0
- package/dist/commands/daily.commands.d.ts.map +1 -1
- package/dist/commands/daily.commands.js +11 -1
- package/dist/commands/gates.command.d.ts +11 -1
- package/dist/commands/gates.command.d.ts.map +1 -1
- package/dist/commands/gates.command.js +53 -10
- package/dist/commands/generated.command.d.ts.map +1 -1
- package/dist/commands/generated.command.js +36 -6
- package/dist/commands/help.command.d.ts.map +1 -1
- package/dist/commands/help.command.js +64 -2
- package/dist/commands/policy-lint.command.d.ts.map +1 -1
- package/dist/commands/policy-lint.command.js +52 -10
- package/dist/commands/registry.command.d.ts.map +1 -1
- package/dist/commands/registry.command.js +34 -9
- package/dist/exit-codes.d.ts +27 -7
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +47 -8
- package/dist/gates/gate-envelope.d.ts +64 -0
- package/dist/gates/gate-envelope.d.ts.map +1 -0
- package/dist/gates/gate-envelope.js +26 -0
- package/dist/gates/gate-rule-view.d.ts +1 -1
- package/dist/gates/gate-rule-view.d.ts.map +1 -1
- package/dist/gates/gate-rule-view.js +5 -4
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -1
- package/package.json +33 -33
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One machine-readable shape for every gate verb.
|
|
3
|
+
*
|
|
4
|
+
* `--json` has always been available on each plane, but each emitted its own
|
|
5
|
+
* schema (`sharkcraft.wiring/v1`, `sharkcraft.baseline/v1`, …), so a CI step or
|
|
6
|
+
* agent had to parse four shapes to answer one question: which rules ran, which
|
|
7
|
+
* failed, and why. This envelope is that answer, identical across planes.
|
|
8
|
+
*
|
|
9
|
+
* It is ADDITIVE. The per-plane payloads are published, documented, and asserted
|
|
10
|
+
* by tests; replacing them would break every existing consumer. The envelope
|
|
11
|
+
* rides along under a `gate` key, so `jq .gate` is the uniform read and nothing
|
|
12
|
+
* that worked before stops working.
|
|
13
|
+
*/
|
|
14
|
+
export const GATE_ENVELOPE_SCHEMA = 'sharkcraft.gate/v1';
|
|
15
|
+
/** Build the envelope from already-normalized per-rule results. */
|
|
16
|
+
export function buildGateEnvelope(verb, exit, rules) {
|
|
17
|
+
return {
|
|
18
|
+
schema: GATE_ENVELOPE_SCHEMA,
|
|
19
|
+
verb,
|
|
20
|
+
exit,
|
|
21
|
+
rules,
|
|
22
|
+
evaluated: rules.filter((r) => r.status !== 'skipped').length,
|
|
23
|
+
skipped: rules.filter((r) => r.status === 'skipped').length,
|
|
24
|
+
failed: rules.filter((r) => r.status === 'failed' || r.status === 'error').length,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IBaselineRule, type IGeneratedArtifactRule, type IPolicyRule, type IRegistrationIdiom, type IRegistryDeclaration, type IRuleSelfTest, type IWiringRule } from '@shrkcrft/core';
|
|
2
2
|
/** Which data-defined plane a rule belongs to. */
|
|
3
3
|
export type GatePlane = 'wiring' | 'policy' | 'registry' | 'registration' | 'baseline' | 'generated';
|
|
4
4
|
/** Every plane, in the order `shrk gates list` prints them. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-rule-view.d.ts","sourceRoot":"","sources":["../../src/gates/gate-rule-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"gate-rule-view.d.ts","sourceRoot":"","sources":["../../src/gates/gate-rule-view.ts"],"names":[],"mappings":"A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E,SAAS,sBAAsB,EAAE,CAAC;CACjE;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,EAAE,CAqErE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { failsWhenEmpty, } from '@shrkcrft/core';
|
|
1
2
|
/** Every plane, in the order `shrk gates list` prints them. */
|
|
2
3
|
export const GATE_PLANES = [
|
|
3
4
|
'wiring',
|
|
@@ -16,7 +17,7 @@ export function collectGateRules(planes) {
|
|
|
16
17
|
plane: 'wiring',
|
|
17
18
|
...(r.description ? { description: r.description } : {}),
|
|
18
19
|
severity: r.severity ?? 'error',
|
|
19
|
-
failOnEmpty: r
|
|
20
|
+
failOnEmpty: failsWhenEmpty(r),
|
|
20
21
|
...(r.selfTest ? { selfTest: r.selfTest } : {}),
|
|
21
22
|
raw: r,
|
|
22
23
|
});
|
|
@@ -27,7 +28,7 @@ export function collectGateRules(planes) {
|
|
|
27
28
|
plane: 'policy',
|
|
28
29
|
...(r.description ? { description: r.description } : {}),
|
|
29
30
|
severity: r.severity ?? 'error',
|
|
30
|
-
failOnEmpty: r
|
|
31
|
+
failOnEmpty: failsWhenEmpty(r),
|
|
31
32
|
...(r.selfTest ? { selfTest: r.selfTest } : {}),
|
|
32
33
|
raw: r,
|
|
33
34
|
});
|
|
@@ -60,7 +61,7 @@ export function collectGateRules(planes) {
|
|
|
60
61
|
plane: 'baseline',
|
|
61
62
|
...(r.description ? { description: r.description } : {}),
|
|
62
63
|
severity: r.severity ?? 'error',
|
|
63
|
-
failOnEmpty: r
|
|
64
|
+
failOnEmpty: failsWhenEmpty(r),
|
|
64
65
|
...(r.selfTest ? { selfTest: r.selfTest } : {}),
|
|
65
66
|
raw: r,
|
|
66
67
|
});
|
|
@@ -71,7 +72,7 @@ export function collectGateRules(planes) {
|
|
|
71
72
|
plane: 'generated',
|
|
72
73
|
...(r.description ? { description: r.description } : {}),
|
|
73
74
|
severity: r.severity ?? 'error',
|
|
74
|
-
failOnEmpty: r
|
|
75
|
+
failOnEmpty: failsWhenEmpty(r),
|
|
75
76
|
...(r.selfTest ? { selfTest: r.selfTest } : {}),
|
|
76
77
|
raw: r,
|
|
77
78
|
});
|
package/dist/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,eAAe,EAMhB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,eAAe,EAMhB,MAAM,uBAAuB,CAAC;AA0Z/B,wBAAgB,aAAa,IAAI,eAAe,CAqZ/C;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAgDrE;AAwID;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAoDxE"}
|
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { loadDotenv } from "./env/load-dotenv.js";
|
|
3
3
|
import { CommandRegistry, extractGlobalCompress, extractGlobalCwd, extractGlobalExitTrailer, parseArgs, } from "./command-registry.js";
|
|
4
|
-
import { argvHasExitTrailer, argvHasStrict, emitPipeExitSignal, promoteForStrict } from "./exit-codes.js";
|
|
4
|
+
import { argvHasExitTrailer, argvHasNoHints, argvHasStrict, emitPipeExitSignal, promoteForStrict, } from "./exit-codes.js";
|
|
5
5
|
import { runCommandWithCompression } from "./output/output-compression.js";
|
|
6
6
|
import { initCommand } from "./commands/init.command.js";
|
|
7
7
|
import { inspectCommand } from "./commands/inspect.command.js";
|
|
@@ -555,6 +555,7 @@ export async function runCli(argv) {
|
|
|
555
555
|
emitPipeExitSignal(command, exitCode, {
|
|
556
556
|
piped: !process.stdout.isTTY,
|
|
557
557
|
trailer: argvHasExitTrailer(argv),
|
|
558
|
+
noHints: argvHasNoHints(argv),
|
|
558
559
|
});
|
|
559
560
|
}
|
|
560
561
|
return exitCode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shrkcrft/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.29",
|
|
4
4
|
"description": "SharkCraft CLI (`shrk`): structured project intelligence for AI coding agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SharkCraft contributors",
|
|
@@ -47,38 +47,38 @@
|
|
|
47
47
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@shrkcrft/core": "^0.1.0-alpha.
|
|
51
|
-
"@shrkcrft/compress": "^0.1.0-alpha.
|
|
52
|
-
"@shrkcrft/config": "^0.1.0-alpha.
|
|
53
|
-
"@shrkcrft/workspace": "^0.1.0-alpha.
|
|
54
|
-
"@shrkcrft/knowledge": "^0.1.0-alpha.
|
|
55
|
-
"@shrkcrft/context": "^0.1.0-alpha.
|
|
56
|
-
"@shrkcrft/rules": "^0.1.0-alpha.
|
|
57
|
-
"@shrkcrft/paths": "^0.1.0-alpha.
|
|
58
|
-
"@shrkcrft/templates": "^0.1.0-alpha.
|
|
59
|
-
"@shrkcrft/plugin-api": "^0.1.0-alpha.
|
|
60
|
-
"@shrkcrft/dashboard": "^0.1.0-alpha.
|
|
61
|
-
"@shrkcrft/dashboard-api": "^0.1.0-alpha.
|
|
62
|
-
"@shrkcrft/pipelines": "^0.1.0-alpha.
|
|
63
|
-
"@shrkcrft/presets": "^0.1.0-alpha.
|
|
64
|
-
"@shrkcrft/boundaries": "^0.1.0-alpha.
|
|
65
|
-
"@shrkcrft/graph": "^0.1.0-alpha.
|
|
66
|
-
"@shrkcrft/rule-graph": "^0.1.0-alpha.
|
|
67
|
-
"@shrkcrft/structural-search": "^0.1.0-alpha.
|
|
68
|
-
"@shrkcrft/impact-engine": "^0.1.0-alpha.
|
|
69
|
-
"@shrkcrft/context-planner": "^0.1.0-alpha.
|
|
70
|
-
"@shrkcrft/architecture-guard": "^0.1.0-alpha.
|
|
71
|
-
"@shrkcrft/framework-scanners": "^0.1.0-alpha.
|
|
72
|
-
"@shrkcrft/api-surface-diff": "^0.1.0-alpha.
|
|
73
|
-
"@shrkcrft/quality-gates": "^0.1.0-alpha.
|
|
74
|
-
"@shrkcrft/migrate": "^0.1.0-alpha.
|
|
75
|
-
"@shrkcrft/generator": "^0.1.0-alpha.
|
|
76
|
-
"@shrkcrft/importer": "^0.1.0-alpha.
|
|
77
|
-
"@shrkcrft/inspector": "^0.1.0-alpha.
|
|
78
|
-
"@shrkcrft/ai": "^0.1.0-alpha.
|
|
79
|
-
"@shrkcrft/embeddings": "^0.1.0-alpha.
|
|
80
|
-
"@shrkcrft/shared": "^0.1.0-alpha.
|
|
81
|
-
"@shrkcrft/mcp-server": "^0.1.0-alpha.
|
|
50
|
+
"@shrkcrft/core": "^0.1.0-alpha.29",
|
|
51
|
+
"@shrkcrft/compress": "^0.1.0-alpha.29",
|
|
52
|
+
"@shrkcrft/config": "^0.1.0-alpha.29",
|
|
53
|
+
"@shrkcrft/workspace": "^0.1.0-alpha.29",
|
|
54
|
+
"@shrkcrft/knowledge": "^0.1.0-alpha.29",
|
|
55
|
+
"@shrkcrft/context": "^0.1.0-alpha.29",
|
|
56
|
+
"@shrkcrft/rules": "^0.1.0-alpha.29",
|
|
57
|
+
"@shrkcrft/paths": "^0.1.0-alpha.29",
|
|
58
|
+
"@shrkcrft/templates": "^0.1.0-alpha.29",
|
|
59
|
+
"@shrkcrft/plugin-api": "^0.1.0-alpha.29",
|
|
60
|
+
"@shrkcrft/dashboard": "^0.1.0-alpha.29",
|
|
61
|
+
"@shrkcrft/dashboard-api": "^0.1.0-alpha.29",
|
|
62
|
+
"@shrkcrft/pipelines": "^0.1.0-alpha.29",
|
|
63
|
+
"@shrkcrft/presets": "^0.1.0-alpha.29",
|
|
64
|
+
"@shrkcrft/boundaries": "^0.1.0-alpha.29",
|
|
65
|
+
"@shrkcrft/graph": "^0.1.0-alpha.29",
|
|
66
|
+
"@shrkcrft/rule-graph": "^0.1.0-alpha.29",
|
|
67
|
+
"@shrkcrft/structural-search": "^0.1.0-alpha.29",
|
|
68
|
+
"@shrkcrft/impact-engine": "^0.1.0-alpha.29",
|
|
69
|
+
"@shrkcrft/context-planner": "^0.1.0-alpha.29",
|
|
70
|
+
"@shrkcrft/architecture-guard": "^0.1.0-alpha.29",
|
|
71
|
+
"@shrkcrft/framework-scanners": "^0.1.0-alpha.29",
|
|
72
|
+
"@shrkcrft/api-surface-diff": "^0.1.0-alpha.29",
|
|
73
|
+
"@shrkcrft/quality-gates": "^0.1.0-alpha.29",
|
|
74
|
+
"@shrkcrft/migrate": "^0.1.0-alpha.29",
|
|
75
|
+
"@shrkcrft/generator": "^0.1.0-alpha.29",
|
|
76
|
+
"@shrkcrft/importer": "^0.1.0-alpha.29",
|
|
77
|
+
"@shrkcrft/inspector": "^0.1.0-alpha.29",
|
|
78
|
+
"@shrkcrft/ai": "^0.1.0-alpha.29",
|
|
79
|
+
"@shrkcrft/embeddings": "^0.1.0-alpha.29",
|
|
80
|
+
"@shrkcrft/shared": "^0.1.0-alpha.29",
|
|
81
|
+
"@shrkcrft/mcp-server": "^0.1.0-alpha.29",
|
|
82
82
|
"@huggingface/transformers": "^3.7.5"
|
|
83
83
|
},
|
|
84
84
|
"publishConfig": {
|