@cortexkit/opencode-antigravity-auth 3.0.13 → 3.0.15
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/cli.js +1865 -571
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +294 -55
- package/dist/index.js +2377 -784
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +332 -78
- package/dist/server.js +3977 -2327
- package/dist/server.js.map +4 -4
- package/dist/server.meta.json +1 -1
- package/dist/src/__fixtures__/runtime-layout-process.d.ts +2 -0
- package/dist/src/__fixtures__/runtime-layout-process.d.ts.map +1 -0
- package/dist/src/__fixtures__/runtime-layout-process.js +88 -0
- package/dist/src/__fixtures__/runtime-layout-process.js.map +1 -0
- package/dist/src/cli.d.ts +17 -6
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +26 -9
- package/dist/src/cli.js.map +1 -1
- package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +9 -0
- package/dist/src/common-auth-embedded/claustrum/enrollment.js +15 -8
- package/dist/src/common-auth-embedded/claustrum/hub.js +86 -42
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +16 -3
- package/dist/src/common-auth-embedded/setup/command.js +4 -49
- package/dist/src/common-auth-embedded/setup/flags.d.ts +50 -0
- package/dist/src/common-auth-embedded/setup/flags.js +123 -0
- package/dist/src/common-auth-embedded/setup/index.d.ts +1 -0
- package/dist/src/common-auth-embedded/setup/index.js +1 -0
- package/dist/src/common-auth-embedded/setup/types.d.ts +7 -1
- package/dist/src/common-auth-embedded/source-output.json +47 -31
- package/dist/src/ga/server/auth.d.ts.map +1 -1
- package/dist/src/ga/server/auth.js +7 -2
- package/dist/src/ga/server/auth.js.map +1 -1
- package/dist/src/ga/server/index.d.ts.map +1 -1
- package/dist/src/ga/server/index.js +18 -4
- package/dist/src/ga/server/index.js.map +1 -1
- package/dist/src/ga/tui/host-ga.d.ts +55 -2
- package/dist/src/ga/tui/host-ga.d.ts.map +1 -1
- package/dist/src/ga/tui/host-ga.js +73 -43
- package/dist/src/ga/tui/host-ga.js.map +1 -1
- package/dist/src/plugin/__fixtures__/controlled-timeouts.d.ts +7 -0
- package/dist/src/plugin/__fixtures__/controlled-timeouts.d.ts.map +1 -0
- package/dist/src/plugin/__fixtures__/controlled-timeouts.js +41 -0
- package/dist/src/plugin/__fixtures__/controlled-timeouts.js.map +1 -0
- package/dist/src/plugin/__fixtures__/release-model-ids.d.ts +2 -0
- package/dist/src/plugin/__fixtures__/release-model-ids.d.ts.map +1 -0
- package/dist/src/plugin/__fixtures__/release-model-ids.js +11 -0
- package/dist/src/plugin/__fixtures__/release-model-ids.js.map +1 -0
- package/dist/src/plugin/__fixtures__/verified-store.d.ts +3 -0
- package/dist/src/plugin/__fixtures__/verified-store.d.ts.map +1 -0
- package/dist/src/plugin/__fixtures__/verified-store.js +50 -0
- package/dist/src/plugin/__fixtures__/verified-store.js.map +1 -0
- package/dist/src/plugin/auth-loader.d.ts +7 -1
- package/dist/src/plugin/auth-loader.d.ts.map +1 -1
- package/dist/src/plugin/auth-loader.js +4 -4
- package/dist/src/plugin/auth-loader.js.map +1 -1
- package/dist/src/plugin/cache/signature-cache.d.ts +7 -1
- package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -1
- package/dist/src/plugin/cache/signature-cache.js +10 -13
- package/dist/src/plugin/cache/signature-cache.js.map +1 -1
- package/dist/src/plugin/config/loader.d.ts +2 -1
- package/dist/src/plugin/config/loader.d.ts.map +1 -1
- package/dist/src/plugin/config/loader.js +4 -2
- package/dist/src/plugin/config/loader.js.map +1 -1
- package/dist/src/plugin/config/schema.js +1 -1
- package/dist/src/plugin/debug.d.ts.map +1 -1
- package/dist/src/plugin/debug.js +18 -19
- package/dist/src/plugin/debug.js.map +1 -1
- package/dist/src/plugin/errors.js +1 -1
- package/dist/src/plugin/errors.js.map +1 -1
- package/dist/src/plugin/ga-location-services.d.ts +1 -1
- package/dist/src/plugin/ga-location-services.d.ts.map +1 -1
- package/dist/src/plugin/ga-location-services.js +99 -32
- package/dist/src/plugin/ga-location-services.js.map +1 -1
- package/dist/src/plugin/ga-shared-vault-custody.d.ts +19 -5
- package/dist/src/plugin/ga-shared-vault-custody.d.ts.map +1 -1
- package/dist/src/plugin/ga-shared-vault-custody.js +12 -4
- package/dist/src/plugin/ga-shared-vault-custody.js.map +1 -1
- package/dist/src/plugin/index.d.ts.map +1 -1
- package/dist/src/plugin/index.js +31 -9
- package/dist/src/plugin/index.js.map +1 -1
- package/dist/src/plugin/shared/source-sidebar.d.ts +6 -0
- package/dist/src/plugin/shared/source-sidebar.d.ts.map +1 -1
- package/dist/src/plugin/shared/source-sidebar.js +1 -1
- package/dist/src/plugin/shared/source-sidebar.js.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.d.ts +33 -13
- package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.js +97 -44
- package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -1
- package/dist/src/plugin/storage.d.ts +5 -2
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js +5 -4
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/plugin/vault-custody.d.ts +29 -8
- package/dist/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/src/plugin/vault-custody.js +61 -10
- package/dist/src/plugin/vault-custody.js.map +1 -1
- package/dist/src/process-heartbeat.d.ts +22 -2
- package/dist/src/process-heartbeat.d.ts.map +1 -1
- package/dist/src/process-heartbeat.js +47 -10
- package/dist/src/process-heartbeat.js.map +1 -1
- package/dist/src/rpc/rpc-server.d.ts +8 -0
- package/dist/src/rpc/rpc-server.d.ts.map +1 -1
- package/dist/src/rpc/rpc-server.js +26 -1
- package/dist/src/rpc/rpc-server.js.map +1 -1
- package/dist/src/runtime-layout.d.ts +100 -0
- package/dist/src/runtime-layout.d.ts.map +1 -0
- package/dist/src/runtime-layout.js +1242 -0
- package/dist/src/runtime-layout.js.map +1 -0
- package/dist/src/runtime-paths.d.ts +132 -0
- package/dist/src/runtime-paths.d.ts.map +1 -0
- package/dist/src/runtime-paths.js +214 -0
- package/dist/src/runtime-paths.js.map +1 -0
- package/dist/src/setup.d.ts.map +1 -1
- package/dist/src/setup.js +30 -7
- package/dist/src/setup.js.map +1 -1
- package/dist/src/tui/quota-layout.d.ts +1 -1
- package/dist/src/tui/quota-layout.js +1 -1
- package/dist/src/tui/sidebar-frame.d.ts +109 -0
- package/dist/src/tui/sidebar-frame.d.ts.map +1 -0
- package/dist/src/tui/sidebar-frame.js +244 -0
- package/dist/src/tui/sidebar-frame.js.map +1 -0
- package/dist/src/tui.d.ts.map +1 -1
- package/dist/src/tui.js +11 -251
- package/dist/src/tui.js.map +1 -1
- package/dist/src/vault-folder.d.ts +38 -0
- package/dist/src/vault-folder.d.ts.map +1 -0
- package/dist/src/vault-folder.js +91 -0
- package/dist/src/vault-folder.js.map +1 -0
- package/dist/src/version-fence.d.ts +54 -0
- package/dist/src/version-fence.d.ts.map +1 -0
- package/dist/src/version-fence.js +254 -0
- package/dist/src/version-fence.js.map +1 -0
- package/dist/tui-build-map.json +121 -93
- package/dist/tui-ga-build-map.json +23 -9
- package/dist/types/src/cli.d.ts +17 -6
- package/dist/types/src/cli.d.ts.map +1 -1
- package/dist/types/src/common-auth-embedded/claustrum/enrollment.d.ts +9 -0
- package/dist/types/src/common-auth-embedded/setup/flags.d.ts +50 -0
- package/dist/types/src/common-auth-embedded/setup/index.d.ts +1 -0
- package/dist/types/src/common-auth-embedded/setup/types.d.ts +7 -1
- package/dist/types/src/ga/server/auth.d.ts.map +1 -1
- package/dist/types/src/ga/server/index.d.ts.map +1 -1
- package/dist/types/src/plugin/auth-loader.d.ts +7 -1
- package/dist/types/src/plugin/auth-loader.d.ts.map +1 -1
- package/dist/types/src/plugin/cache/signature-cache.d.ts +7 -1
- package/dist/types/src/plugin/cache/signature-cache.d.ts.map +1 -1
- package/dist/types/src/plugin/config/loader.d.ts +2 -1
- package/dist/types/src/plugin/config/loader.d.ts.map +1 -1
- package/dist/types/src/plugin/debug.d.ts.map +1 -1
- package/dist/types/src/plugin/ga-location-services.d.ts +1 -1
- package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -1
- package/dist/types/src/plugin/ga-shared-vault-custody.d.ts +19 -5
- package/dist/types/src/plugin/ga-shared-vault-custody.d.ts.map +1 -1
- package/dist/types/src/plugin/index.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/source-sidebar.d.ts +6 -0
- package/dist/types/src/plugin/shared/source-sidebar.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +33 -13
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/types/src/plugin/storage.d.ts +5 -2
- package/dist/types/src/plugin/storage.d.ts.map +1 -1
- package/dist/types/src/plugin/vault-custody.d.ts +29 -8
- package/dist/types/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/types/src/process-heartbeat.d.ts +22 -2
- package/dist/types/src/process-heartbeat.d.ts.map +1 -1
- package/dist/types/src/rpc/rpc-server.d.ts +8 -0
- package/dist/types/src/rpc/rpc-server.d.ts.map +1 -1
- package/dist/types/src/runtime-layout.d.ts +100 -0
- package/dist/types/src/runtime-layout.d.ts.map +1 -0
- package/dist/types/src/runtime-paths.d.ts +132 -0
- package/dist/types/src/runtime-paths.d.ts.map +1 -0
- package/dist/types/src/setup.d.ts.map +1 -1
- package/dist/types/src/vault-folder.d.ts +38 -0
- package/dist/types/src/vault-folder.d.ts.map +1 -0
- package/dist/types/src/version-fence.d.ts +54 -0
- package/dist/types/src/version-fence.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/common-auth-embedded/claustrum/enrollment.d.ts +9 -0
- package/src/common-auth-embedded/claustrum/enrollment.js +15 -8
- package/src/common-auth-embedded/claustrum/hub.js +86 -42
- package/src/common-auth-embedded/fs/refresh-file-lock.js +16 -3
- package/src/common-auth-embedded/setup/command.js +4 -49
- package/src/common-auth-embedded/setup/flags.d.ts +50 -0
- package/src/common-auth-embedded/setup/flags.js +123 -0
- package/src/common-auth-embedded/setup/index.d.ts +1 -0
- package/src/common-auth-embedded/setup/index.js +1 -0
- package/src/common-auth-embedded/setup/types.d.ts +7 -1
- package/src/common-auth-embedded/source-output.json +47 -31
- package/src/tui/entry.mjs +19 -1
- package/src/tui-compiled/sidebar-projection.js +119 -0
- package/src/tui-compiled/tui/quota-layout.js +1 -1
- package/src/tui-compiled/tui/sidebar-frame.js +657 -0
- package/src/tui-compiled/tui.js +25 -606
- package/src/tui-ga-compiled/host-ga.js +116 -124
- package/src/tui-ga-compiled/shared/ced204104a639c9c-sidebar-frame.js +657 -0
- package/src/tui-ga-compiled/shared/dd4c9e1a907f8ef0-quota-layout.js +1 -1
- package/src/tui-ga-raw/host-ga.tsx +157 -95
- package/src/tui-ga-raw/shared/ced204104a639c9c-sidebar-frame.tsx +603 -0
- package/src/tui-ga-raw/shared/dd4c9e1a907f8ef0-quota-layout.tsx +1 -1
- package/src/tui-raw/sidebar-projection.js +119 -0
- package/src/tui-raw/tui/quota-layout.tsx +1 -1
- package/src/tui-raw/tui/sidebar-frame.tsx +603 -0
- package/src/tui-raw/tui.tsx +25 -523
- package/src/tui.tsx +25 -523
|
@@ -44,8 +44,11 @@ export declare const migrateV2ToV3: typeof coreMigrateV2ToV3;
|
|
|
44
44
|
*/
|
|
45
45
|
export declare const mutateAccountStorage: typeof coreMutateAccountStorage;
|
|
46
46
|
/**
|
|
47
|
-
* Files/directories that should be gitignored in the
|
|
48
|
-
*
|
|
47
|
+
* Files/directories that should be gitignored in the folder holding the
|
|
48
|
+
* account store (`ensureGitignore` runs only for that folder). These contain
|
|
49
|
+
* sensitive data or machine-specific state. The signature cache and the
|
|
50
|
+
* default debug log folder used to live here too; they are in the plugin's
|
|
51
|
+
* state folder now, so their entries are no longer added.
|
|
49
52
|
*/
|
|
50
53
|
export declare const GITIGNORE_ENTRIES: string[];
|
|
51
54
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/plugin/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAgBH,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,8BAA8B,EAC9B,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,6BAA6B,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAEzB,KAAK,uBAAuB,EAE5B,0BAA0B,IAAI,8BAA8B,EAE5D,mBAAmB,IAAI,uBAAuB,EAC9C,aAAa,IAAI,iBAAiB,EAClC,oBAAoB,IAAI,wBAAwB,EAMjD,MAAM,kCAAkC,CAAA;AAWzC;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAA;AAE5C,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,8BAA8B,EAC9B,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,CAAA;AAED;;;;;;;GAOG;AACH,OAAO,EAAE,6BAA6B,EAAE,CAAA;AAExC;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,uCAAiC,CAAA;AACxE,eAAO,MAAM,mBAAmB,gCAA0B,CAAA;AAC1D,eAAO,MAAM,aAAa,0BAAoB,CAAA;AAE9C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,wBAMzC,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/plugin/storage.ts"],"names":[],"mappings":"AAA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B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAanD;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,2BAA2B,CAC/C,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,GAC9C,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAsBxC"}
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* setup steps that switch between them, and the vault account source the
|
|
6
6
|
* custody request path uses.
|
|
7
7
|
*
|
|
8
|
-
* Everything lives in an owner-only `antigravity-auth-vault` directory
|
|
9
|
-
*
|
|
10
|
-
* roster and this host's enrollment files
|
|
8
|
+
* Everything lives in an owner-only `antigravity-auth-vault` directory, the
|
|
9
|
+
* vault folder the entry point settled for this process (`vault-folder.ts`):
|
|
10
|
+
* the non-secret mode file, the vault roster and this host's enrollment files
|
|
11
|
+
* (written by the vault library).
|
|
11
12
|
* The mode file holds only the mode; no token, project or account data is
|
|
12
13
|
* written here. A missing mode file is local mode, so nothing connects to
|
|
13
14
|
* the vault and no source starts while local custody is in force.
|
|
@@ -26,7 +27,10 @@ export declare const OPENCODE_VAULT_PROVIDER = "google";
|
|
|
26
27
|
export declare const OPENCODE_VAULT_HOST = "opencode";
|
|
27
28
|
/** The enrollment name the vault operator sees and approves. */
|
|
28
29
|
export declare const OPENCODE_VAULT_ENROLLMENT_NAME: "antigravity-auth-opencode" | "antigravity-auth-pi";
|
|
29
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* The vault directory's name, in both places it can live: beside the account
|
|
32
|
+
* file, and in the plugin's state-home folder (`runtime-paths.ts`).
|
|
33
|
+
*/
|
|
30
34
|
export declare const OPENCODE_VAULT_DIR_NAME = "antigravity-auth-vault";
|
|
31
35
|
type Claustrum = CommonAuthClaustrumModule;
|
|
32
36
|
type EnrollmentStatus = Awaited<ReturnType<Claustrum['readClaustrumEnrollmentStatus']>>;
|
|
@@ -41,8 +45,8 @@ export interface OpenCodeVaultPaths {
|
|
|
41
45
|
/** The vault accounts' credential-free provider state. */
|
|
42
46
|
readonly stateFile: string;
|
|
43
47
|
}
|
|
44
|
-
/** The vault paths
|
|
45
|
-
export declare function openCodeVaultPaths(
|
|
48
|
+
/** The vault paths inside one vault folder. */
|
|
49
|
+
export declare function openCodeVaultPaths(vaultDir: string): OpenCodeVaultPaths;
|
|
46
50
|
export type OpenCodeVaultMode = 'local' | 'custody';
|
|
47
51
|
export interface OpenCodeVaultModeRecord {
|
|
48
52
|
readonly version: 1;
|
|
@@ -75,8 +79,25 @@ export interface OpenCodeVaultStatus {
|
|
|
75
79
|
export interface OpenCodeVaultCustodyOptions {
|
|
76
80
|
readonly onAuthorityChanged?: (authority: EnrollmentAuthority) => void;
|
|
77
81
|
readonly onRosterChanged?: () => void;
|
|
78
|
-
/**
|
|
79
|
-
|
|
82
|
+
/**
|
|
83
|
+
* The folder holding this host's vault files: the one the entry point
|
|
84
|
+
* settled for this process (`prepareVaultFolder` in `vault-folder.ts`).
|
|
85
|
+
*/
|
|
86
|
+
readonly vaultDir: string;
|
|
87
|
+
/**
|
|
88
|
+
* The account file that folder was settled against. Disconnect hands it to
|
|
89
|
+
* `removeMovedVaultStateLeftover`, which looks for an old vault folder
|
|
90
|
+
* beside it. Defaults to the one `legacyAccountFile()` names.
|
|
91
|
+
*/
|
|
92
|
+
readonly accountFile?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Set when the entry point could not settle where the vault files live:
|
|
95
|
+
* the refusal's message, which names the folders involved. Custody then
|
|
96
|
+
* reads and writes no vault file. The mode reads as unclear with this text,
|
|
97
|
+
* so neither vault nor local accounts are served, the Vault section shows
|
|
98
|
+
* it, and every vault action refuses with it.
|
|
99
|
+
*/
|
|
100
|
+
readonly layoutRefusal?: string;
|
|
80
101
|
/**
|
|
81
102
|
* The host's own auth slot for `google`, read through the host's public
|
|
82
103
|
* API and shaped as the vault library classifies it (`oauth` or `api`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault-custody.d.ts","sourceRoot":"","sources":["../../../../src/plugin/vault-custody.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vault-custody.d.ts","sourceRoot":"","sources":["../../../../src/plugin/vault-custody.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAE7B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAcxB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,kCAAkC,CAAA;AAKzC,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC7B,MAAM,uCAAuC,CAAA;AAG9C,sEAAsE;AACtE,eAAO,MAAM,uBAAuB,WAAW,CAAA;AAC/C,oDAAoD;AACpD,eAAO,MAAM,mBAAmB,aAAa,CAAA;AAC7C,gEAAgE;AAChE,eAAO,MAAM,8BAA8B,qDACa,CAAA;AACxD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,2BAA2B,CAAA;AAE/D,KAAK,SAAS,GAAG,yBAAyB,CAAA;AAC1C,KAAK,gBAAgB,GAAG,OAAO,CAC7B,UAAU,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC,CACvD,CAAA;AACD,KAAK,oBAAoB,GAAG,OAAO,CACjC,UAAU,CAAC,SAAS,CAAC,kCAAkC,CAAC,CAAC,CAC1D,CAAA;AAED,KAAK,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAChE,KAAK,WAAW,GAAG,UAAU,CAAC,wBAAwB,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC/E,KAAK,gBAAgB,GAAG,WAAW,CAAC,WAAW,CAAC,QAAQ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C1E,wBAAgB,WAAW,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,EAAE,CAejE"}
|
|
@@ -57,10 +57,30 @@ export declare function startProcessHeartbeat(input: {
|
|
|
57
57
|
* finishes. Never throws.
|
|
58
58
|
*/
|
|
59
59
|
export declare function removeProcessHeartbeat(logger: HeartbeatLogger): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Record which layout this process uses for one config folder. A `legacy`
|
|
62
|
+
* choice is written to the heartbeat file at once, because another process
|
|
63
|
+
* deciding whether it may move the files reads it; the caller makes the
|
|
64
|
+
* choice and this write while it holds the layout lock. A `state-home`
|
|
65
|
+
* choice only goes into the next heartbeat write. Throws when the write
|
|
66
|
+
* fails, unlike `startProcessHeartbeat`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function recordProcessLayout(input: {
|
|
69
|
+
key: string;
|
|
70
|
+
layout: ProcessLayout;
|
|
71
|
+
version: string;
|
|
72
|
+
now?: () => number;
|
|
73
|
+
pid?: number;
|
|
74
|
+
dir?: string;
|
|
75
|
+
}): Promise<void>;
|
|
76
|
+
/** This plugin's version, from its package manifest. */
|
|
77
|
+
export declare function pluginPackageVersion(): Promise<string>;
|
|
60
78
|
/**
|
|
61
79
|
* Start one owner of this process's heartbeat: the plugin's version and the
|
|
62
|
-
*
|
|
63
|
-
* has.
|
|
80
|
+
* layout this process decided for its OpenCode config folder, or `legacy`
|
|
81
|
+
* while it has not decided. When the package manifest cannot be read it
|
|
82
|
+
* writes version `unknown` and no layout. Never throws; a failure is logged
|
|
83
|
+
* at warn.
|
|
64
84
|
*/
|
|
65
85
|
export declare function startRuntimeProcessHeartbeat(logger: HeartbeatLogger): Promise<ProcessHeartbeatHandle>;
|
|
66
86
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-heartbeat.d.ts","sourceRoot":"","sources":["../../../src/process-heartbeat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"process-heartbeat.d.ts","sourceRo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CAAC,IAAI,CAAC,CAEf;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,IAAI,CAAC,CAchB;AAMD,wDAAwD;AACxD,wBAAgB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAYtD;AAED;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,sBAAsB,CAAC,CAejC;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,+DAA+D;AAC/D,wBAAgB,8BAA8B,IAAI,IAAI,CAMrD"}
|
|
@@ -11,6 +11,14 @@ export interface StartRpcServerOptions {
|
|
|
11
11
|
* not called.
|
|
12
12
|
*/
|
|
13
13
|
parseApplyRequest: typeof Commands.parseApplyRequest;
|
|
14
|
+
/**
|
|
15
|
+
* This plugin's package version, written into the port file. A process
|
|
16
|
+
* deciding whether it may move the vault files out of OpenCode's config
|
|
17
|
+
* folder (`version-fence.ts`) reads it; a port file without one counts as
|
|
18
|
+
* an older plugin and holds the move. The caller passes it in so this
|
|
19
|
+
* adapter imports nothing beyond the RPC library.
|
|
20
|
+
*/
|
|
21
|
+
version: string;
|
|
14
22
|
/** Runs one parsed menu action and returns the refreshed menu. */
|
|
15
23
|
apply(request: CommandApplyRequest): Promise<CommandApplyResult> | CommandApplyResult;
|
|
16
24
|
drain(lastReceivedId: number, sessionId?: string): Promise<RpcNotification[]> | RpcNotification[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-server.d.ts","sourceRoot":"","sources":["../../../../src/rpc/rpc-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,2CAA2C,CAAA;
|
|
1
|
+
{"version":3,"file":"rpc-server.d.ts","sourceRoot":"","sources":["../../../../src/rpc/rpc-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,2CAA2C,CAAA;AAO1E,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EAChB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAA;IACX;;;;;;;OAOG;IACH,iBAAiB,EAAE,OAAO,QAAQ,CAAC,iBAAiB,CAAA;IACpD;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,KAAK,CACH,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAA;IACnD,KAAK,CACH,cAAc,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,eAAe,EAAE,CAAC,GAAG,eAAe,EAAE,CAAA;CAClD;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB;AAUD,wBAAsB,cAAc,CAClC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAoE1B"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type RuntimeLayout } from './runtime-paths.js';
|
|
2
|
+
import { type VersionFenceResult } from './version-fence.js';
|
|
3
|
+
export type { RuntimeLayout };
|
|
4
|
+
/** Name of the lock held while a process decides or moves the layout. */
|
|
5
|
+
export declare const RUNTIME_LAYOUT_LOCK_NAME = "runtime-layout";
|
|
6
|
+
/** Lists the copies an unfinished move has put in the state-home folder. */
|
|
7
|
+
export declare const RUNTIME_LAYOUT_MANIFEST_FILE = "layout-moving.json";
|
|
8
|
+
/**
|
|
9
|
+
* The enrollment state file. A move leaves it in the old folder when it keeps
|
|
10
|
+
* the host in vault mode without its token (approved, or blocked because the
|
|
11
|
+
* token is missing).
|
|
12
|
+
*/
|
|
13
|
+
export declare const VAULT_ENROLLMENT_STATE_FILE = "opencode-enrollment-state.json";
|
|
14
|
+
/**
|
|
15
|
+
* The vault files that move, and the only ones the move ever reads, copies,
|
|
16
|
+
* compares or removes in either vault folder. Anything else there (Pi's
|
|
17
|
+
* files, when Pi's account file points into OpenCode's config folder, or a
|
|
18
|
+
* file a later library version adds) is left alone; a new vault file has to
|
|
19
|
+
* be added here on purpose.
|
|
20
|
+
*/
|
|
21
|
+
export declare const VAULT_FILE_NAMES: readonly ["opencode-enrollment.json", "opencode-enrollment-state.json", "opencode-roster.json", "opencode-state.json", "opencode-mode.json"];
|
|
22
|
+
/** The message logged once by a process that keeps the legacy layout. */
|
|
23
|
+
export declare const RUNTIME_LAYOUT_DEFERRED_MESSAGE = "antigravity-auth keeps its vault files in OpenCode's config folder until every running OpenCode using it has restarted on this version.";
|
|
24
|
+
/**
|
|
25
|
+
* Plugin start stops when it cannot settle a safe layout: it could not take
|
|
26
|
+
* the layout lock or write its heartbeat (so other processes could not see
|
|
27
|
+
* which files it uses), could not trust the marker, found conflicting vault
|
|
28
|
+
* files, or found a state-home folder owned by another config folder.
|
|
29
|
+
*/
|
|
30
|
+
export declare class RuntimeLayoutRefusal extends Error {
|
|
31
|
+
readonly stateDir: string;
|
|
32
|
+
readonly errorClass: string;
|
|
33
|
+
constructor(stateDir: string, errorClass: string, message?: string);
|
|
34
|
+
}
|
|
35
|
+
export interface RuntimeLayoutLogger {
|
|
36
|
+
info(message: string, meta?: Record<string, unknown>): unknown;
|
|
37
|
+
warn(message: string, meta?: Record<string, unknown>): unknown;
|
|
38
|
+
}
|
|
39
|
+
export interface RuntimeLayoutOptions {
|
|
40
|
+
/** This build's version, for the version fence. */
|
|
41
|
+
version: string;
|
|
42
|
+
log?: RuntimeLayoutLogger;
|
|
43
|
+
/**
|
|
44
|
+
* The account file a legacy-layout process of this config folder uses;
|
|
45
|
+
* the old vault folder is beside it. Defaults to `legacyAccountFile()`.
|
|
46
|
+
*/
|
|
47
|
+
accountFile?: string;
|
|
48
|
+
/** Defaults to `versionFenceOpen` for `version`, with the layout checks. */
|
|
49
|
+
fence?: () => Promise<VersionFenceResult>;
|
|
50
|
+
/**
|
|
51
|
+
* Whether an existing destination vault folder may be written into.
|
|
52
|
+
* Defaults to the private-files check on Windows (a folder this module did
|
|
53
|
+
* not create is never repaired) and to true elsewhere, where the move sets
|
|
54
|
+
* the folder to 0700 itself.
|
|
55
|
+
*/
|
|
56
|
+
destinationPrivate?: (dir: string) => Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Test seams, run at one step of the move. A step that throws stands in for
|
|
59
|
+
* a crash there: nothing after it runs.
|
|
60
|
+
*/
|
|
61
|
+
steps?: {
|
|
62
|
+
afterManifest?: () => void | Promise<void>;
|
|
63
|
+
afterCopy?: () => void | Promise<void>;
|
|
64
|
+
afterMarker?: () => void | Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Runs right before each removal of an old file, of the move's
|
|
67
|
+
* `layout-moving.json` and of the old vault folder, ahead of the lease
|
|
68
|
+
* check that guards it.
|
|
69
|
+
*/
|
|
70
|
+
beforeRemove?: (path: string) => void | Promise<void>;
|
|
71
|
+
};
|
|
72
|
+
/** Test seam: how long to wait for the layout lock. */
|
|
73
|
+
layoutLockWaitMs?: number;
|
|
74
|
+
/**
|
|
75
|
+
* The signature cache file older versions wrote in OpenCode's config
|
|
76
|
+
* folder. Defaults to `legacySignatureCacheFile()`.
|
|
77
|
+
*/
|
|
78
|
+
oldSignatureCacheFile?: string;
|
|
79
|
+
}
|
|
80
|
+
/** Test seam: forget this process's runs and log lines. */
|
|
81
|
+
export declare function __resetRuntimeLayoutRunsForTest(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Decide, once per process, where this config folder's vault files live,
|
|
84
|
+
* moving them first when that is safe. Call at plugin start before anything
|
|
85
|
+
* resolves a vault path. Resolves to the layout `getVaultDir()` in
|
|
86
|
+
* `runtime-paths.ts` now uses; rejects with `RuntimeLayoutRefusal` when the
|
|
87
|
+
* plugin must not start.
|
|
88
|
+
*/
|
|
89
|
+
export declare function prepareRuntimeLayout(options: RuntimeLayoutOptions): Promise<RuntimeLayout>;
|
|
90
|
+
/**
|
|
91
|
+
* After Disconnect, remove the enrollment state file a move left in the old
|
|
92
|
+
* vault folder, so an older version no longer reads this host as enrolled.
|
|
93
|
+
* Acts only for this config folder's state-home vault folder (`vaultDir`), and
|
|
94
|
+
* only on a vault-shaped leftover of this plugin's enrollment
|
|
95
|
+
* (`isVaultShapedKeptState`); any other file there stays. The emptied old
|
|
96
|
+
* vault folder goes too. `accountFile` is the one the move was given
|
|
97
|
+
* (`RuntimeLayoutOptions.accountFile`).
|
|
98
|
+
*/
|
|
99
|
+
export declare function removeMovedVaultStateLeftover(vaultDir: string, accountFile?: string): Promise<void>;
|
|
100
|
+
//# sourceMappingURL=runtime-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-layout.d.ts","sourceRoot":"","sources":["../../../src/runtime-layout.ts"],"names":[],"mappings":"AAqHA,OAAO,EAOL,KAAK,aAAa,EAKnB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,iBAAiB,CAAA;AAE3E,YAAY,EAAE,aAAa,EAAE,CAAA;AAM7B,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,mBAAmB,CAAA;AACxD,4EAA4E;AAC5E,eAAO,MAAM,4BAA4B,uBAAuB,CAAA;AAEhE;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,mCAAmC,CAAA;AAK3E;;;;;;GAMG;AACH,eAAO,MA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CAAC,IAAI,CAAC,CAAA;KACtD,CAAA;IACD,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAC/B;AA4CD,2DAA2D;AAC3D,wBAAgB,+BAA+B,IAAI,IAAI,CAGtD;AAsED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,aAAa,CAAC,CAmBxB;AAynBD;;;;;;;;GAQG;AACH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAmBf"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the plugin's vault folder lives for one OpenCode config folder, and
|
|
3
|
+
* the per-process decision about it.
|
|
4
|
+
*
|
|
5
|
+
* The vault folder (`antigravity-auth-vault/`: the enrollment token and
|
|
6
|
+
* state, the vault roster, the vault provider state and the mode file) lives
|
|
7
|
+
* in one of two places:
|
|
8
|
+
* - the legacy layout: beside the account file, in OpenCode's config folder,
|
|
9
|
+
* where versions before the move kept it;
|
|
10
|
+
* - the state-home layout: `<state home>/cortexkit/antigravity-auth/opencode/`
|
|
11
|
+
* for the config folder `<home>/.config/opencode`, and
|
|
12
|
+
* `<state home>/cortexkit/antigravity-auth/opencode-<hash>/` for any other
|
|
13
|
+
* one, so two config folders never share a file.
|
|
14
|
+
* `runtime-layout.ts` decides which one, once per process, and moves the
|
|
15
|
+
* files once; until a process has decided, the layout marker alone tells.
|
|
16
|
+
*
|
|
17
|
+
* The account store (`antigravity-accounts.json`, its pointer and its
|
|
18
|
+
* generation folders) stays in OpenCode's config folder in both layouts: it
|
|
19
|
+
* records its own absolute paths and refuses to open anywhere else.
|
|
20
|
+
*
|
|
21
|
+
* So `state-home` in a heartbeat's `layouts` means "vault in the state home,
|
|
22
|
+
* account store in the config folder". A later release that moves the account
|
|
23
|
+
* store must not read a `state-home` heartbeat as "this process no longer
|
|
24
|
+
* uses the config folder": it has to fence on version (every live process at
|
|
25
|
+
* that release or newer), not on this layout value.
|
|
26
|
+
*/
|
|
27
|
+
/** In the state-home folder: present once that folder is authoritative. */
|
|
28
|
+
export declare const RUNTIME_LAYOUT_MARKER_FILE = "layout.json";
|
|
29
|
+
/** In every state-home runtime folder: names the config folder it belongs to. */
|
|
30
|
+
export declare const RUNTIME_CONFIG_DIR_NOTE_FILE = "config-dir.json";
|
|
31
|
+
/**
|
|
32
|
+
* The vault folder's name in both layouts. The same value as
|
|
33
|
+
* `OPENCODE_VAULT_DIR_NAME` in `plugin/vault-custody.ts`; kept here so this
|
|
34
|
+
* module does not load the vault code.
|
|
35
|
+
*/
|
|
36
|
+
export declare const VAULT_DIR_NAME = "antigravity-auth-vault";
|
|
37
|
+
/** The account file's name in OpenCode's config folder. */
|
|
38
|
+
export declare const ACCOUNT_FILE_NAME = "antigravity-accounts.json";
|
|
39
|
+
/**
|
|
40
|
+
* A config folder's identity: its real path as the file system spells it
|
|
41
|
+
* (symlinks resolved, on-disk case), or the resolved path when the folder
|
|
42
|
+
* does not exist. Nothing else is normalized: case folding would merge two
|
|
43
|
+
* distinct folders on a case-sensitive volume. This is the same string
|
|
44
|
+
* `processConfigFolderKey()` in `process-heartbeat.ts` writes, so a key
|
|
45
|
+
* recorded by 3.0.13 names the same folder.
|
|
46
|
+
*/
|
|
47
|
+
export declare function configDirIdentity(path: string): string;
|
|
48
|
+
/** Both places a config folder's vault folder can live in. */
|
|
49
|
+
export interface RuntimeLayoutLocation {
|
|
50
|
+
/** The config folder's identity (`configDirIdentity`). */
|
|
51
|
+
key: string;
|
|
52
|
+
/** OpenCode's config folder, as `getConfigDir()` returns it. */
|
|
53
|
+
configDir: string;
|
|
54
|
+
/** The state-home runtime folder for this config folder. */
|
|
55
|
+
stateHomeDir: string;
|
|
56
|
+
/** True when the config folder is `<home>/.config/opencode`. */
|
|
57
|
+
isDefaultConfigDir: boolean;
|
|
58
|
+
}
|
|
59
|
+
export type RuntimeLayout = 'legacy' | 'state-home';
|
|
60
|
+
/**
|
|
61
|
+
* Where this config folder's vault folder lives in the state home. Only the
|
|
62
|
+
* folder `<home>/.config/opencode` gets the plain `opencode/` folder; that is
|
|
63
|
+
* decided from the home directory, not from XDG_CONFIG_HOME, so two
|
|
64
|
+
* processes with different XDG_CONFIG_HOME values never share one. Every
|
|
65
|
+
* other config folder gets `opencode-<first 16 hex of sha256(identity)>/`.
|
|
66
|
+
*
|
|
67
|
+
* `configDir` defaults to `getConfigDir()` from `plugin/storage.ts`, used
|
|
68
|
+
* untrimmed, exactly as the account file and the 3.0.13 heartbeat use it.
|
|
69
|
+
*/
|
|
70
|
+
export declare function runtimeLayoutLocation(configDir?: string): RuntimeLayoutLocation;
|
|
71
|
+
/**
|
|
72
|
+
* Fix this process's layout for a config folder. Only `runtime-layout.ts`
|
|
73
|
+
* calls this, once per folder, while it holds the layout lock.
|
|
74
|
+
*/
|
|
75
|
+
export declare function setRuntimeLayout(location: RuntimeLayoutLocation, layout: RuntimeLayout): void;
|
|
76
|
+
/** The layout this process fixed for a config folder, if any. */
|
|
77
|
+
export declare function decidedRuntimeLayout(location: RuntimeLayoutLocation): RuntimeLayout | undefined;
|
|
78
|
+
/** Test seam: forget every decided layout and cached location. */
|
|
79
|
+
export declare function __resetRuntimeLayoutsForTest(): void;
|
|
80
|
+
/**
|
|
81
|
+
* The layout a config folder's vault folder is in for this process: the one
|
|
82
|
+
* it decided, or, for a process that never decided (a tool that never
|
|
83
|
+
* started the plugin), the marker read without taking any lock: the
|
|
84
|
+
* state-home layout once the state-home folder holds the marker, the legacy
|
|
85
|
+
* layout until then.
|
|
86
|
+
*/
|
|
87
|
+
export declare function currentRuntimeLayout(location?: RuntimeLayoutLocation): RuntimeLayout;
|
|
88
|
+
/**
|
|
89
|
+
* The plugin's own folder in the state home,
|
|
90
|
+
* `<state home>/cortexkit/antigravity-auth`, on every OS. It holds the
|
|
91
|
+
* per-config-folder runtime folders, the signature cache and the default
|
|
92
|
+
* debug log folder.
|
|
93
|
+
*/
|
|
94
|
+
export declare function pluginStateDir(): string;
|
|
95
|
+
/** The signature cache file's name, in both its old and its new folder. */
|
|
96
|
+
export declare const SIGNATURE_CACHE_FILE_NAME = "antigravity-signature-cache.json";
|
|
97
|
+
/**
|
|
98
|
+
* Where the signature cache lives by default: one file in the plugin's state
|
|
99
|
+
* folder, shared by every config folder OpenCode uses.
|
|
100
|
+
*/
|
|
101
|
+
export declare function stateHomeSignatureCacheFile(): string;
|
|
102
|
+
/**
|
|
103
|
+
* Where versions before the move kept the signature cache: `%APPDATA%\opencode`
|
|
104
|
+
* on Windows, `$XDG_CONFIG_HOME/opencode` or `~/.config/opencode` elsewhere.
|
|
105
|
+
* That folder never followed OPENCODE_CONFIG_DIR. Nothing writes this file
|
|
106
|
+
* any more; the move removes it once (`runtime-layout.ts`).
|
|
107
|
+
*/
|
|
108
|
+
export declare function legacySignatureCacheFile(): string;
|
|
109
|
+
/**
|
|
110
|
+
* The default debug log folder, used when neither OPENCODE_ANTIGRAVITY_LOG_DIR
|
|
111
|
+
* nor the `log_dir` setting names one.
|
|
112
|
+
*/
|
|
113
|
+
export declare function stateHomeLogsDir(): string;
|
|
114
|
+
/**
|
|
115
|
+
* The account file a legacy-layout process uses for this config folder,
|
|
116
|
+
* without changing anything on disk: `<config>/antigravity-accounts.json`,
|
|
117
|
+
* except on Windows when that file is missing and one exists in
|
|
118
|
+
* `%APPDATA%\opencode`. This is the choice `getStoragePath()` in
|
|
119
|
+
* `plugin/storage.ts` makes, minus its attempt to move the Windows file.
|
|
120
|
+
*/
|
|
121
|
+
export declare function legacyAccountFile(configDir?: string): string;
|
|
122
|
+
/** The vault folder of the legacy layout: beside the account file. */
|
|
123
|
+
export declare function legacyVaultDir(accountFile: string): string;
|
|
124
|
+
/** The vault folder of the state-home layout for one config folder. */
|
|
125
|
+
export declare function stateHomeVaultDir(location: RuntimeLayoutLocation): string;
|
|
126
|
+
/**
|
|
127
|
+
* The folder holding this config folder's vault files, for this process:
|
|
128
|
+
* the state-home vault folder in the state-home layout, and the folder beside
|
|
129
|
+
* `accountFile` in the legacy layout.
|
|
130
|
+
*/
|
|
131
|
+
export declare function getVaultDir(accountFile?: string, configDir?: string): string;
|
|
132
|
+
//# sourceMappingURL=runtime-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-paths.d.ts","sourceRoot":"","sources":["../../../src/runtime-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AASH,2EAA2E;AAC3E,eAAO,MAAM,0BAA0B,gBAAgB,CAAA;AACvD,iFAAiF;AACjF,eAAO,MAAM,4BAA4B,oBAAoB,CAAA;AAC7D;;;;GAIG;AACH,eAAO,MAAM,cAAc,2BAA2B,CAAA;AACtD,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,8BAA8B,CAAA;AAE5D;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB;IACpC,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAA;IACX,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAA;IACjB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAA;IACpB,gEAAgE;IAChE,kBAAkB,EAAE,OAAO,CAAA;CAC5B;AAED,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,YAAY,CAAA;AAuBnD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,GAAE,MAAuB,GACjC,qBAAqB,CA0BvB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,qBAAqB,EAC/B,MAAM,EAAE,aAAa,GACpB,IAAI,CAEN;AAED,iEAAiE;AACjE,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,qBAAqB,GAC9B,aAAa,GAAG,SAAS,CAE3B;AAED,kEAAkE;AAClE,wBAAgB,4BAA4B,IAAI,IAAI,CAGnD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,GAAE,qBAA+C,GACxD,aAAa,CAOf;AAUD;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB,qCAAqC,CAAA;AAE3E;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CASjD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,MAAuB,GAAG,MAAM,CAK5E;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,CAEzE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,GAAE,MAAuB,GACjC,MAAM,CAKR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/setup.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAIL,KAAK,oBAAoB,EAEzB,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/setup.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAIL,KAAK,oBAAoB,EAEzB,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAA;AA0D9E;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,GACtD,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7D;AA4CD,2EAA2E;AAC3E,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,+BAA+B,EACvC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,eAAe,EACrB,eAAe,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACtC,UAAU,UAAQ,GACjB,OAAO,CAAC,WAAW,CAAC,CAwStB;AAED,2FAA2F;AAC3F,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,EAAE,eAAe,EACrB,eAAe,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACtC,EAAE,GAAE,OAAY,GACf,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type RuntimeLayoutLogger, RuntimeLayoutRefusal } from './runtime-layout.js';
|
|
2
|
+
/** The vault folder an entry point uses, or why it has none. */
|
|
3
|
+
export interface VaultFolder {
|
|
4
|
+
/** The account file the folder was settled against (`getStoragePath()`). */
|
|
5
|
+
readonly accountFile: string;
|
|
6
|
+
/**
|
|
7
|
+
* The folder holding the vault files for this process. With a refusal it
|
|
8
|
+
* is only where the files would be read from without a decision; nothing
|
|
9
|
+
* may read or write it.
|
|
10
|
+
*/
|
|
11
|
+
readonly vaultDir: string;
|
|
12
|
+
/** Set when the start could not settle where the vault files live. */
|
|
13
|
+
readonly refusal?: RuntimeLayoutRefusal;
|
|
14
|
+
}
|
|
15
|
+
/** Test seam: forget every refusal this process kept. */
|
|
16
|
+
export declare function __resetVaultFoldersForTest(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Settle this process's vault folder for the config folder `accountFile`
|
|
19
|
+
* belongs to, moving the vault files first when that is safe. Resolves with
|
|
20
|
+
* the refusal rather than rejecting when the layout cannot be settled.
|
|
21
|
+
* `version` defaults to this package's own version (`unknown` when its
|
|
22
|
+
* manifest cannot be read, which other processes' version checks treat as
|
|
23
|
+
* blocking).
|
|
24
|
+
*/
|
|
25
|
+
export declare function prepareVaultFolder(options: {
|
|
26
|
+
accountFile: string;
|
|
27
|
+
version?: string;
|
|
28
|
+
log?: RuntimeLayoutLogger;
|
|
29
|
+
/** Test seam: how long to wait for the layout lock. */
|
|
30
|
+
layoutLockWaitMs?: number;
|
|
31
|
+
}): Promise<VaultFolder>;
|
|
32
|
+
/**
|
|
33
|
+
* The vault folder for code that runs after its entry point prepared: the
|
|
34
|
+
* kept refusal, or the folder of the decided layout. A process that never
|
|
35
|
+
* prepared follows the layout marker without taking a lock.
|
|
36
|
+
*/
|
|
37
|
+
export declare function currentVaultFolder(accountFile: string): VaultFolder;
|
|
38
|
+
//# sourceMappingURL=vault-folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault-folder.d.ts","sourceRoot":"","sources":["../../../src/vault-folder.ts"],"names":[],"mappings":"AAoBA,OAAO,EAEL,KAAK,mBAAmB,EACxB,oBAAoB,EACrB,MAAM,kBAAkB,CAAA;AAGzB,gEAAgE;AAChE,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,sEAAsE;IACtE,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAA;CACxC;AAmBD,yDAAyD;AACzD,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE;IAChD,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,mBAAmB,CAAA;IACzB,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,GAAG,OAAO,CAAC,WAAW,CAAC,CAmCvB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAKnE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** One live process that keeps the fence shut. */
|
|
2
|
+
export interface VersionFenceBlocker {
|
|
3
|
+
/** `'unknown'` when a whole directory could not be read. */
|
|
4
|
+
pid: number | 'unknown';
|
|
5
|
+
/** The version its heartbeat or port file names, or `'unknown'`. */
|
|
6
|
+
version: string;
|
|
7
|
+
/** The file or directory that showed it. */
|
|
8
|
+
detail: string;
|
|
9
|
+
}
|
|
10
|
+
export type VersionFenceResult = {
|
|
11
|
+
open: true;
|
|
12
|
+
} | {
|
|
13
|
+
open: false;
|
|
14
|
+
blockers: VersionFenceBlocker[];
|
|
15
|
+
};
|
|
16
|
+
export interface VersionFenceOptions {
|
|
17
|
+
/** The XDG state base; defaults to `$XDG_STATE_HOME` or `~/.local/state`. */
|
|
18
|
+
stateHome?: string;
|
|
19
|
+
/** Root holding the per-project RPC directories; defaults under the base. */
|
|
20
|
+
rpcDir?: string;
|
|
21
|
+
/** The version that wants to act. */
|
|
22
|
+
currentVersion: string;
|
|
23
|
+
isAlive?: (pid: number) => boolean;
|
|
24
|
+
/** This process, which never blocks itself. Defaults to `process.pid`. */
|
|
25
|
+
selfPid?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Set when the vault files are about to move: a live process that uses the
|
|
28
|
+
* legacy layout for any config folder, or that writes no layouts at all,
|
|
29
|
+
* also keeps the fence shut.
|
|
30
|
+
*/
|
|
31
|
+
layoutMove?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The XDG state base every state-home file of the plugin lives under:
|
|
35
|
+
* `$XDG_STATE_HOME`, else `~/.local/state`, on every OS. An empty
|
|
36
|
+
* XDG_STATE_HOME counts as unset, as it does for the heartbeat.
|
|
37
|
+
*/
|
|
38
|
+
export declare function defaultStateHome(): string;
|
|
39
|
+
/** Where a plugin process writes its heartbeat, `<pid>.json`. */
|
|
40
|
+
export declare function processHeartbeatDir(stateHome?: string): string;
|
|
41
|
+
/** The root of the plugin's per-project RPC directories. */
|
|
42
|
+
export declare function rpcStateRoot(stateHome?: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Semver precedence of `a` against `b` (negative, zero, positive), or
|
|
45
|
+
* undefined when either is not a version. A pre-release sorts below its
|
|
46
|
+
* release; build metadata is ignored.
|
|
47
|
+
*/
|
|
48
|
+
export declare function compareVersions(a: string, b: string): number | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Whether no other live process keeps the fence shut. Never throws: anything
|
|
51
|
+
* it cannot establish counts as a blocker.
|
|
52
|
+
*/
|
|
53
|
+
export declare function versionFenceOpen(options: VersionFenceOptions): Promise<VersionFenceResult>;
|
|
54
|
+
//# sourceMappingURL=version-fence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-fence.d.ts","sourceRoot":"","sources":["../../../src/version-fence.ts"],"names":[],"mappings":"AAoCA,kDAAkD;AAClD,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAA;IACf,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,mBAAmB,EAAE,CAAA;CAAE,CAAA;AAEpD,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qCAAqC;IACrC,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;IAClC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,SAAS,SAAqB,GAAG,MAAM,CAE1E;AAED,4DAA4D;AAC5D,wBAAgB,YAAY,CAAC,SAAS,SAAqB,GAAG,MAAM,CAEnE;AA+BD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA2BxE;AA0DD;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAwF7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/opencode-antigravity-auth",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.15",
|
|
4
4
|
"description": "Google Antigravity OAuth auth plugin for OpenCode - access Gemini and Claude models using Google credentials",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"dependencies": {
|
|
131
131
|
"@cortexkit/claustrum-client": "0.12.0",
|
|
132
132
|
"@cortexkit/subc-client": "0.22.5",
|
|
133
|
-
"@cortexkit/antigravity-auth-core": "3.0.
|
|
133
|
+
"@cortexkit/antigravity-auth-core": "3.0.15",
|
|
134
134
|
"@cortexkit/private-files": "0.2.1",
|
|
135
135
|
"jsonc-parser": "^3.3.1",
|
|
136
136
|
"xdg-basedir": "^5.1.0",
|
|
@@ -107,6 +107,15 @@ export interface EnrollmentAncestorOptions {
|
|
|
107
107
|
* sticky ancestors are accepted. Windows uses the shared safe-parent policy.
|
|
108
108
|
*/
|
|
109
109
|
export declare function refuseWritableAncestor(parent: string, options?: EnrollmentAncestorOptions): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Create `directory` owner-only, or make an existing one owner-only. POSIX:
|
|
112
|
+
* every component it creates gets mode 0700, a directory another user owns is
|
|
113
|
+
* refused, and one that group or others can reach is tightened to 0700.
|
|
114
|
+
* Windows: private-files creates missing components owner-only and verifies
|
|
115
|
+
* existing ones without modifying them. `what` names the directory in the
|
|
116
|
+
* ownership refusal.
|
|
117
|
+
*/
|
|
118
|
+
export declare function ensureClaustrumPrivateDirectory(directory: string, options?: EnrollmentAncestorOptions, what?: string): Promise<void>;
|
|
110
119
|
export declare function readClaustrumEnrollmentStatus(paths: ClaustrumEnrollmentPaths, proposedName: string): Promise<ClaustrumEnrollmentStatus>;
|
|
111
120
|
/**
|
|
112
121
|
* Resolve the host's account mode from its enrollment files. It never changes
|