@objectstack/service-ai 6.0.0 → 6.1.1

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.
package/dist/index.d.cts CHANGED
@@ -7,6 +7,7 @@ import { Plugin, PluginContext } from '@objectstack/core';
7
7
  import { LanguageModelV2 } from '@ai-sdk/provider';
8
8
  import { TextStreamPart as TextStreamPart$1, ToolSet as ToolSet$1 } from 'ai';
9
9
  import { InstalledPackage } from '@objectstack/spec/kernel';
10
+ import { Action } from '@objectstack/spec/ui';
10
11
  import * as _objectstack_spec_data from '@objectstack/spec/data';
11
12
 
12
13
  /**
@@ -325,6 +326,7 @@ declare class AIService implements IAIService {
325
326
  * maximum number of iterations (`maxIterations`) is reached.
326
327
  */
327
328
  chatWithTools(messages: ModelMessage[], options?: ChatWithToolsOptions): Promise<AIResult>;
329
+ private chatWithToolsImpl;
328
330
  /**
329
331
  * Stream chat with automatic tool call resolution.
330
332
  *
@@ -937,6 +939,102 @@ interface PackageToolContext {
937
939
  */
938
940
  declare function registerPackageTools(registry: ToolRegistry, context: PackageToolContext): void;
939
941
 
942
+ /**
943
+ * Actions-as-Tools — turn declarative {@link Action} metadata into
944
+ * AI-callable tools so an agent can not only **read** the user's data
945
+ * (via `query_data` / `data_explorer`) but also **act** on it.
946
+ *
947
+ * Phase 1 scope (this module):
948
+ * - Only `type: 'script'` actions are auto-exposed. Their handler is
949
+ * resolved through {@link IDataEngine.executeAction} (the same
950
+ * dispatcher used by Studio's "row toolbar" buttons), so the LLM
951
+ * ends up calling exactly the same business logic the UI does.
952
+ * - Skip any action that is dangerous (`confirmText`, `variant: 'danger'`,
953
+ * `mode: 'delete'`) — these require Phase 2 HITL plumbing.
954
+ * - Skip any action whose owner opted out via `aiExposed: false` (the
955
+ * hint is read from the action record but not formalised in the Zod
956
+ * schema yet; spec change is backwards-compatible additive).
957
+ *
958
+ * The tool's JSON Schema is materialised from `action.params[]`,
959
+ * resolving field-backed params (`{ field: 'priority' }`) against the
960
+ * owning object so the LLM sees the same type/options/required
961
+ * constraints the modal dialog would render.
962
+ */
963
+
964
+ /** Minimal field shape we care about when resolving param types. */
965
+ interface FieldDef {
966
+ type?: string;
967
+ label?: string;
968
+ required?: boolean;
969
+ options?: Array<{
970
+ value: string;
971
+ label?: unknown;
972
+ } | string>;
973
+ description?: string;
974
+ }
975
+ /** Minimal object shape — same as what {@link SchemaRetriever} consumes. */
976
+ interface ObjectDef {
977
+ name: string;
978
+ label?: string;
979
+ pluralLabel?: string;
980
+ fields?: Record<string, FieldDef>;
981
+ actions?: Action[];
982
+ }
983
+ /**
984
+ * Dependencies needed to invoke an Action from the AI tool runtime.
985
+ *
986
+ * The `metadata` service is used at registration time to resolve param
987
+ * field types; the `dataEngine` is used at call time to (a) load the
988
+ * subject record when a `recordIdParam` is configured and (b) dispatch
989
+ * to the registered handler via `executeAction`.
990
+ *
991
+ * `principal` lets callers attribute AI-initiated mutations to a known
992
+ * user id; it defaults to a synthetic `'ai_agent'` user so traces /
993
+ * audit always have *some* actor.
994
+ */
995
+ interface ActionToolsContext {
996
+ metadata: IMetadataService;
997
+ dataEngine: IDataEngine;
998
+ /** Synthetic user attribution for AI-initiated calls. */
999
+ principal?: {
1000
+ id: string;
1001
+ name?: string;
1002
+ };
1003
+ /** Tool-name prefix (default: `action_`). Keeps namespace separate from data tools. */
1004
+ toolPrefix?: string;
1005
+ }
1006
+ /**
1007
+ * Decide whether an action should be auto-exposed as a tool.
1008
+ *
1009
+ * Returns `null` when exposed, or a string reason when skipped.
1010
+ * Exported for tests and Studio "AI exposure" diagnostics.
1011
+ */
1012
+ declare function actionSkipReason(action: Action): string | null;
1013
+ /** Compute the AI tool name for a given action (prefixed for namespacing). */
1014
+ declare function actionToolName(action: Action, prefix?: string): string;
1015
+ /**
1016
+ * Convert a single {@link Action} into a complete {@link AIToolDefinition}.
1017
+ *
1018
+ * Returns `null` when the action is filtered out by {@link actionSkipReason}.
1019
+ */
1020
+ declare function actionToToolDefinition(action: Action, ownerObject: ObjectDef | undefined, allObjects: Map<string, ObjectDef>, toolPrefix?: string): AIToolDefinition | null;
1021
+ /**
1022
+ * Walk every registered object in the {@link IMetadataService}, pick out
1023
+ * each object's actions, and register the ones that pass {@link actionSkipReason}
1024
+ * as AI tools.
1025
+ *
1026
+ * Returns the list of registered tool names and a parallel list of
1027
+ * `{ action, reason }` for actions that were intentionally skipped —
1028
+ * useful for Studio's "AI exposure" diagnostics surface.
1029
+ */
1030
+ declare function registerActionsAsTools(registry: ToolRegistry, context: ActionToolsContext): Promise<{
1031
+ registered: string[];
1032
+ skipped: Array<{
1033
+ action: string;
1034
+ reason: string;
1035
+ }>;
1036
+ }>;
1037
+
940
1038
  /**
941
1039
  * Runtime context passed when chatting with the ambient assistant.
942
1040
  *
@@ -1229,6 +1327,58 @@ declare const DATA_CHAT_AGENT: Agent;
1229
1327
  */
