@cortexkit/opencode-antigravity-auth 3.0.14 → 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.map +2 -2
- package/dist/cli.meta.json +4 -4
- package/dist/index.js +211 -33
- package/dist/index.js.map +2 -2
- package/dist/index.meta.json +8 -8
- package/dist/server.js +242 -38
- package/dist/server.js.map +3 -3
- package/dist/server.meta.json +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/ga-location-services.d.ts.map +1 -1
- package/dist/src/plugin/ga-location-services.js +49 -5
- package/dist/src/plugin/ga-location-services.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/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/tui-build-map.json +120 -92
- package/dist/tui-ga-build-map.json +22 -8
- package/dist/types/src/plugin/ga-location-services.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/package.json +2 -2
- 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
package/dist/cli.meta.json
CHANGED
|
@@ -2518,7 +2518,7 @@
|
|
|
2518
2518
|
"format": "esm"
|
|
2519
2519
|
},
|
|
2520
2520
|
"../core/dist/vault-provider-state.js": {
|
|
2521
|
-
"bytes":
|
|
2521
|
+
"bytes": 24634,
|
|
2522
2522
|
"imports": [
|
|
2523
2523
|
{
|
|
2524
2524
|
"path": "node:fs/promises",
|
|
@@ -2534,7 +2534,7 @@
|
|
|
2534
2534
|
"format": "esm"
|
|
2535
2535
|
},
|
|
2536
2536
|
"../core/dist/vault-account-source.js": {
|
|
2537
|
-
"bytes":
|
|
2537
|
+
"bytes": 18160,
|
|
2538
2538
|
"imports": [
|
|
2539
2539
|
{
|
|
2540
2540
|
"path": "../core/dist/vault-family.js",
|
|
@@ -4030,7 +4030,7 @@
|
|
|
4030
4030
|
"format": "esm"
|
|
4031
4031
|
},
|
|
4032
4032
|
"src/plugin/shared/vault-request-credentials.ts": {
|
|
4033
|
-
"bytes":
|
|
4033
|
+
"bytes": 32268,
|
|
4034
4034
|
"imports": [
|
|
4035
4035
|
{
|
|
4036
4036
|
"path": "../core/dist/index.js",
|
|
@@ -4265,7 +4265,7 @@
|
|
|
4265
4265
|
"imports": [],
|
|
4266
4266
|
"exports": [],
|
|
4267
4267
|
"inputs": {},
|
|
4268
|
-
"bytes":
|
|
4268
|
+
"bytes": 2684739
|
|
4269
4269
|
},
|
|
4270
4270
|
"dist/cli.js": {
|
|
4271
4271
|
"imports": [
|
package/dist/index.js
CHANGED
|
@@ -26802,6 +26802,124 @@ async function commitVaultProviderState(input2) {
|
|
|
26802
26802
|
return { result };
|
|
26803
26803
|
});
|
|
26804
26804
|
}
|
|
26805
|
+
async function commitVaultProviderStates(input2) {
|
|
26806
|
+
const { claustrum, fs: fs4, statePath } = input2;
|
|
26807
|
+
input2.signal?.throwIfAborted();
|
|
26808
|
+
const results = new Array(input2.entries.length);
|
|
26809
|
+
const refuse = (index, error) => {
|
|
26810
|
+
results[index] = { status: "refused", error };
|
|
26811
|
+
};
|
|
26812
|
+
let pending = [];
|
|
26813
|
+
for (const [index, entry] of input2.entries.entries()) {
|
|
26814
|
+
try {
|
|
26815
|
+
pending.push({
|
|
26816
|
+
index,
|
|
26817
|
+
attribution: pinAttribution(entry.attribution),
|
|
26818
|
+
update: entry.update
|
|
26819
|
+
});
|
|
26820
|
+
} catch (error) {
|
|
26821
|
+
refuse(index, error);
|
|
26822
|
+
}
|
|
26823
|
+
}
|
|
26824
|
+
const keepBound = (roster, entries) => entries.filter((entry) => {
|
|
26825
|
+
try {
|
|
26826
|
+
assertRosterBinding(roster, entry.attribution, claustrum);
|
|
26827
|
+
return true;
|
|
26828
|
+
} catch (error) {
|
|
26829
|
+
refuse(entry.index, error);
|
|
26830
|
+
return false;
|
|
26831
|
+
}
|
|
26832
|
+
});
|
|
26833
|
+
if (pending.length > 0)
|
|
26834
|
+
pending = keepBound(await claustrum.readVaultRoster(input2.rosterPath), pending);
|
|
26835
|
+
input2.signal?.throwIfAborted();
|
|
26836
|
+
if (pending.length === 0)
|
|
26837
|
+
return results;
|
|
26838
|
+
await claustrum.mutateVaultRoster(input2.rosterPath, async (roster, rosterLock) => {
|
|
26839
|
+
input2.signal?.throwIfAborted();
|
|
26840
|
+
const bound = keepBound(roster, pending);
|
|
26841
|
+
if (bound.length === 0)
|
|
26842
|
+
return { result: void 0 };
|
|
26843
|
+
await fs4.withLock(statePath, VAULT_PROVIDER_STATE_LOCK, async (stateLock) => {
|
|
26844
|
+
input2.signal?.throwIfAborted();
|
|
26845
|
+
const proofs = await Promise.allSettled(bound.map((entry) => input2.verify(entry.attribution)));
|
|
26846
|
+
input2.signal?.throwIfAborted();
|
|
26847
|
+
const proven = bound.filter((entry, at) => {
|
|
26848
|
+
const proof = proofs[at];
|
|
26849
|
+
if (proof?.status !== "rejected")
|
|
26850
|
+
return true;
|
|
26851
|
+
refuse(entry.index, proof.reason);
|
|
26852
|
+
return false;
|
|
26853
|
+
});
|
|
26854
|
+
if (proven.length === 0)
|
|
26855
|
+
return;
|
|
26856
|
+
const file = await readVaultProviderState(statePath);
|
|
26857
|
+
input2.signal?.throwIfAborted();
|
|
26858
|
+
const accounts = {
|
|
26859
|
+
...file.accounts
|
|
26860
|
+
};
|
|
26861
|
+
const written = [];
|
|
26862
|
+
for (const entry of proven) {
|
|
26863
|
+
const identity3 = entry.attribution.accountIdentity;
|
|
26864
|
+
const current = Object.hasOwn(accounts, identity3) ? accounts[identity3] : void 0;
|
|
26865
|
+
try {
|
|
26866
|
+
const requested = entry.update(current);
|
|
26867
|
+
if (isRecord9(requested) && typeof requested.then === "function")
|
|
26868
|
+
throw new VaultProviderStateError("invalid-update", "a state update must be synchronous");
|
|
26869
|
+
if (requested === void 0 || requested === null && !current) {
|
|
26870
|
+
results[entry.index] = current ? { status: "unchanged", state: current } : { status: "unchanged" };
|
|
26871
|
+
continue;
|
|
26872
|
+
}
|
|
26873
|
+
if (requested === null) {
|
|
26874
|
+
delete accounts[identity3];
|
|
26875
|
+
written.push(entry);
|
|
26876
|
+
continue;
|
|
26877
|
+
}
|
|
26878
|
+
const next = Object.freeze({
|
|
26879
|
+
observed: Object.freeze({
|
|
26880
|
+
routeId: entry.attribution.routeId,
|
|
26881
|
+
credentialId: entry.attribution.credentialId,
|
|
26882
|
+
recordVersion: entry.attribution.recordVersion
|
|
26883
|
+
}),
|
|
26884
|
+
...decodeValue(requested, "update", "typed")
|
|
26885
|
+
});
|
|
26886
|
+
accounts[identity3] = next;
|
|
26887
|
+
written.push({ ...entry, next });
|
|
26888
|
+
} catch (error) {
|
|
26889
|
+
refuse(entry.index, error);
|
|
26890
|
+
}
|
|
26891
|
+
}
|
|
26892
|
+
if (written.length === 0)
|
|
26893
|
+
return;
|
|
26894
|
+
const encoded = encodeVaultProviderState({ ...file, accounts });
|
|
26895
|
+
try {
|
|
26896
|
+
await fs4.writeJsonAtomic(statePath, encoded, {
|
|
26897
|
+
beforeRename: async () => {
|
|
26898
|
+
await rosterLock.assertOwned();
|
|
26899
|
+
await stateLock.assertOwned();
|
|
26900
|
+
input2.signal?.throwIfAborted();
|
|
26901
|
+
}
|
|
26902
|
+
});
|
|
26903
|
+
} catch (error) {
|
|
26904
|
+
let reloaded;
|
|
26905
|
+
try {
|
|
26906
|
+
reloaded = await readVaultProviderState(statePath);
|
|
26907
|
+
} catch {
|
|
26908
|
+
reloaded = void 0;
|
|
26909
|
+
}
|
|
26910
|
+
for (const entry of written) {
|
|
26911
|
+
const state = reloaded && vaultAccountState(reloaded, entry.attribution.accountIdentity);
|
|
26912
|
+
results[entry.index] = state ? { status: "uncertain", error, state } : { status: "uncertain", error };
|
|
26913
|
+
}
|
|
26914
|
+
return;
|
|
26915
|
+
}
|
|
26916
|
+
for (const entry of written)
|
|
26917
|
+
results[entry.index] = entry.next ? { status: "written", state: entry.next } : { status: "cleared" };
|
|
26918
|
+
});
|
|
26919
|
+
return { result: void 0 };
|
|
26920
|
+
});
|
|
26921
|
+
return results;
|
|
26922
|
+
}
|
|
26805
26923
|
|
|
26806
26924
|
// ../core/dist/vault-account-source.js
|
|
26807
26925
|
function untilAborted2(pending, signal) {
|
|
@@ -27058,6 +27176,20 @@ function createAntigravityVaultAccountSource(options) {
|
|
|
27058
27176
|
update
|
|
27059
27177
|
});
|
|
27060
27178
|
},
|
|
27179
|
+
commitStates: async (entries, signal) => {
|
|
27180
|
+
assertOpen(signal);
|
|
27181
|
+
if (!options.state)
|
|
27182
|
+
throw new AntigravityVaultSourceError("state-unavailable", "No provider-state sidecar is configured for this vault source");
|
|
27183
|
+
return commitVaultProviderStates({
|
|
27184
|
+
claustrum,
|
|
27185
|
+
fs: options.state.fs,
|
|
27186
|
+
rosterPath: options.rosterPath,
|
|
27187
|
+
statePath: options.state.path,
|
|
27188
|
+
entries,
|
|
27189
|
+
verify: (by) => verifyAttribution(by, signal),
|
|
27190
|
+
signal
|
|
27191
|
+
});
|
|
27192
|
+
},
|
|
27061
27193
|
decline: async (ref) => {
|
|
27062
27194
|
assertOpen();
|
|
27063
27195
|
await consumer.decline(ref.routeId);
|
|
@@ -35720,6 +35852,13 @@ function applyDurableSelection(row, metadata) {
|
|
|
35720
35852
|
function stateBelongsTo(state, row) {
|
|
35721
35853
|
return state.observed.routeId === row.route.routeId && state.observed.credentialId === row.route.credentialId;
|
|
35722
35854
|
}
|
|
35855
|
+
function quotaUpdate(quota) {
|
|
35856
|
+
return (current) => ({
|
|
35857
|
+
...current?.metadata !== void 0 ? { metadata: current.metadata } : {},
|
|
35858
|
+
quota,
|
|
35859
|
+
...current?.extensions !== void 0 ? { extensions: current.extensions } : {}
|
|
35860
|
+
});
|
|
35861
|
+
}
|
|
35723
35862
|
function createVaultSelectionState(options) {
|
|
35724
35863
|
const now = options.now ?? (() => Date.now());
|
|
35725
35864
|
const attributions = /* @__PURE__ */ new WeakMap();
|
|
@@ -35793,15 +35932,30 @@ function createVaultSelectionState(options) {
|
|
|
35793
35932
|
},
|
|
35794
35933
|
flush: flush2,
|
|
35795
35934
|
recordQuota(attribution, quota, signal) {
|
|
35796
|
-
return options.source.commitState(
|
|
35935
|
+
return options.source.commitState(attribution, quotaUpdate(quota), signal);
|
|
35936
|
+
},
|
|
35937
|
+
async recordQuotas(readings, signal) {
|
|
35938
|
+
const entries = readings.map(({ attribution, quota }) => ({
|
|
35797
35939
|
attribution,
|
|
35798
|
-
(
|
|
35799
|
-
|
|
35800
|
-
|
|
35801
|
-
|
|
35802
|
-
|
|
35803
|
-
|
|
35804
|
-
|
|
35940
|
+
update: quotaUpdate(quota)
|
|
35941
|
+
}));
|
|
35942
|
+
if (options.source.commitStates)
|
|
35943
|
+
return options.source.commitStates(entries, signal);
|
|
35944
|
+
const results = [];
|
|
35945
|
+
for (const { attribution, update } of entries) {
|
|
35946
|
+
if (signal?.aborted) {
|
|
35947
|
+
results.push({ status: "refused", error: signal.reason });
|
|
35948
|
+
continue;
|
|
35949
|
+
}
|
|
35950
|
+
try {
|
|
35951
|
+
results.push(
|
|
35952
|
+
await options.source.commitState(attribution, update, signal)
|
|
35953
|
+
);
|
|
35954
|
+
} catch (error) {
|
|
35955
|
+
results.push({ status: "refused", error });
|
|
35956
|
+
}
|
|
35957
|
+
}
|
|
35958
|
+
return results;
|
|
35805
35959
|
}
|
|
35806
35960
|
};
|
|
35807
35961
|
}
|
|
@@ -35931,8 +36085,15 @@ async function checkVaultQuota(input2) {
|
|
|
35931
36085
|
const state = input2.pool.state;
|
|
35932
36086
|
const rows = [...input2.pool.selector.rows];
|
|
35933
36087
|
const now = input2.now ?? (() => Date.now());
|
|
36088
|
+
const reportError = (error) => {
|
|
36089
|
+
try {
|
|
36090
|
+
input2.onError?.(error);
|
|
36091
|
+
} catch {
|
|
36092
|
+
}
|
|
36093
|
+
};
|
|
35934
36094
|
let checked = 0;
|
|
35935
36095
|
if (state === void 0) input2.onOutcome?.("state-invalid");
|
|
36096
|
+
const readings = [];
|
|
35936
36097
|
for (const row of rows) {
|
|
35937
36098
|
if (input2.signal.aborted || state === void 0) break;
|
|
35938
36099
|
try {
|
|
@@ -35952,32 +36113,49 @@ async function checkVaultQuota(input2) {
|
|
|
35952
36113
|
input2.onOutcome?.("unattributed");
|
|
35953
36114
|
continue;
|
|
35954
36115
|
}
|
|
35955
|
-
|
|
35956
|
-
|
|
35957
|
-
|
|
35958
|
-
|
|
35959
|
-
if (result.status !== "written") {
|
|
35960
|
-
input2.onOutcome?.(
|
|
35961
|
-
result.status === "uncertain" ? "write-uncertain" : "commit-unchanged",
|
|
35962
|
-
result.status === "uncertain" ? result.error : void 0
|
|
35963
|
-
);
|
|
35964
|
-
continue;
|
|
35965
|
-
}
|
|
35966
|
-
checked += 1;
|
|
35967
|
-
input2.onOutcome?.("recorded");
|
|
35968
|
-
const live = input2.pool.selector.rows.find(
|
|
35969
|
-
(candidate) => candidate.route.routeId === attribution.routeId && candidate.route.credentialId === attribution.credentialId && candidate.route.accountIdentity === attribution.accountIdentity
|
|
35970
|
-
);
|
|
35971
|
-
if (live !== void 0) {
|
|
35972
|
-
const cached = cachedQuotaOf(reading);
|
|
35973
|
-
if (cached !== void 0) live.cachedQuota = cached;
|
|
35974
|
-
live.cachedQuotaUpdatedAt = reading.cachedQuotaUpdatedAt ?? void 0;
|
|
35975
|
-
}
|
|
36116
|
+
readings.push({
|
|
36117
|
+
attribution,
|
|
36118
|
+
quota: vaultQuotaState(answer.quota, answer.observedAt ?? now())
|
|
36119
|
+
});
|
|
35976
36120
|
} catch (error) {
|
|
35977
|
-
|
|
35978
|
-
|
|
35979
|
-
|
|
35980
|
-
|
|
36121
|
+
reportError(error);
|
|
36122
|
+
}
|
|
36123
|
+
}
|
|
36124
|
+
if (state === void 0 || readings.length === 0 || input2.signal.aborted)
|
|
36125
|
+
return { checked, notChecked: rows.length - checked };
|
|
36126
|
+
let results;
|
|
36127
|
+
try {
|
|
36128
|
+
input2.onStage?.("commit");
|
|
36129
|
+
input2.signal.throwIfAborted();
|
|
36130
|
+
results = await state.recordQuotas(readings, input2.signal);
|
|
36131
|
+
} catch (error) {
|
|
36132
|
+
for (const _ of readings) reportError(error);
|
|
36133
|
+
return { checked, notChecked: rows.length - checked };
|
|
36134
|
+
}
|
|
36135
|
+
for (const [at, { attribution, quota: reading }] of readings.entries()) {
|
|
36136
|
+
const result = results[at];
|
|
36137
|
+
if (result === void 0 || result.status === "refused") {
|
|
36138
|
+
reportError(
|
|
36139
|
+
result === void 0 ? new Error("The provider-state commit returned no result") : result.error
|
|
36140
|
+
);
|
|
36141
|
+
continue;
|
|
36142
|
+
}
|
|
36143
|
+
if (result.status !== "written") {
|
|
36144
|
+
input2.onOutcome?.(
|
|
36145
|
+
result.status === "uncertain" ? "write-uncertain" : "commit-unchanged",
|
|
36146
|
+
result.status === "uncertain" ? result.error : void 0
|
|
36147
|
+
);
|
|
36148
|
+
continue;
|
|
36149
|
+
}
|
|
36150
|
+
checked += 1;
|
|
36151
|
+
input2.onOutcome?.("recorded");
|
|
36152
|
+
const live = input2.pool.selector.rows.find(
|
|
36153
|
+
(candidate) => candidate.route.routeId === attribution.routeId && candidate.route.credentialId === attribution.credentialId && candidate.route.accountIdentity === attribution.accountIdentity
|
|
36154
|
+
);
|
|
36155
|
+
if (live !== void 0) {
|
|
36156
|
+
const cached = cachedQuotaOf(reading);
|
|
36157
|
+
if (cached !== void 0) live.cachedQuota = cached;
|
|
36158
|
+
live.cachedQuotaUpdatedAt = reading.cachedQuotaUpdatedAt ?? void 0;
|
|
35981
36159
|
}
|
|
35982
36160
|
}
|
|
35983
36161
|
return { checked, notChecked: rows.length - checked };
|