@stndrds/schema 1.0.0-alpha.84 → 1.0.0-alpha.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { a5 as Timestamps, A as Attribute, q as AttributeType, o as RollupAttribute, K as Location, Q as LocationGranularity, S as StatusAttribute, f as SelectAttribute, M as MultiselectAttribute, P as Phone, J as Currency, m as FormulaAttribute, a8 as CompletionStatus, a6 as SharingMode, a9 as ObjectRecord, r as ObjectDefinition, v as FeatureFlagsRepository, b1 as ValidationResult, ae as PropertySchema, i as RelationAttribute, n as FormulaReturnType } from './validators-BeBrdQCB.mjs';
1
+ import { a5 as Timestamps, A as Attribute, q as AttributeType, o as RollupAttribute, K as Location, Q as LocationGranularity, S as StatusAttribute, f as SelectAttribute, M as MultiselectAttribute, P as Phone, J as Currency, m as FormulaAttribute, a8 as CompletionStatus, a6 as SharingMode, a9 as ObjectRecord, r as ObjectDefinition, v as FeatureFlagsRepository, b3 as ValidationResult, ae as PropertySchema, i as RelationAttribute, n as FormulaReturnType } from './validators-CJmtOk1a.mjs';
2
2
  import { MimeType, ColorId, IconName, CountryIso3 } from '@stndrds/constants';
3
3
  import { Uuid, TenantId, UserId } from './utils.mjs';
4
4
  import { JWTPayload } from 'jose';
@@ -1164,6 +1164,17 @@ interface FlowSlot {
1164
1164
  /** Optional icon */
1165
1165
  icon?: IconName;
1166
1166
  }
1167
+ /**
1168
+ * Configuration for relation fields in workflow/flow forms.
1169
+ * Controls which qualified properties are visible and whether
1170
+ * inline record creation is allowed.
1171
+ */
1172
+ interface RelationFieldConfig {
1173
+ /** Which qualified properties to display (all if omitted) */
1174
+ visibleProperties?: string[];
1175
+ /** Allow creating new target records inline (default: true) */
1176
+ allowCreate?: boolean;
1177
+ }
1167
1178
  /**
1168
1179
  * Field within a row (simplified - no span, auto-calculated)
1169
1180
  */
@@ -1180,6 +1191,8 @@ interface FlowRowField {
1180
1191
  tooltip?: string;
1181
1192
  /** Override required */
1182
1193
  required?: boolean;
1194
+ /** Relation-specific configuration (only for relation attributes) */
1195
+ relationConfig?: RelationFieldConfig;
1183
1196
  }
1184
1197
  /**
1185
1198
  * Row type discriminator.
@@ -2299,6 +2312,8 @@ interface FormFieldRef {
2299
2312
  slotId: string;
2300
2313
  /** Attribute name on the object */
2301
2314
  attribute: string;
2315
+ /** Relation-specific config (only for relation attributes) */
2316
+ relationConfig?: RelationFieldConfig;
2302
2317
  }
2303
2318
  /**
2304
2319
  * Check if a FormNode uses simple mode (fields array)
@@ -2401,6 +2416,86 @@ interface AssignNode extends BaseNode {
2401
2416
  assignments: AssignmentMapping[];
2402
2417
  next?: string | null;
2403
2418
  }
2419
+ /**
2420
+ * AI action config — discriminated union for different AI capabilities.
2421
+ *
2422
+ * @example Document generation
2423
+ * ```typescript
2424
+ * const action: AIActionConfig = {
2425
+ * type: "document-generation",
2426
+ * templateId: "template-contract-v1",
2427
+ * inputSlotIds: ["client", "company"],
2428
+ * targetSlotIds: ["client"],
2429
+ * outputFormat: "pdf",
2430
+ * aiInstructions: "Generate a professional contract",
2431
+ * };
2432
+ * ```
2433
+ */
2434
+ type AIActionConfig = DocumentGenerationAction | CodeExecutionAction;
2435
+ /**
2436
+ * AI action type discriminant
2437
+ */
2438
+ type AIActionType = AIActionConfig["type"];
2439
+ /**
2440
+ * Generate a document (PDF/DOCX) from a template using an AI agent session.
2441
+ */
2442
+ interface DocumentGenerationAction {
2443
+ type: "document-generation";
2444
+ /** File ID of the uploaded DOCX template in storage */
2445
+ templateId: string;
2446
+ /** Slots whose data is context for the AI */
2447
+ inputSlotIds: string[];
2448
+ /** Slots to attach the generated document to */
2449
+ targetSlotIds: string[];
2450
+ /** Output format */
2451
+ outputFormat: "pdf" | "docx";
2452
+ /** Instructions for the AI agent on how to generate content */
2453
+ aiInstructions?: string;
2454
+ }
2455
+ /**
2456
+ * Execute code in a sandbox without AI (mode "code").
2457
+ */
2458
+ interface CodeExecutionAction {
2459
+ type: "code-execution";
2460
+ /** Code to execute (may contain Mustache expressions resolved from slots) */
2461
+ code: string;
2462
+ language: "javascript" | "typescript" | "python";
2463
+ /** Slots injected as JSON environment variables */
2464
+ inputSlotIds?: string[];
2465
+ /** Variable name to capture stdout into the execution context */
2466
+ outputVariable?: string;
2467
+ /** Packages to install before execution */
2468
+ packages?: string[];
2469
+ }
2470
+ /**
2471
+ * AI node — runs an AI action (document generation, code execution, etc.)
2472
+ *
2473
+ * @example
2474
+ * ```typescript
2475
+ * const node: AINode = {
2476
+ * type: "ai",
2477
+ * id: "generate-contract",
2478
+ * label: "Generate Contract",
2479
+ * action: {
2480
+ * type: "document-generation",
2481
+ * templateId: "template-contract-v1",
2482
+ * inputSlotIds: ["client", "company"],
2483
+ * targetSlotIds: ["client"],
2484
+ * outputFormat: "pdf",
2485
+ * },
2486
+ * next: "end-success",
2487
+ * };
2488
+ * ```
2489
+ */
2490
+ interface AINode extends BaseNode {
2491
+ type: "ai";
2492
+ label: string;
2493
+ description?: string;
2494
+ action: AIActionConfig;
2495
+ /** Timeout in milliseconds (default: 120_000) */
2496
+ timeoutMs?: number;
2497
+ next?: string | null;
2498
+ }
2404
2499
  /**
2405
2500
  * Terminal node marking the end of a workflow path.
2406
2501
  * A workflow can have multiple EndNodes for different outcomes.
@@ -2436,7 +2531,7 @@ interface EndNode extends BaseNode {
2436
2531
  * Union of all workflow node types.
2437
2532
  * Use discriminated union on `type` field for type narrowing.
2438
2533
  */
2439
- type WorkflowNode = StartNode | FormNode | ConditionNode | AssignNode | EndNode;
2534
+ type WorkflowNode = StartNode | FormNode | ConditionNode | AssignNode | AINode | EndNode;
2440
2535
  /**
2441
2536
  * All possible node types
2442
2537
  */
@@ -2457,6 +2552,10 @@ declare function isConditionNode(node: WorkflowNode): node is ConditionNode;
2457
2552
  * Check if a node is an AssignNode
2458
2553
  */
2459
2554
  declare function isAssignNode(node: WorkflowNode): node is AssignNode;
2555
+ /**
2556
+ * Check if a node is an AINode
2557
+ */
2558
+ declare function isAINode(node: WorkflowNode): node is AINode;
2460
2559
  /**
2461
2560
  * Check if a node is an EndNode
2462
2561
  */
@@ -3131,6 +3230,12 @@ interface ListViewTab {
3131
3230
  cardUserAttribute?: string;
3132
3231
  /** Date attribute to display on kanban cards (bottom-right) */
3133
3232
  cardDateAttribute?: string;
3233
+ /** Order of kanban columns (by option value) - for kanban layout only */
3234
+ kanbanColumnOrder?: string[];
3235
+ /** Visibility of kanban columns (by option value) - for kanban layout only */
3236
+ kanbanColumnVisibility?: Record<string, boolean>;
3237
+ /** Pinned kanban columns (by option value) - for kanban layout only */
3238
+ kanbanPinnedColumns?: string[];
3134
3239
  }
3135
3240
  /**
3136
3241
  * Configuration for the side panel displayed alongside tab content.
@@ -3561,6 +3666,8 @@ interface FormFieldContext {
3561
3666
  labelOverride?: string;
3562
3667
  /** Override tooltip/description (from FlowRowField.tooltip) */
3563
3668
  tooltipOverride?: string;
3669
+ /** Relation-specific configuration from workflow builder */
3670
+ relationConfig?: RelationFieldConfig;
3564
3671
  }
3565
3672
  /**
3566
3673
  * Standard row of form fields
@@ -4248,6 +4355,93 @@ declare class PolicyViolationError extends Error {
4248
4355
  constructor(objectName: string, action: "read" | "update" | "delete", recordId?: string | undefined);
4249
4356
  }
4250
4357
 
4358
+ /**
4359
+ * Sandbox execution mode.
4360
+ * - "code": Execute a snippet in isolation (fast, deterministic, no AI)
4361
+ * - "agent": AI agent iterates in a full environment (slower, AI-driven)
4362
+ */
4363
+ type SandboxMode = "code" | "agent";
4364
+ /**
4365
+ * Lifecycle status of a sandbox execution.
4366
+ */
4367
+ type SandboxExecutionStatus = "pending" | "running" | "completed" | "failed" | "timeout" | "cancelled";
4368
+ /**
4369
+ * What triggered the sandbox execution.
4370
+ */
4371
+ interface SandboxTrigger {
4372
+ source: "workflow" | "conversation" | "api";
4373
+ sourceId?: string;
4374
+ metadata?: Record<string, unknown>;
4375
+ }
4376
+ /**
4377
+ * Input configuration for a sandbox execution.
4378
+ */
4379
+ interface SandboxExecutionInput {
4380
+ /** Code to execute (mode "code") */
4381
+ code?: string;
4382
+ /** Instructions for the AI agent (mode "agent") */
4383
+ instructions?: string;
4384
+ /** E2B template (e.g. "node-20", "python-3.11", "stndrds-pdf") */
4385
+ template?: string;
4386
+ /** Environment variables */
4387
+ env?: Record<string, string>;
4388
+ /** Files to inject (references to file IDs in storage) */
4389
+ files?: Array<{
4390
+ path: string;
4391
+ fileId: string;
4392
+ }>;
4393
+ }
4394
+ /**
4395
+ * Result of a sandbox execution.
4396
+ */
4397
+ interface SandboxExecutionResult {
4398
+ stdout?: string;
4399
+ stderr?: string;
4400
+ exitCode?: number;
4401
+ /** File IDs of produced artifacts (stored in files table) */
4402
+ artifactFileIds?: string[];
4403
+ /** Summary of what the agent did (mode "agent") */
4404
+ agentSummary?: string;
4405
+ }
4406
+ /**
4407
+ * Persistent sandbox execution record.
4408
+ * Tracks lifecycle, cost, and results of sandbox runs.
4409
+ */
4410
+ interface SandboxExecution {
4411
+ id: string;
4412
+ tenantId: string;
4413
+ mode: SandboxMode;
4414
+ /** Provider sandbox ID (e.g. E2B sandbox ID), set once sandbox starts */
4415
+ providerSandboxId: string | null;
4416
+ status: SandboxExecutionStatus;
4417
+ triggeredBy: SandboxTrigger;
4418
+ input: SandboxExecutionInput;
4419
+ result: SandboxExecutionResult | null;
4420
+ error: string | null;
4421
+ /** Duration in milliseconds */
4422
+ durationMs: number | null;
4423
+ /** Tokens consumed by AI (mode "agent") */
4424
+ tokenCount: number | null;
4425
+ /** Compute cost in USD (sandbox provider) */
4426
+ computeCost: number | null;
4427
+ /** AI cost in USD (LLM calls, mode "agent") */
4428
+ aiCost: number | null;
4429
+ startedBy: string | null;
4430
+ startedAt: Date | null;
4431
+ completedAt: Date | null;
4432
+ /** Hard timeout: sandbox killed after this time */
4433
+ expiresAt: Date | null;
4434
+ createdAt: Date;
4435
+ updatedAt: Date;
4436
+ }
4437
+ interface CreateSandboxExecution {
4438
+ mode: SandboxMode;
4439
+ triggeredBy: SandboxTrigger;
4440
+ input: SandboxExecutionInput;
4441
+ startedBy?: string;
4442
+ expiresAt?: Date;
4443
+ }
4444
+
4251
4445
  /**
4252
4446
  * User status for account management
4253
4447
  */