1230
1328
  declare const METADATA_ASSISTANT_AGENT: Agent;
1231
1329
 
1330
+ /**
1331
+ * Built-in `data_explorer` skill — the read-only data-Q&A capability
1332
+ * bundle that the `data_chat` agent (and any other agent that wants
1333
+ * data-exploration powers) attaches to its `skills[]`.
1334
+ *
1335
+ * Following the platform's metadata-driven philosophy, the agent
1336
+ * itself no longer hardcodes which tools it can call; instead it
1337
+ * names this skill and the SkillRegistry resolves the tool list at
1338
+ * request time. Disabling this skill via the metadata service
1339
+ * disables data exploration for every agent that references it,
1340
+ * without code changes.
1341
+ */
1342
+ declare const DATA_EXPLORER_SKILL: Skill;
1343
+
1344
+ /**
1345
+ * Built-in `metadata_authoring` skill — the write-side schema-design
1346
+ * capability bundle attached to the `metadata_assistant` agent (and
1347
+ * any other agent that should be allowed to mutate schema).
1348
+ *
1349
+ * Splitting this off from the agent record lets us:
1350
+ * - Reuse the same authoring tools across multiple agent personas
1351
+ * (e.g. an "ops bot" that ALSO can author).
1352
+ * - Disable authoring globally by setting `active: false` on the
1353
+ * skill metadata, without redeploying the agent.
1354
+ * - Layer permissions via `Skill.permissions` independent of the
1355
+ * agent's permissions.
1356
+ */
1357
+ declare const METADATA_AUTHORING_SKILL: Skill;
1358
+
1359
+ /**
1360
+ * Built-in `actions_executor` skill — the write-side counterpart to
1361
+ * `data_explorer`.
1362
+ *
1363
+ * Where `data_explorer` lets an agent **answer** questions about the
1364
+ * user's data, `actions_executor` lets the same agent **perform**
1365
+ * business operations: complete tasks, start workflows, send invites,
1366
+ * etc. The concrete tools are not enumerated here — they're materialised
1367
+ * at runtime from every `Action` declared on every object the metadata
1368
+ * service knows about (see `registerActionsAsTools` in
1369
+ * `tools/action-tools.ts`). The skill records the *intent* ("agent may
1370
+ * invoke business actions"); the registry expands it into actual tools
1371
+ * after metadata is loaded.
1372
+ *
1373
+ * The `tools` array is intentionally empty — Phase 1 lets the
1374
+ * skill-registry resolver fall through to the global tool list when an
1375
+ * agent's skill bundle would otherwise filter out the dynamically
1376
+ * registered `action_*` tools. Skills that want to restrict the set
1377
+ * should be authored project-side with the specific `action_<name>`
1378
+ * tools they want to expose.
1379
+ */
1380
+ declare const ACTIONS_EXECUTOR_SKILL: Skill;
1381
+
1232
1382
  declare const ActionRefSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1233
1383
  type: z.ZodString;
1234
1384
  params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1855,7 +2005,7 @@ declare const AiConversationObject: Omit<{
1855
2005
  trash: boolean;
1856
2006
  mru: boolean;
1857
2007
  clone: boolean;
1858
- apiMethods?: ("search" | "upsert" | "create" | "import" | "delete" | "list" | "get" | "update" | "history" | "bulk" | "aggregate" | "restore" | "purge" | "export")[] | undefined;
2008
+ apiMethods?: ("restore" | "export" | "import" | "search" | "upsert" | "create" | "delete" | "list" | "get" | "update" | "history" | "bulk" | "aggregate" | "purge")[] | undefined;
1859
2009
  } | undefined;
1860
2010
  recordTypes?: string[] | undefined;
1861
2011
  sharingModel?: "private" | "read" | "full" | "read_write" | undefined;
@@ -1926,6 +2076,7 @@ declare const AiConversationObject: Omit<{
1926
2076
  } | undefined;
1927
2077
  shortcut?: string | undefined;
1928
2078
  bulkEnabled?: boolean | undefined;
2079
+ aiExposed?: boolean | undefined;
1929
2080
  recordIdParam?: string | undefined;
1930
2081
  recordIdField?: string | undefined;
