@promptscript/cli 1.18.0 → 1.18.1
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/index.js +468 -136
- package/package.json +3 -3
- package/src/cli.d.ts.map +1 -1
- package/src/commands/check.d.ts +1 -1
- package/src/commands/check.d.ts.map +1 -1
- package/src/commands/compile.d.ts.map +1 -1
- package/src/commands/diff.d.ts.map +1 -1
- package/src/commands/migrate.d.ts.map +1 -1
- package/src/types.d.ts +2 -0
- package/src/types.d.ts.map +1 -1
- package/src/utils/build-profile.d.ts +5 -0
- package/src/utils/build-profile.d.ts.map +1 -0
- package/src/utils/migration-prompt.d.ts +1 -1
- package/src/utils/migration-prompt.d.ts.map +1 -1
- package/src/utils/target-config.d.ts +8 -0
- package/src/utils/target-config.d.ts.map +1 -0
package/index.js
CHANGED
|
@@ -29055,8 +29055,10 @@ var init_backup = __esm({
|
|
|
29055
29055
|
function generateMigrationPrompt(candidates, options = {}) {
|
|
29056
29056
|
const fileList = candidates.map((c) => `- ${c.path} (${c.sizeHuman}, ${c.toolName})`).join("\n");
|
|
29057
29057
|
const outputDirectory = options.outputDirectory ?? ".promptscript";
|
|
29058
|
-
const
|
|
29059
|
-
|
|
29058
|
+
const existingEntries = options.existingEntries ?? [];
|
|
29059
|
+
const existingProjectInstructions = existingEntries.length > 0 ? `
|
|
29060
|
+
Do not modify promptscript.yaml or the original instruction files. Add one @use directive to each configured entry file that composes the migrated project:
|
|
29061
|
+
${existingEntries.map((entry) => `- ${entry}`).join("\n")}
|
|
29060
29062
|
` : "";
|
|
29061
29063
|
return `Migrate my existing AI instructions to PromptScript.
|
|
29062
29064
|
|
|
@@ -31964,6 +31966,100 @@ var init_init = __esm({
|
|
|
31964
31966
|
}
|
|
31965
31967
|
});
|
|
31966
31968
|
|
|
31969
|
+
// packages/cli/src/utils/build-profile.ts
|
|
31970
|
+
function isBuildProfile(value) {
|
|
31971
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
31972
|
+
}
|
|
31973
|
+
function getBuildProfiles(config) {
|
|
31974
|
+
const builds = config.builds;
|
|
31975
|
+
if (builds === void 0) {
|
|
31976
|
+
return {};
|
|
31977
|
+
}
|
|
31978
|
+
if (builds === null || typeof builds !== "object" || Array.isArray(builds)) {
|
|
31979
|
+
throw new Error("config.builds must be an object");
|
|
31980
|
+
}
|
|
31981
|
+
const profiles = /* @__PURE__ */ Object.create(null);
|
|
31982
|
+
for (const [name, profile] of Object.entries(builds)) {
|
|
31983
|
+
if (!isBuildProfile(profile)) {
|
|
31984
|
+
throw new Error(`Build profile "${name}" must be an object`);
|
|
31985
|
+
}
|
|
31986
|
+
profiles[name] = profile;
|
|
31987
|
+
}
|
|
31988
|
+
return profiles;
|
|
31989
|
+
}
|
|
31990
|
+
function getBuildProfile(config, buildName) {
|
|
31991
|
+
if (buildName === void 0) return void 0;
|
|
31992
|
+
const builds = getBuildProfiles(config);
|
|
31993
|
+
if (!Object.hasOwn(builds, buildName)) {
|
|
31994
|
+
const available2 = Object.keys(builds);
|
|
31995
|
+
const suffix = available2.length > 0 ? ` Available build profiles: ${available2.join(", ")}.` : "";
|
|
31996
|
+
throw new Error(`Unknown build profile: ${buildName}.${suffix}`);
|
|
31997
|
+
}
|
|
31998
|
+
return builds[buildName];
|
|
31999
|
+
}
|
|
32000
|
+
function getEffectiveEntryPaths(config) {
|
|
32001
|
+
const configuredDefaultEntry = config.input?.entry;
|
|
32002
|
+
const defaultEntry = typeof configuredDefaultEntry === "string" && configuredDefaultEntry.trim().length > 0 ? configuredDefaultEntry : ".promptscript/project.prs";
|
|
32003
|
+
const entries = /* @__PURE__ */ new Set();
|
|
32004
|
+
if ((config.targets?.length ?? 0) > 0) {
|
|
32005
|
+
entries.add(defaultEntry);
|
|
32006
|
+
}
|
|
32007
|
+
for (const profile of Object.values(config.builds ?? {})) {
|
|
32008
|
+
if (profile && typeof profile === "object" && !Array.isArray(profile)) {
|
|
32009
|
+
if (profile.entry === void 0) {
|
|
32010
|
+
entries.add(defaultEntry);
|
|
32011
|
+
} else if (typeof profile.entry === "string" && profile.entry.trim().length > 0) {
|
|
32012
|
+
entries.add(profile.entry);
|
|
32013
|
+
}
|
|
32014
|
+
}
|
|
32015
|
+
}
|
|
32016
|
+
if (entries.size === 0) {
|
|
32017
|
+
entries.add(defaultEntry);
|
|
32018
|
+
}
|
|
32019
|
+
return [...entries];
|
|
32020
|
+
}
|
|
32021
|
+
var init_build_profile = __esm({
|
|
32022
|
+
"packages/cli/src/utils/build-profile.ts"() {
|
|
32023
|
+
"use strict";
|
|
32024
|
+
}
|
|
32025
|
+
});
|
|
32026
|
+
|
|
32027
|
+
// packages/cli/src/utils/target-config.ts
|
|
32028
|
+
function isTargetConfig(value) {
|
|
32029
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
32030
|
+
}
|
|
32031
|
+
function parseTargetEntries(targets) {
|
|
32032
|
+
if (!Array.isArray(targets)) {
|
|
32033
|
+
if (targets === void 0) {
|
|
32034
|
+
return [];
|
|
32035
|
+
}
|
|
32036
|
+
throw new Error("Compilation targets must be an array");
|
|
32037
|
+
}
|
|
32038
|
+
return targets.flatMap((entry) => {
|
|
32039
|
+
if (typeof entry === "string" && entry.trim().length > 0) {
|
|
32040
|
+
return [{ name: entry }];
|
|
32041
|
+
}
|
|
32042
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
32043
|
+
throw new Error("Target entries must be non-empty names or configuration objects");
|
|
32044
|
+
}
|
|
32045
|
+
const entries = Object.entries(entry);
|
|
32046
|
+
if (entries.length === 0) {
|
|
32047
|
+
throw new Error("Empty target configuration");
|
|
32048
|
+
}
|
|
32049
|
+
return entries.map(([name, config]) => {
|
|
32050
|
+
if (!isTargetConfig(config)) {
|
|
32051
|
+
throw new Error(`Target "${name}" configuration must be an object`);
|
|
32052
|
+
}
|
|
32053
|
+
return { name, config };
|
|
32054
|
+
});
|
|
32055
|
+
}).filter((target) => target.config?.enabled !== false);
|
|
32056
|
+
}
|
|
32057
|
+
var init_target_config = __esm({
|
|
32058
|
+
"packages/cli/src/utils/target-config.ts"() {
|
|
32059
|
+
"use strict";
|
|
32060
|
+
}
|
|
32061
|
+
});
|
|
32062
|
+
|
|
31967
32063
|
// node_modules/.pnpm/ip-address@10.4.0/node_modules/ip-address/dist/address-error.js
|
|
31968
32064
|
var require_address_error = __commonJS({
|
|
31969
32065
|
"node_modules/.pnpm/ip-address@10.4.0/node_modules/ip-address/dist/address-error.js"(exports) {
|
|
@@ -35734,8 +35830,9 @@ async function runMigrateCommand(options, services) {
|
|
|
35734
35830
|
if (options.targets) {
|
|
35735
35831
|
throw new Error("--targets can only be used when migration initializes a project");
|
|
35736
35832
|
}
|
|
35737
|
-
const targets = extractTargetNames(config.targets);
|
|
35738
35833
|
const strategy = options.llm ? "llm" : options.static ? "static" : await selectMigrationStrategy(services);
|
|
35834
|
+
const entryPaths = getMigrationEntryPaths(config);
|
|
35835
|
+
const targets = strategy === "llm" ? extractTargetNames(getConfiguredTargetEntries(config)) : [];
|
|
35739
35836
|
let selectedCandidates = candidates;
|
|
35740
35837
|
if (strategy === "static" && !options.static && !options.files) {
|
|
35741
35838
|
const selectedPaths = await services.prompts.checkbox({
|
|
@@ -35752,11 +35849,7 @@ async function runMigrateCommand(options, services) {
|
|
|
35752
35849
|
}
|
|
35753
35850
|
selectedCandidates = candidates.filter((candidate) => selectedPaths.includes(candidate.path));
|
|
35754
35851
|
}
|
|
35755
|
-
const writes = strategy === "static" ? await createStaticMigrationWrites(selectedCandidates, config, services) : createLlmMigrationWrites(
|
|
35756
|
-
selectedCandidates,
|
|
35757
|
-
targets,
|
|
35758
|
-
validateProjectPath(config.input?.entry ?? ".promptscript/project.prs")
|
|
35759
|
-
);
|
|
35852
|
+
const writes = strategy === "static" ? await createStaticMigrationWrites(selectedCandidates, config, entryPaths, services) : createLlmMigrationWrites(selectedCandidates, targets, entryPaths);
|
|
35760
35853
|
if (!isGitRepo(services)) {
|
|
35761
35854
|
ConsoleOutput.warn("Not a git repository. Changes are not version-controlled.");
|
|
35762
35855
|
}
|
|
@@ -35778,11 +35871,11 @@ async function runMigrateCommand(options, services) {
|
|
|
35778
35871
|
const spinner = createSpinner(
|
|
35779
35872
|
options.dryRun ? "Planning migration..." : "Applying migration..."
|
|
35780
35873
|
).start();
|
|
35781
|
-
const
|
|
35874
|
+
const overwritableEntries = new Set(entryPaths);
|
|
35782
35875
|
const result = await executeWritePlan(writes, services, {
|
|
35783
35876
|
dryRun: options.dryRun,
|
|
35784
35877
|
force: options.force === true || shouldBackup,
|
|
35785
|
-
canOverwrite: (path2) => strategy === "static" && path2
|
|
35878
|
+
canOverwrite: (path2) => strategy === "static" && overwritableEntries.has(path2)
|
|
35786
35879
|
});
|
|
35787
35880
|
if (options.dryRun) {
|
|
35788
35881
|
spinner.succeed("Migration plan ready");
|
|
@@ -35851,13 +35944,90 @@ function selectRequestedCandidates(candidates, requestedFiles) {
|
|
|
35851
35944
|
async function readProjectConfig2(configPath, services) {
|
|
35852
35945
|
const content = interpolateEnvVars2(await services.fs.readFile(configPath, "utf-8"));
|
|
35853
35946
|
const config = parseYaml17(content);
|
|
35854
|
-
if (!config || typeof config !== "object" || typeof config.id !== "string" || config.id.trim().length === 0 || typeof config.syntax !== "string" || config.syntax.trim().length === 0 || !
|
|
35855
|
-
|
|
35856
|
-
|
|
35857
|
-
|
|
35947
|
+
if (!config || typeof config !== "object" || typeof config.id !== "string" || config.id.trim().length === 0 || typeof config.syntax !== "string" || config.syntax.trim().length === 0 || !hasValidTargetSource(config)) {
|
|
35948
|
+
throw new Error(
|
|
35949
|
+
`${configPath} must contain id, syntax, and either non-empty targets or build profiles with non-empty targets before migration`
|
|
35950
|
+
);
|
|
35858
35951
|
}
|
|
35859
35952
|
return config;
|
|
35860
35953
|
}
|
|
35954
|
+
function isValidTargetEntry(target) {
|
|
35955
|
+
if (typeof target === "string") {
|
|
35956
|
+
return target.trim().length > 0;
|
|
35957
|
+
}
|
|
35958
|
+
if (target === null || typeof target !== "object" || Array.isArray(target)) {
|
|
35959
|
+
return false;
|
|
35960
|
+
}
|
|
35961
|
+
const entries = Object.entries(target);
|
|
35962
|
+
if (entries.length === 0) {
|
|
35963
|
+
return false;
|
|
35964
|
+
}
|
|
35965
|
+
return entries.every(
|
|
35966
|
+
([name, targetConfig]) => name.trim().length > 0 && isTargetConfig(targetConfig)
|
|
35967
|
+
);
|
|
35968
|
+
}
|
|
35969
|
+
function isValidTargetList(targets) {
|
|
35970
|
+
return Array.isArray(targets) && targets.length > 0 && targets.every(isValidTargetEntry);
|
|
35971
|
+
}
|
|
35972
|
+
function hasValidTargetSource(config) {
|
|
35973
|
+
const rootTargets = config.targets;
|
|
35974
|
+
const hasRootTargets = isValidTargetList(rootTargets);
|
|
35975
|
+
if (rootTargets !== void 0 && (!Array.isArray(rootTargets) || rootTargets.length > 0 && !hasRootTargets)) {
|
|
35976
|
+
return false;
|
|
35977
|
+
}
|
|
35978
|
+
const builds = config.builds;
|
|
35979
|
+
if (builds === void 0) {
|
|
35980
|
+
return hasRootTargets;
|
|
35981
|
+
}
|
|
35982
|
+
if (builds === null || typeof builds !== "object" || Array.isArray(builds)) {
|
|
35983
|
+
return false;
|
|
35984
|
+
}
|
|
35985
|
+
const profiles = Object.values(builds);
|
|
35986
|
+
let hasProfileTargets = false;
|
|
35987
|
+
for (const profile of profiles) {
|
|
35988
|
+
if (!profile || typeof profile !== "object" || Array.isArray(profile)) {
|
|
35989
|
+
return false;
|
|
35990
|
+
}
|
|
35991
|
+
const targets = profile.targets;
|
|
35992
|
+
if (targets === void 0) {
|
|
35993
|
+
if (!hasRootTargets) {
|
|
35994
|
+
return false;
|
|
35995
|
+
}
|
|
35996
|
+
continue;
|
|
35997
|
+
}
|
|
35998
|
+
if (!isValidTargetList(targets)) {
|
|
35999
|
+
return false;
|
|
36000
|
+
}
|
|
36001
|
+
hasProfileTargets = true;
|
|
36002
|
+
}
|
|
36003
|
+
return hasRootTargets || hasProfileTargets;
|
|
36004
|
+
}
|
|
36005
|
+
function getConfiguredTargetEntries(config) {
|
|
36006
|
+
const entries = Array.isArray(config.targets) ? [...config.targets] : [];
|
|
36007
|
+
for (const profile of Object.values(config.builds ?? {})) {
|
|
36008
|
+
if (profile && typeof profile === "object" && Array.isArray(profile.targets)) {
|
|
36009
|
+
entries.push(...profile.targets);
|
|
36010
|
+
}
|
|
36011
|
+
}
|
|
36012
|
+
return entries;
|
|
36013
|
+
}
|
|
36014
|
+
function getMigrationEntryPaths(config) {
|
|
36015
|
+
const input2 = config.input;
|
|
36016
|
+
if (input2 !== void 0 && (input2 === null || typeof input2 !== "object" || Array.isArray(input2))) {
|
|
36017
|
+
throw new Error("config.input must be an object");
|
|
36018
|
+
}
|
|
36019
|
+
const configuredEntry = input2 && typeof input2 === "object" ? input2.entry : void 0;
|
|
36020
|
+
if (configuredEntry !== void 0 && (typeof configuredEntry !== "string" || configuredEntry.trim().length === 0)) {
|
|
36021
|
+
throw new Error("config.input.entry must be a non-empty string");
|
|
36022
|
+
}
|
|
36023
|
+
for (const [buildName, profile] of Object.entries(config.builds ?? {})) {
|
|
36024
|
+
const profileEntry = profile.entry;
|
|
36025
|
+
if (profileEntry !== void 0 && (typeof profileEntry !== "string" || profileEntry.trim().length === 0)) {
|
|
36026
|
+
throw new Error(`config.builds.${buildName}.entry must be a non-empty string`);
|
|
36027
|
+
}
|
|
36028
|
+
}
|
|
36029
|
+
return getEffectiveEntryPaths(config).map(validateProjectPath);
|
|
36030
|
+
}
|
|
35861
36031
|
function extractTargetNames(targets) {
|
|
35862
36032
|
const names = [];
|
|
35863
36033
|
for (const target of targets) {
|
|
@@ -35873,7 +36043,7 @@ function extractTargetNames(targets) {
|
|
|
35873
36043
|
}
|
|
35874
36044
|
return Array.from(new Set(names));
|
|
35875
36045
|
}
|
|
35876
|
-
async function createStaticMigrationWrites(candidates, config, services) {
|
|
36046
|
+
async function createStaticMigrationWrites(candidates, config, entryPaths, services) {
|
|
35877
36047
|
const result = await importMultipleFiles(
|
|
35878
36048
|
candidates.map((candidate) => resolve41(services.cwd, candidate.path)),
|
|
35879
36049
|
{
|
|
@@ -35885,9 +36055,8 @@ async function createStaticMigrationWrites(candidates, config, services) {
|
|
|
35885
36055
|
const details = result.warnings.length > 0 ? ` ${result.warnings.join(" ")}` : "";
|
|
35886
36056
|
throw new Error(`Not all selected instruction files could be imported.${details}`);
|
|
35887
36057
|
}
|
|
35888
|
-
|
|
35889
|
-
|
|
35890
|
-
throw new Error("Project entry cannot be inside the reserved migration output directory");
|
|
36058
|
+
if (entryPaths.some((entryPath) => entryPath.startsWith(".promptscript/migrated/"))) {
|
|
36059
|
+
throw new Error("Project entries cannot be inside the reserved migration output directory");
|
|
35891
36060
|
}
|
|
35892
36061
|
const writes = [];
|
|
35893
36062
|
let importedProject;
|
|
@@ -35909,11 +36078,14 @@ async function createStaticMigrationWrites(candidates, config, services) {
|
|
|
35909
36078
|
}
|
|
35910
36079
|
const migratedProjectPath = ".promptscript/migrated/project.prs";
|
|
35911
36080
|
writes.push({ path: migratedProjectPath, content: markMigrationOutput(importedProject) });
|
|
35912
|
-
const
|
|
35913
|
-
|
|
35914
|
-
|
|
35915
|
-
|
|
35916
|
-
|
|
36081
|
+
for (const entryPath of entryPaths) {
|
|
36082
|
+
const useLine = `@use ${toUsePath(entryPath, migratedProjectPath)}`;
|
|
36083
|
+
if (services.fs.existsSync(entryPath)) {
|
|
36084
|
+
const existing = await services.fs.readFile(entryPath, "utf-8");
|
|
36085
|
+
const hasUseLine = existing.split(/\r?\n/).some((line) => line.trim() === useLine);
|
|
36086
|
+
if (hasUseLine) {
|
|
36087
|
+
continue;
|
|
36088
|
+
}
|
|
35917
36089
|
writes.push({
|
|
35918
36090
|
path: entryPath,
|
|
35919
36091
|
content: `${existing.trimEnd()}
|
|
@@ -35921,25 +36093,25 @@ async function createStaticMigrationWrites(candidates, config, services) {
|
|
|
35921
36093
|
${useLine}
|
|
35922
36094
|
`
|
|
35923
36095
|
});
|
|
36096
|
+
} else {
|
|
36097
|
+
writes.push({
|
|
36098
|
+
path: entryPath,
|
|
36099
|
+
content: [
|
|
36100
|
+
"# promptscript-generated: migration",
|
|
36101
|
+
"@meta {",
|
|
36102
|
+
` id: ${JSON.stringify(config.id)}`,
|
|
36103
|
+
` syntax: ${JSON.stringify(config.syntax)}`,
|
|
36104
|
+
"}",
|
|
36105
|
+
"",
|
|
36106
|
+
useLine,
|
|
36107
|
+
""
|
|
36108
|
+
].join("\n")
|
|
36109
|
+
});
|
|
35924
36110
|
}
|
|
35925
|
-
} else {
|
|
35926
|
-
writes.push({
|
|
35927
|
-
path: entryPath,
|
|
35928
|
-
content: [
|
|
35929
|
-
"# promptscript-generated: migration",
|
|
35930
|
-
"@meta {",
|
|
35931
|
-
` id: ${JSON.stringify(config.id)}`,
|
|
35932
|
-
` syntax: ${JSON.stringify(config.syntax)}`,
|
|
35933
|
-
"}",
|
|
35934
|
-
"",
|
|
35935
|
-
useLine,
|
|
35936
|
-
""
|
|
35937
|
-
].join("\n")
|
|
35938
|
-
});
|
|
35939
36111
|
}
|
|
35940
36112
|
return deduplicateWrites(writes);
|
|
35941
36113
|
}
|
|
35942
|
-
function createLlmMigrationWrites(candidates, targets,
|
|
36114
|
+
function createLlmMigrationWrites(candidates, targets, entryPaths) {
|
|
35943
36115
|
const prompt = generateMigrationPrompt(
|
|
35944
36116
|
candidates.map((candidate) => ({
|
|
35945
36117
|
path: candidate.path,
|
|
@@ -35948,7 +36120,7 @@ function createLlmMigrationWrites(candidates, targets, entryPath) {
|
|
|
35948
36120
|
})),
|
|
35949
36121
|
{
|
|
35950
36122
|
outputDirectory: ".promptscript/migrated",
|
|
35951
|
-
|
|
36123
|
+
existingEntries: entryPaths
|
|
35952
36124
|
}
|
|
35953
36125
|
);
|
|
35954
36126
|
return deduplicateWrites([
|
|
@@ -35968,7 +36140,7 @@ ${content}`;
|
|
|
35968
36140
|
function toUsePath(entryPath, targetPath) {
|
|
35969
36141
|
const withoutExtension = targetPath.replace(/\.prs$/, "");
|
|
35970
36142
|
const path2 = relative21(dirname27(entryPath), withoutExtension).replace(/\\/g, "/");
|
|
35971
|
-
return path2.startsWith(".") ? path2 : `./${path2}`;
|
|
36143
|
+
return path2.startsWith("./") || path2.startsWith("../") ? path2 : `./${path2}`;
|
|
35972
36144
|
}
|
|
35973
36145
|
function validateProjectPath(path2) {
|
|
35974
36146
|
const normalized = normalizeRequestedPath(path2);
|
|
@@ -36019,6 +36191,8 @@ var init_migrate = __esm({
|
|
|
36019
36191
|
init_write_plan();
|
|
36020
36192
|
init_init();
|
|
36021
36193
|
init_loader2();
|
|
36194
|
+
init_build_profile();
|
|
36195
|
+
init_target_config();
|
|
36022
36196
|
}
|
|
36023
36197
|
});
|
|
36024
36198
|
|
|
@@ -53073,6 +53247,8 @@ async function finalizeOutputPlan(result, options) {
|
|
|
53073
53247
|
}
|
|
53074
53248
|
|
|
53075
53249
|
// packages/cli/src/commands/compile.ts
|
|
53250
|
+
init_build_profile();
|
|
53251
|
+
init_target_config();
|
|
53076
53252
|
async function loadCompileLockfile(projectRoot, logger) {
|
|
53077
53253
|
const lockfilePath = resolve21(projectRoot, "promptscript.lock");
|
|
53078
53254
|
if (!existsSync14(lockfilePath)) {
|
|
@@ -53116,28 +53292,20 @@ function createCliLogger() {
|
|
|
53116
53292
|
}
|
|
53117
53293
|
};
|
|
53118
53294
|
}
|
|
53119
|
-
function
|
|
53120
|
-
|
|
53121
|
-
|
|
53122
|
-
|
|
53123
|
-
}
|
|
53124
|
-
|
|
53125
|
-
|
|
53126
|
-
|
|
53127
|
-
}
|
|
53128
|
-
const [name, config] = entries[0];
|
|
53129
|
-
return { name, config };
|
|
53130
|
-
}).filter((target) => target.config?.enabled !== false);
|
|
53131
|
-
}
|
|
53132
|
-
function getBuildProfile(config, buildName) {
|
|
53133
|
-
if (!buildName) return void 0;
|
|
53134
|
-
const profile = config.builds?.[buildName];
|
|
53135
|
-
if (!profile) {
|
|
53136
|
-
const available2 = Object.keys(config.builds ?? {});
|
|
53137
|
-
const suffix = available2.length > 0 ? ` Available build profiles: ${available2.join(", ")}.` : "";
|
|
53138
|
-
throw new Error(`Unknown build profile: ${buildName}.${suffix}`);
|
|
53295
|
+
function describeEmptyTargets(context) {
|
|
53296
|
+
const { buildName, fromBuildProfile, entries, availableBuilds } = context;
|
|
53297
|
+
const location = fromBuildProfile && buildName ? `config.builds.${buildName}.targets` : "config.targets";
|
|
53298
|
+
if (entries && entries.length > 0) {
|
|
53299
|
+
const source = fromBuildProfile && buildName ? `Build profile "${buildName}"` : "promptscript.yaml";
|
|
53300
|
+
return `All compilation targets are disabled. ${source} lists only targets with "enabled: false" - enable at least one in ${location}.`;
|
|
53301
|
+
}
|
|
53302
|
+
if (buildName) {
|
|
53303
|
+
return fromBuildProfile ? `Build profile "${buildName}" lists no compilation targets. Add them to ${location}.` : `Build profile "${buildName}" inherits targets from config.targets, which is empty. Add targets to config.builds.${buildName}.targets or config.targets.`;
|
|
53139
53304
|
}
|
|
53140
|
-
|
|
53305
|
+
if (availableBuilds.length > 0) {
|
|
53306
|
+
return `No compilation targets configured in config.targets. Compile a named build profile with --build <name> (available: ${availableBuilds.join(", ")}) or use --all-builds.`;
|
|
53307
|
+
}
|
|
53308
|
+
return 'No compilation targets configured. Add a "targets" list to promptscript.yaml or run: prs init';
|
|
53141
53309
|
}
|
|
53142
53310
|
function resolveOutputBase(projectRoot, output) {
|
|
53143
53311
|
if (!output) return projectRoot;
|
|
@@ -53474,7 +53642,7 @@ async function compileAllBuilds(options, services) {
|
|
|
53474
53642
|
const projectRoot = options.cwd ? resolve21(options.cwd) : process.cwd();
|
|
53475
53643
|
const configPath = resolveCompileConfigPath(projectRoot, options);
|
|
53476
53644
|
const config = await loadEffectiveConfig(configPath);
|
|
53477
|
-
const buildNames = Object.keys(config
|
|
53645
|
+
const buildNames = Object.keys(getBuildProfiles(config));
|
|
53478
53646
|
if (buildNames.length === 0) {
|
|
53479
53647
|
ConsoleOutput.warning("No named build profiles found in config.builds");
|
|
53480
53648
|
return true;
|
|
@@ -53552,7 +53720,7 @@ async function compileCommandWithResult(options, services) {
|
|
|
53552
53720
|
const buildProfile = getBuildProfile(config, options.build);
|
|
53553
53721
|
const selectedTarget = options.target ?? options.format;
|
|
53554
53722
|
const targetEntries = buildProfile?.targets ?? config.targets;
|
|
53555
|
-
const parsedTargets =
|
|
53723
|
+
const parsedTargets = parseTargetEntries(targetEntries);
|
|
53556
53724
|
let targets;
|
|
53557
53725
|
if (selectedTarget) {
|
|
53558
53726
|
const matched = parsedTargets.find((t) => t.name === selectedTarget);
|
|
@@ -53560,6 +53728,19 @@ async function compileCommandWithResult(options, services) {
|
|
|
53560
53728
|
} else {
|
|
53561
53729
|
targets = parsedTargets;
|
|
53562
53730
|
}
|
|
53731
|
+
if (targets.length === 0) {
|
|
53732
|
+
spinner.fail("No compilation targets");
|
|
53733
|
+
ConsoleOutput.error(
|
|
53734
|
+
describeEmptyTargets({
|
|
53735
|
+
buildName: options.build,
|
|
53736
|
+
fromBuildProfile: buildProfile?.targets !== void 0,
|
|
53737
|
+
entries: targetEntries,
|
|
53738
|
+
availableBuilds: Object.keys(config.builds ?? {})
|
|
53739
|
+
})
|
|
53740
|
+
);
|
|
53741
|
+
process.exitCode = 1;
|
|
53742
|
+
return false;
|
|
53743
|
+
}
|
|
53563
53744
|
const conflicts = detectOutputConflicts(targets);
|
|
53564
53745
|
if (conflicts.size > 0) {
|
|
53565
53746
|
const lines = [...conflicts.entries()].map(
|
|
@@ -54731,6 +54912,8 @@ async function buildCompilationDiff(options) {
|
|
|
54731
54912
|
|
|
54732
54913
|
// packages/cli/src/commands/diff.ts
|
|
54733
54914
|
init_legacy_factory_hooks();
|
|
54915
|
+
init_build_profile();
|
|
54916
|
+
init_target_config();
|
|
54734
54917
|
import chalk2 from "chalk";
|
|
54735
54918
|
import { parse as parseYaml7 } from "yaml";
|
|
54736
54919
|
function configureColors(options) {
|
|
@@ -54765,19 +54948,6 @@ function createDiffLogger(machineReadable = false) {
|
|
|
54765
54948
|
}
|
|
54766
54949
|
};
|
|
54767
54950
|
}
|
|
54768
|
-
function parseTargets2(targets) {
|
|
54769
|
-
return targets.map((entry) => {
|
|
54770
|
-
if (typeof entry === "string") {
|
|
54771
|
-
return { name: entry };
|
|
54772
|
-
}
|
|
54773
|
-
const entries = Object.entries(entry);
|
|
54774
|
-
if (entries.length === 0) {
|
|
54775
|
-
throw new Error("Empty target configuration");
|
|
54776
|
-
}
|
|
54777
|
-
const [name, config] = entries[0];
|
|
54778
|
-
return { name, config };
|
|
54779
|
-
}).filter((target) => target.config?.enabled !== false);
|
|
54780
|
-
}
|
|
54781
54951
|
function resolveUniversalDir2(universalDir) {
|
|
54782
54952
|
if (universalDir === false) return void 0;
|
|
54783
54953
|
if (typeof universalDir === "string") return { universalDir };
|
|
@@ -54843,6 +55013,41 @@ async function diffCommand(options) {
|
|
|
54843
55013
|
const spinner = isJsonFormat ? createSpinner("").stop() : createSpinner("Loading configuration...").start();
|
|
54844
55014
|
try {
|
|
54845
55015
|
const config = await loadConfig();
|
|
55016
|
+
const buildProfile = getBuildProfile(config, options.build);
|
|
55017
|
+
const targetEntries = buildProfile?.targets ?? config.targets;
|
|
55018
|
+
const parsedTargets = parseTargetEntries(targetEntries);
|
|
55019
|
+
const targets = options.target ? [parsedTargets.find((target) => target.name === options.target) ?? { name: options.target }] : parsedTargets;
|
|
55020
|
+
if (targets.length === 0) {
|
|
55021
|
+
const availableBuilds = Object.keys(config.builds ?? {});
|
|
55022
|
+
let message;
|
|
55023
|
+
if (options.build) {
|
|
55024
|
+
const location = buildProfile?.targets !== void 0 ? `config.builds.${options.build}.targets` : "config.targets";
|
|
55025
|
+
message = `No compilation targets configured for build profile "${options.build}". Add an enabled target to ${location}.`;
|
|
55026
|
+
} else if (availableBuilds.length > 0) {
|
|
55027
|
+
message = `No compilation targets configured in config.targets. Run prs diff --build <name> (available: ${availableBuilds.join(", ")}) or add targets to promptscript.yaml.`;
|
|
55028
|
+
} else {
|
|
55029
|
+
message = 'No compilation targets configured. Add a "targets" list to promptscript.yaml or run: prs init';
|
|
55030
|
+
}
|
|
55031
|
+
if (isJsonFormat) {
|
|
55032
|
+
console.log(
|
|
55033
|
+
JSON.stringify(
|
|
55034
|
+
createCompilationDiffErrorReport(
|
|
55035
|
+
[{ name: "TargetError", code: "DIFF0003", message }],
|
|
55036
|
+
[],
|
|
55037
|
+
projectRoot,
|
|
55038
|
+
options.includeContent
|
|
55039
|
+
),
|
|
55040
|
+
null,
|
|
55041
|
+
2
|
|
55042
|
+
)
|
|
55043
|
+
);
|
|
55044
|
+
} else {
|
|
55045
|
+
spinner.fail("No compilation targets");
|
|
55046
|
+
ConsoleOutput.error(message);
|
|
55047
|
+
}
|
|
55048
|
+
process.exitCode = 1;
|
|
55049
|
+
return;
|
|
55050
|
+
}
|
|
54846
55051
|
const lockfile = await loadDiffLockfile(projectRoot);
|
|
54847
55052
|
const vendorDir = resolve25(projectRoot, ".promptscript/vendor");
|
|
54848
55053
|
if (!isJsonFormat) spinner.text = "Resolving registry...";
|
|
@@ -54852,12 +55057,10 @@ async function diffCommand(options) {
|
|
|
54852
55057
|
readOnly: true
|
|
54853
55058
|
});
|
|
54854
55059
|
if (!isJsonFormat) spinner.text = "Compiling...";
|
|
54855
|
-
const parsedTargets = parseTargets2(config.targets);
|
|
54856
|
-
const targets = options.target ? [parsedTargets.find((target) => target.name === options.target) ?? { name: options.target }] : parsedTargets;
|
|
54857
55060
|
const logger = createDiffLogger(isJsonFormat);
|
|
54858
55061
|
const prettierOptions = await resolvePrettierOptions(config, projectRoot);
|
|
54859
55062
|
const skillContent = config.includePromptScriptSkill === false ? void 0 : await loadBundledSkillContent(logger);
|
|
54860
|
-
const outputRoot = resolve25(projectRoot, config.output?.baseDir ?? ".");
|
|
55063
|
+
const outputRoot = resolve25(projectRoot, buildProfile?.output ?? config.output?.baseDir ?? ".");
|
|
54861
55064
|
const compiler = new Compiler({
|
|
54862
55065
|
resolver: {
|
|
54863
55066
|
registryPath: registry2.path,
|
|
@@ -54878,7 +55081,10 @@ async function diffCommand(options) {
|
|
|
54878
55081
|
logger,
|
|
54879
55082
|
skillContent
|
|
54880
55083
|
});
|
|
54881
|
-
const entryPath = resolve25(
|
|
55084
|
+
const entryPath = resolve25(
|
|
55085
|
+
projectRoot,
|
|
55086
|
+
buildProfile?.entry ?? config.input?.entry ?? "./.promptscript/project.prs"
|
|
55087
|
+
);
|
|
54882
55088
|
if (!existsSync18(entryPath)) {
|
|
54883
55089
|
const message = `File not found: ${entryPath}`;
|
|
54884
55090
|
if (isJsonFormat) {
|
|
@@ -54897,7 +55103,9 @@ async function diffCommand(options) {
|
|
|
54897
55103
|
} else {
|
|
54898
55104
|
spinner.fail("Entry file not found");
|
|
54899
55105
|
ConsoleOutput.error(message);
|
|
54900
|
-
ConsoleOutput.muted(
|
|
55106
|
+
ConsoleOutput.muted(
|
|
55107
|
+
options.build ? `Check config.builds.${options.build}.entry` : "Run: prs init"
|
|
55108
|
+
);
|
|
54901
55109
|
}
|
|
54902
55110
|
process.exitCode = 1;
|
|
54903
55111
|
return;
|
|
@@ -55031,6 +55239,45 @@ import { parse as parseYaml8 } from "yaml";
|
|
|
55031
55239
|
init_src();
|
|
55032
55240
|
init_loader2();
|
|
55033
55241
|
init_console();
|
|
55242
|
+
init_build_profile();
|
|
55243
|
+
init_target_config();
|
|
55244
|
+
function isTargetDisabled(config) {
|
|
55245
|
+
return config !== null && typeof config === "object" && !Array.isArray(config) && config.enabled === false;
|
|
55246
|
+
}
|
|
55247
|
+
function analyzeTargetEntries(entries) {
|
|
55248
|
+
const names = /* @__PURE__ */ new Set();
|
|
55249
|
+
const errors = [];
|
|
55250
|
+
for (const entry of entries) {
|
|
55251
|
+
if (typeof entry === "string") {
|
|
55252
|
+
if (isKnownTarget(entry)) {
|
|
55253
|
+
names.add(entry);
|
|
55254
|
+
} else {
|
|
55255
|
+
errors.push(`unknown target "${entry}"`);
|
|
55256
|
+
}
|
|
55257
|
+
continue;
|
|
55258
|
+
}
|
|
55259
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
55260
|
+
errors.push("target entries must be names or configuration objects");
|
|
55261
|
+
continue;
|
|
55262
|
+
}
|
|
55263
|
+
const configuredTargets = Object.entries(entry);
|
|
55264
|
+
if (configuredTargets.length === 0) {
|
|
55265
|
+
errors.push("target entries must not be empty");
|
|
55266
|
+
continue;
|
|
55267
|
+
}
|
|
55268
|
+
for (const [name, targetConfig] of configuredTargets) {
|
|
55269
|
+
if (!isKnownTarget(name)) {
|
|
55270
|
+
errors.push(`unknown target "${name}"`);
|
|
55271
|
+
}
|
|
55272
|
+
if (!isTargetConfig(targetConfig)) {
|
|
55273
|
+
errors.push(`target "${name}" configuration must be an object`);
|
|
55274
|
+
} else if (isKnownTarget(name) && !isTargetDisabled(targetConfig)) {
|
|
55275
|
+
names.add(name);
|
|
55276
|
+
}
|
|
55277
|
+
}
|
|
55278
|
+
}
|
|
55279
|
+
return { names: [...names], errors };
|
|
55280
|
+
}
|
|
55034
55281
|
async function checkCommand(_options) {
|
|
55035
55282
|
const spinner = createSpinner("Checking project health...").start();
|
|
55036
55283
|
const results = [];
|
|
@@ -55114,21 +55361,55 @@ async function checkCommand(_options) {
|
|
|
55114
55361
|
message: `v${config.syntax}`
|
|
55115
55362
|
});
|
|
55116
55363
|
}
|
|
55117
|
-
const
|
|
55118
|
-
|
|
55119
|
-
|
|
55120
|
-
|
|
55121
|
-
|
|
55122
|
-
|
|
55123
|
-
|
|
55124
|
-
|
|
55364
|
+
const entryIssues = [];
|
|
55365
|
+
const inputValue = config.input;
|
|
55366
|
+
if (inputValue !== void 0 && (inputValue === null || typeof inputValue !== "object" || Array.isArray(inputValue))) {
|
|
55367
|
+
entryIssues.push("config.input must be an object");
|
|
55368
|
+
} else if (inputValue && typeof inputValue === "object") {
|
|
55369
|
+
const configuredEntry = inputValue.entry;
|
|
55370
|
+
if (configuredEntry !== void 0 && (typeof configuredEntry !== "string" || configuredEntry.trim().length === 0)) {
|
|
55371
|
+
entryIssues.push("config.input.entry must be a non-empty string");
|
|
55372
|
+
}
|
|
55373
|
+
}
|
|
55374
|
+
const entryBuildsValue = config.builds;
|
|
55375
|
+
if (entryBuildsValue && typeof entryBuildsValue === "object" && !Array.isArray(entryBuildsValue)) {
|
|
55376
|
+
for (const [buildName, profile] of Object.entries(
|
|
55377
|
+
entryBuildsValue
|
|
55378
|
+
)) {
|
|
55379
|
+
if (!profile || typeof profile !== "object" || Array.isArray(profile)) continue;
|
|
55380
|
+
const configuredEntry = profile.entry;
|
|
55381
|
+
if (configuredEntry !== void 0 && (typeof configuredEntry !== "string" || configuredEntry.trim().length === 0)) {
|
|
55382
|
+
entryIssues.push(`config.builds.${buildName}.entry must be a non-empty string`);
|
|
55383
|
+
}
|
|
55384
|
+
}
|
|
55385
|
+
}
|
|
55386
|
+
if (entryIssues.length > 0) {
|
|
55125
55387
|
results.push({
|
|
55126
|
-
name: "Entry
|
|
55388
|
+
name: "Entry configuration",
|
|
55127
55389
|
status: "error",
|
|
55128
|
-
message:
|
|
55390
|
+
message: entryIssues.join("; ")
|
|
55129
55391
|
});
|
|
55130
55392
|
hasErrors = true;
|
|
55131
55393
|
}
|
|
55394
|
+
const effectiveEntries = getEffectiveEntryPaths(config);
|
|
55395
|
+
for (const entry of effectiveEntries) {
|
|
55396
|
+
const entryPath = resolve26(entry);
|
|
55397
|
+
const name = entry === (config.input?.entry ?? ".promptscript/project.prs") ? "Entry file" : `Entry file (${entry})`;
|
|
55398
|
+
if (existsSync19(entryPath)) {
|
|
55399
|
+
results.push({
|
|
55400
|
+
name,
|
|
55401
|
+
status: "ok",
|
|
55402
|
+
message: entry
|
|
55403
|
+
});
|
|
55404
|
+
} else {
|
|
55405
|
+
results.push({
|
|
55406
|
+
name,
|
|
55407
|
+
status: "error",
|
|
55408
|
+
message: `Entry file not found: ${entryPath}`
|
|
55409
|
+
});
|
|
55410
|
+
hasErrors = true;
|
|
55411
|
+
}
|
|
55412
|
+
}
|
|
55132
55413
|
if (config.registry?.url && !config.registry.git) {
|
|
55133
55414
|
results.push({
|
|
55134
55415
|
name: "Registry URL",
|
|
@@ -55153,7 +55434,62 @@ async function checkCommand(_options) {
|
|
|
55153
55434
|
hasErrors = true;
|
|
55154
55435
|
}
|
|
55155
55436
|
}
|
|
55156
|
-
|
|
55437
|
+
const targetIssues = [];
|
|
55438
|
+
const targetNames = /* @__PURE__ */ new Set();
|
|
55439
|
+
const rootTargetValue = config.targets;
|
|
55440
|
+
const rootTargets = Array.isArray(rootTargetValue) ? rootTargetValue : [];
|
|
55441
|
+
const buildsValue = config.builds;
|
|
55442
|
+
const builds = buildsValue !== void 0 && buildsValue !== null && typeof buildsValue === "object" && !Array.isArray(buildsValue) ? Object.entries(buildsValue) : [];
|
|
55443
|
+
const appendTargetAnalysis = (location, entries) => {
|
|
55444
|
+
const analysis = analyzeTargetEntries(entries);
|
|
55445
|
+
for (const name of analysis.names) {
|
|
55446
|
+
targetNames.add(name);
|
|
55447
|
+
}
|
|
55448
|
+
targetIssues.push(...analysis.errors.map((error) => `${location}: ${error}`));
|
|
55449
|
+
if (entries.length > 0 && analysis.names.length === 0 && analysis.errors.length === 0) {
|
|
55450
|
+
targetIssues.push(`${location}: no enabled targets`);
|
|
55451
|
+
}
|
|
55452
|
+
};
|
|
55453
|
+
if (rootTargetValue !== void 0 && !Array.isArray(rootTargetValue)) {
|
|
55454
|
+
targetIssues.push("config.targets must be an array");
|
|
55455
|
+
} else if (rootTargets.length > 0) {
|
|
55456
|
+
appendTargetAnalysis("config.targets", rootTargets);
|
|
55457
|
+
}
|
|
55458
|
+
if (buildsValue !== void 0 && (buildsValue === null || typeof buildsValue !== "object" || Array.isArray(buildsValue))) {
|
|
55459
|
+
targetIssues.push("config.builds must be an object");
|
|
55460
|
+
}
|
|
55461
|
+
for (const [buildName, profile] of builds) {
|
|
55462
|
+
if (!profile || typeof profile !== "object" || Array.isArray(profile)) {
|
|
55463
|
+
targetIssues.push(`config.builds.${buildName} must be an object`);
|
|
55464
|
+
continue;
|
|
55465
|
+
}
|
|
55466
|
+
const profileTargetValue = profile.targets;
|
|
55467
|
+
if (profileTargetValue === void 0) {
|
|
55468
|
+
if (rootTargets.length === 0) {
|
|
55469
|
+
targetIssues.push(
|
|
55470
|
+
`config.builds.${buildName}.targets is missing and config.targets is empty`
|
|
55471
|
+
);
|
|
55472
|
+
}
|
|
55473
|
+
continue;
|
|
55474
|
+
}
|
|
55475
|
+
if (!Array.isArray(profileTargetValue)) {
|
|
55476
|
+
targetIssues.push(`config.builds.${buildName}.targets must be an array`);
|
|
55477
|
+
continue;
|
|
55478
|
+
}
|
|
55479
|
+
if (profileTargetValue.length === 0) {
|
|
55480
|
+
targetIssues.push(`config.builds.${buildName}.targets is empty`);
|
|
55481
|
+
continue;
|
|
55482
|
+
}
|
|
55483
|
+
appendTargetAnalysis(`config.builds.${buildName}.targets`, profileTargetValue);
|
|
55484
|
+
}
|
|
55485
|
+
if (targetIssues.length > 0) {
|
|
55486
|
+
results.push({
|
|
55487
|
+
name: "Targets",
|
|
55488
|
+
status: "error",
|
|
55489
|
+
message: targetIssues.join("; ")
|
|
55490
|
+
});
|
|
55491
|
+
hasErrors = true;
|
|
55492
|
+
} else if (rootTargets.length === 0 && builds.length === 0) {
|
|
55157
55493
|
results.push({
|
|
55158
55494
|
name: "Targets",
|
|
55159
55495
|
status: "warning",
|
|
@@ -55161,30 +55497,14 @@ async function checkCommand(_options) {
|
|
|
55161
55497
|
});
|
|
55162
55498
|
hasWarnings = true;
|
|
55163
55499
|
} else {
|
|
55164
|
-
|
|
55165
|
-
|
|
55166
|
-
|
|
55167
|
-
|
|
55168
|
-
}
|
|
55169
|
-
return Object.keys(target);
|
|
55500
|
+
results.push({
|
|
55501
|
+
name: "Targets",
|
|
55502
|
+
status: "ok",
|
|
55503
|
+
message: rootTargets.length === 0 ? `${targetNames.size} target(s) configured in build profiles` : `${targetNames.size} target(s) configured`
|
|
55170
55504
|
});
|
|
55171
|
-
const invalidTargets = targetNames.filter((target) => !isKnownTarget(target));
|
|
55172
|
-
if (invalidTargets.length > 0 || targetNames.length === 0) {
|
|
55173
|
-
results.push({
|
|
55174
|
-
name: "Targets",
|
|
55175
|
-
status: "error",
|
|
55176
|
-
message: invalidTargets.length > 0 ? `Unknown target(s): ${invalidTargets.join(", ")}` : "Target entries must not be empty"
|
|
55177
|
-
});
|
|
55178
|
-
hasErrors = true;
|
|
55179
|
-
} else {
|
|
55180
|
-
results.push({
|
|
55181
|
-
name: "Targets",
|
|
55182
|
-
status: "ok",
|
|
55183
|
-
message: `${targetNames.length} target(s) configured`
|
|
55184
|
-
});
|
|
55185
|
-
}
|
|
55186
55505
|
}
|
|
55187
|
-
|
|
55506
|
+
const existingEntries = effectiveEntries.filter((entry) => existsSync19(resolve26(entry)));
|
|
55507
|
+
if (existingEntries.length > 0) {
|
|
55188
55508
|
try {
|
|
55189
55509
|
const lockfilePath = resolve26("promptscript.lock");
|
|
55190
55510
|
let lockfile;
|
|
@@ -55219,27 +55539,39 @@ async function checkCommand(_options) {
|
|
|
55219
55539
|
},
|
|
55220
55540
|
formatters: []
|
|
55221
55541
|
});
|
|
55222
|
-
const
|
|
55223
|
-
|
|
55224
|
-
|
|
55225
|
-
|
|
55226
|
-
|
|
55227
|
-
|
|
55228
|
-
|
|
55229
|
-
|
|
55230
|
-
|
|
55231
|
-
|
|
55232
|
-
|
|
55233
|
-
|
|
55234
|
-
|
|
55235
|
-
|
|
55236
|
-
|
|
55237
|
-
|
|
55238
|
-
|
|
55239
|
-
|
|
55240
|
-
|
|
55241
|
-
|
|
55242
|
-
|
|
55542
|
+
for (const entry of existingEntries) {
|
|
55543
|
+
const name = entry === (config.input?.entry ?? ".promptscript/project.prs") ? "Project resolution" : `Project resolution (${entry})`;
|
|
55544
|
+
try {
|
|
55545
|
+
const result = await compiler.compile(resolve26(entry));
|
|
55546
|
+
if (result.errors.length > 0) {
|
|
55547
|
+
results.push({
|
|
55548
|
+
name,
|
|
55549
|
+
status: "error",
|
|
55550
|
+
message: result.errors.map((error) => error.message).join("; ")
|
|
55551
|
+
});
|
|
55552
|
+
hasErrors = true;
|
|
55553
|
+
} else if (result.warnings.length > 0) {
|
|
55554
|
+
results.push({
|
|
55555
|
+
name,
|
|
55556
|
+
status: "warning",
|
|
55557
|
+
message: `${result.warnings.length} validation warning(s)`
|
|
55558
|
+
});
|
|
55559
|
+
hasWarnings = true;
|
|
55560
|
+
} else {
|
|
55561
|
+
results.push({
|
|
55562
|
+
name,
|
|
55563
|
+
status: "ok",
|
|
55564
|
+
message: "Syntax, imports, and inheritance are valid"
|
|
55565
|
+
});
|
|
55566
|
+
}
|
|
55567
|
+
} catch (error) {
|
|
55568
|
+
results.push({
|
|
55569
|
+
name,
|
|
55570
|
+
status: "error",
|
|
55571
|
+
message: error instanceof Error ? error.message : "Unknown resolution error"
|
|
55572
|
+
});
|
|
55573
|
+
hasErrors = true;
|
|
55574
|
+
}
|
|
55243
55575
|
}
|
|
55244
55576
|
} catch (error) {
|
|
55245
55577
|
results.push({
|
|
@@ -60768,7 +61100,7 @@ program.command("validate [files...]").description("Validate PromptScript files"
|
|
|
60768
61100
|
program.command("inspect <skill-name>").description("Inspect skill composition layers and property provenance").option("--layers", "Show layer-level breakdown").option("--format <format>", "Output format (text, json)", "text").option("-c, --config <path>", "Path to custom config file").option("--cwd <dir>", "Working directory (project root)").action((skillName, opts) => inspectCommand(skillName, opts));
|
|
60769
61101
|
program.command("explain <path>").description("Explain source and composition provenance for a resolved path").option("--format <format>", "Output format (text, json)", "text").option("-c, --config <path>", "Path to custom config file").option("--cwd <dir>", "Working directory (project root)").option("--absolute-paths", "Include absolute filesystem paths in output").action((path2, opts) => explainCommand(path2, opts));
|
|
60770
61102
|
program.command("pull").description("Pull updates from registry").option("-f, --force", "Force overwrite").option("--dry-run", "Preview changes without pulling").option("-b, --branch <name>", "Git branch to pull from").option("--tag <name>", "Git tag to pull from").option("--commit <hash>", "Git commit to pull from").option("--refresh", "Force re-fetch from remote (ignore cache)").action(pullCommand);
|
|
60771
|
-
program.command("diff").description("Show diff for compiled output").option("-t, --target <target>", "Specific target").option("--format <format>", "Output format (text, json)", "text").option("-a, --all", "Show diff for all targets at once").option("--full", "Show full diff without truncation").option("--include-content", "Include canonical output content in JSON reports").option("--no-pager", "Disable pager output").option("--color", "Force colored output").option("--no-color", "Disable colored output").action(diffCommand);
|
|
61103
|
+
program.command("diff").description("Show diff for compiled output").option("-b, --build <name>", "Named build profile from config.builds").option("-t, --target <target>", "Specific target").option("--format <format>", "Output format (text, json)", "text").option("-a, --all", "Show diff for all targets at once").option("--full", "Show full diff without truncation").option("--include-content", "Include canonical output content in JSON reports").option("--no-pager", "Disable pager output").option("--color", "Force colored output").option("--no-color", "Disable colored output").action(diffCommand);
|
|
60772
61104
|
program.command("check").description("Check configuration and dependencies health").action(checkCommand);
|
|
60773
61105
|
program.command("update-check").description("Check for CLI updates").action(updateCheckCommand);
|
|
60774
61106
|
program.command("telemetry").argument("<action>", "Action: status, enable, or disable").description("Manage anonymous usage telemetry").action(telemetryCommand);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptscript/cli",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.1",
|
|
4
4
|
"description": "CLI for PromptScript - standardize AI instructions across GitHub Copilot, Claude, Cursor and other AI tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"prettier": "^3.9.6",
|
|
51
51
|
"yaml": "^2.9.0",
|
|
52
52
|
"simple-git": "3.36.0",
|
|
53
|
-
"fastify": "^5.
|
|
53
|
+
"fastify": "^5.12.0",
|
|
54
54
|
"@fastify/cors": "^11.3.0",
|
|
55
55
|
"@fastify/websocket": "^11.3.0",
|
|
56
|
-
"ws": "^8.21.
|
|
56
|
+
"ws": "^8.21.3",
|
|
57
57
|
"fast-glob": "^3.3.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/src/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/cli.ts"],"names":[],"mappings":";AAoWA;;;GAGG;AACH,wBAAsB,GAAG,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAStE"}
|
package/src/commands/check.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { CheckOptions } from '../types.js';
|
|
|
3
3
|
* Check configuration and dependencies health.
|
|
4
4
|
* Verifies:
|
|
5
5
|
* - Config file exists and is valid
|
|
6
|
-
* -
|
|
6
|
+
* - Effective entry files exist
|
|
7
7
|
* - Registry and lockfile are usable
|
|
8
8
|
* - PromptScript syntax, imports, and inheritance resolve
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/check.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/check.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAsEhD;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAsZxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/compile.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/compile.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgBlD,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AA+rBzE;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,cAAc,EACvB,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/diff.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/diff.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAkC,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAmCjF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,eAAe,UAAQ,GAAG,MAAM,CAwBhE;AAqFD;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA+OrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/migrate.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/migrate.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAqBzE,wBAAsB,cAAc,CAClC,OAAO,EAAE,cAAc,EACvB,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAQf"}
|
package/src/types.d.ts
CHANGED
|
@@ -123,6 +123,8 @@ export interface PullOptions {
|
|
|
123
123
|
* Options for the diff command.
|
|
124
124
|
*/
|
|
125
125
|
export interface DiffOptions {
|
|
126
|
+
/** Named build profile from config.builds */
|
|
127
|
+
build?: string;
|
|
126
128
|
/** Specific target to diff */
|
|
127
129
|
target?: string;
|
|
128
130
|
/** Output format */
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iCAAiC;IACjC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qCAAqC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE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CAAC;IACjB,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iCAAiC;IACjC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qCAAqC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yDAAyD;I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AM,CAAC,EAAE,OAAO,CAAC;IACjB,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BuildProfileConfig, PromptScriptConfig } from '@promptscript/core';
|
|
2
|
+
export declare function getBuildProfiles(config: PromptScriptConfig): Record<string, BuildProfileConfig>;
|
|
3
|
+
export declare function getBuildProfile(config: PromptScriptConfig, buildName: string | undefined): BuildProfileConfig | undefined;
|
|
4
|
+
export declare function getEffectiveEntryPaths(config: PromptScriptConfig): string[];
|
|
5
|
+
//# sourceMappingURL=build-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-profile.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/build-profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAMjF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAiB/F;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,kBAAkB,GAAG,SAAS,CAYhC;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,EAAE,CA2B3E"}
|
|
@@ -5,7 +5,7 @@ export interface MigrationPromptInput {
|
|
|
5
5
|
}
|
|
6
6
|
export interface MigrationPromptOptions {
|
|
7
7
|
outputDirectory?: string;
|
|
8
|
-
|
|
8
|
+
existingEntries?: string[];
|
|
9
9
|
}
|
|
10
10
|
export declare function generateMigrationPrompt(candidates: MigrationPromptInput[], options?: MigrationPromptOptions): string;
|
|
11
11
|
//# sourceMappingURL=migration-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-prompt.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/migration-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,
|
|
1
|
+
{"version":3,"file":"migration-prompt.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/migration-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,oBAAoB,EAAE,EAClC,OAAO,GAAE,sBAA2B,GACnC,MAAM,CAgCR"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TargetConfig } from '@promptscript/core';
|
|
2
|
+
export interface ParsedTarget {
|
|
3
|
+
name: string;
|
|
4
|
+
config?: TargetConfig;
|
|
5
|
+
}
|
|
6
|
+
export declare function isTargetConfig(value: unknown): value is TargetConfig;
|
|
7
|
+
export declare function parseTargetEntries(targets: unknown): ParsedTarget[];
|
|
8
|
+
//# sourceMappingURL=target-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target-config.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/target-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,EAAE,CA8BnE"}
|