@hasna/switcher 0.2.19 → 0.2.21

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.
@@ -19,11 +19,17 @@ export type GatewayInput = HarnessLaunchInput & {
19
19
  onRoutingEvent?: (event: RoutingEvent) => void;
20
20
  };
21
21
  /** A started gateway endpoint as a native harness sees it. */
22
+ /**
23
+ * routeSettingsFile: set when the gateway keeps serving this token to a session of this user
24
+ * after the launch ends and across restarts (a durable route). The harness writes the route
25
+ * into that file, which the gateway removes or empties when it stops accepting the token.
26
+ */
22
27
  export type GatewayLease = {
23
28
  baseUrl: string;
24
29
  token: string;
25
30
  cleanup: () => Promise<void>;
26
31
  retainsState?: () => boolean;
32
+ routeSettingsFile?: string;
27
33
  };
28
34
  /** Where a launch's inference gateway runs: its own listener, or a persistent service. */
29
35
  export type GatewayHost = {
@@ -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>;