@shrkcrft/inspector 0.1.0-alpha.2 → 0.1.0-alpha.20
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/agent-brief.d.ts.map +1 -1
- package/dist/agent-brief.js +59 -10
- package/dist/agent-contract-gate.d.ts.map +1 -1
- package/dist/agent-contract-gate.js +25 -2
- package/dist/agent-instructions.d.ts.map +1 -1
- package/dist/agent-instructions.js +11 -0
- package/dist/agent-task-prep.d.ts.map +1 -1
- package/dist/agent-task-prep.js +1 -3
- package/dist/ai-readiness.d.ts +84 -9
- package/dist/ai-readiness.d.ts.map +1 -1
- package/dist/ai-readiness.js +181 -35
- package/dist/apply-dispatch-trace.d.ts +1 -2
- package/dist/apply-dispatch-trace.d.ts.map +1 -1
- package/dist/apply-dispatch-trace.js +0 -9
- package/dist/area-explore.d.ts.map +1 -1
- package/dist/area-explore.js +4 -6
- package/dist/area-map.d.ts +0 -5
- package/dist/area-map.d.ts.map +1 -1
- package/dist/area-map.js +0 -10
- package/dist/changed-preflight.d.ts +7 -0
- package/dist/changed-preflight.d.ts.map +1 -1
- package/dist/changed-preflight.js +56 -9
- package/dist/changes-summary.d.ts.map +1 -1
- package/dist/changes-summary.js +10 -1
- package/dist/check-guardrail-globs.d.ts +16 -0
- package/dist/check-guardrail-globs.d.ts.map +1 -0
- package/dist/check-guardrail-globs.js +38 -0
- package/dist/code-intelligence-doctor.d.ts +21 -0
- package/dist/code-intelligence-doctor.d.ts.map +1 -0
- package/dist/code-intelligence-doctor.js +985 -0
- package/dist/command-recommender.d.ts.map +1 -1
- package/dist/command-recommender.js +23 -0
- package/dist/compliance-profiles.js +1 -1
- package/dist/construct-adoption-diff.d.ts.map +1 -1
- package/dist/construct-adoption-diff.js +2 -1
- package/dist/construct-adoption.d.ts.map +1 -1
- package/dist/construct-adoption.js +10 -11
- package/dist/construct-inference.d.ts.map +1 -1
- package/dist/construct-inference.js +5 -2
- package/dist/construct-registry.d.ts.map +1 -1
- package/dist/construct-registry.js +2 -10
- package/dist/contract-file-rule.d.ts +8 -0
- package/dist/contract-file-rule.d.ts.map +1 -1
- package/dist/contract-file-rule.js +8 -3
- package/dist/contract-template-registry.d.ts.map +1 -1
- package/dist/contract-template-registry.js +2 -10
- package/dist/contradictions.d.ts +8 -1
- package/dist/contradictions.d.ts.map +1 -1
- package/dist/contradictions.js +37 -35
- package/dist/convention-registry.d.ts.map +1 -1
- package/dist/convention-registry.js +2 -10
- package/dist/coverage-report.d.ts.map +1 -1
- package/dist/coverage-report.js +14 -1
- package/dist/dashboard/dashboard-knowledge.d.ts +8 -0
- package/dist/dashboard/dashboard-knowledge.d.ts.map +1 -0
- package/dist/dashboard/dashboard-knowledge.js +259 -0
- package/dist/decision-records.d.ts.map +1 -1
- package/dist/decision-records.js +5 -10
- package/dist/delegate-catalog.d.ts +45 -0
- package/dist/delegate-catalog.d.ts.map +1 -0
- package/dist/delegate-catalog.js +50 -0
- package/dist/delegate-doctor.d.ts +15 -0
- package/dist/delegate-doctor.d.ts.map +1 -0
- package/dist/delegate-doctor.js +36 -0
- package/dist/delegate-pack-recipes.d.ts +29 -0
- package/dist/delegate-pack-recipes.d.ts.map +1 -0
- package/dist/delegate-pack-recipes.js +77 -0
- package/dist/demo-script.d.ts +0 -1
- package/dist/demo-script.d.ts.map +1 -1
- package/dist/demo-script.js +0 -43
- package/dist/docs-check.js +1 -1
- package/dist/drift-baseline.d.ts.map +1 -1
- package/dist/drift-baseline.js +5 -2
- package/dist/feedback-ingestion.d.ts.map +1 -1
- package/dist/feedback-ingestion.js +2 -16
- package/dist/git-helpers.d.ts +15 -0
- package/dist/git-helpers.d.ts.map +1 -1
- package/dist/git-helpers.js +51 -4
- package/dist/helper-registry.d.ts +27 -54
- package/dist/helper-registry.d.ts.map +1 -1
- package/dist/helper-registry.js +16 -517
- package/dist/impact-analysis.d.ts.map +1 -1
- package/dist/impact-analysis.js +14 -7
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/ingest-drafts.js +8 -4
- package/dist/migration-profile-registry.d.ts.map +1 -1
- package/dist/migration-profile-registry.js +2 -10
- package/dist/monorepo-onboarding.js +2 -2
- package/dist/onboarding-report.d.ts.map +1 -1
- package/dist/onboarding-report.js +5 -1
- package/dist/onboarding.d.ts +1 -1
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +9 -66
- package/dist/ownership.js +2 -10
- package/dist/pack-contributions-inventory.d.ts +0 -1
- package/dist/pack-contributions-inventory.d.ts.map +1 -1
- package/dist/pack-contributions-inventory.js +17 -29
- package/dist/pack-helper-registry.d.ts.map +1 -1
- package/dist/pack-helper-registry.js +2 -10
- package/dist/pack-release-check.d.ts.map +1 -1
- package/dist/pack-release-check.js +4 -11
- package/dist/pack-signature-status.d.ts.map +1 -1
- package/dist/pack-signature-status.js +18 -2
- package/dist/pack-test-runner.js +2 -10
- package/dist/plan-review.d.ts.map +1 -1
- package/dist/plan-review.js +5 -10
- package/dist/plan-simulation.d.ts +13 -0
- package/dist/plan-simulation.d.ts.map +1 -1
- package/dist/plan-simulation.js +4 -21
- package/dist/playbook-registry.d.ts.map +1 -1
- package/dist/playbook-registry.js +2 -10
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +3 -11
- package/dist/policy-test.js +3 -11
- package/dist/profile-registry.d.ts +0 -1
- package/dist/profile-registry.d.ts.map +1 -1
- package/dist/profile-registry.js +4 -32
- package/dist/propose-knowledge.d.ts +15 -0
- package/dist/propose-knowledge.d.ts.map +1 -1
- package/dist/propose-knowledge.js +37 -4
- package/dist/quality-baseline.d.ts.map +1 -1
- package/dist/quality-baseline.js +3 -1
- package/dist/ranker-explainability.d.ts.map +1 -1
- package/dist/ranker-explainability.js +3 -9
- package/dist/registration-hint-registry.d.ts.map +1 -1
- package/dist/registration-hint-registry.js +2 -10
- package/dist/registry-lifecycle.d.ts +6 -0
- package/dist/registry-lifecycle.d.ts.map +1 -1
- package/dist/registry-lifecycle.js +137 -10
- package/dist/release-readiness.js +3 -3
- package/dist/repo-memory.d.ts.map +1 -1
- package/dist/repo-memory.js +3 -1
- package/dist/reposet.js +1 -1
- package/dist/repository-intelligence.d.ts.map +1 -1
- package/dist/repository-intelligence.js +7 -2
- package/dist/repository-knowledge-model.d.ts +1 -1
- package/dist/repository-knowledge-model.d.ts.map +1 -1
- package/dist/repository-stats.d.ts.map +1 -1
- package/dist/repository-stats.js +3 -1
- package/dist/resolve-verification-commands.d.ts +26 -0
- package/dist/resolve-verification-commands.d.ts.map +1 -0
- package/dist/resolve-verification-commands.js +55 -0
- package/dist/review-packet.d.ts.map +1 -1
- package/dist/review-packet.js +14 -17
- package/dist/rule-drift.d.ts.map +1 -1
- package/dist/rule-drift.js +24 -9
- package/dist/rule-scaffold.d.ts.map +1 -1
- package/dist/rule-scaffold.js +12 -4
- package/dist/scaffold-patterns.js +2 -10
- package/dist/search-tuning-registry.d.ts.map +1 -1
- package/dist/search-tuning-registry.js +2 -10
- 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 +6 -10
- package/dist/self-config-doctor.d.ts.map +1 -1
- package/dist/self-config-doctor.js +7 -13
- package/dist/sharkcraft-inspector.d.ts +14 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -1
- package/dist/sharkcraft-inspector.js +103 -1
- package/dist/start-here.d.ts +2 -2
- package/dist/start-here.d.ts.map +1 -1
- package/dist/start-here.js +16 -1
- package/dist/synthesize-from-onboarding.d.ts +68 -0
- package/dist/synthesize-from-onboarding.d.ts.map +1 -0
- package/dist/synthesize-from-onboarding.js +508 -0
- package/dist/task-packet.d.ts +13 -0
- package/dist/task-packet.d.ts.map +1 -1
- package/dist/task-packet.js +59 -6
- package/dist/task-ranker.d.ts.map +1 -1
- package/dist/task-ranker.js +1 -31
- package/dist/task-routing-hint-registry.d.ts.map +1 -1
- package/dist/task-routing-hint-registry.js +2 -10
- package/dist/template-drift.d.ts +7 -0
- package/dist/template-drift.d.ts.map +1 -1
- package/dist/template-drift.js +14 -6
- package/dist/test-impact.d.ts.map +1 -1
- package/dist/test-impact.js +5 -2
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +12 -17
- package/dist/universal-search.d.ts +0 -1
- package/dist/universal-search.d.ts.map +1 -1
- package/dist/universal-search.js +0 -12
- package/dist/why-file.js +66 -22
- package/package.json +18 -18
- package/dist/plugin-lifecycle-profile-registry.d.ts +0 -52
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +0 -1
- package/dist/plugin-lifecycle-profile-registry.js +0 -202
- package/dist/plugin-lifecycle.d.ts +0 -132
- package/dist/plugin-lifecycle.d.ts.map +0 -1
- package/dist/plugin-lifecycle.js +0 -477
|
@@ -1,202 +0,0 @@
|
|
|
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
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Plugin lifecycle profile registry.
|
|
11
|
-
*
|
|
12
|
-
* Loads pack-contributed and locally configured `IPluginLifecycleProfile`
|
|
13
|
-
* entries. Duplicate ids and invalid profiles surface as doctor issues.
|
|
14
|
-
* Source attribution lets the CLI tell the user where a profile came from.
|
|
15
|
-
*/
|
|
16
|
-
import { existsSync } from 'node:fs';
|
|
17
|
-
import * as nodePath from 'node:path';
|
|
18
|
-
import { pathToFileURL } from 'node:url';
|
|
19
|
-
import { validatePluginLifecycleProfile, } from '@shrkcrft/plugin-api';
|
|
20
|
-
export const PLUGIN_LIFECYCLE_PROFILE_REGISTRY_SCHEMA = 'sharkcraft.plugin-lifecycle-profile-registry/v1';
|
|
21
|
-
export var PluginLifecycleProfileSource;
|
|
22
|
-
(function (PluginLifecycleProfileSource) {
|
|
23
|
-
PluginLifecycleProfileSource["Local"] = "local";
|
|
24
|
-
PluginLifecycleProfileSource["Pack"] = "pack";
|
|
25
|
-
PluginLifecycleProfileSource["Fixture"] = "fixture";
|
|
26
|
-
})(PluginLifecycleProfileSource || (PluginLifecycleProfileSource = {}));
|
|
27
|
-
export var ProfileDoctorSeverity;
|
|
28
|
-
(function (ProfileDoctorSeverity) {
|
|
29
|
-
ProfileDoctorSeverity["Info"] = "info";
|
|
30
|
-
ProfileDoctorSeverity["Warning"] = "warning";
|
|
31
|
-
ProfileDoctorSeverity["Error"] = "error";
|
|
32
|
-
})(ProfileDoctorSeverity || (ProfileDoctorSeverity = {}));
|
|
33
|
-
const CACHE = new Map();
|
|
34
|
-
async function importDefaultProfiles(file) {
|
|
35
|
-
const mod = (await import(__rewriteRelativeImportExtension(pathToFileURL(file).href)));
|
|
36
|
-
if (Array.isArray(mod.default))
|
|
37
|
-
return mod.default;
|
|
38
|
-
if (mod.default && typeof mod.default === 'object')
|
|
39
|
-
return [mod.default];
|
|
40
|
-
if (Array.isArray(mod.pluginLifecycleProfiles))
|
|
41
|
-
return mod.pluginLifecycleProfiles;
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
function localProfileFiles(inspection) {
|
|
45
|
-
const out = [];
|
|
46
|
-
const dir = inspection.sharkcraftDir;
|
|
47
|
-
if (!dir)
|
|
48
|
-
return [];
|
|
49
|
-
for (const name of ['plugin-lifecycle-profiles.ts', 'plugin-lifecycle-profiles/index.ts']) {
|
|
50
|
-
const full = nodePath.join(dir, name);
|
|
51
|
-
if (existsSync(full))
|
|
52
|
-
out.push(full);
|
|
53
|
-
}
|
|
54
|
-
const cfg = inspection.config;
|
|
55
|
-
for (const rel of cfg?.pluginLifecycleProfileFiles ?? []) {
|
|
56
|
-
out.push(nodePath.isAbsolute(rel) ? rel : nodePath.join(dir, rel));
|
|
57
|
-
}
|
|
58
|
-
return out;
|
|
59
|
-
}
|
|
60
|
-
export async function loadPluginLifecycleProfiles(inspection) {
|
|
61
|
-
const cacheKey = `${inspection.projectRoot}:${(inspection.packs.validPacks ?? [])
|
|
62
|
-
.map((p) => p.packageName + '@' + p.packageVersion)
|
|
63
|
-
.join(',')}`;
|
|
64
|
-
const cached = CACHE.get(inspection.projectRoot);
|
|
65
|
-
if (cached && cached.cacheKey === cacheKey) {
|
|
66
|
-
return { entries: cached.entries, issues: cached.issues };
|
|
67
|
-
}
|
|
68
|
-
const seen = new Map();
|
|
69
|
-
const entries = [];
|
|
70
|
-
const issues = [];
|
|
71
|
-
const ingest = (profile, source, packageName, sourceFile) => {
|
|
72
|
-
const validation = validatePluginLifecycleProfile(profile);
|
|
73
|
-
if (!validation.valid) {
|
|
74
|
-
for (const issue of validation.issues) {
|
|
75
|
-
issues.push({
|
|
76
|
-
severity: ProfileDoctorSeverity.Error,
|
|
77
|
-
code: 'invalid-profile',
|
|
78
|
-
message: `${issue.field}: ${issue.message}`,
|
|
79
|
-
profileId: typeof profile.id === 'string' ? profile.id : undefined,
|
|
80
|
-
source: sourceFile,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const existing = seen.get(profile.id);
|
|
86
|
-
if (existing) {
|
|
87
|
-
issues.push({
|
|
88
|
-
severity: ProfileDoctorSeverity.Error,
|
|
89
|
-
code: 'duplicate-id',
|
|
90
|
-
message: `Profile id "${profile.id}" already loaded from ${existing.sourceFile} (source=${existing.source}); skipping duplicate from ${sourceFile} (source=${source}).`,
|
|
91
|
-
profileId: profile.id,
|
|
92
|
-
source: sourceFile,
|
|
93
|
-
});
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const entry = {
|
|
97
|
-
profile,
|
|
98
|
-
source,
|
|
99
|
-
...(packageName ? { packageName } : {}),
|
|
100
|
-
sourceFile,
|
|
101
|
-
};
|
|
102
|
-
seen.set(profile.id, entry);
|
|
103
|
-
entries.push(entry);
|
|
104
|
-
};
|
|
105
|
-
for (const file of localProfileFiles(inspection)) {
|
|
106
|
-
try {
|
|
107
|
-
const list = await importDefaultProfiles(file);
|
|
108
|
-
const rel = nodePath.relative(inspection.projectRoot, file) || file;
|
|
109
|
-
for (const raw of list) {
|
|
110
|
-
ingest(raw, PluginLifecycleProfileSource.Local, undefined, rel);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
catch (e) {
|
|
114
|
-
issues.push({
|
|
115
|
-
severity: ProfileDoctorSeverity.Warning,
|
|
116
|
-
code: 'load-failed',
|
|
117
|
-
message: `Failed to load ${file}: ${e.message}`,
|
|
118
|
-
source: file,
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
for (const pack of inspection.packs.validPacks ?? []) {
|
|
123
|
-
const contributions = (pack.manifest?.contributions ?? {});
|
|
124
|
-
for (const rel of contributions.pluginLifecycleProfileFiles ?? []) {
|
|
125
|
-
const file = nodePath.resolve(pack.packageRoot, rel);
|
|
126
|
-
if (!existsSync(file)) {
|
|
127
|
-
issues.push({
|
|
128
|
-
severity: ProfileDoctorSeverity.Warning,
|
|
129
|
-
code: 'missing-file',
|
|
130
|
-
message: `Pack ${pack.packageName} declares profile file ${rel} but it is missing.`,
|
|
131
|
-
source: file,
|
|
132
|
-
});
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
try {
|
|
136
|
-
const list = await importDefaultProfiles(file);
|
|
137
|
-
for (const raw of list) {
|
|
138
|
-
ingest(raw, PluginLifecycleProfileSource.Pack, pack.packageName, rel);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
catch (e) {
|
|
142
|
-
issues.push({
|
|
143
|
-
severity: ProfileDoctorSeverity.Warning,
|
|
144
|
-
code: 'load-failed',
|
|
145
|
-
message: `Pack ${pack.packageName} (${rel}): ${e.message}`,
|
|
146
|
-
source: file,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
CACHE.set(inspection.projectRoot, { cacheKey, entries, issues });
|
|
152
|
-
return { entries, issues };
|
|
153
|
-
}
|
|
154
|
-
export async function listPluginLifecycleProfiles(inspection) {
|
|
155
|
-
const { entries } = await loadPluginLifecycleProfiles(inspection);
|
|
156
|
-
return entries;
|
|
157
|
-
}
|
|
158
|
-
export async function findPluginLifecycleProfile(inspection, id) {
|
|
159
|
-
const entries = await listPluginLifecycleProfiles(inspection);
|
|
160
|
-
return entries.find((e) => e.profile.id === id) ?? null;
|
|
161
|
-
}
|
|
162
|
-
export async function listPluginLifecycleProfileIssues(inspection) {
|
|
163
|
-
const { issues } = await loadPluginLifecycleProfiles(inspection);
|
|
164
|
-
return issues;
|
|
165
|
-
}
|
|
166
|
-
export function clearPluginLifecycleProfileCache(projectRoot) {
|
|
167
|
-
if (projectRoot)
|
|
168
|
-
CACHE.delete(projectRoot);
|
|
169
|
-
else
|
|
170
|
-
CACHE.clear();
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Pick a profile from the registry. If `profileId` is supplied, look it up.
|
|
174
|
-
* If not and exactly one profile is registered and `allowSingleDefault` is
|
|
175
|
-
* true, return it. Otherwise emit an explanatory error string and list ids.
|
|
176
|
-
*/
|
|
177
|
-
export async function resolvePluginLifecycleProfile(inspection, options = {}) {
|
|
178
|
-
const entries = await listPluginLifecycleProfiles(inspection);
|
|
179
|
-
const availableIds = entries.map((e) => e.profile.id);
|
|
180
|
-
if (options.profileId) {
|
|
181
|
-
const found = entries.find((e) => e.profile.id === options.profileId);
|
|
182
|
-
if (found)
|
|
183
|
-
return { entry: found, availableIds };
|
|
184
|
-
return {
|
|
185
|
-
error: `Unknown plugin lifecycle profile "${options.profileId}". Available: ${availableIds.length === 0 ? '(none registered)' : availableIds.join(', ')}. Contribute one via a pack manifest "pluginLifecycleProfileFiles" entry or sharkcraft/plugin-lifecycle-profiles.ts.`,
|
|
186
|
-
availableIds,
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
if (entries.length === 0) {
|
|
190
|
-
return {
|
|
191
|
-
error: 'No plugin lifecycle profiles registered. Contribute one via a pack manifest "pluginLifecycleProfileFiles" entry or sharkcraft/plugin-lifecycle-profiles.ts.',
|
|
192
|
-
availableIds,
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
if (entries.length === 1 && options.allowSingleDefault) {
|
|
196
|
-
return { entry: entries[0], availableIds };
|
|
197
|
-
}
|
|
198
|
-
return {
|
|
199
|
-
error: `--profile required. Available: ${availableIds.join(', ')}.`,
|
|
200
|
-
availableIds,
|
|
201
|
-
};
|
|
202
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plan-only plugin lifecycle helpers driven by a resolved profile.
|
|
3
|
-
*
|
|
4
|
-
* Lifecycle helpers never write source directly. They emit a structured plan
|
|
5
|
-
* containing:
|
|
6
|
-
* - replaceOps: safe `replace` plan operations against the profile's
|
|
7
|
-
* key-table file, barrels, and other registry files.
|
|
8
|
-
* - manualSteps: things the planned-operation model cannot do today
|
|
9
|
-
* (rename a folder, delete a folder) when folder ops are
|
|
10
|
-
* not requested or not safe.
|
|
11
|
-
* - conflicts: anchors that could not be found — surfaced as advisory
|
|
12
|
-
* hints (no failure).
|
|
13
|
-
* - destructive: `true` for remove; `true` for rename when files need to
|
|
14
|
-
* be renamed on disk.
|
|
15
|
-
*
|
|
16
|
-
* The engine has no project-specific knowledge: every path / key style / barrel
|
|
17
|
-
* comes from the supplied `IPluginLifecycleProfile`. A pack contributes the
|
|
18
|
-
* profile via `pluginLifecycleProfileFiles` on the manifest.
|
|
19
|
-
*/
|
|
20
|
-
import { type IPluginLifecycleProfile } from '@shrkcrft/plugin-api';
|
|
21
|
-
export declare enum PluginLifecycleAction {
|
|
22
|
-
Rename = "rename",
|
|
23
|
-
Remove = "remove"
|
|
24
|
-
}
|
|
25
|
-
export interface IPluginLifecycleManualStep {
|
|
26
|
-
kind: 'delete-file' | 'delete-folder' | 'rename-file' | 'rename-folder';
|
|
27
|
-
targetPath: string;
|
|
28
|
-
newPath?: string;
|
|
29
|
-
reason: string;
|
|
30
|
-
}
|
|
31
|
-
export interface IPluginLifecycleReplaceOp {
|
|
32
|
-
targetPath: string;
|
|
33
|
-
operation: {
|
|
34
|
-
kind: 'replace';
|
|
35
|
-
find: string;
|
|
36
|
-
replaceWith: string;
|
|
37
|
-
description: string;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export interface IPluginLifecycleFolderOp {
|
|
41
|
-
kind: 'rename-folder' | 'delete-folder';
|
|
42
|
-
targetPath: string;
|
|
43
|
-
newPath?: string;
|
|
44
|
-
safety: 'safe' | 'unsafe';
|
|
45
|
-
safetyReason?: string;
|
|
46
|
-
reason: string;
|
|
47
|
-
}
|
|
48
|
-
export interface IPluginLifecyclePlan {
|
|
49
|
-
schema: 'sharkcraft.plugin-lifecycle/v1';
|
|
50
|
-
action: PluginLifecycleAction;
|
|
51
|
-
/** Profile id (e.g. "my-monorepo"). Engine does not constrain this to a literal. */
|
|
52
|
-
profile: string;
|
|
53
|
-
oldName: string;
|
|
54
|
-
newName?: string;
|
|
55
|
-
destructive: boolean;
|
|
56
|
-
humanApprovalRequired: boolean;
|
|
57
|
-
replaceOps: ReadonlyArray<IPluginLifecycleReplaceOp>;
|
|
58
|
-
manualSteps: ReadonlyArray<IPluginLifecycleManualStep>;
|
|
59
|
-
/** Structured folder operations when --emit-folder-ops is requested. */
|
|
60
|
-
folderOps?: ReadonlyArray<IPluginLifecycleFolderOp>;
|
|
61
|
-
conflicts: ReadonlyArray<string>;
|
|
62
|
-
validationCommands: ReadonlyArray<string>;
|
|
63
|
-
}
|
|
64
|
-
export interface IBuildPluginRenameInput {
|
|
65
|
-
projectRoot: string;
|
|
66
|
-
profile: IPluginLifecycleProfile;
|
|
67
|
-
oldName: string;
|
|
68
|
-
newName: string;
|
|
69
|
-
/** When true, also emit structured folder rename ops in `folderOps[]`. */
|
|
70
|
-
emitFolderOps?: boolean;
|
|
71
|
-
}
|
|
72
|
-
export declare function buildPluginRenamePlan(input: IBuildPluginRenameInput): IPluginLifecyclePlan;
|
|
73
|
-
export interface IBuildPluginRemoveInput {
|
|
74
|
-
projectRoot: string;
|
|
75
|
-
profile: IPluginLifecycleProfile;
|
|
76
|
-
oldName: string;
|
|
77
|
-
/** When true, also emit structured folder delete ops in `folderOps[]`. */
|
|
78
|
-
emitFolderOps?: boolean;
|
|
79
|
-
}
|
|
80
|
-
export declare function buildPluginRemovePlan(input: IBuildPluginRemoveInput): IPluginLifecyclePlan;
|
|
81
|
-
/**
|
|
82
|
-
* Convert a plugin-lifecycle plan into a saved plan (synthetic
|
|
83
|
-
* templateId) so it can flow through `shrk apply`. ReplaceOps become
|
|
84
|
-
* `expectedChanges` carrying their operation intent; folderOps[] is copied
|
|
85
|
-
* through. The plan is unsigned by this helper; call `signPlan` separately.
|
|
86
|
-
*/
|
|
87
|
-
export declare const PLUGIN_LIFECYCLE_SYNTHETIC_TEMPLATE = "__plugin-lifecycle__";
|
|
88
|
-
export declare function pluginLifecyclePlanToSavedPlan(plan: IPluginLifecyclePlan, projectRoot: string): {
|
|
89
|
-
schema: 'sharkcraft.plan/v2';
|
|
90
|
-
templateId: string;
|
|
91
|
-
name?: string;
|
|
92
|
-
variables: Record<string, string>;
|
|
93
|
-
projectRoot: string;
|
|
94
|
-
createdAt: string;
|
|
95
|
-
expectedChanges: {
|
|
96
|
-
type: string;
|
|
97
|
-
relativePath: string;
|
|
98
|
-
sizeBytes: number;
|
|
99
|
-
operation: IPluginLifecycleReplaceOp['operation'];
|
|
100
|
-
}[];
|
|
101
|
-
folderOps?: {
|
|
102
|
-
kind: 'rename-folder' | 'delete-folder';
|
|
103
|
-
targetPath: string;
|
|
104
|
-
newPath?: string;
|
|
105
|
-
reason?: string;
|
|
106
|
-
}[];
|
|
107
|
-
note?: string;
|
|
108
|
-
};
|
|
109
|
-
export declare function renderPluginLifecyclePlanText(plan: IPluginLifecyclePlan): string;
|
|
110
|
-
export interface IPluginLifecycleListingInput {
|
|
111
|
-
projectRoot: string;
|
|
112
|
-
profile: IPluginLifecycleProfile;
|
|
113
|
-
}
|
|
114
|
-
export declare function buildPluginLifecycleListing(input: IPluginLifecycleListingInput): {
|
|
115
|
-
pluginsByLayer: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
116
|
-
pluginKeys: ReadonlyArray<{
|
|
117
|
-
key: string;
|
|
118
|
-
value: string;
|
|
119
|
-
}>;
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Doctor check: a profile is valid if every declared file exists and the
|
|
123
|
-
* key-table file (if any) parses. This stays read-only; no fs mutations.
|
|
124
|
-
*/
|
|
125
|
-
export interface IPluginLifecycleProfileDoctorEntry {
|
|
126
|
-
readonly id: 'missing-key-table' | 'missing-barrel' | 'missing-plugin-root' | 'ok';
|
|
127
|
-
readonly severity: 'info' | 'warning' | 'error';
|
|
128
|
-
readonly path?: string;
|
|
129
|
-
readonly message: string;
|
|
130
|
-
}
|
|
131
|
-
export declare function checkPluginLifecycleProfileHealth(projectRoot: string, profile: IPluginLifecycleProfile): readonly IPluginLifecycleProfileDoctorEntry[];
|
|
132
|
-
//# sourceMappingURL=plugin-lifecycle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-lifecycle.d.ts","sourceRoot":"","sources":["../src/plugin-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,oBAAY,qBAAqB;IAC/B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI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