@shrkcrft/inspector 0.1.0-alpha.8 → 0.1.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/adoption-state.js +1 -1
- package/dist/agent-brief.d.ts.map +1 -1
- package/dist/agent-brief.js +10 -59
- package/dist/agent-task-prep.d.ts.map +1 -1
- package/dist/agent-task-prep.js +3 -1
- package/dist/ai-readiness.d.ts +9 -84
- package/dist/ai-readiness.d.ts.map +1 -1
- package/dist/ai-readiness.js +30 -161
- package/dist/apply-dispatch-trace.d.ts +2 -1
- package/dist/apply-dispatch-trace.d.ts.map +1 -1
- package/dist/apply-dispatch-trace.js +9 -0
- package/dist/area-explore.d.ts.map +1 -1
- package/dist/area-explore.js +5 -1
- package/dist/area-map.d.ts +19 -0
- package/dist/area-map.d.ts.map +1 -1
- package/dist/area-map.js +27 -0
- package/dist/ci-permissions-fix.d.ts +1 -1
- package/dist/ci-permissions-fix.d.ts.map +1 -1
- package/dist/ci-permissions-fix.js +182 -1
- package/dist/compliance-profiles.js +1 -1
- package/dist/construct-adoption-diff.d.ts.map +1 -1
- package/dist/construct-adoption-diff.js +1 -2
- package/dist/construct-adoption.d.ts.map +1 -1
- package/dist/construct-adoption.js +11 -10
- package/dist/construct-inference.d.ts.map +1 -1
- package/dist/construct-inference.js +1 -2
- package/dist/construct-registry.d.ts.map +1 -1
- package/dist/construct-registry.js +10 -2
- package/dist/contract-template-registry.d.ts.map +1 -1
- package/dist/contract-template-registry.js +10 -2
- package/dist/convention-registry.d.ts.map +1 -1
- package/dist/convention-registry.js +10 -2
- package/dist/decision-records.d.ts.map +1 -1
- package/dist/decision-records.js +9 -2
- package/dist/demo-script.d.ts +1 -0
- package/dist/demo-script.d.ts.map +1 -1
- package/dist/demo-script.js +43 -0
- package/dist/docs-check.js +1 -1
- package/dist/drift-baseline.d.ts.map +1 -1
- package/dist/drift-baseline.js +2 -5
- package/dist/feedback-ingestion.d.ts.map +1 -1
- package/dist/feedback-ingestion.js +16 -2
- package/dist/git-helpers.d.ts +12 -0
- package/dist/git-helpers.d.ts.map +1 -1
- package/dist/git-helpers.js +63 -0
- package/dist/helper-registry.d.ts +54 -27
- package/dist/helper-registry.d.ts.map +1 -1
- package/dist/helper-registry.js +517 -16
- package/dist/impact-analysis.d.ts.map +1 -1
- package/dist/impact-analysis.js +5 -4
- package/dist/impact-render.d.ts.map +1 -1
- package/dist/impact-render.js +9 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/ingest-drafts.js +4 -8
- package/dist/migration-profile-registry.d.ts.map +1 -1
- package/dist/migration-profile-registry.js +10 -2
- package/dist/monorepo-onboarding.js +2 -2
- package/dist/onboarding-drafts-merge.d.ts +71 -0
- package/dist/onboarding-drafts-merge.d.ts.map +1 -0
- package/dist/onboarding-drafts-merge.js +174 -0
- package/dist/onboarding-drafts.d.ts +14 -0
- package/dist/onboarding-drafts.d.ts.map +1 -1
- package/dist/onboarding-drafts.js +39 -5
- package/dist/onboarding-report.d.ts.map +1 -1
- package/dist/onboarding-report.js +1 -5
- package/dist/onboarding.d.ts +1 -1
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +64 -5
- package/dist/ownership.js +10 -2
- package/dist/pack-contributions-inventory.d.ts +1 -0
- package/dist/pack-contributions-inventory.d.ts.map +1 -1
- package/dist/pack-contributions-inventory.js +24 -0
- package/dist/pack-helper-registry.d.ts.map +1 -1
- package/dist/pack-helper-registry.js +10 -2
- package/dist/pack-release-check.d.ts.map +1 -1
- package/dist/pack-release-check.js +11 -4
- package/dist/pack-signature-status.d.ts.map +1 -1
- package/dist/pack-signature-status.js +1 -0
- package/dist/pack-symbol-compat.d.ts +17 -4
- package/dist/pack-symbol-compat.d.ts.map +1 -1
- package/dist/pack-symbol-compat.js +155 -7
- package/dist/pack-test-runner.js +10 -2
- package/dist/plan-simulation.d.ts.map +1 -1
- package/dist/plan-simulation.js +20 -3
- package/dist/playbook-registry.d.ts.map +1 -1
- package/dist/playbook-registry.js +10 -2
- package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
- package/dist/plugin-lifecycle-profile-registry.js +202 -0
- package/dist/plugin-lifecycle.d.ts +132 -0
- package/dist/plugin-lifecycle.d.ts.map +1 -0
- package/dist/plugin-lifecycle.js +477 -0
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +11 -3
- package/dist/policy-test.js +11 -3
- package/dist/product-coherence.js +5 -5
- package/dist/profile-registry.d.ts +1 -0
- package/dist/profile-registry.d.ts.map +1 -1
- package/dist/profile-registry.js +32 -4
- package/dist/quality-baseline.d.ts.map +1 -1
- package/dist/quality-baseline.js +1 -3
- package/dist/ranker-explainability.d.ts.map +1 -1
- package/dist/ranker-explainability.js +9 -3
- package/dist/registration-hint-registry.d.ts.map +1 -1
- package/dist/registration-hint-registry.js +10 -2
- package/dist/release-readiness.js +5 -5
- package/dist/reposet.js +1 -1
- package/dist/repository-knowledge-model.d.ts +1 -1
- package/dist/repository-knowledge-model.d.ts.map +1 -1
- package/dist/review-packet-v2.d.ts.map +1 -1
- package/dist/review-packet-v2.js +13 -3
- package/dist/rule-scaffold.d.ts.map +1 -1
- package/dist/rule-scaffold.js +4 -12
- package/dist/scaffold-patterns.js +10 -2
- package/dist/search-tuning-registry.d.ts.map +1 -1
- package/dist/search-tuning-registry.js +10 -2
- package/dist/self-config-doctor-v2.d.ts +1 -1
- package/dist/self-config-doctor-v2.d.ts.map +1 -1
- package/dist/self-config-doctor-v2.js +10 -6
- package/dist/self-config-doctor.d.ts.map +1 -1
- package/dist/self-config-doctor.js +13 -7
- package/dist/sharkcraft-inspector.d.ts.map +1 -1
- package/dist/sharkcraft-inspector.js +0 -1
- package/dist/start-here.d.ts +1 -1
- package/dist/start-here.js +1 -1
- package/dist/task-ranker.d.ts.map +1 -1
- package/dist/task-ranker.js +31 -1
- package/dist/task-routing-hint-registry.d.ts.map +1 -1
- package/dist/task-routing-hint-registry.js +10 -2
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +16 -8
- package/dist/universal-search.d.ts +1 -0
- package/dist/universal-search.d.ts.map +1 -1
- package/dist/universal-search.js +12 -0
- package/dist/upgrade-advisor.js +1 -1
- package/package.json +21 -22
- package/dist/synthesize-from-onboarding.d.ts +0 -68
- package/dist/synthesize-from-onboarding.d.ts.map +0 -1
- package/dist/synthesize-from-onboarding.js +0 -508
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
1
9
|
/**
|
|
2
10
|
* Convention registry. Loads pack + local conventions and validates
|
|
3
11
|
* them. Engine has no built-in conventions; everything comes from
|
|
@@ -5,8 +13,8 @@
|
|
|
5
13
|
*/
|
|
6
14
|
import { existsSync } from 'node:fs';
|
|
7
15
|
import * as nodePath from 'node:path';
|
|
16
|
+
import { pathToFileURL } from 'node:url';
|
|
8
17
|
import { validateConvention, } from '@shrkcrft/plugin-api';
|
|
9
|
-
import { importModuleViaLoader } from '@shrkcrft/core';
|
|
10
18
|
export const CONVENTION_REGISTRY_SCHEMA = 'sharkcraft.convention-registry/v1';
|
|
11
19
|
export var ConventionSource;
|
|
12
20
|
(function (ConventionSource) {
|
|
@@ -15,7 +23,7 @@ export var ConventionSource;
|
|
|
15
23
|
ConventionSource["Fixture"] = "fixture";
|
|
16
24
|
})(ConventionSource || (ConventionSource = {}));
|
|
17
25
|
async function importDefault(file) {
|
|
18
|
-
const mod = (await
|
|
26
|
+
const mod = (await import(__rewriteRelativeImportExtension(pathToFileURL(file).href)));
|
|
19
27
|
if (Array.isArray(mod.default))
|
|
20
28
|
return mod.default;
|
|
21
29
|
if (mod.default && typeof mod.default === 'object')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision-records.d.ts","sourceRoot":"","sources":["../src/decision-records.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"decision-records.d.ts","sourceRoot":"","sources":["../src/decision-records.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAE/D,oBAAY,cAAc;IACxB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,sBAAsB,CAAC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA8CD,wBAAgB,aAAa,CAAC,UAAU,EAAE,qBAAqB,GAAG,SAAS,eAAe,EAAE,CAyD3F;AA0BD;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAuCrC;AAaD,wBAAgB,WAAW,CAAC,UAAU,EAAE,qBAAqB,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAEtG;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CA0CvE;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAE/E"}
|
package/dist/decision-records.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
1
9
|
/**
|
|
2
10
|
* Decision / ADR support.
|
|
3
11
|
*
|
|
@@ -10,7 +18,6 @@
|
|
|
10
18
|
*/
|
|
11
19
|
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
12
20
|
import * as nodePath from 'node:path';
|
|
13
|
-
import { importModuleViaLoader } from '@shrkcrft/core';
|
|
14
21
|
export const DECISION_RECORD_SCHEMA = 'sharkcraft.decision/v1';
|
|
15
22
|
export var DecisionStatus;
|
|
16
23
|
(function (DecisionStatus) {
|
|
@@ -186,7 +193,7 @@ async function importDefaultArray(absPath) {
|
|
|
186
193
|
if (!existsSync(absPath))
|
|
187
194
|
return [];
|
|
188
195
|
const { pathToFileURL } = await import('node:url');
|
|
189
|
-
const mod = (await
|
|
196
|
+
const mod = (await import(__rewriteRelativeImportExtension(pathToFileURL(absPath).href)));
|
|
190
197
|
return Array.isArray(mod.default) ? mod.default : [];
|
|
191
198
|
}
|
|
192
199
|
catch {
|
package/dist/demo-script.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"demo-script.d.ts","sourceRoot":"","sources":["../src/demo-script.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,oBAAY,YAAY;IACtB,gBAAgB,sBAAsB;IACtC,QAAQ,cAAc;IACtB,UAAU,eAAe;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,kBAAkB,CAAC;IAClC,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;CACnC;
|
|
1
|
+
{"version":3,"file":"demo-script.d.ts","sourceRoot":"","sources":["../src/demo-script.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,oBAAY,YAAY;IACtB,gBAAgB,sBAAsB;IACtC,cAAc,oBAAoB;IAClC,QAAQ,cAAc;IACtB,UAAU,eAAe;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,kBAAkB,CAAC;IAClC,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;CACnC;AAsKD,wBAAgB,iBAAiB,IAAI,SAAS,YAAY,EAAE,CAE3D;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,YAAY,GAAG,WAAW,CAEjE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAsBjE"}
|
package/dist/demo-script.js
CHANGED
|
@@ -2,6 +2,7 @@ export const DEMO_SCRIPT_SCHEMA = 'sharkcraft.demo-script/v1';
|
|
|
2
2
|
export var DemoScenario;
|
|
3
3
|
(function (DemoScenario) {
|
|
4
4
|
DemoScenario["UnconfiguredRepo"] = "unconfigured-repo";
|
|
5
|
+
DemoScenario["PlatformPlugin"] = "platform-plugin";
|
|
5
6
|
DemoScenario["PrReview"] = "pr-review";
|
|
6
7
|
DemoScenario["Governance"] = "governance";
|
|
7
8
|
})(DemoScenario || (DemoScenario = {}));
|
|
@@ -51,6 +52,48 @@ const SCRIPTS = {
|
|
|
51
52
|
},
|
|
52
53
|
],
|
|
53
54
|
},
|
|
55
|
+
[DemoScenario.PlatformPlugin]: {
|
|
56
|
+
schema: DEMO_SCRIPT_SCHEMA,
|
|
57
|
+
scenario: DemoScenario.PlatformPlugin,
|
|
58
|
+
title: 'Add a plugin to a platform-adopter project',
|
|
59
|
+
description: 'Uses a pack-contributed plugin construct + playbook + lifecycle profile. SharkCraft does not embed any platform-specific assumptions; everything comes from the pack.',
|
|
60
|
+
steps: [
|
|
61
|
+
{
|
|
62
|
+
title: 'Confirm packs loaded',
|
|
63
|
+
commands: ['shrk packs doctor --require-signatures'],
|
|
64
|
+
notes: 'Set SHARKCRAFT_PACK_SECRET so signature verification can run.',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
title: 'Inspect the plugin construct contributed by the pack',
|
|
68
|
+
commands: ['shrk constructs list --filter plugin', 'shrk constructs get <pack>.plugin'],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
title: 'Walk the add-plugin playbook',
|
|
72
|
+
commands: [
|
|
73
|
+
'shrk playbooks recommend "add a profile plugin"',
|
|
74
|
+
'shrk playbooks list --filter plugin',
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: 'Use the lifecycle profile (rename / remove preview)',
|
|
79
|
+
commands: [
|
|
80
|
+
'shrk plugin lifecycle profiles',
|
|
81
|
+
'shrk plugin lifecycle list --profile <id>',
|
|
82
|
+
'shrk plugin rename old new --profile <id> --dry-run',
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
title: 'Render a chunked agent brief',
|
|
87
|
+
commands: [
|
|
88
|
+
'shrk brief "create a user profile plugin" --mode implementation --chunk --output-dir .sharkcraft/briefs/profile-plugin',
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
title: 'Start a dev session and let an agent take it from here',
|
|
93
|
+
commands: ['shrk dev start "create a user profile plugin" --brief'],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
54
97
|
[DemoScenario.PrReview]: {
|
|
55
98
|
schema: DEMO_SCRIPT_SCHEMA,
|
|
56
99
|
scenario: DemoScenario.PrReview,
|
package/dist/docs-check.js
CHANGED
|
@@ -101,7 +101,7 @@ export function buildDocsCheck(projectRoot, options = {}) {
|
|
|
101
101
|
severity: 'warning',
|
|
102
102
|
message: 'README does not explicitly state that MCP is read-only.',
|
|
103
103
|
file: 'README.md',
|
|
104
|
-
suggestion: 'Include the phrase "MCP is read-only" so
|
|
104
|
+
suggestion: 'Include the phrase "MCP is read-only" so adopters can scan-find it.',
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
// Validate internal links.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drift-baseline.d.ts","sourceRoot":"","sources":["../src/drift-baseline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,eAAO,MAAM,qBAAqB,iCAAiC,CAAC;AAEpE,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,qBAAqB,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,yCAAyC,CAAC;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,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M,GAAG,cAAc,GAAG,IAAI,CAOrE;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,qBAAqB,EACjC,YAAY,EAAE,MAAM,GACnB,wBAAwB,GAAG,IAAI,CAwBjC"}
|
package/dist/drift-baseline.js
CHANGED
|
@@ -35,10 +35,7 @@ export function createDriftBaseline(inspection, outFile) {
|
|
|
35
35
|
const baseline = {
|
|
36
36
|
schema: DRIFT_BASELINE_SCHEMA,
|
|
37
37
|
createdAt: nowIso(),
|
|
38
|
-
|
|
39
|
-
// committed to version control and absolute paths leak the author's
|
|
40
|
-
// filesystem layout into the public repo.
|
|
41
|
-
projectRoot: nodePath.basename(inspection.projectRoot),
|
|
38
|
+
projectRoot: inspection.projectRoot,
|
|
42
39
|
findings,
|
|
43
40
|
};
|
|
44
41
|
mkdirSync(nodePath.dirname(outFile), { recursive: true });
|
|
@@ -73,7 +70,7 @@ export function compareDriftBaseline(inspection, baselineFile) {
|
|
|
73
70
|
current: {
|
|
74
71
|
schema: DRIFT_BASELINE_SCHEMA,
|
|
75
72
|
createdAt: nowIso(),
|
|
76
|
-
projectRoot:
|
|
73
|
+
projectRoot: inspection.projectRoot,
|
|
77
74
|
findings: currentList,
|
|
78
75
|
},
|
|
79
76
|
existing,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback-ingestion.d.ts","sourceRoot":"","sources":["../src/feedback-ingestion.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,yBAAyB,qCAAqC,CAAC;AAE5E,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,SAAS,eAAe;IACxB,KAAK,UAAU;CAChB;AAED,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,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EnE;AA2MD,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,KAAK,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CAClC;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,sBAA2B,GACnC,eAAe,CAiDjB;AAED,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,sBAA2B,GACnC,eAAe,CAIjB;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,SAAS;YAAE,WAAW,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE;gBAAE,aAAa,CAAC,EAAE,OAAO,CAAA;aAAE,GAAG,IAAI,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC;CAC5G,GAAG,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAuBpC;AAYD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAmCrE"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
1
9
|
/**
|
|
2
10
|
* Feedback ingestion.
|
|
3
11
|
*
|
|
@@ -13,8 +21,8 @@
|
|
|
13
21
|
* Schema: sharkcraft.feedback-ingestion/v1
|
|
14
22
|
*/
|
|
15
23
|
import { existsSync, readFileSync } from 'node:fs';
|
|
24
|
+
import { pathToFileURL } from 'node:url';
|
|
16
25
|
import * as nodePath from 'node:path';
|
|
17
|
-
import { importModuleViaLoader } from '@shrkcrft/core';
|
|
18
26
|
export const FEEDBACK_INGESTION_SCHEMA = 'sharkcraft.feedback-ingestion/v1';
|
|
19
27
|
export var FeedbackBucket;
|
|
20
28
|
(function (FeedbackBucket) {
|
|
@@ -143,6 +151,12 @@ const KEYWORD_RULES = [
|
|
|
143
151
|
targetArea: 'mcp',
|
|
144
152
|
suggestedCommands: ['shrk commands list --filter mcp'],
|
|
145
153
|
},
|
|
154
|
+
{
|
|
155
|
+
pattern: /\b(plugin)\b/i,
|
|
156
|
+
tags: ['plugin'],
|
|
157
|
+
targetArea: 'plugin-lifecycle',
|
|
158
|
+
suggestedCommands: ['shrk plugin lifecycle list', 'shrk plugin rename <old> <new>'],
|
|
159
|
+
},
|
|
146
160
|
{
|
|
147
161
|
pattern: /\b(helper[s]?)\b/i,
|
|
148
162
|
tags: ['helpers'],
|
|
@@ -335,7 +349,7 @@ async function importDefaultArray(absPath) {
|
|
|
335
349
|
try {
|
|
336
350
|
if (!existsSync(absPath))
|
|
337
351
|
return [];
|
|
338
|
-
const mod = (await
|
|
352
|
+
const mod = (await import(__rewriteRelativeImportExtension(pathToFileURL(absPath).href)));
|
|
339
353
|
return Array.isArray(mod.default) ? mod.default : [];
|
|
340
354
|
}
|
|
341
355
|
catch {
|
package/dist/git-helpers.d.ts
CHANGED
|
@@ -20,6 +20,18 @@ export interface IGitStatusSummary {
|
|
|
20
20
|
export declare function isGitRepo(cwd: string): boolean;
|
|
21
21
|
export declare function getGitRoot(cwd: string): string | null;
|
|
22
22
|
export declare function getGitBranch(cwd: string): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Verify that `ref` resolves to a commit. Returns `{ valid: true }` on
|
|
25
|
+
* success, otherwise `{ valid: false, suggestions }` listing nearby
|
|
26
|
+
* branch / tag names so the caller can offer a did-you-mean.
|
|
27
|
+
*
|
|
28
|
+
* Cheap (`git rev-parse --verify` + `git for-each-ref`) — only run when
|
|
29
|
+
* the user passes an explicit ref.
|
|
30
|
+
*/
|
|
31
|
+
export declare function verifyGitRef(cwd: string, ref: string): {
|
|
32
|
+
valid: boolean;
|
|
33
|
+
suggestions?: string[];
|
|
34
|
+
};
|
|
23
35
|
export declare function getChangedFiles(cwd: string, opts?: IGitChangedOptions): string[];
|
|
24
36
|
export declare function getStatusSummary(cwd: string): IGitStatusSummary;
|
|
25
37
|
export declare function parseLines(text: string): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-helpers.d.ts","sourceRoot":"","sources":["../src/git-helpers.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gEAAgE;IAChE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAWD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAI9C;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKrD;AAED,wBAAgB,YAAY,CAAC,GAA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AM,EAAE,CAAA;CAAE,CAQ5C;AA2CD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,GAAG,MAAM,EAAE,CAkBpF;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAyC/D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKjD"}
|
package/dist/git-helpers.js
CHANGED
|
@@ -29,6 +29,69 @@ export function getGitBranch(cwd) {
|
|
|
29
29
|
const out = r.stdout.trim();
|
|
30
30
|
return out.length > 0 ? out : null;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Verify that `ref` resolves to a commit. Returns `{ valid: true }` on
|
|
34
|
+
* success, otherwise `{ valid: false, suggestions }` listing nearby
|
|
35
|
+
* branch / tag names so the caller can offer a did-you-mean.
|
|
36
|
+
*
|
|
37
|
+
* Cheap (`git rev-parse --verify` + `git for-each-ref`) — only run when
|
|
38
|
+
* the user passes an explicit ref.
|
|
39
|
+
*/
|
|
40
|
+
export function verifyGitRef(cwd, ref) {
|
|
41
|
+
if (!isGitRepo(cwd))
|
|
42
|
+
return { valid: false, suggestions: [] };
|
|
43
|
+
const r = runGit(cwd, ['rev-parse', '--verify', '--quiet', `${ref}^{commit}`]);
|
|
44
|
+
if (r.ok)
|
|
45
|
+
return { valid: true };
|
|
46
|
+
// Collect candidate names from local + remote refs, then rank by Levenshtein.
|
|
47
|
+
const candidates = listRefNames(cwd);
|
|
48
|
+
const suggestions = nearestRefs(ref, candidates, 3);
|
|
49
|
+
return { valid: false, suggestions };
|
|
50
|
+
}
|
|
51
|
+
function listRefNames(cwd) {
|
|
52
|
+
const out = new Set();
|
|
53
|
+
const local = runGit(cwd, ['for-each-ref', '--format=%(refname:short)', 'refs/heads']);
|
|
54
|
+
if (local.ok)
|
|
55
|
+
for (const line of parseLines(local.stdout))
|
|
56
|
+
out.add(line);
|
|
57
|
+
const remote = runGit(cwd, ['for-each-ref', '--format=%(refname:short)', 'refs/remotes']);
|
|
58
|
+
if (remote.ok)
|
|
59
|
+
for (const line of parseLines(remote.stdout))
|
|
60
|
+
out.add(line);
|
|
61
|
+
const tags = runGit(cwd, ['for-each-ref', '--format=%(refname:short)', 'refs/tags']);
|
|
62
|
+
if (tags.ok)
|
|
63
|
+
for (const line of parseLines(tags.stdout))
|
|
64
|
+
out.add(line);
|
|
65
|
+
return [...out];
|
|
66
|
+
}
|
|
67
|
+
function nearestRefs(query, refs, k) {
|
|
68
|
+
const scored = refs.map((r) => ({ r, d: levenshtein(query, r) }));
|
|
69
|
+
scored.sort((a, b) => a.d - b.d);
|
|
70
|
+
return scored.slice(0, k).map((s) => s.r);
|
|
71
|
+
}
|
|
72
|
+
function levenshtein(a, b) {
|
|
73
|
+
if (a === b)
|
|
74
|
+
return 0;
|
|
75
|
+
const al = a.length;
|
|
76
|
+
const bl = b.length;
|
|
77
|
+
if (al === 0)
|
|
78
|
+
return bl;
|
|
79
|
+
if (bl === 0)
|
|
80
|
+
return al;
|
|
81
|
+
let prev = new Array(bl + 1);
|
|
82
|
+
let curr = new Array(bl + 1);
|
|
83
|
+
for (let j = 0; j <= bl; j += 1)
|
|
84
|
+
prev[j] = j;
|
|
85
|
+
for (let i = 1; i <= al; i += 1) {
|
|
86
|
+
curr[0] = i;
|
|
87
|
+
for (let j = 1; j <= bl; j += 1) {
|
|
88
|
+
const cost = a.charCodeAt(i - 1) === b.charCodeAt(j - 1) ? 0 : 1;
|
|
89
|
+
curr[j] = Math.min((prev[j] ?? 0) + 1, (curr[j - 1] ?? 0) + 1, (prev[j - 1] ?? 0) + cost);
|
|
90
|
+
}
|
|
91
|
+
[prev, curr] = [curr, prev];
|
|
92
|
+
}
|
|
93
|
+
return prev[bl] ?? Math.max(al, bl);
|
|
94
|
+
}
|
|
32
95
|
export function getChangedFiles(cwd, opts = {}) {
|
|
33
96
|
if (!isGitRepo(cwd))
|
|
34
97
|
return [];
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Helper plan generators.
|
|
2
|
+
* Helper plan generators (profile-driven for project-specific paths).
|
|
3
3
|
*
|
|
4
4
|
* Helpers are one-shot plan-v2 producers for small, well-bounded edits.
|
|
5
|
-
*
|
|
5
|
+
* They are dry-run by default and idempotent where the plan engine supports it.
|
|
6
6
|
*
|
|
7
|
-
* No helper writes source directly. The output is a structured
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* No helper writes source directly. The output is a structured `IHelperPlan`
|
|
8
|
+
* containing planned ops (using the existing plan-v2 operation set) and a
|
|
9
|
+
* list of advisory conflicts when an expected anchor cannot be resolved.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Helpers must accept an IPluginLifecycleProfile instead of hardcoded paths,
|
|
12
|
+
* so the engine knows where the key-table / plugin roots live.
|
|
13
|
+
* Project-specific helpers contributed by packs travel in pack-contributed
|
|
14
|
+
* playbooks/scaffolds; the engine just provides the generic shapes.
|
|
13
15
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
import { type IPluginLifecycleProfile } from '@shrkcrft/plugin-api';
|
|
17
|
+
export declare enum HelperId {
|
|
18
|
+
AddPluginKey = "core.add-plugin-key",
|
|
19
|
+
RemovePluginKey = "core.remove-plugin-key",
|
|
20
|
+
RenamePluginKey = "core.rename-plugin-key",
|
|
21
|
+
AddBarrelExport = "core.add-barrel-export",
|
|
22
|
+
RemoveBarrelExport = "core.remove-barrel-export",
|
|
23
|
+
AddEventEntry = "core.add-event-entry",
|
|
24
|
+
RemoveEventEntry = "core.remove-event-entry",
|
|
25
|
+
AddDefaultRegistration = "core.add-default-registration",
|
|
26
|
+
RemoveDefaultRegistration = "core.remove-default-registration",
|
|
27
|
+
AddComposerEntry = "core.add-composer-entry",
|
|
28
|
+
RemoveComposerEntry = "core.remove-composer-entry",
|
|
29
|
+
RenamePluginFolder = "core.rename-plugin-folder",
|
|
30
|
+
RemoveUserPluginEntry = "core.remove-user-plugin-entry"
|
|
31
|
+
}
|
|
19
32
|
export interface IHelperDefinition {
|
|
20
33
|
id: HelperId;
|
|
21
34
|
description: string;
|
|
@@ -30,34 +43,48 @@ export interface IHelperDefinition {
|
|
|
30
43
|
}
|
|
31
44
|
export declare const HELPERS: ReadonlyArray<IHelperDefinition>;
|
|
32
45
|
export interface IHelperPlanOp {
|
|
33
|
-
kind: 'append' | 'insert-after' | 'insert-before' | 'create' | 'replace';
|
|
34
46
|
targetPath: string;
|
|
35
|
-
|
|
36
|
-
anchor?: string;
|
|
37
|
-
fromPattern?: string;
|
|
47
|
+
operation: Record<string, unknown>;
|
|
38
48
|
}
|
|
39
49
|
export interface IHelperPlan {
|
|
40
50
|
schema: 'sharkcraft.helper-plan/v1';
|
|
41
51
|
helperId: HelperId;
|
|
42
|
-
|
|
43
|
-
ops:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
kind: string;
|
|
47
|
-
description: string;
|
|
48
|
-
}>;
|
|
52
|
+
variables: Record<string, string>;
|
|
53
|
+
ops: ReadonlyArray<IHelperPlanOp>;
|
|
54
|
+
manualSteps: ReadonlyArray<string>;
|
|
55
|
+
conflicts: ReadonlyArray<string>;
|
|
49
56
|
destructive: boolean;
|
|
50
|
-
|
|
57
|
+
humanReviewRequired: boolean;
|
|
51
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Convert a helper plan into a saved plan (synthetic templateId) so
|
|
61
|
+
* it flows through `shrk apply`. Helper ops are persisted as v2 operation
|
|
62
|
+
* intents; the apply path evaluates them against the live file system.
|
|
63
|
+
* Unsigned by default; call `signPlan` separately when desired.
|
|
64
|
+
*/
|
|
52
65
|
export declare const HELPER_SYNTHETIC_TEMPLATE = "__helper__";
|
|
66
|
+
export declare function helperPlanToSavedPlan(plan: IHelperPlan, projectRoot: string): {
|
|
67
|
+
schema: 'sharkcraft.plan/v2';
|
|
68
|
+
templateId: string;
|
|
69
|
+
variables: Record<string, string>;
|
|
70
|
+
projectRoot: string;
|
|
71
|
+
createdAt: string;
|
|
72
|
+
expectedChanges: {
|
|
73
|
+
type: string;
|
|
74
|
+
relativePath: string;
|
|
75
|
+
sizeBytes: number;
|
|
76
|
+
operation: Record<string, unknown>;
|
|
77
|
+
}[];
|
|
78
|
+
note?: string;
|
|
79
|
+
};
|
|
53
80
|
interface IHelperBuildInput {
|
|
54
81
|
helperId: HelperId;
|
|
55
82
|
projectRoot: string;
|
|
56
83
|
vars: Record<string, string>;
|
|
57
|
-
|
|
84
|
+
/** Required for helpers marked requiresProfile in HELPERS. */
|
|
85
|
+
profile?: IPluginLifecycleProfile;
|
|
58
86
|
}
|
|
59
|
-
export declare function buildHelperPlan(
|
|
60
|
-
export declare function helperPlanToSavedPlan(plan: IHelperPlan, _projectRoot: string): unknown;
|
|
87
|
+
export declare function buildHelperPlan(input: IHelperBuildInput): IHelperPlan;
|
|
61
88
|
export declare function renderHelperPlanText(plan: IHelperPlan): string;
|
|
62
89
|
export {};
|
|
63
90
|
//# sourceMappingURL=helper-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper-registry.d.ts","sourceRoot":"","sources":["../src/helper-registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"helper-registry.d.ts","sourceRoot":"","sources":["../src/helper-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,oBAAY,QAAQ;IAClB,YAAY,wBAAwB;IACpC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;IAC1C,kBAAkB,8BAA8B;IAChD,aAAa,yBAAyB;IACtC,gBAAgB,4BAA4B;IAC5C,sBAAsB,kCAAkC;IACxD,yBAAyB,qCAAqC;IAC9D,gBAAgB,4BAA4B;IAC5C,mBA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