@promptscript/cli 1.0.0-alpha.3 → 1.0.0-alpha.5
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/CHANGELOG.md +35 -0
- package/README.md +2 -0
- package/index.js +213 -38
- package/package.json +27 -26
- package/src/cli.d.ts.map +1 -1
- package/src/commands/compile.d.ts.map +1 -1
- package/src/commands/init.d.ts.map +1 -1
- package/src/output/console.d.ts +7 -1
- package/src/output/console.d.ts.map +1 -1
- package/src/utils/ai-tools-detector.d.ts +10 -0
- package/src/utils/ai-tools-detector.d.ts.map +1 -1
- package/package.publish.json +0 -50
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,41 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.0-alpha.5](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2026-01-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### chore
|
|
12
|
+
|
|
13
|
+
* prepare alpha release ([54696c9](https://github.com/mrwogu/promptscript/commit/54696c93e27cf9fc2f09dd730b09e568d0dc425e))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **cli:** add AI-assisted migration skill and CLI integration ([53e9cca](https://github.com/mrwogu/promptscript/commit/53e9cca8669a30e787cbc2aa7679bb63f7896fce))
|
|
19
|
+
* **cli:** add verbose and debug logging throughout compilation pipeline ([36bd63a](https://github.com/mrwogu/promptscript/commit/36bd63a2fa1dde1acbfd0794bb174f645ef71335))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **cli:** add migrationCandidates to test mocks ([d8fe117](https://github.com/mrwogu/promptscript/commit/d8fe117ff5523bb5b1c15996e00d8c24548c7b8f))
|
|
25
|
+
* **cli:** extend marker detection from 10 to 20 lines ([229e9bc](https://github.com/mrwogu/promptscript/commit/229e9bc5bf4d0441c9674e6483a5125347b6f0b8))
|
|
26
|
+
|
|
27
|
+
## [1.0.0-alpha.4](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2026-01-27)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### ⚠ BREAKING CHANGES
|
|
31
|
+
|
|
32
|
+
* **compiler:** Generated files now have compact marker instead of verbose header. Existing files with legacy marker still recognized.
|
|
33
|
+
|
|
34
|
+
### chore
|
|
35
|
+
|
|
36
|
+
* prepare alpha release ([8c3a428](https://github.com/mrwogu/promptscript/commit/8c3a428856bc088fb27a4fdd6a16185fe5e63589))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* **compiler:** add compact PromptScript marker to all outputs ([6d74480](https://github.com/mrwogu/promptscript/commit/6d744800a4ab38030b6c23b2ab949c79977ab12e))
|
|
42
|
+
|
|
8
43
|
## [1.0.0-alpha.3](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2026-01-27)
|
|
9
44
|
|
|
10
45
|
|
package/README.md
CHANGED
|
@@ -69,6 +69,8 @@ Options:
|
|
|
69
69
|
--dry-run Preview changes without writing files
|
|
70
70
|
--force Force overwrite existing files without prompts
|
|
71
71
|
--registry <path> Path or URL to registry
|
|
72
|
+
--verbose Show detailed compilation progress
|
|
73
|
+
--debug Show debug information (includes verbose)
|
|
72
74
|
```
|
|
73
75
|
|
|
74
76
|
**Watch Mode:** Uses [chokidar](https://github.com/paulmillr/chokidar) for reliable file watching across all platforms. Automatically recompiles when `.prs` files change.
|
package/index.js
CHANGED
|
@@ -296,6 +296,14 @@ function getPackageVersion(baseDir, relativePath = "../package.json") {
|
|
|
296
296
|
return getPackageInfo(baseDir, relativePath).version;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
+
// packages/core/src/logger.ts
|
|
300
|
+
var noopLogger = {
|
|
301
|
+
verbose: () => {
|
|
302
|
+
},
|
|
303
|
+
debug: () => {
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
|
|
299
307
|
// packages/cli/src/commands/init.ts
|
|
300
308
|
import { fileURLToPath } from "url";
|
|
301
309
|
import { dirname as dirname2 } from "path";
|
|
@@ -331,6 +339,7 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
|
331
339
|
LogLevel2[LogLevel2["Quiet"] = 0] = "Quiet";
|
|
332
340
|
LogLevel2[LogLevel2["Normal"] = 1] = "Normal";
|
|
333
341
|
LogLevel2[LogLevel2["Verbose"] = 2] = "Verbose";
|
|
342
|
+
LogLevel2[LogLevel2["Debug"] = 3] = "Debug";
|
|
334
343
|
return LogLevel2;
|
|
335
344
|
})(LogLevel || {});
|
|
336
345
|
var globalContext = {
|
|
@@ -349,6 +358,9 @@ function isVerbose() {
|
|
|
349
358
|
function isQuiet() {
|
|
350
359
|
return globalContext.logLevel <= 0 /* Quiet */;
|
|
351
360
|
}
|
|
361
|
+
function isDebug() {
|
|
362
|
+
return globalContext.logLevel >= 3 /* Debug */;
|
|
363
|
+
}
|
|
352
364
|
function createSpinner(text) {
|
|
353
365
|
if (isQuiet()) {
|
|
354
366
|
const noopSpinner = ora({ isSilent: true });
|
|
@@ -617,6 +629,16 @@ async function detectFrameworks(services) {
|
|
|
617
629
|
}
|
|
618
630
|
|
|
619
631
|
// packages/cli/src/utils/ai-tools-detector.ts
|
|
632
|
+
var PROMPTSCRIPT_MARKER = "PromptScript";
|
|
633
|
+
var INSTRUCTION_FILES = [
|
|
634
|
+
"CLAUDE.md",
|
|
635
|
+
"claude.md",
|
|
636
|
+
".cursorrules",
|
|
637
|
+
".github/copilot-instructions.md",
|
|
638
|
+
"AGENTS.md",
|
|
639
|
+
"AI_INSTRUCTIONS.md",
|
|
640
|
+
"AI.md"
|
|
641
|
+
];
|
|
620
642
|
var AI_TOOL_PATTERNS = [
|
|
621
643
|
{
|
|
622
644
|
target: "github",
|
|
@@ -648,6 +670,15 @@ async function directoryHasContent(dir, services) {
|
|
|
648
670
|
return false;
|
|
649
671
|
}
|
|
650
672
|
}
|
|
673
|
+
async function isPromptScriptGenerated(filePath, services) {
|
|
674
|
+
try {
|
|
675
|
+
const content = await services.fs.readFile(filePath, "utf-8");
|
|
676
|
+
const header = content.slice(0, 500);
|
|
677
|
+
return header.includes(PROMPTSCRIPT_MARKER);
|
|
678
|
+
} catch {
|
|
679
|
+
return false;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
651
682
|
async function detectAITools(services = createDefaultServices()) {
|
|
652
683
|
const detected = [];
|
|
653
684
|
const details = {
|
|
@@ -656,6 +687,7 @@ async function detectAITools(services = createDefaultServices()) {
|
|
|
656
687
|
cursor: [],
|
|
657
688
|
antigravity: []
|
|
658
689
|
};
|
|
690
|
+
const migrationCandidates = [];
|
|
659
691
|
for (const pattern of AI_TOOL_PATTERNS) {
|
|
660
692
|
const foundFiles = [];
|
|
661
693
|
for (const file of pattern.files) {
|
|
@@ -673,7 +705,15 @@ async function detectAITools(services = createDefaultServices()) {
|
|
|
673
705
|
details[pattern.target] = foundFiles;
|
|
674
706
|
}
|
|
675
707
|
}
|
|
676
|
-
|
|
708
|
+
for (const file of INSTRUCTION_FILES) {
|
|
709
|
+
if (services.fs.existsSync(file)) {
|
|
710
|
+
const isGenerated = await isPromptScriptGenerated(file, services);
|
|
711
|
+
if (!isGenerated) {
|
|
712
|
+
migrationCandidates.push(file);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
return { detected, details, migrationCandidates };
|
|
677
717
|
}
|
|
678
718
|
function getAllTargets() {
|
|
679
719
|
return ["github", "claude", "cursor", "antigravity"];
|
|
@@ -694,6 +734,25 @@ function formatDetectionResults(detection) {
|
|
|
694
734
|
}
|
|
695
735
|
return lines;
|
|
696
736
|
}
|
|
737
|
+
function hasMigrationCandidates(detection) {
|
|
738
|
+
return detection.migrationCandidates.length > 0;
|
|
739
|
+
}
|
|
740
|
+
function formatMigrationHint(detection) {
|
|
741
|
+
if (detection.migrationCandidates.length === 0) {
|
|
742
|
+
return [];
|
|
743
|
+
}
|
|
744
|
+
const lines = [];
|
|
745
|
+
lines.push("");
|
|
746
|
+
lines.push("\u{1F4CB} Existing instruction files detected:");
|
|
747
|
+
for (const file of detection.migrationCandidates) {
|
|
748
|
+
lines.push(` \u2022 ${file}`);
|
|
749
|
+
}
|
|
750
|
+
lines.push("");
|
|
751
|
+
lines.push(" These can be migrated to PromptScript for unified management.");
|
|
752
|
+
lines.push(" See: https://getpromptscript.dev/latest/guides/ai-migration-best-practices");
|
|
753
|
+
lines.push(" Or use the /migrate skill in Claude Code.");
|
|
754
|
+
return lines;
|
|
755
|
+
}
|
|
697
756
|
|
|
698
757
|
// packages/cli/src/prettier/loader.ts
|
|
699
758
|
import { existsSync as existsSync2 } from "fs";
|
|
@@ -854,6 +913,18 @@ async function initCommand(options, services = createDefaultServices()) {
|
|
|
854
913
|
console.log("Next steps:");
|
|
855
914
|
ConsoleOutput.muted("1. Edit .promptscript/project.prs to customize your AI instructions");
|
|
856
915
|
ConsoleOutput.muted("2. Run: prs compile");
|
|
916
|
+
if (hasMigrationCandidates(aiToolsDetection)) {
|
|
917
|
+
const migrationHint = formatMigrationHint(aiToolsDetection);
|
|
918
|
+
for (const line of migrationHint) {
|
|
919
|
+
if (line.startsWith("\u{1F4CB}") || line.includes("migrated") || line.includes("See:") || line.includes("Or use")) {
|
|
920
|
+
ConsoleOutput.info(line.replace(/^\s+/, ""));
|
|
921
|
+
} else if (line.trim().startsWith("\u2022")) {
|
|
922
|
+
ConsoleOutput.muted(line);
|
|
923
|
+
} else if (line.trim()) {
|
|
924
|
+
console.log(line);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}
|
|
857
928
|
} catch (error) {
|
|
858
929
|
if (error.name === "ExitPromptError") {
|
|
859
930
|
ConsoleOutput.newline();
|
|
@@ -2064,8 +2135,6 @@ var GitHubFormatter = class extends BaseFormatter {
|
|
|
2064
2135
|
const lines = [];
|
|
2065
2136
|
lines.push("# Agent Instructions");
|
|
2066
2137
|
lines.push("");
|
|
2067
|
-
lines.push("> Auto-generated by PromptScript");
|
|
2068
|
-
lines.push("");
|
|
2069
2138
|
const identityText = this.extractText(identity2.content);
|
|
2070
2139
|
if (identityText) {
|
|
2071
2140
|
lines.push("## Identity");
|
|
@@ -2225,16 +2294,8 @@ var GitHubFormatter = class extends BaseFormatter {
|
|
|
2225
2294
|
const knowledge = this.knowledge(ast, renderer);
|
|
2226
2295
|
if (knowledge) sections.push(knowledge);
|
|
2227
2296
|
}
|
|
2228
|
-
header(
|
|
2229
|
-
|
|
2230
|
-
const syntax = this.getMetaField(ast, "syntax") ?? "0.0.0";
|
|
2231
|
-
return `# GitHub Copilot Instructions
|
|
2232
|
-
|
|
2233
|
-
> Auto-generated by PromptScript
|
|
2234
|
-
> Source: ${id} (syntax ${syntax})
|
|
2235
|
-
> Generated: ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
2236
|
-
>
|
|
2237
|
-
> **Do not edit manually**`;
|
|
2297
|
+
header(_ast) {
|
|
2298
|
+
return `# GitHub Copilot Instructions`;
|
|
2238
2299
|
}
|
|
2239
2300
|
project(ast, renderer) {
|
|
2240
2301
|
const identity2 = this.findBlock(ast, "identity");
|
|
@@ -4068,17 +4129,8 @@ var AntigravityFormatter = class extends BaseFormatter {
|
|
|
4068
4129
|
formatWorkflowTitle(name) {
|
|
4069
4130
|
return name.replace(/^\//, "").split(/[-_]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
4070
4131
|
}
|
|
4071
|
-
header(
|
|
4072
|
-
|
|
4073
|
-
const syntax = this.getMetaField(ast, "syntax") ?? "0.0.0";
|
|
4074
|
-
return `# Project Rules
|
|
4075
|
-
|
|
4076
|
-
> Auto-generated by PromptScript
|
|
4077
|
-
> Source: ${id} (syntax ${syntax})
|
|
4078
|
-
> Generated: ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
4079
|
-
>
|
|
4080
|
-
> **Do not edit manually** - these rules are generated from PromptScript.
|
|
4081
|
-
> To modify, update the source .prs file and recompile.`;
|
|
4132
|
+
header(_ast) {
|
|
4133
|
+
return `# Project Rules`;
|
|
4082
4134
|
}
|
|
4083
4135
|
identity(ast, _renderer) {
|
|
4084
4136
|
const identity2 = this.findBlock(ast, "identity");
|
|
@@ -15397,11 +15449,13 @@ var Resolver = class {
|
|
|
15397
15449
|
cache;
|
|
15398
15450
|
resolving;
|
|
15399
15451
|
cacheEnabled;
|
|
15452
|
+
logger;
|
|
15400
15453
|
constructor(options) {
|
|
15401
15454
|
this.loader = new FileLoader(options);
|
|
15402
15455
|
this.cache = /* @__PURE__ */ new Map();
|
|
15403
15456
|
this.resolving = /* @__PURE__ */ new Set();
|
|
15404
15457
|
this.cacheEnabled = options.cache !== false;
|
|
15458
|
+
this.logger = options.logger ?? noopLogger;
|
|
15405
15459
|
}
|
|
15406
15460
|
/**
|
|
15407
15461
|
* Resolve a PromptScript file and all its dependencies.
|
|
@@ -15413,15 +15467,19 @@ var Resolver = class {
|
|
|
15413
15467
|
async resolve(entryPath) {
|
|
15414
15468
|
const absPath = this.loader.toAbsolutePath(entryPath);
|
|
15415
15469
|
if (this.resolving.has(absPath)) {
|
|
15470
|
+
this.logger.debug(`Circular dependency detected: ${absPath}`);
|
|
15416
15471
|
throw new CircularDependencyError([...this.resolving, absPath]);
|
|
15417
15472
|
}
|
|
15418
15473
|
if (this.cacheEnabled && this.cache.has(absPath)) {
|
|
15474
|
+
this.logger.debug(`Cache hit: ${absPath}`);
|
|
15419
15475
|
return this.cache.get(absPath);
|
|
15420
15476
|
}
|
|
15421
15477
|
this.resolving.add(absPath);
|
|
15478
|
+
this.logger.verbose(`Parsing ${absPath}`);
|
|
15422
15479
|
try {
|
|
15423
15480
|
const result = await this.doResolve(absPath);
|
|
15424
15481
|
if (this.cacheEnabled) {
|
|
15482
|
+
this.logger.debug(`Cache store: ${absPath}`);
|
|
15425
15483
|
this.cache.set(absPath, result);
|
|
15426
15484
|
}
|
|
15427
15485
|
return result;
|
|
@@ -15440,16 +15498,33 @@ var Resolver = class {
|
|
|
15440
15498
|
return { ast: null, sources, errors };
|
|
15441
15499
|
}
|
|
15442
15500
|
let ast = parseData.ast;
|
|
15501
|
+
this.logger.debug(`AST node count: ${this.countNodes(ast)}`);
|
|
15443
15502
|
ast = await this.resolveInherit(ast, absPath, sources, errors);
|
|
15444
15503
|
ast = await this.resolveImports(ast, absPath, sources, errors);
|
|
15504
|
+
if (ast.extends.length > 0) {
|
|
15505
|
+
this.logger.debug(`Applying ${ast.extends.length} extension(s)`);
|
|
15506
|
+
}
|
|
15445
15507
|
ast = applyExtends(ast);
|
|
15446
15508
|
ast = await resolveNativeSkills(ast, this.loader.getRegistryPath(), absPath);
|
|
15509
|
+
this.logger.debug(`Resolved ${sources.length} source file(s)`);
|
|
15447
15510
|
return {
|
|
15448
15511
|
ast,
|
|
15449
15512
|
sources: [...new Set(sources)],
|
|
15450
15513
|
errors
|
|
15451
15514
|
};
|
|
15452
15515
|
}
|
|
15516
|
+
/**
|
|
15517
|
+
* Count nodes in AST for debug output.
|
|
15518
|
+
*/
|
|
15519
|
+
countNodes(ast) {
|
|
15520
|
+
let count = 1;
|
|
15521
|
+
if (ast.meta) count++;
|
|
15522
|
+
if (ast.inherit) count++;
|
|
15523
|
+
count += ast.uses.length;
|
|
15524
|
+
count += ast.blocks.length;
|
|
15525
|
+
count += ast.extends.length;
|
|
15526
|
+
return count;
|
|
15527
|
+
}
|
|
15453
15528
|
/**
|
|
15454
15529
|
* Load and parse a file.
|
|
15455
15530
|
*/
|
|
@@ -15484,11 +15559,14 @@ var Resolver = class {
|
|
|
15484
15559
|
return ast;
|
|
15485
15560
|
}
|
|
15486
15561
|
const parentPath = this.loader.resolveRef(ast.inherit.path, absPath);
|
|
15562
|
+
this.logger.verbose(`Resolving inherit: ${ast.inherit.path.raw}`);
|
|
15563
|
+
this.logger.verbose(` \u2192 ${parentPath}`);
|
|
15487
15564
|
try {
|
|
15488
15565
|
const parent = await this.resolve(parentPath);
|
|
15489
15566
|
sources.push(...parent.sources);
|
|
15490
15567
|
errors.push(...parent.errors);
|
|
15491
15568
|
if (parent.ast) {
|
|
15569
|
+
this.logger.debug(`Merging with parent AST`);
|
|
15492
15570
|
return resolveInheritance(parent.ast, ast);
|
|
15493
15571
|
}
|
|
15494
15572
|
} catch (err) {
|
|
@@ -15506,11 +15584,14 @@ var Resolver = class {
|
|
|
15506
15584
|
let result = ast;
|
|
15507
15585
|
for (const use of ast.uses) {
|
|
15508
15586
|
const importPath = this.loader.resolveRef(use.path, absPath);
|
|
15587
|
+
this.logger.verbose(`Resolving import: ${use.path.raw}`);
|
|
15588
|
+
this.logger.verbose(` \u2192 ${importPath}`);
|
|
15509
15589
|
try {
|
|
15510
15590
|
const imported = await this.resolve(importPath);
|
|
15511
15591
|
sources.push(...imported.sources);
|
|
15512
15592
|
errors.push(...imported.errors);
|
|
15513
15593
|
if (imported.ast) {
|
|
15594
|
+
this.logger.debug(`Merging import${use.alias ? ` as "${use.alias}"` : ""}`);
|
|
15514
15595
|
result = resolveUses(result, use, imported.ast);
|
|
15515
15596
|
}
|
|
15516
15597
|
} catch (err) {
|
|
@@ -16784,6 +16865,7 @@ var Validator = class {
|
|
|
16784
16865
|
rules;
|
|
16785
16866
|
config;
|
|
16786
16867
|
disabledRules;
|
|
16868
|
+
logger;
|
|
16787
16869
|
/**
|
|
16788
16870
|
* Create a new validator instance.
|
|
16789
16871
|
*
|
|
@@ -16793,11 +16875,13 @@ var Validator = class {
|
|
|
16793
16875
|
this.config = config;
|
|
16794
16876
|
this.rules = [...allRules];
|
|
16795
16877
|
this.disabledRules = new Set(config.disableRules ?? []);
|
|
16878
|
+
this.logger = config.logger ?? noopLogger;
|
|
16796
16879
|
if (config.customRules) {
|
|
16797
16880
|
for (const rule of config.customRules) {
|
|
16798
16881
|
this.rules.push(rule);
|
|
16799
16882
|
}
|
|
16800
16883
|
}
|
|
16884
|
+
this.logger.debug(`Validator initialized with ${this.rules.length} rules`);
|
|
16801
16885
|
}
|
|
16802
16886
|
/**
|
|
16803
16887
|
* Validate an AST.
|
|
@@ -16807,15 +16891,22 @@ var Validator = class {
|
|
|
16807
16891
|
*/
|
|
16808
16892
|
validate(ast) {
|
|
16809
16893
|
const messages = [];
|
|
16894
|
+
const activeRules = this.rules.filter(
|
|
16895
|
+
(r) => !this.disabledRules.has(r.name) && !this.disabledRules.has(r.id)
|
|
16896
|
+
);
|
|
16897
|
+
this.logger.verbose(`Running ${activeRules.length} validation rules`);
|
|
16810
16898
|
for (const rule of this.rules) {
|
|
16811
16899
|
if (this.disabledRules.has(rule.name) || this.disabledRules.has(rule.id)) {
|
|
16900
|
+
this.logger.debug(`Skipping disabled rule: ${rule.name}`);
|
|
16812
16901
|
continue;
|
|
16813
16902
|
}
|
|
16814
16903
|
const configuredSeverity = this.config.rules?.[rule.name];
|
|
16815
16904
|
const severity = configuredSeverity ?? rule.defaultSeverity;
|
|
16816
16905
|
if (severity === "off") {
|
|
16906
|
+
this.logger.debug(`Skipping off rule: ${rule.name}`);
|
|
16817
16907
|
continue;
|
|
16818
16908
|
}
|
|
16909
|
+
this.logger.debug(`Running rule: ${rule.name} (${severity})`);
|
|
16819
16910
|
const ctx = {
|
|
16820
16911
|
ast,
|
|
16821
16912
|
config: this.config,
|
|
@@ -16833,6 +16924,9 @@ var Validator = class {
|
|
|
16833
16924
|
const errors = messages.filter((m) => m.severity === "error");
|
|
16834
16925
|
const warnings = messages.filter((m) => m.severity === "warning");
|
|
16835
16926
|
const infos = messages.filter((m) => m.severity === "info");
|
|
16927
|
+
if (errors.length > 0 || warnings.length > 0) {
|
|
16928
|
+
this.logger.verbose(`Validation: ${errors.length} error(s), ${warnings.length} warning(s)`);
|
|
16929
|
+
}
|
|
16836
16930
|
return {
|
|
16837
16931
|
valid: errors.length === 0,
|
|
16838
16932
|
errors,
|
|
@@ -16878,16 +16972,52 @@ var Validator = class {
|
|
|
16878
16972
|
};
|
|
16879
16973
|
|
|
16880
16974
|
// packages/compiler/src/compiler.ts
|
|
16975
|
+
function generateMarker() {
|
|
16976
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
16977
|
+
return `<!-- PromptScript ${timestamp} - do not edit -->`;
|
|
16978
|
+
}
|
|
16979
|
+
function addMarkerToOutput(output) {
|
|
16980
|
+
const { content, path } = output;
|
|
16981
|
+
if (content.includes("<!-- PromptScript")) {
|
|
16982
|
+
return output;
|
|
16983
|
+
}
|
|
16984
|
+
const marker = generateMarker();
|
|
16985
|
+
if (!path.endsWith(".md") && !path.endsWith(".mdc")) {
|
|
16986
|
+
return output;
|
|
16987
|
+
}
|
|
16988
|
+
if (content.startsWith("---")) {
|
|
16989
|
+
const closingIndex = content.indexOf("---", 3);
|
|
16990
|
+
if (closingIndex !== -1) {
|
|
16991
|
+
const beforeMarker = content.slice(0, closingIndex + 3);
|
|
16992
|
+
const afterMarker = content.slice(closingIndex + 3);
|
|
16993
|
+
const newContent = `${beforeMarker}
|
|
16994
|
+
|
|
16995
|
+
${marker}
|
|
16996
|
+
${afterMarker.replace(/^\n+/, "\n")}`;
|
|
16997
|
+
return { ...output, content: newContent };
|
|
16998
|
+
}
|
|
16999
|
+
}
|
|
17000
|
+
const lines = content.split("\n");
|
|
17001
|
+
if (lines[0]?.startsWith("# ")) {
|
|
17002
|
+
lines.splice(1, 0, "", marker);
|
|
17003
|
+
} else {
|
|
17004
|
+
lines.unshift(marker, "");
|
|
17005
|
+
}
|
|
17006
|
+
return { ...output, content: lines.join("\n") };
|
|
17007
|
+
}
|
|
16881
17008
|
var Compiler = class _Compiler {
|
|
16882
17009
|
constructor(options) {
|
|
16883
17010
|
this.options = options;
|
|
16884
|
-
this.
|
|
16885
|
-
this.
|
|
17011
|
+
this.logger = options.logger ?? noopLogger;
|
|
17012
|
+
this.resolver = new Resolver({ ...options.resolver, logger: this.logger });
|
|
17013
|
+
this.validator = new Validator({ ...options.validator, logger: this.logger });
|
|
16886
17014
|
this.loadedFormatters = this.loadFormatters(options.formatters);
|
|
17015
|
+
this.logger.debug(`Compiler initialized with ${this.loadedFormatters.length} formatters`);
|
|
16887
17016
|
}
|
|
16888
17017
|
resolver;
|
|
16889
17018
|
validator;
|
|
16890
17019
|
loadedFormatters;
|
|
17020
|
+
logger;
|
|
16891
17021
|
/**
|
|
16892
17022
|
* Compile a PromptScript file through the full pipeline.
|
|
16893
17023
|
*
|
|
@@ -16895,6 +17025,10 @@ var Compiler = class _Compiler {
|
|
|
16895
17025
|
* @returns Compilation result with outputs, errors, and stats
|
|
16896
17026
|
*/
|
|
16897
17027
|
async compile(entryPath) {
|
|
17028
|
+
this.logger.verbose(`Entry: ${entryPath}`);
|
|
17029
|
+
this.logger.verbose(
|
|
17030
|
+
`Targets: ${this.loadedFormatters.map((f) => f.formatter.name).join(", ")}`
|
|
17031
|
+
);
|
|
16898
17032
|
const startTotal = Date.now();
|
|
16899
17033
|
const stats = {
|
|
16900
17034
|
resolveTime: 0,
|
|
@@ -16902,6 +17036,7 @@ var Compiler = class _Compiler {
|
|
|
16902
17036
|
formatTime: 0,
|
|
16903
17037
|
totalTime: 0
|
|
16904
17038
|
};
|
|
17039
|
+
this.logger.verbose("=== Stage 1: Resolve ===");
|
|
16905
17040
|
const startResolve = Date.now();
|
|
16906
17041
|
let resolved;
|
|
16907
17042
|
try {
|
|
@@ -16909,6 +17044,7 @@ var Compiler = class _Compiler {
|
|
|
16909
17044
|
} catch (err) {
|
|
16910
17045
|
stats.resolveTime = Date.now() - startResolve;
|
|
16911
17046
|
stats.totalTime = Date.now() - startTotal;
|
|
17047
|
+
this.logger.verbose(`Resolve failed (${stats.resolveTime}ms)`);
|
|
16912
17048
|
return {
|
|
16913
17049
|
success: false,
|
|
16914
17050
|
outputs: /* @__PURE__ */ new Map(),
|
|
@@ -16918,6 +17054,7 @@ var Compiler = class _Compiler {
|
|
|
16918
17054
|
};
|
|
16919
17055
|
}
|
|
16920
17056
|
stats.resolveTime = Date.now() - startResolve;
|
|
17057
|
+
this.logger.verbose(`Resolve completed (${stats.resolveTime}ms)`);
|
|
16921
17058
|
if (resolved.errors.length > 0 || !resolved.ast) {
|
|
16922
17059
|
stats.totalTime = Date.now() - startTotal;
|
|
16923
17060
|
return {
|
|
@@ -16928,9 +17065,11 @@ var Compiler = class _Compiler {
|
|
|
16928
17065
|
stats
|
|
16929
17066
|
};
|
|
16930
17067
|
}
|
|
17068
|
+
this.logger.verbose("=== Stage 2: Validate ===");
|
|
16931
17069
|
const startValidate = Date.now();
|
|
16932
17070
|
const validation = this.validator.validate(resolved.ast);
|
|
16933
17071
|
stats.validateTime = Date.now() - startValidate;
|
|
17072
|
+
this.logger.verbose(`Validate completed (${stats.validateTime}ms)`);
|
|
16934
17073
|
if (!validation.valid) {
|
|
16935
17074
|
stats.totalTime = Date.now() - startTotal;
|
|
16936
17075
|
return {
|
|
@@ -16941,17 +17080,24 @@ var Compiler = class _Compiler {
|
|
|
16941
17080
|
stats
|
|
16942
17081
|
};
|
|
16943
17082
|
}
|
|
17083
|
+
this.logger.verbose("=== Stage 3: Format ===");
|
|
16944
17084
|
const startFormat = Date.now();
|
|
16945
17085
|
const outputs = /* @__PURE__ */ new Map();
|
|
16946
17086
|
const formatErrors = [];
|
|
16947
17087
|
for (const { formatter, config } of this.loadedFormatters) {
|
|
17088
|
+
const formatterStart = Date.now();
|
|
17089
|
+
this.logger.verbose(`Formatting for ${formatter.name}`);
|
|
16948
17090
|
try {
|
|
16949
17091
|
const formatOptions = this.getFormatOptionsForTarget(formatter.name, config);
|
|
17092
|
+
this.logger.debug(` Convention: ${formatOptions.convention ?? "default"}`);
|
|
16950
17093
|
const output = formatter.format(resolved.ast, formatOptions);
|
|
16951
|
-
|
|
17094
|
+
const formatterTime = Date.now() - formatterStart;
|
|
17095
|
+
this.logger.verbose(` \u2192 ${output.path} (${formatterTime}ms)`);
|
|
17096
|
+
outputs.set(output.path, addMarkerToOutput(output));
|
|
16952
17097
|
if (output.additionalFiles) {
|
|
16953
17098
|
for (const additionalFile of output.additionalFiles) {
|
|
16954
|
-
|
|
17099
|
+
this.logger.verbose(` \u2192 ${additionalFile.path} (additional)`);
|
|
17100
|
+
outputs.set(additionalFile.path, addMarkerToOutput(additionalFile));
|
|
16955
17101
|
}
|
|
16956
17102
|
}
|
|
16957
17103
|
} catch (err) {
|
|
@@ -16964,6 +17110,7 @@ var Compiler = class _Compiler {
|
|
|
16964
17110
|
}
|
|
16965
17111
|
stats.formatTime = Date.now() - startFormat;
|
|
16966
17112
|
stats.totalTime = Date.now() - startTotal;
|
|
17113
|
+
this.logger.verbose(`Format completed (${stats.formatTime}ms)`);
|
|
16967
17114
|
if (formatErrors.length > 0) {
|
|
16968
17115
|
return {
|
|
16969
17116
|
success: false,
|
|
@@ -17257,7 +17404,26 @@ function createPager(enabled = true) {
|
|
|
17257
17404
|
}
|
|
17258
17405
|
|
|
17259
17406
|
// packages/cli/src/commands/compile.ts
|
|
17260
|
-
var
|
|
17407
|
+
var PROMPTSCRIPT_MARKERS = [
|
|
17408
|
+
"<!-- PromptScript",
|
|
17409
|
+
// Current marker (HTML comment with date)
|
|
17410
|
+
"> Auto-generated by PromptScript"
|
|
17411
|
+
// Legacy - for backwards compatibility
|
|
17412
|
+
];
|
|
17413
|
+
function createCliLogger() {
|
|
17414
|
+
return {
|
|
17415
|
+
verbose: (message) => {
|
|
17416
|
+
if (isVerbose() || isDebug()) {
|
|
17417
|
+
ConsoleOutput.verbose(message);
|
|
17418
|
+
}
|
|
17419
|
+
},
|
|
17420
|
+
debug: (message) => {
|
|
17421
|
+
if (isDebug()) {
|
|
17422
|
+
ConsoleOutput.debug(message);
|
|
17423
|
+
}
|
|
17424
|
+
}
|
|
17425
|
+
};
|
|
17426
|
+
}
|
|
17261
17427
|
function parseTargets(targets) {
|
|
17262
17428
|
return targets.map((entry) => {
|
|
17263
17429
|
if (typeof entry === "string") {
|
|
@@ -17271,11 +17437,11 @@ function parseTargets(targets) {
|
|
|
17271
17437
|
return { name, config };
|
|
17272
17438
|
}).filter((target) => target.config?.enabled !== false);
|
|
17273
17439
|
}
|
|
17274
|
-
async function
|
|
17440
|
+
async function isPromptScriptGenerated2(filePath) {
|
|
17275
17441
|
try {
|
|
17276
17442
|
const content = await readFile6(filePath, "utf-8");
|
|
17277
|
-
const lines = content.split("\n").slice(0,
|
|
17278
|
-
return lines.some((line) => line.includes(
|
|
17443
|
+
const lines = content.split("\n").slice(0, 20);
|
|
17444
|
+
return lines.some((line) => PROMPTSCRIPT_MARKERS.some((marker) => line.includes(marker)));
|
|
17279
17445
|
} catch {
|
|
17280
17446
|
return false;
|
|
17281
17447
|
}
|
|
@@ -17310,7 +17476,7 @@ async function writeOutputs(outputs, options, _config, services) {
|
|
|
17310
17476
|
const fileExists2 = existsSync7(outputPath);
|
|
17311
17477
|
if (options.dryRun) {
|
|
17312
17478
|
if (fileExists2) {
|
|
17313
|
-
const isGenerated2 = await
|
|
17479
|
+
const isGenerated2 = await isPromptScriptGenerated2(outputPath);
|
|
17314
17480
|
if (isGenerated2) {
|
|
17315
17481
|
ConsoleOutput.dryRun(`Would overwrite: ${outputPath}`);
|
|
17316
17482
|
} else {
|
|
@@ -17329,7 +17495,7 @@ async function writeOutputs(outputs, options, _config, services) {
|
|
|
17329
17495
|
result.written.push(outputPath);
|
|
17330
17496
|
continue;
|
|
17331
17497
|
}
|
|
17332
|
-
const isGenerated = await
|
|
17498
|
+
const isGenerated = await isPromptScriptGenerated2(outputPath);
|
|
17333
17499
|
if (isGenerated) {
|
|
17334
17500
|
await mkdir2(dirname5(outputPath), { recursive: true });
|
|
17335
17501
|
await writeFile2(outputPath, output.content, "utf-8");
|
|
@@ -17397,12 +17563,16 @@ function printWarnings(warnings) {
|
|
|
17397
17563
|
}
|
|
17398
17564
|
async function compileCommand(options, services = createDefaultServices()) {
|
|
17399
17565
|
const spinner = createSpinner("Loading configuration...").start();
|
|
17566
|
+
const logger = createCliLogger();
|
|
17400
17567
|
try {
|
|
17568
|
+
logger.verbose("Loading configuration...");
|
|
17401
17569
|
const config = await loadConfig(options.config);
|
|
17402
17570
|
spinner.text = "Compiling...";
|
|
17403
17571
|
const selectedTarget = options.target ?? options.format;
|
|
17404
17572
|
const targets = selectedTarget ? [{ name: selectedTarget }] : parseTargets(config.targets);
|
|
17405
17573
|
const registryPath = options.registry ?? config.registry?.path ?? "./registry";
|
|
17574
|
+
logger.verbose(`Registry: ${registryPath}`);
|
|
17575
|
+
logger.debug(`Config: ${JSON.stringify(config, null, 2)}`);
|
|
17406
17576
|
const prettierOptions = await resolvePrettierOptions(config, process.cwd());
|
|
17407
17577
|
const compiler = new Compiler({
|
|
17408
17578
|
resolver: {
|
|
@@ -17412,7 +17582,8 @@ async function compileCommand(options, services = createDefaultServices()) {
|
|
|
17412
17582
|
validator: config.validation,
|
|
17413
17583
|
formatters: targets,
|
|
17414
17584
|
customConventions: config.customConventions,
|
|
17415
|
-
prettier: prettierOptions
|
|
17585
|
+
prettier: prettierOptions,
|
|
17586
|
+
logger
|
|
17416
17587
|
});
|
|
17417
17588
|
const entryPath = resolve4("./.promptscript/project.prs");
|
|
17418
17589
|
if (!existsSync7(entryPath)) {
|
|
@@ -18061,19 +18232,23 @@ function printResults(results) {
|
|
|
18061
18232
|
var __filename2 = fileURLToPath2(import.meta.url);
|
|
18062
18233
|
var __dirname2 = dirname7(__filename2);
|
|
18063
18234
|
var program = new Command();
|
|
18064
|
-
program.name("prs").description("PromptScript CLI - Standardize AI instructions").version(getPackageVersion(__dirname2, "./package.json")).option("--verbose", "Enable verbose output").option("--quiet", "Suppress non-error output").hook("preAction", (thisCommand) => {
|
|
18235
|
+
program.name("prs").description("PromptScript CLI - Standardize AI instructions").version(getPackageVersion(__dirname2, "./package.json")).option("--verbose", "Enable verbose output").option("--debug", "Enable debug output (includes verbose)").option("--quiet", "Suppress non-error output").hook("preAction", (thisCommand) => {
|
|
18065
18236
|
const opts = thisCommand.opts();
|
|
18066
18237
|
if (opts["quiet"]) {
|
|
18067
18238
|
setContext({ logLevel: 0 /* Quiet */ });
|
|
18239
|
+
} else if (opts["debug"]) {
|
|
18240
|
+
setContext({ logLevel: 3 /* Debug */ });
|
|
18068
18241
|
} else if (opts["verbose"]) {
|
|
18069
18242
|
setContext({ logLevel: 2 /* Verbose */ });
|
|
18070
18243
|
}
|
|
18071
|
-
if (process.env["
|
|
18244
|
+
if (process.env["PROMPTSCRIPT_DEBUG"] === "1" || process.env["PROMPTSCRIPT_DEBUG"] === "true") {
|
|
18245
|
+
setContext({ logLevel: 3 /* Debug */ });
|
|
18246
|
+
} else if (process.env["PROMPTSCRIPT_VERBOSE"] === "1" || process.env["PROMPTSCRIPT_VERBOSE"] === "true") {
|
|
18072
18247
|
setContext({ logLevel: 2 /* Verbose */ });
|
|
18073
18248
|
}
|
|
18074
18249
|
});
|
|
18075
18250
|
program.command("init").description("Initialize PromptScript in current directory").option("-n, --name <name>", "Project name (auto-detected from package.json, etc.)").option("-t, --team <team>", "Team namespace").option("--inherit <path>", "Inheritance path (e.g., @company/team)").option("--registry <path>", "Registry path").option("--targets <targets...>", "Target AI tools (github, claude, cursor)").option("-i, --interactive", "Force interactive mode").option("-y, --yes", "Skip prompts, use defaults").option("-f, --force", "Force reinitialize even if already initialized").action((opts) => initCommand(opts));
|
|
18076
|
-
program.command("compile").description("Compile PromptScript to target formats").option("-t, --target <target>", "Specific target (github, claude, cursor)").option("-f, --format <format>", "Output format (alias for --target)").option("-a, --all", "All configured targets", true).option("-w, --watch", "Watch mode").option("-o, --output <dir>", "Output directory").option("--dry-run", "Preview changes").option("--registry <path>", "Registry path (overrides config)").option("-c, --config <path>", "Path to custom config file").option("--force", "Force overwrite existing files without prompts").action(compileCommand);
|
|
18251
|
+
program.command("compile").description("Compile PromptScript to target formats").option("-t, --target <target>", "Specific target (github, claude, cursor)").option("-f, --format <format>", "Output format (alias for --target)").option("-a, --all", "All configured targets", true).option("-w, --watch", "Watch mode").option("-o, --output <dir>", "Output directory").option("--dry-run", "Preview changes").option("--registry <path>", "Registry path (overrides config)").option("-c, --config <path>", "Path to custom config file").option("--force", "Force overwrite existing files without prompts").action((opts) => compileCommand(opts));
|
|
18077
18252
|
program.command("validate").description("Validate PromptScript files").option("--strict", "Treat warnings as errors").option("--format <format>", "Output format (text, json)", "text").action(validateCommand);
|
|
18078
18253
|
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);
|
|
18079
18254
|
program.command("diff").description("Show diff for compiled output").option("-t, --target <target>", "Specific target").option("-a, --all", "Show diff for all targets at once").option("--full", "Show full diff without truncation").option("--no-pager", "Disable pager output").option("--color", "Force colored output").option("--no-color", "Disable colored output").action(diffCommand);
|
package/package.json
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptscript/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"description": "CLI for PromptScript - standardize AI instructions across GitHub Copilot, Claude, Cursor and other AI tools",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cli",
|
|
7
|
+
"enterprise",
|
|
8
|
+
"typescript",
|
|
9
|
+
"devtools",
|
|
10
|
+
"infrastructure-as-code",
|
|
11
|
+
"cursor",
|
|
12
|
+
"developer-experience",
|
|
13
|
+
"governance",
|
|
14
|
+
"claude",
|
|
15
|
+
"ai-tools",
|
|
16
|
+
"github-copilot",
|
|
17
|
+
"llm",
|
|
18
|
+
"prompt-engineering",
|
|
19
|
+
"promptscript",
|
|
20
|
+
"antigravity",
|
|
21
|
+
"promptops"
|
|
22
|
+
],
|
|
5
23
|
"repository": {
|
|
6
24
|
"type": "git",
|
|
7
25
|
"url": "https://github.com/mrwogu/promptscript.git",
|
|
8
26
|
"directory": "packages/cli"
|
|
9
27
|
},
|
|
28
|
+
"license": "MIT",
|
|
10
29
|
"publishConfig": {
|
|
11
30
|
"access": "public"
|
|
12
31
|
},
|
|
13
32
|
"type": "module",
|
|
14
33
|
"main": "./index.js",
|
|
34
|
+
"types": "./src/index.d.ts",
|
|
15
35
|
"bin": {
|
|
16
36
|
"prs": "./bin/prs.js",
|
|
17
37
|
"promptscript": "./bin/prs.js"
|
|
18
38
|
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18"
|
|
41
|
+
},
|
|
19
42
|
"dependencies": {
|
|
20
43
|
"@inquirer/prompts": "^8.2.0",
|
|
21
44
|
"chalk": "^5.6.2",
|
|
22
45
|
"chokidar": "^5.0.0",
|
|
23
46
|
"commander": "^14.0.2",
|
|
24
47
|
"ora": "^9.0.0",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
}
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=18"
|
|
30
|
-
},
|
|
31
|
-
"keywords": [
|
|
32
|
-
"cli",
|
|
33
|
-
"enterprise",
|
|
34
|
-
"typescript",
|
|
35
|
-
"devtools",
|
|
36
|
-
"infrastructure-as-code",
|
|
37
|
-
"cursor",
|
|
38
|
-
"developer-experience",
|
|
39
|
-
"governance",
|
|
40
|
-
"claude",
|
|
41
|
-
"ai-tools",
|
|
42
|
-
"github-copilot",
|
|
43
|
-
"llm",
|
|
44
|
-
"prompt-engineering",
|
|
45
|
-
"promptscript",
|
|
46
|
-
"antigravity",
|
|
47
|
-
"promptops"
|
|
48
|
-
],
|
|
49
|
-
"license": "MIT"
|
|
48
|
+
"yaml": "^2.8.2",
|
|
49
|
+
"simple-git": "^3.22.0"
|
|
50
|
+
}
|
|
50
51
|
}
|
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":";AA6GA;;;GAGG;AACH,wBAAgB,GAAG,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,IAAI,CAEvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/compile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/compile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAqPzE;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,cAAc,EACvB,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAkFf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/init.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAKzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/init.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAKzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA2B/C;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,WAAW,EACpB,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAkGf"}
|
package/src/output/console.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export declare enum LogLevel {
|
|
|
8
8
|
/** Normal output (default) */
|
|
9
9
|
Normal = 1,
|
|
10
10
|
/** Verbose output with additional details */
|
|
11
|
-
Verbose = 2
|
|
11
|
+
Verbose = 2,
|
|
12
|
+
/** Debug output with maximum details */
|
|
13
|
+
Debug = 3
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Global CLI context for sharing state across commands.
|
|
@@ -35,6 +37,10 @@ export declare function isVerbose(): boolean;
|
|
|
35
37
|
* Check if quiet mode is enabled.
|
|
36
38
|
*/
|
|
37
39
|
export declare function isQuiet(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Check if debug logging is enabled.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isDebug(): boolean;
|
|
38
44
|
/**
|
|
39
45
|
* Creates a spinner for async operations.
|
|
40
46
|
* Returns a no-op spinner in quiet mode.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/output/console.ts"],"names":[],"mappings":"AACA,OAAY,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAEpC;;GAEG;AACH,oBAAY,QAAQ;IAClB,wCAAwC;IACxC,KAAK,IAAI;IACT,8BAA8B;IAC9B,MAAM,IAAI;IACV,6CAA6C;IAC7C,OAAO,IAAI;
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/output/console.ts"],"names":[],"mappings":"AACA,OAAY,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAEpC;;GAEG;AACH,oBAAY,QAAQ;IAClB,wCAAwC;IACxC,KAAK,IAAI;IACT,8BAA8B;IAC9B,MAAM,IAAI;IACV,6CAA6C;IAC7C,OAAO,IAAI;IACX,wCAAwC;IACxC,KAAK,IAAI;CACV;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,wBAAwB;IACxB,QAAQ,EAAE,QAAQ,CAAC;IACnB,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;CACjB;AAUD;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAE7D;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,UAAU,CAEvC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED;;GAEG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAEjC;AAED;;GAEG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAEjC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAQ/C;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;qBACc,MAAM,GAAG,IAAI;IAK9B;;;OAGG;mBACY,MAAM,GAAG,IAAI;IAI5B;;OAEG;qBACc,MAAM,GAAG,IAAI;IAK9B;;OAEG;kBACW,MAAM,GAAG,IAAI;IAK3B;;OAEG;qBACc,MAAM,GAAG,IAAI;IAK9B;;OAEG;kBACW,MAAM,GAAG,IAAI;IAK3B;;OAEG;mBACY,MAAM,GAAG,IAAI;IAK5B;;OAEG;qBACc,MAAM,GAAG,IAAI;IAK9B;;OAEG;mBACY,MAAM,GAAG,IAAI;IAK5B;;OAEG;oBACa,MAAM,GAAG,IAAI;IAK7B;;OAEG;eACQ,IAAI;IAKf;;OAEG;oBACa,MAAM,GAAG,IAAI;IAK7B;;OAEG;mBACY,MAAM,GAAG,IAAI;IAK5B;;OAEG;qBACc,MAAM,GAAG,MAAM;IAIhC;;OAEG;yBACkB,MAAM,SAAS,MAAM,WAAW,MAAM,GAAG,MAAM;CAUrE,CAAC"}
|
|
@@ -11,6 +11,8 @@ export interface AIToolsDetection {
|
|
|
11
11
|
detected: AIToolTarget[];
|
|
12
12
|
/** Details about detected files */
|
|
13
13
|
details: Record<AIToolTarget, string[]>;
|
|
14
|
+
/** Files that exist but were NOT generated by PromptScript (candidates for migration) */
|
|
15
|
+
migrationCandidates: string[];
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* Detect existing AI tool configurations.
|
|
@@ -29,4 +31,12 @@ export declare function getSuggestedTargets(detection: AIToolsDetection): AITool
|
|
|
29
31
|
* Format detection results for display.
|
|
30
32
|
*/
|
|
31
33
|
export declare function formatDetectionResults(detection: AIToolsDetection): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Check if there are migration candidates (non-PromptScript instruction files).
|
|
36
|
+
*/
|
|
37
|
+
export declare function hasMigrationCandidates(detection: AIToolsDetection): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Format migration hint for display.
|
|
40
|
+
*/
|
|
41
|
+
export declare function formatMigrationHint(detection: AIToolsDetection): string[];
|
|
32
42
|
//# sourceMappingURL=ai-tools-detector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tools-detector.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/ai-tools-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ai-tools-detector.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/ai-tools-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IACxC,yFAAyF;IACzF,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAgFD;;GAEG;AACH,wBAAsB,aAAa,CACjC,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,gBAAgB,CAAC,CA4C3B;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAE9C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAE/E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAgB5E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAE3E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAiBzE"}
|
package/package.publish.json
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@promptscript/cli",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"description": "CLI for PromptScript - standardize AI instructions across GitHub Copilot, Claude, Cursor and other AI tools",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "https://github.com/mrwogu/promptscript.git",
|
|
8
|
-
"directory": "packages/cli"
|
|
9
|
-
},
|
|
10
|
-
"publishConfig": {
|
|
11
|
-
"access": "public"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"main": "./index.js",
|
|
15
|
-
"bin": {
|
|
16
|
-
"prs": "./bin/prs.js",
|
|
17
|
-
"promptscript": "./bin/prs.js"
|
|
18
|
-
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"@inquirer/prompts": "^8.2.0",
|
|
21
|
-
"chalk": "^5.6.2",
|
|
22
|
-
"chokidar": "^5.0.0",
|
|
23
|
-
"commander": "^14.0.2",
|
|
24
|
-
"ora": "^9.0.0",
|
|
25
|
-
"simple-git": "^3.22.0",
|
|
26
|
-
"yaml": "^2.8.2"
|
|
27
|
-
},
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=18"
|
|
30
|
-
},
|
|
31
|
-
"keywords": [
|
|
32
|
-
"cli",
|
|
33
|
-
"enterprise",
|
|
34
|
-
"typescript",
|
|
35
|
-
"devtools",
|
|
36
|
-
"infrastructure-as-code",
|
|
37
|
-
"cursor",
|
|
38
|
-
"developer-experience",
|
|
39
|
-
"governance",
|
|
40
|
-
"claude",
|
|
41
|
-
"ai-tools",
|
|
42
|
-
"github-copilot",
|
|
43
|
-
"llm",
|
|
44
|
-
"prompt-engineering",
|
|
45
|
-
"promptscript",
|
|
46
|
-
"antigravity",
|
|
47
|
-
"promptops"
|
|
48
|
-
],
|
|
49
|
-
"license": "MIT"
|
|
50
|
-
}
|