@promptscript/cli 1.14.2 → 1.16.0

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.
@@ -2,6 +2,8 @@ import type { FormatterOutput } from '@promptscript/compiler';
2
2
  export interface ManagedOutputCleanupResult {
3
3
  /** Obsolete files removed, or that would be removed in dry-run mode */
4
4
  removed: string[];
5
+ /** Managed directories pruned because they became empty */
6
+ removedDirectories: string[];
5
7
  }
6
8
  export interface ManagedOutputCleanupOptions {
7
9
  /** Absolute base directory used to resolve formatter output paths */
@@ -20,11 +22,25 @@ interface FileIdentity {
20
22
  * symlinks and file symlinks are skipped, and unmarked files are preserved.
21
23
  */
22
24
  export declare function cleanupManagedOutputs(outputs: Map<string, FormatterOutput>, options: ManagedOutputCleanupOptions): Promise<ManagedOutputCleanupResult>;
25
+ export declare function rewriteHookOutputIfUnchanged(file: string, outputRoot: string, expectedContent: string, content: string): Promise<boolean>;
26
+ export declare function createHookOutputSafely(file: string, outputRoot: string, content: string, mode?: number): Promise<boolean>;
27
+ export declare function removeHookOutputIfUnchanged(file: string, outputRoot: string, expectedContent: string): Promise<boolean>;
23
28
  /**
24
29
  * Remove a file only when it is still a regular (non-symlink) file whose device
25
30
  * and inode match the previously observed identity. Used as an in-process
26
31
  * fallback when a child process cannot perform the cwd-relative guarded unlink.
27
32
  */
28
33
  export declare function removeIfUnchanged(entryPath: string, fileStat: FileIdentity): Promise<boolean>;
34
+ export declare function hasOnlyOwnedHookCommands(content: string): boolean;
35
+ export declare function isPromptScriptOwnedHookOutput(path: string, content: string): boolean;
36
+ export declare function isHookOutputPath(path: string): boolean;
37
+ export declare function mergePromptScriptHookOutput(path: string, existingContent: string, generatedContent: string): string | undefined;
38
+ export interface RemovedOwnedHooks {
39
+ content: string;
40
+ empty: boolean;
41
+ }
42
+ export declare function removePromptScriptOwnedCodexHooks(path: string, content: string): RemovedOwnedHooks | undefined;
43
+ export declare function mergePromptScriptCodexConfig(existingContent: string, generatedContent: string): string | undefined;
44
+ export declare function removePromptScriptOwnedHooks(path: string, content: string): RemovedOwnedHooks | undefined;
29
45
  export {};
30
46
  //# sourceMappingURL=managed-output-cleanup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"managed-output-cleanup.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/managed-output-cleanup.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AA2C9D,MAAM,WAAW,0BAA0B;IACzC,uEAAuE;IACvE,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,2BAA2B;IAC1C,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAOD,UAAU,YAAY;IACpB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,EACrC,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,0BAA0B,CAAC,CAuBrC;AA0HD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,OAAO,CAAC,CAclB"}
1
+ {"version":3,"file":"managed-output-cleanup.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/managed-output-cleanup.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAyO9D,MAAM,WAAW,0BAA0B;IACzC,uEAAuE;IACvE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2DAA2D;IAC3D,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,2BAA2B;IAC1C,qE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gB,EAAE,MAAM,GACvB,MAAM,GAAG,SAAS,CAiCpB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,iBAAiB,GAAG,SAAS,CA4C/B;AAED,wBAAgB,4BAA4B,CAC1C,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,MAAM,GACvB,MAAM,GAAG,SAAS,CAkBpB;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,iBAAiB,GAAG,SAAS,CA8B/B"}
@@ -2,15 +2,8 @@
2
2
  * PromptScript generation marker utilities.
3
3
  *
4
4
  * Markers are added to compiled output files so the compiler can identify
5
- * files it previously generated. These utilities strip markers before
6
- * content comparison to avoid false diffs from timestamp-only changes.
5
+ * files it previously generated. Stripping them before content comparison
6
+ * avoids false diffs from timestamp-only changes.
7
7
  */
8
- /**
9
- * Strip PromptScript generation markers from content for comparison purposes.
10
- * This allows comparing actual content changes while ignoring timestamp updates.
11
- *
12
- * Regex literals are inlined to avoid stateful module-level RegExp objects
13
- * with the `g` flag (which maintain a `lastIndex` cursor between calls).
14
- */
15
- export declare function stripMarkers(content: string): string;
8
+ export { stripPromptScriptMarkers as stripMarkers } from '@promptscript/core';
16
9
  //# sourceMappingURL=markers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/markers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIpD"}
1
+ {"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/markers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,wBAAwB,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC"}