@hasna/switcher 0.2.11 → 0.2.13
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.
- package/dist/claude-desktop-gateway.d.ts +33 -0
- package/dist/claude-desktop-launch.d.ts +2 -3
- package/dist/claude-desktop-models.d.ts +2 -0
- package/dist/claude-desktop.d.ts +6 -0
- package/dist/claude-desktop.js +5368 -0
- package/dist/cli/index.js +763 -192
- package/dist/desktop-apps.d.ts +3 -0
- package/dist/desktop-selection.d.ts +20 -0
- package/dist/desktop-state.d.ts +30 -1
- package/dist/index.js +5362 -86
- package/dist/mcp/index.js +6315 -368
- package/dist/native-state.d.ts +2 -0
- package/dist/private-directory.d.ts +2 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/sdk.js +5362 -86
- package/dist/serve/index.js +2 -2
- package/docs/CLAUDE-DESKTOP-GATEWAY.md +84 -0
- package/hasna.contract.json +1 -1
- package/openapi.json +1 -1
- package/package.json +9 -4
package/dist/desktop-apps.d.ts
CHANGED
|
@@ -23,3 +23,6 @@ export declare function detectChatGPTApp(appPath?: string, system?: DesktopHost)
|
|
|
23
23
|
/** Claude Desktop's supported third-party gateway mode uses its own Claude-3p
|
|
24
24
|
* data directory. Do not use restricted Electron development overrides. */
|
|
25
25
|
export declare function detectClaudeDesktopApp(appPath?: string, system?: DesktopHost): Promise<ClaudeDesktopInstallation>;
|
|
26
|
+
export declare const claudeDesktopDataDirectory: () => string;
|
|
27
|
+
export declare function validateClaudeDesktopVersion(app: ClaudeDesktopInstallation): void;
|
|
28
|
+
export declare function assertClaudeDesktopAvailable(userData: string): Promise<void>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Caller holds the shared desktop lease and has refused a running native app. */
|
|
2
|
+
export declare function recoverDesktopSelection(library: string): Promise<void>;
|
|
3
|
+
/** Read-only validation before account selection or broker access. The returned
|
|
4
|
+
* digests bind incumbent bytes without exporting credential-bearing content. */
|
|
5
|
+
export declare function inspectDesktopSelection(library: string): Promise<{
|
|
6
|
+
metadataHash: string | null;
|
|
7
|
+
metadataMode: number | null;
|
|
8
|
+
selectedHash: string | null;
|
|
9
|
+
recoveryHash: string | null;
|
|
10
|
+
}>;
|
|
11
|
+
export type DesktopSelection = {
|
|
12
|
+
configPath: string;
|
|
13
|
+
assertCurrent(): Promise<void>;
|
|
14
|
+
assertCurrentSync(): void;
|
|
15
|
+
restore(): Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
/** One journal/rollback protocol for the provider launcher and broker adapter.
|
|
18
|
+
* The receipt is written and read back before touching the effective selection.
|
|
19
|
+
* Hooks are an internal fixture seam, never part of the public adapter input. */
|
|
20
|
+
export declare function applyDesktopSelection(library: string, config: Record<string, unknown>, label: string, checkpoint?: (stage: "preserved" | "config" | "selected") => Promise<void>): Promise<DesktopSelection>;
|
package/dist/desktop-state.d.ts
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
export type DesktopFileSnapshot = {
|
|
2
|
+
text: string;
|
|
3
|
+
mode: number;
|
|
4
|
+
metadataHash: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function safeDesktopSnapshot(path: string): Promise<DesktopFileSnapshot | undefined>;
|
|
7
|
+
/** Bounded, no-yield form for the final native launch handoff. */
|
|
8
|
+
export declare function safeDesktopSnapshotSync(path: string): DesktopFileSnapshot | undefined;
|
|
1
9
|
export declare function safeDesktopRead(path: string): Promise<string | undefined>;
|
|
2
|
-
export declare function
|
|
10
|
+
export declare function sameDesktopSnapshot(a: DesktopFileSnapshot | undefined, b: DesktopFileSnapshot | undefined): boolean;
|
|
11
|
+
/** Preserve a complete original, including admitted attributes, without
|
|
12
|
+
* overwriting an incumbent. Verify both source continuity and copied bytes. */
|
|
13
|
+
export declare function preserveDesktopFile(source: string, destination: string, expected: DesktopFileSnapshot): Promise<void>;
|
|
14
|
+
/** Atomically replace `path` only while the current directory entry still
|
|
15
|
+
* matches `expectedCurrent`. The current entry is moved aside first; the new
|
|
16
|
+
* inode is installed with link-exclusive semantics, so a foreign entry that
|
|
17
|
+
* appears in the gap is never overwritten. The displaced entry is checked
|
|
18
|
+
* after the move, and restored on any mismatch. */
|
|
19
|
+
export declare function replaceDesktopFile(path: string, temporary: string, expectedCurrent: DesktopFileSnapshot | undefined, expectedNew: DesktopFileSnapshot): Promise<void>;
|
|
20
|
+
/** Remove `path` only while its moved directory entry still matches the
|
|
21
|
+
* expected snapshot. A foreign replacement in the gap is preserved. */
|
|
22
|
+
export declare function removeDesktopFile(path: string, expected: DesktopFileSnapshot | undefined, guard?: () => Promise<void> | void): Promise<void>;
|
|
23
|
+
export declare function writeDesktopPrivate(path: string, text: string, mode?: number, metadataSource?: {
|
|
24
|
+
path: string;
|
|
25
|
+
snapshot: DesktopFileSnapshot;
|
|
26
|
+
}, expectation?: {
|
|
27
|
+
current: DesktopFileSnapshot | undefined;
|
|
28
|
+
}): Promise<void>;
|
|
3
29
|
export declare function desktopLease(path: string): Promise<() => void>;
|
|
30
|
+
export declare function assertDesktopRuntime(): Promise<void>;
|
|
31
|
+
/** Read-only preflight, not acquisition of a future launch lease. */
|
|
32
|
+
export declare function assertDesktopLeaseAvailable(path: string): Promise<void>;
|