@hasna/switcher 0.2.19 → 0.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,7 +65,9 @@ export declare function setOwnerProbeForTesting(probe?: OwnerProbe): void;
65
65
  export declare function assertCorpusLink(link: string, root: string): Promise<void>;
66
66
  /** A nested CLI keeps its authentication home. Refuse conflicting instruction
67
67
  * overlays rather than rewriting account config or exposing instructions in argv. */
68
- export declare function assertNativeInstructionOverlay(state: NativeState, overlayHome: string): Promise<void>;
68
+ export declare function assertNativeInstructionOverlay(state: NativeState, overlayHome: string, options?: {
69
+ plan?: boolean;
70
+ }): Promise<void>;
69
71
  /** This marker identifies the corpus, never the selected authentication home. */
70
72
  export declare function resolveNativeState(tool: SharedNativeTool, environment?: NodeJS.ProcessEnv, options?: {
71
73
  create?: boolean;
@@ -74,5 +76,13 @@ export declare function nativeStateEnvironment(state: NativeState): Record<strin
74
76
  /** Metadata only. Old data remains visible as pending migration; normal launch
75
77
  * never treats starting a fresh shared overlay as completed legacy migration. */
76
78
  export declare function legacyNativeStateWarnings(root: string, state: NativeState): Promise<string[]>;
79
+ /** A directory a launch would create with mode 0700: the nearest existing
80
+ * ancestor must sit on a path with no symbolic link, under safe ancestors,
81
+ * which is what assertNativeStateDirectory checks once it exists. */
82
+ export declare function assertCreatableNativeStateDirectory(path: string): Promise<void>;
77
83
  export declare function projectNativeState(state: NativeState, overlayHome: string): Promise<void>;
84
+ /** The refusals projectNativeState would make, for a dry run, including an
85
+ * existing lock (held, stale or unsafe). It takes no lock and writes nothing,
86
+ * so a concurrent launch can still change the result. */
87
+ export declare function checkNativeStateProjection(state: NativeState, overlayHome: string): Promise<void>;
78
88
  export {};
@@ -1,2 +1,5 @@
1
1
  /** Filesystem policy shared by native adapters and the CLI runtime. */
2
2
  export declare function privateDirectory(path: string): Promise<void>;
3
+ /** The same policy without creating anything: a missing directory passes,
4
+ * because privateDirectory would create it with mode 0700. */
5
+ export declare function checkPrivateDirectory(path: string): Promise<void>;
package/dist/runtime.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { SwitcherClient } from "./sdk";
2
2
  import type { CatalogCredentialResolver } from "./catalog";
3
- export { privateDirectory } from "./private-directory";
3
+ export { checkPrivateDirectory, privateDirectory } from "./private-directory";
4
4
  /** The refusal code when no Switcher API credential is configured and the local opt-in is not set. */
5
5
  export declare const REMOTE_API_CONFIG_MISSING = "remote_api_config_missing";
6
6
  export declare function switcherHome(env?: NodeJS.ProcessEnv): string;