@cortexkit/opencode-antigravity-auth 3.0.30 → 3.0.31
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 +104 -81
- package/dist/cli.js.map +3 -3
- package/dist/cli.meta.json +24 -19
- package/dist/index.js +120 -118
- package/dist/index.js.map +3 -3
- package/dist/index.meta.json +26 -21
- package/dist/server.js +120 -118
- package/dist/server.js.map +3 -3
- package/dist/server.meta.json +1 -1
- package/dist/src/common-auth-embedded/claustrum/roster.d.ts +2 -0
- package/dist/src/common-auth-embedded/claustrum/roster.js +32 -8
- package/dist/src/common-auth-embedded/fs/file-read-cache.js +10 -5
- package/dist/src/common-auth-embedded/limits/axes.d.ts +7 -1
- package/dist/src/common-auth-embedded/limits/decide.d.ts +5 -0
- package/dist/src/common-auth-embedded/limits/families.d.ts +4 -2
- package/dist/src/common-auth-embedded/limits/marker.d.ts +5 -0
- package/dist/src/common-auth-embedded/limits/request-history.d.ts +3 -1
- package/dist/src/common-auth-embedded/opencode2/install.d.ts +2 -1
- package/dist/src/common-auth-embedded/opencode2/install.js +58 -9
- package/dist/src/common-auth-embedded/opencode2/types.d.ts +19 -3
- package/dist/src/common-auth-embedded/setup/enroll.js +7 -1
- package/dist/src/common-auth-embedded/source-output.json +57 -57
- package/dist/src/common-auth-embedded/store/index.d.ts +1 -1
- package/dist/src/common-auth-embedded/store/limits-namespace.d.ts +7 -1
- package/dist/src/common-auth-embedded/store/limits-namespace.js +19 -7
- package/dist/src/common-auth-embedded/store/pool.d.ts +1 -1
- package/dist/src/common-auth-embedded/store/pool.js +1 -1
- package/dist/src/plugin/__fixtures__/release-model-ids.d.ts.map +1 -1
- package/dist/src/plugin/__fixtures__/release-model-ids.js +0 -1
- package/dist/src/plugin/__fixtures__/release-model-ids.js.map +1 -1
- package/dist/src/plugin/__fixtures__/verified-store.js +2 -2
- package/dist/src/plugin/account-access.js +1 -1
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +3 -2
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/shared/request-services.d.ts +1 -1
- package/dist/src/plugin/shared/request-services.js +1 -1
- package/dist/tui-build-map.json +1 -1
- package/dist/tui-ga-build-map.json +1 -1
- package/dist/types/src/common-auth-embedded/claustrum/roster.d.ts +2 -0
- package/dist/types/src/common-auth-embedded/limits/axes.d.ts +7 -1
- package/dist/types/src/common-auth-embedded/limits/decide.d.ts +5 -0
- package/dist/types/src/common-auth-embedded/limits/families.d.ts +4 -2
- package/dist/types/src/common-auth-embedded/limits/marker.d.ts +5 -0
- package/dist/types/src/common-auth-embedded/limits/request-history.d.ts +3 -1
- package/dist/types/src/common-auth-embedded/opencode2/install.d.ts +2 -1
- package/dist/types/src/common-auth-embedded/opencode2/types.d.ts +19 -3
- package/dist/types/src/common-auth-embedded/store/index.d.ts +1 -1
- package/dist/types/src/common-auth-embedded/store/limits-namespace.d.ts +7 -1
- package/dist/types/src/common-auth-embedded/store/pool.d.ts +1 -1
- package/dist/types/src/plugin/request.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/request-services.d.ts +1 -1
- package/package.json +3 -3
- package/src/common-auth-embedded/claustrum/roster.d.ts +2 -0
- package/src/common-auth-embedded/claustrum/roster.js +32 -8
- package/src/common-auth-embedded/fs/file-read-cache.js +10 -5
- package/src/common-auth-embedded/limits/axes.d.ts +7 -1
- package/src/common-auth-embedded/limits/decide.d.ts +5 -0
- package/src/common-auth-embedded/limits/families.d.ts +4 -2
- package/src/common-auth-embedded/limits/marker.d.ts +5 -0
- package/src/common-auth-embedded/limits/request-history.d.ts +3 -1
- package/src/common-auth-embedded/opencode2/install.d.ts +2 -1
- package/src/common-auth-embedded/opencode2/install.js +58 -9
- package/src/common-auth-embedded/opencode2/types.d.ts +19 -3
- package/src/common-auth-embedded/setup/enroll.js +7 -1
- package/src/common-auth-embedded/source-output.json +57 -57
- package/src/common-auth-embedded/store/index.d.ts +1 -1
- package/src/common-auth-embedded/store/limits-namespace.d.ts +7 -1
- package/src/common-auth-embedded/store/limits-namespace.js +19 -7
- package/src/common-auth-embedded/store/pool.d.ts +1 -1
- package/src/common-auth-embedded/store/pool.js +1 -1
package/dist/server.js
CHANGED
|
@@ -1631,10 +1631,10 @@ async function privateDirectory(path5) {
|
|
|
1631
1631
|
if (errno(error) !== "EEXIST")
|
|
1632
1632
|
throw error;
|
|
1633
1633
|
}
|
|
1634
|
-
const
|
|
1635
|
-
if (!
|
|
1634
|
+
const stat18 = await lstat2(path5);
|
|
1635
|
+
if (!stat18.isDirectory() || stat18.isSymbolicLink())
|
|
1636
1636
|
throw new AccountMigrationError("successor directory is not a regular directory");
|
|
1637
|
-
privateMode(
|
|
1637
|
+
privateMode(stat18.mode, 448);
|
|
1638
1638
|
if (windowsPrivateFiles)
|
|
1639
1639
|
await verifySafeDirectory(path5);
|
|
1640
1640
|
if (!sameFilesystemPath(await realpath(path5), path5))
|
|
@@ -5879,7 +5879,7 @@ function getAgyNativeModel(model) {
|
|
|
5879
5879
|
}
|
|
5880
5880
|
function isRetiredAgyModel(model) {
|
|
5881
5881
|
const route = model.toLowerCase().replace(/^antigravity-/, "").replace(/^gemini-(?=claude-)/, "").replace(/-preview(?:-customtools)?$/, "");
|
|
5882
|
-
return (/^claude-(opus|sonnet)-4-6(?:-thinking)?(?:-(?:minimal|low|medium|high))?$/.test(route) || /^gemini-3\.1-pro(?:-(?:low|high))?$/.test(route) || /^gemini-3\.[67]-flash(?:-(?:low|medium|high|tiered))?$/.test(route) || route === "gemini-pro-agent") && getAgyNativeModel(route) === void 0;
|
|
5882
|
+
return (/^claude-(opus|sonnet)-4-6(?:-thinking)?(?:-(?:minimal|low|medium|high))?$/.test(route) || /^gemini-3\.1-pro(?:-(?:low|high))?$/.test(route) || /^gemini-3\.5-flash(?:-(?:low|medium|high|extra-low))?$/.test(route) || /^gemini-3\.[67]-flash(?:-(?:low|medium|high|tiered))?$/.test(route) || route === "gemini-3-flash-agent" || route === "gemini-pro-agent") && getAgyNativeModel(route) === void 0;
|
|
5883
5883
|
}
|
|
5884
5884
|
function pickModelDefinitions(ids) {
|
|
5885
5885
|
return Object.fromEntries(ids.map((id) => [id, ALL_MODEL_DEFINITIONS[id]]));
|
|
@@ -6067,36 +6067,12 @@ var init_model_registry = __esm({
|
|
|
6067
6067
|
supportsThinking: true,
|
|
6068
6068
|
vertexModelId: "openai/gpt-oss-120b-maas"
|
|
6069
6069
|
},
|
|
6070
|
-
"gemini-3.5-flash-extra-low": {
|
|
6071
|
-
displayName: "Gemini 3.5 Flash (Low)",
|
|
6072
|
-
maxTokens: 1048576,
|
|
6073
|
-
maxOutputTokens: 65536,
|
|
6074
|
-
model: "MODEL_PLACEHOLDER_M187",
|
|
6075
|
-
thinkingBudget: 1e3,
|
|
6076
|
-
supportsThinking: true
|
|
6077
|
-
},
|
|
6078
|
-
"gemini-3.5-flash-low": {
|
|
6079
|
-
displayName: "Gemini 3.5 Flash (Medium)",
|
|
6080
|
-
maxTokens: 1048576,
|
|
6081
|
-
maxOutputTokens: 65536,
|
|
6082
|
-
model: "MODEL_PLACEHOLDER_M20",
|
|
6083
|
-
thinkingBudget: 4e3,
|
|
6084
|
-
supportsThinking: true
|
|
6085
|
-
},
|
|
6086
|
-
"gemini-3-flash-agent": {
|
|
6087
|
-
displayName: "Gemini 3.5 Flash (High)",
|
|
6088
|
-
maxTokens: 1048576,
|
|
6089
|
-
maxOutputTokens: 65536,
|
|
6090
|
-
model: "MODEL_PLACEHOLDER_M84",
|
|
6091
|
-
thinkingBudget: -1,
|
|
6092
|
-
supportsThinking: true
|
|
6093
|
-
},
|
|
6094
6070
|
"gemini-3.1-flash-image": {
|
|
6095
6071
|
displayName: "Gemini 3.1 Flash Image",
|
|
6096
6072
|
model: "MODEL_PLACEHOLDER_M21"
|
|
6097
6073
|
}
|
|
6098
6074
|
};
|
|
6099
|
-
RETIRED_AGY_MODEL_MESSAGE = "This Antigravity model is no longer offered.
|
|
6075
|
+
RETIRED_AGY_MODEL_MESSAGE = "This Antigravity model is no longer offered. Use Gemini 3.8 Flash, or Claude Sonnet 5.5 or Opus 5.5.";
|
|
6100
6076
|
ALL_MODEL_DEFINITIONS = {
|
|
6101
6077
|
"antigravity-gemini-4-argon": defineModel("antigravity-gemini-4-argon", {
|
|
6102
6078
|
name: "Gemini 4 Argon (Antigravity)",
|
|
@@ -6109,17 +6085,6 @@ var init_model_registry = __esm({
|
|
|
6109
6085
|
high: { thinkingLevel: "high" }
|
|
6110
6086
|
}
|
|
6111
6087
|
}),
|
|
6112
|
-
"antigravity-gemini-3.5-flash": defineModel("antigravity-gemini-3.5-flash", {
|
|
6113
|
-
name: "Gemini 3.5 Flash (Antigravity)",
|
|
6114
|
-
reasoning: true,
|
|
6115
|
-
limit: { context: 1048576, output: 65536 },
|
|
6116
|
-
modalities: DEFAULT_MODALITIES,
|
|
6117
|
-
variants: {
|
|
6118
|
-
low: { thinkingLevel: "low" },
|
|
6119
|
-
medium: { thinkingLevel: "medium" },
|
|
6120
|
-
high: { thinkingLevel: "high" }
|
|
6121
|
-
}
|
|
6122
|
-
}),
|
|
6123
6088
|
"antigravity-gemini-3.1-flash-image": defineModel("antigravity-gemini-3.1-flash-image", {
|
|
6124
6089
|
name: "Gemini 3.1 Flash Image (Antigravity)",
|
|
6125
6090
|
reasoning: false,
|
|
@@ -6175,7 +6140,6 @@ var init_model_registry = __esm({
|
|
|
6175
6140
|
"gemini-3-flash-low": "gemini-3-flash",
|
|
6176
6141
|
"gemini-3-flash-medium": "gemini-3-flash",
|
|
6177
6142
|
"gemini-3-flash-high": "gemini-3-flash",
|
|
6178
|
-
"gemini-3.5-flash-low": "gemini-3.5-flash",
|
|
6179
6143
|
"gemini-3.5-flash-medium": "gemini-3.5-flash",
|
|
6180
6144
|
"gemini-3.5-flash-high": "gemini-3.5-flash",
|
|
6181
6145
|
"gemini-3.6-flash-low": "gemini-3.6-flash",
|
|
@@ -6245,9 +6209,6 @@ var init_model_registry = __esm({
|
|
|
6245
6209
|
"gemini-3.1-pro-low": "gemini",
|
|
6246
6210
|
"gemini-3.1-pro-high": "gemini",
|
|
6247
6211
|
"gemini-3-flash": "gemini",
|
|
6248
|
-
"gemini-3-flash-agent": "gemini",
|
|
6249
|
-
"gemini-3.5-flash-low": "gemini",
|
|
6250
|
-
"gemini-3.5-flash-extra-low": "gemini",
|
|
6251
6212
|
"gemini-3.6-flash-low": "gemini",
|
|
6252
6213
|
"gemini-3.6-flash-medium": "gemini",
|
|
6253
6214
|
"gemini-3.6-flash-high": "gemini",
|
|
@@ -6267,7 +6228,6 @@ var init_model_registry = __esm({
|
|
|
6267
6228
|
ANTIGRAVITY_OPENCODE_MODEL_IDS = [
|
|
6268
6229
|
"antigravity-gemini-4-argon",
|
|
6269
6230
|
"antigravity-gemini-3.8-flash",
|
|
6270
|
-
"antigravity-gemini-3.5-flash",
|
|
6271
6231
|
"antigravity-gemini-3.1-flash-image",
|
|
6272
6232
|
"antigravity-claude-sonnet-5-5",
|
|
6273
6233
|
"antigravity-claude-opus-5-5",
|
|
@@ -10385,6 +10345,9 @@ var init_agy_request_metadata = __esm({
|
|
|
10385
10345
|
}
|
|
10386
10346
|
};
|
|
10387
10347
|
HISTORICAL_AGY_MODEL_ENUMS = {
|
|
10348
|
+
"gemini-3.5-flash-extra-low": "MODEL_PLACEHOLDER_M187",
|
|
10349
|
+
"gemini-3.5-flash-low": "MODEL_PLACEHOLDER_M20",
|
|
10350
|
+
"gemini-3-flash-agent": "MODEL_PLACEHOLDER_M84",
|
|
10388
10351
|
"gemini-3.1-pro-low": "MODEL_PLACEHOLDER_M36",
|
|
10389
10352
|
"gemini-3.1-pro-high": "MODEL_PLACEHOLDER_M37",
|
|
10390
10353
|
"gemini-pro-agent": "MODEL_PLACEHOLDER_M16",
|
|
@@ -14951,7 +14914,7 @@ var init_attribution = __esm({
|
|
|
14951
14914
|
});
|
|
14952
14915
|
|
|
14953
14916
|
// ../core/dist/common-auth-embedded/store/limits-namespace.js
|
|
14954
|
-
async function updatePoolLimitsNamespace(rt, mutator) {
|
|
14917
|
+
async function updatePoolLimitsNamespace(rt, mutator, options = {}) {
|
|
14955
14918
|
assertLimitsWriteAllowed();
|
|
14956
14919
|
const { ctx } = rt;
|
|
14957
14920
|
await runOperation(ctx, "updateLimitsNamespace", void 0, void 0, async (locks, progress) => {
|
|
@@ -14971,13 +14934,21 @@ async function updatePoolLimitsNamespace(rt, mutator) {
|
|
|
14971
14934
|
operation: "updateLimitsNamespace",
|
|
14972
14935
|
rowId: void 0
|
|
14973
14936
|
};
|
|
14974
|
-
|
|
14975
|
-
|
|
14976
|
-
|
|
14977
|
-
|
|
14978
|
-
|
|
14979
|
-
|
|
14937
|
+
try {
|
|
14938
|
+
await writeJsonAtomic2(ctx.configPath, config, {
|
|
14939
|
+
beforeRename: async () => {
|
|
14940
|
+
await ctx.onStep?.("before-config-write", info);
|
|
14941
|
+
await locks.assertAll();
|
|
14942
|
+
options.beforePublish?.();
|
|
14943
|
+
}
|
|
14944
|
+
});
|
|
14945
|
+
} catch (error) {
|
|
14946
|
+
if (error && typeof error === "object" && "published" in error && error.published === true)
|
|
14947
|
+
options.onPublished?.();
|
|
14948
|
+
throw error;
|
|
14949
|
+
}
|
|
14980
14950
|
progress.writes++;
|
|
14951
|
+
options.onPublished?.();
|
|
14981
14952
|
await ctx.onStep?.("after-config-write", info);
|
|
14982
14953
|
});
|
|
14983
14954
|
}
|
|
@@ -17322,11 +17293,11 @@ var init_refresh = __esm({
|
|
|
17322
17293
|
});
|
|
17323
17294
|
|
|
17324
17295
|
// ../core/dist/common-auth-embedded/fs/file-read-cache.js
|
|
17325
|
-
import { lstat as lstat4 } from "node:fs/promises";
|
|
17296
|
+
import { lstat as lstat4, stat as stat4 } from "node:fs/promises";
|
|
17326
17297
|
import { resolve as resolve5 } from "node:path";
|
|
17327
|
-
async function identity(path5) {
|
|
17298
|
+
async function identity(path5, followSymlinks) {
|
|
17328
17299
|
try {
|
|
17329
|
-
const metadata = await lstat4(path5);
|
|
17300
|
+
const metadata = await (followSymlinks ? stat4(path5) : lstat4(path5));
|
|
17330
17301
|
return metadata.isFile() ? metadata : void 0;
|
|
17331
17302
|
} catch (error) {
|
|
17332
17303
|
return error.code === "ENOENT" ? "absent" : void 0;
|
|
@@ -17342,11 +17313,15 @@ var init_file_read_cache = __esm({
|
|
|
17342
17313
|
"../core/dist/common-auth-embedded/fs/file-read-cache.js"() {
|
|
17343
17314
|
"use strict";
|
|
17344
17315
|
FileReadCache = class {
|
|
17316
|
+
#followSymlinks;
|
|
17345
17317
|
#entries = /* @__PURE__ */ new Map();
|
|
17318
|
+
constructor(options = {}) {
|
|
17319
|
+
this.#followSymlinks = options.followSymlinks ?? false;
|
|
17320
|
+
}
|
|
17346
17321
|
async read(paths, read, validateHit) {
|
|
17347
17322
|
const resolvedPaths = paths.map((path5) => resolve5(path5));
|
|
17348
17323
|
const key = JSON.stringify(resolvedPaths);
|
|
17349
|
-
const probed = await Promise.all(resolvedPaths.map(identity));
|
|
17324
|
+
const probed = await Promise.all(resolvedPaths.map((path5) => identity(path5, this.#followSymlinks)));
|
|
17350
17325
|
const identities = probed.every((entry) => entry !== void 0) ? probed : void 0;
|
|
17351
17326
|
const cached = this.#entries.get(key);
|
|
17352
17327
|
if (identities && cached && identities.every((entry, index) => {
|
|
@@ -17583,7 +17558,7 @@ function openPoolStore(options) {
|
|
|
17583
17558
|
reorder: (ids, callOptions) => reorderRows(rt, ids, callOptions),
|
|
17584
17559
|
readSettings: () => readPoolSettings(rt),
|
|
17585
17560
|
updateSettings: (mutator, callOptions) => updatePoolSettings(rt, mutator, callOptions),
|
|
17586
|
-
updateLimitsNamespace: (mutator) => updatePoolLimitsNamespace(rt, mutator),
|
|
17561
|
+
updateLimitsNamespace: (mutator, options2) => updatePoolLimitsNamespace(rt, mutator, options2),
|
|
17587
17562
|
recordIdentity: (id, identity3, attribution, callOptions) => recordRowIdentity(rt, id, identity3, attribution, callOptions),
|
|
17588
17563
|
refresh: (id, provider2, callOptions) => refreshRow(rt, id, provider2, callOptions),
|
|
17589
17564
|
recordQuota: record3,
|
|
@@ -21094,7 +21069,7 @@ var init_any_signal = __esm({
|
|
|
21094
21069
|
// ../core/dist/common-auth-embedded/claustrum/enrollment.js
|
|
21095
21070
|
import { createHash as createHash6, randomBytes as randomBytes4, randomUUID as randomUUID12 } from "node:crypto";
|
|
21096
21071
|
import { constants as fsConstants } from "node:fs";
|
|
21097
|
-
import { chmod as chmod2, mkdir as mkdir8, open as open6, readFile as readFile6, realpath as realpath3, rename as rename7, stat as
|
|
21072
|
+
import { chmod as chmod2, mkdir as mkdir8, open as open6, readFile as readFile6, realpath as realpath3, rename as rename7, stat as stat5, unlink as unlink6 } from "node:fs/promises";
|
|
21098
21073
|
import { basename as basename3, dirname as dirname9, extname, isAbsolute as isAbsolute2, join as join7, resolve as resolve7 } from "node:path";
|
|
21099
21074
|
import { ClaustrumCredentialError as ClaustrumCredentialError2, ClaustrumClient as ClaustrumWireClient, writeEnrollmentTokenFile } from "@cortexkit/claustrum-client";
|
|
21100
21075
|
function classifyEnrollmentError(error) {
|
|
@@ -21314,7 +21289,7 @@ async function refuseWritableAncestor(parent, options = {}) {
|
|
|
21314
21289
|
}
|
|
21315
21290
|
let privateGroup;
|
|
21316
21291
|
for (; ; ) {
|
|
21317
|
-
const metadata = await
|
|
21292
|
+
const metadata = await stat5(component).catch(() => void 0);
|
|
21318
21293
|
if (metadata && (metadata.mode & 18) !== 0 && (metadata.mode & 512) === 0) {
|
|
21319
21294
|
if (privateGroup === void 0) {
|
|
21320
21295
|
privateGroup = gid !== void 0 && await isPrivateGroup(uid, gid, options);
|
|
@@ -21343,7 +21318,7 @@ async function ensureClaustrumPrivateDirectory(directory, options = {}, what = "
|
|
|
21343
21318
|
return;
|
|
21344
21319
|
}
|
|
21345
21320
|
await mkdir8(directory, { recursive: true, mode: 448 });
|
|
21346
|
-
const metadata = await
|
|
21321
|
+
const metadata = await stat5(directory);
|
|
21347
21322
|
const uid = process.geteuid?.();
|
|
21348
21323
|
if (uid !== void 0 && metadata.uid !== uid) {
|
|
21349
21324
|
throw new ClaustrumConsumerError("unsafe-file", `Claustrum ${what} must be owned by the current user`);
|
|
@@ -22824,7 +22799,7 @@ var init_interlock = __esm({
|
|
|
22824
22799
|
|
|
22825
22800
|
// ../core/dist/common-auth-embedded/claustrum/roster.js
|
|
22826
22801
|
import { createHash as createHash7 } from "node:crypto";
|
|
22827
|
-
import { stat as
|
|
22802
|
+
import { stat as stat6 } from "node:fs/promises";
|
|
22828
22803
|
import { resolve as resolve8 } from "node:path";
|
|
22829
22804
|
function vaultRosterSeed(roster) {
|
|
22830
22805
|
return {
|
|
@@ -23055,6 +23030,12 @@ function decodedVaultRoster(roster) {
|
|
|
23055
23030
|
return decodeRoster(JSON.parse(JSON.stringify(roster)));
|
|
23056
23031
|
}
|
|
23057
23032
|
async function readVaultRoster(path5) {
|
|
23033
|
+
if (windowsPrivateFiles)
|
|
23034
|
+
return readFreshVaultRoster(path5);
|
|
23035
|
+
const roster = await rosterReadCache.read([path5], ([resolvedPath = path5]) => readFreshVaultRoster(resolvedPath));
|
|
23036
|
+
return structuredClone(roster);
|
|
23037
|
+
}
|
|
23038
|
+
async function readFreshVaultRoster(path5) {
|
|
23058
23039
|
let text2;
|
|
23059
23040
|
try {
|
|
23060
23041
|
text2 = await readPrivateText(path5, windowsPrivateFiles);
|
|
@@ -23073,19 +23054,26 @@ async function readVaultRoster(path5) {
|
|
|
23073
23054
|
}
|
|
23074
23055
|
async function mutateVaultRoster(path5, change, options = {}) {
|
|
23075
23056
|
return withLock(path5, { ...WRITE_LOCK, signal: options.signal }, async (lock) => {
|
|
23076
|
-
const current = await
|
|
23057
|
+
const current = await readFreshVaultRoster(path5);
|
|
23077
23058
|
const { next, result } = await change(current, {
|
|
23078
23059
|
assertOwned: () => lock.assertOwned()
|
|
23079
23060
|
});
|
|
23080
23061
|
if (next) {
|
|
23081
23062
|
await lock.assertOwned();
|
|
23082
|
-
|
|
23083
|
-
|
|
23084
|
-
|
|
23085
|
-
|
|
23086
|
-
|
|
23087
|
-
|
|
23088
|
-
|
|
23063
|
+
try {
|
|
23064
|
+
await writeJsonAtomic2(path5, next, {
|
|
23065
|
+
beforeRename: async () => {
|
|
23066
|
+
await options.beforePublish?.();
|
|
23067
|
+
options.signal?.throwIfAborted();
|
|
23068
|
+
await lock.assertOwned();
|
|
23069
|
+
}
|
|
23070
|
+
});
|
|
23071
|
+
} catch (error) {
|
|
23072
|
+
if (error && typeof error === "object" && "published" in error && error.published === true)
|
|
23073
|
+
options.onPublished?.();
|
|
23074
|
+
throw error;
|
|
23075
|
+
}
|
|
23076
|
+
options.onPublished?.();
|
|
23089
23077
|
}
|
|
23090
23078
|
return result;
|
|
23091
23079
|
});
|
|
@@ -23233,7 +23221,7 @@ function isVaultRosterLockRefusal(path5, error) {
|
|
|
23233
23221
|
}
|
|
23234
23222
|
async function fileStamp(path5) {
|
|
23235
23223
|
try {
|
|
23236
|
-
const { dev, ino, size, mtimeMs } = await
|
|
23224
|
+
const { dev, ino, size, mtimeMs } = await stat6(path5);
|
|
23237
23225
|
return { dev, ino, size, mtimeMs };
|
|
23238
23226
|
} catch {
|
|
23239
23227
|
return void 0;
|
|
@@ -23373,10 +23361,11 @@ function resolveVaultPrimary(input2) {
|
|
|
23373
23361
|
...previous && previous.accountIdentity !== identity3 && { replaced: previous }
|
|
23374
23362
|
};
|
|
23375
23363
|
}
|
|
23376
|
-
var DEFAULT_ROUTE_PREFIX, SKIPPED_REASONS, WRITE_LOCK, DISCOVERY_LEASE, pendingDiscoveries, UNLOCKED_READ_ATTEMPTS;
|
|
23364
|
+
var DEFAULT_ROUTE_PREFIX, SKIPPED_REASONS, rosterReadCache, WRITE_LOCK, DISCOVERY_LEASE, pendingDiscoveries, UNLOCKED_READ_ATTEMPTS;
|
|
23377
23365
|
var init_roster = __esm({
|
|
23378
23366
|
"../core/dist/common-auth-embedded/claustrum/roster.js"() {
|
|
23379
23367
|
"use strict";
|
|
23368
|
+
init_file_read_cache();
|
|
23380
23369
|
init_fs();
|
|
23381
23370
|
init_private_files();
|
|
23382
23371
|
init_quota();
|
|
@@ -23391,6 +23380,9 @@ var init_roster = __esm({
|
|
|
23391
23380
|
"blank account identity",
|
|
23392
23381
|
"empty state"
|
|
23393
23382
|
]);
|
|
23383
|
+
rosterReadCache = new FileReadCache({
|
|
23384
|
+
followSymlinks: true
|
|
23385
|
+
});
|
|
23394
23386
|
WRITE_LOCK = {
|
|
23395
23387
|
name: "claustrum-roster-write",
|
|
23396
23388
|
ttlMs: 1e4,
|
|
@@ -24446,7 +24438,7 @@ var init_consumer = __esm({
|
|
|
24446
24438
|
// ../core/dist/common-auth-embedded/claustrum/hub.js
|
|
24447
24439
|
import { createHash as createHash8 } from "node:crypto";
|
|
24448
24440
|
import { channel as channel2 } from "node:diagnostics_channel";
|
|
24449
|
-
import { readdir, stat as
|
|
24441
|
+
import { readdir, stat as stat7 } from "node:fs/promises";
|
|
24450
24442
|
import { dirname as dirname10, join as join8, resolve as resolve10 } from "node:path";
|
|
24451
24443
|
function canonicalJson3(value, path5 = /* @__PURE__ */ new Set()) {
|
|
24452
24444
|
if (value === null)
|
|
@@ -25187,7 +25179,7 @@ var init_hub = __esm({
|
|
|
25187
25179
|
let newest;
|
|
25188
25180
|
for (const path5 of candidates) {
|
|
25189
25181
|
try {
|
|
25190
|
-
const modified = (await
|
|
25182
|
+
const modified = (await stat7(path5)).mtimeMs;
|
|
25191
25183
|
const roster = await readVaultRoster(path5);
|
|
25192
25184
|
if (roster && (!newest || modified > newest.modified))
|
|
25193
25185
|
newest = { modified, roster };
|
|
@@ -25554,7 +25546,7 @@ var init_claustrum = __esm({
|
|
|
25554
25546
|
|
|
25555
25547
|
// ../core/dist/common-auth-embedded/pi-slot/lock.js
|
|
25556
25548
|
import { rmdirSync, statSync as statSync2, utimesSync } from "node:fs";
|
|
25557
|
-
import { mkdir as mkdir9, rmdir, stat as
|
|
25549
|
+
import { mkdir as mkdir9, rmdir, stat as stat8, utimes } from "node:fs/promises";
|
|
25558
25550
|
function sameDirectory(observed, identity3) {
|
|
25559
25551
|
return observed.dev === identity3.dev && observed.ino === identity3.ino;
|
|
25560
25552
|
}
|
|
@@ -25582,7 +25574,7 @@ async function acquire(path5, stale) {
|
|
|
25582
25574
|
throw held();
|
|
25583
25575
|
let mtime;
|
|
25584
25576
|
try {
|
|
25585
|
-
mtime = (await
|
|
25577
|
+
mtime = (await stat8(path5)).mtime.getTime();
|
|
25586
25578
|
} catch (error2) {
|
|
25587
25579
|
if (errorCode(error2) === "ENOENT")
|
|
25588
25580
|
return acquire(path5, 0);
|
|
@@ -25595,7 +25587,7 @@ async function acquire(path5, stale) {
|
|
|
25595
25587
|
}
|
|
25596
25588
|
let created;
|
|
25597
25589
|
try {
|
|
25598
|
-
const st = await
|
|
25590
|
+
const st = await stat8(path5);
|
|
25599
25591
|
created = { dev: st.dev, ino: st.ino };
|
|
25600
25592
|
} catch {
|
|
25601
25593
|
created = void 0;
|
|
@@ -25605,14 +25597,14 @@ async function acquire(path5, stale) {
|
|
|
25605
25597
|
const probe = new Date(Math.ceil(Date.now() / 1e3) * 1e3 + 5);
|
|
25606
25598
|
await utimes(path5, probe, probe);
|
|
25607
25599
|
}
|
|
25608
|
-
const observed = await
|
|
25600
|
+
const observed = await stat8(path5);
|
|
25609
25601
|
const mtime = observed.mtime.getTime();
|
|
25610
25602
|
precision ??= mtime % 1e3 === 0 ? "s" : "ms";
|
|
25611
25603
|
return { dev: observed.dev, ino: observed.ino, mtime };
|
|
25612
25604
|
} catch (error) {
|
|
25613
25605
|
try {
|
|
25614
25606
|
if (created) {
|
|
25615
|
-
const current = await
|
|
25607
|
+
const current = await stat8(path5).catch(() => void 0);
|
|
25616
25608
|
if (current && current.dev === created.dev && current.ino === created.ino)
|
|
25617
25609
|
await remove(path5).catch(() => {
|
|
25618
25610
|
});
|
|
@@ -25712,7 +25704,7 @@ async function acquirePiLock(authPath, onCompromised, onRenew) {
|
|
|
25712
25704
|
}
|
|
25713
25705
|
let observed;
|
|
25714
25706
|
try {
|
|
25715
|
-
observed = await
|
|
25707
|
+
observed = await stat8(path5);
|
|
25716
25708
|
} catch (error) {
|
|
25717
25709
|
if (errorCode(error) !== "ENOENT")
|
|
25718
25710
|
throw error;
|
|
@@ -25851,13 +25843,13 @@ async function safeRead(path5, privateFile = false, afterReadCheck) {
|
|
|
25851
25843
|
let file;
|
|
25852
25844
|
try {
|
|
25853
25845
|
file = await open7(path5, constants2.O_RDONLY | constants2.O_NOFOLLOW);
|
|
25854
|
-
const
|
|
25855
|
-
if (!
|
|
25846
|
+
const stat18 = await file.stat();
|
|
25847
|
+
if (!stat18.isFile() || privateFile && (stat18.mode & 511) !== 384) {
|
|
25856
25848
|
throw new PiSlotError("unsafe-path");
|
|
25857
25849
|
}
|
|
25858
25850
|
await afterReadCheck?.(path5);
|
|
25859
25851
|
const current = await lstat5(path5);
|
|
25860
|
-
if (!current.isFile() || current.dev !==
|
|
25852
|
+
if (!current.isFile() || current.dev !== stat18.dev || current.ino !== stat18.ino) {
|
|
25861
25853
|
throw new PiSlotError("unsafe-path");
|
|
25862
25854
|
}
|
|
25863
25855
|
const bytes = await file.readFile();
|
|
@@ -30635,7 +30627,7 @@ var init_vault_insula_quota = __esm({
|
|
|
30635
30627
|
});
|
|
30636
30628
|
|
|
30637
30629
|
// src/plugin/vault-custody.ts
|
|
30638
|
-
import { chmod as chmod3, mkdir as mkdir11, readFile as readFile9, stat as
|
|
30630
|
+
import { chmod as chmod3, mkdir as mkdir11, readFile as readFile9, stat as stat9 } from "node:fs/promises";
|
|
30639
30631
|
import { join as join11 } from "node:path";
|
|
30640
30632
|
async function enrollmentFilesIdentity(paths) {
|
|
30641
30633
|
const takenAt = performance.now();
|
|
@@ -30643,7 +30635,7 @@ async function enrollmentFilesIdentity(paths) {
|
|
|
30643
30635
|
const parts = [];
|
|
30644
30636
|
for (const path5 of [paths.tokenPath, paths.statePath]) {
|
|
30645
30637
|
try {
|
|
30646
|
-
const info = await
|
|
30638
|
+
const info = await stat9(path5, { bigint: true });
|
|
30647
30639
|
if (info.ino === 0n) coarse = true;
|
|
30648
30640
|
parts.push(
|
|
30649
30641
|
`${info.dev}:${info.ino}:${info.size}:${info.mtimeNs}:${info.ctimeNs}`
|
|
@@ -31539,7 +31531,7 @@ var init_process_heartbeat = __esm({
|
|
|
31539
31531
|
});
|
|
31540
31532
|
|
|
31541
31533
|
// src/version-fence.ts
|
|
31542
|
-
import { readdir as readdir2, readFile as readFile11, stat as
|
|
31534
|
+
import { readdir as readdir2, readFile as readFile11, stat as stat10, unlink as unlink9 } from "node:fs/promises";
|
|
31543
31535
|
import { homedir as homedir3, uptime } from "node:os";
|
|
31544
31536
|
import { join as join13 } from "node:path";
|
|
31545
31537
|
function defaultStateHome() {
|
|
@@ -31659,7 +31651,7 @@ async function staleRecord(path5, record3, boot, heartbeat) {
|
|
|
31659
31651
|
let start = heartbeat ? record3.startedAt : void 0;
|
|
31660
31652
|
if (start === void 0) {
|
|
31661
31653
|
try {
|
|
31662
|
-
start = (await
|
|
31654
|
+
start = (await stat10(path5)).mtimeMs;
|
|
31663
31655
|
} catch {
|
|
31664
31656
|
return false;
|
|
31665
31657
|
}
|
|
@@ -31788,7 +31780,7 @@ import {
|
|
|
31788
31780
|
readFile as readFile12,
|
|
31789
31781
|
rename as rename10,
|
|
31790
31782
|
rmdir as rmdir2,
|
|
31791
|
-
stat as
|
|
31783
|
+
stat as stat11,
|
|
31792
31784
|
unlink as unlink10
|
|
31793
31785
|
} from "node:fs/promises";
|
|
31794
31786
|
import { basename as basename4, dirname as dirname15, join as join14, resolve as resolve15 } from "node:path";
|
|
@@ -32707,7 +32699,7 @@ async function physicalAliases(location, files) {
|
|
|
32707
32699
|
async function samePhysical(a, b) {
|
|
32708
32700
|
const id = async (path5) => {
|
|
32709
32701
|
try {
|
|
32710
|
-
const info = await
|
|
32702
|
+
const info = await stat11(path5, { bigint: true });
|
|
32711
32703
|
return info.ino === 0n ? void 0 : `${info.dev}:${info.ino}`;
|
|
32712
32704
|
} catch (error) {
|
|
32713
32705
|
const code2 = error.code;
|
|
@@ -32973,7 +32965,7 @@ function lockHolderText(name) {
|
|
|
32973
32965
|
}
|
|
32974
32966
|
async function exists2(path5) {
|
|
32975
32967
|
try {
|
|
32976
|
-
await
|
|
32968
|
+
await stat11(path5);
|
|
32977
32969
|
return true;
|
|
32978
32970
|
} catch (error) {
|
|
32979
32971
|
const code2 = error.code;
|
|
@@ -35017,7 +35009,7 @@ function extractAccountAccessErrorDetails(bodyText) {
|
|
|
35017
35009
|
};
|
|
35018
35010
|
}
|
|
35019
35011
|
function buildAccountAccessProbeRequest(projectId) {
|
|
35020
|
-
const wireModel = "gemini-3.
|
|
35012
|
+
const wireModel = "gemini-3.8-flash-low";
|
|
35021
35013
|
const request = {
|
|
35022
35014
|
contents: [{ role: "user", parts: [{ text: "ping" }] }],
|
|
35023
35015
|
generationConfig: { maxOutputTokens: 1, temperature: 0 }
|
|
@@ -43637,8 +43629,8 @@ function prepareAntigravityRequestIn(wire, input2, init, accessToken, projectId,
|
|
|
43637
43629
|
} else {
|
|
43638
43630
|
const requestPayload = { ...parsedBody };
|
|
43639
43631
|
if (isImageGenerationModel(effectiveModel) && isOpenCodeTitleGenerationRequest(requestPayload)) {
|
|
43640
|
-
effectiveModel = "gemini-3.
|
|
43641
|
-
tierThinkingBudget =
|
|
43632
|
+
effectiveModel = "gemini-3.8-flash-low";
|
|
43633
|
+
tierThinkingBudget = 1e3;
|
|
43642
43634
|
tierThinkingLevel = void 0;
|
|
43643
43635
|
}
|
|
43644
43636
|
const rawGenerationConfig = requestPayload.generationConfig;
|
|
@@ -45939,7 +45931,7 @@ function prepareAgyWireRequest(wire, request) {
|
|
|
45939
45931
|
request.options
|
|
45940
45932
|
);
|
|
45941
45933
|
}
|
|
45942
|
-
var TITLE_FALLBACK_MODEL = "gemini-3.
|
|
45934
|
+
var TITLE_FALLBACK_MODEL = "gemini-3.8-flash-low";
|
|
45943
45935
|
function routeTitleModel(url) {
|
|
45944
45936
|
const model = extractModelFromUrl(url);
|
|
45945
45937
|
if (model === null) return url;
|
|
@@ -53638,16 +53630,16 @@ async function select2(terminal, items, options) {
|
|
|
53638
53630
|
// src/common-auth-embedded/claustrum/enrollment.js
|
|
53639
53631
|
import { createHash as createHash19, randomBytes as randomBytes6, randomUUID as randomUUID19 } from "node:crypto";
|
|
53640
53632
|
import { constants as fsConstants2 } from "node:fs";
|
|
53641
|
-
import { chmod as chmod6, mkdir as mkdir15, open as open10, readFile as readFile14, realpath as realpath4, rename as rename12, stat as
|
|
53633
|
+
import { chmod as chmod6, mkdir as mkdir15, open as open10, readFile as readFile14, realpath as realpath4, rename as rename12, stat as stat14, unlink as unlink11 } from "node:fs/promises";
|
|
53642
53634
|
import { basename as basename6, dirname as dirname22, extname as extname2, isAbsolute as isAbsolute4, join as join26, resolve as resolve22 } from "node:path";
|
|
53643
53635
|
import { ClaustrumCredentialError as ClaustrumCredentialError6, ClaustrumClient as ClaustrumWireClient2, writeEnrollmentTokenFile as writeEnrollmentTokenFile2 } from "@cortexkit/claustrum-client";
|
|
53644
53636
|
|
|
53645
53637
|
// src/common-auth-embedded/fs/file-read-cache.js
|
|
53646
|
-
import { lstat as lstat7 } from "node:fs/promises";
|
|
53638
|
+
import { lstat as lstat7, stat as stat12 } from "node:fs/promises";
|
|
53647
53639
|
import { resolve as resolve21 } from "node:path";
|
|
53648
|
-
async function identity2(path5) {
|
|
53640
|
+
async function identity2(path5, followSymlinks) {
|
|
53649
53641
|
try {
|
|
53650
|
-
const metadata = await lstat7(path5);
|
|
53642
|
+
const metadata = await (followSymlinks ? stat12(path5) : lstat7(path5));
|
|
53651
53643
|
return metadata.isFile() ? metadata : void 0;
|
|
53652
53644
|
} catch (error) {
|
|
53653
53645
|
return error.code === "ENOENT" ? "absent" : void 0;
|
|
@@ -53659,11 +53651,15 @@ function sameIdentity2(left, right) {
|
|
|
53659
53651
|
return left.dev === right.dev && left.ino === right.ino && left.size === right.size && left.mtimeMs === right.mtimeMs && left.ctimeMs === right.ctimeMs;
|
|
53660
53652
|
}
|
|
53661
53653
|
var FileReadCache2 = class {
|
|
53654
|
+
#followSymlinks;
|
|
53662
53655
|
#entries = /* @__PURE__ */ new Map();
|
|
53656
|
+
constructor(options = {}) {
|
|
53657
|
+
this.#followSymlinks = options.followSymlinks ?? false;
|
|
53658
|
+
}
|
|
53663
53659
|
async read(paths, read, validateHit) {
|
|
53664
53660
|
const resolvedPaths = paths.map((path5) => resolve21(path5));
|
|
53665
53661
|
const key = JSON.stringify(resolvedPaths);
|
|
53666
|
-
const probed = await Promise.all(resolvedPaths.map(identity2));
|
|
53662
|
+
const probed = await Promise.all(resolvedPaths.map((path5) => identity2(path5, this.#followSymlinks)));
|
|
53667
53663
|
const identities = probed.every((entry) => entry !== void 0) ? probed : void 0;
|
|
53668
53664
|
const cached = this.#entries.get(key);
|
|
53669
53665
|
if (identities && cached && identities.every((entry, index) => {
|
|
@@ -53712,7 +53708,7 @@ init_private_files2();
|
|
|
53712
53708
|
// src/common-auth-embedded/fs/refresh-file-lock.js
|
|
53713
53709
|
init_private_files2();
|
|
53714
53710
|
import { randomUUID as randomUUID18 } from "node:crypto";
|
|
53715
|
-
import { lstat as lstat8, mkdir as mkdir14, open as open9, readFile as readFile13, rename as rename11, rm as rm6, stat as
|
|
53711
|
+
import { lstat as lstat8, mkdir as mkdir14, open as open9, readFile as readFile13, rename as rename11, rm as rm6, stat as stat13 } from "node:fs/promises";
|
|
53716
53712
|
import { dirname as dirname21, join as join25 } from "node:path";
|
|
53717
53713
|
|
|
53718
53714
|
// src/common-auth-embedded/fs/with-lock.js
|
|
@@ -53966,7 +53962,7 @@ async function acquireRefreshFileLockWithClock2(options) {
|
|
|
53966
53962
|
};
|
|
53967
53963
|
}
|
|
53968
53964
|
try {
|
|
53969
|
-
const current = await
|
|
53965
|
+
const current = await stat13(lockPath);
|
|
53970
53966
|
const legacyExpiry = Number.isFinite(expiresAt) ? expiresAt : current.mtimeMs + options.ttlMs;
|
|
53971
53967
|
if (legacyExpiry > now())
|
|
53972
53968
|
return { status: "live" };
|
|
@@ -54060,7 +54056,7 @@ async function acquireRefreshFileLockWithClock2(options) {
|
|
|
54060
54056
|
if (!ownedDirectory)
|
|
54061
54057
|
return false;
|
|
54062
54058
|
try {
|
|
54063
|
-
await
|
|
54059
|
+
await stat13(evictOwnerPath);
|
|
54064
54060
|
return false;
|
|
54065
54061
|
} catch (error) {
|
|
54066
54062
|
if (error.code !== "ENOENT")
|
|
@@ -54081,7 +54077,7 @@ async function acquireRefreshFileLockWithClock2(options) {
|
|
|
54081
54077
|
return false;
|
|
54082
54078
|
stillOurs = true;
|
|
54083
54079
|
try {
|
|
54084
|
-
await
|
|
54080
|
+
await stat13(evictOwnerPath);
|
|
54085
54081
|
return false;
|
|
54086
54082
|
} catch (error) {
|
|
54087
54083
|
return error.code === "ENOENT";
|
|
@@ -54131,7 +54127,7 @@ async function acquireRefreshFileLockWithClock2(options) {
|
|
|
54131
54127
|
async function recoverStaleEvictionMarker(deadline) {
|
|
54132
54128
|
let evictStat;
|
|
54133
54129
|
try {
|
|
54134
|
-
evictStat = await
|
|
54130
|
+
evictStat = await stat13(evictPath);
|
|
54135
54131
|
} catch (error) {
|
|
54136
54132
|
if (error.code === "ENOENT")
|
|
54137
54133
|
return "missing";
|
|
@@ -54149,7 +54145,7 @@ async function acquireRefreshFileLockWithClock2(options) {
|
|
|
54149
54145
|
if (evictStat.mtimeMs + EVICT_TTL > now()) {
|
|
54150
54146
|
let hasOwner = true;
|
|
54151
54147
|
try {
|
|
54152
|
-
await
|
|
54148
|
+
await stat13(evictOwnerPath);
|
|
54153
54149
|
} catch (error) {
|
|
54154
54150
|
if (error.code === "ENOENT")
|
|
54155
54151
|
hasOwner = false;
|
|
@@ -54766,7 +54762,7 @@ async function refuseWritableAncestor2(parent, options = {}) {
|
|
|
54766
54762
|
}
|
|
54767
54763
|
let privateGroup;
|
|
54768
54764
|
for (; ; ) {
|
|
54769
|
-
const metadata = await
|
|
54765
|
+
const metadata = await stat14(component).catch(() => void 0);
|
|
54770
54766
|
if (metadata && (metadata.mode & 18) !== 0 && (metadata.mode & 512) === 0) {
|
|
54771
54767
|
if (privateGroup === void 0) {
|
|
54772
54768
|
privateGroup = gid !== void 0 && await isPrivateGroup2(uid, gid, options);
|
|
@@ -54795,7 +54791,7 @@ async function ensureClaustrumPrivateDirectory2(directory, options = {}, what =
|
|
|
54795
54791
|
return;
|
|
54796
54792
|
}
|
|
54797
54793
|
await mkdir15(directory, { recursive: true, mode: 448 });
|
|
54798
|
-
const metadata = await
|
|
54794
|
+
const metadata = await stat14(directory);
|
|
54799
54795
|
const uid = process.geteuid?.();
|
|
54800
54796
|
if (uid !== void 0 && metadata.uid !== uid) {
|
|
54801
54797
|
throw new ClaustrumConsumerError2("unsafe-file", `Claustrum ${what} must be owned by the current user`);
|
|
@@ -55384,7 +55380,7 @@ function setupPaths(io = {}) {
|
|
|
55384
55380
|
}
|
|
55385
55381
|
|
|
55386
55382
|
// src/common-auth-embedded/setup/detect.js
|
|
55387
|
-
function
|
|
55383
|
+
function stat15(path5, kind) {
|
|
55388
55384
|
try {
|
|
55389
55385
|
return statSync5(path5)[kind]();
|
|
55390
55386
|
} catch {
|
|
@@ -55393,12 +55389,12 @@ function stat13(path5, kind) {
|
|
|
55393
55389
|
}
|
|
55394
55390
|
var defaultSetupFileSystem = {
|
|
55395
55391
|
exists: existsSync12,
|
|
55396
|
-
isFile: (path5) =>
|
|
55397
|
-
isDirectory: (path5) =>
|
|
55392
|
+
isFile: (path5) => stat15(path5, "isFile"),
|
|
55393
|
+
isDirectory: (path5) => stat15(path5, "isDirectory"),
|
|
55398
55394
|
isExecutable(path5) {
|
|
55399
55395
|
try {
|
|
55400
55396
|
accessSync(path5, constants3.X_OK);
|
|
55401
|
-
return
|
|
55397
|
+
return stat15(path5, "isFile");
|
|
55402
55398
|
} catch {
|
|
55403
55399
|
return false;
|
|
55404
55400
|
}
|
|
@@ -55897,6 +55893,12 @@ async function connectSetupHost(plugin2, host, io, terminal, fence) {
|
|
|
55897
55893
|
await writeEnrollmentTokenFile3(path5, file);
|
|
55898
55894
|
}
|
|
55899
55895
|
});
|
|
55896
|
+
await fence();
|
|
55897
|
+
const initial = await manager.status();
|
|
55898
|
+
if (initial.state === "approved") {
|
|
55899
|
+
printLine2(terminal, `Already connected as ${initial.approvedName ?? initial.proposedName}.`);
|
|
55900
|
+
return;
|
|
55901
|
+
}
|
|
55900
55902
|
printLine2(terminal, `Asking the vault to connect ${name}\u2026`);
|
|
55901
55903
|
const deadline = now() + ENROLLMENT_WAIT_MS;
|
|
55902
55904
|
let printedRequest;
|
|
@@ -55904,7 +55906,6 @@ async function connectSetupHost(plugin2, host, io, terminal, fence) {
|
|
|
55904
55906
|
let reportedCode;
|
|
55905
55907
|
let failedProposals = 0;
|
|
55906
55908
|
for (; ; ) {
|
|
55907
|
-
await fence();
|
|
55908
55909
|
const status = await manager.reconcile();
|
|
55909
55910
|
if (status.state === "approved") {
|
|
55910
55911
|
printLine2(terminal, `Connected ${host} to Claustrum.`);
|
|
@@ -55950,6 +55951,7 @@ async function connectSetupHost(plugin2, host, io, terminal, fence) {
|
|
|
55950
55951
|
if (remaining <= 0)
|
|
55951
55952
|
break;
|
|
55952
55953
|
await wait2(Math.min(pause, remaining));
|
|
55954
|
+
await fence();
|
|
55953
55955
|
}
|
|
55954
55956
|
if (printedRequest)
|
|
55955
55957
|
throw new HostNotEnrolledError(`Claustrum approval is still pending. In another terminal, run: ${approveCommand(printedRequest, name)} and then rerun setup.`, {
|
|
@@ -56104,7 +56106,7 @@ import { applyEdits, createScanner, findNodeAtLocation, modify, parse as parse2,
|
|
|
56104
56106
|
|
|
56105
56107
|
// src/common-auth-embedded/setup/config-write.js
|
|
56106
56108
|
import { randomUUID as randomUUID20 } from "node:crypto";
|
|
56107
|
-
import { mkdir as mkdir16, open as open11, rename as rename13, stat as
|
|
56109
|
+
import { mkdir as mkdir16, open as open11, rename as rename13, stat as stat16, unlink as unlink12 } from "node:fs/promises";
|
|
56108
56110
|
import { basename as basename7, dirname as dirname23, join as join28 } from "node:path";
|
|
56109
56111
|
import { setTimeout as delay2 } from "node:timers/promises";
|
|
56110
56112
|
async function writeHostConfigAtomic(file, content, options = {}) {
|
|
@@ -56114,7 +56116,7 @@ async function writeHostConfigAtomic(file, content, options = {}) {
|
|
|
56114
56116
|
let mode;
|
|
56115
56117
|
if (!windows2) {
|
|
56116
56118
|
try {
|
|
56117
|
-
mode = (await
|
|
56119
|
+
mode = (await stat16(file)).mode & 4095;
|
|
56118
56120
|
} catch (error) {
|
|
56119
56121
|
if (error.code !== "ENOENT")
|
|
56120
56122
|
throw error;
|
|
@@ -57818,8 +57820,8 @@ function getLocalDevPath(directory) {
|
|
|
57818
57820
|
}
|
|
57819
57821
|
function findPackageJsonUp(startPath) {
|
|
57820
57822
|
try {
|
|
57821
|
-
const
|
|
57822
|
-
let dir =
|
|
57823
|
+
const stat18 = fs4.statSync(startPath);
|
|
57824
|
+
let dir = stat18.isDirectory() ? startPath : path4.dirname(startPath);
|
|
57823
57825
|
for (let i = 0; i < 10; i++) {
|
|
57824
57826
|
const pkgPath = path4.join(dir, "package.json");
|
|
57825
57827
|
if (fs4.existsSync(pkgPath)) {
|
|
@@ -58149,7 +58151,7 @@ function isSessionId(value) {
|
|
|
58149
58151
|
// src/common-auth-embedded/rpc/port-file.js
|
|
58150
58152
|
init_private_files2();
|
|
58151
58153
|
import { createHash as createHash21, randomUUID as randomUUID21 } from "node:crypto";
|
|
58152
|
-
import { chmod as chmod7, mkdir as mkdir17, open as open12, readdir as readdir4, rename as rename14, rmdir as rmdir3, stat as
|
|
58154
|
+
import { chmod as chmod7, mkdir as mkdir17, open as open12, readdir as readdir4, rename as rename14, rmdir as rmdir3, stat as stat17, unlink as unlink13 } from "node:fs/promises";
|
|
58153
58155
|
import { uptime as uptime2 } from "node:os";
|
|
58154
58156
|
import { join as join35, resolve as resolve26 } from "node:path";
|
|
58155
58157
|
function staleBefore(clock2) {
|
|
@@ -58165,7 +58167,7 @@ async function removeStalePortFile(path5, raw, info, beforeRemove2) {
|
|
|
58165
58167
|
await beforeRemove2?.(path5);
|
|
58166
58168
|
try {
|
|
58167
58169
|
const current = await readPrivateText2(path5);
|
|
58168
|
-
const identity3 = await
|
|
58170
|
+
const identity3 = await stat17(path5);
|
|
58169
58171
|
if (current === raw && identity3.dev === info.dev && identity3.ino === info.ino && identity3.mtimeMs === info.mtimeMs && identity3.size === info.size)
|
|
58170
58172
|
await unlink13(path5).catch(() => {
|
|
58171
58173
|
});
|
|
@@ -58279,7 +58281,7 @@ async function sweepRpcState(root, activeDir, isManagedDir, log17, options = {})
|
|
|
58279
58281
|
if (!name.startsWith("port-") || !name.endsWith(".json"))
|
|
58280
58282
|
continue;
|
|
58281
58283
|
const portFile = join35(dir, name);
|
|
58282
|
-
const info = await
|
|
58284
|
+
const info = await stat17(portFile).catch(() => void 0);
|
|
58283
58285
|
let raw;
|
|
58284
58286
|
try {
|
|
58285
58287
|
raw = await readPrivateText2(portFile);
|