export { AgentLookupEntry, BuildAgentLookupInput, ParsedMention, TeamMemberLookupRow, UserLookupRow, buildAgentLookup, parseMentions, prepareDiscussionDoc, prepareEntityDescriptionDoc, resolveMentions } from './utils/index.cjs'; import { a as DiscussionModel$1, A as Account, C as Category, S as ScheduledTransactionSummary, b as SubtransactionSummary, c as ConversationState, T as TransactionSummary } from './types-5lxby8F5.cjs'; export { j as AccountType, o as AttachmentModel, p as AttachmentStatus, h as CompressedHistory, i as ConversationConfig, f as ConversationTurn, r as DEFAULT_CONVERSATION_CONFIG, q as DiscussionMention, L as LoanAccountPeriodicValue, d as ProcessCategory, P as ProcessStatus, e as ProcessStepType, k as ScheduledTransactionFrequency, n as TransactionClearedStatus, l as TransactionFlagColor, m as TransactionFlagName, g as TurnMetadata } from './types-5lxby8F5.cjs'; import { T as TaskModel, A as ApprovalModel, M as MilestoneModel, P as ProjectModel, C as Collection$l, b as Collection$m, c as Collection$n, d as Collection$o, e as Collection$p, f as Collection$q, g as Collection$r, h as Collection$s, i as Collection$t } from './Workspace-CoUdcswi.cjs'; export { D as DocumentModel, O as OrgModel, a as TemplateModel, U as UserModel, W as WorkspaceModel } from './Workspace-CoUdcswi.cjs'; import { z } from 'zod'; import { R as RoleModel, a as RoleMembershipModel, C as Collection$u, b as Collection$v } from './RoleMembership-CkKSxZZF.cjs'; import { KeyRing, EncryptionContext, KeyLookupFn } from '@epicdm/flowstate-crypto'; import { a as CollectionMode, b as D1QueryParams } from './d1Client-BfyBzH2u.cjs'; export { C as CollectionModeConfig, D as D1Client, c as D1ClientError, g as getCollectionMode } from './d1Client-BfyBzH2u.cjs'; declare const safeNanoid: (size?: number) => string; /** * Canonical mapping from entity type to ID prefix. * This is the source of truth for all ID prefixes. * Each prefix must be unique and exactly 4 characters long. * * When adding a new entity type: * 1. Add it here with a unique prefix * 2. Also update ID_PREFIX_TO_COLLECTION to include the new prefix * 3. Use createId('entitytype') to generate IDs */ declare const ENTITY_TO_PREFIX: Record; /** * Generate a unique ID for an entity type. * Format: {prefix}_{nanoid} where prefix is looked up from ENTITY_TO_PREFIX. * * @param entityType - The entity type (e.g., 'task', 'project', 'goal') * @returns A unique ID string (e.g., 'task_abc123xyz0') * @throws Error if entityType is not registered in ENTITY_TO_PREFIX * * @example * createId('task') // 'task_abc123xyz0' * createId('project') // 'proj_xyz789abc1' * createId('goal') // 'goal_def456ghi2' */ declare const createId: (entityType: string) => string; /** * Map of ID prefixes to collection names. * Manually maintained; must be kept in sync with ENTITY_TO_PREFIX. * Used to determine the entity type from an ID string. */ declare const ID_PREFIX_TO_COLLECTION: Record; /** * Get the collection name from an entity ID by parsing its prefix. * IDs are generated with format: `{prefix}_{nanoid}` where prefix is from ENTITY_TO_PREFIX. * * @param id - The entity ID (e.g., 'task_abc123', 'proj_xyz789', 'mile_def456') * @returns The collection name (e.g., 'tasks', 'projects', 'milestones') or null if unknown * * @example * getCollectionFromId('task_abc123') // returns 'tasks' * getCollectionFromId('proj_xyz789') // returns 'projects' * getCollectionFromId('mile_def456') // returns 'milestones' * getCollectionFromId('unknown_123') // returns null */ declare const getCollectionFromId: (id: string) => string | null; /** * Get the entity type (singular form) from an entity ID. * This is useful for display purposes and polymorphic relationships. * * @param id - The entity ID (e.g., 'task_abc123', 'proj_xyz789') * @returns The entity type (e.g., 'task', 'project', 'milestone') or null if unknown * * @example * getEntityTypeFromId('task_abc123') // returns 'task' * getEntityTypeFromId('proj_xyz789') // returns 'project' * getEntityTypeFromId('mile_def456') // returns 'milestone' */ declare const getEntityTypeFromId: (id: string) => string | null; /** * Conversation Model Interface (auto-generated from Drizzle schema) */ interface ConversationModel { id: string; orgId: string; workspaceId?: string; userId: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; title: string; provider: string; model: string; settings?: Record; tenantId?: string; } declare const Collection$k: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; title: { type: string; maxLength: number; }; provider: { type: string; maxLength: number; }; model: { type: string; maxLength: number; }; settings: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Message Model Interface (auto-generated from Drizzle schema) */ interface MessageModel { id: string; orgId: string; workspaceId?: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; conversationId: string; role: string; content: string; toolCalls?: unknown[]; mentions?: Record[]; tenantId?: string; } declare const Collection$j: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; conversationId: { type: string; maxLength: number; }; role: { type: string; maxLength: number; }; content: { type: string; maxLength: number; }; toolCalls: { type: string; items: {}; }; mentions: { type: string; items: { type: string; properties: { type: { type: string; maxLength: number; }; identifier: { type: string; maxLength: number; }; teamMemberId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; position: { type: string; minimum: number; maximum: number; multipleOf: number; }; }; required: string[]; }; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Agent Inbox Query * * Single-call surface for an agent's active workload: * - Tasks they're assigned to (Planned + In Progress) * - Discussions where they were @-mentioned (within the lookback window) * - Replies on threads they authored OR where they were @-mentioned in the reply * * Design spec: docs/specs/2026-05-03-agent-inbox-design.md §2 * * Pure library: depends only on the in-memory collection accessor shape * defined by `AgentInboxCollections`. CLI and MCP surfaces (Phase 3) wire * up the accessors against RxDB; tests pass mocks. */ interface TaskInboxItem { id: string; title: string; description?: string; status: string; priority: number; projectId?: string; milestoneId?: string; parentTaskId?: string; createdAt: string; updatedAt: string; dueAt?: string; } interface MentionInboxItem { discussionId: string; entityType: string; entityId: string; authorTeamMemberId: string; authorUserName: string; contentSnippet: string; position: number; createdAt: string; /** Set when the discussion's entity is one of MY active tasks. */ relatedTaskId?: string; } interface ReplyInboxItem { discussionId: string; parentDiscussionId: string; authorTeamMemberId: string; authorUserName: string; contentSnippet: string; myPriorSnippet?: string; reason: 'authored-thread' | 'mentioned-in-reply'; createdAt: string; /** Set when the discussion's entity is one of MY active tasks. */ relatedTaskId?: string; } /** * Multi-agent conversation surfaced in the inbox. One entry per * `conversations` row where the agent is a participant. New since * proj_qMizgu4RD2 (Conversations Extension); see spec §3. */ interface ConversationInboxItem { conversationId: string; title: string; participantIds: string[]; /** Resolved at query time when `collections.teammembers` is available. */ participantSlugs?: string[]; /** True when the conversation was implicitly created from a DM. */ isDm: boolean; /** True when the agent has muted this thread (`metadata.mutedBy` contains me). */ isMuted: boolean; /** Count of messages in window where `userId !== me`. */ unreadCount: number; /** Any unread message has me in `mentions[]` (per the hybrid match). */ hasUnreadMention: boolean; /** Denormalized from `metadata.lastMessageAt` (set by d1-worker hook). */ lastMessageAt: string; /** First 200 chars of the last message; from `metadata.lastMessagePreview`. */ lastMessagePreview: string; /** teamMemberId of the last message author. */ lastMessageAuthorId: string; /** Resolved slug for the last message author. */ lastMessageAuthorSlug?: string; /** Self-reported confidence (0-1) on the latest unread message, when set. */ lastMessageConfidence?: number; turnsUsed?: number; maxTurns?: number; turnsRemaining?: number; /** True when `turnsUsed >= maxTurns`. */ policyExceeded?: boolean; /** True when `turnPolicy.closedAt` is set. */ isClosed?: boolean; /** From `turnPolicy.closedReason` when the conversation is closed. */ closedReason?: string; /** Original requester's confidence target from `turnPolicy.expectedConfidence`. */ expectedConfidence?: number; } /** * Pending approval where the caller is the approver. Surfaced in the * inbox as a separate section because they have a different action shape * from mentions/replies (response is a `collection-update`, not a new * discussion) and a different urgency profile (most workflows block * downstream tasks until the approval lands). * * `approverId` on the wire is a single string — agents = `team_xxx`, * humans = `user_xxx`. The query just matches whichever id the caller * carries. */ interface ApprovalInboxItem { /** `appr_xxx` — full id, used directly in the response `collection-update`. */ id: string; title: string; /** Free-form type label (e.g. "brainstorm-question", "phase-decomposition"). */ type: string; /** Workflow category slug (e.g. "brainstorming", "planning"). */ category: string; /** Human-readable category label (e.g. "Brainstorming"). */ categoryName: string; /** Free-form status — pending entries appear here; resolved ones don't. */ status: string; /** Optional preview of `documentContent` (first 200 chars). */ contentSnippet?: string; /** Optional doc-type discriminator, e.g. "proposals", "phase-decomposition". */ documentType?: string; /** Cross-references to the entity awaiting approval — populated when set. */ projectId?: string; milestoneId?: string; taskId?: string; documentId?: string; /** Approval creator (the one who *requested* the approval). */ requestedByUserId: string; createdAt: string; } /** * Mention parsed from a task / milestone / project `description` field * (PR C). Distinct from {@link MentionInboxItem} (which is sourced from * `discussions`) because the action surface is different — to clear a * description-mention you typically reply with a `discussions` post on * the entity, not edit the description. */ interface DescriptionMentionInboxItem { /** Collection the entity lives in: `'tasks' | 'milestones' | 'projects'`. */ entityType: 'task' | 'milestone' | 'project'; /** Full entity id with native prefix (`task_<12>`, `mile_<12>`, `proj_<12>`). */ entityId: string; /** Entity title — agent's primary anchor when reading the inbox. */ title: string; /** First 200 chars of the description so the agent has context. */ descriptionSnippet: string; /** Position of my @-handle inside the description. */ position: number; /** Last write time (`updatedAt`) — relative-time anchor. */ updatedAt: string; } interface AgentInboxResult { tasks: TaskInboxItem[]; mentions: MentionInboxItem[]; replies: ReplyInboxItem[]; /** Multi-agent conversations where I'm a participant (Phase 2 of proj_qMizgu4RD2). */ conversations: ConversationInboxItem[]; /** Pending approvals where I'm the approver. */ approvals: ApprovalInboxItem[]; /** PR C: @-mentions found in task/milestone/project `description` fields. */ descriptionMentions: DescriptionMentionInboxItem[]; /** ISO 8601 timestamp of when the query ran. */ generatedAt: string; /** ISO 8601 cutoff (now - sinceDays) used to filter discussions/replies. */ windowStart: string; } /** * Identity for an inbox query. Discriminated union so the same code path * serves both agents (queried by `teamMemberId` + `slug`) and humans * (queried by `userId`). Conversations are skipped when `kind === 'user'` * — agent-to-agent threads aren't a human surface today. */ type InboxIdentity = AgentInboxIdentity | UserInboxIdentity; interface AgentInboxIdentity { kind: 'agent'; teamMemberId: string; slug: string; orgId: string; workspaceId: string; } interface UserInboxIdentity { kind: 'user'; userId: string; orgId: string; workspaceId: string; } interface AgentInboxOpts { /** Lookback window in days. Default 7. */ sinceDays?: number; /** Per-signal cap (tasks, mentions, replies). Default 50. */ limit?: number; } /** * Minimal accessor shape backing the inbox query. * * `find` accepts a Mango-style selector and optional sort/limit; concrete * implementations may translate this to RxDB queries, D1 SELECTs, or * in-memory filters (the test path). */ interface AgentInboxCollections { tasks: { find(query: { selector: Record; sort?: Array>; limit?: number; }): Promise; }; discussions: { find(query: { selector: Record; sort?: Array>; limit?: number; }): Promise; findByIds(ids: string[]): Promise; }; /** * Optional — when not provided, `AgentInboxResult.conversations` is empty. * Phase 2 of proj_qMizgu4RD2. */ conversations?: { find(query: { selector: Record; sort?: Array>; limit?: number; }): Promise; }; /** * Optional — required only when `conversations` accessor is provided. */ messages?: { find(query: { selector: Record; sort?: Array>; limit?: number; }): Promise; }; /** * Optional — when provided, `ConversationInboxItem.participantSlugs` and * `lastMessageAuthorSlug` are resolved via a single batched lookup. */ teammembers?: { findByIds(ids: string[]): Promise>; }; /** * Optional — when not provided, `AgentInboxResult.approvals` is empty. * Pending approvals where the caller is the `approverId`. */ approvals?: { find(query: { selector: Record; sort?: Array>; limit?: number; }): Promise; }; /** * Optional — when ANY of these three accessors are wired, the inbox * scans the corresponding collection's `mentions[]` field. Missing * accessor → that collection is silently skipped (so a caller can * mount only the collections they care about). * * The `tasks` accessor is reused from above for description-mention * scanning; we don't add a separate one. Milestones and projects * each get their own here. */ milestones?: { find(query: { selector: Record; sort?: Array>; limit?: number; }): Promise; }; projects?: { find(query: { selector: Record; sort?: Array>; limit?: number; }): Promise; }; } /** * Build an agent's active inbox. * * @param collections - Accessors for `tasks` and `discussions` collections. * @param identity - The agent's resolved identity (teamMemberId, slug, tenancy). * @param opts - Optional sinceDays (default 7) and per-signal limit (default 50). * * @returns AgentInboxResult — three independent arrays (tasks, mentions, replies) * plus `generatedAt` / `windowStart` for caller display. */ declare function getInbox(collections: AgentInboxCollections, identity: InboxIdentity, opts?: AgentInboxOpts): Promise; /** * Backward-compat alias for the agent-only inbox surface. * * @deprecated Use {@link getInbox} with an {@link InboxIdentity} * (discriminated union) instead. Existing call sites that pass a literal * of the old shape just need a `kind: 'agent'` discriminator added to * compile against the new typing. */ declare const getAgentInbox: typeof getInbox; /** * Pure hierarchy helpers for OpenClaw agent authorization. * * Inputs are plain teammember-like rows. Local `.flowstate/agents/*.json` * files are bootstrap/import artifacts only and are not runtime hierarchy * authority. The helpers intentionally avoid RxDB document APIs so MCP, CLI, * workers, and tests can all call the same code with already-loaded records. */ interface AgentHierarchyRecord { id?: string; slug?: string | null; name?: string | null; userName?: string | null; role?: string | null; directReports?: unknown; metadata?: Record; extended?: { agent?: { name?: string | null; metadata?: Record; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; } interface AgentHierarchyCollections { teammembers?: AgentHierarchyRecord[] | { records?: AgentHierarchyRecord[]; }; records?: AgentHierarchyRecord[]; } type AgentHierarchyInput = AgentHierarchyRecord[] | AgentHierarchyCollections; declare function getDirectReports(input: AgentHierarchyInput, managerSlug: string): string[]; declare function getDescendants(input: AgentHierarchyInput, managerSlug: string): string[]; declare function assertCanControl(input: AgentHierarchyInput, managerSlug: string, childSlug: string): true; declare function assertCanReport(input: AgentHierarchyInput, managerSlug: string, targetSlug: string): true; interface SubordinateReportOptions { managerSlug: string; scope?: 'direct' | 'descendants'; sinceDays?: number; limit?: number; now?: Date | string; includeInbox?: boolean; orgId?: string; workspaceId?: string; } interface SubordinateControlPlaneReport { manager: { slug: string; }; scope: 'direct' | 'descendants'; generatedAt: string; windowStart: string; rollup: { totalAgents: number; activeTasks: number; blockedTasks: number; overdueTasks: number; unreadInboxItems: number; limitedAgents: number; }; agents: SubordinateAgentReport[]; } interface SubordinateAgentReport { identity: { slug: string; teamMemberId?: string; reportsTo?: string; directReports: string[]; }; lifecycle: { provisioned: boolean; containerEnabled: boolean; containerStatus?: string; heartbeatAt?: string; heartbeatAgeSeconds?: number; chatEndpoint?: string; readiness: { rbac: 'ready' | 'missing'; vault: 'ready' | 'missing'; budget: 'ready' | 'missing'; filesystem: 'ready' | 'missing'; container: 'ready' | 'missing'; health: 'ready' | 'missing'; }; readinessRefs: string[]; blockerReasons: string[]; remediation: string[]; }; work: { statusCounts: Record; activeTasks: number; blockedTasks: number; overdueTasks: number; currentTaskIds: string[]; taskLimit: number; truncated: boolean; }; inbox: SubordinateInboxSummary; blockers: SubordinateBlockerReference[]; } interface SubordinateInboxSummary { tasks: number; mentions: number; replies: number; conversations: number; approvals: number; descriptionMentions: number; totalUnread: number; } interface SubordinateBlockerReference { taskId?: string; discussionId?: string; title?: string; status?: string; updatedAt?: string; discussionUpdatedAt?: string; } interface SubordinateReportCollections { teammembers?: TeamMemberReportSource; records?: AgentRecordSource; tasks?: OptionalFindCollection; discussions?: DiscussionReportCollection; conversations?: OptionalFindCollection; messages?: OptionalFindCollection; approvals?: OptionalFindCollection; milestones?: OptionalFindCollection; projects?: OptionalFindCollection; } type TeamMemberReportSource = SubordinateTeamMemberRecord[] | { records?: SubordinateTeamMemberRecord[]; find?: (query: ReportFindQuery) => Promise; findByIds?: (ids: string[]) => Promise; }; type AgentRecordSource = AgentHierarchyRecord[] | { records?: AgentHierarchyRecord[]; find?: (query: ReportFindQuery) => Promise; }; interface SubordinateTeamMemberRecord extends AgentHierarchyRecord { id: string; orgId?: string; workspaceId?: string; userName: string; slug?: string; isAgent?: boolean; lastHeartbeat?: string; containerStatus?: string; } interface OptionalFindCollection { find(query: ReportFindQuery): Promise; } interface DiscussionReportCollection extends OptionalFindCollection { findByIds?: (ids: string[]) => Promise; } interface ReportFindQuery { selector: Record; sort?: Array>; limit?: number; } declare function getSubordinateReport(collections: SubordinateReportCollections, options: SubordinateReportOptions): Promise; declare const activitySchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; entityType: z.ZodString; entityId: z.ZodString; entityName: z.ZodString; action: z.ZodString; userName: z.ZodString; productId: z.ZodOptional; changes: z.ZodOptional>; tenantId: z.ZodOptional; }, z.core.$strip>; type ActivityInput = z.infer; declare const approvalSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; projectId: z.ZodString; milestoneId: z.ZodOptional; taskId: z.ZodOptional; documentId: z.ZodOptional; title: z.ZodString; type: z.ZodString; category: z.ZodString; categoryName: z.ZodString; status: z.ZodString; documentType: z.ZodOptional; documentContent: z.ZodOptional; response: z.ZodOptional; annotations: z.ZodOptional; comments: z.ZodOptional; respondedAt: z.ZodOptional; approverId: z.ZodOptional; tenantId: z.ZodOptional; }, z.core.$strip>; type ApprovalInput = z.infer; declare const appSnapshotSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; capturedBy: z.ZodString; capturedAt: z.ZodString; appId: z.ZodString; snapshotType: z.ZodString; name: z.ZodString; period: z.ZodString; periodType: z.ZodString; notes: z.ZodOptional; summary: z.ZodRecord; data: z.ZodRecord; tenantId: z.ZodOptional; }, z.core.$strip>; type AppSnapshotInput = z.infer; declare const attributeSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; title: z.ZodString; description: z.ZodOptional; color: z.ZodString; entityType: z.ZodString; type: z.ZodString; sortOrder: z.ZodOptional; popularity: z.ZodOptional; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type AttributeInput = z.infer; declare const codebaseSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; title: z.ZodString; description: z.ZodString; repository: z.ZodRecord; environment: z.ZodRecord; deployment: z.ZodOptional>; agentWorkflow: z.ZodOptional>; tags: z.ZodOptional>; status: z.ZodString; archivedAt: z.ZodOptional; archived: z.ZodBoolean; tenantId: z.ZodOptional; gitProvider: z.ZodOptional; gitNamespace: z.ZodOptional; gitRepo: z.ZodOptional; gitRepoId: z.ZodOptional; gitDefaultBranch: z.ZodOptional; gitConnectionId: z.ZodOptional; gitVisibility: z.ZodOptional; gitPushedAt: z.ZodOptional; gitWebUrl: z.ZodOptional; }, z.core.$strip>; type CodebaseInput = z.infer; declare const connector_sync_runsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; configId: z.ZodString; providerId: z.ZodString; endpointId: z.ZodOptional; startedAt: z.ZodString; completedAt: z.ZodString; status: z.ZodString; triggeredBy: z.ZodString; recordsRead: z.ZodNumber; inserts: z.ZodNumber; updates: z.ZodNumber; errors: z.ZodNumber; errorMessage: z.ZodOptional; durationMs: z.ZodNumber; archived: z.ZodBoolean; }, z.core.$strip>; type Connector_sync_runsInput = z.infer; declare const connectorConfigSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; providerId: z.ZodString; name: z.ZodString; enabled: z.ZodBoolean; direction: z.ZodString; pollingIntervalMs: z.ZodNumber; providerConfig: z.ZodOptional>; fieldMappings: z.ZodOptional>>; archived: z.ZodBoolean; nextSyncAt: z.ZodOptional; lastSyncAt: z.ZodOptional; lastError: z.ZodOptional; failureCount: z.ZodNumber; }, z.core.$strip>; type ConnectorConfigInput = z.infer; declare const conversationSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; title: z.ZodString; provider: z.ZodString; model: z.ZodString; settings: z.ZodOptional>; tenantId: z.ZodOptional; }, z.core.$strip>; type ConversationInput = z.infer; declare const discussionSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; entityType: z.ZodString; entityId: z.ZodString; content: z.ZodString; contentHtml: z.ZodOptional; parentId: z.ZodOptional; threadDepth: z.ZodNumber; isEdited: z.ZodBoolean; editedAt: z.ZodOptional; isDeleted: z.ZodBoolean; deletedAt: z.ZodOptional; userName: z.ZodString; userAvatar: z.ZodOptional; attachments: z.ZodOptional; checksum: z.ZodOptional; }, z.core.$strip>>>; reactionCounts: z.ZodOptional>; mentions: z.ZodOptional; userId: z.ZodOptional; position: z.ZodNumber; }, z.core.$strip>>>; tenantId: z.ZodOptional; }, z.core.$strip>; type DiscussionInput = z.infer; declare const documentSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; projectId: z.ZodOptional; milestoneId: z.ZodOptional; taskId: z.ZodOptional; codebaseId: z.ZodOptional; documentType: z.ZodString; title: z.ZodString; content: z.ZodOptional; storage: z.ZodOptional>; documentVersion: z.ZodNumber; approved: z.ZodBoolean; approvedAt: z.ZodOptional; approvedBy: z.ZodOptional; tenantId: z.ZodOptional; }, z.core.$strip>; type DocumentInput = z.infer; declare const git_connectionsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; provider: z.ZodString; authMethod: z.ZodString; apiHost: z.ZodString; externalAccountId: z.ZodString; externalAccountLogin: z.ZodString; externalAccountType: z.ZodString; tokenVaultRef: z.ZodOptional; scopes: z.ZodOptional>; permissions: z.ZodOptional>; webhookSecretVaultRef: z.ZodOptional; webhookEvents: z.ZodOptional>; repoSelection: z.ZodOptional; providerData: z.ZodOptional>; status: z.ZodString; suspendedAt: z.ZodOptional; archived: z.ZodBoolean; }, z.core.$strip>; type Git_connectionsInput = z.infer; /** * @fileoverview Zod schema for the pullrequests VCA collection. * * Pull Requests and Merge Requests from any connected Git provider. * Provider-specific extras (e.g. GitHub's `auto_merge`, GitLab's `source_project_id`) * go in `providerData` so the table schema stays provider-agnostic. * * Identity tuple: (gitConnectionId, repoId, number) * ID prefix: prq_ */ declare const pullrequestsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; gitConnectionId: z.ZodString; codebaseId: z.ZodOptional; repoId: z.ZodString; number: z.ZodNumber; title: z.ZodString; body: z.ZodOptional; state: z.ZodEnum<{ open: "open"; closed: "closed"; merged: "merged"; }>; draft: z.ZodDefault; headRef: z.ZodString; headSha: z.ZodString; baseRef: z.ZodString; baseSha: z.ZodString; mergeable: z.ZodOptional>; additions: z.ZodOptional; deletions: z.ZodOptional; changedFiles: z.ZodOptional; authorLogin: z.ZodString; requestedReviewers: z.ZodOptional>; assignees: z.ZodOptional>; labels: z.ZodOptional>; milestoneId: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; closedAt: z.ZodOptional>; mergedAt: z.ZodOptional>; mergedBy: z.ZodOptional>; providerData: z.ZodOptional>; }, z.core.$strip>; type PullrequestsInput = z.infer; /** * @fileoverview Zod schema for the commits VCA collection. * * Git commits from any connected provider. One row per unique (gitConnectionId, repoId, sha). * * Identity tuple: (gitConnectionId, repoId, sha) * ID prefix: cmt_ */ declare const commitsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; gitConnectionId: z.ZodString; codebaseId: z.ZodOptional; repoId: z.ZodString; sha: z.ZodString; message: z.ZodString; authorLogin: z.ZodOptional>; authorEmail: z.ZodString; authoredAt: z.ZodString; committedAt: z.ZodString; parentShas: z.ZodOptional>; providerData: z.ZodOptional>; }, z.core.$strip>; type CommitsInput = z.infer; /** * @fileoverview Zod schema for the branches VCA collection. * * Git branches from any connected provider. * * Identity tuple: (gitConnectionId, repoId, name) * ID prefix: brn_ */ declare const branchesSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; gitConnectionId: z.ZodString; codebaseId: z.ZodOptional; repoId: z.ZodString; name: z.ZodString; headSha: z.ZodString; isProtected: z.ZodDefault; providerData: z.ZodOptional>; }, z.core.$strip>; type BranchesInput = z.infer; /** * @fileoverview Zod schema for the releases VCA collection. * * Git releases / tags from any connected provider. * * Identity tuple: (gitConnectionId, repoId, tagName) * ID prefix: rel_ */ declare const releasesSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; gitConnectionId: z.ZodString; codebaseId: z.ZodOptional; repoId: z.ZodString; tagName: z.ZodString; name: z.ZodOptional; body: z.ZodOptional; isPrerelease: z.ZodDefault; isDraft: z.ZodDefault; publishedAt: z.ZodOptional>; authorLogin: z.ZodString; providerData: z.ZodOptional>; }, z.core.$strip>; type ReleasesInput = z.infer; /** * @fileoverview Zod schema for the workflow_runs VCA collection. * * CI/CD pipeline runs from any connected provider * (GitHub Actions, GitLab Pipelines, Forgejo Actions, etc.). * * Identity tuple: (gitConnectionId, repoId, runId) * ID prefix: wfr_ */ declare const workflow_runsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; gitConnectionId: z.ZodString; codebaseId: z.ZodOptional; repoId: z.ZodString; runId: z.ZodString; name: z.ZodString; status: z.ZodEnum<{ completed: "completed"; in_progress: "in_progress"; queued: "queued"; }>; conclusion: z.ZodOptional>>; headSha: z.ZodString; branchName: z.ZodOptional>; runStartedAt: z.ZodString; completedAt: z.ZodOptional>; durationMs: z.ZodOptional>; providerData: z.ZodOptional>; }, z.core.$strip>; type Workflow_runsInput = z.infer; /** * @fileoverview Zod schema for the git_comments VCA collection. * * Issue, PR, commit, and review thread comments from any connected provider. * Stored as a unified collection; `parentType` discriminates the context. * * Named `git_comments` (prefix `gcm_`) to avoid collision with the existing * generic `comment` entity (prefix `cmnt`) used by process flows. * * Identity tuple: (gitConnectionId, repoId, commentId, parentType) * ID prefix: gcm_ */ declare const git_commentsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; gitConnectionId: z.ZodString; codebaseId: z.ZodOptional; repoId: z.ZodString; commentId: z.ZodString; parentType: z.ZodEnum<{ commit: "commit"; review: "review"; issue: "issue"; pr: "pr"; }>; parentId: z.ZodString; body: z.ZodString; authorLogin: z.ZodString; createdAt: z.ZodString; updatedAt: z.ZodString; providerData: z.ZodOptional>; }, z.core.$strip>; type Git_commentsInput = z.infer; /** * @fileoverview Zod schema for the reviews VCA collection. * * PR/MR review objects (the top-level review submission, not individual line comments). * Line-level comments are stored in the `review_comments` collection. * * Identity tuple: (gitConnectionId, repoId, prNumber, reviewId) * ID prefix: grv_ */ declare const reviewsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; gitConnectionId: z.ZodString; codebaseId: z.ZodOptional; repoId: z.ZodString; pullrequestId: z.ZodOptional; prNumber: z.ZodNumber; reviewId: z.ZodString; state: z.ZodEnum<{ approved: "approved"; changes_requested: "changes_requested"; commented: "commented"; dismissed: "dismissed"; }>; body: z.ZodOptional; authorLogin: z.ZodString; submittedAt: z.ZodString; providerData: z.ZodOptional>; }, z.core.$strip>; type ReviewsInput = z.infer; /** * @fileoverview Zod schema for the review_comments VCA collection. * * Line-level review comments (inline code annotations on a PR/MR diff). * The parent review object lives in the `reviews` collection. * * Identity tuple: (gitConnectionId, repoId, commentId) * ID prefix: grc_ */ declare const review_commentsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; gitConnectionId: z.ZodString; codebaseId: z.ZodOptional; repoId: z.ZodString; commentId: z.ZodString; reviewId: z.ZodOptional; prNumber: z.ZodNumber; path: z.ZodString; line: z.ZodOptional>; side: z.ZodEnum<{ LEFT: "LEFT"; RIGHT: "RIGHT"; }>; body: z.ZodString; authorLogin: z.ZodString; createdAt: z.ZodString; providerData: z.ZodOptional>; }, z.core.$strip>; type Review_commentsInput = z.infer; /** * @fileoverview Zod schema for the git_project_links VCA collection. * * Mapping table between FlowState Projects and provider-side project/group entities. * Allows a single FlowState project to track work across multiple provider projects * (e.g. a GitHub org with several repos grouped under one FlowState project). * * Identity tuple: (flowstateProjectId, gitConnectionId, externalProjectId) * ID prefix: gpl_ */ declare const git_project_linksSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; flowstateProjectId: z.ZodString; gitConnectionId: z.ZodString; externalProjectId: z.ZodString; externalProjectUrl: z.ZodOptional; syncedFields: z.ZodOptional>; providerData: z.ZodOptional>; }, z.core.$strip>; type Git_project_linksInput = z.infer; /** * @fileoverview Zod schema for the connector_webhook_events VCA collection. * * Inbound webhook audit log for all Git provider events. Every raw webhook * delivery is persisted here before dispatch to domain handlers. This gives * Phase 7 idempotency (deliveryId dedup) and auditability for failed events. * * Identity tuple: (provider, deliveryId) * ID prefix: cwe_ */ declare const connector_webhook_eventsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; provider: z.ZodString; deliveryId: z.ZodString; gitConnectionId: z.ZodOptional>; eventType: z.ZodString; payload: z.ZodRecord; headers: z.ZodRecord; receivedAt: z.ZodString; processedAt: z.ZodOptional>; status: z.ZodEnum<{ failed: "failed"; received: "received"; processed: "processed"; }>; errorMessage: z.ZodOptional>; }, z.core.$strip>; type Connector_webhook_eventsInput = z.infer; declare const goalSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodOptional; title: z.ZodString; description: z.ZodOptional; status: z.ZodString; priority: z.ZodString; category: z.ZodOptional; progressMode: z.ZodOptional; currentProgress: z.ZodOptional; completed: z.ZodBoolean; dueDate: z.ZodOptional; targetDate: z.ZodOptional; parentGoalId: z.ZodOptional; metrics: z.ZodOptional>; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type GoalInput = z.infer; declare const messageSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; conversationId: z.ZodString; role: z.ZodString; content: z.ZodString; toolCalls: z.ZodOptional>; tenantId: z.ZodOptional; }, z.core.$strip>; type MessageInput = z.infer; declare const milestoneSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodOptional; title: z.ZodString; description: z.ZodOptional; completed: z.ZodBoolean; status: z.ZodOptional; sortOrder: z.ZodOptional; projectId: z.ZodString; goalId: z.ZodString; startAt: z.ZodOptional; startedAt: z.ZodOptional; dueAt: z.ZodOptional; completedAt: z.ZodOptional; archived: z.ZodBoolean; timeBudgetHours: z.ZodOptional; categoryId: z.ZodOptional; tagIds: z.ZodOptional>; version: z.ZodNumber; tenantId: z.ZodOptional; }, z.core.$strip>; type MilestoneInput = z.infer; declare const orgSchema: z.ZodObject<{ id: z.ZodString; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; description: z.ZodOptional; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type OrgInput = z.infer; declare const processesSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; title: z.ZodString; description: z.ZodOptional; version: z.ZodOptional; status: z.ZodString; category: z.ZodOptional; startStepId: z.ZodOptional; documentId: z.ZodOptional; flowId: z.ZodOptional; trigger: z.ZodOptional>; inputSchema: z.ZodOptional>; outputSchema: z.ZodOptional>; executionConfig: z.ZodOptional>; maxSubprocessDepth: z.ZodOptional; executorAgentId: z.ZodOptional; statistics: z.ZodOptional>; requiredCapabilities: z.ZodOptional>; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type ProcessesInput = z.infer; declare const processExecutionsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; processId: z.ZodString; processVersion: z.ZodOptional; status: z.ZodString; progress: z.ZodNumber; currentStepId: z.ZodOptional; startedAt: z.ZodOptional; completedAt: z.ZodOptional; durationMs: z.ZodOptional; retryCount: z.ZodNumber; maxRetries: z.ZodNumber; inputs: z.ZodRecord; outputs: z.ZodOptional>; variables: z.ZodRecord; context: z.ZodRecord; stepHistory: z.ZodArray; error: z.ZodOptional>; correlationId: z.ZodOptional; externalId: z.ZodOptional; parentExecutionId: z.ZodOptional; depth: z.ZodOptional; resumeAt: z.ZodOptional; workerId: z.ZodOptional; processName: z.ZodOptional; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type ProcessExecutionsInput = z.infer; declare const processStepsSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; processId: z.ZodString; templateId: z.ZodOptional; name: z.ZodString; title: z.ZodString; description: z.ZodOptional; stepType: z.ZodString; order: z.ZodNumber; optional: z.ZodBoolean; enabled: z.ZodBoolean; nextStepId: z.ZodOptional; action: z.ZodOptional>; conditions: z.ZodOptional>>; outputs: z.ZodOptional>>; outputExtraction: z.ZodOptional>; inputs: z.ZodOptional>; requiredVariables: z.ZodOptional>; position: z.ZodOptional>; estimatedDurationMinutes: z.ZodOptional; icon: z.ZodOptional; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type ProcessStepsInput = z.infer; declare const projectSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodOptional; title: z.ZodString; description: z.ZodOptional; completed: z.ZodBoolean; status: z.ZodOptional; sortOrder: z.ZodOptional; goalId: z.ZodOptional; startAt: z.ZodOptional; startedAt: z.ZodOptional; dueAt: z.ZodOptional; completedAt: z.ZodOptional; archived: z.ZodBoolean; codebaseId: z.ZodOptional; sourceTemplateId: z.ZodOptional; timeBudgetHours: z.ZodOptional; categoryId: z.ZodOptional; tagIds: z.ZodOptional>; productId: z.ZodOptional; roadmapId: z.ZodOptional; initiativeId: z.ZodOptional; version: z.ZodNumber; tenantId: z.ZodOptional; }, z.core.$strip>; type ProjectInput = z.infer; declare const recordSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; schemaId: z.ZodString; title: z.ZodString; status: z.ZodOptional; parentId: z.ZodOptional; parentCollection: z.ZodOptional; data: z.ZodRecord; archived: z.ZodBoolean; completed: z.ZodOptional; completedAt: z.ZodOptional; startedAt: z.ZodOptional; sortOrder: z.ZodOptional; assigneeId: z.ZodOptional; priority: z.ZodOptional; dueAt: z.ZodOptional; amount: z.ZodOptional; version: z.ZodNumber; tenantId: z.ZodOptional; }, z.core.$strip>; type RecordInput = z.infer; declare const relationSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; sourceId: z.ZodString; sourceCollection: z.ZodString; sourceSchemaId: z.ZodOptional; targetId: z.ZodString; targetCollection: z.ZodString; targetSchemaId: z.ZodOptional; relationType: z.ZodString; data: z.ZodOptional>; sortOrder: z.ZodOptional; label: z.ZodOptional; tenantId: z.ZodOptional; }, z.core.$strip>; type RelationInput = z.infer; declare const roleSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; title: z.ZodString; description: z.ZodOptional; scopeType: z.ZodOptional; scopeId: z.ZodOptional; builtIn: z.ZodBoolean; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type RoleInput = z.infer; declare const roleMembershipSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; roleId: z.ZodString; grantedBy: z.ZodString; scopeType: z.ZodOptional; scopeId: z.ZodOptional; status: z.ZodDefault; expiresAt: z.ZodOptional; tenantId: z.ZodOptional; }, z.core.$strip>; type RoleMembershipInput = z.infer; declare const schemaSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; title: z.ZodString; description: z.ZodString; icon: z.ZodOptional; category: z.ZodString; target: z.ZodString; fields: z.ZodArray>; titleField: z.ZodString; defaultSort: z.ZodOptional>; ownerPluginId: z.ZodOptional; builtIn: z.ZodBoolean; version: z.ZodNumber; archived: z.ZodBoolean; classLevelPermissions: z.ZodOptional>; encryptedFields: z.ZodOptional>>; tenantId: z.ZodOptional; }, z.core.$strip>; type SchemaInput = z.infer; declare const serviceKeySchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; serviceName: z.ZodString; publicKey: z.ZodString; fingerprint: z.ZodString; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type ServiceKeyInput = z.infer; declare const stepTemplatesSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; title: z.ZodString; description: z.ZodOptional; category: z.ZodString; stepType: z.ZodString; action: z.ZodRecord; inputs: z.ZodOptional>; outputs: z.ZodOptional>; outputExtraction: z.ZodOptional>; requiredVariables: z.ZodOptional>; cli: z.ZodOptional>; versionField: z.ZodOptional; tags: z.ZodOptional>; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type StepTemplatesInput = z.infer; declare const taskSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodOptional; title: z.ZodString; description: z.ZodOptional; dueAt: z.ZodOptional; startAt: z.ZodOptional; startedAt: z.ZodOptional; completedAt: z.ZodOptional; status: z.ZodOptional>; type: z.ZodOptional; completed: z.ZodOptional; projectId: z.ZodOptional; milestoneId: z.ZodOptional; parentTaskId: z.ZodOptional; archived: z.ZodBoolean; timeBudgetHours: z.ZodOptional; isRecurring: z.ZodOptional; recurrenceRule: z.ZodOptional; parentRecurrenceId: z.ZodOptional; recurrenceInstanceDate: z.ZodOptional; categoryId: z.ZodOptional; tagIds: z.ZodOptional>; priority: z.ZodOptional; assigneeId: z.ZodOptional; estimatePoints: z.ZodOptional; sortOrder: z.ZodOptional; version: z.ZodNumber; tenantId: z.ZodOptional; }, z.core.$strip>; type TaskInput = z.infer; declare const teamMemberSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; userName: z.ZodString; slug: z.ZodOptional; userEmail: z.ZodOptional; userAvatar: z.ZodOptional; role: z.ZodString; isAgent: z.ZodBoolean; joinedAt: z.ZodOptional; raciAssignments: z.ZodOptional>; productId: z.ZodOptional; tenantId: z.ZodOptional; lastHeartbeat: z.ZodOptional; containerStatus: z.ZodOptional; }, z.core.$strip>; type TeamMemberInput = z.infer; declare const templateSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; templateType: z.ZodString; name: z.ZodString; content: z.ZodString; version: z.ZodString; isDefault: z.ZodBoolean; data: z.ZodOptional>; tenantId: z.ZodOptional; }, z.core.$strip>; type TemplateInput = z.infer; declare const timeEntrySchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; taskId: z.ZodString; startAt: z.ZodString; endAt: z.ZodOptional; duration: z.ZodOptional; categoryId: z.ZodOptional; tagIds: z.ZodOptional>; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type TimeEntryInput = z.infer; declare const userSchema: z.ZodObject<{ id: z.ZodString; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; email: z.ZodOptional; authUserId: z.ZodOptional; timezone: z.ZodOptional; archived: z.ZodBoolean; onboarded: z.ZodBoolean; avatarUrl: z.ZodOptional; role: z.ZodOptional; tenantId: z.ZodOptional; }, z.core.$strip>; type UserInput = z.infer; declare const vaultSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; description: z.ZodOptional; icon: z.ZodOptional; encryptedVaultKey: z.ZodOptional; shared: z.ZodBoolean; keyVersion: z.ZodNumber; rotationPending: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type VaultInput = z.infer; declare const vaultItemSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; vaultId: z.ZodString; name: z.ZodString; type: z.ZodString; provider: z.ZodOptional; encryptedPayload: z.ZodString; iv: z.ZodString; authTag: z.ZodString; keyWraps: z.ZodArray; keyVersion: z.ZodNumber; url: z.ZodOptional; tags: z.ZodOptional>; notes: z.ZodOptional; expiresAt: z.ZodOptional; lastRotatedAt: z.ZodOptional; lastAccessedAt: z.ZodOptional; archived: z.ZodBoolean; tenantId: z.ZodOptional; }, z.core.$strip>; type VaultItemInput = z.infer; declare const workerSchema: z.ZodObject<{ id: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; status: z.ZodString; lastHeartbeat: z.ZodString; currentExecutionId: z.ZodOptional; capabilities: z.ZodArray; mode: z.ZodString; hostname: z.ZodString; ip: z.ZodOptional; healthPort: z.ZodOptional; maxConcurrent: z.ZodNumber; pollIntervalMs: z.ZodNumber; registeredAt: z.ZodString; registeredBy: z.ZodString; version: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; tenantId: z.ZodOptional; }, z.core.$strip>; type WorkerInput = z.infer; declare const workspaceSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; userId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; metadata: z.ZodOptional>; extended: z.ZodOptional>; name: z.ZodString; title: z.ZodString; description: z.ZodString; tags: z.ZodOptional>; status: z.ZodString; archivedAt: z.ZodOptional; archived: z.ZodBoolean; icon: z.ZodOptional; color: z.ZodOptional; tenantId: z.ZodOptional; }, z.core.$strip>; type WorkspaceInput = z.infer; declare const sagaAgentStateSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; handle: z.ZodString; walletAddress: z.ZodString; chain: z.ZodString; publicKey: z.ZodOptional; homeHubUrl: z.ZodString; directoryUrl: z.ZodOptional; registrationTxHash: z.ZodOptional; parentSagaId: z.ZodOptional; cloneDepth: z.ZodDefault; name: z.ZodString; avatar: z.ZodOptional; headline: z.ZodOptional; bio: z.ZodOptional; profileType: z.ZodDefault>; currentSyncVersion: z.ZodDefault; lastSyncAt: z.ZodOptional; registeredSystems: z.ZodOptional>; registeredAt: z.ZodString; updatedAt: z.ZodString; }, z.core.$strip>; type SagaAgentStateInput = z.infer; declare const sagaScopeSchema: z.ZodObject<{ originSystemUrl: z.ZodString; originSystemId: z.ZodString; originOrgId: z.ZodString; syncPolicy: z.ZodEnum<{ "agent-portable": "agent-portable"; public: "public"; "org-internal": "org-internal"; "org-confidential": "org-confidential"; }>; lastSyncedAt: z.ZodNullable; }, z.core.$strip>; declare const sagaMemorySchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; agentId: z.ZodString; memoryType: z.ZodEnum<{ episodic: "episodic"; semantic: "semantic"; procedural: "procedural"; }>; eventType: z.ZodOptional; summary: z.ZodString; learnings: z.ZodOptional; significance: z.ZodOptional; knowledgeDomain: z.ZodOptional; expertiseLevel: z.ZodOptional>; workflowName: z.ZodOptional; workflowSteps: z.ZodOptional>; scope: z.ZodObject<{ originSystemUrl: z.ZodString; originSystemId: z.ZodString; originOrgId: z.ZodString; syncPolicy: z.ZodEnum<{ "agent-portable": "agent-portable"; public: "public"; "org-internal": "org-internal"; "org-confidential": "org-confidential"; }>; lastSyncedAt: z.ZodNullable; }, z.core.$strip>; linkedTaskId: z.ZodOptional; linkedSystemTaskId: z.ZodOptional; createdAt: z.ZodString; updatedAt: z.ZodString; }, z.core.$strip>; type SagaMemoryInput = z.infer; declare const sagaSkillSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; agentId: z.ZodString; name: z.ZodString; category: z.ZodString; verificationType: z.ZodEnum<{ verified: "verified"; "self-reported": "self-reported"; endorsed: "endorsed"; }>; verificationSource: z.ZodOptional; verificationProof: z.ZodOptional; completionCount: z.ZodDefault; confidence: z.ZodDefault; firstVerified: z.ZodOptional; lastVerified: z.ZodOptional; endorsedByWallet: z.ZodOptional; endorsedByHandle: z.ZodOptional; endorsementSignature: z.ZodOptional; scope: z.ZodObject<{ originSystemUrl: z.ZodString; originSystemId: z.ZodString; originOrgId: z.ZodString; syncPolicy: z.ZodEnum<{ "agent-portable": "agent-portable"; public: "public"; "org-internal": "org-internal"; "org-confidential": "org-confidential"; }>; lastSyncedAt: z.ZodNullable; }, z.core.$strip>; createdAt: z.ZodString; updatedAt: z.ZodString; }, z.core.$strip>; type SagaSkillInput = z.infer; declare const sagaTaskSummarySchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; agentId: z.ZodString; totalCompleted: z.ZodDefault; totalFailed: z.ZodDefault; totalInProgress: z.ZodDefault; firstTaskAt: z.ZodOptional; lastTaskAt: z.ZodOptional; bySkill: z.ZodOptional>; scope: z.ZodObject<{ originSystemUrl: z.ZodString; originSystemId: z.ZodString; originOrgId: z.ZodString; syncPolicy: z.ZodEnum<{ "agent-portable": "agent-portable"; public: "public"; "org-internal": "org-internal"; "org-confidential": "org-confidential"; }>; lastSyncedAt: z.ZodNullable; }, z.core.$strip>; createdAt: z.ZodString; updatedAt: z.ZodString; }, z.core.$strip>; type SagaTaskSummaryInput = z.infer; declare const sagaSystemRegistrySchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; systemUrl: z.ZodString; systemId: z.ZodString; walletAddress: z.ZodString; chain: z.ZodString; exportPolicy: z.ZodOptional; neverExport: z.ZodArray; requiresApproval: z.ZodArray; }, z.core.$strip>>; sharingPolicy: z.ZodOptional; cannotShareTo: z.ZodArray; requireOriginConsent: z.ZodBoolean; }, z.core.$strip>>; conformanceLevel: z.ZodDefault; lastSyncAt: z.ZodOptional; registeredAt: z.ZodString; }, z.core.$strip>; type SagaSystemRegistryInput = z.infer; declare const sagaSyncLogSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; agentId: z.ZodString; systemId: z.ZodString; direction: z.ZodEnum<{ push: "push"; pull: "pull"; "hub-push": "hub-push"; "hub-pull": "hub-pull"; }>; collectionName: z.ZodString; documentCount: z.ZodDefault; checkpointBefore: z.ZodOptional>; checkpointAfter: z.ZodOptional>; status: z.ZodEnum<{ failed: "failed"; success: "success"; partial: "partial"; }>; rejectedCount: z.ZodDefault; rejectionReasons: z.ZodOptional>; createdAt: z.ZodString; }, z.core.$strip>; type SagaSyncLogInput = z.infer; declare const sagaHubPeerSchema: z.ZodObject<{ id: z.ZodString; orgId: z.ZodString; workspaceId: z.ZodOptional; peerHubUrl: z.ZodString; peerHubId: z.ZodString; peerWalletAddress: z.ZodString; peerPublicKey: z.ZodOptional; federationAgreementId: z.ZodOptional; status: z.ZodDefault>; lastReplicationAt: z.ZodOptional; sharedAgentCount: z.ZodDefault; replicationConfig: z.ZodOptional; pollingIntervalMs: z.ZodNumber; batchSize: z.ZodNumber; }, z.core.$strip>>; registeredAt: z.ZodString; }, z.core.$strip>; type SagaHubPeerInput = z.infer; /** * AppSnapshot Model Interface (auto-generated from Drizzle schema) */ interface AppSnapshotModel { id: string; orgId: string; workspaceId?: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; capturedBy: string; capturedAt: string; appId: string; snapshotType: string; name: string; period: string; periodType: string; notes?: string; summary: Record; data: Record; tenantId?: string; } declare const Collection$i: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; capturedBy: { type: string; maxLength: number; }; capturedAt: { type: string; maxLength: number; format: string; }; appId: { type: string; maxLength: number; }; snapshotType: { type: string; maxLength: number; }; name: { type: string; maxLength: number; }; period: { type: string; maxLength: number; }; periodType: { type: string; maxLength: number; }; notes: { type: string; maxLength: number; }; summary: { type: string; }; data: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Codebase Model Interface (auto-generated from Drizzle schema) */ interface CodebaseModel { id: string; orgId: string; workspaceId: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; name: string; title: string; description: string; repository: Record; environment: Record; deployment?: Record; agentWorkflow?: Record; tags?: string[]; status: string; archivedAt?: string; archived: boolean; tenantId?: string; gitProvider?: string; gitNamespace?: string; gitRepo?: string; gitRepoId?: string; gitDefaultBranch?: string; gitConnectionId?: string; gitVisibility?: string; gitPushedAt?: string; gitWebUrl?: string; } declare const Collection$h: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; repository: { type: string; }; environment: { type: string; }; deployment: { type: string; }; agentWorkflow: { type: string; }; tags: { type: string; items: { type: string; }; }; status: { type: string; maxLength: number; }; archivedAt: { type: string; maxLength: number; format: string; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; gitProvider: { type: string; maxLength: number; }; gitNamespace: { type: string; maxLength: number; }; gitRepo: { type: string; maxLength: number; }; gitRepoId: { type: string; maxLength: number; }; gitDefaultBranch: { type: string; maxLength: number; }; gitConnectionId: { type: string; maxLength: number; }; gitVisibility: { type: string; maxLength: number; }; gitPushedAt: { type: string; maxLength: number; }; gitWebUrl: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Discussion Model Interface (auto-generated from Drizzle schema) */ interface DiscussionModel { id: string; orgId: string; workspaceId: string; userId: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; entityType: string; entityId: string; content: string; contentHtml?: string; parentId: string; threadDepth: number; isEdited: boolean; editedAt?: string; isDeleted: boolean; deletedAt?: string; userName: string; userAvatar?: string; attachments?: Record[]; reactionCounts?: Record; mentions?: Record[]; tenantId?: string; } declare const Collection$g: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; entityType: { type: string; maxLength: number; }; entityId: { type: string; maxLength: number; }; content: { type: string; maxLength: number; }; contentHtml: { type: string; maxLength: number; }; parentId: { type: string; maxLength: number; }; threadDepth: { type: string; }; isEdited: { type: string; }; editedAt: { type: string; maxLength: number; format: string; }; isDeleted: { type: string; }; deletedAt: { type: string; maxLength: number; format: string; }; userName: { type: string; maxLength: number; }; userAvatar: { type: string; maxLength: number; }; attachments: { type: string; items: { type: string; properties: { id: { type: string; }; name: { type: string; }; size: { type: string; }; type: { type: string; }; url: { type: string; }; uploadedAt: { type: string; format: string; }; status: { type: string; enum: string[]; }; thumbnailUrl: { type: string; }; checksum: { type: string; }; }; required: string[]; }; }; reactionCounts: { type: string; }; mentions: { type: string; items: { type: string; properties: { type: { type: string; maxLength: number; }; identifier: { type: string; maxLength: number; }; teamMemberId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; position: { type: string; minimum: number; maximum: number; multipleOf: number; }; }; required: string[]; }; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Schema Model Interface (auto-generated from Drizzle schema) */ interface SchemaModel { id: string; orgId: string; workspaceId: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; name: string; title: string; description: string; icon?: string; category: string; target: string; fields: Record[]; titleField: string; defaultSort?: Record; ownerPluginId: string; builtIn: boolean; version: number; archived: boolean; classLevelPermissions?: Record; encryptedFields?: Record[]; tenantId?: string; } declare const Collection$f: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; icon: { type: string; maxLength: number; }; category: { type: string; maxLength: number; }; target: { type: string; maxLength: number; }; fields: { type: string; items: { type: string; }; }; titleField: { type: string; maxLength: number; }; defaultSort: { type: string; }; ownerPluginId: { type: string; maxLength: number; }; builtIn: { type: string; }; version: { type: string; minimum: number; maximum: number; multipleOf: number; }; archived: { type: string; }; classLevelPermissions: { type: string; }; encryptedFields: { type: string; items: { type: string; }; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Record Model Interface (auto-generated from Drizzle schema) */ interface RecordModel { id: string; orgId: string; workspaceId: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; schemaId: string; title: string; status: string; parentId: string; parentCollection?: string; data: Record; archived: boolean; completed?: boolean; completedAt?: string; startedAt?: string; sortOrder?: number; assigneeId: string; priority?: number; dueAt?: string; amount?: number; version: number; tenantId?: string; } declare const Collection$e: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; schemaId: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; parentId: { type: string; maxLength: number; }; parentCollection: { type: string; maxLength: number; }; data: { type: string; }; archived: { type: string; }; completed: { type: string; }; completedAt: { type: string; maxLength: number; format: string; }; startedAt: { type: string; maxLength: number; format: string; }; sortOrder: { type: string; minimum: number; maximum: number; multipleOf: number; }; assigneeId: { type: string; maxLength: number; }; priority: { type: string; minimum: number; maximum: number; multipleOf: number; }; dueAt: { type: string; maxLength: number; format: string; }; amount: { type: string; minimum: number; maximum: number; multipleOf: number; }; version: { type: string; minimum: number; maximum: number; multipleOf: number; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Relation Model Interface (auto-generated from Drizzle schema) */ interface RelationModel { id: string; orgId: string; workspaceId?: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; sourceId: string; sourceCollection: string; sourceSchemaId?: string; targetId: string; targetCollection: string; targetSchemaId?: string; relationType: string; data?: Record; sortOrder?: number; label?: string; tenantId?: string; } declare const Collection$d: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; sourceId: { type: string; maxLength: number; }; sourceCollection: { type: string; maxLength: number; }; sourceSchemaId: { type: string; maxLength: number; }; targetId: { type: string; maxLength: number; }; targetCollection: { type: string; maxLength: number; }; targetSchemaId: { type: string; maxLength: number; }; relationType: { type: string; maxLength: number; }; data: { type: string; }; sortOrder: { type: string; minimum: number; maximum: number; multipleOf: number; }; label: { type: string; maxLength: number; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Vault Model Interface (auto-generated from Drizzle schema) */ interface VaultModel { id: string; orgId: string; workspaceId: string; userId: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; name: string; description?: string; icon?: string; encryptedVaultKey?: string; shared: boolean; keyVersion: number; rotationPending: boolean; tenantId?: string; } declare const Collection$c: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; icon: { type: string; maxLength: number; }; encryptedVaultKey: { type: string; maxLength: number; }; shared: { type: string; }; keyVersion: { type: string; minimum: number; maximum: number; multipleOf: number; }; rotationPending: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * VaultItem Model Interface (auto-generated from Drizzle schema) */ interface VaultItemModel { id: string; orgId: string; workspaceId: string; userId: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; vaultId: string; name: string; type: string; provider: string; encryptedPayload: string; iv: string; authTag: string; keyWraps: unknown[]; keyVersion: number; url?: string; tags?: string[]; notes?: string; expiresAt?: string; lastRotatedAt?: string; lastAccessedAt?: string; archived: boolean; tenantId?: string; } declare const Collection$b: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; vaultId: { type: string; maxLength: number; }; name: { type: string; maxLength: number; }; type: { type: string; maxLength: number; }; provider: { type: string; maxLength: number; }; encryptedPayload: { type: string; maxLength: number; }; iv: { type: string; maxLength: number; }; authTag: { type: string; maxLength: number; }; keyWraps: { type: string; items: {}; }; keyVersion: { type: string; }; url: { type: string; maxLength: number; }; tags: { type: string; items: { type: string; }; }; notes: { type: string; maxLength: number; }; expiresAt: { type: string; maxLength: number; format: string; }; lastRotatedAt: { type: string; maxLength: number; }; lastAccessedAt: { type: string; maxLength: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * ServiceKey Model Interface (auto-generated from Drizzle schema) */ interface ServiceKeyModel { id: string; orgId: string; workspaceId?: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; serviceName: string; publicKey: string; fingerprint: string; archived: boolean; tenantId?: string; } declare const Collection$a: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; serviceName: { type: string; maxLength: number; }; publicKey: { type: string; maxLength: number; }; fingerprint: { type: string; maxLength: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Worker Model Interface (auto-generated from Drizzle schema) */ interface WorkerModel { id: string; metadata?: Record; extended?: Record; name: string; status: string; lastHeartbeat: string; currentExecutionId: string; capabilities: string[]; mode: string; hostname: string; ip?: string; healthPort?: number; maxConcurrent: number; pollIntervalMs: number; registeredAt: string; registeredBy: string; version?: string; createdAt: string; updatedAt: string; tenantId?: string; } declare const Collection$9: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; lastHeartbeat: { type: string; maxLength: number; format: string; }; currentExecutionId: { type: string; maxLength: number; }; capabilities: { type: string; items: { type: string; }; }; mode: { type: string; maxLength: number; }; hostname: { type: string; maxLength: number; }; ip: { type: string; maxLength: number; }; healthPort: { type: string; minimum: number; maximum: number; multipleOf: number; }; maxConcurrent: { type: string; minimum: number; maximum: number; multipleOf: number; }; pollIntervalMs: { type: string; minimum: number; maximum: number; multipleOf: number; }; registeredAt: { type: string; maxLength: number; format: string; }; registeredBy: { type: string; maxLength: number; }; version: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Attribute Model Interface (auto-generated from Drizzle schema) */ interface AttributeModel { id: string; orgId: string; workspaceId?: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; name: string; title: string; description?: string; color: string; entityType: string; type: string; sortOrder?: number; popularity?: number; archived: boolean; tenantId?: string; } declare const Collection$8: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; color: { type: string; maxLength: number; }; entityType: { type: string; maxLength: number; }; type: { type: string; maxLength: number; }; sortOrder: { type: string; minimum: number; maximum: number; multipleOf: number; }; popularity: { type: string; minimum: number; maximum: number; multipleOf: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Activity Model Interface (auto-generated from Drizzle schema) */ interface ActivityModel { id: string; orgId: string; workspaceId: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; entityType: string; entityId: string; entityName: string; action: string; userName: string; productId?: string; changes?: Record; tenantId?: string; } declare const Collection$7: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; entityType: { type: string; maxLength: number; }; entityId: { type: string; maxLength: number; }; entityName: { type: string; maxLength: number; }; action: { type: string; maxLength: number; }; userName: { type: string; maxLength: number; }; productId: { type: string; maxLength: number; }; changes: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * TeamMember Model Interface (auto-generated from Drizzle schema) */ interface TeamMemberModel { id: string; orgId: string; workspaceId?: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; userName: string; slug?: string; userEmail?: string; userAvatar?: string; role: string; isAgent: boolean; joinedAt?: string; raciAssignments?: Record; productId?: string; tenantId?: string; lastHeartbeat?: string; containerStatus?: string; } declare const Collection$6: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; userName: { type: string; maxLength: number; }; slug: { type: string; maxLength: number; }; userEmail: { type: string; maxLength: number; }; userAvatar: { type: string; maxLength: number; }; role: { type: string; maxLength: number; }; isAgent: { type: string; }; joinedAt: { type: string; maxLength: number; }; raciAssignments: { type: string; }; productId: { type: string; maxLength: number; }; tenantId: { type: string; maxLength: number; }; lastHeartbeat: { type: string; maxLength: number; format: string; }; containerStatus: { type: string; maxLength: number; enum: string[]; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * TimeEntry Model Interface (auto-generated from Drizzle schema) */ interface TimeEntryModel { id: string; orgId: string; workspaceId?: string; userId: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; name: string; taskId: string; startAt: string; endAt?: string; duration?: number; categoryId?: string; tagIds?: string[]; archived: boolean; tenantId?: string; } declare const Collection$5: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; taskId: { type: string; maxLength: number; }; startAt: { type: string; maxLength: number; format: string; }; endAt: { type: string; maxLength: number; }; duration: { type: string; minimum: number; maximum: number; multipleOf: number; }; categoryId: { type: string; maxLength: number; }; tagIds: { type: string; items: { type: string; }; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Goal Model Interface (auto-generated from Drizzle schema) */ interface GoalModel { id: string; orgId: string; workspaceId?: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; name?: string; title: string; description?: string; status: string; priority: string; category: string; progressMode?: string; currentProgress?: number; completed: boolean; dueDate?: string; targetDate?: string; parentGoalId: string; metrics?: unknown[]; archived: boolean; tenantId?: string; } declare const Collection$4: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; priority: { type: string; maxLength: number; }; category: { type: string; maxLength: number; }; progressMode: { type: string; maxLength: number; }; currentProgress: { type: string; minimum: number; maximum: number; multipleOf: number; }; completed: { type: string; }; dueDate: { type: string; maxLength: number; }; targetDate: { type: string; maxLength: number; }; parentGoalId: { type: string; maxLength: number; }; metrics: { type: string; items: {}; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Processes Model Interface (auto-generated from Drizzle schema) */ interface ProcessesModel { id: string; orgId: string; workspaceId: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; name: string; title: string; description?: string; version?: string; status: string; category: string; startStepId?: string; documentId?: string; flowId: string; trigger?: Record; inputSchema?: Record; outputSchema?: Record; executionConfig?: Record; maxSubprocessDepth?: number; executorAgentId?: string; statistics?: Record; requiredCapabilities?: string[]; archived: boolean; tenantId?: string; } declare const Collection$3: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; version: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; category: { type: string; maxLength: number; }; startStepId: { type: string; maxLength: number; }; documentId: { type: string; maxLength: number; }; flowId: { type: string; maxLength: number; }; trigger: { type: string; }; inputSchema: { type: string; }; outputSchema: { type: string; }; executionConfig: { type: string; }; maxSubprocessDepth: { type: string; }; executorAgentId: { type: string; maxLength: number; }; statistics: { type: string; }; requiredCapabilities: { type: string; items: { type: string; }; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * ProcessExecutions Model Interface (auto-generated from Drizzle schema) */ interface ProcessExecutionsModel { id: string; orgId: string; workspaceId: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; processId: string; processVersion?: string; status: string; progress: number; currentStepId?: string; startedAt?: string; completedAt?: string; durationMs?: number; retryCount: number; maxRetries: number; inputs: Record; outputs?: Record; variables: Record; context: Record; stepHistory: unknown[]; error?: Record; correlationId?: string; externalId?: string; parentExecutionId: string; depth?: number; resumeAt?: string; workerId: string; processName?: string; archived: boolean; tenantId?: string; } declare const Collection$2: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; processId: { type: string; maxLength: number; }; processVersion: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; progress: { type: string; minimum: number; maximum: number; multipleOf: number; }; currentStepId: { type: string; maxLength: number; }; startedAt: { type: string; maxLength: number; format: string; }; completedAt: { type: string; maxLength: number; format: string; }; durationMs: { type: string; minimum: number; maximum: number; multipleOf: number; }; retryCount: { type: string; minimum: number; maximum: number; multipleOf: number; }; maxRetries: { type: string; minimum: number; maximum: number; multipleOf: number; }; inputs: { type: string; }; outputs: { type: string; }; variables: { type: string; }; context: { type: string; }; stepHistory: { type: string; items: {}; }; error: { type: string; }; correlationId: { type: string; maxLength: number; }; externalId: { type: string; maxLength: number; }; parentExecutionId: { type: string; maxLength: number; }; depth: { type: string; minimum: number; maximum: number; multipleOf: number; }; resumeAt: { type: string; maxLength: number; format: string; }; workerId: { type: string; maxLength: number; }; processName: { type: string; maxLength: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * ProcessSteps Model Interface (auto-generated from Drizzle schema) */ interface ProcessStepsModel { id: string; orgId: string; workspaceId: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; processId: string; templateId?: string; name: string; title: string; description?: string; stepType: string; order: number; optional: boolean; enabled: boolean; nextStepId?: string; action?: Record; conditions?: Record[]; outputs?: Record[]; outputExtraction?: Record; inputs?: Record; requiredVariables?: string[]; position?: Record; estimatedDurationMinutes?: number; icon?: string; archived: boolean; tenantId?: string; } declare const Collection$1: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; processId: { type: string; maxLength: number; }; templateId: { type: string; maxLength: number; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; stepType: { type: string; maxLength: number; }; order: { type: string; minimum: number; maximum: number; multipleOf: number; }; optional: { type: string; }; enabled: { type: string; }; nextStepId: { type: string; maxLength: number; }; action: { type: string; }; conditions: { type: string; items: { type: string; }; }; outputs: { type: string; items: { type: string; }; }; outputExtraction: { type: string; }; inputs: { type: string; }; requiredVariables: { type: string; items: { type: string; }; }; position: { type: string; }; estimatedDurationMinutes: { type: string; }; icon: { type: string; maxLength: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * StepTemplates Model Interface (auto-generated from Drizzle schema) */ interface StepTemplatesModel { id: string; orgId: string; workspaceId: string; userId?: string; createdAt: string; updatedAt: string; metadata?: Record; extended?: Record; name: string; title: string; description?: string; category: string; stepType: string; action: Record; inputs?: Record; outputs?: Record; outputExtraction?: Record; requiredVariables?: string[]; cli?: Record; versionField?: string; tags?: string[]; archived: boolean; tenantId?: string; } declare const Collection: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; category: { type: string; maxLength: number; }; stepType: { type: string; maxLength: number; }; action: { type: string; }; inputs: { type: string; }; outputs: { type: string; }; outputExtraction: { type: string; }; requiredVariables: { type: string; items: { type: string; }; }; cli: { type: string; }; versionField: { type: string; maxLength: number; }; tags: { type: string; items: { type: string; }; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; /** * Financial Account Model Interface * * Represents a financial account from YNAB (You Need A Budget) integration. * Accounts track bank accounts, credit cards, investment accounts, and other * financial entities. Extends YNAB Account type with organization and audit fields. */ interface FinAccountModel extends Omit { /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID who owns or manages this account */ userId: string; /** ISO 8601 timestamp when account was created */ createdAt: string; /** ISO 8601 timestamp when account was last updated */ updatedAt: string; /** Budget ID this account belongs to */ budget_id: string; /** Soft delete flag - true if account has been deleted */ is_deleted?: boolean; /** Extensible object for future schema additions */ extended?: Record; } /** * Financial Budget Model Interface * * Represents a complete budget from YNAB (You Need A Budget) integration. * Budgets serve as the top-level container for financial accounts, categories, * and transactions. Each budget has its own settings for currency, date format, * and account structure. */ interface BudgetModel { /** Unique budget identifier */ id: string; /** ISO 8601 timestamp when budget was created in our system */ createdAt: string; /** ISO 8601 timestamp when budget was last updated in our system */ updatedAt: string; /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID who owns or manages this budget */ userId: string; /** Budget name from YNAB */ name: string; /** ISO 8601 timestamp of last modification in YNAB */ last_modified_on: string; /** First month of budget data (YYYY-MM-DD format) */ first_month: string; /** Last month of budget data (YYYY-MM-DD format) */ last_month: string; /** Soft delete flag - true if budget has been trashed */ trashed: boolean; /** Date format configuration for budget display */ date_format: { /** Date format string (e.g., 'MM/DD/YYYY', 'DD/MM/YYYY') */ format: string; }; /** Currency format configuration for budget display */ currency_format: { /** ISO 4217 currency code (e.g., 'USD', 'EUR') */ iso_code: string; /** Example formatted amount (e.g., '$1,234.56') */ example_format: string; /** Number of decimal digits (typically 2) */ decimal_digits: number; /** Decimal separator character ('.' or ',') */ decimal_separator: string; /** Whether currency symbol appears before amount */ symbol_first: boolean; }; /** Simplified account summaries for quick reference */ accounts: { /** Account ID */ id: string; /** Account name */ name: string; /** Account type (checking, savings, credit card, etc.) */ type: string; /** Current account balance in milliunits */ balance: number; }[]; /** Extensible object for future schema additions */ extended?: Record; } /** * Financial Category Model Interface * * Represents a budget category from YNAB (You Need A Budget) integration. * Categories organize budget allocations and track spending against targets. * Supports goal-based budgeting with various goal types (target balance, monthly funding, etc.) * and tracks activity, balance, and goal progress for financial planning. */ interface FinCategoryModel extends Omit { /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID who owns or manages this category */ userId: string; /** ISO 8601 timestamp when category was created in our system */ createdAt: string; /** ISO 8601 timestamp when category was last updated in our system */ updatedAt: string; /** Soft delete flag - true if category has been deleted */ is_deleted?: boolean; /** Whether this is a default category template */ isDefault?: boolean; /** Extensible object for future schema additions */ extended?: Record; } /** * Client Model Interface * * Represents a business client or customer within the organization. * Clients can be associated with opportunities, projects, and time entries for tracking * business relationships and engagements. */ interface ClientModel { /** Unique client identifier */ id: string; /** Client contact name */ name: string; /** Company or organization name */ company: string; /** Primary email address for client communication */ email: string; /** Primary phone number for client contact */ phone: string; /** Physical or mailing address */ address: string; /** Optional reference to primary contact person (userId) */ primaryContactId?: string; /** ISO 8601 timestamp when client was created */ createdAt: string; /** ISO 8601 timestamp when client was last updated */ updatedAt: string; /** Soft delete flag - true if client has been archived */ archived: boolean; /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID of client record creator */ userId: string; /** Extensible object for future schema additions */ extended?: Record; } /** * Contact Model Interface * * Represents an individual contact person within the organization. * Contacts can be associated with clients for relationship management and tracking. * Stores detailed contact information including name, email, phone, and business details. */ interface ContactModel { /** Unique contact identifier */ id: string; /** Full contact name (typically firstName + lastName) */ name: string; /** Contact's first name */ firstName: string; /** Contact's last name */ lastName: string; /** Contact's email address */ email: string; /** Contact's phone number */ phone: string; /** Company or organization the contact works for */ company: string; /** Contact's job title or position */ title: string; /** Physical or mailing address */ address: string; /** Soft delete flag - true if contact has been archived */ archived: boolean; /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID of contact record creator */ userId: string; /** ISO 8601 timestamp when contact was created */ createdAt: string; /** ISO 8601 timestamp when contact was last updated */ updatedAt: string; /** Extensible object for future schema additions */ extended?: Record; } interface ConversationSettings { systemPrompt?: string; temperature: number; maxTokens: number; } interface ConversationMetadata { messageCount: number; lastMessageAt: string; } /** * Flow Model Interface * * Represents a visual flowchart or diagram created using React Flow. * Flows can represent database schemas, process workflows, agent orchestration, * or custom visualizations. Supports serialization of nodes, edges, and viewport state. */ interface FlowModel { /** Unique flow identifier */ id: string; /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level isolation */ workspaceId: string; /** User ID of flow creator */ userId: string; /** ISO 8601 timestamp when flow was created */ createdAt: string; /** ISO 8601 timestamp when flow was last updated */ updatedAt: string; /** Human-readable flow name for display */ name: string; /** Detailed description of flow purpose and contents */ description: string; /** Type of flow determining its purpose and rendering context */ flowType: 'database-schema' | 'process-flow' | 'agent-flow' | 'custom'; /** React Flow nodes (serialized JSON array of node objects) */ nodes: any[]; /** React Flow edges (serialized JSON array of edge/connection objects) */ edges: any[]; /** Viewport state for preserving pan/zoom position */ viewport: { /** Horizontal pan offset in pixels */ x: number; /** Vertical pan offset in pixels */ y: number; /** Zoom level (1.0 = 100%, 0.5 = 50%, 2.0 = 200%) */ zoom: number; }; /** Optional metadata for categorization and association */ metadata: { /** Tags for organization and filtering */ tags?: string[]; /** Optional project association */ projectId?: string; /** Version string for tracking flow revisions */ version?: string; }; /** Extensible object for future schema additions */ extended?: Record; } type GoalMetricType = 'percentage' | 'currency' | 'count' | 'custom'; type GoalMetricTrend = 'up' | 'down' | 'stable'; type GoalProgressMode = 'auto' | 'manual'; type GoalCategory = 'Revenue' | 'Growth' | 'Quality' | 'Efficiency' | 'Custom'; type GoalStatus = 'Not Started' | 'In Progress' | 'At Risk' | 'On Track' | 'Complete'; interface GoalMetric { id: string; name: string; type: GoalMetricType; targetValue: number; currentValue: number; unit?: string; startValue?: number; trend?: GoalMetricTrend; } interface ToolCall { id?: string; toolName: string; arguments: unknown; result?: unknown; status: 'pending' | 'success' | 'error'; } interface MessageMetadata { tokens?: { input: number; output: number; total: number; }; cost?: { total: number; }; latency?: number; model?: string; } /** * Metadata structure for MCP-managed milestones * * Supports phase-based workflow management and document content approval tracking. */ interface MilestoneMetadata { /** Type of development phase this milestone represents */ phaseType?: 'requirements' | 'design' | 'tasks' | 'implementation'; /** Path to external markdown document if stored outside milestone */ documentPath?: string; /** Approval status for milestone completion */ approvalStatus?: 'pending' | 'approved' | 'rejected'; /** User ID of approver */ approvedBy?: string; /** ISO 8601 timestamp when milestone was approved */ approvedAt?: string; /** Flag indicating if milestone was created by MCP agent */ createdByMCP?: boolean; /** Workflow data for phase document content management */ workflowData?: { /** Markdown content stored directly in milestone */ documentContent?: string; /** Approval status flag */ approved: boolean; /** ISO 8601 timestamp when approved */ approvedAt?: string; /** User ID who approved */ approvedBy?: string; /** ISO 8601 timestamp when document was last updated */ lastUpdated?: string; /** Template version used for document generation */ templateVersion?: string; }; /** Additional custom metadata fields */ [key: string]: unknown; } /** * Opportunity Model Interface * * Represents a business opportunity or potential engagement with a client. * Opportunities track potential projects, sales leads, or business development * initiatives. Each opportunity is associated with a specific client and tracks * completion status. */ interface OpportunityModel { /** Unique opportunity identifier */ id: string; /** Internal system name (kebab-case identifier) */ name: string; /** Human-readable opportunity title for display */ title: string; /** Detailed description of opportunity scope and potential */ description: string; /** Completion status - true when opportunity is won/lost/closed */ completed: boolean; /** Client ID this opportunity is associated with */ clientId: string; /** Soft delete flag - true if opportunity has been archived */ archived: boolean; /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID of opportunity creator/owner */ userId: string; /** ISO 8601 timestamp when opportunity was created */ createdAt: string; /** ISO 8601 timestamp when opportunity was last updated */ updatedAt: string; /** Extensible object for future schema additions */ extended?: Record; } interface OrgMetadata { colorSchemeIndex?: number; [key: string]: unknown; } /** * Product Type Enum * * Defines the category of product being managed. * Phase 1: Only 'software' is fully functional. */ type ProductType = 'software' | 'physical' | 'service' | 'content' | 'custom'; /** * Product Lifecycle Phase * * Represents the current stage in a product's lifecycle from ideation to end-of-life. */ type ProductPhase = 'concept' | 'discovery' | 'design' | 'development' | 'beta' | 'launch' | 'growth' | 'sunset'; /** * KPI Trend Direction * * Indicates the directional movement of a key performance indicator. */ type KpiTrend = 'up' | 'down' | 'stable'; /** * Key Performance Indicator * * Tracks measurable metrics for product success evaluation. */ interface ProductKpi { /** Unique identifier for the KPI */ id: string; /** Human-readable name of the KPI */ name: string; /** Target value to achieve */ target: number; /** Current measured value */ current: number; /** Unit of measurement (e.g., '%', 'users', 'seconds') */ unit: string; /** Direction of recent change */ trend: KpiTrend; } /** * Phase History Entry * * Records a product's transition through lifecycle phases. */ interface PhaseHistoryEntry { /** The lifecycle phase */ phase: ProductPhase; /** ISO 8601 timestamp when the product entered this phase */ enteredAt: string; /** ISO 8601 timestamp when the product exited this phase (undefined if current) */ exitedAt?: string; } /** * Product Metadata * * Stores additional product-specific information that doesn't fit the core schema. */ interface ProductMetadata { /** Calculated completeness score (0-100) based on filled fields */ completenessScore?: number; /** Product version string */ version?: string; /** Target platforms (e.g., ['web', 'ios', 'android']) */ platforms?: string[]; /** Technology stack used in the product */ techStack?: string[]; /** Latest release notes */ releaseNotes?: string; /** Additional custom metadata fields */ [key: string]: unknown; } /** * Product Model Interface * * Represents a product entity in the Product Management app. * Products are the top-level entities that contain all product-related information * including strategy, lifecycle tracking, and performance metrics. */ interface ProductModel { /** Unique product identifier (format: prod_XXXXXXXXXX) */ id: string; /** Internal system name (kebab-case identifier) */ name: string; /** URL-friendly slug derived from name */ slug?: string; /** Product category type */ type: ProductType; /** Detailed product description (optional - can be added after initial creation) */ description?: string; /** Icon identifier for UI display */ icon?: string; /** Brand color in hex format (e.g., '#6366f1') */ color?: string; /** Problem the product solves for its target market */ problemStatement?: string; /** Unique value proposition describing why customers should choose this product */ valueProposition?: string; /** Array of target market segments */ targetMarket?: string[]; /** Analysis of competitive landscape */ competitiveLandscape?: string; /** Customer Persona */ customerPersona?: string; /** Array of key performance indicators */ kpis?: ProductKpi[]; /** Current lifecycle phase */ currentPhase: ProductPhase; /** History of phase transitions */ phaseHistory?: PhaseHistoryEntry[]; /** ISO 8601 timestamp when product was created */ createdAt: string; /** ISO 8601 timestamp when product was last updated */ updatedAt: string; /** Soft delete flag - true if product has been archived */ archived: boolean; /** Organization ID for multi-tenant data isolation */ orgId: string; /** User ID of product creator/owner */ userId: string; /** Workspace ID for workspace-level isolation */ workspaceId: string; /** Optional template ID if product was created from a template */ sourceTemplateId?: string; /** Optional additional metadata */ metadata?: ProductMetadata; /** Extensible object for future schema additions */ extended?: Record; } interface ProjectMetadata { /** Type of spec/project: feature, bugfix, or refactor */ specType?: 'feature' | 'bugfix' | 'refactor'; /** Current development phase */ phase?: 'requirements' | 'design' | 'tasks' | 'implementation'; /** Flag indicating if project was created by MCP agent */ createdByMCP?: boolean; /** MCP version that created/managed this project */ mcpVersion?: string; /** Additional custom metadata fields */ [key: string]: unknown; } /** * Roadmap Model Interface * * Represents a product-level roadmap with optional start/end quarters. */ interface RoadmapModel { /** Unique roadmap identifier */ id: string; /** Product this roadmap belongs to */ productId: string; /** Optional start quarter label (e.g., "Q1 2026") */ startQuarter?: string; /** Optional end quarter label (e.g., "Q4 2026") */ endQuarter?: string; /** Organization ID for multi-tenant isolation */ orgId: string; /** Workspace ID for workspace-level isolation */ workspaceId: string; /** User ID of roadmap creator/owner */ userId: string; /** ISO 8601 timestamp when roadmap was created */ createdAt: string; /** ISO 8601 timestamp when roadmap was last updated */ updatedAt: string; /** Optional additional metadata */ metadata?: Record; /** Extensible object for future schema additions */ extended?: Record; } /** * Financial Scheduled Transaction Model Interface * * Represents a recurring transaction from YNAB (You Need A Budget) integration. * Scheduled transactions automate recurring expenses and income like rent, salary, * subscriptions, and bill payments. Supports various recurrence frequencies and * can include split transactions via subtransactions. */ interface FinScheduledTransactionModel extends Omit { /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID who owns or manages this scheduled transaction */ userId: string; /** ISO 8601 timestamp when scheduled transaction was created in our system */ createdAt: string; /** ISO 8601 timestamp when scheduled transaction was last updated in our system */ updatedAt: string; /** Soft delete flag - true if scheduled transaction has been deleted */ is_deleted?: boolean; /** Account name for display (denormalized from account) */ account_name: string; /** Payee name for display (denormalized from payee, nullable) */ payee_name?: string | null; /** Category name for display (denormalized from category, nullable) */ category_name?: string | null; /** Split transaction components for multi-category expenses */ subtransactions: SubtransactionSummary[]; /** Extensible object for future schema additions */ extended?: Record; } /** * Session Model Interface * * Represents an agent work session for context tracking and recovery. * Sessions maintain state for ongoing work, allowing agents to pause and resume * development tasks with full context preservation. Essential for long-running * agent workflows and collaborative development scenarios. */ interface SessionModel { /** Unique session identifier */ id: string; /** Organization ID for multi-tenant data isolation */ orgId: string; /** User ID associated with this session */ userId: string; /** Codebase ID for the repository being worked on */ codebaseId: string; /** Workspace ID for workspace-level context */ workspaceId: string; /** Optional project ID if session is project-scoped */ projectId?: string; /** Optional milestone ID if session is milestone-scoped */ milestoneId?: string; /** Optional task ID if session is task-scoped */ taskId?: string; /** Session type identifier */ sessionType?: 'agent' | 'terminal' | 'debug' | 'custom'; /** ISO 8601 timestamp when session was created */ createdAt: string; /** ISO 8601 timestamp when session was last updated */ updatedAt: string; /** Optional ISO 8601 timestamp when session expires */ expiresAt?: string; /** Soft delete flag - true if session has been archived */ archived: boolean; /** Flexible context object for storing session state */ context: SessionContext; /** Additional metadata for extensibility */ metadata?: Record; /** Extensible object for future schema additions */ extended?: Record; } /** * Terminal connection status */ type TerminalConnectionStatus = 'connected' | 'disconnected' | 'reconnecting'; /** * Shell type identifier */ type ShellType = 'bash' | 'zsh' | 'fish' | 'powershell' | 'cmd' | 'sh'; /** * Entity type for session scoping */ type SessionScopeEntityType = 'project' | 'milestone' | 'task' | 'codebase' | 'workspace'; /** * Session Context Interface * * Stores flexible state information for agent session recovery. * Allows arbitrary fields for future extensibility while providing * common fields for typical development workflows. */ interface SessionContext { /** Current task ID being worked on */ activeTaskId?: string; /** Current development phase or stage */ currentPhase?: string; /** ISO 8601 timestamp of last activity */ lastActivity?: string; /** Working directory path within repository */ workingDirectory?: string; /** Current git branch name */ gitBranch?: string; /** Free-form notes for session context */ notes?: string; /** ID from shell-server for terminal sessions */ shellSessionId?: string; /** Process ID of the shell process */ processId?: number; /** Current connection status for terminal sessions */ connectionStatus?: TerminalConnectionStatus; /** Type of shell being used */ shellType?: ShellType; /** User-editable display name for the session */ displayName?: string; /** System-generated name based on context */ autoGeneratedName?: string; /** Entity type this session is scoped to */ scopedEntityType?: SessionScopeEntityType; /** ID of the scoped entity */ scopedEntityId?: string; /** Last N lines of terminal output for context preservation */ lastOutput?: string; /** Environment variables snapshot for session restoration */ environmentSnapshot?: Record; /** Terminal dimensions (columns) */ terminalCols?: number; /** Terminal dimensions (rows) */ terminalRows?: number; /** ISO 8601 timestamp when session was last connected */ lastConnectedAt?: string; /** ISO 8601 timestamp when session was disconnected */ disconnectedAt?: string; /** Additional custom context fields */ [key: string]: any; } /** * Storage information for documents backed by document-store service. * These documents have their content stored in S3/MinIO and vectors in SurrealDB, * rather than content directly in the RxDB document. */ interface DocumentStorageInfo { /** S3 object key for the document content */ s3Key: string; /** S3 bucket name where the document is stored */ s3Bucket: string; /** SHA-256 hash of the document content for change detection */ contentHash: string; /** Size of the document in bytes */ fileSize: number; /** MIME type of the document */ mimeType: string; /** Document-store service's internal document ID */ documentStoreId?: string; /** RAG processing job ID for tracking embedding status */ ragJobId?: string; } interface TaskMetadata { /** Execution type: 'local' for local agent, 'remote' for cloud agent */ executionType?: 'local' | 'remote'; /** AI prompt describing task requirements for agent execution */ prompt?: string; /** Files to reuse/reference (string for spec workflow, array for legacy) */ leverage?: string | string[]; /** Requirement IDs to satisfy (string for spec workflow, array for legacy) */ requirements?: string | string[]; /** Worker ID of agent currently assigned to this task */ assignedAgent?: string; /** Number of execution attempts made */ executionAttempts?: number; /** Last error message if task execution failed */ lastExecutionError?: string; /** Multi-turn conversation state with compression support for long conversations */ conversationState?: ConversationState; /** Legacy conversation history (being migrated to conversationState) */ conversationHistory?: Array<{ /** Message role: 'user' or 'assistant' */ role: string; /** Message content text */ content: string; /** ISO 8601 timestamp of message */ timestamp: string; }>; /** Array of TimeEntry document IDs tracking time spent on this task */ timeEntryIds?: string[]; /** Cumulative time spent on task in seconds */ totalTimeSeconds?: number; /** Array of Log document IDs for task execution logs */ logIds?: string[]; /** Flag indicating if task was created by MCP agent */ createdByMCP?: boolean; /** Hierarchical task number from spec workflow (e.g., '1.1.1', '2.3.1') */ taskNumber?: string; /** Parent task number for hierarchical structure (e.g., '1.1' for task '1.1.1') */ parentTaskNumber?: string; /** Checkbox state from tasks.md markdown file */ markdownStatus?: '[ ]' | '[-]' | '[x]'; /** Structured prompt sections for AI task execution */ promptSections?: Array<{ /** Section name (e.g., 'Role', 'Task', 'Restrictions', 'Context') */ key: string; /** Section content text */ value: string; }>; /** Additional custom metadata fields */ [key: string]: unknown; } type TemplateCategory = 'software-development' | 'product-management' | 'project-management' | 'personal' | 'business' | 'other'; interface TemplateItem { templateId: string; title: string; description?: string; startOffsetDays: number; durationDays: number; } interface MilestoneTemplateItem extends TemplateItem { } interface TaskTemplateItem extends TemplateItem { milestoneTemplateId: string; } interface SubtaskTemplateItem extends TemplateItem { taskTemplateId: string; } interface ProjectTemplateData { project: { title: string; description?: string; }; milestones: MilestoneTemplateItem[]; tasks: TaskTemplateItem[]; subtasks: SubtaskTemplateItem[]; } /** * Financial Transaction Model Interface * * Represents a financial transaction from YNAB (You Need A Budget) integration. * Transactions record all money movements including expenses, income, transfers, * and debt payments. Each transaction can be split into multiple subtransactions * for detailed categorization and tracking. */ interface FinTransactionModel extends Omit { /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID who owns or manages this transaction */ userId: string; /** ISO 8601 timestamp when transaction was created in our system */ createdAt: string; /** ISO 8601 timestamp when transaction was last updated in our system */ updatedAt: string; /** Soft delete flag - true if transaction has been deleted */ is_deleted?: boolean; /** Account name for display (denormalized from account) */ account_name: string; /** Payee name for display (denormalized from payee, nullable) */ payee_name?: string | null; /** Category name for display (denormalized from category, nullable) */ category_name?: string | null; /** Split transaction components for multi-category expenses */ subtransactions: SubtransactionSummary[]; /** Extensible object for future schema additions */ extended?: Record; } /** * Linked Statement Reference * Represents a reference to another income statement from a different workspace */ interface LinkedStatementRef { /** ID of the linked income statement */ statementId: string; /** Workspace ID where the linked statement resides */ workspaceId: string; /** Display name for the linked statement */ displayName: string; /** How to display in the quadrant (income, expense, asset, liability) */ displayAs: 'income' | 'expense' | 'asset' | 'liability'; } /** * Period configuration for income statement reporting */ interface StatementPeriod { /** Period type: monthly, quarterly, annual, or custom */ type: 'monthly' | 'quarterly' | 'annual' | 'custom'; /** Start date for custom period (ISO 8601) */ startDate?: string; /** End date for custom period (ISO 8601) */ endDate?: string; /** For monthly/quarterly: current period offset (0 = current, -1 = previous, etc.) */ offset?: number; } /** * Financial Income Statement Model Interface * * Represents an income statement dashboard configuration that links to a YNAB budget * and can include references to other statements from different workspaces. * Provides a 4-quadrant view: Income, Expenses, Assets, and Liabilities. */ interface FinIncomeStatementModel { /** Unique identifier (format: fini_{nanoid}) */ id: string; /** Human-readable name for this income statement */ name: string; /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID who created this income statement */ userId: string; /** Optional description */ description?: string; /** Budget ID this statement is linked to (from FinBudget) */ budgetId: string; /** Period configuration for reporting */ period: StatementPeriod; /** References to other income statements to include as line items */ linkedStatements: LinkedStatementRef[]; /** Category IDs to include in Income quadrant (from FinCategory) */ incomeCategories: string[]; /** Category IDs to include in Expenses quadrant */ expenseCategories: string[]; /** Account IDs to include in Assets quadrant (from FinAccount) */ assetAccounts: string[]; /** Account IDs to include in Liabilities quadrant */ liabilityAccounts: string[]; /** Whether this statement is the default for the workspace */ isDefault?: boolean; /** Whether this statement is archived */ isArchived?: boolean; /** Wizard status: draft = incomplete, active = ready to use */ status: 'draft' | 'active' | 'archived'; /** Current wizard step (1-6) for resuming setup */ wizardStep?: number; /** Array of completed wizard step numbers */ wizardCompletedSteps?: number[]; /** YNAB budget ID if imported from YNAB */ ynabBudgetId?: string; /** ISO 8601 timestamp when statement was created */ createdAt: string; /** ISO 8601 timestamp when statement was last updated */ updatedAt: string; /** Extensible object for future schema additions */ extended?: Record; } /** * Variables Model Interface * * Flexible variable storage supporting environment-specific overrides, * feature flags, secrets, and arbitrary contexts for future use cases. */ interface VariablesModel { /** Unique variable document identifier (format: var___) */ id: string; /** Parent codebase ID */ codebaseId: string; /** Organization ID for multi-tenant data isolation */ orgId: string; /** * Context scope where these variables apply: * - 'env:base' - Base environment variables (shared across all environments) * - 'env:development' - Development environment overrides * - 'env:production' - Production environment overrides * - 'env:' - Custom environment overrides * - 'global' - Codebase-wide variables (not env-specific) * - 'feature-flags' - Feature toggles * - 'secrets' - Sensitive values (future: encrypted) * - Custom contexts for future use cases */ context: string; /** Key-value pairs for this context */ variables: Record; /** Context metadata */ metadata: { /** Human-readable name (e.g., "Production Environment") */ label?: string; /** Optional description */ description?: string; /** Source: 'bulk-import', 'manual', 'api' */ source?: string; /** Timestamp if bulk imported */ importedAt?: string; /** User ID who last modified */ lastModifiedBy?: string; /** Additional custom metadata fields */ [key: string]: any; }; /** ISO 8601 timestamp when created */ createdAt: string; /** ISO 8601 timestamp when last updated */ updatedAt: string; /** Flag for soft delete */ archived: boolean; /** Extensible object for future schema additions */ extended?: Record; } /** * Sync Field Mapping Interface * * Defines how a field should be mapped between FlowState and an external provider. */ interface SyncFieldMapping { /** Field name in FlowState entity */ flowstateField: string; /** Field name in external provider entity */ externalField: string; /** Transform type: 'direct' for 1:1 mapping, 'custom' for custom transformer */ transform: 'direct' | 'custom'; /** Name of custom transformer function (required when transform is 'custom') */ transformerName?: string; /** Default value to use when source field is missing or null */ defaultValue?: unknown; } /** * Sync Config Model Interface * * Represents a synchronization configuration between FlowState and an external provider. * Stores credentials, field mappings, sync direction, and status information. * Supports syncing tasks, projects, and milestones with external services like GitHub, Jira, etc. */ interface SyncConfigModel { /** Unique sync configuration identifier */ id: string; /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID this sync configuration belongs to */ workspaceId: string; /** User ID who created/owns this configuration */ userId: string; /** Provider type identifier (e.g., 'github', 'jira', 'asana') */ providerId: string; /** User-friendly name for this sync configuration */ name: string; /** Optional detailed description of the sync configuration */ description?: string; /** Target project ID for synced items (optional) */ targetProjectId?: string; /** Target milestone ID for synced items (optional) */ targetMilestoneId?: string; /** Direction of synchronization: 'pull', 'push', or 'bidirectional' */ direction: 'pull' | 'push' | 'bidirectional'; /** Polling interval in milliseconds (minimum 60000ms = 1 minute) */ pollingIntervalMs: number; /** Whether this sync configuration is enabled */ enabled: boolean; /** Provider-specific credentials (tokens, API keys, etc.) - stored as JSON string */ credentials: string; /** Provider-specific configuration options - stored as JSON string */ providerConfig: string; /** Field mappings between FlowState and external provider - stored as JSON string */ fieldMappings: string; /** Timestamp of last successful sync (ISO 8601 string) */ lastSyncAt?: string; /** Error message from last sync attempt, if any */ lastSyncError?: string; /** Number of items synced in the last sync operation */ lastSyncItemCount?: number; /** ISO 8601 timestamp when configuration was created */ createdAt: string; /** ISO 8601 timestamp when configuration was last updated */ updatedAt: string; /** Soft delete flag - true if configuration has been archived */ archived: boolean; /** Extensible object for future schema additions */ extended?: Record; } /** * Process trigger types */ type ProcessTriggerType = 'manual' | 'scheduled' | 'event' | 'entity' | 'webhook' | 'api'; /** * FlowState entity types that can trigger processes */ type TriggerEntityType = 'task' | 'milestone' | 'project' | 'approval' | 'document' | 'discussion' | 'session' | 'goal' | 'opportunity' | 'contact' | 'client' | 'process' | 'processexecution'; /** * Comparison operators for trigger conditions */ type TriggerConditionOperator = 'equals' | 'not-equals' | 'changes-to' | 'changes-from' | 'exists' | 'not-exists' | 'contains' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not-in' | 'regex'; /** * Individual condition for FlowState entity triggers */ interface FlowStateTriggerCondition { /** Property path to evaluate (dot notation supported, e.g., 'status', 'metadata.phase') */ propertyPath: string; /** Comparison operator */ operator: TriggerConditionOperator; /** Value to compare against (supports ${variable} interpolation) */ value?: unknown; /** Reference to another property or context variable for comparison */ valueRef?: string; } /** * Debounce configuration for triggers */ interface TriggerDebounceConfig { /** Wait time in milliseconds before firing */ waitMs: number; /** Strategy: 'leading' fires first then ignores, 'trailing' waits for quiet period */ strategy?: 'leading' | 'trailing'; } /** * FlowState entity change trigger configuration */ interface FlowStateEntityTrigger { /** FlowState entity type to watch */ entityType: TriggerEntityType; /** RxDB selector to filter which entities to watch */ selector?: Record; /** Property conditions - ALL must match (AND logic) */ conditions: FlowStateTriggerCondition[]; /** Debounce configuration to prevent rapid firing */ debounce?: TriggerDebounceConfig; } /** * Process trigger configuration */ interface ProcessTrigger { /** Type of trigger that initiates this process */ type: ProcessTriggerType; /** Cron expression for scheduled triggers (e.g., '0 9 * * 1' for Monday 9am) */ schedule?: string; /** Event name that triggers the process (for generic 'event' type) */ eventName?: string; /** FlowState entity trigger configuration (for 'entity' type) */ entityTrigger?: FlowStateEntityTrigger; /** Webhook endpoint configuration */ webhook?: { /** HTTP method accepted */ method: 'GET' | 'POST' | 'PUT'; /** Authentication type */ auth?: 'none' | 'api-key' | 'bearer' | 'basic'; }; /** Additional trigger conditions (JSON Logic format) */ conditions?: Record; } /** * JSON Schema definition for process inputs/outputs */ interface ProcessSchema { /** JSON Schema type */ type: 'object' | 'array' | 'string' | 'number' | 'boolean'; /** Schema properties for object types */ properties?: Record; /** Required field names */ required?: string[]; /** Schema description */ description?: string; } /** * Queue behavior when max concurrent executions reached */ type QueueBehavior = 'wait' | 'reject' | 'replace-oldest'; /** * Process execution configuration */ interface ProcessExecutionConfig { /** Maximum concurrent executions of this process */ maxConcurrentExecutions?: number; /** What to do when max concurrent executions reached */ queueBehavior?: QueueBehavior; /** Default timeout for entire process in minutes */ timeoutMinutes?: number; /** Singleton mode - only one active execution at a time */ singleton?: boolean; /** Priority level for execution queue (higher = more priority) */ priority?: number; } /** * Process statistics configuration for linking to FlowState entities */ interface ProcessStatistics { /** Link to project for metrics tracking */ projectId?: string; /** Link to milestone for phase tracking */ milestoneId?: string; /** Custom metrics definitions */ metrics?: Array<{ name: string; type: 'counter' | 'gauge' | 'histogram'; description?: string; }>; } /** * Process metadata structure */ interface ProcessMetadata { /** Author information */ author?: string; /** Last editor user ID */ lastEditedBy?: string; /** Publish date when process became active */ publishedAt?: string; /** Published by user ID */ publishedBy?: string; /** Deprecation date */ deprecatedAt?: string; /** Reason for deprecation */ deprecationReason?: string; /** Replacement process ID */ replacedBy?: string; /** Estimated execution time in minutes */ estimatedDurationMinutes?: number; /** SLA configuration */ sla?: { warningMinutes?: number; criticalMinutes?: number; }; /** Total execution count */ executionCount?: number; /** Success rate (0-100) */ successRate?: number; /** Average execution time in seconds */ avgExecutionTimeSeconds?: number; /** Additional custom metadata fields */ [key: string]: unknown; } /** * Step execution status */ type ProcessStepStatus = 'pending' | 'active' | 'completed' | 'skipped' | 'failed'; /** * Subprocess failure handling strategy */ type SubprocessFailureStrategy = 'fail-parent' | 'continue' | 'retry'; /** * Subprocess configuration for nested process execution */ interface SubprocessConfig { /** Process ID to execute */ processId?: string; /** Alternative: lookup process by name */ processName?: string; /** Specific version to use (optional, defaults to latest active) */ processVersion?: string; /** Map parent variables to subprocess inputs (supports ${variable} interpolation) */ inputMapping?: Record; /** Map subprocess outputs back to parent variables */ outputMapping?: Record; /** Wait for subprocess completion or fire-and-forget */ waitForCompletion?: boolean; /** Timeout for subprocess execution in seconds */ timeoutSeconds?: number; /** What to do if subprocess fails */ onFailure?: SubprocessFailureStrategy; } /** * Agent task configuration for AI agent execution */ interface AgentTaskConfig { /** Agent identifier */ agentId?: string; /** Prompt template (supports ${variable} interpolation) */ prompt?: string; /** System prompt for the agent */ systemPrompt?: string; /** Model to use */ model?: string; /** Temperature setting (0-1) */ temperature?: number; /** Maximum tokens for response */ maxTokens?: number; /** MCP tools the agent can use */ tools?: string[]; /** Structured output schema (JSON Schema) */ outputSchema?: Record; /** Variables to include in agent context */ contextVariables?: string[]; } /** * CLI command configuration for shell execution */ interface CommandConfig { /** Executable or shell command */ executable: string; /** Command arguments (supports ${variable} interpolation) */ args?: string[]; /** Working directory */ workingDirectory?: string; /** Environment variables */ env?: Record; /** Run in shell (allows pipes, redirects, etc.) */ shell?: boolean; /** Capture stdout as output variable */ captureOutput?: boolean; /** Variable name to store captured output */ outputVariable?: string; /** Capture stderr separately */ captureStderr?: boolean; /** Variable name to store stderr */ stderrVariable?: string; } /** * Container volume mount configuration */ interface ContainerVolumeMount { /** Host path or volume name */ hostPath: string; /** Path inside container */ containerPath: string; /** Mount as read-only */ readOnly?: boolean; } /** * Container resource limits */ interface ContainerResources { /** CPU limit (e.g., "1.0", "0.5") */ cpuLimit?: string; /** Memory limit (e.g., "512Mi", "1Gi") */ memoryLimit?: string; /** CPU request for scheduling */ cpuRequest?: string; /** Memory request for scheduling */ memoryRequest?: string; } /** * Container execution configuration for isolated step execution */ interface ContainerConfig { /** Docker image */ image: string; /** Image tag (defaults to 'latest') */ tag?: string; /** Override container command */ command?: string[]; /** Override entrypoint */ entrypoint?: string[]; /** Environment variables */ env?: Record; /** Volume mounts */ volumes?: ContainerVolumeMount[]; /** Resource limits */ resources?: ContainerResources; /** Network mode */ network?: string; /** Pull policy: always, never, if-not-present */ pullPolicy?: 'always' | 'never' | 'if-not-present'; /** Working directory inside container */ workingDir?: string; /** User to run as */ user?: string; } /** * Action configuration for executable steps */ interface StepAction { /** Type of action to perform */ type: 'http' | 'script' | 'mcp-tool' | 'notification' | 'subprocess' | 'approval' | 'agent' | 'command' | 'container'; /** HTTP endpoint for API calls */ endpoint?: string; /** HTTP method */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** Request headers */ headers?: Record; /** Request body template (supports ${variable} interpolation) */ bodyTemplate?: string; /** Script content for script actions */ script?: string; /** Script language */ scriptLanguage?: 'javascript' | 'python' | 'shell'; /** MCP tool name for mcp-tool actions */ mcpTool?: string; /** MCP tool parameters */ mcpParams?: Record; /** Subprocess configuration (for type: 'subprocess') */ subprocess?: SubprocessConfig; /** Agent task configuration (for type: 'agent') */ agent?: AgentTaskConfig; /** CLI command configuration (for type: 'command') */ command?: CommandConfig; /** Container execution configuration (for type: 'container') */ container?: ContainerConfig; /** Notification configuration */ notification?: { channel: 'email' | 'slack' | 'webhook' | 'in-app'; template?: string; recipients?: string[]; }; /** Approval configuration */ approval?: { approverUserIds?: string[]; approverRoleIds?: string[]; requiredApprovals?: number; timeoutMinutes?: number; escalationUserIds?: string[]; }; /** Retry configuration */ retry?: { maxAttempts: number; delaySeconds: number; backoffMultiplier?: number; }; /** Timeout in seconds */ timeoutSeconds?: number; } /** * Condition for decision steps */ interface StepCondition { /** Unique condition identifier */ id: string; /** Condition expression (JSON Logic format or simple comparison) */ expression: string | Record; /** Target step ID when condition is true */ targetStepId: string; /** Human-readable label for the branch */ label?: string; /** Order for evaluation (lower = first) */ order: number; } /** * Output mapping for step results */ interface StepOutput { /** Variable name to store the output */ name: string; /** JSON path to extract from response */ path?: string; /** Data type of the output */ type: 'string' | 'number' | 'boolean' | 'object' | 'array'; /** Default value if extraction fails */ defaultValue?: unknown; } /** * Visual position for flowchart rendering */ interface StepPosition { /** X coordinate in pixels */ x: number; /** Y coordinate in pixels */ y: number; } /** * ProcessStep metadata structure */ interface ProcessStepMetadata { /** Documentation URL */ documentationUrl?: string; /** Help text for users */ helpText?: string; /** Validation rules */ validation?: { inputRequired?: boolean; outputRequired?: boolean; customRules?: Record[]; }; /** Logging configuration */ logging?: { level?: 'debug' | 'info' | 'warn' | 'error'; includeInputs?: boolean; includeOutputs?: boolean; }; /** Error handling configuration */ errorHandling?: { onError?: 'fail' | 'skip' | 'retry' | 'goto'; gotoStepId?: string; errorMessage?: string; }; /** Additional custom metadata fields */ [key: string]: unknown; } /** * Process execution status */ type ProcessExecutionStatus = 'pending' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled' | 'timed-out'; /** * Individual step execution record */ interface StepExecutionRecord { /** Step ID that was executed */ stepId: string; /** Step name for reference */ stepName: string; /** Step type */ stepType: string; /** Execution status of this step */ status: 'pending' | 'running' | 'completed' | 'skipped' | 'failed'; /** ISO 8601 timestamp when step execution started */ startedAt?: string; /** ISO 8601 timestamp when step execution completed */ completedAt?: string; /** Duration in milliseconds */ durationMs?: number; /** Input data provided to the step */ inputs?: Record; /** Output data produced by the step */ outputs?: Record; /** Error information if step failed */ error?: { message: string; code?: string; stack?: string; details?: Record; }; /** Number of retry attempts */ retryCount?: number; /** User ID who executed/approved this step (for human tasks) */ executedBy?: string; /** Comments or notes from manual execution */ notes?: string; } /** * Source entity information for entity-triggered executions */ interface TriggerSourceEntity { /** FlowState entity type that triggered this execution */ entityType: string; /** Entity ID that triggered this execution */ entityId: string; /** Collection name in RxDB */ collection: string; /** Properties that changed and triggered the execution */ changedProperties: string[]; /** Previous values of changed properties */ previousValues?: Record; /** New values of changed properties */ newValues?: Record; /** Full entity snapshot at time of trigger (optional, for debugging) */ entitySnapshot?: Record; } /** * Execution context tracking */ interface ExecutionContext { /** Trigger type that initiated this execution */ triggerType: 'manual' | 'scheduled' | 'event' | 'entity' | 'webhook' | 'api' | 'subprocess'; /** ID of parent execution if this is a subprocess */ parentExecutionId?: string; /** Step ID in parent that spawned this subprocess */ parentStepId?: string; /** Current subprocess nesting depth (checked against maxSubprocessDepth) */ depth?: number; /** Source entity information for entity-triggered executions */ sourceEntity?: TriggerSourceEntity; /** Event data that triggered the execution (for generic 'event' type) */ triggerEvent?: Record; /** Webhook request data */ webhookData?: { method: string; headers?: Record; body?: unknown; query?: Record; }; /** User ID who manually triggered the execution */ triggeredBy?: string; /** IP address of trigger source */ sourceIp?: string; /** User agent of trigger source */ userAgent?: string; /** Execution environment */ environment?: 'development' | 'staging' | 'production'; /** Agent runner ID that executed this process */ agentRunnerId?: string; /** Timestamp when execution was triggered */ triggeredAt?: string; } /** * ProcessExecution metadata structure */ interface ProcessExecutionMetadata { /** Priority level (1-10, higher = more urgent) */ priority?: number; /** Queue name for execution scheduling */ queue?: string; /** Tags for categorization */ tags?: string[]; /** Resource usage tracking */ resources?: { cpuTimeMs?: number; memoryPeakBytes?: number; networkBytesIn?: number; networkBytesOut?: number; }; /** Billing/metering information */ billing?: { computeUnits?: number; apiCalls?: number; storageBytes?: number; }; /** Audit trail */ audit?: Array<{ action: string; userId?: string; timestamp: string; details?: Record; }>; /** Additional custom metadata fields */ [key: string]: unknown; } /** * @fileoverview ProductGoal junction collection for linking products to goals * @module @epicdm/flowstate-collections/models/ProductGoal */ /** * ProductGoal Model Interface * * Represents a junction table linking products to their associated goals. * This enables a many-to-many relationship between products and goals, * allowing multiple goals to be tracked for each product with ordering * and primary goal designation. */ interface ProductGoalModel { /** Unique identifier (format: pgoa_{nanoid}) */ id: string; /** Product ID reference */ productId: string; /** Goal ID reference */ goalId: string; /** Display order for sorting goals within a product */ order: number; /** Indicates if this is the primary goal for the product */ isPrimary?: boolean; /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level isolation */ workspaceId: string; /** User ID of the creator */ userId: string; /** ISO 8601 timestamp when the link was created */ createdAt: string; /** ISO 8601 timestamp when the link was last updated */ updatedAt: string; /** Extensible object for custom data */ extended?: Record; } /** * Role type for product-project relationships. * - primary: This is the main project implementing the product * - supporting: Project provides supporting functionality * - related: Project is loosely related to the product */ type ProductProjectRole = 'primary' | 'supporting' | 'related'; /** * ProductProject Junction Model * * Links products to projects in a many-to-many relationship. * Supports bidirectional navigation and role classification. */ interface ProductProjectModel { /** Unique identifier (format: ppro_XXXXXXXXXX) */ id: string; /** Product ID being linked */ productId: string; /** Project ID being linked */ projectId: string; /** Role of this project for the product */ role: ProductProjectRole; /** ISO 8601 timestamp when link was created */ linkedAt: string; /** User ID who created the link */ linkedBy: string; /** Organization ID for multi-tenant isolation */ orgId: string; /** Workspace ID for workspace-level isolation */ workspaceId: string; /** ISO 8601 timestamp when record was created */ createdAt: string; /** ISO 8601 timestamp when record was last updated */ updatedAt: string; /** Extensible object for custom data */ extended?: Record; } /** * Role type for product-team member relationships. * - lead: Team lead for this product * - member: Regular team member * - advisor: Advisory/consulting role * - observer: View-only access */ type ProductTeamMemberRole = 'lead' | 'member' | 'advisor' | 'observer'; /** * ProductTeamMember Junction Model * * Links products to team members in a many-to-many relationship. * Allows team members (including agents) to be assigned to multiple products. */ interface ProductTeamMemberModel { /** Unique identifier (format: ptmb_XXXXXXXXXX) */ id: string; /** Product ID being linked */ productId: string; /** TeamMember ID being linked */ teamMemberId: string; /** Role of this team member for the product */ role: ProductTeamMemberRole; /** Whether this is the primary product for this team member */ isPrimary: boolean; /** ISO 8601 timestamp when link was created */ linkedAt: string; /** User ID who created the link */ linkedBy: string; /** Organization ID for multi-tenant isolation */ orgId: string; /** Workspace ID for workspace-level isolation */ workspaceId: string; /** ISO 8601 timestamp when record was created */ createdAt: string; /** ISO 8601 timestamp when record was last updated */ updatedAt: string; /** Extensible object for custom data */ extended?: Record; } type ActivityEntityType = 'product' | 'project' | 'goal' | 'initiative' | 'team' | 'productProject' | 'client' | 'opportunity' | 'partnership'; type ActivityAction = 'created' | 'updated' | 'deleted' | 'linked' | 'unlinked' | 'status_changed' | 'phase_changed' | 'assigned' | 'unassigned' | 'role_changed' | 'commented' | 'called' | 'emailed' | 'met'; interface ActivityChanges { field: string; oldValue: unknown; newValue: unknown; } type TeamMemberRole = 'owner' | 'manager' | 'contributor' | 'viewer'; type RaciType = 'R' | 'A' | 'C' | 'I'; interface RaciAssignment { area: string; type: RaciType; } /** * @fileoverview OrgTheme collection for organization-specific theme configurations * @module @epicdm/flowstate-collections/models/OrgTheme */ /** * Organization Theme Model Interface * * Represents a theme configuration for an organization. Each organization can have * multiple themes with one marked as the default. The config field stores a JSON- * stringified Theme object containing color schemes, typography, and other visual * settings for the organization's branding. * * @example * ```typescript * const orgTheme: OrgThemeModel = { * id: 'othr_abc123def456', * orgId: 'org_xyz789abc123', * name: 'Corporate Brand', * config: JSON.stringify({ * primaryColor: '#0066CC', * secondaryColor: '#FF6600', * // ... other theme properties * }), * isDefault: true, * createdAt: '2026-01-22T00:00:00.000Z', * updatedAt: '2026-01-22T00:00:00.000Z', * createdBy: 'use_admin123456', * updatedBy: 'use_admin123456', * }; * ``` */ interface OrgThemeModel { /** Unique theme identifier (format: othr_{nanoid}) */ id: string; /** Organization ID this theme belongs to */ orgId: string; /** Human-readable theme name for display */ name: string; /** JSON-stringified Theme configuration object */ config: string; /** Whether this is the default theme for the organization */ isDefault: boolean; /** ISO 8601 timestamp when theme was created */ createdAt: string; /** ISO 8601 timestamp when theme was last updated */ updatedAt: string; /** User ID who created the theme */ createdBy: string; /** User ID who last updated the theme */ updatedBy: string; /** Extensible object for future schema additions */ extended?: Record; } interface BusinessPlanModel { id: string; orgId: string; workspaceId: string; userId: string; title: string; description?: string; status: 'draft' | 'active' | 'archived'; planType: 'startup' | 'growth' | 'pivot' | 'annual'; missionStatement?: string; visionStatement?: string; targetMarket?: string; problemStatement?: string; solutionSummary?: string; revenueModel?: string; competitiveAdvantage?: string; timeframeMonths: number; startDate: string; endDate: string; version?: number; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } interface MarketSize { tam: number; sam: number; som: number; currency: string; year: number; } interface TargetSegment { name: string; size: number; characteristics: string; painPoints: string[]; } interface SwotAnalysis { strengths: string[]; weaknesses: string[]; opportunities: string[]; threats: string[]; } interface MarketAnalysisModel { id: string; orgId: string; workspaceId?: string; userId?: string; businessPlanId: string; title: string; description?: string; marketSize?: MarketSize; growthRate?: number; trends?: string[]; targetSegments?: TargetSegment[]; swot?: SwotAnalysis; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } interface CompetitorModel { id: string; orgId: string; workspaceId: string; userId: string; businessPlanId: string; name: string; website?: string; description?: string; strengths?: string[]; weaknesses?: string[]; pricing?: string; marketShare?: string; differentiators?: string[]; threatLevel: 'low' | 'medium' | 'high'; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } interface OfferValueStackItem { name: string; value: number; description: string; } interface OfferBonus { name: string; value: number; description: string; type: 'digital' | 'physical' | 'access' | 'service'; } type OfferStatus = 'draft' | 'active' | 'paused' | 'retired'; type OfferType = 'core' | 'tripwire' | 'upsell' | 'downsell' | 'lead_magnet'; type GuaranteeType = 'unconditional' | 'conditional' | 'anti' | 'performance'; type ScarcityType = 'quantity' | 'time' | 'cohort'; type UrgencyType = 'deadline' | 'seasonal' | 'pricing' | 'exploding'; interface OfferModel { id: string; orgId: string; workspaceId: string; userId: string; name: string; description?: string; status: OfferStatus; productId?: string; type: OfferType; price?: number; currency?: string; compareAtPrice?: number; valueStack?: OfferValueStackItem[]; bonuses?: OfferBonus[]; guaranteeType?: GuaranteeType; guaranteeTerms?: string; scarcityType?: ScarcityType; scarcityDetails?: string; urgencyType?: UrgencyType; urgencyDetails?: string; targetAvatar?: string; headline?: string; salesPageUrl?: string; impactScores?: Record; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type CampaignType = 'content' | 'email' | 'social' | 'paid_ads' | 'outreach' | 'launch' | 'partnership' | 'event'; type CampaignStatus = 'planning' | 'active' | 'paused' | 'completed' | 'analyzed'; type CampaignChannel = 'twitter' | 'linkedin' | 'youtube' | 'email' | 'reddit' | 'facebook' | 'google_ads' | 'other'; type CampaignGoalType = 'leads' | 'sales' | 'awareness' | 'engagement'; interface CampaignModel { id: string; orgId: string; workspaceId: string; userId: string; offerId?: string; name: string; description?: string; type: CampaignType; status: CampaignStatus; channel: CampaignChannel; startDate?: string; endDate?: string; budget?: number; spentAmount?: number; currency?: string; goalType?: CampaignGoalType; goalTarget?: number; goalActual?: number; impressions?: number; clicks?: number; leads?: number; conversions?: number; revenue?: number; notes?: string; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type AudienceType = 'segment' | 'persona' | 'list'; type AudienceSource = 'organic' | 'paid' | 'referral' | 'import'; type AudiencePillar = 'consciousness' | 'health' | 'wealth' | 'self_love'; interface AudienceModel { id: string; orgId: string; workspaceId: string; userId: string; name: string; description?: string; type: AudienceType; criteria?: string; size?: number; source?: AudienceSource; notes?: string; pillar?: AudiencePillar; tagline?: string; ageRange?: string; demographics?: string; psychographics?: string; painPoints?: string; dreamOutcomes?: string; buyingTriggers?: string; objections?: string; valueMessage?: string; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type LeadMagnetType = 'problem_revealer' | 'sample_trial' | 'one_step' | 'software_tool' | 'checklist' | 'guide'; type LeadMagnetDelivery = 'pdf' | 'video' | 'email_course' | 'tool' | 'service'; type LeadMagnetStatus = 'draft' | 'active' | 'retired'; interface LeadMagnetModel { id: string; orgId: string; workspaceId: string; userId: string; offerId?: string; name: string; description?: string; type: LeadMagnetType; deliveryMethod?: LeadMagnetDelivery; downloadUrl?: string; landingPageUrl?: string; status: LeadMagnetStatus; downloads?: number; conversions?: number; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type CampaignContactStatus = 'targeted' | 'reached' | 'engaged' | 'converted'; interface CampaignContactModel { id: string; orgId: string; workspaceId: string; userId: string; campaignId: string; contactId: string; status: CampaignContactStatus; source?: string; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type CampaignProductRole = 'primary' | 'supporting'; interface CampaignProductModel { id: string; orgId: string; workspaceId: string; userId: string; campaignId: string; productId: string; role: CampaignProductRole; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type DealStage = 'qualified' | 'proposal' | 'negotiation' | 'contract' | 'closed_won' | 'closed_lost'; interface DealModel { id: string; orgId: string; workspaceId: string; userId: string; clientId?: string; contactId?: string; opportunityId?: string; title: string; description?: string; stage: DealStage; value?: number; currency?: string; probability?: number; closeDate?: string; actualCloseDate?: string; lostReason?: string; assignedTo?: string; pipelineId?: string; notes?: string; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } interface PipelineModel { id: string; orgId: string; workspaceId: string; userId: string; name: string; description?: string; isDefault?: boolean; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type PipelineStageType = 'open' | 'won' | 'lost'; interface PipelineStageModel { id: string; orgId: string; workspaceId: string; userId: string; pipelineId: string; name: string; order: number; probability?: number; color?: string; type: PipelineStageType; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type QuoteStatus = 'draft' | 'sent' | 'accepted' | 'rejected' | 'expired'; interface QuoteModel { id: string; orgId: string; workspaceId: string; userId: string; dealId?: string; clientId?: string; contactId?: string; quoteNumber?: string; title: string; description?: string; status: QuoteStatus; subtotal?: number; tax?: number; discount?: number; total?: number; currency?: string; validUntil?: string; terms?: string; notes?: string; sentAt?: string; acceptedAt?: string; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type InvoiceStatus = 'draft' | 'sent' | 'partial' | 'paid' | 'overdue' | 'void'; interface InvoiceModel { id: string; orgId: string; workspaceId: string; userId: string; dealId?: string; quoteId?: string; clientId?: string; contactId?: string; invoiceNumber?: string; title: string; description?: string; status: InvoiceStatus; subtotal?: number; tax?: number; discount?: number; total?: number; currency?: string; issueDate?: string; dueDate?: string; paidDate?: string; paymentMethod?: string; paymentReference?: string; terms?: string; notes?: string; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type LineItemParentType = 'quote' | 'invoice'; interface LineItemModel { id: string; orgId: string; workspaceId: string; userId: string; parentId: string; parentType: LineItemParentType; productId?: string; description: string; quantity: number; unitPrice: number; discount?: number; total?: number; order: number; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } interface DealProductModel { id: string; orgId: string; workspaceId: string; userId: string; dealId: string; productId: string; quantity?: number; unitPrice?: number; notes?: string; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type DealProjectRelationship = 'delivery' | 'support' | 'implementation'; interface DealProjectModel { id: string; orgId: string; workspaceId: string; userId: string; dealId: string; projectId: string; relationship?: DealProjectRelationship; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type PartnershipType = 'strategic' | 'referral' | 'channel' | 'technology' | 'content' | 'affiliate'; type PartnershipStatus = 'prospecting' | 'negotiating' | 'active' | 'paused' | 'ended'; interface PartnershipModel { id: string; orgId: string; workspaceId: string; userId: string; clientId?: string; contactId?: string; name: string; description?: string; type: PartnershipType; status: PartnershipStatus; terms?: string; startDate?: string; endDate?: string; value?: number; commissionRate?: number; notes?: string; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type ContentPieceStatus = 'idea' | 'drafted' | 'scheduled' | 'published' | 'analyzed'; type ContentPieceType = 'post' | 'thread' | 'article' | 'video' | 'email' | 'newsletter' | 'carousel' | 'reel' | 'podcast'; type ContentPlatform = 'twitter' | 'linkedin' | 'youtube' | 'email' | 'blog' | 'instagram' | 'tiktok' | 'reddit'; type MessagingFramework = 'pas' | 'aida' | 'before_after_bridge' | 'heros_journey' | 'custom'; type AwarenessLevel = 'unaware' | 'problem_aware' | 'solution_aware' | 'product_aware' | 'most_aware'; type ContentFunnelStageLevel = 'awareness' | 'interest' | 'decision' | 'action'; interface OutlineSection { heading: string; subpoints: string[]; narrative: string; visualNotes: string; } interface ContentPieceMetrics { impressions?: number; likes?: number; shares?: number; comments?: number; clicks?: number; conversions?: number; engagementRate?: number; } interface ContentPieceModel { id: string; orgId: string; workspaceId: string; userId: string; title: string; description?: string; status?: ContentPieceStatus; type?: ContentPieceType; platform?: ContentPlatform; pillarId?: string; campaignId?: string; offerId?: string; hookFormulaId?: string; targetAudienceId?: string; purpose?: string; messagingFramework?: MessagingFramework; awarenessLevel?: AwarenessLevel; funnelStage?: ContentFunnelStageLevel; hook?: string; intro?: string; outline?: OutlineSection[]; conversionCodeIds?: string; leadMagnetId?: string; scheduledDate?: string; publishedDate?: string; metrics?: ContentPieceMetrics; notes?: string; createdAt: string; updatedAt: string; archived: boolean; extended?: Record; } type PillarCategory = 'educational' | 'inspirational' | 'promotional' | 'behind_the_scenes' | 'storytelling'; interface ContentPillarModel { id: string; orgId: string; workspaceId: string; userId: string; name: string; description?: string; category?: PillarCategory; topics?: string; targetFrequency?: number; color?: string; notes?: string; createdAt: string; updatedAt: string; archived: boolean; extended?: Record; } type HookCategory = 'pain_agitate' | 'curiosity' | 'authority' | 'contrarian' | 'how_to' | 'story' | 'list' | 'question'; type HookSource = 'creator_blueprints' | 'custom'; interface HookVariable { name: string; description: string; example: string; } interface HookTemplateModel { id: string; orgId: string; workspaceId: string; userId: string; formula: string; category?: HookCategory; source?: HookSource; variables?: HookVariable[]; exampleFilled?: string; usageCount?: number; avgEngagement?: number; notes?: string; createdAt: string; updatedAt: string; archived: boolean; extended?: Record; } type ConversionCategory = 'structural' | 'emotional' | 'logical' | 'psychological' | 'attention' | 'offer_positioning' | 'authority' | 'problem_awareness'; interface ConversionCodeModel { id: string; orgId: string; workspaceId: string; userId: string; name: string; description?: string; category?: ConversionCategory; technique?: string; bestContentTypes?: string[]; exampleUsage?: string; notes?: string; createdAt: string; updatedAt: string; archived: boolean; extended?: Record; } type FunnelStatus = 'planning' | 'active' | 'optimizing' | 'retired'; interface FunnelStage { name: string; goal: string; contentTypes: string[]; cta: string; exitCriteria: string; } interface FunnelMetrics { enterCount?: number; conversionRate?: number; revenue?: number; avgTimeToConvert?: number; } interface ContentFunnelModel { id: string; orgId: string; workspaceId: string; userId: string; name: string; description?: string; status?: FunnelStatus; offerId?: string; leadMagnetId?: string; campaignId?: string; stages?: FunnelStage[]; metrics?: FunnelMetrics; notes?: string; createdAt: string; updatedAt: string; archived: boolean; extended?: Record; } /** * Payment plan type options for structuring offer pricing. */ type PaymentPlanType = 'pay_in_full' | 'installment_3' | 'installment_6' | 'installment_12' | 'graduated' | 'trial_then_pay'; /** * Payment plan status. */ type PaymentPlanStatus = 'draft' | 'active' | 'archived'; /** * PaymentPlanModel Interface * * Represents a pricing and payment structure for an offer. * Payment plans define how a buyer pays — lump sum, installments, * trial-to-paid, or graduated structures. */ interface PaymentPlanModel { /** Unique payment plan identifier */ id: string; /** Human-readable name for this payment plan */ name: string; /** Optional reference to the parent offer */ offerId?: string; /** The payment structure type */ planType?: PaymentPlanType; /** Full / base price in default currency */ basePrice?: number; /** Introductory or discounted price (pay_in_full, graduated) */ introPrice?: number; /** Amount due per installment period */ installmentAmount?: number; /** Number of trial days before billing begins */ trialDays?: number; /** Legal terms and conditions */ terms?: string; /** Lifecycle status of this plan */ status?: PaymentPlanStatus; /** Soft delete flag */ archived: boolean; /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID of plan creator/owner */ userId: string; /** ISO 8601 timestamp when plan was created */ createdAt: string; /** ISO 8601 timestamp when plan was last updated */ updatedAt: string; /** Extensible object for future schema additions */ extended?: Record; } /** * OutreachTargetModel Interface * * Tracks daily outreach activity targets and actuals for the Daily 100 cadence. * Each record represents one day's planned vs actual output across four * outreach categories: warm outreach, content creation, cold outreach, and ad spend. */ interface OutreachTargetModel { /** Unique identifier */ id: string; /** ISO date string (YYYY-MM-DD) for this day's tracking entry */ date: string; /** Planned warm outreach contact count for the day */ warmOutreachTarget?: number; /** Actual warm outreach contacts made */ warmOutreachActual?: number; /** Planned content creation in minutes */ contentMinutesTarget?: number; /** Actual content creation minutes logged */ contentMinutesActual?: number; /** Planned cold outreach contact count */ coldOutreachTarget?: number; /** Actual cold outreach contacts made */ coldOutreachActual?: number; /** Planned ad spend in dollars */ adSpendTarget?: number; /** Actual ad spend in dollars */ adSpendActual?: number; /** Freeform daily notes */ notes?: string; /** Running consecutive-day streak count */ streakDays?: number; /** Soft delete flag */ archived: boolean; /** Organization ID for multi-tenant data isolation */ orgId: string; /** Workspace ID for workspace-level data isolation */ workspaceId: string; /** User ID of the record owner */ userId: string; /** ISO 8601 timestamp when record was created */ createdAt: string; /** ISO 8601 timestamp when record was last updated */ updatedAt: string; /** Extensible object for future schema additions */ extended?: Record; } type OfferWorksheetStatus = 'draft' | 'active' | 'archived'; interface OfferWorksheetModel { id: string; orgId: string; workspaceId: string; userId: string; name: string; offerId?: string; dreamOutcome?: string; problemList?: string; solutionList?: string; deliveryVehicles?: string; trimmedStack?: string; partnerBonuses?: string; status?: OfferWorksheetStatus; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } type OfferFunnelType = 'attraction' | 'upsell' | 'downsell' | 'continuity' | 'full_ladder'; type OfferFunnelStatus = 'draft' | 'active' | 'archived'; interface OfferFunnelModel { id: string; orgId: string; workspaceId: string; userId: string; name: string; description?: string; funnelType?: OfferFunnelType; entryOfferId?: string; stages?: string; triggerConditions?: string; emailSequenceNotes?: string; conversionTargets?: string; status?: OfferFunnelStatus; extended?: Record; createdAt: string; updatedAt: string; archived: boolean; } /** * Primitive field types supported by the schema-in-db system. * These map to UI rendering and validation behaviour in consumers. */ type FieldType = 'text' | 'number' | 'boolean' | 'date' | 'select' | 'multiselect' | 'relation' | 'richtext' | 'json'; /** * Display renderer hint for a field. Consumers use this to pick the * appropriate cell/input widget without storing UI code in the DB. */ type FieldRenderer = 'default' | 'link' | 'email' | 'phone' | 'image' | 'avatar' | 'color' | 'rating' | 'progress' | 'badge' | 'currency' | 'code' | 'markdown' | 'file'; /** * Additional display and validation configuration attached to a field. * All properties are optional so consumers only carry what they need. */ interface FieldConfig { renderer?: FieldRenderer; placeholder?: string; helpText?: string; prefix?: string; suffix?: string; pattern?: string; patternMessage?: string; minLength?: number; maxLength?: number; format?: string; precision?: number; step?: number; multiline?: boolean; rendererConfig?: Record; /** When true, this field is encrypted at rest using client-side encryption */ encrypted?: boolean; /** Determines which key encrypts this field. * 'owner' = only document creator can decrypt (default) * 'org' = all org members can decrypt * 'workspace' = all workspace members can decrypt * 'role:' = members of the named role can decrypt */ encryptionScope?: string; } /** * A single option in a select or multiselect field. */ interface SelectOption { value: string; label: string; color?: string; } /** * Complete definition of a single field within a virtual collection schema. */ interface FieldDefinition { name: string; label: string; type: FieldType; required: boolean; defaultValue?: unknown; options?: SelectOption[]; /** Name of the target schema when type is 'relation'. */ relationSchema?: string; min?: number; max?: number; /** Display order. Lower values appear first. */ order: number; hidden?: boolean; /** Column width hint in pixels for table views. */ width?: number; config: FieldConfig; } /** Defines who can perform which operations on records in a collection. */ interface ClassLevelPermissions { /** Map of grantee key → allowed flag for record creation */ create?: Record; /** Map of grantee key → allowed flag for reading a specific record by ID */ read?: Record; /** Map of grantee key → allowed flag for listing/querying all records */ list?: Record; /** Map of grantee key → allowed flag for updating records */ update?: Record; /** Map of grantee key → allowed flag for deleting records */ delete?: Record; /** Map of grantee key → allowed flag for modifying ACL entries on a resource */ share?: Record; /** When true, row-level ACL overrides are active for this collection */ aclEnabled?: boolean; /** Fields hidden per grantee key */ protectedFields?: { [grantee: string]: string[]; }; /** Index signature for compatibility with Record */ [key: string]: unknown; } /** * Identifies which built-in RxDB collection a virtual schema's records * are stored in. Every target maps to a real, physical collection. */ type SchemaTarget = 'records' | 'tasks' | 'milestones' | 'projects' | 'documents'; type VaultItemType = 'api_key' | 'oauth_token' | 'password' | 'secret' | 'certificate'; type TicketSource = 'email' | 'chat' | 'phone' | 'form' | 'internal'; type TicketType = 'bug' | 'billing' | 'how_to' | 'feature_request' | 'feedback'; type TicketSeverity = 'low' | 'medium' | 'high' | 'critical'; type TicketStatus = 'open' | 'in_progress' | 'waiting' | 'resolved' | 'closed'; interface TicketModel { id: string; orgId: string; workspaceId: string; userId: string; subject: string; description?: string; source?: TicketSource; ticketType?: TicketType; severity?: TicketSeverity; status?: TicketStatus; contactId?: string; assignedTo?: string; customerTier?: string; slaDeadline?: string; resolution?: string; createdAt: string; updatedAt: string; archived: boolean; extended?: Record; } type FeedbackType = 'bug' | 'feature_request' | 'usability' | 'pricing' | 'onboarding' | 'content_quality'; type FeedbackSentiment = 'positive' | 'neutral' | 'negative'; type FeedbackStatus = 'new' | 'reviewed' | 'routed' | 'resolved'; interface FeedbackItemModel { id: string; orgId: string; workspaceId: string; userId: string; title: string; description?: string; feedbackType?: FeedbackType; product?: string; theme?: string; sentiment?: FeedbackSentiment; volume?: number; contactId?: string; status?: FeedbackStatus; createdAt: string; updatedAt: string; archived: boolean; extended?: Record; } type KbArticleVisibility = 'public' | 'internal'; type KbArticleStatus = 'draft' | 'published' | 'archived'; interface KbArticleModel { id: string; orgId: string; workspaceId: string; userId: string; title: string; content?: string; category?: string; visibility?: KbArticleVisibility; status?: KbArticleStatus; tags?: string; viewCount?: number; deflectionCount?: number; relatedTicketIds?: string; createdAt: string; updatedAt: string; archived: boolean; extended?: Record; } type PaymentStatus = 'current' | 'overdue' | 'churned'; type HealthTrend = 'improving' | 'stable' | 'declining'; interface HealthScoreModel { id: string; orgId: string; workspaceId: string; userId: string; contactId: string; compositeScore?: number; loginFrequency?: number; featureAdoption?: number; ticketVolume?: number; contentEngagement?: number; paymentStatus?: PaymentStatus; trend?: HealthTrend; lastCalculated?: string; notes?: string; createdAt: string; updatedAt: string; archived: boolean; extended?: Record; } type IntegrationProductType = 'lms' | 'saas' | 'course_platform' | 'ecommerce' | 'other'; type IntegrationStatus = 'active' | 'inactive' | 'error'; interface IntegrationModel { id: string; orgId: string; workspaceId: string; userId: string; name: string; productType?: IntegrationProductType; connectionUrl?: string; apiKeyRef?: string; status?: IntegrationStatus; lastSyncAt?: string; syncFrequency?: string; notes?: string; createdAt: string; updatedAt: string; archived: boolean; extended?: Record; } /** Minimal query interface — only .exec() is used by the adapter. * The REST CollectionAccessorAdapter does not support chainable * .skip()/.limit()/.sort() so the VCA applies those client-side. * * Returns `unknown[]` because RxDB documents have `.toJSON()` while * REST responses are plain objects — {@link VirtualCollectionAdapter.toPlainObject} * normalizes both at runtime. */ interface ExecutableQuery { exec(): Promise; } /** * Structural interface for the subset of RxCollection methods used by the adapter. * * All operations are collection-level (not document-level) so the adapter * works with both RxDB local collections and REST client wrappers. */ interface RecordCollection { find(query: { selector: Record; sort?: Array>; }): ExecutableQuery; findOne(query: { selector: Record; }): { exec(): Promise | null>; }; insert(doc: Partial): Promise>; /** Update a document by ID. Returns the updated document. */ update(id: string, patch: Record): Promise>; /** Delete a document by ID. */ delete(id: string): Promise; /** * Execute an aggregate query against the collection. * Only supported by REST-backed implementations (D1 worker). * RxDB local collections do not implement this method. * * @param spec - The AggregateRequest payload forwarded verbatim to the worker. * @returns An object with a `documents` array of result rows. */ aggregate?(spec: Record): Promise<{ documents: Record[]; }>; } /** Structural interface for the schemas collection used by SchemaRegistry. */ interface SchemaCollection { find(query: { selector: Record; }): { exec(): Promise; }>>; }; findOne(query: { selector: Record; }): { exec(): Promise<{ toJSON(): Record; } | null>; }; } /** * Wraps the generic `records` RxCollection and scopes all operations * to a specific schemaId. Provides the same CRUD interface that consumers * expect from a dedicated collection. */ declare class VirtualCollectionAdapter { private recordsCollection; private schemaDefinition; constructor(recordsCollection: RecordCollection, schemaDefinition: SchemaModel); /** * Safely extract a plain object from an RxDB document or REST response. * RxDB documents have `.toJSON()`, REST clients return plain objects. */ private toPlainObject; get name(): string; get schemaId(): string; /** * Map a flat document (as callers provide) into the RecordModel storage format. * * Any field present in TOP_LEVEL_FIELDS is written directly to the record * object. Everything else is packed into the `data` bag. * * Using TOP_LEVEL_FIELDS as the single source of truth means that schema * columns added to RecordModel (e.g. `extended`, `sortOrder`, `priority`) * are automatically promoted without needing a matching change here. */ mapToRecord(flatDoc: Record): Partial; /** * Map a RecordModel back to a flat document (as callers expect). * Merges `data` fields to top level alongside standard fields. */ mapFromRecord(record: RecordModel): Record; /** * Rewrite a selector to scope it to this schema. * Only includes top-level RecordModel fields that RxDB can query directly. * Data-bag fields are omitted — use {@link extractDataFilter} to get them * for client-side filtering after the query returns. */ rewriteSelector(selector: Record, isNested?: boolean): Record; /** * Extract data-bag field conditions from a selector for client-side filtering. * Returns field conditions that are NOT top-level RecordModel fields and NOT * logical operators ($and/$or). * * Note: data-bag fields inside $and/$or are not extracted — they are silently * dropped from the RxDB query. For complex logical queries on data-bag fields, * fetch all records for the schema and filter entirely client-side. */ extractDataFilter(selector: Record): Record; /** * Rewrite sort criteria, keeping only top-level RecordModel fields. * Data-bag field sorts are omitted — use {@link extractClientSort} to get * them for client-side sorting. */ rewriteSort(sort: Array>): Array>; /** * Extract data-bag field sorts for client-side sorting. */ extractClientSort(sort: Array>): Array>; /** * Test whether a flat (mapped) document matches data-bag filter conditions. * Supports direct equality and common MongoDB-style operators. */ static matchesDataFilter(doc: Record, filter: Record): boolean; /** * Sort flat (mapped) documents by data-bag field criteria client-side. */ static applyClientSort>(docs: T[], sort: Array>): T[]; /** Query records scoped to this schema */ find(options?: { selector?: Record; limit?: number; skip?: number; sort?: Array>; }): Promise[]>; /** Get a single record by ID */ findOne(id: string): Promise | null>; /** * Generate an ID for a new record using the schema-declared prefix. * Resolution order: * 1. `metadata.idPrefix` from the schema definition (e.g. 'deal') * 2. `createId(schemaName)` via ENTITY_TO_PREFIX lookup * 3. `createId('records')` as last resort */ private generateId; /** Insert a new record */ insert(flatDoc: Record): Promise>; /** * Update a record by ID with partial data. * * **Merge semantics:** Existing `data` fields are preserved; only provided * fields are overwritten. Setting a field to `null` stores `null` but does * NOT delete the key. To remove a field, callers should use a dedicated * delete-field operation (not yet implemented). * * **Immutable fields:** `id`, `schemaId`, `orgId`, `workspaceId`, `userId`, * and `createdAt` are silently dropped from updates. * * **Column routing:** Fields present in TOP_LEVEL_FIELDS are written to * real RecordModel columns. Any field NOT in TOP_LEVEL_FIELDS and NOT * immutable is packed into the `data` extension blob. The `data` key is * only written when there are extension-only fields — callers that update * only real columns do not cause an unintentional `data: {}` overwrite. * * Previously this method maintained a second, shorter hardcoded set of * "top-level" fields that excluded RecordModel columns added after the * initial implementation (`extended`, `sortOrder`, `priority`, `dueAt`, * `amount`, `tenantId`). Those columns were silently routed to the `data` * blob, leaving the real DB column NULL. The fix is to use the shared * TOP_LEVEL_FIELDS constant which is kept in sync with RecordModel. */ update(id: string, updates: Record): Promise | null>; /** * Insert or update a record, handling cross-schema conflicts. * * Checks for existing documents proactively before insert to handle * cross-org/cross-schema scenarios where the same external ID exists * under a different schemaId/orgId. Falls back to CONFLICT catch for * race conditions. * * Use this for sync workflows where the same external ID may have been * previously imported under a different org or schema context. */ upsert(flatDoc: Record): Promise>; /** Delete a record by ID */ remove(id: string): Promise; /** Count records matching a selector */ count(selector?: Record): Promise; /** * Execute an aggregate (GROUP BY / HAVING) query. * * Delegates directly to the underlying `RecordCollection.aggregate()`. * Only REST-backed collections (D1 worker) implement this method — * local RxDB collections do not support server-side aggregation. * * @param spec - Aggregate request spec forwarded verbatim to the worker. * @throws Error if the underlying collection does not support aggregate. */ aggregate(spec: Record): Promise<{ documents: Record[]; }>; } /** * Wrap a raw RxDB collection to satisfy the RecordCollection interface. * * RxDB collections have document-level update/delete (doc.patch, doc.remove) * but not collection-level update(id, patch) or delete(id). This wrapper * bridges that gap so VirtualCollectionAdapter works in both browser (RxDB) * and REST (CollectionAccessorAdapter) contexts. */ declare function wrapRxCollection(rxCollection: any): RecordCollection; /** * Decorator that adds transparent field-level encryption to a {@link VirtualCollectionAdapter}. * * - On write (insert/update/upsert): encrypts configured fields before passing to VCA * - On read (find/findOne): decrypts encrypted field envelopes after VCA returns * - When KeyRing is locked: reads return `'[encrypted]'` placeholders, writes throw * * The adapter does NOT mutate the VCA — it wraps it as a pure decorator. * * @example * ```typescript * const vca = new VirtualCollectionAdapter(records, schema) * const adapter = new EncryptedCollectionAdapter(vca, schema, keyRing, context) * const doc = await adapter.insert({ name: 'Alice', ssn: '123-45-6789' }) * // ssn is stored encrypted in VCA, returned decrypted to caller * ``` */ declare class EncryptedCollectionAdapter { private readonly vca; private readonly keyRing; private readonly context; private readonly lookupKey?; private readonly encryptionConfig; /** * @param vca - The VirtualCollectionAdapter to wrap * @param schema - Schema definition containing encrypted field configuration * @param keyRing - The KeyRing used for encrypt/decrypt operations * @param context - Encryption context (orgId, workspaceId, userId) * @param lookupKey - Optional key lookup function for group key resolution */ constructor(vca: VirtualCollectionAdapter, schema: SchemaModel, keyRing: KeyRing, context: EncryptionContext, lookupKey?: KeyLookupFn | undefined); /** Delegates to the wrapped VCA's collection name. */ get name(): string; /** Delegates to the wrapped VCA's schema ID. */ get schemaId(): string; /** * Find records matching the given selector. * Encrypted fields in returned documents are decrypted transparently. * Returns `'[encrypted]'` placeholder strings when the KeyRing is locked. */ find(options?: { selector?: Record; limit?: number; skip?: number; sort?: Array>; }): Promise[]>; /** * Find a single record by ID. * Encrypted fields in the returned document are decrypted transparently. * Returns `null` if no record is found. */ findOne(id: string): Promise | null>; /** * Insert a new record, encrypting configured fields before storage. * * @throws When the KeyRing is locked and there are fields to encrypt */ insert(flatDoc: Record): Promise>; /** * Update an existing record by ID, encrypting any configured fields in the patch. * Returns the updated document with encrypted fields decrypted, or `null` if not found. * * @throws When the KeyRing is locked and the patch contains fields to encrypt */ update(id: string, updates: Record): Promise | null>; /** * Remove a record by ID. Delegates directly to VCA — no encryption needed for deletes. * Returns `true` if the record was found and removed, `false` otherwise. */ remove(id: string): Promise; /** * Upsert a record, encrypting configured fields before storage. * Inserts if no record with the given ID exists, updates otherwise. * * @throws When the KeyRing is locked and there are fields to encrypt */ upsert(flatDoc: Record): Promise>; } /** * Derive the encryptedFields config from a schema's field definitions. * Called by schema save handlers to keep the encryptedFields column in sync. * * @param fields - Array of field definitions from the schema * @returns Array of encrypted field configurations containing fieldName and encryptionScope * * @example * ```typescript * const encryptedFields = deriveEncryptedFieldsConfig(schema.fields) * // [{ fieldName: 'ssn', encryptionScope: 'owner' }] * ``` */ declare function deriveEncryptedFieldsConfig(fields: Array<{ name: string; config?: { encrypted?: boolean; encryptionScope?: string; }; }>): Array<{ fieldName: string; encryptionScope: string; }>; declare class SchemaRegistry { private schemasCollection; private recordsCollection; private schemas; private adapterCache; /** * Encrypted-adapter cache keyed by `${userId}:${orgId}:${name}` so * adapters created under one org's keyRing are NOT served to * another org's request. The plain (`adapterCache` above) is org- * agnostic because the underlying VCA reads the records table * directly with no encryption involved. */ private encryptedAdapterCache; /** * Per-(user, org) encryption entries. Set via * `setEncryptionContext(userId, orgId, ...)` after a successful * vault-unlock; cleared via `clearEncryptionContext(userId, orgId)` * on vault-lock or session end. Concurrent unlocked sessions in * different orgs each have their own entry. */ private encryptionContexts; constructor(schemasCollection: SchemaCollection | null, recordsCollection: RecordCollection | null); /** * Load all schema definitions for an org from the database. * Uses query-then-swap: existing cache is preserved if the DB query fails. * * @param orgId - The organization ID to filter schemas by */ loadSchemas(orgId: string): Promise; /** * Load all non-archived schema definitions across all orgs. * Uses query-then-swap: existing cache is preserved if the DB query fails. */ loadAllSchemas(): Promise; /** * Lazy single-schema resolution with DB fallback. * Checks the in-memory cache first; on miss, queries the DB and caches the result. * * @param name - Schema name * @param orgId - Organization ID for the DB query * @returns The schema if found, undefined otherwise */ getSchemaLazy(name: string, orgId: string): Promise; /** * Lazy adapter resolution with DB fallback. * Checks adapter cache, then schema cache, then falls back to DB query. * * @param name - Schema/virtual collection name * @param orgId - Organization ID for the DB query * @returns A VirtualCollectionAdapter if the schema targets 'records', undefined otherwise */ getAdapterLazy(name: string, orgId: string): Promise; /** * Lazy encrypted adapter resolution with DB fallback. * Returns an {@link EncryptedCollectionAdapter} when a KeyRing is configured, * otherwise returns a plain {@link VirtualCollectionAdapter}. * * Use this when you need transparent field-level encryption on CRUD operations. * Use {@link getAdapterLazy} when you need VCA-specific internals (reactive queries, * selector rewriting, etc.). * * @param name - Schema/virtual collection name * @param orgId - Organization ID for the DB query */ getEncryptedAdapterLazy(name: string, userId: string, orgId: string): Promise; /** Register a schema directly (for seed/testing without DB) */ registerSchema(schema: SchemaModel): void; /** Check if a name matches a registered schema */ hasSchema(name: string): boolean; /** Get the schema definition by name */ getSchema(name: string): SchemaModel | undefined; /** Get all registered schema names */ getSchemaNames(): string[]; /** Get all registered schemas */ getAllSchemas(): SchemaModel[]; /** Get or create a VirtualCollectionAdapter for a schema name */ getAdapter(name: string): VirtualCollectionAdapter | undefined; /** * Get or create an encrypted adapter for a schema name. * Returns an {@link EncryptedCollectionAdapter} when a KeyRing is configured, * otherwise returns a plain {@link VirtualCollectionAdapter}. * * Use this when you need transparent field-level encryption on CRUD operations. * Use {@link getAdapter} when you need VCA-specific internals (reactive queries, * selector rewriting, etc.). */ getEncryptedAdapter(name: string, userId: string, orgId: string): VirtualCollectionAdapter | EncryptedCollectionAdapter | undefined; /** Get schemas that overlay a primitive collection */ getOverlays(primitiveCollection: string): SchemaModel[]; /** Clear all cached state */ clear(): void; /** * Configure field-level encryption for the (user, org) session. * * Multi-org callers (service accounts spanning orgs, users with * concurrent vault-unlocks in different orgs) each get their own * encryption entry. Setting context for (userA, orgB) does NOT * disturb (userA, orgA) — earlier sessions stay unlocked. * * Invalidates only the (userId, orgId)-scoped slice of the * encrypted-adapter cache so other unlocked sessions keep their * cached encrypted adapters. * * @param userId - Caller's verified userId (from JWT sub/userId claim) * @param orgId - Caller's verified orgId (from JWT orgId claim) * @param keyRing - The KeyRing used for encrypt/decrypt operations * @param context - Encryption context (orgId, workspaceId, userId) * @param lookupKey - Optional key lookup function for group key resolution */ setEncryptionContext(userId: string, orgId: string, keyRing: KeyRing, context: EncryptionContext, lookupKey?: KeyLookupFn): void; /** * Clear the (user, org) encryption entry — encrypted adapters for * THIS session resolve to plain VCA again. Other unlocked * sessions are unaffected. */ clearEncryptionContext(userId: string, orgId: string): void; /** * Drop ALL encryption contexts and cached encrypted adapters. * Called from `MCPServer.close()` during shutdown so key material * doesn't outlive the process. */ clearAllEncryptionContexts(): void; /** * Optionally wrap a VCA with encryption if KeyRing is configured. * Caches the result in the encrypted adapter cache. */ private wrapWithEncryption; /** Normalize a DB document (RxDB or REST plain object) to a SchemaModel. */ private static docToSchema; } /** * Result of a migration run for a single collection. */ interface MigrationResult$1 { /** The schema name (== legacy collection name) that was migrated. */ collection: string; /** Number of documents successfully written to `records`. */ migrated: number; /** Number of documents that failed to insert. */ errors: number; /** Per-document error details for failed inserts. */ errorDetails: Array<{ id: string; error: string; }>; } /** * Migrate all documents from a legacy collection into the records collection. * * For each document: * 1. Map promoted fields (`title`, `status`, etc.) to top-level RecordModel fields * 2. Map remaining domain fields into the `data` bag * 3. Preserve `orgId`, `workspaceId`, `userId`, timestamps * 4. Set `schemaId` from the provided schema definition * 5. Generate a new record ID (`rec_` prefix) * * Idempotent: skips documents that already exist in `records` with a matching * `metadata.sourceId`. The source ID is stored in `metadata.sourceId` for * traceability and to make repeated runs safe. * * @param legacyCollection - The source RxDB collection (or compatible mock). * @param recordsCollection - The target `records` RxDB collection. * @param schema - The SchemaModel that governs the migrated entity type. * @returns Counts and per-document error details for the migration run. */ declare function migrateCollectionToRecords(legacyCollection: { find(query: { selector: Record; }): { exec(): Promise; }; }, recordsCollection: { findOne(query: { selector: Record; }): { exec(): Promise; }; insert(doc: RecordModel): Promise; }, schema: SchemaModel): Promise; /** * Run migration for multiple legacy collections in sequence. * * Each mapping entry pairs a legacy collection with the SchemaModel it should * be migrated under. The `recordsCollection` is shared across all migrations. * * Errors within a single collection do not abort other collections; per-item * errors are captured inside each {@link MigrationResult}. * * @param mappings - Array of `{ name, legacyCollection, schema }` descriptors. * @param recordsCollection - The shared target `records` RxDB collection. * @returns One {@link MigrationResult} per mapping entry, in order. */ declare function migrateAll(mappings: Array<{ /** Display name used for logging; typically matches schema.name. */ name: string; legacyCollection: { find(query: { selector: Record; }): { exec(): Promise; }; }; schema: SchemaModel; }>, recordsCollection: { findOne(query: { selector: Record; }): { exec(): Promise; }; insert(doc: RecordModel): Promise; }): Promise; /** RxDB-compatible collection interface required by {@link seedBuiltInRoles}. */ interface RolesCollectionLike { findOne(query: { selector: Record; }): { exec(): Promise<{ id: string; name: string; } | null>; }; insert(doc: RoleModel): Promise; } /** * Seeds the four built-in org roles (owner, manager, contributor, viewer) if they * do not already exist for the given org. Safe to call multiple times — existing * roles are detected via a compound selector on `name + orgId + builtIn`. * * @param rolesCollection - RxDB (or compatible) collection for roles * @param orgId - The org to seed roles for * @returns Counts of created and skipped roles */ declare function seedBuiltInRoles(rolesCollection: RolesCollectionLike, orgId: string): Promise<{ created: number; skipped: number; }>; interface MigrationDependencies { orgId: string; systemUserId: string; getTeamMembers(): Promise; findRoleByName(name: string): Promise | null>; existsMembership(userId: string, roleId: string, orgId: string): Promise; insertMembership(membership: RoleMembershipModel): Promise; } interface MigrationResult { migrated: number; skipped: number; errors: Array<{ userId: string; reason: string; }>; } /** * One-time migration: for each teamMember, create a rolemembership for their * org-level role if one does not already exist. * * Idempotent — safe to run multiple times. Already-migrated members are skipped. * * All side effects are injected via `deps` so this function is fully testable * without a live database. The caller is responsible for supplying correct * collection accessors scoped to the target org. * * @param deps - Injected dependencies (collections + context IDs) * @returns Counts of migrated, skipped, and errored members */ declare function migrateTeamMembersToRoleMemberships(deps: MigrationDependencies): Promise; /** * @fileoverview One-time migration that promotes `lastHeartbeat` and * `containerStatus` from the TeamMember `metadata` blob to schema-level * fields. * * Idempotent — safe to run multiple times. Records where `lastHeartbeat` * is already set at the schema level are skipped. Per-record errors are * accumulated in the returned {@link PromotionResult.errors} array rather * than aborting the whole run. */ interface PromotionDependencies { orgId: string; getTeamMembers(): Promise; updateTeamMember(id: string, patch: Partial): Promise; } interface PromotionResult { migrated: number; skipped: number; errors: Array<{ id: string; reason: string; }>; } /** * Promote `lastHeartbeat` and `containerStatus` from metadata to * schema-level fields on every TeamMember record in the given org. * * Idempotent — records where `lastHeartbeat` is already set at the * schema level are skipped. Records with no metadata values to promote * are also skipped. * * All side effects are injected via `deps` so this function is fully * testable without a live database. */ declare function promoteTeamMemberAgentFields(deps: PromotionDependencies): Promise; /** * Placeholder orgId used in built-in seed schemas. * Replaced with the real orgId by the seed runner at initialization time. */ declare const SEED_ORG_PLACEHOLDER = "__SEED_ORG__"; /** * Placeholder workspaceId used in built-in seed schemas. * Replaced with the real workspaceId by the seed runner at initialization time. */ declare const SEED_WORKSPACE_PLACEHOLDER = "__SEED_WORKSPACE__"; /** * A seed schema is a SchemaModel without the auto-generated fields that * the seed runner fills in (id, createdAt, updatedAt). */ type SeedSchema = Omit; /** * Core seeds required by the shell infrastructure. * These are always seeded regardless of which apps are installed: * - orchestration: agent pipeline (proposals, missions, steps, events, triggers, policies, affinities) * - assignments: generic entity→team-member linking (category: 'core') * - dashboard: dashboard rendering framework (dashboards, templates, components) * * Domain seeds (crm, sales, finance, etc.) are contributed by their * respective app plugins via `contributes.schemas` manifests. */ declare const coreSeeds: SeedSchema[]; /** * Result returned by {@link seedSchemas} describing what happened. */ interface SeedResult { /** Number of schemas inserted during this run. */ created: number; /** Number of schemas that already existed and were left untouched. */ skipped: number; } /** * Options for controlling seed behavior. */ interface SeedOptions { /** * Number of schemas to insert per batch before yielding. * Smaller batches produce smaller replication push payloads (local insert) * or smaller REST request bodies (REST write). * @default 5 */ batchSize?: number; /** * Milliseconds to wait between batches so replication can flush. * @default 200 */ batchDelayMs?: number; /** * Optional orgs collection for org-existence validation. * When provided, seedSchemas will verify the orgId exists before * inserting any schemas. If the org doesn't exist, returns immediately * with { created: 0, skipped: 0 }. * When omitted, no validation is performed (backward compatible). */ orgsCollection?: { findOne(query: { selector: { id: string; }; }): { exec(): Promise<{ id: string; } | null>; }; }; /** * Custom seed list to use instead of the default `coreSeeds`. * Pass any subset of SeedSchema[] for targeted seeding. * When omitted, falls back to `coreSeeds` (shell infrastructure only). */ seeds?: SeedSchema[]; /** * When provided, missing schemas are written directly to the server via * this function instead of being inserted into the local RxDB collection. * * This avoids triggering replication push for bulk seed operations, which * causes RC_PUSH timeout errors when many schemas are created at once. * The caller is responsible for triggering a pull re-sync after seeding * to bring the server-side documents into the local IndexedDB. * * Receives a batch of fully-constructed {@link SchemaModel} documents. * Called once per batch; awaits completion before moving to the next. */ writeViaRest?: (docs: SchemaModel[]) => Promise; } /** * Minimal interface for the RxDB schemas collection expected by the runner. * Using a structural interface instead of the full RxDB type so callers can * pass mocks in tests without dragging in the RxDB peer dependency. */ interface SchemasCollection$1 { findOne(query: { selector: { name: string; orgId: string; }; }): { exec(): Promise; }; find(query: { selector: Record; }): { exec(): Promise; }; insert(doc: SchemaModel): Promise; } /** * Seeds built-in schema definitions into the schemas collection. * * Idempotent — fetches all existing schemas for the org in a single bulk * query and only inserts the ones that are missing. Safe to call on every * application startup. * * Placeholder values (`__SEED_ORG__`, `__SEED_WORKSPACE__`) in seed data * are replaced with the provided `orgId` and `workspaceId` before insert. * * Inserts are batched to avoid overwhelming replication with large push * payloads (which causes PayloadTooLargeError on the server). * * @param schemasCollection - An RxDB collection (or compatible mock) for schemas. * @param orgId - The target organisation ID; replaces {@link SEED_ORG_PLACEHOLDER}. * @param workspaceId - The target workspace ID; replaces {@link SEED_WORKSPACE_PLACEHOLDER}. * @param options - Optional batching configuration. * @returns Counts of created and skipped schemas. * * @example * const result = await seedSchemas(db.schemas, 'org_abc123', 'work_def456'); * console.log(`created=${result.created} skipped=${result.skipped}`); */ declare function seedSchemas(schemasCollection: SchemasCollection$1, orgId: string, workspaceId: string, options?: SeedOptions): Promise; /** * A single versioned migration for a virtual schema. * * Each migration targets a specific schema by name and declares the version * the schema will be at after the migration is applied. */ interface SchemaMigration { /** Virtual schema name (e.g., 'contentpieces'). */ schema: string; /** Schema version after this migration is applied. */ version: number; /** Human-readable description of what this migration does. */ description: string; /** * Transform the schema definition itself (add/remove/modify fields). * Receives the current SchemaModel and returns the updated fields. */ schemaChanges: (schema: SchemaModel) => Partial; /** * Transform existing records to match the new schema. * Called once per record. Omit if no data changes are needed. * Must be a pure function — no side effects or network calls. */ migrateData?: (record: RecordModel) => RecordModel; } /** * A single entry in a schema's migration history audit trail. */ interface MigrationHistoryEntry { version: number; appliedAt: string; description: string; } /** * Options for controlling migration execution. */ interface MigrationRunnerOptions { /** Report what would change without applying. */ dryRun?: boolean; /** Log per-record migration progress. */ verbose?: boolean; /** Number of records to process per batch (default: 100). */ batchSize?: number; /** Filter to specific schema names (default: all builtIn schemas). */ schemas?: string[]; } /** * Result of running migrations for a single schema within a single org. */ interface SchemaMigrationResult { schema: string; orgId: string; fromVersion: number; toVersion: number; migrationsApplied: number; recordsUpdated: number; errors: Array<{ recordId: string; error: string; }>; dryRun: boolean; } /** * In-memory registry of all known schema migrations. * * Migrations are registered by schema name and version. The registry ensures * versions are unique per schema and provides sorted access for the runner. * * Design note: sorting on insert (not on read) keeps getMigrationsForSchema * O(1) at the cost of a slightly more expensive register(). Since registration * happens at startup and reads happen at runtime, this is the right trade-off. */ declare class MigrationRegistry { private readonly migrations; /** * Register a migration. * * @throws {Error} If a migration with the same schema name and version * is already registered. Duplicate versions indicate a programming error * that must be caught at startup, not silently overwritten. */ register(migration: SchemaMigration): void; /** * Get all migrations for a schema, sorted by version ascending. * Returns an empty array for schemas with no registered migrations. */ getMigrationsForSchema(name: string): SchemaMigration[]; /** * Get migrations with version strictly greater than `currentVersion`, * sorted ascending. These are the migrations the runner must apply next. */ getPendingMigrations(name: string, currentVersion: number): SchemaMigration[]; /** * Get all registered migrations grouped by schema name. * Returns a defensive copy — callers cannot mutate registry state. */ getAllMigrations(): Map; /** * Get all schema names that have at least one registered migration, * sorted alphabetically. */ getSchemaNames(): string[]; } /** * Structural interface for the schemas collection. * Accepts both RxDB collections and REST-compatible wrappers. */ interface SchemasCollection { find(query: { selector: Record; }): { exec(): Promise; }; update(id: string, patch: Partial): Promise; } /** * Structural interface for the records collection. */ interface RecordsCollection { find(query: { selector: Record; }): { exec(): Promise; }; update(id: string, patch: Partial): Promise; } /** * Run all pending migrations across all orgs. * * Algorithm: * 1. Discover all builtIn schemas from the collection * 2. Extract the distinct set of orgIds across those schemas * 3. For each org, iterate every builtIn schema and compute pending migrations * 4. Apply schema-definition changes (field additions, renames, etc.) * 5. Optionally migrate existing record data via `migrateData` transforms * 6. Persist the updated schema (with audit history) unless dryRun is set * * Isolation contract: record write errors are captured per-record and do NOT * abort the migration for that schema. The schema definition is still updated * so subsequent runs can proceed cleanly. Callers should inspect * `result.errors` and re-drive failed records through compensating logic. * * @param registry - The populated MigrationRegistry for this deployment * @param schemasCollection - Collection holding SchemaModel documents * @param recordsCollection - Collection holding RecordModel documents * @param options - Optional runner controls (dryRun, filter, etc.) * @returns One result per (org, schema) pair that had pending migrations */ declare function runMigrations(registry: MigrationRegistry, schemasCollection: SchemasCollection, recordsCollection: RecordsCollection, options?: MigrationRunnerOptions): Promise; /** Flat list of all migrations across all schemas. */ declare const allMigrations: SchemaMigration[]; /** * Create a MigrationRegistry pre-loaded with all known migrations. * This is the primary entry point for the CLI and other consumers. */ declare function createMigrationRegistry(): MigrationRegistry; /** * Default CLP applied to all built-in collections. * Matches current implicit behavior: authenticated users can read; * contributor role can create/update/delete. */ declare const DEFAULT_CLP: ClassLevelPermissions; /** * Built-in collection names that receive a default CLP schema record. * These match the collection names registered in db-collections/src/index.ts. * RBAC collections and system collections (users, workers) are excluded. */ declare const BUILT_IN_COLLECTION_NAMES: string[]; interface SeedBuiltInCLPResult { total: number; created: number; updated: number; skipped: number; } interface SchemasLike { find(query: { selector: Record; }): { exec(): Promise; }) => Promise; [key: string]: unknown; }>>; }; update?: (id: string, patch: Record) => Promise; upsert(doc: object): Promise; } /** * Idempotent: seeds a default CLP schema record for each built-in collection. * Skips collections that already have a builtIn schema record. * * These are marker records — they carry no field definitions. Their sole purpose * is to attach a {@link ClassLevelPermissions} object to each native RxDB * collection so the RBAC enforcement layer has something to evaluate against. * * @param schemasCollection - RxDB schemas collection or a compatible mock. * @param orgId - The organisation to seed CLP records for. * @param clp - The CLP to apply; defaults to {@link DEFAULT_CLP}. * @returns Counts of created, skipped, and total records processed. */ declare function seedBuiltInCLP(schemasCollection: SchemasLike, orgId: string, clp?: ClassLevelPermissions): Promise; /** * Collection tier definitions for community vs premium editions. * * RxDB free tier limits databases to 13 collections. This module defines * which collections are included in the community (free) tier and provides * a selector function used by host apps at database initialization time. */ /** * Collections included in the free community edition (max 13 for RxDB free tier). * * These cover core project management, document storage, team collaboration, * and the schema/record system needed for virtual collection support. */ declare const COMMUNITY_COLLECTIONS: readonly ["orgs", "users", "workspaces", "projects", "milestones", "tasks", "documents", "discussions", "teammembers", "schemas", "records", "goals", "templates"]; type CommunityCollectionName = (typeof COMMUNITY_COLLECTIONS)[number]; /** * All 32 core collection names across both community and premium tiers. */ declare const ALL_COLLECTION_NAMES: readonly ["orgs", "users", "workspaces", "projects", "milestones", "tasks", "documents", "discussions", "teammembers", "schemas", "records", "goals", "templates", "appsnapshots", "approvals", "activities", "attributes", "codebases", "conversations", "messages", "processexecutions", "processes", "processsteps", "steptemplates", "relations", "rolememberships", "roles", "servicekeys", "timeentries", "vaultitems", "vaults", "workers"]; type CollectionName = (typeof ALL_COLLECTION_NAMES)[number]; /** * Build per-collection mode map based on premium status. * * - Premium: all 32 collections → 'local' (empty map, defaultMode handles it) * - Community: 13 community collections → 'local', remaining 19 → 'remote' */ declare function buildCollectionModes(premium: boolean): Record; /** * Select collections for the active tier. * * @param allCollections - Full collection map (all 32 collections) * @param premium - Whether premium edition is active * @returns Filtered collection map (13 for free, all for premium) */ declare function getCollectionsForTier(allCollections: Record, premium: boolean): Record; /** * Query key factory for @tanstack/react-query cache management. * * Follows the query key factory pattern so that cache invalidation * can target all queries for a collection, a specific query shape, * or a single document. */ declare const collectionKeys: { all: (name: string) => readonly [string]; query: (name: string, params: D1QueryParams) => readonly [string, "query", D1QueryParams]; get: (name: string, ids: string[]) => readonly [string, "get", string[]]; single: (name: string, id: string) => readonly [string, "single", string]; }; declare const generateActivityId: () => string; declare const collections: { [Collection$i.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; capturedBy: { type: string; maxLength: number; }; capturedAt: { type: string; maxLength: number; format: string; }; appId: { type: string; maxLength: number; }; snapshotType: { type: string; maxLength: number; }; name: { type: string; maxLength: number; }; period: { type: string; maxLength: number; }; periodType: { type: string; maxLength: number; }; notes: { type: string; maxLength: number; }; summary: { type: string; }; data: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$l.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; projectId: { type: string; maxLength: number; }; milestoneId: { type: string; maxLength: number; }; taskId: { type: string; maxLength: number; }; documentId: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; type: { type: string; maxLength: number; }; category: { type: string; maxLength: number; }; categoryName: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; documentType: { type: string; maxLength: number; }; documentContent: { type: string; maxLength: number; }; response: { type: string; maxLength: number; }; annotations: { type: string; maxLength: number; }; comments: { type: string; maxLength: number; }; respondedAt: { type: string; maxLength: number; format: string; }; approverId: { type: string; maxLength: number; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$g.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; entityType: { type: string; maxLength: number; }; entityId: { type: string; maxLength: number; }; content: { type: string; maxLength: number; }; contentHtml: { type: string; maxLength: number; }; parentId: { type: string; maxLength: number; }; threadDepth: { type: string; }; isEdited: { type: string; }; editedAt: { type: string; maxLength: number; format: string; }; isDeleted: { type: string; }; deletedAt: { type: string; maxLength: number; format: string; }; userName: { type: string; maxLength: number; }; userAvatar: { type: string; maxLength: number; }; attachments: { type: string; items: { type: string; properties: { id: { type: string; }; name: { type: string; }; size: { type: string; }; type: { type: string; }; url: { type: string; }; uploadedAt: { type: string; format: string; }; status: { type: string; enum: string[]; }; thumbnailUrl: { type: string; }; checksum: { type: string; }; }; required: string[]; }; }; reactionCounts: { type: string; }; mentions: { type: string; items: { type: string; properties: { type: { type: string; maxLength: number; }; identifier: { type: string; maxLength: number; }; teamMemberId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; position: { type: string; minimum: number; maximum: number; multipleOf: number; }; }; required: string[]; }; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$m.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; completed: { type: string; }; status: { type: string; maxLength: number; }; sortOrder: { type: string; minimum: number; maximum: number; multipleOf: number; }; projectId: { type: string; maxLength: number; }; goalId: { type: string; maxLength: number; }; startAt: { type: string; maxLength: number; format: string; }; startedAt: { type: string; maxLength: number; format: string; }; dueAt: { type: string; maxLength: number; format: string; }; completedAt: { type: string; maxLength: number; format: string; }; archived: { type: string; }; timeBudgetHours: { type: string; }; categoryId: { type: string; maxLength: number; }; tagIds: { type: string; items: { type: string; }; }; version: { type: string; }; mentions: { type: string; items: {}; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$n.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$o.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; completed: { type: string; }; status: { type: string; maxLength: number; }; sortOrder: { type: string; minimum: number; maximum: number; multipleOf: number; }; goalId: { type: string; maxLength: number; }; startAt: { type: string; maxLength: number; format: string; }; startedAt: { type: string; maxLength: number; format: string; }; dueAt: { type: string; maxLength: number; format: string; }; completedAt: { type: string; maxLength: number; format: string; }; archived: { type: string; }; codebaseId: { type: string; maxLength: number; }; sourceTemplateId: { type: string; maxLength: number; }; timeBudgetHours: { type: string; }; categoryId: { type: string; maxLength: number; }; tagIds: { type: string; items: { type: string; }; }; productId: { type: string; maxLength: number; }; roadmapId: { type: string; maxLength: number; }; initiativeId: { type: string; maxLength: number; }; version: { type: string; }; mentions: { type: string; items: {}; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$p.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; projectId: { type: string; maxLength: number; }; milestoneId: { type: string; maxLength: number; }; taskId: { type: string; maxLength: number; }; codebaseId: { type: string; maxLength: number; }; documentType: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; content: { type: string; maxLength: number; }; storage: { type: string; }; documentVersion: { type: string; }; approved: { type: string; }; approvedAt: { type: string; maxLength: number; }; approvedBy: { type: string; maxLength: number; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$q.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; dueAt: { type: string; maxLength: number; format: string; }; startAt: { type: string; maxLength: number; format: string; }; startedAt: { type: string; maxLength: number; format: string; }; completedAt: { type: string; maxLength: number; format: string; }; status: { type: string; maxLength: number; default: string; }; type: { type: string; maxLength: number; }; completed: { type: string; }; projectId: { type: string; maxLength: number; }; milestoneId: { type: string; maxLength: number; }; parentTaskId: { type: string; maxLength: number; }; archived: { type: string; }; timeBudgetHours: { type: string; }; isRecurring: { type: string; }; recurrenceRule: { type: string; maxLength: number; }; parentRecurrenceId: { type: string; maxLength: number; }; recurrenceInstanceDate: { type: string; maxLength: number; format: string; }; categoryId: { type: string; maxLength: number; }; tagIds: { type: string; items: { type: string; }; }; priority: { type: string; minimum: number; maximum: number; multipleOf: number; }; assigneeId: { type: string; maxLength: number; }; estimatePoints: { type: string; minimum: number; maximum: number; multipleOf: number; }; sortOrder: { type: string; minimum: number; maximum: number; multipleOf: number; }; version: { type: string; minimum: number; maximum: number; multipleOf: number; }; mentions: { type: string; items: {}; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$r.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; templateType: { type: string; maxLength: number; }; name: { type: string; maxLength: number; }; content: { type: string; maxLength: number; }; version: { type: string; maxLength: number; }; isDefault: { type: string; }; data: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$s.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; email: { type: string; maxLength: number; }; authUserId: { type: string; maxLength: number; }; timezone: { type: string; maxLength: number; }; archived: { type: string; }; onboarded: { type: string; }; avatarUrl: { type: string; maxLength: number; }; role: { type: string; maxLength: number; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$t.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; tags: { type: string; items: { type: string; }; }; status: { type: string; maxLength: number; }; archivedAt: { type: string; maxLength: number; format: string; }; archived: { type: string; }; icon: { type: string; maxLength: number; }; color: { type: string; maxLength: number; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$f.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; icon: { type: string; maxLength: number; }; category: { type: string; maxLength: number; }; target: { type: string; maxLength: number; }; fields: { type: string; items: { type: string; }; }; titleField: { type: string; maxLength: number; }; defaultSort: { type: string; }; ownerPluginId: { type: string; maxLength: number; }; builtIn: { type: string; }; version: { type: string; minimum: number; maximum: number; multipleOf: number; }; archived: { type: string; }; classLevelPermissions: { type: string; }; encryptedFields: { type: string; items: { type: string; }; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$e.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; schemaId: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; parentId: { type: string; maxLength: number; }; parentCollection: { type: string; maxLength: number; }; data: { type: string; }; archived: { type: string; }; completed: { type: string; }; completedAt: { type: string; maxLength: number; format: string; }; startedAt: { type: string; maxLength: number; format: string; }; sortOrder: { type: string; minimum: number; maximum: number; multipleOf: number; }; assigneeId: { type: string; maxLength: number; }; priority: { type: string; minimum: number; maximum: number; multipleOf: number; }; dueAt: { type: string; maxLength: number; format: string; }; amount: { type: string; minimum: number; maximum: number; multipleOf: number; }; version: { type: string; minimum: number; maximum: number; multipleOf: number; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$d.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; sourceId: { type: string; maxLength: number; }; sourceCollection: { type: string; maxLength: number; }; sourceSchemaId: { type: string; maxLength: number; }; targetId: { type: string; maxLength: number; }; targetCollection: { type: string; maxLength: number; }; targetSchemaId: { type: string; maxLength: number; }; relationType: { type: string; maxLength: number; }; data: { type: string; }; sortOrder: { type: string; minimum: number; maximum: number; multipleOf: number; }; label: { type: string; maxLength: number; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$c.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; icon: { type: string; maxLength: number; }; encryptedVaultKey: { type: string; maxLength: number; }; shared: { type: string; }; keyVersion: { type: string; minimum: number; maximum: number; multipleOf: number; }; rotationPending: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$b.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; vaultId: { type: string; maxLength: number; }; name: { type: string; maxLength: number; }; type: { type: string; maxLength: number; }; provider: { type: string; maxLength: number; }; encryptedPayload: { type: string; maxLength: number; }; iv: { type: string; maxLength: number; }; authTag: { type: string; maxLength: number; }; keyWraps: { type: string; items: {}; }; keyVersion: { type: string; }; url: { type: string; maxLength: number; }; tags: { type: string; items: { type: string; }; }; notes: { type: string; maxLength: number; }; expiresAt: { type: string; maxLength: number; format: string; }; lastRotatedAt: { type: string; maxLength: number; }; lastAccessedAt: { type: string; maxLength: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$a.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; serviceName: { type: string; maxLength: number; }; publicKey: { type: string; maxLength: number; }; fingerprint: { type: string; maxLength: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$9.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; lastHeartbeat: { type: string; maxLength: number; format: string; }; currentExecutionId: { type: string; maxLength: number; }; capabilities: { type: string; items: { type: string; }; }; mode: { type: string; maxLength: number; }; hostname: { type: string; maxLength: number; }; ip: { type: string; maxLength: number; }; healthPort: { type: string; minimum: number; maximum: number; multipleOf: number; }; maxConcurrent: { type: string; minimum: number; maximum: number; multipleOf: number; }; pollIntervalMs: { type: string; minimum: number; maximum: number; multipleOf: number; }; registeredAt: { type: string; maxLength: number; format: string; }; registeredBy: { type: string; maxLength: number; }; version: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$8.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; color: { type: string; maxLength: number; }; entityType: { type: string; maxLength: number; }; type: { type: string; maxLength: number; }; sortOrder: { type: string; minimum: number; maximum: number; multipleOf: number; }; popularity: { type: string; minimum: number; maximum: number; multipleOf: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$7.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; entityType: { type: string; maxLength: number; }; entityId: { type: string; maxLength: number; }; entityName: { type: string; maxLength: number; }; action: { type: string; maxLength: number; }; userName: { type: string; maxLength: number; }; productId: { type: string; maxLength: number; }; changes: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$6.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; userName: { type: string; maxLength: number; }; slug: { type: string; maxLength: number; }; userEmail: { type: string; maxLength: number; }; userAvatar: { type: string; maxLength: number; }; role: { type: string; maxLength: number; }; isAgent: { type: string; }; joinedAt: { type: string; maxLength: number; }; raciAssignments: { type: string; }; productId: { type: string; maxLength: number; }; tenantId: { type: string; maxLength: number; }; lastHeartbeat: { type: string; maxLength: number; format: string; }; containerStatus: { type: string; maxLength: number; enum: string[]; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$5.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; taskId: { type: string; maxLength: number; }; startAt: { type: string; maxLength: number; format: string; }; endAt: { type: string; maxLength: number; }; duration: { type: string; minimum: number; maximum: number; multipleOf: number; }; categoryId: { type: string; maxLength: number; }; tagIds: { type: string; items: { type: string; }; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$k.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; title: { type: string; maxLength: number; }; provider: { type: string; maxLength: number; }; model: { type: string; maxLength: number; }; settings: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$j.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; conversationId: { type: string; maxLength: number; }; role: { type: string; maxLength: number; }; content: { type: string; maxLength: number; }; toolCalls: { type: string; items: {}; }; mentions: { type: string; items: { type: string; properties: { type: { type: string; maxLength: number; }; identifier: { type: string; maxLength: number; }; teamMemberId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; position: { type: string; minimum: number; maximum: number; multipleOf: number; }; }; required: string[]; }; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$4.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; priority: { type: string; maxLength: number; }; category: { type: string; maxLength: number; }; progressMode: { type: string; maxLength: number; }; currentProgress: { type: string; minimum: number; maximum: number; multipleOf: number; }; completed: { type: string; }; dueDate: { type: string; maxLength: number; }; targetDate: { type: string; maxLength: number; }; parentGoalId: { type: string; maxLength: number; }; metrics: { type: string; items: {}; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$h.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; repository: { type: string; }; environment: { type: string; }; deployment: { type: string; }; agentWorkflow: { type: string; }; tags: { type: string; items: { type: string; }; }; status: { type: string; maxLength: number; }; archivedAt: { type: string; maxLength: number; format: string; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; gitProvider: { type: string; maxLength: number; }; gitNamespace: { type: string; maxLength: number; }; gitRepo: { type: string; maxLength: number; }; gitRepoId: { type: string; maxLength: number; }; gitDefaultBranch: { type: string; maxLength: number; }; gitConnectionId: { type: string; maxLength: number; }; gitVisibility: { type: string; maxLength: number; }; gitPushedAt: { type: string; maxLength: number; }; gitWebUrl: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$3.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; version: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; category: { type: string; maxLength: number; }; startStepId: { type: string; maxLength: number; }; documentId: { type: string; maxLength: number; }; flowId: { type: string; maxLength: number; }; trigger: { type: string; }; inputSchema: { type: string; }; outputSchema: { type: string; }; executionConfig: { type: string; }; maxSubprocessDepth: { type: string; }; executorAgentId: { type: string; maxLength: number; }; statistics: { type: string; }; requiredCapabilities: { type: string; items: { type: string; }; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$2.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; processId: { type: string; maxLength: number; }; processVersion: { type: string; maxLength: number; }; status: { type: string; maxLength: number; }; progress: { type: string; minimum: number; maximum: number; multipleOf: number; }; currentStepId: { type: string; maxLength: number; }; startedAt: { type: string; maxLength: number; format: string; }; completedAt: { type: string; maxLength: number; format: string; }; durationMs: { type: string; minimum: number; maximum: number; multipleOf: number; }; retryCount: { type: string; minimum: number; maximum: number; multipleOf: number; }; maxRetries: { type: string; minimum: number; maximum: number; multipleOf: number; }; inputs: { type: string; }; outputs: { type: string; }; variables: { type: string; }; context: { type: string; }; stepHistory: { type: string; items: {}; }; error: { type: string; }; correlationId: { type: string; maxLength: number; }; externalId: { type: string; maxLength: number; }; parentExecutionId: { type: string; maxLength: number; }; depth: { type: string; minimum: number; maximum: number; multipleOf: number; }; resumeAt: { type: string; maxLength: number; format: string; }; workerId: { type: string; maxLength: number; }; processName: { type: string; maxLength: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$1.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; processId: { type: string; maxLength: number; }; templateId: { type: string; maxLength: number; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; stepType: { type: string; maxLength: number; }; order: { type: string; minimum: number; maximum: number; multipleOf: number; }; optional: { type: string; }; enabled: { type: string; }; nextStepId: { type: string; maxLength: number; }; action: { type: string; }; conditions: { type: string; items: { type: string; }; }; outputs: { type: string; items: { type: string; }; }; outputExtraction: { type: string; }; inputs: { type: string; }; requiredVariables: { type: string; items: { type: string; }; }; position: { type: string; }; estimatedDurationMinutes: { type: string; }; icon: { type: string; maxLength: number; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; category: { type: string; maxLength: number; }; stepType: { type: string; maxLength: number; }; action: { type: string; }; inputs: { type: string; }; outputs: { type: string; }; outputExtraction: { type: string; }; requiredVariables: { type: string; items: { type: string; }; }; cli: { type: string; }; versionField: { type: string; maxLength: number; }; tags: { type: string; items: { type: string; }; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$u.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; name: { type: string; maxLength: number; }; title: { type: string; maxLength: number; }; description: { type: string; maxLength: number; }; scopeType: { type: string; maxLength: number; }; scopeId: { type: string; maxLength: number; }; builtIn: { type: string; }; archived: { type: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; [Collection$v.name]: { name: string; schema: { title: string; version: number; primaryKey: string; type: string; properties: { id: { type: string; maxLength: number; }; orgId: { type: string; maxLength: number; }; workspaceId: { type: string; maxLength: number; }; userId: { type: string; maxLength: number; }; createdAt: { type: string; maxLength: number; format: string; }; updatedAt: { type: string; maxLength: number; format: string; }; metadata: { type: string; }; extended: { type: string; }; roleId: { type: string; maxLength: number; }; grantedBy: { type: string; maxLength: number; }; scopeType: { type: string; maxLength: number; }; scopeId: { type: string; maxLength: number; }; status: { type: string; maxLength: number; default: string; }; expiresAt: { type: string; maxLength: number; format: string; }; tenantId: { type: string; maxLength: number; }; }; required: string[]; indexes: string[][]; }; hooks: { preInsert: (doc: Record) => Record; preSave: (doc: Record, oldDoc: Record) => Record; }; migrationStrategies: {}; }; }; export { ALL_COLLECTION_NAMES, type ActivityAction, type ActivityChanges, Collection$7 as ActivityCollection, type ActivityEntityType, type ActivityInput, type ActivityModel, type AgentHierarchyCollections, type AgentHierarchyInput, type AgentHierarchyRecord, type AgentInboxCollections, type AgentInboxIdentity, type AgentInboxOpts, type AgentInboxResult, type AgentRecordSource, type AgentTaskConfig, Collection$i as AppSnapshotCollection, type AppSnapshotInput, type AppSnapshotModel, Collection$l as ApprovalCollection, type ApprovalInboxItem, type ApprovalInput, ApprovalModel, Collection$8 as AttributeCollection, type AttributeInput, type AttributeModel, type AudienceModel, type AudiencePillar, type AudienceSource, type AudienceType, type AwarenessLevel, BUILT_IN_COLLECTION_NAMES, type BranchesInput, type BudgetModel, type BusinessPlanModel, COMMUNITY_COLLECTIONS, type CampaignChannel, type CampaignContactModel, type CampaignContactStatus, type CampaignGoalType, type CampaignModel, type CampaignProductModel, type CampaignProductRole, type CampaignStatus, type CampaignType, type ClassLevelPermissions, type ClientModel, Collection$h as CodebaseCollection, type CodebaseInput, type CodebaseModel, CollectionMode, type CollectionName, type CommandConfig, type CommitsInput, type CommunityCollectionName, type CompetitorModel, type ConnectorConfigInput, type Connector_sync_runsInput, type Connector_webhook_eventsInput, type ContactModel, type ContainerConfig, type ContainerResources, type ContainerVolumeMount, type ContentFunnelModel, type ContentFunnelStageLevel, type ContentPieceMetrics, type ContentPieceModel, type ContentPieceStatus, type ContentPieceType, type ContentPillarModel, type ContentPlatform, Collection$k as ConversationCollection, type ConversationInboxItem, type ConversationInput, type ConversationMetadata, type ConversationModel, type ConversationSettings, ConversationState, type ConversionCategory, type ConversionCodeModel, D1QueryParams, DEFAULT_CLP, type DealModel, type DealProductModel, type DealProjectModel, type DealProjectRelationship, type DealStage, type DescriptionMentionInboxItem, Collection$g as DiscussionCollection, type DiscussionInput, type DiscussionModel, Collection$p as DocumentCollection, type DocumentInput, type DocumentStorageInfo, ENTITY_TO_PREFIX, EncryptedCollectionAdapter, type ExecutionContext, type FeedbackItemModel, type FeedbackSentiment, type FeedbackStatus, type FeedbackType, type FieldConfig, type FieldDefinition, type FieldRenderer, type FieldType, type FinAccountModel, type FinCategoryModel, type FinIncomeStatementModel, type FinScheduledTransactionModel, type FinTransactionModel, type FlowModel, type FlowStateEntityTrigger, type FlowStateTriggerCondition, type FunnelMetrics, type FunnelStage, type FunnelStatus, type Git_commentsInput, type Git_connectionsInput, type Git_project_linksInput, type GoalCategory, Collection$4 as GoalCollection, type GoalInput, type GoalMetric, type GoalMetricTrend, type GoalMetricType, type GoalModel, type GoalProgressMode, type GoalStatus, type GuaranteeType, type HealthScoreModel, type HealthTrend, type HookCategory, type HookSource, type HookTemplateModel, type HookVariable, ID_PREFIX_TO_COLLECTION, type InboxIdentity, type IntegrationModel, type IntegrationProductType, type IntegrationStatus, type InvoiceModel, type InvoiceStatus, type KbArticleModel, type KbArticleStatus, type KbArticleVisibility, type KpiTrend, type LeadMagnetDelivery, type LeadMagnetModel, type LeadMagnetStatus, type LeadMagnetType, type LineItemModel, type LineItemParentType, type LinkedStatementRef, type MarketAnalysisModel, type MarketSize, type MentionInboxItem, Collection$j as MessageCollection, type MessageInput, type MessageMetadata, type MessageModel, type MessagingFramework, type MigrationDependencies, type MigrationHistoryEntry, MigrationRegistry, type MigrationResult$1 as MigrationResult, type MigrationRunnerOptions, Collection$m as MilestoneCollection, type MilestoneInput, type MilestoneMetadata, MilestoneModel, type MilestoneTemplateItem, type OfferBonus, type OfferFunnelModel, type OfferFunnelStatus, type OfferFunnelType, type OfferModel, type OfferStatus, type OfferType, type OfferValueStackItem, type OfferWorksheetModel, type OfferWorksheetStatus, type OpportunityModel, Collection$n as OrgCollection, type OrgInput, type OrgMetadata, type OrgThemeModel, type OutlineSection, type OutreachTargetModel, type PartnershipModel, type PartnershipStatus, type PartnershipType, type PaymentPlanModel, type PaymentPlanStatus, type PaymentPlanType, type PaymentStatus, type PhaseHistoryEntry, type PillarCategory, type PipelineModel, type PipelineStageModel, type PipelineStageType, type ProcessExecutionConfig, type ProcessExecutionMetadata, type ProcessExecutionsModel as ProcessExecutionModel, type ProcessExecutionStatus, Collection$2 as ProcessExecutionsCollection, type ProcessExecutionsInput, type ProcessExecutionsModel, type ProcessMetadata, type ProcessesModel as ProcessModel, type ProcessSchema, type ProcessStatistics, type ProcessStepMetadata, type ProcessStepsModel as ProcessStepModel, type ProcessStepStatus, Collection$1 as ProcessStepsCollection, type ProcessStepsInput, type ProcessStepsModel, type ProcessTrigger, type ProcessTriggerType, Collection$3 as ProcessesCollection, type ProcessesInput, type ProcessesModel, type ProductGoalModel, type ProductKpi, type ProductMetadata, type ProductModel, type ProductPhase, type ProductProjectModel, type ProductProjectRole, type ProductTeamMemberModel, type ProductTeamMemberRole, type ProductType, Collection$o as ProjectCollection, type ProjectInput, type ProjectMetadata, ProjectModel, type ProjectTemplateData, type PromotionDependencies, type PromotionResult, type PullrequestsInput, type QueueBehavior, type QuoteModel, type QuoteStatus, type RaciAssignment, type RaciType, Collection$e as RecordCollection, type RecordCollection as RecordCollectionInterface, type RecordInput, type RecordModel, Collection$d as RelationCollection, type RelationInput, type RelationModel, type ReleasesInput, type ReplyInboxItem, type Review_commentsInput, type ReviewsInput, type RoadmapModel, Collection$u as RoleCollection, type RoleInput, Collection$v as RoleMembershipCollection, type RoleMembershipInput, RoleMembershipModel, RoleModel, SEED_ORG_PLACEHOLDER, SEED_WORKSPACE_PLACEHOLDER, type SagaAgentStateInput, type SagaHubPeerInput, type SagaMemoryInput, type SagaSkillInput, type SagaSyncLogInput, type SagaSystemRegistryInput, type SagaTaskSummaryInput, type ScarcityType, Collection$f as SchemaCollection, type SchemaInput, type SchemaMigration, type SchemaMigrationResult, type SchemaModel, SchemaRegistry, type SchemaTarget, type SeedBuiltInCLPResult, type SeedOptions, type SeedResult, type SeedSchema, type SelectOption, Collection$a as ServiceKeyCollection, type ServiceKeyInput, type ServiceKeyModel, type SessionContext, type SessionModel, type SessionScopeEntityType, type ShellType, type StatementPeriod, type StepAction, type StepCondition, type StepExecutionRecord, type StepOutput, type StepPosition, type StepTemplatesModel as StepTemplateModel, Collection as StepTemplatesCollection, type StepTemplatesInput, type StepTemplatesModel, type SubordinateAgentReport, type SubordinateBlockerReference, type SubordinateControlPlaneReport, type SubordinateInboxSummary, type SubordinateReportCollections, type SubordinateReportOptions, type SubordinateTeamMemberRecord, type SubprocessConfig, type SubprocessFailureStrategy, type SubtaskTemplateItem, SubtransactionSummary, type SwotAnalysis, type SyncConfigModel, type SyncFieldMapping, type TargetSegment, Collection$q as TaskCollection, type TaskInboxItem, type TaskInput, type TaskMetadata, TaskModel, type TaskTemplateItem, Collection$6 as TeamMemberCollection, type TeamMemberInput, type TeamMemberModel, type TeamMemberReportSource, type TeamMemberRole, type MigrationResult as TeamMigrationResult, type TemplateCategory, Collection$r as TemplateCollection, type TemplateInput, type TemplateItem, type TerminalConnectionStatus, type TicketModel, type TicketSeverity, type TicketSource, type TicketStatus, type TicketType, Collection$5 as TimeEntryCollection, type TimeEntryInput, type TimeEntryModel, type ToolCall, type TriggerConditionOperator, type TriggerDebounceConfig, type TriggerEntityType, type TriggerSourceEntity, type UrgencyType, Collection$s as UserCollection, type UserInboxIdentity, type UserInput, type VariablesModel, Collection$c as VaultCollection, type VaultInput, Collection$b as VaultItemCollection, type VaultItemInput, type VaultItemModel, type VaultItemType, type VaultModel, VirtualCollectionAdapter, Collection$9 as WorkerCollection, type WorkerInput, type WorkerModel, type Workflow_runsInput, Collection$t as WorkspaceCollection, type WorkspaceInput, activitySchema, allMigrations, appSnapshotSchema, approvalSchema, assertCanControl, assertCanReport, attributeSchema, branchesSchema, buildCollectionModes, codebaseSchema, collectionKeys, collections, commitsSchema, connectorConfigSchema, connector_sync_runsSchema, connector_webhook_eventsSchema, conversationSchema, coreSeeds, createId, createMigrationRegistry, deriveEncryptedFieldsConfig, discussionSchema, documentSchema, generateActivityId, getAgentInbox, getCollectionFromId, getCollectionsForTier, getDescendants, getDirectReports, getEntityTypeFromId, getInbox, getSubordinateReport, git_commentsSchema, git_connectionsSchema, git_project_linksSchema, goalSchema, messageSchema, migrateAll, migrateCollectionToRecords, migrateTeamMembersToRoleMemberships, milestoneSchema, orgSchema, processExecutionsSchema, processStepsSchema, processesSchema, projectSchema, promoteTeamMemberAgentFields, pullrequestsSchema, recordSchema, relationSchema, releasesSchema, review_commentsSchema, reviewsSchema, roleMembershipSchema, roleSchema, runMigrations, safeNanoid, sagaAgentStateSchema, sagaHubPeerSchema, sagaMemorySchema, sagaScopeSchema, sagaSkillSchema, sagaSyncLogSchema, sagaSystemRegistrySchema, sagaTaskSummarySchema, schemaSchema, seedBuiltInCLP, seedBuiltInRoles, seedSchemas, serviceKeySchema, stepTemplatesSchema, taskSchema, teamMemberSchema, templateSchema, timeEntrySchema, userSchema, vaultItemSchema, vaultSchema, workerSchema, workflow_runsSchema, workspaceSchema, wrapRxCollection };