@promptscript/cli 1.15.0 → 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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