Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

AntigravityProvider.ts

594 lines23.2 KB

1import { resolveProviderProbeTimeoutMs } from "@t3tools/provider-core/server/snapshotProbe";
2import {
3 ANTIGRAVITY_DEFAULT_MODEL,
4 ProviderDriverKind,
5 type AntigravitySettings,
6 type ProviderSetupError,
7 type RuntimeMode,
8 type ServerProvider,
9 type ServerProviderModel,
10 type ServerProviderSlashCommand,
11 type ServerProviderUsageLimits,
12} from "@t3tools/contracts";
13import { createModelCapabilities } from "@t3tools/shared/model";
14import * as Context from "effect/Context";
15import * as DateTime from "effect/DateTime";
16import * as Deferred from "effect/Deferred";
17import * as Effect from "effect/Effect";
18import * as FiberHandle from "effect/FiberHandle";
19import * as Option from "effect/Option";
20import * as Predicate from "effect/Predicate";
21import * as Result from "effect/Result";
22import * as Stream from "effect/Stream";
23import * as SubscriptionRef from "effect/SubscriptionRef";
24import type * as EffectAcpErrors from "effect-acp/errors";
25import type * as EffectAcpSchema from "effect-acp/compat";
26​
27import type * as AcpSessionRuntime from "@t3tools/provider-acp/server/AcpSessionRuntime";
28import { parseSessionModeState } from "@t3tools/provider-acp/server/runtimeModel";
29import { acpProviderOptionDescriptors } from "@t3tools/provider-acp/server/sessionConfig";
30import {
31 DeferringFailedCheck,
32 makeManagedServerProvider,
33} from "@t3tools/provider-core/server/managedProvider";
34import {
35 makeManualOnlyProviderMaintenanceCapabilities,
36 type ProviderMaintenanceCapabilities,
37} from "@t3tools/provider-core/server/maintenanceResolver";
38import {
39 buildServerProvider,
40 isCommandMissingCause,
41 type ServerProviderDraft,
42} from "@t3tools/provider-core/server/snapshotProbe";
43import { resolveUsageLimitsAfterProbe } from "@t3tools/provider-core/server/usageLimits";
44​
45import { antigravityThinkingConfig } from "./acp/AntigravityAcpSupport.ts";
46​
47const EMPTY_MODEL_CAPABILITIES = createModelCapabilities({ optionDescriptors: [] });
48const MAX_WORKSPACE_SNAPSHOTS = 32;
49const HEALTH_CHECK_TIMEOUT_MS = 90_000;
50const SIGN_IN_MESSAGE = "Sign in with Google to use Antigravity.";
51const AUTH_UNCHECKED_MESSAGE =
52 "Antigravity is installed. Google account access is not checked yet.";
53// Set while a finished quota read republishes, so that health check does not read again.
54const PublishingUsage = Context.Reference<boolean>("t3/provider/AntigravityPublishingUsage", {
55 defaultValue: () => false,
56});
57​
58type SessionSetupResult = Pick<
59 AcpSessionRuntime.AcpSessionRuntimeStartResult["sessionSetupResult"],
60 "configOptions" | "models"
61>;
62​
63type ThinkingConfig = NonNullable<ReturnType<typeof antigravityThinkingConfig>>;
64​
65/** Thinking options each model reported when selected; `null` means it has none. */
66export type AntigravityThinkingLevels = ReadonlyMap<string, ThinkingConfig | null>;
67​
68function thinkingCapabilities(config: ThinkingConfig | null | undefined, observed: boolean) {
69 const descriptor = config
70 ? acpProviderOptionDescriptors({ configOptions: [config], modeState: undefined })[0]
71 : undefined;
72 if (descriptor?.type !== "select") return EMPTY_MODEL_CAPABILITIES;
73 // Another model's selected level is not this model's default.
74 const { currentValue: _currentValue, ...unobserved } = descriptor;
75 return createModelCapabilities({ optionDescriptors: [observed ? descriptor : unobserved] });
77​
78export function buildAntigravityModelsFromSession(
79 setup: SessionSetupResult,
80 thinkingLevels: AntigravityThinkingLevels = new Map(),
81): ReadonlyArray<ServerProviderModel> {
82 const config = setup.configOptions?.find(
83 (option) => option.id === "model" || option.category === "model",
84 );
85 const currentValue =
86 config?.type === "select" ? config.currentValue : setup.models?.currentModelId;
87 const entries =
88 config?.type === "select"
89 ? config.options.flatMap((entry) => ("value" in entry ? [entry] : entry.options))
90 : config === undefined
91 ? (setup.models?.availableModels.map((model) => ({
92 value: model.modelId,
93 name: model.name,
94 })) ?? [])
95 : [];
96 const currentThinking = antigravityThinkingConfig(setup.configOptions);
97 const seen = new Set<string>();
98 // The agent can list two IDs under one name; label the later ones so the picker tells them apart.
99 const names = new Set<string>();
100 return entries.flatMap((entry): ServerProviderModel[] => {
101 if (!entry.value.trim() || seen.has(entry.value)) return [];
102 seen.add(entry.value);
103 const baseName = entry.name.trim() ? entry.name : entry.value;
104 const name = names.has(baseName) ? `${baseName} (${entry.value})` : baseName;
105 names.add(baseName);
106 const observed =
107 entry.value === currentValue ? (currentThinking ?? null) : thinkingLevels.get(entry.value);
108 return [
109 {
110 slug: entry.value,
111 name,
112 isCustom: false,
113 ...(entry.value === currentValue
114 ? { isDefault: true, aliases: [ANTIGRAVITY_DEFAULT_MODEL] }
115 : {}),
116 capabilities:
117 observed === undefined
118 ? thinkingCapabilities(currentThinking, false)
119 : thinkingCapabilities(observed, true),
120 },
121 ];
122 });
124​
125function nativeCommands(
126 commands: ReadonlyArray<EffectAcpSchema.AvailableCommand>,
127): ReadonlyArray<ServerProviderSlashCommand> {
128 const seen = new Set<string>();
129 return commands.flatMap((command): ServerProviderSlashCommand[] => {
130 if (!command.name.trim() || seen.has(command.name)) return [];
131 seen.add(command.name);
132 const description = command.description.trim();
133 const hint = command.input?.hint.trim();
134 return [
135 {
136 name: command.name,
137 ...(description ? { description } : {}),
138 ...(hint ? { input: { hint } } : {}),
139 },
140 ];
141 });
143​
144function isMissingInstallation(error: EffectAcpErrors.AcpError | ProviderSetupError): boolean {
145 if (error._tag === "AcpSpawnError") {
146 return (
147 isCommandMissingCause(error.cause) ||
148 (Predicate.isObject(error.cause) && error.cause.code === "ENOENT")
149 );
150 }
151 return (
152 error._tag === "ProviderSetupError" &&
153 error.operation === "resolve" &&
154 /not installed|missing|incomplete|changed on disk|does not publish/i.test(error.detail)
155 );
157​
158interface AntigravityProviderState {
159 readonly draft: ServerProviderDraft;
160 readonly authRevision: number;
162​
163interface AntigravityProviderOptions {
164 readonly environment?: NodeJS.ProcessEnv;
165 readonly stampIdentity: (snapshot: ServerProviderDraft) => Effect.Effect<ServerProvider>;
166 readonly probe: Effect.Effect<
167 EffectAcpSchema.InitializeResponse,
168 EffectAcpErrors.AcpError | ProviderSetupError
169 >;
170 readonly supportsTextGeneration: Effect.Effect<boolean>;
171 readonly probeUsage?: Effect.Effect<ServerProviderUsageLimits>;
172 readonly clearUsage?: Effect.Effect<void>;
173 readonly maintenanceCapabilities?: ProviderMaintenanceCapabilities;
174 readonly auth?: { readonly type: string; readonly label: string };
175 /** Modes the last session advertised, saved because initialize alone does not report them. */
176 readonly rememberedRuntimeModes?: ReadonlyArray<RuntimeMode>;
177 readonly rememberRuntimeModes?: (modes: ReadonlyArray<RuntimeMode>) => Effect.Effect<void>;
179​
180const RUNTIME_MODES_WITHOUT_AUTO = [
181 "approval-required",
182 "auto-accept-edits",
183 "full-access",
184] as const;
185​
186/** Auto is offered only where the session advertises agy's own Auto; elsewhere it runs Supervised. */
187function antigravityRuntimeModes(
188 sessionSetupResult: AcpSessionRuntime.AcpSessionRuntimeStartResult["sessionSetupResult"],
189): ReadonlyArray<RuntimeMode> {
190 return parseSessionModeState(sessionSetupResult)?.availableModes.some(
191 (mode) => mode.id === "auto",
192 )
193 ? ["approval-required", "auto-accept-edits", "auto", "full-access"]
194 : RUNTIME_MODES_WITHOUT_AUTO;
196​
197export const makeAntigravityProvider = Effect.fn("makeAntigravityProvider")(function* (
198 settings: AntigravitySettings,
199 options: AntigravityProviderOptions,
200) {
201 const usesCredentials =
202 options.auth?.type === "gemini-api-key" || options.auth?.type === "agent-platform";
203 const signInMessage = usesCredentials
204 ? `Connect with ${options.auth.label} to use Antigravity and load models.`
205 : SIGN_IN_MESSAGE;
206 const authUncheckedMessage = usesCredentials
207 ? `Antigravity is installed. Connect with ${options.auth.label} to load models.`
208 : AUTH_UNCHECKED_MESSAGE;
209 const checkedAt = DateTime.formatIso(yield* DateTime.now);
210 const initialDraft = {
211 ...buildServerProvider({
212 presentation: {
213 displayName: "Antigravity",
214 showInteractionModeToggle: false,
215 supportedRuntimeModes: options.rememberedRuntimeModes ?? RUNTIME_MODES_WITHOUT_AUTO,
216 },
217 enabled: settings.enabled,
218 checkedAt,
219 models: [],
220 probe: {
221 installed: false,
222 version: null,
223 status: "warning",
224 auth: { status: "unknown", ...(options.auth ? { type: options.auth.type } : {}) },
225 message: settings.enabled
226 ? "Checking Antigravity availability."
227 : "Antigravity is disabled in T3 Code settings.",
228 },
229 }),
230 setup: { canAuthenticate: true, canInstall: true },
231 supportsConversationRollback: true,
232 supportsTextGeneration: false,
233 workspaceSnapshots: [],
234 } satisfies ServerProviderDraft;
235 const metadata = yield* SubscriptionRef.make<AntigravityProviderState>({
236 draft: initialDraft,
237 authRevision: 0,
238 });
239 // Preserve disk-discovered skills when callbacks replace workspace commands; the registry will not rescan them.
240 const discoveredSkills = new Map<string, ServerProvider["skills"]>();
241 const thinkingLevels = new Map<string, ThinkingConfig | null>();
242 const observeThinkingLevels = (
243 configOptions: ReadonlyArray<EffectAcpSchema.SessionConfigOption> | null | undefined,
244 ) => {
245 const model = configOptions?.find(
246 (option) => option.id === "model" || option.category === "model",
247 );
248 if (model?.type === "select" && model.currentValue) {
249 thinkingLevels.set(model.currentValue, antigravityThinkingConfig(configOptions) ?? null);
250 }
251 };
252 const rememberRuntimeModes = Effect.fn("AntigravityProvider.rememberRuntimeModes")(function* (
253 previous: ReadonlyArray<RuntimeMode> | undefined,
254 next: ReadonlyArray<RuntimeMode>,
255 ) {
256 if (options.rememberRuntimeModes && previous?.join() !== next.join()) {
257 yield* options.rememberRuntimeModes(next);
258 }
259 });
260 const getSnapshot = SubscriptionRef.get(metadata).pipe(
261 Effect.flatMap((state) => options.stampIdentity(state.draft)),
262 );
263​
264 // The quota read can take 30 seconds, so it never blocks readiness or a session start.
265 // One read runs at a time; sign-in and sign-out interrupt it so a stale account never lands.
266 const usageRead = yield* FiberHandle.make();
267 const republish = yield* Deferred.make<Effect.Effect<ServerProvider>>();
268 const scope = yield* Effect.scope;
269 const refreshUsage = Effect.fn("AntigravityProvider.refreshUsage")(function* () {
270 if (!options.probeUsage || (yield* PublishingUsage)) return;
271 yield* FiberHandle.run(
272 usageRead,
273 options.probeUsage.pipe(
274 Effect.flatMap((probed) =>
275 SubscriptionRef.update(metadata, (state) => ({
276 ...state,
277 draft: {
278 ...state.draft,
279 usageLimits: resolveUsageLimitsAfterProbe({
280 published: state.draft.usageLimits,
281 probed,
282 }),
283 },
284 })),
285 ),
286 // Enrichment cannot change published limits; a health check publishes them.
287 Effect.andThen(
288 Deferred.await(republish).pipe(
289 Effect.flatten,
290 Effect.provideService(PublishingUsage, true),
291 Effect.ignoreCause({ log: true }),
292 Effect.forkIn(scope),
293 ),
294 ),
295 ),
296 // Store the fiber before it runs, so a sign-out during the read can interrupt it.
297 { onlyIfMissing: true, startImmediately: false },
298 );
299 });
300 const resetUsage = Effect.gen(function* () {
301 yield* FiberHandle.clear(usageRead);
302 if (options.clearUsage) yield* options.clearUsage;
303 });
304​
305 const checkProvider = Effect.fn("checkAntigravityProvider")(function* () {
306 if (!settings.enabled) return yield* getSnapshot;
307 const before = yield* SubscriptionRef.get(metadata);
308 const timeoutMs = resolveProviderProbeTimeoutMs(
309 "antigravity",
310 HEALTH_CHECK_TIMEOUT_MS,
311 options.environment,
312 );
313 const result = yield* options.probe.pipe(Effect.timeoutOption(timeoutMs), Effect.result);
314 const initialized =
315 Result.isSuccess(result) && Option.isSome(result.success) ? result.success.value : undefined;
316 const version = initialized?.agentInfo?.version;
317 const failure = Result.isFailure(result) ? result.failure : undefined;
318 const missingInstallation = failure !== undefined && isMissingInstallation(failure);
319 const errorMessage =
320 initialized !== undefined
321 ? undefined
322 : failure?._tag === "ProviderSetupError"
323 ? failure.detail.trim() || "Antigravity could not complete its local health check."
324 : missingInstallation
325 ? "Antigravity ACP runtime is not installed or its executable could not be found."
326 : failure
327 ? "Antigravity could not complete its local health check."
328 : `Antigravity did not respond to its local health check within ${timeoutMs / 1_000} seconds.`;
329 const supportsTextGeneration =
330 initialized !== undefined ? yield* options.supportsTextGeneration : false;
331 const updatedAt = DateTime.formatIso(yield* DateTime.now);
332 const applyCheck = (state: AntigravityProviderState) => {
333 if (state.authRevision !== before.authRevision) return state;
334 const { message: _previousMessage, ...draft } = state.draft;
335 const authenticated = draft.auth.status === "authenticated";
336 const message =
337 errorMessage ??
338 (authenticated
339 ? undefined
340 : draft.auth.status === "unauthenticated"
341 ? signInMessage
342 : authUncheckedMessage);
343 return {
344 ...state,
345 draft: {
346 ...draft,
347 installed: !missingInstallation,
348 // Lightweight custom-launcher probes lack versions; preserve the real handshake's version.
349 version: version === "unknown" ? draft.version : version || draft.version,
350 status: errorMessage ? "error" : authenticated ? "ready" : "warning",
351 checkedAt: updatedAt,
352 usageLimits: missingInstallation ? undefined : draft.usageLimits,
353 ...(missingInstallation
354 ? {
355 models: [],
356 slashCommands: [],
357 skills: [],
358 workspaceSnapshots: [],
359 supportsTextGeneration: false,
360 }
361 : {}),
362 ...(initialized !== undefined
363 ? {
364 supportsTextGeneration:
365 supportsTextGeneration && draft.auth.status !== "unauthenticated",
366 }
367 : {}),
368 ...(message ? { message } : {}),
369 },
370 } satisfies AntigravityProviderState;
371 };
372 // This state is published as it changes, so a failure the managed provider discards stays out.
373 const deferFailure = errorMessage !== undefined && (yield* DeferringFailedCheck);
374 const next = yield* SubscriptionRef.modifySome(metadata, (state) => {
375 const checked = applyCheck(state);
376 const stored = deferFailure && state.draft.status === "ready" ? state : checked;
377 return [checked, stored === state ? Option.none() : Option.some(stored)];
378 });
379 if (initialized !== undefined) yield* refreshUsage();
380 return yield* options.stampIdentity(next.draft);
381 });
382​
383 const maintenanceCapabilities =
384 options.maintenanceCapabilities ??
385 makeManualOnlyProviderMaintenanceCapabilities({
386 provider: ProviderDriverKind.make("antigravity"),
387 packageName: null,
388 });
389 const managed = yield* makeManagedServerProvider({
390 resolveMaintenance: () => Effect.succeed(maintenanceCapabilities),
391 getSettings: Effect.succeed(settings),
392 streamSettings: Stream.empty,
393 haveSettingsChanged: () => false,
394 initialSnapshot: () => getSnapshot,
395 checkProvider: checkProvider(),
396 enrichSnapshot: ({ publishSnapshot }) =>
397 SubscriptionRef.changes(metadata).pipe(
398 Stream.runForEach((state) =>
399 options.stampIdentity(state.draft).pipe(Effect.flatMap(publishSnapshot)),
400 ),
401 ),
402 });
403 yield* Deferred.succeed(republish, managed.refresh);
404​
405 const onSessionStarted = Effect.fn("AntigravityProvider.onSessionStarted")(function* (
406 started: AcpSessionRuntime.AcpSessionRuntimeStartResult,
407 cwd?: string,
408 ) {
409 if (!settings.enabled) return;
410 observeThinkingLevels(started.sessionSetupResult.configOptions);
411 const before = yield* SubscriptionRef.get(metadata);
412 const supportsTextGeneration = yield* options.supportsTextGeneration;
413 const updatedAt = DateTime.formatIso(yield* DateTime.now);
414 const supportedRuntimeModes = antigravityRuntimeModes(started.sessionSetupResult);
415 const previousModes = yield* SubscriptionRef.modify(metadata, (state) => {
416 if (
417 state.authRevision !== before.authRevision &&
418 state.draft.auth.status === "unauthenticated"
419 ) {
420 return [supportedRuntimeModes, state] as const;
421 }
422 const { message: _previousMessage, ...draft } = state.draft;
423 const workspaces = draft.workspaceSnapshots ?? [];
424 const workspace = cwd ? workspaces.find((entry) => entry.cwd === cwd) : undefined;
425 const next = {
426 authRevision: state.authRevision + 1,
427 draft: {
428 ...draft,
429 installed: true,
430 status: "ready",
431 version: started.initializeResult.agentInfo?.version || draft.version,
432 auth: {
433 status: "authenticated",
434 type: options.auth?.type ?? "oauth-personal",
435 label: options.auth?.label ?? "Google account",
436 },
437 checkedAt: updatedAt,
438 models: buildAntigravityModelsFromSession(started.sessionSetupResult, thinkingLevels),
439 supportedRuntimeModes,
440 supportsTextGeneration,
441 ...(cwd
442 ? {
443 workspaceSnapshots: [
444 ...workspaces.filter((entry) => entry.cwd !== cwd),
445 {
446 cwd,
447 checkedAt: updatedAt,
448 slashCommands: workspace?.slashCommands ?? draft.slashCommands,
449 skills: workspace?.skills ?? discoveredSkills.get(cwd) ?? [],
450 },
451 ].slice(-MAX_WORKSPACE_SNAPSHOTS),
452 }
453 : {}),
454 },
455 } satisfies AntigravityProviderState;
456 return [draft.supportedRuntimeModes, next] as const;
457 });
458 yield* rememberRuntimeModes(previousModes, supportedRuntimeModes);
459 if (!before.draft.usageLimits || before.draft.usageLimits.unavailable) yield* refreshUsage();
460 });
461​
462 const onConfigOptionsUpdated = Effect.fn("AntigravityProvider.onConfigOptionsUpdated")(function* (
463 configOptions: ReadonlyArray<EffectAcpSchema.SessionConfigOption>,
464 ) {
465 observeThinkingLevels(configOptions);
466 const models = buildAntigravityModelsFromSession({ configOptions }, thinkingLevels);
467 yield* SubscriptionRef.update(metadata, (state) => {
468 if (state.draft.auth.status !== "authenticated") return state;
469 return { ...state, draft: { ...state.draft, models } };
470 });
471 });
472​
473 const onAvailableCommands = Effect.fn("AntigravityProvider.onAvailableCommands")(function* (
474 commands: ReadonlyArray<EffectAcpSchema.AvailableCommand>,
475 cwd?: string,
476 ) {
477 if (!settings.enabled) return;
478 const slashCommands = nativeCommands(commands);
479 const updatedAt = DateTime.formatIso(yield* DateTime.now);
480 yield* SubscriptionRef.update(metadata, (state) => {
481 if (state.draft.auth.status === "unauthenticated") return state;
482 return {
483 ...state,
484 draft: {
485 ...state.draft,
486 slashCommands,
487 ...(cwd
488 ? {
489 workspaceSnapshots: [
490 ...(state.draft.workspaceSnapshots ?? []).filter((entry) => entry.cwd !== cwd),
491 {
492 cwd,
493 checkedAt: updatedAt,
494 slashCommands,
495 skills:
496 state.draft.workspaceSnapshots?.find((entry) => entry.cwd === cwd)?.skills ??
497 discoveredSkills.get(cwd) ??
498 [],
499 },
500 ].slice(-MAX_WORKSPACE_SNAPSHOTS),
501 }
502 : {}),
503 },
504 };
505 });
506 });
507​
508 const clearAccountMetadata = Effect.fn("AntigravityProvider.clearAccountMetadata")(function* () {
509 yield* resetUsage;
510 if (!settings.enabled) return;
511 const updatedAt = DateTime.formatIso(yield* DateTime.now);
512 const previousModes = yield* SubscriptionRef.modify(metadata, (state) => [
513 state.draft.supportedRuntimeModes,
514 {
515 authRevision: state.authRevision + 1,
516 draft: {
517 ...state.draft,
518 auth: {
519 status: "unauthenticated",
520 ...(usesCredentials ? options.auth : {}),
521 },
522 status: "warning",
523 message: signInMessage,
524 checkedAt: updatedAt,
525 models: [],
526 slashCommands: [],
527 skills: [],
528 workspaceSnapshots: [],
529 supportedRuntimeModes: RUNTIME_MODES_WITHOUT_AUTO,
530 supportsTextGeneration: false,
531 usageLimits: undefined,
532 },
533 } satisfies AntigravityProviderState,
534 ]);
535 yield* rememberRuntimeModes(previousModes, RUNTIME_MODES_WITHOUT_AUTO);
536 discoveredSkills.clear();
537 thinkingLevels.clear();
538 });
539​
540 const snapshotForCwd = Effect.fn("AntigravityProvider.snapshotForCwd")(function* (
541 cwd: string,
542 skills?: ServerProvider["skills"],
543 ) {
544 if (skills) {
545 discoveredSkills.set(cwd, skills);
546 yield* SubscriptionRef.update(metadata, (state) =>
547 state.draft.workspaceSnapshots?.some((entry) => entry.cwd === cwd)
548 ? {
549 ...state,
550 draft: {
551 ...state.draft,
552 workspaceSnapshots: state.draft.workspaceSnapshots.map((entry) =>
553 entry.cwd === cwd ? { ...entry, skills } : entry,
554 ),
555 },
556 }
557 : state,
558 );
559 }
560 const snapshot = yield* getSnapshot;
561 const workspace = snapshot.workspaceSnapshots?.find((entry) => entry.cwd === cwd);
562 const resolvedSkills = skills ?? workspace?.skills ?? discoveredSkills.get(cwd) ?? [];
563 return workspace
564 ? { ...snapshot, slashCommands: workspace.slashCommands, skills: resolvedSkills }
565 : { ...snapshot, skills: resolvedSkills };
566 });
567​
568 return {
569 snapshot: { ...managed, getSnapshot },
570 onSessionStarted,
571 onConfigOptionsUpdated,
572 onAvailableCommands,
573 // The new sign-in may be another account. Clear and republish its limits so a failed read
574 // cannot fall back to them; the session start then reads the new account's limits.
575 onSignedIn: resetUsage.pipe(
576 Effect.andThen(
577 SubscriptionRef.update(metadata, (state) => {
578 const { usageLimits: _previousAccount, ...draft } = state.draft;
579 return { ...state, draft };
580 }),
581 ),
582 Effect.andThen(
583 Deferred.await(republish).pipe(
584 Effect.flatten,
585 Effect.provideService(PublishingUsage, true),
586 ),
587 ),
588 Effect.asVoid,
589 ),
590 onSignedOut: clearAccountMetadata(),
591 onAuthRequired: clearAccountMetadata(),
592 snapshotForCwd,
593 };
594});