import type { ByteSource } from '../../../io/types.ts'; import { IOResult } from '../../../io/types.ts'; import type { Resource } from '../../../resource/base.ts'; import type { PathSpec } from '../../../types.ts'; import type { ResourceName } from '../../../types.ts'; import type { MountEntry } from '../../mount/mount.ts'; import type { NamespaceView } from '../../../ops/types.ts'; import type { Namespace } from '../../mount/namespace/namespace.ts'; import { type MountRegistry } from '../../mount/registry.ts'; import type { Runtime } from '../../../runtime/base.ts'; import type { RouteDecision } from '../../../runtime/routing/index.ts'; import type { Session } from '../../session/session.ts'; import type { DispatchFn } from '../../../runtime/types.ts'; import type { Flags } from './types.ts'; export interface RunOnMountCtx { registry: MountRegistry; session: Session; dispatch: DispatchFn; namespace?: Namespace; ensureOpen?: (resource: Resource) => Promise; runtimeBindings?: Record; routingDecision?: RouteDecision; } interface RunOnMountOpts { stdin?: ByteSource | null; resolveHint?: PathSpec | null; mount?: MountEntry | null; } /** * Drop cached listings and bodies for the mounts a CLI's service backs. * * An account CLI mutates its service by id, so no vfs path can be derived from * the call and per-path invalidation has nothing to aim at: after * `gws sheets spreadsheets create` the new file has no cache entry to expire, * which is exactly the case that matters. What is known is the service, so the * mounts it backs drop their caches and the next read refetches. * * Both caches go, because the two hide different writes. A stale listing hides * a create or a delete; a stale body hides an edit, and these resources cache * reads, so a `cat` after `gws docs documents batchUpdate` would otherwise keep * serving the pre-edit content without ever reaching Google. * * Scoped by the spec's declared `serves` rather than a blanket reset, so a * Slack or S3 mount alongside keeps its cache. */ export declare function dropServiceCaches(registry: MountRegistry, serves: readonly ResourceName[]): Promise; export declare function runOnMount(ctx: RunOnMountCtx, cmdName: string, paths: PathSpec[], texts: string[], flagKwargs: Flags, opts?: RunOnMountOpts): Promise<[ByteSource | null, IOResult]>; export declare function namespaceViewOf(registry: MountRegistry, namespace: Namespace | null, dispatch: DispatchFn): NamespaceView; export {}; //# sourceMappingURL=run.d.ts.map