@hasna/switcher 0.2.18 → 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.
@@ -33,11 +33,13 @@ export type InferenceHandlerOptions = {
33
33
  /** Resolve the provider credential when a request needs it; replaces input.credential. */
34
34
  credential?: () => Promise<string | undefined>;
35
35
  };
36
+ /** close aborts requests in flight; drain refuses new ones and lets those in flight finish. */
36
37
  export type InferenceHandler = {
37
38
  bodyLimit: number;
38
39
  closing: () => boolean;
39
40
  handle: (request: Request, server: Bun.Server<unknown>) => Promise<Response>;
40
41
  close: () => Promise<void>;
42
+ drain: () => Promise<void>;
41
43
  };
42
44
  export declare const MAX_REQUEST_BODY_BYTES: number;
43
45
  /** A launch's credential boundary and model policy, independent of the listener that serves it. */
@@ -67,4 +67,38 @@ export declare function prepareOriForPlan(plan: LaunchPlan, options: OriPreparat
67
67
  contract: OriContract;
68
68
  prepared: PreparedLaunch;
69
69
  }>;
70
+ /** The private home a shared native-state launch runs in, and the environment
71
+ * its Claude user settings are read with. The launch and its dry run share it. */
72
+ export declare function sharedNativeHome(state: NativeState, root: string, profileId: string, environment?: NodeJS.ProcessEnv): Promise<{
73
+ home: string;
74
+ settingsEnvironment: NodeJS.ProcessEnv;
75
+ }>;
76
+ export declare function launchSessionDirectory(root: string, harness: string, profileId: string): string;
77
+ /** The native-state refusals a direct shared launch makes before its harness
78
+ * starts, in the same order and with nothing written; it returns the launch's
79
+ * native-state warnings. A missing state root, corpus or overlay counts as the
80
+ * empty directory the launch would create. */
81
+ export declare function checkSharedNativeLaunch(state: NativeState, root: string, profileId: string, options?: {
82
+ desktop?: boolean;
83
+ }): Promise<string[]>;
84
+ /** The home an isolated (--no-share-native-state) direct launch keeps its
85
+ * native state in. The launch checks every such home for isolation and makes a
86
+ * CLI launch's home private; a desktop launch's home is only checked. */
87
+ export declare function isolatedNativeHome(tool: "codex" | "claude", root: string, profileId: string, options?: {
88
+ desktop?: boolean;
89
+ claudeDesktop?: boolean;
90
+ }, environment?: NodeJS.ProcessEnv): {
91
+ home: string;
92
+ private: boolean;
93
+ };
94
+ /** What a direct launch refuses before its harness starts in the state root,
95
+ * the shared or isolated native state and the Claude settings folder, in
96
+ * launch order and with nothing written. It returns the launch's native-state
97
+ * warnings. */
98
+ export declare function checkDirectLaunch(root: string, profileId: string, harness: string, options?: {
99
+ sharedState?: NativeState;
100
+ isolated?: boolean;
101
+ desktop?: boolean;
102
+ claudeDesktop?: boolean;
103
+ }): Promise<string[]>;
70
104
  export declare function launch(client: SwitcherClient, profileId: string, options?: LaunchOptions): Promise<number>;