@@ -5710,6 +5904,48 @@ interface RelationAttributesRepository {
5710
5904
  deleteByTarget(toId: Uuid): Promise<void>;
5711
5905
  }
5712
5906
 
5907
+ /**
5908
+ * Repository for sandbox execution records.
5909
+ *
5910
+ * This repository is optional — if not provided in the DatabaseAdapter,
5911
+ * sandbox execution tracking is disabled.
5912
+ */
5913
+ interface SandboxExecutionsRepository {
5914
+ create(data: CreateSandboxExecution): Promise<SandboxExecution>;
5915
+ /**
5916
+ * Atomically create an execution only if the tenant is under the concurrency limit.
5917
+ * Returns null if the limit is reached (no race condition).
5918
+ */
5919
+ createIfUnderLimit(data: CreateSandboxExecution, maxConcurrent: number): Promise<SandboxExecution | null>;
5920
+ findById(id: string): Promise<SandboxExecution | null>;
5921
+ findByProviderSandboxId(providerSandboxId: string): Promise<SandboxExecution | null>;
5922
+ markRunning(id: string, providerSandboxId: string): Promise<SandboxExecution>;
5923
+ markCompleted(id: string, result: SandboxExecutionResult, durationMs: number): Promise<SandboxExecution>;
5924
+ markFailed(id: string, error: string): Promise<SandboxExecution>;
5925
+ markTimeout(id: string): Promise<SandboxExecution>;
5926
+ cancel(id: string): Promise<SandboxExecution>;
5927
+ /** Count currently running sandboxes for the tenant */
5928
+ countRunning(): Promise<number>;
5929
+ /** Find executions past their expiration time */
5930
+ findExpired(): Promise<SandboxExecution[]>;
5931
+ list(options?: {
5932
+ limit?: number;
5933
+ offset?: number;
5934
+ status?: SandboxExecutionStatus;
5935
+ mode?: SandboxMode;
5936
+ }): Promise<{
5937
+ executions: SandboxExecution[];
5938
+ total: number;
5939
+ }>;
5940
+ /** Aggregate costs for a tenant over a date range */
5941
+ getCostByDateRange(startDate: Date, endDate: Date): Promise<{
5942
+ executionCount: number;
5943
+ totalComputeCost: number;
5944
+ totalAiCost: number;
5945
+ totalDurationMs: number;
5946
+ }>;
5947
+ }
5948
+
5713
5949
  /** Attribute types that support sorting in search engines. */
5714
5950
  declare const SORTABLE_ATTRIBUTE_TYPES: ReadonlySet<string>;
5715
5951
  /**
@@ -6009,6 +6245,7 @@ interface DatabaseAdapter {
6009
6245
  documentSlots?: DocumentSlotsRepository;
6010
6246
  documentJobs?: DocumentJobsRepository;
6011
6247
  relationAttributes?: RelationAttributesRepository;
6248
+ sandboxExecutions?: SandboxExecutionsRepository;
6012
6249
  featureFlags?: FeatureFlagsRepository;
6013
6250
  search?: SearchAdapter;
6014
6251
  transaction<T>(callback: (adapter: DatabaseAdapter) => Promise<T>): Promise<T>;
@@ -7047,6 +7284,21 @@ declare class PermissionService extends BaseService {
7047
7284
  * Revoke a role from a user.
7048
7285
  */
7049
7286
  revokeRole(userProfileId: string, roleId: string): Promise<void>;
7287
+ /**
7288
+ * Reset all roles and permissions to their default configuration.
7289
+ *
7290
+ * This will:
7291
+ * 1. Delete all custom (non-system) roles and reassign their users to the default member role
7292
+ * 2. Reset permissions on the default roles (owner, member) back to defaults
7293
+ * 3. Invalidate all permission caches
7294
+ *
7295
+ * @example
7296
+ * ```typescript
7297
+ * const service = new PermissionService(adapter);
7298
+ * await service.resetToDefaults();
7299
+ * ```
7300
+ */
7301
+ resetToDefaults(): Promise<void>;
7050
7302
  /**
7051
7303
  * Initialize default roles for the tenant if they don't exist.
7052
7304
  *
@@ -9741,160 +9993,538 @@ declare class AssignExecutor implements NodeExecutor<AssignNode> {
9741
9993
  }
9742
9994
 
9743
9995
  /**
9744
- * Executor for StartNode.
9745
- * Simply transitions to the next node.
9746
- */
9747
- declare class StartExecutor implements NodeExecutor<StartNode> {
9748
- readonly nodeType: "start";
9749
- execute(node: StartNode, _context: ExecutorContext): ExecutorResult;
9750
- canExecute(_node: StartNode, _context: ExecutorContext): boolean;
9751
- validate(node: StartNode): string[];
9752
- }
9753
-
9754
- /**
9755
- * Create a default executor registry with all core executors registered
9756
- */
9757
- declare function createDefaultExecutorRegistry(): ExecutorRegistry;
9758
- /**
9759
- * Get the default executor registry (singleton)
9760
- */
9761
- declare function getDefaultExecutorRegistry(): ExecutorRegistry;
9762
-
9763
- /**
9764
- * Result of formula evaluation
9996
+ * Result from an AI action handler.
9765
9997
  */