1931
2082
  bodyShape?: "flat" | {
@@ -3779,7 +3930,7 @@ declare const AiMessageObject: Omit<{
3779
3930
  trash: boolean;
3780
3931
  mru: boolean;
3781
3932
  clone: boolean;
3782
- apiMethods?: ("search" | "upsert" | "create" | "import" | "delete" | "list" | "get" | "update" | "history" | "bulk" | "aggregate" | "restore" | "purge" | "export")[] | undefined;
3933
+ apiMethods?: ("restore" | "export" | "import" | "search" | "upsert" | "create" | "delete" | "list" | "get" | "update" | "history" | "bulk" | "aggregate" | "purge")[] | undefined;
3783
3934
  } | undefined;
3784
3935
  recordTypes?: string[] | undefined;
3785
3936
  sharingModel?: "private" | "read" | "full" | "read_write" | undefined;
@@ -3850,6 +4001,7 @@ declare const AiMessageObject: Omit<{
3850
4001
  } | undefined;
3851
4002
  shortcut?: string | undefined;
3852
4003
  bulkEnabled?: boolean | undefined;
4004
+ aiExposed?: boolean | undefined;
3853
4005
  recordIdParam?: string | undefined;
3854
4006
  recordIdField?: string | undefined;
3855
4007
  bodyShape?: "flat" | {
@@ -5705,7 +5857,7 @@ declare const AiTraceObject: Omit<{
5705
5857
  trash: boolean;
5706
5858
  mru: boolean;
5707
5859
  clone: boolean;
5708
- apiMethods?: ("search" | "upsert" | "create" | "import" | "delete" | "list" | "get" | "update" | "history" | "bulk" | "aggregate" | "restore" | "purge" | "export")[] | undefined;
5860
+ apiMethods?: ("restore" | "export" | "import" | "search" | "upsert" | "create" | "delete" | "list" | "get" | "update" | "history" | "bulk" | "aggregate" | "purge")[] | undefined;
5709
5861
  } | undefined;
5710
5862
  recordTypes?: string[] | undefined;
5711
5863
  sharingModel?: "private" | "read" | "full" | "read_write" | undefined;
@@ -5776,6 +5928,7 @@ declare const AiTraceObject: Omit<{
5776
5928
  } | undefined;
5777
5929
  shortcut?: string | undefined;
5778
5930
  bulkEnabled?: boolean | undefined;
5931
+ aiExposed?: boolean | undefined;
5779
5932
  recordIdParam?: string | undefined;
5780
5933
  recordIdField?: string | undefined;
5781
5934
  bodyShape?: "flat" | {
@@ -8971,6 +9124,745 @@ declare const AiTraceObject: Omit<{
8971
9124
  };
8972
9125
  }, "fields">;
8973
9126
 
9127
+ /**
9128
+ * ai_traces — built-in Studio list view.
9129
+ *
9130
+ * Exposes per-call observability for every LLM invocation that flowed
9131
+ * through the `AIService`. Ships with the platform so users don't have
9132
+ * to author a view for an object they didn't create.
9133
+ *
9134
+ * - Default list: grid sorted by `created_at` desc, showing the columns an
9135
+ * operator usually wants at a glance (operation, model, latency, tokens,
9136
+ * cost, status).
9137
+ * - `errors` view: pre-filtered to status="error" for triage.
9138
+ * - `by_model` view: grouped by model for cost / quality comparison.
9139
+ *
9140
+ * Registered via the AIService plugin's manifest payload — appears
9141
+ * automatically in Studio when AIService is loaded.
9142
+ */
9143
+ declare const AiTraceView: {
9144
+ list?: {
9145
+ type: "map" | "kanban" | "calendar" | "gantt" | "gallery" | "timeline" | "chart" | "grid";
9146
+ columns: string[] | {
9147
+ field: string;
9148
+ label?: string | undefined;
9149
+ width?: number | undefined;
9150
+ align?: "left" | "center" | "right" | undefined;
9151
+ hidden?: boolean | undefined;
9152
+ sortable?: boolean | undefined;
9153
+ resizable?: boolean | undefined;
9154
+ wrap?: boolean | undefined;
9155
+ type?: string | undefined;
9156
+ pinned?: "left" | "right" | undefined;
9157
+ summary?: "none" | "min" | "max" | "count" | "sum" | "avg" | "count_empty" | "count_filled" | "count_unique" | "percent_empty" | "percent_filled" | undefined;
9158
+ link?: boolean | undefined;
9159
+ action?: string | undefined;
9160
+ }[];
9161
+ name?: string | undefined;
9162
+ label?: string | undefined;
9163
+ data?: {
9164
+ provider: "object";
9165
+ object: string;
9166
+ } | {
9167
+ provider: "api";
9168
+ read?: {
9169
+ url: string;
9170
+ method: "GET" | "POST" | "DELETE" | "PATCH" | "PUT";
9171
+ headers?: Record<string, string> | undefined;
9172
+ params?: Record<string, unknown> | undefined;
9173
+ body?: unknown;
9174
+ } | undefined;
9175
+ write?: {
9176
+ url: string;
9177
+ method: "GET" | "POST" | "DELETE" | "PATCH" | "PUT";
9178
+ headers?: Record<string, string> | undefined;
9179
+ params?: Record<string, unknown> | undefined;
9180
+ body?: unknown;
9181
+ } | undefined;
9182
+ } | {
9183
+ provider: "value";
9184
+ items: unknown[];
9185
+ } | undefined;
9186
+ filter?: {
9187
+ field: string;
9188
+ operator: string;
9189
+ value?: string | number | boolean | (string | number)[] | null | undefined;
9190
+ }[] | undefined;
9191
+ sort?: string | {
9192
+ field: string;
9193
+ order: "asc" | "desc";
9194
+ }[] | undefined;
9195
+ searchableFields?: string[] | undefined;
9196
+ filterableFields?: string[] | undefined;
9197
+ resizable?: boolean | undefined;
9198
+ striped?: boolean | undefined;
9199
+ bordered?: boolean | undefined;
9200
+ compactToolbar?: boolean | undefined;
9201
+ selection?: {
9202
+ type: "none" | "multiple" | "single";
9203
+ } | undefined;
9204
+ navigation?: {
9205
+ mode: "none" | "split" | "page" | "modal" | "drawer" | "popover" | "new_window";
9206
+ preventNavigation: boolean;
9207
+ openNewTab: boolean;
9208
+ view?: string | undefined;
9209
+ width?: string | number | undefined;
9210
+ } | undefined;
9211
+ pagination?: {
9212
+ pageSize: number;
9213
+ pageSizeOptions?: number[] | undefined;
9214
+ } | undefined;
9215
+ kanban?: {
9216
+ groupByField: string;
9217
+ columns: string[];
9218
+ summarizeField?: string | undefined;
9219
+ } | undefined;
9220
+ calendar?: {
9221
+ startDateField: string;
9222
+ titleField: string;
9223
+ endDateField?: string | undefined;
9224
+ colorField?: string | undefined;
9225
+ } | undefined;
9226
+ gantt?: {
9227
+ startDateField: string;
9228
+ endDateField: string;
9229
+ titleField: string;
9230
+ progressField?: string | undefined;
9231
+ dependenciesField?: string | undefined;
9232
+ } | undefined;
9233
+ gallery?: {
9234
+ coverFit: "cover" | "contain";
9235
+ cardSize: "small" | "medium" | "large";
9236
+ coverField?: string | undefined;
9237
+ titleField?: string | undefined;
9238
+ visibleFields?: string[] | undefined;
9239
+ } | undefined;
9240
+ timeline?: {
9241
+ startDateField: string;
9242
+ titleField: string;
9243
+ scale: "day" | "week" | "month" | "quarter" | "year" | "hour";
9244
+ endDateField?: string | undefined;
9245
+ groupByField?: string | undefined;
9246
+ colorField?: string | undefined;
9247
+ } | undefined;
9248
+ chart?: {
9249
+ chartType: "bar" | "line" | "pie" | "area" | "scatter";
9250
+ xAxisField: string;
9251
+ yAxisFields: string[];
9252
+ aggregation?: "min" | "max" | "count" | "sum" | "avg" | undefined;
9253
+ groupByField?: string | undefined;
9254
+ } | undefined;
9255
+ description?: string | undefined;
9256
+ sharing?: {
9257
+ type: "personal" | "collaborative";
9258
+ lockedBy?: string | undefined;
9259
+ } | undefined;
9260
+ rowHeight?: "medium" | "short" | "compact" | "tall" | "extra_tall" | undefined;
9261
+ grouping?: {
9262
+ fields: {
9263
+ field: string;
9264
+ order: "asc" | "desc";
9265
+ collapsed: boolean;
9266
+ }[];
9267
+ } | undefined;
9268
+ rowColor?: {
9269
+ field: string;
9270
+ colors?: Record<string, string> | undefined;
9271
+ } | undefined;
9272
+ hiddenFields?: string[] | undefined;
9273
+ fieldOrder?: string[] | undefined;
9274
+ rowActions?: string[] | undefined;
9275
+ bulkActions?: string[] | undefined;
9276
+ bulkActionDefs?: Record<string, any>[] | undefined;
9277
+ virtualScroll?: boolean | undefined;
9278
+ conditionalFormatting?: {
9279
+ condition: {
9280
+ dialect: "cel" | "js" | "cron" | "template";
9281
+ source?: string | undefined;
9282
+ ast?: unknown;
9283
+ meta?: {
9284
+ rationale?: string | undefined;
9285
+ generatedBy?: string | undefined;
9286
+ } | undefined;
9287
+ } | {
9288
+ dialect: "cel" | "js" | "cron" | "template";
9289
+ source?: string | undefined;
9290
+ ast?: unknown;
9291
+ meta?: {
9292
+ rationale?: string | undefined;
9293
+ generatedBy?: string | undefined;
9294
+ } | undefined;
9295
+ };
9296
+ style: Record<string, string>;
9297
+ }[] | undefined;
9298
+ inlineEdit?: boolean | undefined;
9299
+ exportOptions?: ("json" | "csv" | "xlsx" | "pdf")[] | undefined;
9300
+ userActions?: {
9301
+ sort: boolean;
9302
+ search: boolean;
9303
+ filter: boolean;
9304
+ rowHeight: boolean;
9305
+ addRecordForm: boolean;
9306
+ buttons?: string[] | undefined;
9307
+ } | undefined;
9308
+ appearance?: {
9309
+ showDescription: boolean;
9310
+ allowedVisualizations?: ("map" | "kanban" | "calendar" | "gantt" | "gallery" | "timeline" | "grid")[] | undefined;
9311
+ } | undefined;
9312
+ tabs?: {
9313
+ name: string;
9314
+ pinned: boolean;
9315
+ isDefault: boolean;
9316
+ visible: boolean;
9317
+ label?: string | undefined;
9318
+ icon?: string | undefined;
9319
+ view?: string | undefined;
9320
+ filter?: {
9321
+ field: string;
9322
+ operator: string;
9323
+ value?: string | number | boolean | (string | number)[] | null | undefined;
9324
+ }[] | undefined;
9325
+ order?: number | undefined;
9326
+ }[] | undefined;
9327
+ addRecord?: {
9328
+ enabled: boolean;
9329
+ position: "top" | "bottom" | "both";
9330
+ mode: "modal" | "form" | "inline";
9331
+ formView?: string | undefined;
9332
+ } | undefined;
9333
+ showRecordCount?: boolean | undefined;
9334
+ allowPrinting?: boolean | undefined;
9335
+ emptyState?: {
9336
+ title?: string | undefined;
9337
+ message?: string | undefined;
9338
+ icon?: string | undefined;
9339
+ } | undefined;
9340
+ aria?: {
9341
+ ariaLabel?: string | undefined;
9342
+ ariaDescribedBy?: string | undefined;
9343
+ role?: string | undefined;
9344
+ } | undefined;
9345
+ responsive?: {
9346
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
9347
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
9348
+ columns?: {
9349
+ xs?: number | undefined;
9350
+ sm?: number | undefined;
9351
+ md?: number | undefined;
9352
+ lg?: number | undefined;
9353
+ xl?: number | undefined;
9354
+ '2xl'?: number | undefined;
9355
+ } | undefined;
9356
+ order?: {
9357
+ xs?: number | undefined;
9358
+ sm?: number | undefined;
9359
+ md?: number | undefined;
9360
+ lg?: number | undefined;
9361
+ xl?: number | undefined;
9362
+ '2xl'?: number | undefined;
9363
+ } | undefined;
9364
+ } | undefined;
9365
+ performance?: {
9366
+ lazyLoad?: boolean | undefined;
9367
+ virtualScroll?: {
9368
+ enabled: boolean;
9369
+ itemHeight?: number | undefined;
9370
+ overscan?: number | undefined;
9371
+ } | undefined;
9372
+ cacheStrategy?: "none" | "cache-first" | "network-first" | "stale-while-revalidate" | undefined;
9373
+ prefetch?: boolean | undefined;
9374
+ pageSize?: number | undefined;
9375
+ debounceMs?: number | undefined;
9376
+ } | undefined;
9377
+ } | undefined;
9378
+ form?: {
9379
+ type: "split" | "modal" | "drawer" | "simple" | "tabbed" | "wizard";
9380
+ data?: {
9381
+ provider: "object";
9382
+ object: string;
9383
+ } | {
9384
+ provider: "api";
9385
+ read?: {
9386
+ url: string;
9387
+ method: "GET" | "POST" | "DELETE" | "PATCH" | "PUT";
9388
+ headers?: Record<string, string> | undefined;
9389
+ params?: Record<string, unknown> | undefined;
9390
+ body?: unknown;
9391
+ } | undefined;
9392
+ write?: {
9393
+ url: string;
9394
+ method: "GET" | "POST" | "DELETE" | "PATCH" | "PUT";
9395
+ headers?: Record<string, string> | undefined;
9396
+ params?: Record<string, unknown> | undefined;
9397
+ body?: unknown;
9398
+ } | undefined;
9399
+ } | {
9400
+ provider: "value";
9401
+ items: unknown[];
9402
+ } | undefined;
9403
+ sections?: {
9404
+ collapsible: boolean;
9405
+ collapsed: boolean;
9406
+ columns: 1 | 2 | 3 | 4;
9407
+ fields: (string | {
9408
+ field: string;
9409
+ label?: string | undefined;
9410
+ placeholder?: string | undefined;
9411
+ helpText?: string | undefined;
9412
+ readonly?: boolean | undefined;
9413
+ required?: boolean | undefined;
9414
+ hidden?: boolean | undefined;
9415
+ colSpan?: number | undefined;
9416
+ widget?: string | undefined;
9417
+ dependsOn?: string | undefined;
9418
+ visibleOn?: {
9419
+ dialect: "cel" | "js" | "cron" | "template";
9420
+ source?: string | undefined;
9421
+ ast?: unknown;
9422
+ meta?: {
9423
+ rationale?: string | undefined;
9424
+ generatedBy?: string | undefined;
9425
+ } | undefined;
9426
+ } | {
9427
+ dialect: "cel" | "js" | "cron" | "template";
9428
+ source?: string | undefined;
9429
+ ast?: unknown;
9430
+ meta?: {
9431
+ rationale?: string | undefined;
9432
+ generatedBy?: string | undefined;
9433
+ } | undefined;
9434
+ } | undefined;
9435
+ })[];
9436
+ label?: string | undefined;
9437
+ }[] | undefined;
9438
+ groups?: {
9439
+ collapsible: boolean;
9440
+ collapsed: boolean;
9441
+ columns: 1 | 2 | 3 | 4;
9442
+ fields: (string | {
9443
+ field: string;
9444
+ label?: string | undefined;
9445
+ placeholder?: string | undefined;
9446
+ helpText?: string | undefined;
9447
+ readonly?: boolean | undefined;
9448
+ required?: boolean | undefined;
9449
+ hidden?: boolean | undefined;
9450
+ colSpan?: number | undefined;
9451
+ widget?: string | undefined;
9452
+ dependsOn?: string | undefined;
9453
+ visibleOn?: {
9454
+ dialect: "cel" | "js" | "cron" | "template";
9455
+ source?: string | undefined;
9456
+ ast?: unknown;
9457
+ meta?: {
9458
+ rationale?: string | undefined;
9459
+ generatedBy?: string | undefined;
9460
+ } | undefined;
9461
+ } | {
9462
+ dialect: "cel" | "js" | "cron" | "template";
9463
+ source?: string | undefined;
9464
+ ast?: unknown;
9465
+ meta?: {
9466
+ rationale?: string | undefined;
9467
+ generatedBy?: string | undefined;
9468
+ } | undefined;
9469
+ } | undefined;
9470
+ })[];
9471
+ label?: string | undefined;
9472
+ }[] | undefined;
9473
+ defaultSort?: {
9474
+ field: string;
9475
+ order: "asc" | "desc";
9476
+ }[] | undefined;
9477
+ sharing?: {
9478
+ enabled: boolean;
9479
+ allowAnonymous: boolean;
9480
+ publicLink?: string | undefined;
9481
+ password?: string | undefined;
9482
+ allowedDomains?: string[] | undefined;
9483
+ expiresAt?: string | undefined;
9484
+ } | undefined;
9485
+ submitBehavior?: {
9486
+ kind: "thank-you";
9487
+ title?: string | undefined;
9488
+ message?: string | undefined;
9489
+ } | {
9490
+ kind: "redirect";
9491
+ url: string;
9492
+ delayMs?: number | undefined;
9493
+ } | {
9494
+ kind: "continue";
9495
+ } | {
9496
+ kind: "next-record";
9497
+ } | undefined;
9498
+ aria?: {
9499
+ ariaLabel?: string | undefined;
9500
+ ariaDescribedBy?: string | undefined;
9501
+ role?: string | undefined;
9502
+ } | undefined;
9503
+ } | undefined;
9504
+ listViews?: Record<string, {
9505
+ type: "map" | "kanban" | "calendar" | "gantt" | "gallery" | "timeline" | "chart" | "grid";
9506
+ columns: string[] | {
9507
+ field: string;
9508
+ label?: string | undefined;
9509
+ width?: number | undefined;
9510
+ align?: "left" | "center" | "right" | undefined;
9511
+ hidden?: boolean | undefined;
9512
+ sortable?: boolean | undefined;
9513
+ resizable?: boolean | undefined;
9514
+ wrap?: boolean | undefined;
9515
+ type?: string | undefined;
9516
+ pinned?: "left" | "right" | undefined;
9517
+ summary?: "none" | "min" | "max" | "count" | "sum" | "avg" | "count_empty" | "count_filled" | "count_unique" | "percent_empty" | "percent_filled" | undefined;
9518
+ link?: boolean | undefined;
9519
+ action?: string | undefined;
9520
+ }[];
9521
+ name?: string | undefined;
9522
+ label?: string | undefined;
9523
+ data?: {
9524
+ provider: "object";
9525
+ object: string;
9526
+ } | {
9527
+ provider: "api";
9528
+ read?: {
9529
+ url: string;
9530
+ method: "GET" | "POST" | "DELETE" | "PATCH" | "PUT";
9531
+ headers?: Record<string, string> | undefined;
9532
+ params?: Record<string, unknown> | undefined;
9533
+ body?: unknown;
9534
+ } | undefined;
9535
+ write?: {
9536
+ url: string;
9537
+ method: "GET" | "POST" | "DELETE" | "PATCH" | "PUT";
9538
+ headers?: Record<string, string> | undefined;
9539
+ params?: Record<string, unknown> | undefined;
9540
+ body?: unknown;
9541
+ } | undefined;
9542
+ } | {
9543
+ provider: "value";
9544
+ items: unknown[];
9545
+ } | undefined;
9546
+ filter?: {
9547
+ field: string;
9548
+ operator: string;
9549
+ value?: string | number | boolean | (string | number)[] | null | undefined;
9550
+ }[] | undefined;
9551
+ sort?: string | {
9552
+ field: string;
9553
+ order: "asc" | "desc";
9554
+ }[] | undefined;
9555
+ searchableFields?: string[] | undefined;
9556
+ filterableFields?: string[] | undefined;
9557
+ resizable?: boolean | undefined;
9558
+ striped?: boolean | undefined;
9559
+ bordered?: boolean | undefined;
9560
+ compactToolbar?: boolean | undefined;
9561
+ selection?: {
9562
+ type: "none" | "multiple" | "single";
9563
+ } | undefined;
9564
+ navigation?: {
9565
+ mode: "none" | "split" | "page" | "modal" | "drawer" | "popover" | "new_window";
9566
+ preventNavigation: boolean;
9567
+ openNewTab: boolean;
9568
+ view?: string | undefined;
9569
+ width?: string | number | undefined;
9570
+ } | undefined;
9571
+ pagination?: {
9572
+ pageSize: number;
9573
+ pageSizeOptions?: number[] | undefined;
9574
+ } | undefined;
9575
+ kanban?: {
9576
+ groupByField: string;
9577
+ columns: string[];
9578
+ summarizeField?: string | undefined;
9579
+ } | undefined;
9580
+ calendar?: {
9581
+ startDateField: string;
9582
+ titleField: string;
9583
+ endDateField?: string | undefined;
9584
+ colorField?: string | undefined;
9585
+ } | undefined;
9586
+ gantt?: {
9587
+ startDateField: string;
9588
+ endDateField: string;
9589
+ titleField: string;
9590
+ progressField?: string | undefined;
9591
+ dependenciesField?: string | undefined;
9592
+ } | undefined;
9593
+ gallery?: {
9594
+ coverFit: "cover" | "contain";
9595
+ cardSize: "small" | "medium" | "large";
9596
+ coverField?: string | undefined;
9597
+ titleField?: string | undefined;
9598
+ visibleFields?: string[] | undefined;
9599
+ } | undefined;
9600
+ timeline?: {
9601
+ startDateField: string;
9602
+ titleField: string;
9603
+ scale: "day" | "week" | "month" | "quarter" | "year" | "hour";
9604
+ endDateField?: string | undefined;
9605
+ groupByField?: string | undefined;
9606
+ colorField?: string | undefined;
9607
+ } | undefined;
9608
+ chart?: {
9609
+ chartType: "bar" | "line" | "pie" | "area" | "scatter";
9610
+ xAxisField: string;
9611
+ yAxisFields: string[];
9612
+ aggregation?: "min" | "max" | "count" | "sum" | "avg" | undefined;
9613
+ groupByField?: string | undefined;
9614
+ } | undefined;
9615
+ description?: string | undefined;
9616
+ sharing?: {
9617
+ type: "personal" | "collaborative";
9618
+ lockedBy?: string | undefined;
9619
+ } | undefined;
9620
+ rowHeight?: "medium" | "short" | "compact" | "tall" | "extra_tall" | undefined;
9621
+ grouping?: {
9622
+ fields: {
9623
+ field: string;
9624
+ order: "asc" | "desc";
9625
+ collapsed: boolean;
9626
+ }[];
9627
+ } | undefined;
9628
+ rowColor?: {
9629
+ field: string;
9630
+ colors?: Record<string, string> | undefined;
9631
+ } | undefined;
9632
+ hiddenFields?: string[] | undefined;
9633
+ fieldOrder?: string[] | undefined;
9634
+ rowActions?: string[] | undefined;
9635
+ bulkActions?: string[] | undefined;
9636
+ bulkActionDefs?: Record<string, any>[] | undefined;
9637
+ virtualScroll?: boolean | undefined;
9638
+ conditionalFormatting?: {
9639
+ condition: {
9640
+ dialect: "cel" | "js" | "cron" | "template";
9641
+ source?: string | undefined;
9642
+ ast?: unknown;
9643
+ meta?: {
9644
+ rationale?: string | undefined;
9645
+ generatedBy?: string | undefined;
9646
+ } | undefined;
9647
+ } | {
9648
+ dialect: "cel" | "js" | "cron" | "template";
9649
+ source?: string | undefined;
9650
+ ast?: unknown;
9651
+ meta?: {
9652
+ rationale?: string | undefined;
9653
+ generatedBy?: string | undefined;
9654
+ } | undefined;
9655
+ };
9656
+ style: Record<string, string>;
9657
+ }[] | undefined;
9658
+ inlineEdit?: boolean | undefined;
9659
+ exportOptions?: ("json" | "csv" | "xlsx" | "pdf")[] | undefined;
9660
+ userActions?: {
9661
+ sort: boolean;
9662
+ search: boolean;
9663
+ filter: boolean;
9664
+ rowHeight: boolean;
9665
+ addRecordForm: boolean;
9666
+ buttons?: string[] | undefined;
9667
+ } | undefined;
9668
+ appearance?: {
9669
+ showDescription: boolean;
9670
+ allowedVisualizations?: ("map" | "kanban" | "calendar" | "gantt" | "gallery" | "timeline" | "grid")[] | undefined;
9671
+ } | undefined;
9672
+ tabs?: {
9673
+ name: string;
9674
+ pinned: boolean;
9675
+ isDefault: boolean;
9676
+ visible: boolean;
9677
+ label?: string | undefined;
9678
+ icon?: string | undefined;
9679
+ view?: string | undefined;
9680
+ filter?: {
9681
+ field: string;
9682
+ operator: string;
9683
+ value?: string | number | boolean | (string | number)[] | null | undefined;
9684
+ }[] | undefined;
9685
+ order?: number | undefined;
9686
+ }[] | undefined;
9687
+ addRecord?: {
9688
+ enabled: boolean;
9689
+ position: "top" | "bottom" | "both";
9690
+ mode: "modal" | "form" | "inline";
9691
+ formView?: string | undefined;
9692
+ } | undefined;
9693
+ showRecordCount?: boolean | undefined;
9694
+ allowPrinting?: boolean | undefined;
9695
+ emptyState?: {
9696
+ title?: string | undefined;
9697
+ message?: string | undefined;
9698
+ icon?: string | undefined;
9699
+ } | undefined;
9700
+ aria?: {
9701
+ ariaLabel?: string | undefined;
9702
+ ariaDescribedBy?: string | undefined;
9703
+ role?: string | undefined;
9704
+ } | undefined;
9705
+ responsive?: {
9706
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
9707
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
9708
+ columns?: {
9709
+ xs?: number | undefined;
9710
+ sm?: number | undefined;
9711
+ md?: number | undefined;
9712
+ lg?: number | undefined;
9713
+ xl?: number | undefined;
9714
+ '2xl'?: number | undefined;
9715
+ } | undefined;
9716
+ order?: {
9717
+ xs?: number | undefined;
9718
+ sm?: number | undefined;
9719
+ md?: number | undefined;
9720
+ lg?: number | undefined;
9721
+ xl?: number | undefined;
9722
+ '2xl'?: number | undefined;
9723
+ } | undefined;
9724
+ } | undefined;
9725
+ performance?: {
9726
+ lazyLoad?: boolean | undefined;
9727
+ virtualScroll?: {
9728
+ enabled: boolean;
9729
+ itemHeight?: number | undefined;
9730
+ overscan?: number | undefined;
9731
+ } | undefined;
9732
+ cacheStrategy?: "none" | "cache-first" | "network-first" | "stale-while-revalidate" | undefined;
9733
+ prefetch?: boolean | undefined;
9734
+ pageSize?: number | undefined;
9735
+ debounceMs?: number | undefined;
9736
+ } | undefined;
9737
+ }> | undefined;
9738
+ formViews?: Record<string, {
9739
+ type: "split" | "modal" | "drawer" | "simple" | "tabbed" | "wizard";
9740
+ data?: {
9741
+ provider: "object";
9742
+ object: string;
9743
+ } | {
9744
+ provider: "api";
9745
+ read?: {
9746
+ url: string;
9747
+ method: "GET" | "POST" | "DELETE" | "PATCH" | "PUT";
9748
+ headers?: Record<string, string> | undefined;
9749
+ params?: Record<string, unknown> | undefined;
9750
+ body?: unknown;
9751
+ } | undefined;
9752
+ write?: {
9753
+ url: string;
9754
+ method: "GET" | "POST" | "DELETE" | "PATCH" | "PUT";
9755
+ headers?: Record<string, string> | undefined;
9756
+ params?: Record<string, unknown> | undefined;
9757
+ body?: unknown;
9758
+ } | undefined;
9759
+ } | {
9760
+ provider: "value";
9761
+ items: unknown[];
9762
+ } | undefined;
9763
+ sections?: {
9764
+ collapsible: boolean;
9765
+ collapsed: boolean;
9766
+ columns: 1 | 2 | 3 | 4;
9767
+ fields: (string | {
9768
+ field: string;
9769
+ label?: string | undefined;
9770
+ placeholder?: string | undefined;
9771
+ helpText?: string | undefined;
9772
+ readonly?: boolean | undefined;
9773
+ required?: boolean | undefined;
9774
+ hidden?: boolean | undefined;
9775
+ colSpan?: number | undefined;
9776
+ widget?: string | undefined;
9777
+ dependsOn?: string | undefined;
9778
+ visibleOn?: {
9779
+ dialect: "cel" | "js" | "cron" | "template";
9780
+ source?: string | undefined;
9781
+ ast?: unknown;
9782
+ meta?: {
9783
+ rationale?: string | undefined;
9784
+ generatedBy?: string | undefined;
9785
+ } | undefined;
9786
+ } | {
9787
+ dialect: "cel" | "js" | "cron" | "template";
9788
+ source?: string | undefined;
9789
+ ast?: unknown;
9790
+ meta?: {
9791
+ rationale?: string | undefined;
9792
+ generatedBy?: string | undefined;
9793
+ } | undefined;
9794
+ } | undefined;
9795
+ })[];
9796
+ label?: string | undefined;
9797
+ }[] | undefined;
9798
+ groups?: {
9799
+ collapsible: boolean;
9800
+ collapsed: boolean;
9801
+ columns: 1 | 2 | 3 | 4;
9802
+ fields: (string | {
9803
+ field: string;
9804
+ label?: string | undefined;
9805
+ placeholder?: string | undefined;
9806
+ helpText?: string | undefined;
9807
+ readonly?: boolean | undefined;
9808
+ required?: boolean | undefined;
9809
+ hidden?: boolean | undefined;
9810
+ colSpan?: number | undefined;
9811
+ widget?: string | undefined;
9812
+ dependsOn?: string | undefined;
9813
+ visibleOn?: {
9814
+ dialect: "cel" | "js" | "cron" | "template";
9815
+ source?: string | undefined;
9816
+ ast?: unknown;
9817
+ meta?: {
9818
+ rationale?: string | undefined;
9819
+ generatedBy?: string | undefined;
9820
+ } | undefined;
9821
+ } | {
9822
+ dialect: "cel" | "js" | "cron" | "template";
9823
+ source?: string | undefined;
9824
+ ast?: unknown;
9825
+ meta?: {
9826
+ rationale?: string | undefined;
9827
+ generatedBy?: string | undefined;
9828
+ } | undefined;
9829
+ } | undefined;
9830
+ })[];
9831
+ label?: string | undefined;
9832
+ }[] | undefined;
9833
+ defaultSort?: {
9834
+ field: string;
9835
+ order: "asc" | "desc";
9836
+ }[] | undefined;
9837
+ sharing?: {
9838
+ enabled: boolean;
9839
+ allowAnonymous: boolean;
9840
+ publicLink?: string | undefined;
9841
+ password?: string | undefined;
9842
+ allowedDomains?: string[] | undefined;
9843
+ expiresAt?: string | undefined;
9844
+ } | undefined;
9845
+ submitBehavior?: {
9846
+ kind: "thank-you";
9847
+ title?: string | undefined;
9848
+ message?: string | undefined;
9849
+ } | {
9850
+ kind: "redirect";
9851
+ url: string;
9852
+ delayMs?: number | undefined;
9853
+ } | {
9854
+ kind: "continue";
9855
+ } | {
9856
+ kind: "next-record";
9857
+ } | undefined;
9858
+ aria?: {
9859
+ ariaLabel?: string | undefined;
9860
+ ariaDescribedBy?: string | undefined;
9861
+ role?: string | undefined;
9862
+ } | undefined;
9863
+ }> | undefined;
9864
+ };
9865
+
8974
9866
  /**
8975
9867
  * SchemaRetriever — Keyword-based metadata retrieval for AI prompts.
8976
9868
  *
@@ -9249,4 +10141,4 @@ declare function buildAssistantRoutes(aiService: AIService, agentRuntime: AgentR
9249
10141
  */
9250
10142
  declare function buildToolRoutes(aiService: AIService, logger: Logger): RouteDefinition[];
9251
10143
 
9252
- export { AIService, type AIServiceConfig, AIServicePlugin, type AIServicePluginOptions, type AgentChatContext, AgentRuntime, AiConversationObject, AiMessageObject, AiTraceObject, type CostEstimate, DATA_CHAT_AGENT, DATA_TOOL_DEFINITIONS, type DataToolContext, type FieldShape, type IConversationService, type IPackageRegistry, InMemoryConversationService, METADATA_ASSISTANT_AGENT, METADATA_TOOL_DEFINITIONS, MemoryLLMAdapter, type MetadataToolContext, ModelRegistry, type ModelRegistryConfig, NullTraceRecorder, ObjectQLConversationService, ObjectQLTraceRecorder, type ObjectShape, PACKAGE_TOOL_DEFINITIONS, type PackageToolContext, QUERY_DATA_TOOL, type QueryDataToolContext, type QueryPlan, type RouteDefinition, type RouteRequest, type RouteResponse, type RouteUserContext, type SchemaHit, SchemaRetriever, type SchemaRetrieverOptions, type SkillContext, SkillRegistry, type SkillSummary, type TokenUsage, type ToolExecutionResult, type ToolHandler, ToolRegistry, type TraceEvent, type TraceOperation, type TraceRecorder, VercelLLMAdapter, type VercelLLMAdapterConfig, addFieldTool, buildAIRoutes, buildAgentRoutes, buildAssistantRoutes, buildToolRoutes, buildTraceEvent, computeCost, createObjectTool, createPackageTool, createQueryDataHandler, deleteFieldTool, describeObjectTool, encodeStreamPart, encodeVercelDataStream, getActivePackageTool, getPackageTool, listObjectsTool, listPackagesTool, modifyFieldTool, registerDataTools, registerMetadataTools, registerPackageTools, registerQueryDataTool, setActivePackageTool };
10144
+ export { ACTIONS_EXECUTOR_SKILL, AIService, type AIServiceConfig, AIServicePlugin, type AIServicePluginOptions, type ActionToolsContext, type AgentChatContext, AgentRuntime, AiConversationObject, AiMessageObject, AiTraceObject, AiTraceView, type CostEstimate, DATA_CHAT_AGENT, DATA_EXPLORER_SKILL, DATA_TOOL_DEFINITIONS, type DataToolContext, type FieldShape, type IConversationService, type IPackageRegistry, InMemoryConversationService, METADATA_ASSISTANT_AGENT, METADATA_AUTHORING_SKILL, METADATA_TOOL_DEFINITIONS, MemoryLLMAdapter, type MetadataToolContext, ModelRegistry, type ModelRegistryConfig, NullTraceRecorder, ObjectQLConversationService, ObjectQLTraceRecorder, type ObjectShape, PACKAGE_TOOL_DEFINITIONS, type PackageToolContext, QUERY_DATA_TOOL, type QueryDataToolContext, type QueryPlan, type RouteDefinition, type RouteRequest, type RouteResponse, type RouteUserContext, type SchemaHit, SchemaRetriever, type SchemaRetrieverOptions, type SkillContext, SkillRegistry, type SkillSummary, type TokenUsage, type ToolExecutionResult, type ToolHandler, ToolRegistry, type TraceEvent, type TraceOperation, type TraceRecorder, VercelLLMAdapter, type VercelLLMAdapterConfig, actionSkipReason, actionToToolDefinition, actionToolName, addFieldTool, buildAIRoutes, buildAgentRoutes, buildAssistantRoutes, buildToolRoutes, buildTraceEvent, computeCost, createObjectTool, createPackageTool, createQueryDataHandler, deleteFieldTool, describeObjectTool, encodeStreamPart, encodeVercelDataStream, getActivePackageTool, getPackageTool, listObjectsTool, listPackagesTool, modifyFieldTool, registerActionsAsTools, registerDataTools, registerMetadataTools, registerPackageTools, registerQueryDataTool, setActivePackageTool };