import { isLocalWorkspaceResourceId } from "../local-artifacts/index.js"; import type { StoreWriteOptions } from "../settings/store.js"; export declare const SHARED_OWNER = "__shared__"; export declare const WORKSPACE_OWNER = "__workspace__"; /** * Encode an organization id into the existing resource owner key. This keeps * organization resources isolated without a destructive resources-table * migration, while preserving the legacy `__shared__` owner as the app-wide * default/fallback used by older deployments and solo mode. */ export declare function organizationResourceOwner(orgId: string): string; export declare function organizationIdFromResourceOwner(owner: string): string | null; /** Active organization scope, with the legacy app-shared owner as solo fallback. */ export declare function sharedResourceOwner(orgId?: string | null): string; export interface Resource { id: string; path: string; owner: string; content: string; mimeType: string; size: number; createdAt: number; updatedAt: number; createdBy: ResourceCreatedBy; visibility: ResourceVisibility; threadId: string | null; runId: string | null; expiresAt: number | null; metadata: string | null; } export interface ResourceMeta { id: string; path: string; owner: string; mimeType: string; size: number; createdAt: number; updatedAt: number; createdBy: ResourceCreatedBy; visibility: ResourceVisibility; threadId: string | null; runId: string | null; expiresAt: number | null; metadata: string | null; } export type ResourceCreatedBy = "user" | "agent" | "system"; export type ResourceVisibility = "workspace" | "agent_scratch"; export interface ResourceWriteOptions extends StoreWriteOptions { createdBy?: ResourceCreatedBy; visibility?: ResourceVisibility; threadId?: string | null; runId?: string | null; expiresAt?: number | null; metadata?: string | Record | null; } export interface ResourceListOptions { includeAgentScratch?: boolean; workspaceAppId?: string | null; userEmail?: string | null; orgId?: string | null; } export interface ResourceResolutionOptions { workspaceAppId?: string | null; userEmail?: string | null; orgId?: string | null; } export type ResourceInheritanceScope = "workspace" | "shared" | "personal"; export interface EffectiveResourceLayer { scope: ResourceInheritanceScope; label: string; owner: string; resource: ResourceMeta | null; exists: boolean; effective: boolean; overridden: boolean; canWrite: boolean; } export interface EffectiveResourceContext { path: string; effectiveResource: ResourceMeta | null; effectiveScope: ResourceInheritanceScope | null; layers: EffectiveResourceLayer[]; } export declare const LOCAL_WORKSPACE_RESOURCE_METADATA_SOURCE = "local-workspace-resource"; export declare function canWriteLocalWorkspaceResourcePath(resourcePath: string): Promise; export { isLocalWorkspaceResourceId }; /** * Seed personal AGENTS.md and LEARNINGS.md for a user if they don't exist. * Called when listing resources or from the agent chat plugin. */ export declare function ensurePersonalDefaults(owner: string): Promise; export declare function resourceGet(id: string, options?: ResourceResolutionOptions): Promise; export declare function resourceGetByPath(owner: string, path: string, options?: ResourceResolutionOptions): Promise; export declare function resourcePut(owner: string, path: string, content: string, mimeType?: string, options?: ResourceWriteOptions): Promise; export declare function resourceDelete(id: string): Promise; export declare function resourceDeleteByPath(owner: string, path: string): Promise; export declare function resourceList(owner: string, pathPrefix?: string, options?: ResourceListOptions): Promise; export declare function resourceListAccessible(userEmail: string, pathPrefix?: string, options?: ResourceListOptions): Promise; export declare function resourceEffectiveContext(userEmail: string, path: string, options?: ResourceResolutionOptions): Promise; /** * List all resources matching a path prefix across ALL owners. * Used by the recurring jobs scheduler to find all job resources. */ export declare function resourceListAllOwners(pathPrefix: string): Promise; export declare function resourceMove(id: string, newPath: string): Promise; //# sourceMappingURL=store.d.ts.map