9766
- interface FormulaResult {
9767
- /** Computed value (null if error) */
9768
- value: unknown;
9769
- /** Error message if evaluation failed */
9998
+ interface AIActionResult {
9999
+ success: boolean;
10000
+ /** Context updates to merge into workflow execution context */
10001
+ contextUpdates?: Record<string, unknown>;
10002
+ /** Error message if not successful */
9770
10003
  error?: string;
9771
10004
  }
9772
10005
  /**
9773
- * Evaluate a formula expression against record values
9774
- *
9775
- * @param expression - Formula expression (e.g., "price * quantity")
9776
- * @param values - Record values to use as variables
9777
- * @returns Computed value or null on error
9778
- *
9779
- * @example
9780
- * ```typescript
9781
- * const result = evaluateFormula("price * quantity", { price: 10, quantity: 5 });
9782
- * // → 50
9783
- *
9784
- * const greeting = evaluateFormula("CONCAT('Hello, ', name)", { name: "World" });
9785
- * // → "Hello, World"
9786
- * ```
9787
- */
9788
- declare function evaluateFormula(expression: string, values: Record<string, unknown>): unknown;
9789
- /**
9790
- * Evaluate a formula with detailed result including error info
9791
- *
9792
- * @param expression - Formula expression
9793
- * @param values - Record values
9794
- * @returns Result object with value and optional error
9795
- */
9796
- declare function evaluateFormulaWithResult(expression: string, values: Record<string, unknown>): FormulaResult;
9797
- /**
9798
- * Format a formula result based on return type
9799
- *
9800
- * @param value - Raw computed value
9801
- * @param returnType - Expected return type
9802
- * @param decimals - Decimal places for numbers
9803
- * @returns Formatted value
9804
- */
9805
- declare function formatFormulaResult(value: unknown, returnType: FormulaReturnType, decimals?: number): unknown;
9806
- /**
9807
- * Evaluate a formula attribute and return formatted result
9808
- *
9809
- * @param attr - Formula attribute definition
9810
- * @param values - Record values
9811
- * @returns Formatted computed value
9812
- */
9813
- declare function evaluateFormulaAttribute(attr: FormulaAttribute, values: Record<string, unknown>): unknown;
9814
- /**
9815
- * Validate a formula expression syntax without evaluating
9816
- *
9817
- * @param expression - Formula expression to validate
9818
- * @returns Object with valid flag and optional error message
9819
- */
9820
- declare function validateFormulaExpression(expression: string): {
9821
- valid: boolean;
9822
- error?: string;
9823
- };
9824
- /**
9825
- * Extract variable names referenced in a formula expression
9826
- *
9827
- * @param expression - Formula expression
9828
- * @returns Array of variable names
10006
+ * Abstract sandbox executor decouples handlers from the AI package.
10007
+ * Implemented by SandboxService in the AI package, injected via DI.
9829
10008
  */
9830
- declare function extractFormulaVariables(expression: string): string[];
10009
+ interface SandboxExecutor {
10010
+ /**
10011
+ * Execute code in a sandbox (no AI agent).
10012
+ */
10013
+ executeCode(input: CodeExecutionInput): Promise<CodeExecutionOutput>;
10014
+ /**
10015
+ * Run an AI agent session inside a sandbox.
10016
+ */
10017
+ executeAgent(input: AgentExecutionInput): Promise<AgentExecutionOutput>;
10018
+ }
10019
+ interface CodeExecutionInput {
10020
+ code: string;
10021
+ language: "javascript" | "typescript" | "python";
10022
+ env?: Record<string, string>;
10023
+ packages?: string[];
10024
+ timeoutMs?: number;
10025
+ }
10026
+ interface CodeExecutionOutput {
10027
+ stdout: string;
10028
+ stderr: string;
10029
+ exitCode: number;
10030
+ }
10031
+ interface AgentExecutionInput {
10032
+ instructions: string;
10033
+ /** Skill context injected into agent system prompt */
10034
+ skillContext?: string;
10035
+ /** Files to inject before agent starts */
10036
+ inputFiles?: Array<{
10037
+ path: string;
10038
+ content: string | Uint8Array;
10039
+ }>;
10040
+ /** Paths to retrieve as artifacts after agent finishes */
10041
+ expectedOutputs?: string[];
10042
+ /** E2B template (default: "stndrds-pdf") */
10043
+ template?: string;
10044
+ timeoutMs?: number;
10045
+ maxIterations?: number;
10046
+ }
10047
+ interface AgentExecutionOutput {
10048
+ success: boolean;
10049
+ /** Produced artifact files */
10050
+ artifacts: Array<{
10051
+ path: string;
10052
+ data: Uint8Array;
10053
+ mimeType: string;
10054
+ }>;
10055
+ /** Summary of agent actions */
10056
+ summary?: string;
10057
+ /** Token usage */
10058
+ usage?: {
10059
+ inputTokens: number;
10060
+ outputTokens: number;
10061
+ };
10062
+ }
9831
10063
  /**
9832
- * Extract relation references from a formula expression
9833
- *
9834
- * Finds patterns like "company.name", "customer.email" in the expression.
9835
- *
9836
- * @param expression - Formula expression
9837
- * @returns Array of relation references (e.g., ["company.name", "customer.email"])
10064
+ * Handler for a specific AI action type.
9838
10065
  */
9839
- declare function extractRelationReferences(expression: string): string[];
10066
+ interface AIActionHandler<T extends AIActionConfig = AIActionConfig> {
10067
+ readonly actionType: T["type"];
10068
+ execute(action: T, ctx: ExecutorContext): Promise<AIActionResult>;
10069
+ }
9840
10070
  /**
9841
- * Extract unique relation names from formula expression
9842
- *
9843
- * @param expression - Formula expression
9844
- * @returns Array of unique relation names (e.g., ["company", "customer"])
10071
+ * Registry for AI action handlers.
9845
10072
  */
9846
- declare function extractRelationNames(expression: string): string[];
10073
+ declare class AIActionRegistry {
10074
+ private handlers;
10075
+ register<T extends AIActionConfig>(handler: AIActionHandler<T>): void;
10076
+ get(actionType: AIActionType): AIActionHandler | undefined;
10077
+ has(actionType: AIActionType): boolean;
10078
+ }
10079
+
9847
10080
  /**
9848
- * Check if a formula expression contains relation references
10081
+ * Executor for AINode.
9849
10082
  *
9850
- * @param expression - Formula expression
9851
- * @returns True if expression contains dot-notation references
10083
+ * Delegates to the appropriate AI action handler based on the action type.
10084
+ * The action registry is injected, allowing different environments to register
10085
+ * different handlers (e.g., sandbox-backed handlers in production, mocks in tests).
9852
10086
  */
9853
- declare function hasRelationReferences(expression: string): boolean;
10087
+ declare class AIExecutor implements NodeExecutor<AINode> {
10088
+ private actionRegistry;
10089
+ readonly nodeType: "ai";
10090
+ constructor(actionRegistry: AIActionRegistry);
10091
+ execute(node: AINode, ctx: ExecutorContext): Promise<ExecutorResult>;
10092
+ validate(node: AINode): string[];
10093
+ }
10094
+
9854
10095
  /**
9855
- * Convert resolved relations into nested objects for formula evaluation
9856
- *
9857
- * expr-eval interprets `company.name` as property access on object `company`,
9858
- * so we need to create nested objects that can be traversed.
9859
- *
9860
- * Converts: { company: { name: "Acme", id: "..." } }
9861
- * To: { company: { name: "Acme", id: "..." } }
9862
- *
9863
- * (Passes through as-is since ResolvedRelations is already nested)
9864
- *
9865
- * @param resolvedRelations - Resolved relation values
9866
- * @returns Nested objects for expr-eval property access
10096
+ * Options for FileService constructor
9867
10097
  */
9868
- declare function flattenRelationsForEval(resolvedRelations: ResolvedRelations): Record<string, unknown>;
10098
+ interface FileServiceOptions {
10099
+ /**
10100
+ * Audit service for logging file operations.
10101
+ * If provided, audit logging is enabled using userId from context.
10102
+ * If not provided, no audit logs are created (backward compatible).
10103
+ */
10104
+ auditService?: AuditService;
10105
+ }
9869
10106
  /**
9870
- * Evaluate a formula expression that may contain relation references
9871
- *
9872
- * Phase 2: Supports 1 level of relation traversal (e.g., "company.name")
10107
+ * Service for managing files.
9873
10108
  *
9874
- * @param expression - Formula expression
9875
- * @param record - Source record
9876
- * @param schema - Schema of the source object
9877
- * @param resolver - Relation resolver service
9878
- * @returns Computed value or null on error
10109
+ * Handles file metadata CRUD, permissions, storage operations, and audit logging.
10110
+ * Works with optional StorageAdapter for file upload/download operations.
10111
+ * Automatically uses tenant context from AsyncLocalStorage.
9879
10112
  *
9880
10113
  * @example
9881
10114
  * ```typescript
9882
- * // Formula: "CONCAT(company.name, ' - ', orderNumber)"
9883
- * const result = await evaluateFormulaWithRelations(
9884
- * "CONCAT(company.name, ' - ', orderNumber)",
9885
- * orderRecord,
9886
- * orderSchema,
9887
- * relationResolver
9888
- * );
9889
- * // "Acme Corp - ORD-001"
10115
+ * // Basic usage (metadata only)
10116
+ * const service = new FileService(adapter);
10117
+ *
10118
+ * // With audit logging
10119
+ * const auditService = new AuditService(adapter);
10120
+ * const service = new FileService(adapter, { auditService });
10121
+ *
10122
+ * // Upload file (requires StorageAdapter)
10123
+ * const file = await service.uploadFile({
10124
+ * content: fileBuffer,
10125
+ * fileName: "contract.pdf",
10126
+ * mimeType: "application/pdf",
10127
+ * size: 12345,
10128
+ * uploadedBy: "user-456",
10129
+ * });
9890
10130
  * ```
9891
10131
  */
9892
- declare function evaluateFormulaWithRelations(expression: string, record: ObjectRecord, schema: ObjectDefinition, resolver: FormulaResolverService): Promise<unknown>;
9893
- /**
9894
- * Evaluate a formula attribute that may contain relation references
9895
- *
9896
- * @param attr - Formula attribute definition
9897
- * @param record - Source record
10132
+ declare class FileService extends BaseService {
10133
+ private auditService?;
10134
+ constructor(adapter: DatabaseAdapter, options?: FileServiceOptions);
10135
+ /**
10136
+ * Upload a file to storage and create metadata record.
10137
+ *
10138
+ * This method orchestrates:
10139
+ * 1. Upload to storage (via StorageAdapter)
10140
+ * 2. Create file metadata in database
10141
+ * 3. Audit log the operation
10142
+ *
10143
+ * Requires `adapter.storage` to be configured.
10144
+ *
10145
+ * @param input - File content and metadata
10146
+ * @returns Created file record
10147
+ * @throws Error if StorageAdapter is not configured
10148
+ *
10149
+ * @example
10150
+ * ```typescript
10151
+ * const file = await service.uploadFile({
10152
+ * content: fileBuffer,
10153
+ * fileName: "document.pdf",
10154
+ * mimeType: "application/pdf",
10155
+ * size: 12345,
10156
+ * uploadedBy: "user-123",
10157
+ * visibility: "private",
10158
+ * folderPath: "/documents",
10159
+ * tags: ["contract", "2025"],
10160
+ * });
10161
+ * ```
10162
+ */
10163
+ uploadFile(input: UploadFileInput): Promise<File>;
10164
+ /**
10165
+ * Create a new file record (after upload to storage).
10166
+ *
10167
+ * Use this method when handling storage externally (e.g., with Multer + S3).
10168
+ * For integrated upload, use `uploadFile()` instead.
10169
+ *
10170
+ * @param data - File metadata
10171
+ * @returns Created file record
10172
+ *
10173
+ * @example
10174
+ * ```typescript
10175
+ * // After uploading to S3 with Multer
10176
+ * const file = await service.createFile({
10177
+ * tenantId: "tenant-123",
10178
+ * name: "contract-2025.pdf",
10179
+ * originalName: "Contract Acme Corp 2025.pdf",
10180
+ * mimeType: "application/pdf",
10181
+ * size: 2458624,
10182
+ * storageProvider: "s3",
10183
+ * storagePath: "tenants/123/files/2025/contract.pdf",
10184
+ * storageBucket: "my-app-files",
10185
+ * url: "https://cdn.example.com/files/file-123",
10186
+ * uploadedBy: "profile-456",
10187
+ * visibility: "private"
10188
+ * });
10189
+ * ```
10190
+ */
10191
+ createFile(data: CreateFile): Promise<File>;
10192
+ /**
10193
+ * Get file by ID
10194
+ */
10195
+ getFile(fileId: string): Promise<File | null>;
10196
+ /**
10197
+ * Get file by ID or throw
10198
+ */
10199
+ getFileOrThrow(fileId: string): Promise<File>;
10200
+ /**
10201
+ * Update file metadata
10202
+ *
10203
+ * @param fileId - File UUID
10204
+ * @param data - Data to update
10205
+ * @returns Updated file
10206
+ */
10207
+ updateFile(fileId: string, data: UpdateFile): Promise<File>;
10208
+ /**
10209
+ * Delete file (soft delete by default)
10210
+ *
10211
+ * @param fileId - File UUID
10212
+ * @param options - Delete options
10213
+ */
10214
+ deleteFile(fileId: string, options?: {
10215
+ hard?: boolean;
10216
+ checkOwnership?: boolean;
10217
+ userId?: string;
10218
+ }): Promise<void>;
10219
+ /**
10220
+ * Delete file from both storage and database.
10221
+ *
10222
+ * Requires `adapter.storage` to be configured.
10223
+ *
10224
+ * @param fileId - File UUID
10225
+ * @param options - Delete options
10226
+ * @throws Error if StorageAdapter is not configured
10227
+ */
10228
+ deleteFileWithStorage(fileId: string, options?: {
10229
+ hard?: boolean;
10230
+ }): Promise<void>;
10231
+ /**
10232
+ * Delete multiple files
10233
+ *
10234
+ * @param fileIds - Array of file UUIDs
10235
+ * @param options - Delete options
10236
+ */
10237
+ bulkDelete(fileIds: string[], options?: {
10238
+ hard?: boolean;
10239
+ deleteFromStorage?: boolean;
10240
+ }): Promise<void>;
10241
+ /**
10242
+ * List files for the tenant
10243
+ */
10244
+ listFiles(options?: FileListOptions): Promise<File[]>;
10245
+ /**
10246
+ * List files by folder
10247
+ */
10248
+ listFilesByFolder(folderPath: string): Promise<File[]>;
10249
+ /**
10250
+ * List files uploaded by a specific user
10251
+ */
10252
+ listFilesByUploader(uploadedBy: string): Promise<File[]>;
10253
+ /**
10254
+ * Get a signed URL for private file access.
10255
+ *
10256
+ * Checks access permissions before generating URL.
10257
+ * Requires `adapter.storage` to be configured.
10258
+ *
10259
+ * @param fileId - File UUID
10260
+ * @param userId - User requesting access
10261
+ * @param options - Signed URL options
10262
+ * @returns Signed URL
10263
+ * @throws Error if user doesn't have access or StorageAdapter is not configured
10264
+ *
10265
+ * @example
10266
+ * ```typescript
10267
+ * const url = await service.getSignedUrl("file-123", "user-456", {
10268
+ * expiresIn: 3600, // 1 hour
10269
+ * });
10270
+ * ```
10271
+ */
10272
+ getSignedUrl(fileId: string, userId: string, options?: SignedUrlOptions): Promise<string>;
10273
+ /**
10274
+ * Check if user has access to a file
10275
+ *
10276
+ * @param fileId - File UUID
10277
+ * @param userId - User ID to check
10278
+ * @returns true if user can access the file
10279
+ */
10280
+ checkAccess(fileId: string, userId: string): Promise<boolean>;
10281
+ /**
10282
+ * @deprecated Use checkAccess() instead
10283
+ */
10284
+ canAccess(fileId: string, userId: string): Promise<boolean>;
10285
+ /**
10286
+ * Change file visibility
10287
+ *
10288
+ * @param fileId - File UUID
10289
+ * @param visibility - New visibility level
10290
+ * @param allowedUsers - Users allowed to access (if restricted)
10291
+ */
10292
+ changeVisibility(fileId: string, visibility: FileVisibility, allowedUsers?: string[]): Promise<File>;
10293
+ /**
10294
+ * Grant access to a file for specific users
10295
+ *
10296
+ * @param fileId - File UUID
10297
+ * @param userIds - User IDs to grant access
10298
+ */
10299
+ grantAccess(fileId: string, userIds: string[]): Promise<File>;
10300
+ /**
10301
+ * Revoke access to a file for specific users
10302
+ *
10303
+ * @param fileId - File UUID
10304
+ * @param userIds - User IDs to revoke access
10305
+ */
10306
+ revokeAccess(fileId: string, userIds: string[]): Promise<File>;
10307
+ /**
10308
+ * Move file to different folder
10309
+ */
10310
+ moveToFolder(fileId: string, newFolderPath: string): Promise<File>;
10311
+ /**
10312
+ * Add tags to file
10313
+ */
10314
+ addTags(fileId: string, tags: string[]): Promise<File>;
10315
+ /**
10316
+ * Remove tags from file
10317
+ */
10318
+ removeTags(fileId: string, tags: string[]): Promise<File>;
10319
+ }
10320
+
10321
+ interface DocumentGenerationDeps {
10322
+ sandbox: SandboxExecutor;
10323
+ fileService: FileService;
10324
+ storage: StorageAdapter;
10325
+ }
10326
+ /**
10327
+ * Handler for document generation via AI agent in a sandbox.
10328
+ *
10329
+ * Flow:
10330
+ * 1. Resolve template file metadata via FileService
10331
+ * 2. Download template binary from StorageAdapter
10332
+ * 3. Collect slot data from execution context
10333
+ * 4. Execute agent session in sandbox with template + data
10334
+ * 5. Return generated artifacts as context updates
10335
+ */
10336
+ declare class DocumentGenerationHandler implements AIActionHandler<DocumentGenerationAction> {
10337
+ private deps;
10338
+ readonly actionType: "document-generation";
10339
+ constructor(deps?: DocumentGenerationDeps | null);
10340
+ execute(action: DocumentGenerationAction, ctx: ExecutorContext): Promise<AIActionResult>;
10341
+ }
10342
+
10343
+ /**
10344
+ * Handler for code execution in a sandbox (no AI agent).
10345
+ *
10346
+ * Flow:
10347
+ * 1. Collect slot data as JSON env vars
10348
+ * 2. Execute code via SandboxExecutor
10349
+ * 3. Capture stdout into outputVariable
10350
+ *
10351
+ * Requires a SandboxExecutor to be injected (provided by SandboxService in the AI package).
10352
+ */
10353
+ declare class CodeExecutionHandler implements AIActionHandler<CodeExecutionAction> {
10354
+ private sandbox;
10355
+ readonly actionType: "code-execution";
10356
+ constructor(sandbox?: SandboxExecutor | null);
10357
+ execute(action: CodeExecutionAction, ctx: ExecutorContext): Promise<AIActionResult>;
10358
+ }
10359
+
10360
+ interface AIActionRegistryDeps {
10361
+ sandbox?: SandboxExecutor | null;
10362
+ fileService?: FileService | null;
10363
+ storage?: StorageAdapter | null;
10364
+ }
10365
+ /**
10366
+ * Create an AI action registry with all built-in handlers.
10367
+ *
10368
+ * For document generation, all three deps (sandbox, fileService, storage) are required.
10369
+ * For code execution, only sandbox is required.
10370
+ */
10371
+ declare function createDefaultAIActionRegistry(deps?: AIActionRegistryDeps): AIActionRegistry;
10372
+
10373
+ /**
10374
+ * Executor for StartNode.
10375
+ * Simply transitions to the next node.
10376
+ */
10377
+ declare class StartExecutor implements NodeExecutor<StartNode> {
10378
+ readonly nodeType: "start";
10379
+ execute(node: StartNode, _context: ExecutorContext): ExecutorResult;
10380
+ canExecute(_node: StartNode, _context: ExecutorContext): boolean;
10381
+ validate(node: StartNode): string[];
10382
+ }
10383
+
10384
+ /**
10385
+ * Create a default executor registry with all core executors registered
10386
+ */
10387
+ declare function createDefaultExecutorRegistry(): ExecutorRegistry;
10388
+ /**
10389
+ * Get the default executor registry (singleton)
10390
+ */
10391
+ declare function getDefaultExecutorRegistry(): ExecutorRegistry;
10392
+
10393
+ /**
10394
+ * Result of formula evaluation
10395
+ */
10396
+ interface FormulaResult {
10397
+ /** Computed value (null if error) */
10398
+ value: unknown;
10399
+ /** Error message if evaluation failed */
10400
+ error?: string;
10401
+ }
10402
+ /**
10403
+ * Evaluate a formula expression against record values
10404
+ *
10405
+ * @param expression - Formula expression (e.g., "price * quantity")
10406
+ * @param values - Record values to use as variables
10407
+ * @returns Computed value or null on error
10408
+ *
10409
+ * @example
10410
+ * ```typescript
10411
+ * const result = evaluateFormula("price * quantity", { price: 10, quantity: 5 });
10412
+ * // → 50
10413
+ *
10414
+ * const greeting = evaluateFormula("CONCAT('Hello, ', name)", { name: "World" });
10415
+ * // → "Hello, World"
10416
+ * ```
10417
+ */
10418
+ declare function evaluateFormula(expression: string, values: Record<string, unknown>): unknown;
10419
+ /**
10420
+ * Evaluate a formula with detailed result including error info
10421
+ *
10422
+ * @param expression - Formula expression
10423
+ * @param values - Record values
10424
+ * @returns Result object with value and optional error
10425
+ */
10426
+ declare function evaluateFormulaWithResult(expression: string, values: Record<string, unknown>): FormulaResult;
10427
+ /**
10428
+ * Format a formula result based on return type
10429
+ *
10430
+ * @param value - Raw computed value
10431
+ * @param returnType - Expected return type
10432
+ * @param decimals - Decimal places for numbers
10433
+ * @returns Formatted value
10434
+ */
10435
+ declare function formatFormulaResult(value: unknown, returnType: FormulaReturnType, decimals?: number): unknown;
10436
+ /**
10437
+ * Evaluate a formula attribute and return formatted result
10438
+ *
10439
+ * @param attr - Formula attribute definition
10440
+ * @param values - Record values
10441
+ * @returns Formatted computed value
10442
+ */
10443
+ declare function evaluateFormulaAttribute(attr: FormulaAttribute, values: Record<string, unknown>): unknown;
10444
+ /**
10445
+ * Validate a formula expression syntax without evaluating
10446
+ *
10447
+ * @param expression - Formula expression to validate
10448
+ * @returns Object with valid flag and optional error message
10449
+ */
10450
+ declare function validateFormulaExpression(expression: string): {
10451
+ valid: boolean;
10452
+ error?: string;
10453
+ };
10454
+ /**
10455
+ * Extract variable names referenced in a formula expression
10456
+ *
10457
+ * @param expression - Formula expression
10458
+ * @returns Array of variable names
10459
+ */
10460
+ declare function extractFormulaVariables(expression: string): string[];
10461
+ /**
10462
+ * Extract relation references from a formula expression
10463
+ *
10464
+ * Finds patterns like "company.name", "customer.email" in the expression.
10465
+ *
10466
+ * @param expression - Formula expression
10467
+ * @returns Array of relation references (e.g., ["company.name", "customer.email"])
10468
+ */
10469
+ declare function extractRelationReferences(expression: string): string[];
10470
+ /**
10471
+ * Extract unique relation names from formula expression
10472
+ *
10473
+ * @param expression - Formula expression
10474
+ * @returns Array of unique relation names (e.g., ["company", "customer"])
10475
+ */
10476
+ declare function extractRelationNames(expression: string): string[];
10477
+ /**
10478
+ * Check if a formula expression contains relation references
10479
+ *
10480
+ * @param expression - Formula expression
10481
+ * @returns True if expression contains dot-notation references
10482
+ */
10483
+ declare function hasRelationReferences(expression: string): boolean;
10484
+ /**
10485
+ * Convert resolved relations into nested objects for formula evaluation
10486
+ *
10487
+ * expr-eval interprets `company.name` as property access on object `company`,
10488
+ * so we need to create nested objects that can be traversed.
10489
+ *
10490
+ * Converts: { company: { name: "Acme", id: "..." } }
10491
+ * To: { company: { name: "Acme", id: "..." } }
10492
+ *
10493
+ * (Passes through as-is since ResolvedRelations is already nested)
10494
+ *
10495
+ * @param resolvedRelations - Resolved relation values
10496
+ * @returns Nested objects for expr-eval property access
10497
+ */
10498
+ declare function flattenRelationsForEval(resolvedRelations: ResolvedRelations): Record<string, unknown>;
10499
+ /**
10500
+ * Evaluate a formula expression that may contain relation references
10501
+ *
10502
+ * Phase 2: Supports 1 level of relation traversal (e.g., "company.name")
10503
+ *
10504
+ * @param expression - Formula expression
10505
+ * @param record - Source record
10506
+ * @param schema - Schema of the source object
10507
+ * @param resolver - Relation resolver service
10508
+ * @returns Computed value or null on error
10509
+ *
10510
+ * @example
10511
+ * ```typescript
10512
+ * // Formula: "CONCAT(company.name, ' - ', orderNumber)"
10513
+ * const result = await evaluateFormulaWithRelations(
10514
+ * "CONCAT(company.name, ' - ', orderNumber)",
10515
+ * orderRecord,
10516
+ * orderSchema,
10517
+ * relationResolver
10518
+ * );
10519
+ * // → "Acme Corp - ORD-001"
10520
+ * ```
10521
+ */
10522
+ declare function evaluateFormulaWithRelations(expression: string, record: ObjectRecord, schema: ObjectDefinition, resolver: FormulaResolverService): Promise<unknown>;
10523
+ /**
10524
+ * Evaluate a formula attribute that may contain relation references
10525
+ *
10526
+ * @param attr - Formula attribute definition
10527
+ * @param record - Source record
9898
10528
  * @param schema - Schema of the source object
9899
10529
  * @param resolver - Relation resolver service
9900
10530
  * @returns Formatted computed value
@@ -11162,232 +11792,6 @@ declare class DocumentProcessingService extends BaseService {
11162
11792
  };
11163
11793
  }
11164
11794
 
11165
- /**
11166
- * Options for FileService constructor
11167
- */
11168
- interface FileServiceOptions {
11169
- /**
11170
- * Audit service for logging file operations.
11171
- * If provided, audit logging is enabled using userId from context.
11172
- * If not provided, no audit logs are created (backward compatible).
11173
- */
11174
- auditService?: AuditService;
11175
- }
11176
- /**
11177
- * Service for managing files.
11178
- *
11179
- * Handles file metadata CRUD, permissions, storage operations, and audit logging.
11180
- * Works with optional StorageAdapter for file upload/download operations.
11181
- * Automatically uses tenant context from AsyncLocalStorage.
11182
- *
11183
- * @example
11184
- * ```typescript
11185
- * // Basic usage (metadata only)
11186
- * const service = new FileService(adapter);
11187
- *
11188
- * // With audit logging
11189
- * const auditService = new AuditService(adapter);
11190
- * const service = new FileService(adapter, { auditService });
11191
- *
11192
- * // Upload file (requires StorageAdapter)
11193
- * const file = await service.uploadFile({
11194
- * content: fileBuffer,
11195
- * fileName: "contract.pdf",
11196
- * mimeType: "application/pdf",
11197
- * size: 12345,
11198
- * uploadedBy: "user-456",
11199
- * });
11200
- * ```
11201
- */
11202
- declare class FileService extends BaseService {
11203
- private auditService?;
11204
- constructor(adapter: DatabaseAdapter, options?: FileServiceOptions);
11205
- /**
11206
- * Upload a file to storage and create metadata record.
11207
- *
11208
- * This method orchestrates:
11209
- * 1. Upload to storage (via StorageAdapter)
11210
- * 2. Create file metadata in database
11211
- * 3. Audit log the operation
11212
- *
11213
- * Requires `adapter.storage` to be configured.
11214
- *
11215
- * @param input - File content and metadata
11216
- * @returns Created file record
11217
- * @throws Error if StorageAdapter is not configured
11218
- *
11219
- * @example
11220
- * ```typescript
11221
- * const file = await service.uploadFile({
11222
- * content: fileBuffer,
11223
- * fileName: "document.pdf",
11224
- * mimeType: "application/pdf",
11225
- * size: 12345,
11226
- * uploadedBy: "user-123",
11227
- * visibility: "private",
11228
- * folderPath: "/documents",
11229
- * tags: ["contract", "2025"],
11230
- * });
11231
- * ```
11232
- */
11233
- uploadFile(input: UploadFileInput): Promise<File>;
11234
- /**
11235
- * Create a new file record (after upload to storage).
11236
- *
11237
- * Use this method when handling storage externally (e.g., with Multer + S3).
11238
- * For integrated upload, use `uploadFile()` instead.
11239
- *
11240
- * @param data - File metadata
11241
- * @returns Created file record
11242
- *
11243
- * @example
11244
- * ```typescript
11245
- * // After uploading to S3 with Multer
11246
- * const file = await service.createFile({
11247
- * tenantId: "tenant-123",
11248
- * name: "contract-2025.pdf",
11249
- * originalName: "Contract Acme Corp 2025.pdf",
11250
- * mimeType: "application/pdf",
11251
- * size: 2458624,
11252
- * storageProvider: "s3",
11253
- * storagePath: "tenants/123/files/2025/contract.pdf",
11254
- * storageBucket: "my-app-files",
11255
- * url: "https://cdn.example.com/files/file-123",
11256
- * uploadedBy: "profile-456",
11257
- * visibility: "private"
11258
- * });
11259
- * ```
11260
- */
11261
- createFile(data: CreateFile): Promise<File>;
11262
- /**
11263
- * Get file by ID
11264
- */
11265
- getFile(fileId: string): Promise<File | null>;
11266
- /**
11267
- * Get file by ID or throw
11268
- */
11269
- getFileOrThrow(fileId: string): Promise<File>;
11270
- /**
11271
- * Update file metadata
11272
- *
11273
- * @param fileId - File UUID
11274
- * @param data - Data to update
11275
- * @returns Updated file
11276
- */
11277
- updateFile(fileId: string, data: UpdateFile): Promise<File>;
11278
- /**
11279
- * Delete file (soft delete by default)
11280
- *
11281
- * @param fileId - File UUID
11282
- * @param options - Delete options
11283
- */
11284
- deleteFile(fileId: string, options?: {
11285
- hard?: boolean;
11286
- checkOwnership?: boolean;
11287
- userId?: string;
11288
- }): Promise<void>;
11289
- /**
11290
- * Delete file from both storage and database.
11291
- *
11292
- * Requires `adapter.storage` to be configured.
11293
- *
11294
- * @param fileId - File UUID
11295
- * @param options - Delete options
11296
- * @throws Error if StorageAdapter is not configured
11297
- */
11298
- deleteFileWithStorage(fileId: string, options?: {
11299
- hard?: boolean;
11300
- }): Promise<void>;
11301
- /**
11302
- * Delete multiple files
11303
- *
11304
- * @param fileIds - Array of file UUIDs
11305
- * @param options - Delete options
11306
- */
11307
- bulkDelete(fileIds: string[], options?: {
11308
- hard?: boolean;
11309
- deleteFromStorage?: boolean;
11310
- }): Promise<void>;
11311
- /**
11312
- * List files for the tenant
11313
- */
11314
- listFiles(options?: FileListOptions): Promise<File[]>;
11315
- /**
11316
- * List files by folder
11317
- */
11318
- listFilesByFolder(folderPath: string): Promise<File[]>;
11319
- /**
11320
- * List files uploaded by a specific user
11321
- */
11322
- listFilesByUploader(uploadedBy: string): Promise<File[]>;
11323
- /**
11324
- * Get a signed URL for private file access.
11325
- *
11326
- * Checks access permissions before generating URL.
11327
- * Requires `adapter.storage` to be configured.
11328
- *
11329
- * @param fileId - File UUID
11330
- * @param userId - User requesting access
11331
- * @param options - Signed URL options
11332
- * @returns Signed URL
11333
- * @throws Error if user doesn't have access or StorageAdapter is not configured
11334
- *
11335
- * @example
11336
- * ```typescript
11337
- * const url = await service.getSignedUrl("file-123", "user-456", {
11338
- * expiresIn: 3600, // 1 hour
11339
- * });
11340
- * ```
11341
- */
11342
- getSignedUrl(fileId: string, userId: string, options?: SignedUrlOptions): Promise<string>;
11343
- /**
11344
- * Check if user has access to a file
11345
- *
11346
- * @param fileId - File UUID
11347
- * @param userId - User ID to check
11348
- * @returns true if user can access the file
11349
- */
11350
- checkAccess(fileId: string, userId: string): Promise<boolean>;
11351
- /**
11352
- * @deprecated Use checkAccess() instead
11353
- */
11354
- canAccess(fileId: string, userId: string): Promise<boolean>;
11355
- /**
11356
- * Change file visibility
11357
- *
11358
- * @param fileId - File UUID
11359
- * @param visibility - New visibility level
11360
- * @param allowedUsers - Users allowed to access (if restricted)
11361
- */
11362
- changeVisibility(fileId: string, visibility: FileVisibility, allowedUsers?: string[]): Promise<File>;
11363
- /**
11364
- * Grant access to a file for specific users
11365
- *
11366
- * @param fileId - File UUID
11367
- * @param userIds - User IDs to grant access
11368
- */
11369
- grantAccess(fileId: string, userIds: string[]): Promise<File>;
11370
- /**
11371
- * Revoke access to a file for specific users
11372
- *
11373
- * @param fileId - File UUID
11374
- * @param userIds - User IDs to revoke access
11375
- */
11376
- revokeAccess(fileId: string, userIds: string[]): Promise<File>;
11377
- /**
11378
- * Move file to different folder
11379
- */
11380
- moveToFolder(fileId: string, newFolderPath: string): Promise<File>;
11381
- /**
11382
- * Add tags to file
11383
- */
11384
- addTags(fileId: string, tags: string[]): Promise<File>;
11385
- /**
11386
- * Remove tags from file
11387
- */
11388
- removeTags(fileId: string, tags: string[]): Promise<File>;
11389
- }
11390
-
11391
11795
  interface RecordDocumentsResult {
11392
11796
  /** Documents grouped by attribute name (includes system 'attachments' attribute) */
11393
11797
  byAttribute: Record<string, Document[]>;
@@ -12126,4 +12530,4 @@ interface FullSyncOptions extends SyncOptions, ViewSyncOptions {
12126
12530
  */
12127
12531
  declare function syncAll(adapter: DatabaseAdapter, objectRegistry: typeof registry, nativeViewRegistry: typeof viewRegistry, options?: FullSyncOptions): Promise<FullSyncResult>;
12128
12532
 
12129
- export { type AIThinkingLevel as $, type Action as A, type BoundingBox as B, type CreateMode as C, type DetailViewLayout as D, type CreateSignatureInput as E, type FormNode as F, type Group as G, type SignerRequest as H, type InferAttributeValue as I, type SignaturePosition as J, type SignatureRequestResult as K, type ListViewDefinition as L, type SignatureStatusResult as M, type SignerStatus as N, type OcrAdapter as O, type SignatureStatus as P, type IdentityVerificationAdapter as Q, type RelationGroup as R, type SystemResource as S, type Tab as T, type VerifyInput as U, type ViewType as V, type WorkflowNode as W, type VerificationResult as X, type DocumentData as Y, type VerificationCheck as Z, type AIMessageRole as _, type WorkflowNodeType as a, type RelationFilterOperator as a$, type AIAvailableModel as a0, type AIToolCallStatus as a1, type AIToolCall as a2, type AIChatMessagePartType as a3, type TextPartData as a4, type ToolPartData as a5, type ThinkingPartData as a6, type ReasoningPartData as a7, type AIChatMessagePart as a8, type AIChatMessage as a9, type AuditListOptions as aA, type AuditServiceOptions as aB, type Document as aC, type DocumentStatus as aD, type DocumentSlot as aE, type SlotStatus as aF, type ProcessingJob as aG, type ProcessingJobType as aH, type ProcessingJobStatus as aI, type CreateDocument as aJ, type UpdateDocument as aK, type CreateDocumentSlot as aL, type UpdateDocumentSlot as aM, type CreateProcessingJob as aN, type UpdateProcessingJob as aO, type DocumentListOptions as aP, type StorageProvider as aQ, type FileVisibility as aR, type File as aS, type CreateFile as aT, type UpdateFile as aU, type TextFilterOperator as aV, type NumberFilterOperator as aW, type CheckboxFilterOperator as aX, type DateFilterOperator as aY, type SelectFilterOperator as aZ, type MultiselectFilterOperator as a_, type AIQuestionType as aa, type AIQuestionOption as ab, type AIQuestion as ac, type AIQuestionAnswer as ad, type AIBatchQuestionOption as ae, type AIBatchQuestion as af, type AIBatchQuestionAnswer as ag, type AITodoStatus as ah, type AITodoItem as ai, type AITodoList as aj, type AIMessageAttachment as ak, type AIConversation as al, type AIMessage as am, type AIToolCallRecord as an, type AIUsageMetrics as ao, type AIProviderMetrics as ap, type CreateAIMessageInput as aq, type AIMemoryType as ar, type AIMemoryEntry as as, type AICompactionSummary as at, type AuditResourceType as au, type AuditAction as av, type AuditActorType as aw, type AuditChange as ax, type AuditLogEntry as ay, type CreateAuditLogInput as az, type Field as b, type AccessLevel as b$, type FilterOperator as b0, type RelativeDateValue as b1, type CurrencyFilterValue as b2, type PhoneFilterValue as b3, type FilterValue as b4, type FilterRule as b5, type ExtendedFilterRule as b6, type FilterCombinator as b7, type FilterGroup as b8, type AdvancedFilterState as b9, type GeocodingParams as bA, type GeocodingAdapter as bB, NoopGeocodingAdapter as bC, type AttributeSchema as bD, type InferRecordFromSchema as bE, type InferRecordWithRequirements as bF, type TypedAttribute as bG, type AttributeMap as bH, type AddAttribute as bI, type InferRecord as bJ, type InferRecordInput as bK, type InferRecordUpdate as bL, type CustomAttributeValue as bM, type WithCustomAttributes as bN, type RecordMetadata as bO, type SystemFields as bP, type ExtractRecord as bQ, type ExtractRecordStrict as bR, type ExtractRecordInput as bS, type ExtractRecordInputStrict as bT, type ExtractRecordUpdate as bU, type ExtractRecordUpdateStrict as bV, type ExtractAttributes as bW, type TypedObjectRecord as bX, type ExtractObjectRecord as bY, type ExtractObjectRecordWithCustom as bZ, type PermissionScope as b_, type SortDirection as ba, type QueryState as bb, OPERATORS_BY_TYPE as bc, type NoValueOperator as bd, NO_VALUE_OPERATORS as be, isNoValueOperator as bf, getRollupFilterOperators as bg, type FlowSlot as bh, type FlowRowField as bi, type FlowRowType as bj, type FlowHeadingRow as bk, type FlowSeparatorRow as bl, type FlowTextRow as bm, type FlowRow as bn, isFlowFieldsRow as bo, isLayoutRow as bp, type FlowPage as bq, type FlowRelation as br, type FlowStatus as bs, type FlowDefinition as bt, isFlowDefinition as bu, isFlowPublished as bv, isSystemFlow as bw, type GeocodingSuggestion as bx, type GeocodingAutocompleteParams as by, type ReverseGeocodingParams as bz, type AttributeGroupField as c, type ConditionNode as c$, ALL_ACTIONS as c0, actionsToAccessLevel as c1, accessLevelToActions as c2, type Role as c3, type Permission as c4, type UserRoleAssignment as c5, type EffectivePermissions as c6, type ObjectPermissions as c7, type SystemPermissions as c8, type CreateRoleInput as c9, type TimelineViewConfig as cA, type GalleryViewConfig as cB, type ViewConfig as cC, type CalendarViewDefinition as cD, type TimelineViewDefinition as cE, type GalleryViewDefinition as cF, type ConfigOverrides as cG, type ViewOverlay as cH, isDetailView as cI, isListView as cJ, isCalendarView as cK, isTimelineView as cL, isGalleryView as cM, isFieldGroup as cN, isRelationGroup as cO, isFormTab as cP, isTableTab as cQ, isRelationSourceTab as cR, isInverseSourceTab as cS, isCustomTab as cT, isActivityTab as cU, isRichtextTab as cV, isFlowsTab as cW, isDocumentsTab as cX, type AssignmentMapping as cY, type AssignmentSource as cZ, type AssignNode as c_, type UpdateRoleInput as ca, type CreatePermissionInput as cb, type AssignRoleInput as cc, type PolicyContext as cd, type RecordPolicy as ce, PolicyViolationError as cf, type UserStatus as cg, USER_STATUSES as ch, type UserProfile as ci, type CreateUserProfile as cj, type UpdateUserProfile as ck, type InviteUserInput as cl, type TabType as cm, type FormDensity as cn, type FormTab as co, type RelationSource as cp, type InverseSource as cq, type TableSource as cr, type CustomTab as cs, type ActivityTab as ct, type RichtextTab as cu, type FlowsTab as cv, type DocumentsTab as cw, type ListViewLayout as cx, type DetailViewConfig as cy, type CalendarViewConfig as cz, type FieldGroup as d, type ThemeLogo as d$, type EndNode as d0, type FormFieldRef as d1, type StartNode as d2, isAdvancedFormNode as d3, isAssignNode as d4, isConditionNode as d5, isEndNode as d6, isFormNode as d7, isSimpleFormNode as d8, isStartNode as d9, type CreateInvitationResult as dA, type InvitationStatus as dB, type WorkflowInvitation as dC, isInvitationAccepted as dD, isInvitationExpired as dE, isInvitationValid as dF, type CreateGrantInput as dG, type WorkflowAccessGrant as dH, canAccessNode as dI, isGrantExpired as dJ, isGrantRevoked as dK, isGrantValid as dL, isTokenRevoked as dM, type GeneratedDocument as dN, type WorkflowExecutionContext as dO, createEmptyContext as dP, getContextValue as dQ, setContextValue as dR, type FormContextResponse as dS, type FormFieldContext as dT, type FormFieldRow as dU, type FormFieldsRow as dV, type FormNodeInfo as dW, type ReadOnlyReason as dX, type WorkflowAccessMode as dY, isFormFieldsRow as dZ, type ThemeColors as d_, type ConditionOperator as da, and as db, eq as dc, inValues as dd, isConditionGroup as de, isConditionRule as df, neq as dg, or as dh, type CanvasViewport as di, type NodePosition as dj, type WorkflowLayout as dk, type WorkflowSlot as dl, type WorkflowStatus as dm, isSystemWorkflow as dn, isWorkflowDefinition as dp, isWorkflowPublished as dq, type PendingAction as dr, type WorkflowError as ds, type WorkflowInstance as dt, type WorkflowTransition as du, canResumeInstance as dv, createStartTransition as dw, isInstanceTerminal as dx, isInstanceWaiting as dy, type CreateInvitationInput as dz, type SidePanelConfig as e, hasSchemaContext as e$, type ThemeTypography as e0, DEFAULT_THEME as e1, generateCssVariables as e2, mergeWithDefaults as e3, registry as e4, viewRegistry as e5, type ViewOverlaysRepository as e6, type RelationAttributeInput as e7, type RelationAttributeRow as e8, type RelationAttributesRepository as e9, formatRecord as eA, formatRecords as eB, QueryMultipleResultsError as eC, QueryNoResultError as eD, SHORTCUT_TO_FILTER_OPERATOR as eE, createQueryBuilder as eF, QueryBuilder as eG, type QueryBuilderOptions as eH, type EvaluationResult as eI, type EvaluationTrace as eJ, evaluateCondition as eK, evaluate as eL, evaluateWithTrace as eM, TenantContextError as eN, FeatureFlagsContextError as eO, getFeatureFlags as eP, getFeatureValue as eQ, hasFeatureFlagsContext as eR, isFeatureEnabled as eS, runWithFeatureFlags as eT, tryGetFeatureValue as eU, withFeatureFlags as eV, type FeatureFlagsContext as eW, addSchemaToContext as eX, getSchemaByNameFromContext as eY, getSchemaContext as eZ, getSchemaFromContext as e_, SORTABLE_ATTRIBUTE_TYPES as ea, type SearchAdapter as eb, type DatabaseAdapter as ec, WorkflowJwtService as ed, type JwtVerificationResult as ee, type MagicLinkPayload as ef, type WorkflowAccessPayload as eg, type WorkflowJwtConfig as eh, type WorkflowJwtPayload as ei, type CacheKeyType as ej, hashOptions as ek, type CacheAdapter as el, type CacheOptions as em, cacheKeys as en, cacheTtl as eo, defaultTtl as ep, NoopCacheAdapter as eq, type FetchResult as er, type FormattedRecord as es, type GroupedFetchResult as et, type InsertOptions as eu, type QueryBuilderState as ev, type RegistryMap as ew, type RegistryObjectNames as ex, type ShortcutOperator as ey, createDefaultState as ez, type DetailViewDefinition as f, type HookType as f$, runWithMergedSchemaContext as f0, runWithSchemaContext as f1, type SchemaContext as f2, getContext as f3, getTenantId as f4, getUserId as f5, hasContext as f6, runWithContext as f7, withTenantContext as f8, type TenantContext as f9, extractRelationReferences as fA, flattenRelationsForEval as fB, formatFormulaResult as fC, hasRelationReferences as fD, validateFormulaExpression as fE, type FormulaResult as fF, getPathDepth as fG, getRelationPath as fH, getTargetAttributeName as fI, InvalidPathError as fJ, MaxDepthExceededError as fK, parsePath as fL, pathHasManyCardinality as fM, validatePath as fN, type PathCardinality as fO, type PathSegment as fP, type PathSegmentType as fQ, type SchemaResolver as fR, resolveMultiplePaths as fS, resolveSingleValue as fT, traversePath as fU, type TraversalOptions as fV, type TraversalResult as fW, type AttributeChange as fX, type HookContext as fY, type HookDefinition as fZ, type HookHandler as f_, createDefaultExecutorRegistry as fa, getDefaultExecutorRegistry as fb, type ExecutorCompleteResult as fc, type ExecutorContext as fd, type ExecutorErrorResult as fe, type ExecutorResult as ff, type ExecutorSuccessResult as fg, type ExecutorWaitResult as fh, type NodeExecutor as fi, complete as fj, error as fk, ExecutorRegistry as fl, success as fm, wait as fn, ConditionExecutor as fo, EndExecutor as fp, FormExecutor as fq, AssignExecutor as fr, StartExecutor as fs, evaluateFormula as ft, evaluateFormulaAttribute as fu, evaluateFormulaAttributeWithRelations as fv, evaluateFormulaWithRelations as fw, evaluateFormulaWithResult as fx, extractFormulaVariables as fy, extractRelationNames as fz, type InstanceStatus as g, getPolicy as g$, NoopHookRegistry as g0, type HookRegistry as g1, createMockAdapter as g2, type MockStores as g3, defaultPolicyRegistry as g4, PolicyRegistry as g5, type AIConversationsRepository as g6, type AIUsageMetricsRepository as g7, type AttributesRepository as g8, type AuditRepository as g9, type SearchQueryOptions as gA, type QueryResult as gB, RecordQueryService as gC, type RelationValidationResult as gD, type RelationValidationError as gE, type RelationOption as gF, type RelationOptionsResponse as gG, type GetRelationOptionsParams as gH, type RelationServiceOptions as gI, type ResolveIdsBatchRequest as gJ, type ResolveIdsBatchResponse as gK, RelationService as gL, type MultiRelationValue as gM, type SingleRelationValue as gN, type HybridRelationValue as gO, RelationPropertiesService as gP, RecordResolverService as gQ, type ResolvedRelations as gR, type FormulaResolverServiceOptions as gS, FormulaResolverService as gT, type RollupResult as gU, type RollupServiceOptions as gV, RollupService as gW, type RollupSchedulerOptions as gX, RollupScheduler as gY, applyDefaultValues as gZ, checkPermission as g_, type DocumentJobsRepository as ga, type DocumentSlotsRepository as gb, type DocumentsRepository as gc, type FilesRepository as gd, type ObjectRecordsRepository as ge, type ObjectsRepository as gf, type PermissionsRepository as gg, type UserProfilesRepository as gh, type ViewsRepository as gi, type WorkflowAccessGrantsRepository as gj, type WorkflowInstancesRepository as gk, type WorkflowInvitationsRepository as gl, type WorkflowsRepository as gm, BaseService as gn, BaseRepository as go, type SchemaContextAware as gp, SchemaContextAwareRepository as gq, type CreateCustomObjectInput as gr, type AddAttributeInput as gs, type UpdateObjectInput as gt, type ObjectSchemaServiceOptions as gu, ObjectSchemaService as gv, type RecordServiceOptions as gw, RecordService as gx, type RecordQueryServiceOptions as gy, type QueryOptions as gz, type TableTab as h, type StorageUploadInput as h$, buildPolicyContext as h0, checkRecordAccess as h1, checkRecordModifyOrThrow as h2, checkRecordDeleteOrThrow as h3, checkSharedObjectWriteAccess as h4, computeLabel as h5, type LabelResolver as h6, enrichWithFormulas as h7, enrichRecordsWithFormulas as h8, createContextForCreate as h9, WorkflowService as hA, type UserValidationResult as hB, type UserValidationError as hC, UserService as hD, type UserProfileServiceOptions as hE, UserProfileService as hF, AuditService as hG, buildAuditChanges as hH, type DocumentProcessingConfig as hI, DocumentProcessingService as hJ, type RecordDocumentsResult as hK, type CreateRecordDocumentInput as hL, type CreateRecordDocumentResult as hM, type DocumentServiceOptions as hN, DocumentService as hO, type FileServiceOptions as hP, FileService as hQ, GeocodingService as hR, GlobalSearchService as hS, type PermissionServiceOptions as hT, PermissionService as hU, type CreateViewInput as hV, type UpdateViewInput as hW, type GetViewsOptions as hX, type GetViewOptions as hY, ViewService as hZ, type FileContent as h_, createContextForUpdate as ha, createContextForDelete as hb, createContextForRestore as hc, recalculateParentRollups as hd, type RollupCascadeContext as he, GrantNotFoundError as hf, GrantExpiredError as hg, GrantRevokedError as hh, TokenRevokedError as hi, type GrantServiceConfig as hj, type CreateGrantResult as hk, WorkflowAccessGrantService as hl, type StartWorkflowInput as hm, type ResumeWorkflowInput as hn, type WorkflowInstanceServiceOptions as ho, WorkflowInstanceService as hp, type InvitationServiceConfig as hq, InvitationNotFoundError as hr, InvitationExpiredError as hs, InvitationAlreadyAcceptedError as ht, InvitationRevokedError as hu, WorkflowInvitationService as hv, WorkflowRelationService as hw, type CreateWorkflowInput as hx, type UpdateWorkflowInput as hy, type WorkflowServiceOptions as hz, type FilterState as i, syncNativeViews as i$, type StorageUploadResult as i0, type SignedUrlOptions as i1, type StorageAdapter as i2, type UploadFileInput as i3, type SyncResult as i4, type SyncOptions as i5, syncNativeObjects as i6, verifyNativeObjectsSync as i7, getSyncPreview as i8, type FullSyncResult as i9, type GlobalSearchResultItem as iA, type GlobalSearchGroupedResult as iB, type FileListOptions as iC, type DBView as iD, type CreateDBView as iE, type UpdateDBView as iF, type UpsertDBView as iG, type DBViewOverlay as iH, type CreateDBViewOverlay as iI, type UpdateDBViewOverlay as iJ, type DBWorkflow as iK, type CreateDBWorkflow as iL, type UpdateDBWorkflow as iM, type DBWorkflowInstance as iN, type CreateDBWorkflowInstance as iO, type UpdateDBWorkflowInstance as iP, type DBWorkflowInvitation as iQ, type CreateDBWorkflowInvitation as iR, type UpdateDBWorkflowInvitation as iS, type DBWorkflowAccessGrant as iT, type CreateDBWorkflowAccessGrant as iU, type UpdateDBWorkflowAccessGrant as iV, type OperationResult as iW, type ViewSyncResult as iX, type ViewSyncLogger as iY, type ViewSyncOptions as iZ, seedRegistryViews as i_, type FullSyncOptions as ia, syncAll as ib, DEFAULT_LABEL_FALLBACK as ic, renderLabelExpression as id, isLabelExpression as ie, extractAttributeNames as ig, enrichValuesForDisplay as ih, enrichValuesWithSelectLabels as ii, extractRelationIds as ij, type RelationLabelResolver as ik, computeLabelWithRelations as il, type DBObject as im, type CreateDBObject as io, type UpdateDBObject as ip, type UpsertDBObject as iq, type DBAttribute as ir, type CreateDBAttribute as is, type UpdateDBAttribute as it, type UpsertDBAttribute as iu, type CreateObjectRecord as iv, type ListOptions as iw, type SearchOptions as ix, type GlobalSearchOptions as iy, type GlobalSearchGroupedOptions as iz, type SortRule as j, verifyRegistryViewsSeeded as j0, verifyNativeViewsSync as j1, getViewSeedPreview as j2, getViewSyncPreview as j3, type WorkflowTheme as k, type WorkflowConfig as l, type SlotMode as m, type ConditionGroup as n, type ConditionRule as o, type WorkflowDefinition as p, type FlowFieldsRow as q, type ListViewConfig as r, type ListViewTab as s, type ViewDefinition as t, type OcrInput as u, type OcrOptions as v, type OcrResult as w, type OcrPage as x, type OcrTextBlock as y, type SignatureAdapter as z };
12533
+ export { type AIThinkingLevel as $, type Action as A, type BoundingBox as B, type CreateMode as C, type DetailViewLayout as D, type CreateSignatureInput as E, type FormNode as F, type Group as G, type SignerRequest as H, type InferAttributeValue as I, type SignaturePosition as J, type SignatureRequestResult as K, type ListViewDefinition as L, type SignatureStatusResult as M, type SignerStatus as N, type OcrAdapter as O, type SignatureStatus as P, type IdentityVerificationAdapter as Q, type RelationGroup as R, type SystemResource as S, type Tab as T, type VerifyInput as U, type ViewType as V, type WorkflowNode as W, type VerificationResult as X, type DocumentData as Y, type VerificationCheck as Z, type AIMessageRole as _, type WorkflowNodeType as a, type RelationFilterOperator as a$, type AIAvailableModel as a0, type AIToolCallStatus as a1, type AIToolCall as a2, type AIChatMessagePartType as a3, type TextPartData as a4, type ToolPartData as a5, type ThinkingPartData as a6, type ReasoningPartData as a7, type AIChatMessagePart as a8, type AIChatMessage as a9, type AuditListOptions as aA, type AuditServiceOptions as aB, type Document as aC, type DocumentStatus as aD, type DocumentSlot as aE, type SlotStatus as aF, type ProcessingJob as aG, type ProcessingJobType as aH, type ProcessingJobStatus as aI, type CreateDocument as aJ, type UpdateDocument as aK, type CreateDocumentSlot as aL, type UpdateDocumentSlot as aM, type CreateProcessingJob as aN, type UpdateProcessingJob as aO, type DocumentListOptions as aP, type StorageProvider as aQ, type FileVisibility as aR, type File as aS, type CreateFile as aT, type UpdateFile as aU, type TextFilterOperator as aV, type NumberFilterOperator as aW, type CheckboxFilterOperator as aX, type DateFilterOperator as aY, type SelectFilterOperator as aZ, type MultiselectFilterOperator as a_, type AIQuestionType as aa, type AIQuestionOption as ab, type AIQuestion as ac, type AIQuestionAnswer as ad, type AIBatchQuestionOption as ae, type AIBatchQuestion as af, type AIBatchQuestionAnswer as ag, type AITodoStatus as ah, type AITodoItem as ai, type AITodoList as aj, type AIMessageAttachment as ak, type AIConversation as al, type AIMessage as am, type AIToolCallRecord as an, type AIUsageMetrics as ao, type AIProviderMetrics as ap, type CreateAIMessageInput as aq, type AIMemoryType as ar, type AIMemoryEntry as as, type AICompactionSummary as at, type AuditResourceType as au, type AuditAction as av, type AuditActorType as aw, type AuditChange as ax, type AuditLogEntry as ay, type CreateAuditLogInput as az, type Field as b, type PermissionScope as b$, type FilterOperator as b0, type RelativeDateValue as b1, type CurrencyFilterValue as b2, type PhoneFilterValue as b3, type FilterValue as b4, type FilterRule as b5, type ExtendedFilterRule as b6, type FilterCombinator as b7, type FilterGroup as b8, type AdvancedFilterState as b9, type ReverseGeocodingParams as bA, type GeocodingParams as bB, type GeocodingAdapter as bC, NoopGeocodingAdapter as bD, type AttributeSchema as bE, type InferRecordFromSchema as bF, type InferRecordWithRequirements as bG, type TypedAttribute as bH, type AttributeMap as bI, type AddAttribute as bJ, type InferRecord as bK, type InferRecordInput as bL, type InferRecordUpdate as bM, type CustomAttributeValue as bN, type WithCustomAttributes as bO, type RecordMetadata as bP, type SystemFields as bQ, type ExtractRecord as bR, type ExtractRecordStrict as bS, type ExtractRecordInput as bT, type ExtractRecordInputStrict as bU, type ExtractRecordUpdate as bV, type ExtractRecordUpdateStrict as bW, type ExtractAttributes as bX, type TypedObjectRecord as bY, type ExtractObjectRecord as bZ, type ExtractObjectRecordWithCustom as b_, type SortDirection as ba, type QueryState as bb, OPERATORS_BY_TYPE as bc, type NoValueOperator as bd, NO_VALUE_OPERATORS as be, isNoValueOperator as bf, getRollupFilterOperators as bg, type FlowSlot as bh, type RelationFieldConfig as bi, type FlowRowField as bj, type FlowRowType as bk, type FlowHeadingRow as bl, type FlowSeparatorRow as bm, type FlowTextRow as bn, type FlowRow as bo, isFlowFieldsRow as bp, isLayoutRow as bq, type FlowPage as br, type FlowRelation as bs, type FlowStatus as bt, type FlowDefinition as bu, isFlowDefinition as bv, isFlowPublished as bw, isSystemFlow as bx, type GeocodingSuggestion as by, type GeocodingAutocompleteParams as bz, type AttributeGroupField as c, isCustomTab as c$, type AccessLevel as c0, ALL_ACTIONS as c1, actionsToAccessLevel as c2, accessLevelToActions as c3, type Role as c4, type Permission as c5, type UserRoleAssignment as c6, type EffectivePermissions as c7, type ObjectPermissions as c8, type SystemPermissions as c9, type CustomTab as cA, type ActivityTab as cB, type RichtextTab as cC, type FlowsTab as cD, type DocumentsTab as cE, type ListViewLayout as cF, type DetailViewConfig as cG, type CalendarViewConfig as cH, type TimelineViewConfig as cI, type GalleryViewConfig as cJ, type ViewConfig as cK, type CalendarViewDefinition as cL, type TimelineViewDefinition as cM, type GalleryViewDefinition as cN, type ConfigOverrides as cO, type ViewOverlay as cP, isDetailView as cQ, isListView as cR, isCalendarView as cS, isTimelineView as cT, isGalleryView as cU, isFieldGroup as cV, isRelationGroup as cW, isFormTab as cX, isTableTab as cY, isRelationSourceTab as cZ, isInverseSourceTab as c_, type CreateRoleInput as ca, type UpdateRoleInput as cb, type CreatePermissionInput as cc, type AssignRoleInput as cd, type PolicyContext as ce, type RecordPolicy as cf, PolicyViolationError as cg, type SandboxMode as ch, type SandboxExecutionStatus as ci, type SandboxTrigger as cj, type SandboxExecutionInput as ck, type SandboxExecutionResult as cl, type SandboxExecution as cm, type CreateSandboxExecution as cn, type UserStatus as co, USER_STATUSES as cp, type UserProfile as cq, type CreateUserProfile as cr, type UpdateUserProfile as cs, type InviteUserInput as ct, type TabType as cu, type FormDensity as cv, type FormTab as cw, type RelationSource as cx, type InverseSource as cy, type TableSource as cz, type FieldGroup as d, type GeneratedDocument as d$, isActivityTab as d0, isRichtextTab as d1, isFlowsTab as d2, isDocumentsTab as d3, type AIActionConfig as d4, type AIActionType as d5, type AINode as d6, type AssignmentMapping as d7, type AssignmentSource as d8, type AssignNode as d9, type WorkflowSlot as dA, type WorkflowStatus as dB, isSystemWorkflow as dC, isWorkflowDefinition as dD, isWorkflowPublished as dE, type PendingAction as dF, type WorkflowError as dG, type WorkflowInstance as dH, type WorkflowTransition as dI, canResumeInstance as dJ, createStartTransition as dK, isInstanceTerminal as dL, isInstanceWaiting as dM, type CreateInvitationInput as dN, type CreateInvitationResult as dO, type InvitationStatus as dP, type WorkflowInvitation as dQ, isInvitationAccepted as dR, isInvitationExpired as dS, isInvitationValid as dT, type CreateGrantInput as dU, type WorkflowAccessGrant as dV, canAccessNode as dW, isGrantExpired as dX, isGrantRevoked as dY, isGrantValid as dZ, isTokenRevoked as d_, type CodeExecutionAction as da, type ConditionNode as db, type DocumentGenerationAction as dc, type EndNode as dd, type FormFieldRef as de, type StartNode as df, isAdvancedFormNode as dg, isAINode as dh, isAssignNode as di, isConditionNode as dj, isEndNode as dk, isFormNode as dl, isSimpleFormNode as dm, isStartNode as dn, type ConditionOperator as dp, and as dq, eq as dr, inValues as ds, isConditionGroup as dt, isConditionRule as du, neq as dv, or as dw, type CanvasViewport as dx, type NodePosition as dy, type WorkflowLayout as dz, type SidePanelConfig as e, evaluateWithTrace as e$, type WorkflowExecutionContext as e0, createEmptyContext as e1, getContextValue as e2, setContextValue as e3, type FormContextResponse as e4, type FormFieldContext as e5, type FormFieldRow as e6, type FormFieldsRow as e7, type FormNodeInfo as e8, type ReadOnlyReason as e9, type CacheAdapter as eA, type CacheOptions as eB, cacheKeys as eC, cacheTtl as eD, defaultTtl as eE, NoopCacheAdapter as eF, type FetchResult as eG, type FormattedRecord as eH, type GroupedFetchResult as eI, type InsertOptions as eJ, type QueryBuilderState as eK, type RegistryMap as eL, type RegistryObjectNames as eM, type ShortcutOperator as eN, createDefaultState as eO, formatRecord as eP, formatRecords as eQ, QueryMultipleResultsError as eR, QueryNoResultError as eS, SHORTCUT_TO_FILTER_OPERATOR as eT, createQueryBuilder as eU, QueryBuilder as eV, type QueryBuilderOptions as eW, type EvaluationResult as eX, type EvaluationTrace as eY, evaluateCondition as eZ, evaluate as e_, type WorkflowAccessMode as ea, isFormFieldsRow as eb, type ThemeColors as ec, type ThemeLogo as ed, type ThemeTypography as ee, DEFAULT_THEME as ef, generateCssVariables as eg, mergeWithDefaults as eh, registry as ei, viewRegistry as ej, type ViewOverlaysRepository as ek, type RelationAttributeInput as el, type RelationAttributeRow as em, type RelationAttributesRepository as en, type SandboxExecutionsRepository as eo, SORTABLE_ATTRIBUTE_TYPES as ep, type SearchAdapter as eq, type DatabaseAdapter as er, WorkflowJwtService as es, type JwtVerificationResult as et, type MagicLinkPayload as eu, type WorkflowAccessPayload as ev, type WorkflowJwtConfig as ew, type WorkflowJwtPayload as ex, type CacheKeyType as ey, hashOptions as ez, type DetailViewDefinition as f, extractRelationNames as f$, TenantContextError as f0, FeatureFlagsContextError as f1, getFeatureFlags as f2, getFeatureValue as f3, hasFeatureFlagsContext as f4, isFeatureEnabled as f5, runWithFeatureFlags as f6, tryGetFeatureValue as f7, withFeatureFlags as f8, type FeatureFlagsContext as f9, ExecutorRegistry as fA, success as fB, wait as fC, ConditionExecutor as fD, EndExecutor as fE, FormExecutor as fF, AssignExecutor as fG, AIExecutor as fH, StartExecutor as fI, type AIActionRegistryDeps as fJ, createDefaultAIActionRegistry as fK, type AIActionHandler as fL, type AIActionResult as fM, type AgentExecutionInput as fN, type AgentExecutionOutput as fO, type CodeExecutionInput as fP, type CodeExecutionOutput as fQ, type SandboxExecutor as fR, AIActionRegistry as fS, DocumentGenerationHandler as fT, CodeExecutionHandler as fU, evaluateFormula as fV, evaluateFormulaAttribute as fW, evaluateFormulaAttributeWithRelations as fX, evaluateFormulaWithRelations as fY, evaluateFormulaWithResult as fZ, extractFormulaVariables as f_, addSchemaToContext as fa, getSchemaByNameFromContext as fb, getSchemaContext as fc, getSchemaFromContext as fd, hasSchemaContext as fe, runWithMergedSchemaContext as ff, runWithSchemaContext as fg, type SchemaContext as fh, getContext as fi, getTenantId as fj, getUserId as fk, hasContext as fl, runWithContext as fm, withTenantContext as fn, type TenantContext as fo, createDefaultExecutorRegistry as fp, getDefaultExecutorRegistry as fq, type ExecutorCompleteResult as fr, type ExecutorContext as fs, type ExecutorErrorResult as ft, type ExecutorResult as fu, type ExecutorSuccessResult as fv, type ExecutorWaitResult as fw, type NodeExecutor as fx, complete as fy, error as fz, type InstanceStatus as g, type QueryOptions as g$, extractRelationReferences as g0, flattenRelationsForEval as g1, formatFormulaResult as g2, hasRelationReferences as g3, validateFormulaExpression as g4, type FormulaResult as g5, getPathDepth as g6, getRelationPath as g7, getTargetAttributeName as g8, InvalidPathError as g9, type AttributesRepository as gA, type AuditRepository as gB, type DocumentJobsRepository as gC, type DocumentSlotsRepository as gD, type DocumentsRepository as gE, type FilesRepository as gF, type ObjectRecordsRepository as gG, type ObjectsRepository as gH, type PermissionsRepository as gI, type UserProfilesRepository as gJ, type ViewsRepository as gK, type WorkflowAccessGrantsRepository as gL, type WorkflowInstancesRepository as gM, type WorkflowInvitationsRepository as gN, type WorkflowsRepository as gO, BaseService as gP, BaseRepository as gQ, type SchemaContextAware as gR, SchemaContextAwareRepository as gS, type CreateCustomObjectInput as gT, type AddAttributeInput as gU, type UpdateObjectInput as gV, type ObjectSchemaServiceOptions as gW, ObjectSchemaService as gX, type RecordServiceOptions as gY, RecordService as gZ, type RecordQueryServiceOptions as g_, MaxDepthExceededError as ga, parsePath as gb, pathHasManyCardinality as gc, validatePath as gd, type PathCardinality as ge, type PathSegment as gf, type PathSegmentType as gg, type SchemaResolver as gh, resolveMultiplePaths as gi, resolveSingleValue as gj, traversePath as gk, type TraversalOptions as gl, type TraversalResult as gm, type AttributeChange as gn, type HookContext as go, type HookDefinition as gp, type HookHandler as gq, type HookType as gr, NoopHookRegistry as gs, type HookRegistry as gt, createMockAdapter as gu, type MockStores as gv, defaultPolicyRegistry as gw, PolicyRegistry as gx, type AIConversationsRepository as gy, type AIUsageMetricsRepository as gz, type TableTab as h, type WorkflowServiceOptions as h$, type SearchQueryOptions as h0, type QueryResult as h1, RecordQueryService as h2, type RelationValidationResult as h3, type RelationValidationError as h4, type RelationOption as h5, type RelationOptionsResponse as h6, type GetRelationOptionsParams as h7, type RelationServiceOptions as h8, type ResolveIdsBatchRequest as h9, enrichRecordsWithFormulas as hA, createContextForCreate as hB, createContextForUpdate as hC, createContextForDelete as hD, createContextForRestore as hE, recalculateParentRollups as hF, type RollupCascadeContext as hG, GrantNotFoundError as hH, GrantExpiredError as hI, GrantRevokedError as hJ, TokenRevokedError as hK, type GrantServiceConfig as hL, type CreateGrantResult as hM, WorkflowAccessGrantService as hN, type StartWorkflowInput as hO, type ResumeWorkflowInput as hP, type WorkflowInstanceServiceOptions as hQ, WorkflowInstanceService as hR, type InvitationServiceConfig as hS, InvitationNotFoundError as hT, InvitationExpiredError as hU, InvitationAlreadyAcceptedError as hV, InvitationRevokedError as hW, WorkflowInvitationService as hX, WorkflowRelationService as hY, type CreateWorkflowInput as hZ, type UpdateWorkflowInput as h_, type ResolveIdsBatchResponse as ha, RelationService as hb, type MultiRelationValue as hc, type SingleRelationValue as hd, type HybridRelationValue as he, RelationPropertiesService as hf, RecordResolverService as hg, type ResolvedRelations as hh, type FormulaResolverServiceOptions as hi, FormulaResolverService as hj, type RollupResult as hk, type RollupServiceOptions as hl, RollupService as hm, type RollupSchedulerOptions as hn, RollupScheduler as ho, applyDefaultValues as hp, checkPermission as hq, getPolicy as hr, buildPolicyContext as hs, checkRecordAccess as ht, checkRecordModifyOrThrow as hu, checkRecordDeleteOrThrow as hv, checkSharedObjectWriteAccess as hw, computeLabel as hx, type LabelResolver as hy, enrichWithFormulas as hz, type FilterState as i, type GlobalSearchGroupedOptions as i$, WorkflowService as i0, type UserValidationResult as i1, type UserValidationError as i2, UserService as i3, type UserProfileServiceOptions as i4, UserProfileService as i5, AuditService as i6, buildAuditChanges as i7, type DocumentProcessingConfig as i8, DocumentProcessingService as i9, syncNativeObjects as iA, verifyNativeObjectsSync as iB, getSyncPreview as iC, type FullSyncResult as iD, type FullSyncOptions as iE, syncAll as iF, DEFAULT_LABEL_FALLBACK as iG, renderLabelExpression as iH, isLabelExpression as iI, extractAttributeNames as iJ, enrichValuesForDisplay as iK, enrichValuesWithSelectLabels as iL, extractRelationIds as iM, type RelationLabelResolver as iN, computeLabelWithRelations as iO, type DBObject as iP, type CreateDBObject as iQ, type UpdateDBObject as iR, type UpsertDBObject as iS, type DBAttribute as iT, type CreateDBAttribute as iU, type UpdateDBAttribute as iV, type UpsertDBAttribute as iW, type CreateObjectRecord as iX, type ListOptions as iY, type SearchOptions as iZ, type GlobalSearchOptions as i_, type RecordDocumentsResult as ia, type CreateRecordDocumentInput as ib, type CreateRecordDocumentResult as ic, type DocumentServiceOptions as id, DocumentService as ie, type FileServiceOptions as ig, FileService as ih, GeocodingService as ii, GlobalSearchService as ij, type PermissionServiceOptions as ik, PermissionService as il, type CreateViewInput as im, type UpdateViewInput as io, type GetViewsOptions as ip, type GetViewOptions as iq, ViewService as ir, type FileContent as is, type StorageUploadInput as it, type StorageUploadResult as iu, type SignedUrlOptions as iv, type StorageAdapter as iw, type UploadFileInput as ix, type SyncResult as iy, type SyncOptions as iz, type SortRule as j, type GlobalSearchResultItem as j0, type GlobalSearchGroupedResult as j1, type FileListOptions as j2, type DBView as j3, type CreateDBView as j4, type UpdateDBView as j5, type UpsertDBView as j6, type DBViewOverlay as j7, type CreateDBViewOverlay as j8, type UpdateDBViewOverlay as j9, type DBWorkflow as ja, type CreateDBWorkflow as jb, type UpdateDBWorkflow as jc, type DBWorkflowInstance as jd, type CreateDBWorkflowInstance as je, type UpdateDBWorkflowInstance as jf, type DBWorkflowInvitation as jg, type CreateDBWorkflowInvitation as jh, type UpdateDBWorkflowInvitation as ji, type DBWorkflowAccessGrant as jj, type CreateDBWorkflowAccessGrant as jk, type UpdateDBWorkflowAccessGrant as jl, type OperationResult as jm, type ViewSyncResult as jn, type ViewSyncLogger as jo, type ViewSyncOptions as jp, seedRegistryViews as jq, syncNativeViews as jr, verifyRegistryViewsSeeded as js, verifyNativeViewsSync as jt, getViewSeedPreview as ju, getViewSyncPreview as jv, type WorkflowTheme as k, type WorkflowConfig as l, type SlotMode as m, type ConditionGroup as n, type ConditionRule as o, type WorkflowDefinition as p, type FlowFieldsRow as q, type ListViewConfig as r, type ListViewTab as s, type ViewDefinition as t, type OcrInput as u, type OcrOptions as v, type OcrResult as w, type OcrPage as x, type OcrTextBlock as y, type SignatureAdapter as z };