@stndrds/schema 1.0.0-alpha.345 → 1.0.0-alpha.346

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.
Files changed (69) hide show
  1. package/dist/{all-DdTEiYEh.d.mts → all-72y_keWh.d.mts} +8 -8
  2. package/dist/{all-BfNS2KEx.d.ts → all-DCBPCw9F.d.ts} +8 -8
  3. package/dist/{checkbox-D8nK0oIO.d.ts → checkbox-CMNq2fkL.d.ts} +2 -2
  4. package/dist/{checkbox-DSzn5epa.d.mts → checkbox-CpPTW4Qn.d.mts} +2 -2
  5. package/dist/{config-6uO9OYWQ.mjs → config-BiQGgy7f.mjs} +1 -1
  6. package/dist/{config-DIBMi8S_.js → config-WUWITOeW.js} +1 -1
  7. package/dist/{date-CteDw_88.d.mts → date-B8W-uBOd.d.mts} +2 -2
  8. package/dist/{date-BGULTVlX.d.ts → date-Bn1QYgWY.d.ts} +2 -2
  9. package/dist/{exceptions-BCfkN2ct.d.mts → exceptions-B3WE8Upv.d.mts} +9 -0
  10. package/dist/{exceptions-BCfkN2ct.d.ts → exceptions-B3WE8Upv.d.ts} +9 -0
  11. package/dist/exceptions.d.mts +1 -1
  12. package/dist/exceptions.d.ts +1 -1
  13. package/dist/{index-_gdqRN1W.d.mts → index-BKMp1wdz.d.mts} +1 -1
  14. package/dist/{index-CLEwI8GE.d.ts → index-CL87KvMy.d.ts} +2 -2
  15. package/dist/{index-DyeLYnEc.d.ts → index-D4Fo465g.d.ts} +1 -1
  16. package/dist/{index-BKv7a08I.d.ts → index-Dh21B6e4.d.ts} +1 -1
  17. package/dist/{index-Ds0DxPHk.d.mts → index-Dib0TdMy.d.mts} +2 -2
  18. package/dist/{index-DzEWbzP-.d.mts → index-nzT7sEBR.d.mts} +1 -1
  19. package/dist/index.d.mts +208 -14
  20. package/dist/index.d.ts +208 -14
  21. package/dist/index.js +9 -9
  22. package/dist/index.mjs +9 -9
  23. package/dist/{number-U7UMAXKt.d.mts → number-B52ufFXh.d.mts} +2 -2
  24. package/dist/{number-BcMYyg8j.d.ts → number-DwKAGHUq.d.ts} +2 -2
  25. package/dist/{text-CjhjkBXJ.d.mts → text-CjNrbnmS.d.mts} +2 -2
  26. package/dist/{text-C4EAE9Ap.d.ts → text-LRdjjxmn.d.ts} +2 -2
  27. package/dist/utils.d.mts +1 -1
  28. package/dist/utils.d.ts +1 -1
  29. package/dist/validation/all.d.mts +4 -4
  30. package/dist/validation/all.d.ts +4 -4
  31. package/dist/validation/all.js +1 -1
  32. package/dist/validation/all.mjs +1 -1
  33. package/dist/validation/complex/currency.d.mts +2 -2
  34. package/dist/validation/complex/currency.d.ts +2 -2
  35. package/dist/validation/complex/location.d.mts +2 -2
  36. package/dist/validation/complex/location.d.ts +2 -2
  37. package/dist/validation/complex/phone.d.mts +2 -2
  38. package/dist/validation/complex/phone.d.ts +2 -2
  39. package/dist/validation/complex/relation.d.mts +2 -2
  40. package/dist/validation/complex/relation.d.ts +2 -2
  41. package/dist/validation/complex/richtext.d.mts +2 -2
  42. package/dist/validation/complex/richtext.d.ts +2 -2
  43. package/dist/validation/complex/select.d.mts +2 -2
  44. package/dist/validation/complex/select.d.ts +2 -2
  45. package/dist/validation/complex/user.d.mts +2 -2
  46. package/dist/validation/complex/user.d.ts +2 -2
  47. package/dist/validation/computed/formula.d.mts +2 -2
  48. package/dist/validation/computed/formula.d.ts +2 -2
  49. package/dist/validation/computed/rollup.d.mts +2 -2
  50. package/dist/validation/computed/rollup.d.ts +2 -2
  51. package/dist/validation/config/index.d.mts +1 -1
  52. package/dist/validation/config/index.d.ts +1 -1
  53. package/dist/validation/config/index.js +1 -1
  54. package/dist/validation/config/index.mjs +1 -1
  55. package/dist/validation/core/index.d.mts +1 -1
  56. package/dist/validation/core/index.d.ts +1 -1
  57. package/dist/validation/object/index.d.mts +1 -1
  58. package/dist/validation/object/index.d.ts +1 -1
  59. package/dist/validation/primitives/checkbox.d.mts +1 -1
  60. package/dist/validation/primitives/checkbox.d.ts +1 -1
  61. package/dist/validation/primitives/date.d.mts +1 -1
  62. package/dist/validation/primitives/date.d.ts +1 -1
  63. package/dist/validation/primitives/number.d.mts +1 -1
  64. package/dist/validation/primitives/number.d.ts +1 -1
  65. package/dist/validation/primitives/text.d.mts +1 -1
  66. package/dist/validation/primitives/text.d.ts +1 -1
  67. package/dist/{view-config.schema-Omtzavho.js → view-config.schema-BDQ3S3IE.js} +1 -1
  68. package/dist/{view-config.schema-DbO6eQgP.mjs → view-config.schema-xYyZKn9M.mjs} +1 -1
  69. package/package.json +2 -2
package/dist/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
1
 
2
- import { $ as BilateralConfig, $t as indexBy, A as StorageError, An as ComputedDependency, At as StatusGroup, B as isObjectReferencedError, Bn as ComputedFormulaLiteralNode, Bt as OptionPropertyAttribute, C as RepositoryOperation, Cn as assertAcyclicComputedDependencies, Ct as RichTextAttribute, D as SchemaErrorCode, Dn as ComputedFunctionName, Dt as SelectAttribute, E as SchemaError, En as COMPUTED_FUNCTION_NAMES, Et as RollupFunction, F as SystemEntityImmutableError, Fn as ComputedValueType, Ft as inferInverseCardinality, G as BuiltInTransform, Gt as resolvePropertyDefinitions, H as isRecordReferencedError, Hn as ComputedFormulaPathNode, Ht as PropertySchema, I as ValidationError, In as ComputedFormulaAstNode, It as isAttributeSortable, J as ATTRIBUTE_TYPES, Jt as Uuid, K as MigrationDefinition, Kt as TenantId, L as ValidationErrorDetail, Ln as ComputedFormulaBinaryNode, Lt as isBilateralRelation, M as SyncCascadeError, Mn as ComputedOptionsSource, Mt as TimeFormat, N as SyncConflictError, Nn as ComputedPlan, Nt as UserAttribute, O as SchemaPlanNotFoundError, On as ComputedFunctionSignature, Ot as SingleRelationAttribute, P as SyncError, Pn as ComputedReturnType, Pt as UserReferenceType, Q as BaseAttribute, Qt as generateId, R as isAttributeInUseError, Rn as ComputedFormulaBinaryOperator, Rt as isUniversalRelation, S as RepositoryError, Sn as ComputedFormulaCompileError, St as RelationTarget, T as RoleNotFoundError, Tn as COMPUTED_FUNCTIONS, Tt as RollupAttribute, U as isSchemaError, Un as parseComputedFormula, Ut as PropertyType, V as isProtectedResourceError, Vn as ComputedFormulaParseError, Vt as PropertyAttribute, W as isValidationError, Wt as hasOptions, X as AttributeGroup, Xt as asUserId, Y as Attribute, Yt as asTenantId, Z as AttributeType, Zt as deepEqual, _ as ProtectedResourceError, _n as CompileComputedFormulaInput, _t as Option, a as ChangeTypeNotSupportedError, an as COMPUTED_FUNCTION_METADATA, at as DateRangeValue, b as RecordReference, bn as ComputedCompileSchema, bt as RELATION_TARGET_ANY, c as DuplicateError, cn as ComputedFormulaResult, ct as FormulaAttribute, d as MigrationTimeoutError, dn as evaluateComputedFormulaWithResult, dt as LocationAttribute, en as NonJsonValueError, et as CheckboxAttribute, f as NotFoundError, fn as formatComputedResult, ft as LocationGranularity, g as OrphanSystemAttributeError, gn as rollupToFormulaExpression, gt as NumberUnit, h as ObjectReferencedError, hn as inferRollupReturnType, ht as NumberAttribute, i as AttributeUsage, in as serializeStableJson, it as DateFormat, j as StorageOperation, jn as ComputedFieldKind, jt as TextAttribute, k as SearchBackendError, kn as isComputedFunctionName, kt as StatusAttribute, l as ForbiddenError, ln as evaluateComputedAst, lt as FormulaReturnType, m as ObjectNotFoundError, mn as compileRollupAttribute, mt as MultiselectAttribute, n as AttributeInUseError, nn as sameStableValue, nt as CurrencyAttribute, o as ConcurrentModificationError, on as ComputedFunctionCategory, ot as DateValue, p as NotImplementedError, pn as isPlainRecord, pt as MultiRelationAttribute, q as SchemaOperation, qt as UserId, r as AttributeNotFoundError, rn as serializeCanonicalJson, rt as DateAttribute, s as DestructiveSyncNotAllowedError, sn as ComputedFunctionMetadata, st as DocumentAttribute, t as AccessDeniedError, tn as canonicalStringify, tt as Currency, u as MemoryNotFoundError, un as evaluateComputedFormula, ut as Location, v as ProtectedRoleError, vn as ComputedCompileAttribute, vt as Phone, w as ReservedObjectNameError, wn as compileComputedFormula, wt as RichtextAttribute, x as RecordReferencedError, xn as ComputedDependencyGraphNode, xt as RelationAttribute, y as RecordNotFoundError, yn as ComputedCompileObject, yt as PhoneAttribute, z as isNotFoundError, zn as ComputedFormulaCallNode, zt as relationTargetsOf } from "./exceptions-BCfkN2ct.mjs";
3
- import { $ as RelativeDateValue, A as FormDensity, B as DynamicValue, C as ContentPlacement, D as DocumentsContentDefinition, E as CustomContentDefinition, F as RichtextContentDefinition, G as FilterRule, H as ExtendedFilterRule, I as ViewContentDefinition, J as NO_VALUE_OPERATORS, K as FilterState, L as ViewRead, M as KanbanCollectionContentDefinition, N as ListViewLayout, O as EmailsContentDefinition, P as MeetingsContentDefinition, Q as QueryState, R as CurrencyFilterValue, S as ContentOpenMode, T as ContentViewDefinition, U as FilterCombinator, V as EdgeQuantifier, W as FilterOperator, X as OPERATORS_BY_TYPE, Y as NoValueOperator, Z as PhoneFilterValue, _ as CollectionContentSource, a as displayAttributesSchema, b as ContentField, c as filterStateSchema, d as colorIdSchema, et as SortDirection, f as iconNameSchema, g as CollectionContentDefinition, h as CollectionAction, i as contentViewDefinitionSchemaFor, it as isNoValueOperator, j as FormsContentDefinition, k as FormContentDefinition, l as publishedViewContentDefinitionSchema, m as ActivityContentDefinition, n as columnsSchema, nt as filterOperatorsByTypeForGeneration, o as draftContentViewDefinitionSchema, p as SCHEMA_LIMITS, q as FilterValue, r as contentViewDefinitionSchema, rt as getRollupFilterOperators, s as draftContentViewDefinitionSchemaFor, t as collectionContentSourceSchema, tt as SortRule, u as sortsSchema, v as ColumnReference, w as ContentViewContext, x as ContentFieldGroup, y as ContentCreateMode, z as DayMonthValue } from "./all-DdTEiYEh.mjs";
4
- import { A as FolderPreset, C as ResourceVisibility, D as parseResourceVisibility, E as Timestamps, M as PresetNode, O as DocumentLayout, S as ReservedObjectName, T as SystemFieldName, _ as ObjectRecord, a as validateDraft, b as RESOURCE_VISIBILITIES, c as validateObjectOrThrow, f as createFormAttributeValidator, g as ObjectDefinition, h as ObjectAttribute, j as MAX_PRESET_DEPTH, k as DocumentLayoutVariant, m as ListViewTabVisibility, o as validateDraftOrThrow, p as LIST_VIEW_TAB_VISIBILITIES, r as rejectUnknownAttributesOrThrow, s as validateObject, v as RESERVED_ATTRIBUTE_NAMES, w as SYSTEM_FIELD_NAMES, x as ReservedAttributeName, y as RESERVED_OBJECT_NAMES } from "./index-Ds0DxPHk.mjs";
5
- import { S as UpdateObjectInput, _ as statusOptionWriteSchema, b as RelationOption, c as parseAttributeConfigForCreate, d as propertyAttributeWireSchema, f as propertySchemaSchema, g as statusGroupSchema, h as selectOptionWriteSchema, l as parseAttributeConfigForUpdate, m as refuseForeignKeys, n as WIRE_OMITTED_CONFIG_KEYS, o as multiselectOptionWriteSchema, p as propertySchemaWireSchema, r as attributeConfigSchemas, s as parseAttributeConfig, t as SIMPLE_PROPERTY_TYPES, u as propertyAttributeSchema, v as AddAttributeInput, x as RelationOptionsResponse, y as CreateCustomObjectInput } from "./index-_gdqRN1W.mjs";
6
- import { n as DEFAULT_VALIDATION_MESSAGES, r as ValidationMessages, t as formatZodErrors } from "./index-DzEWbzP-.mjs";
7
- import { t as createTextValidator } from "./text-CjhjkBXJ.mjs";
8
- import { t as createNumberValidator } from "./number-U7UMAXKt.mjs";
9
- import { t as createCheckboxValidator } from "./checkbox-DSzn5epa.mjs";
10
- import { t as createDateValidator } from "./date-CteDw_88.mjs";
2
+ import { $ as BilateralConfig, $t as indexBy, A as StorageError, An as ComputedDependency, At as StatusGroup, B as isObjectReferencedError, Bn as ComputedFormulaLiteralNode, Bt as OptionPropertyAttribute, C as RepositoryOperation, Cn as assertAcyclicComputedDependencies, Ct as RichTextAttribute, D as SchemaErrorCode, Dn as ComputedFunctionName, Dt as SelectAttribute, E as SchemaError, En as COMPUTED_FUNCTION_NAMES, Et as RollupFunction, F as SystemEntityImmutableError, Fn as ComputedValueType, Ft as inferInverseCardinality, G as BuiltInTransform, Gt as resolvePropertyDefinitions, H as isRecordReferencedError, Hn as ComputedFormulaPathNode, Ht as PropertySchema, I as ValidationError, In as ComputedFormulaAstNode, It as isAttributeSortable, J as ATTRIBUTE_TYPES, Jt as Uuid, K as MigrationDefinition, Kt as TenantId, L as ValidationErrorDetail, Ln as ComputedFormulaBinaryNode, Lt as isBilateralRelation, M as SyncCascadeError, Mn as ComputedOptionsSource, Mt as TimeFormat, N as SyncConflictError, Nn as ComputedPlan, Nt as UserAttribute, O as SchemaPlanNotFoundError, On as ComputedFunctionSignature, Ot as SingleRelationAttribute, P as SyncError, Pn as ComputedReturnType, Pt as UserReferenceType, Q as BaseAttribute, Qt as generateId, R as isAttributeInUseError, Rn as ComputedFormulaBinaryOperator, Rt as isUniversalRelation, S as RepositoryError, Sn as ComputedFormulaCompileError, St as RelationTarget, T as RoleNotFoundError, Tn as COMPUTED_FUNCTIONS, Tt as RollupAttribute, U as isSchemaError, Un as parseComputedFormula, Ut as PropertyType, V as isProtectedResourceError, Vn as ComputedFormulaParseError, Vt as PropertyAttribute, W as isValidationError, Wt as hasOptions, X as AttributeGroup, Xt as asUserId, Y as Attribute, Yt as asTenantId, Z as AttributeType, Zt as deepEqual, _ as ProtectedResourceError, _n as CompileComputedFormulaInput, _t as Option, a as ChangeTypeNotSupportedError, an as COMPUTED_FUNCTION_METADATA, at as DateRangeValue, b as RecordReference, bn as ComputedCompileSchema, bt as RELATION_TARGET_ANY, c as DuplicateError, cn as ComputedFormulaResult, ct as FormulaAttribute, d as MigrationTimeoutError, dn as evaluateComputedFormulaWithResult, dt as LocationAttribute, en as NonJsonValueError, et as CheckboxAttribute, f as NotFoundError, fn as formatComputedResult, ft as LocationGranularity, g as OrphanSystemAttributeError, gn as rollupToFormulaExpression, gt as NumberUnit, h as ObjectReferencedError, hn as inferRollupReturnType, ht as NumberAttribute, i as AttributeUsage, in as serializeStableJson, it as DateFormat, j as StorageOperation, jn as ComputedFieldKind, jt as TextAttribute, k as SearchBackendError, kn as isComputedFunctionName, kt as StatusAttribute, l as ForbiddenError, ln as evaluateComputedAst, lt as FormulaReturnType, m as ObjectNotFoundError, mn as compileRollupAttribute, mt as MultiselectAttribute, n as AttributeInUseError, nn as sameStableValue, nt as CurrencyAttribute, o as ConcurrentModificationError, on as ComputedFunctionCategory, ot as DateValue, p as NotImplementedError, pn as isPlainRecord, pt as MultiRelationAttribute, q as SchemaOperation, qt as UserId, r as AttributeNotFoundError, rn as serializeCanonicalJson, rt as DateAttribute, s as DestructiveSyncNotAllowedError, sn as ComputedFunctionMetadata, st as DocumentAttribute, t as AccessDeniedError, tn as canonicalStringify, tt as Currency, u as MemoryNotFoundError, un as evaluateComputedFormula, ut as Location, v as ProtectedRoleError, vn as ComputedCompileAttribute, vt as Phone, w as ReservedObjectNameError, wn as compileComputedFormula, wt as RichtextAttribute, x as RecordReferencedError, xn as ComputedDependencyGraphNode, xt as RelationAttribute, y as RecordNotFoundError, yn as ComputedCompileObject, yt as PhoneAttribute, z as isNotFoundError, zn as ComputedFormulaCallNode, zt as relationTargetsOf } from "./exceptions-B3WE8Upv.mjs";
3
+ import { $ as RelativeDateValue, A as FormDensity, B as DynamicValue, C as ContentPlacement, D as DocumentsContentDefinition, E as CustomContentDefinition, F as RichtextContentDefinition, G as FilterRule, H as ExtendedFilterRule, I as ViewContentDefinition, J as NO_VALUE_OPERATORS, K as FilterState, L as ViewRead, M as KanbanCollectionContentDefinition, N as ListViewLayout, O as EmailsContentDefinition, P as MeetingsContentDefinition, Q as QueryState, R as CurrencyFilterValue, S as ContentOpenMode, T as ContentViewDefinition, U as FilterCombinator, V as EdgeQuantifier, W as FilterOperator, X as OPERATORS_BY_TYPE, Y as NoValueOperator, Z as PhoneFilterValue, _ as CollectionContentSource, a as displayAttributesSchema, b as ContentField, c as filterStateSchema, d as colorIdSchema, et as SortDirection, f as iconNameSchema, g as CollectionContentDefinition, h as CollectionAction, i as contentViewDefinitionSchemaFor, it as isNoValueOperator, j as FormsContentDefinition, k as FormContentDefinition, l as publishedViewContentDefinitionSchema, m as ActivityContentDefinition, n as columnsSchema, nt as filterOperatorsByTypeForGeneration, o as draftContentViewDefinitionSchema, p as SCHEMA_LIMITS, q as FilterValue, r as contentViewDefinitionSchema, rt as getRollupFilterOperators, s as draftContentViewDefinitionSchemaFor, t as collectionContentSourceSchema, tt as SortRule, u as sortsSchema, v as ColumnReference, w as ContentViewContext, x as ContentFieldGroup, y as ContentCreateMode, z as DayMonthValue } from "./all-72y_keWh.mjs";
4
+ import { A as FolderPreset, C as ResourceVisibility, D as parseResourceVisibility, E as Timestamps, M as PresetNode, O as DocumentLayout, S as ReservedObjectName, T as SystemFieldName, _ as ObjectRecord, a as validateDraft, b as RESOURCE_VISIBILITIES, c as validateObjectOrThrow, f as createFormAttributeValidator, g as ObjectDefinition, h as ObjectAttribute, j as MAX_PRESET_DEPTH, k as DocumentLayoutVariant, m as ListViewTabVisibility, o as validateDraftOrThrow, p as LIST_VIEW_TAB_VISIBILITIES, r as rejectUnknownAttributesOrThrow, s as validateObject, v as RESERVED_ATTRIBUTE_NAMES, w as SYSTEM_FIELD_NAMES, x as ReservedAttributeName, y as RESERVED_OBJECT_NAMES } from "./index-Dib0TdMy.mjs";
5
+ import { S as UpdateObjectInput, _ as statusOptionWriteSchema, b as RelationOption, c as parseAttributeConfigForCreate, d as propertyAttributeWireSchema, f as propertySchemaSchema, g as statusGroupSchema, h as selectOptionWriteSchema, l as parseAttributeConfigForUpdate, m as refuseForeignKeys, n as WIRE_OMITTED_CONFIG_KEYS, o as multiselectOptionWriteSchema, p as propertySchemaWireSchema, r as attributeConfigSchemas, s as parseAttributeConfig, t as SIMPLE_PROPERTY_TYPES, u as propertyAttributeSchema, v as AddAttributeInput, x as RelationOptionsResponse, y as CreateCustomObjectInput } from "./index-BKMp1wdz.mjs";
6
+ import { n as DEFAULT_VALIDATION_MESSAGES, r as ValidationMessages, t as formatZodErrors } from "./index-nzT7sEBR.mjs";
7
+ import { t as createTextValidator } from "./text-CjNrbnmS.mjs";
8
+ import { t as createNumberValidator } from "./number-B52ufFXh.mjs";
9
+ import { t as createCheckboxValidator } from "./checkbox-CpPTW4Qn.mjs";
10
+ import { t as createDateValidator } from "./date-B8W-uBOd.mjs";
11
11
  import z, { z as z$1 } from "zod";
12
12
  import { ColorId, CountryIso3, CurrencyCode, IconName, MimeType } from "@stndrds/constants";
13
13
  import { StandardSchemaV1, StandardSchemaV1 as StandardSchemaV1$1 } from "@standard-schema/spec";
@@ -1113,6 +1113,19 @@ export interface AuditChange {
1113
1113
  /** Resolved labels for newValue array, aligned by index. */
1114
1114
  newLabels?: string[];
1115
1115
  }
1116
+ /**
1117
+ * Metadata key of the conversation an entry was written in, stamped by the
1118
+ * runtime on every write that happens during an agent turn. A definition-less
1119
+ * general chat writes as the human — it pins no agent actor — so `actorType`
1120
+ * alone cannot tell such a write from a manual edit (#3782); this key can.
1121
+ */
1122
+ export declare const AUDIT_AGENT_SESSION_METADATA_KEY = "agentSessionId";
1123
+ /**
1124
+ * Whether an AI wrote this entry: an agent actor did, or a human's own
1125
+ * conversation did on their behalf. The feed wears the AI cue on both; the
1126
+ * human stays the author of the second.
1127
+ */
1128
+ export declare function isAgentWrittenAuditEntry(entry: Pick<AuditLogEntry, "actorType" | "metadata">): boolean;
1116
1129
  /**
1117
1130
  * Audit log entry - immutable record of an action
1118
1131
  */
@@ -1423,6 +1436,43 @@ export declare const INFERENCE_SPEEDS: readonly ["standard", "fast"];
1423
1436
  export type InferenceSpeed = (typeof INFERENCE_SPEEDS)[number];
1424
1437
  export declare const INFERENCE_REASONING_OPTIONS: readonly ["none", "minimal", "low", "medium", "high", "xhigh"];
1425
1438
  export type InferenceReasoning = (typeof INFERENCE_REASONING_OPTIONS)[number];
1439
+ /** The kinds of work Auto routing classifies a turn into. */
1440
+ export declare const AGENT_TASK_KINDS: readonly ["conversation", "writing", "coding", "analysis", "extraction"];
1441
+ export type AgentTaskKind = (typeof AGENT_TASK_KINDS)[number];
1442
+ /**
1443
+ * How demanding a classified turn is, least to most. A model's authored level
1444
+ * is a ceiling, not a band: qualified for heavy serves light too.
1445
+ */
1446
+ export declare const TASK_DEMAND_LEVELS: readonly ["light", "standard", "heavy"];
1447
+ export type TaskDemandLevel = (typeof TASK_DEMAND_LEVELS)[number];
1448
+ /**
1449
+ * Who picks the model for a turn. `manual` is the default everywhere except a
1450
+ * spawned agent session, which is created in `auto`. Branch on the union
1451
+ * exhaustively; never add an `isAuto` boolean.
1452
+ */
1453
+ export declare const INFERENCE_ROUTING_MODES: readonly ["manual", "auto"];
1454
+ export type InferenceRouting = (typeof INFERENCE_ROUTING_MODES)[number];
1455
+ /**
1456
+ * Which ceiling a routed turn is held to. `interactive` is a root session in
1457
+ * interactive mode — a person is at it, sees the routed model on every reply
1458
+ * and can take the wheel. Everything else is `delegated`: a spawned session,
1459
+ * an inline run, an autonomous root nobody watches.
1460
+ */
1461
+ export type RoutingContext = "interactive" | "delegated";
1462
+ /** USD per million tokens, one figure per dimension. */
1463
+ export interface RoutingPrice {
1464
+ readonly inputPerMillionUsd: number;
1465
+ readonly outputPerMillionUsd: number;
1466
+ }
1467
+ /**
1468
+ * A bill the client did not choose is a defect, so price gates admission rather
1469
+ * than merely breaking ties. Above these, Auto never routes at all; the model
1470
+ * stays selectable by hand, which returns the decision to the person.
1471
+ *
1472
+ * Declared here, not in the runtime, because `packages/ui` shows which models
1473
+ * Auto may route to with the same numbers. One home, no drift.
1474
+ */
1475
+ export declare const ROUTING_PRICE_CEILINGS: Record<RoutingContext, RoutingPrice>;
1426
1476
  /** The only model identity clients may persist. Capabilities always come from the catalogue. */
1427
1477
  export interface ModelReference {
1428
1478
  provider: ProviderName;
@@ -1432,6 +1482,8 @@ export interface ModelReference {
1432
1482
  export interface AgentInferencePreferences {
1433
1483
  speed?: InferenceSpeed;
1434
1484
  reasoning?: InferenceReasoning;
1485
+ /** `auto` lets the router pick the model per turn. Absent means `manual`. */
1486
+ routing?: InferenceRouting;
1435
1487
  }
1436
1488
  /** Durable per-conversation dimensions layered over an agent's inference defaults. */
1437
1489
  export interface AgentSessionInferenceOverrides extends AgentInferencePreferences {
@@ -1445,7 +1497,10 @@ export type SessionInferencePatch = {
1445
1497
  speed?: InferenceSpeed | null;
1446
1498
  reasoning?: InferenceReasoning | null;
1447
1499
  imageModel?: string | null;
1500
+ routing?: InferenceRouting | null;
1448
1501
  };
1502
+ /** Every dimension a session patch may carry — the one list the server and the client both apply. */
1503
+ export declare const SESSION_INFERENCE_PATCH_KEYS: readonly ["model", "speed", "reasoning", "imageModel", "routing"];
1449
1504
  export interface ModelDefinition extends ModelReference {
1450
1505
  maxTokens?: number;
1451
1506
  /**
@@ -2077,6 +2132,19 @@ export interface AIAvailableModel {
2077
2132
  readonly recommendationRank?: number;
2078
2133
  /** Editorial economical-to-powerful position; never treated as a benchmark. */
2079
2134
  readonly profile?: AIModelProfile;
2135
+ /**
2136
+ * Per task, the highest demand this model is qualified to serve. An absent
2137
+ * entry means Auto never routes that task here; an absent map means Auto
2138
+ * never routes here at all. Routability IS this map — there is no separate
2139
+ * flag that could contradict it.
2140
+ */
2141
+ readonly tasks?: Partial<Record<AgentTaskKind, TaskDemandLevel>>;
2142
+ /**
2143
+ * The non-promotional price, authored when the snapshot's rate is an
2144
+ * introductory one. Routing judges at `max(snapshot, listPricing)` per
2145
+ * dimension, so a stale figure here can only ever be too low.
2146
+ */
2147
+ readonly listPricing?: RoutingPrice;
2080
2148
  /** Canonical per-token decimal strings copied from Vercel AI Gateway. */
2081
2149
  readonly pricing?: AIModelPricing;
2082
2150
  /**
@@ -2349,6 +2417,15 @@ export interface AIChatNotification {
2349
2417
  /** Child's report, unwrapped from the `<subagent_result>` envelope; rendered as markdown. */
2350
2418
  body: string;
2351
2419
  }
2420
+ /** How an assistant message's model was chosen, when its turn ran under Auto. */
2421
+ export interface AIChatMessageRouting {
2422
+ /** `provider/model` as persisted on the message; the UI resolves the label. */
2423
+ model: string;
2424
+ /** Absent together with `demand` when the router declined and the default ran. */
2425
+ tasks?: readonly AgentTaskKind[];
2426
+ demand?: TaskDemandLevel;
2427
+ reason?: "selected" | "retained" | "fallback";
2428
+ }
2352
2429
  /**
2353
2430
  * Chat message for runtime/streaming.
2354
2431
  *
@@ -2391,6 +2468,8 @@ export interface AIChatMessage {
2391
2468
  input: number;
2392
2469
  output: number;
2393
2470
  };
2471
+ /** Present only on an assistant message whose turn ran under Auto. */
2472
+ routing?: AIChatMessageRouting;
2394
2473
  }
2395
2474
  /**
2396
2475
  * Question types supported by the agent
@@ -6934,6 +7013,13 @@ declare class FormulaAttributeBuilder<TName extends string> extends BaseAttribut
6934
7013
  * Set decimal places for number results
6935
7014
  */
6936
7015
  decimals(value: number): this;
7016
+ /**
7017
+ * Set the ISO 4217 code a `number` result renders with (#3419). The value
7018
+ * stays a number and `returnType` stays `"number"`; this only carries the
7019
+ * symbol to the screen — the rollup's `.targetCurrency()` for a formula.
7020
+ * @param code - ISO 4217 code (e.g. "EUR")
7021
+ */
7022
+ currency(code: CurrencyCode): this;
6937
7023
  required(): any;
6938
7024
  optional(): any;
6939
7025
  }
@@ -12393,6 +12479,43 @@ export declare function conversationDisplayTitle(input: ConversationDisplayTitle
12393
12479
  export declare const SCHEMA_SOURCE_ID_PATTERN: RegExp;
12394
12480
  export declare function assertSchemaSourceId(sourceId: string): void;
12395
12481
  //#endregion
12482
+ //#region src/utils/routing-price.d.ts
12483
+ /**
12484
+ * USD per million tokens for one dimension, judged at the HIGHEST figure the
12485
+ * dimension can cost: the greater of the flat rate and every tier's cost.
12486
+ *
12487
+ * A tiered dimension charges more past a prompt-length threshold, and the
12488
+ * snapshot carries both the flat rate and the tiers side by side. Reading the
12489
+ * flat rate alone would judge a model at its cheapest tier and then bill the
12490
+ * dearer one on a long prompt — a model sitting exactly on the delegated
12491
+ * ceiling at its first tier crosses it by half at its second. The routing
12492
+ * price exists to protect the bill, so it errs high on purpose (D4).
12493
+ *
12494
+ * The result is rounded to the nearest micro-dollar because scaling a per-token
12495
+ * decimal by a million is a binary-float operation: `0.0000004 * 1e6` is
12496
+ * `0.39999999999999997`, which no catalogue ever charges. Rounding below the
12497
+ * smallest figure any provider publishes keeps the arithmetic exact where it is
12498
+ * read — comparisons, ordering and the displayed price — without inventing
12499
+ * precision.
12500
+ */
12501
+ export declare function pricePerMillion(dimension: AIModelPriceDimension | undefined): number | undefined;
12502
+ /**
12503
+ * The price routing judges a model at: per dimension, the greater of the rate
12504
+ * the turn will be billed at (`pricing.fast` when Fast is asked for and
12505
+ * priced, else the base) and the authored list price.
12506
+ *
12507
+ * Taking the maximum makes the rule self-correcting. While a promotion runs,
12508
+ * the authored figure wins and the model is judged at what it will cost
12509
+ * later. Once a snapshot refresh raises the base, the snapshot wins and the
12510
+ * authored figure becomes inert rather than wrong. `undefined` when the
12511
+ * snapshot has no price at all: an unknown price is not a low price.
12512
+ */
12513
+ export declare function routingPrice(model: Pick<AIAvailableModel, "pricing" | "listPricing">, speed: InferenceSpeed): RoutingPrice | undefined;
12514
+ /** Both dimensions at or under the ceiling. An unknown price never passes. */
12515
+ export declare function isUnderRoutingCeiling(price: RoutingPrice | undefined, ceiling: RoutingPrice): boolean;
12516
+ /** Routability is the presence of at least one task entry, nothing else. */
12517
+ export declare function isRoutableModel(model: Pick<AIAvailableModel, "tasks">): boolean;
12518
+ //#endregion
12396
12519
  //#region src/types/schema-plan.d.ts
12397
12520
  /** An attribute to add to an object that already exists, or is created in the same plan. */
12398
12521
  export interface PlannedAttribute {
@@ -13014,8 +13137,8 @@ export declare const providerNameSchema: z$1.ZodEnum<{
13014
13137
  zai: "zai";
13015
13138
  }>;
13016
13139
  export declare const inferenceSpeedSchema: z$1.ZodEnum<{
13017
- fast: "fast";
13018
13140
  standard: "standard";
13141
+ fast: "fast";
13019
13142
  }>;
13020
13143
  export declare const inferenceReasoningSchema: z$1.ZodEnum<{
13021
13144
  none: "none";
@@ -13025,6 +13148,10 @@ export declare const inferenceReasoningSchema: z$1.ZodEnum<{
13025
13148
  high: "high";
13026
13149
  xhigh: "xhigh";
13027
13150
  }>;
13151
+ export declare const inferenceRoutingSchema: z$1.ZodEnum<{
13152
+ manual: "manual";
13153
+ auto: "auto";
13154
+ }>;
13028
13155
  export declare const modelReferenceSchema: z$1.ZodObject<{
13029
13156
  provider: z$1.ZodEnum<{
13030
13157
  openai: "openai";
@@ -13043,8 +13170,8 @@ export declare const modelReferenceSchema: z$1.ZodObject<{
13043
13170
  }, z$1.core.$strict>;
13044
13171
  export declare const agentInferencePreferencesSchema: z$1.ZodObject<{
13045
13172
  speed: z$1.ZodOptional<z$1.ZodEnum<{
13046
- fast: "fast";
13047
13173
  standard: "standard";
13174
+ fast: "fast";
13048
13175
  }>>;
13049
13176
  reasoning: z$1.ZodOptional<z$1.ZodEnum<{
13050
13177
  none: "none";
@@ -13054,6 +13181,10 @@ export declare const agentInferencePreferencesSchema: z$1.ZodObject<{
13054
13181
  high: "high";
13055
13182
  xhigh: "xhigh";
13056
13183
  }>>;
13184
+ routing: z$1.ZodOptional<z$1.ZodEnum<{
13185
+ manual: "manual";
13186
+ auto: "auto";
13187
+ }>>;
13057
13188
  }, z$1.core.$strict>;
13058
13189
  /** Syntax only; availability is checked by the dedicated server catalogue. */
13059
13190
  export declare const imageModelIdSchema: z$1.ZodString;
@@ -13075,8 +13206,8 @@ export declare const agentSessionInferenceOverridesInputSchema: z$1.ZodObject<{
13075
13206
  model: z$1.ZodString;
13076
13207
  }, z$1.core.$strict>>;
13077
13208
  speed: z$1.ZodOptional<z$1.ZodEnum<{
13078
- fast: "fast";
13079
13209
  standard: "standard";
13210
+ fast: "fast";
13080
13211
  }>>;
13081
13212
  reasoning: z$1.ZodOptional<z$1.ZodEnum<{
13082
13213
  none: "none";
@@ -13087,6 +13218,10 @@ export declare const agentSessionInferenceOverridesInputSchema: z$1.ZodObject<{
13087
13218
  xhigh: "xhigh";
13088
13219
  }>>;
13089
13220
  imageModel: z$1.ZodOptional<z$1.ZodString>;
13221
+ routing: z$1.ZodOptional<z$1.ZodEnum<{
13222
+ manual: "manual";
13223
+ auto: "auto";
13224
+ }>>;
13090
13225
  }, z$1.core.$strict>;
13091
13226
  export declare const agentSessionInferenceOverridesSchema: z$1.ZodObject<{
13092
13227
  model: z$1.ZodOptional<z$1.ZodObject<{
@@ -13106,8 +13241,8 @@ export declare const agentSessionInferenceOverridesSchema: z$1.ZodObject<{
13106
13241
  model: z$1.ZodString;
13107
13242
  }, z$1.core.$strict>>;
13108
13243
  speed: z$1.ZodOptional<z$1.ZodEnum<{
13109
- fast: "fast";
13110
13244
  standard: "standard";
13245
+ fast: "fast";
13111
13246
  }>>;
13112
13247
  reasoning: z$1.ZodOptional<z$1.ZodEnum<{
13113
13248
  none: "none";
@@ -13118,6 +13253,10 @@ export declare const agentSessionInferenceOverridesSchema: z$1.ZodObject<{
13118
13253
  xhigh: "xhigh";
13119
13254
  }>>;
13120
13255
  imageModel: z$1.ZodOptional<z$1.ZodString>;
13256
+ routing: z$1.ZodOptional<z$1.ZodEnum<{
13257
+ manual: "manual";
13258
+ auto: "auto";
13259
+ }>>;
13121
13260
  }, z$1.core.$strict>;
13122
13261
  export declare const sessionInferencePatchSchema: z$1.ZodObject<{
13123
13262
  model: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{
@@ -13137,8 +13276,8 @@ export declare const sessionInferencePatchSchema: z$1.ZodObject<{
13137
13276
  model: z$1.ZodString;
13138
13277
  }, z$1.core.$strict>>>;
13139
13278
  speed: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodEnum<{
13140
- fast: "fast";
13141
13279
  standard: "standard";
13280
+ fast: "fast";
13142
13281
  }>>>;
13143
13282
  reasoning: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodEnum<{
13144
13283
  none: "none";
@@ -13149,7 +13288,47 @@ export declare const sessionInferencePatchSchema: z$1.ZodObject<{
13149
13288
  xhigh: "xhigh";
13150
13289
  }>>>;
13151
13290
  imageModel: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
13291
+ routing: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodEnum<{
13292
+ manual: "manual";
13293
+ auto: "auto";
13294
+ }>>>;
13152
13295
  }, z$1.core.$strict>;
13296
+ /**
13297
+ * The slice of an assistant message's `metadata.inference` the chat reads to
13298
+ * say what answered. Non-strict on purpose: `speed` and `warnings` ride along
13299
+ * and are dropped, and only a turn that ran under Auto carries `routing`.
13300
+ */
13301
+ export declare const routedMessageInferenceSchema: z$1.ZodObject<{
13302
+ model: z$1.ZodString;
13303
+ routing: z$1.ZodObject<{
13304
+ mode: z$1.ZodLiteral<"auto">;
13305
+ tasks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
13306
+ conversation: "conversation";
13307
+ writing: "writing";
13308
+ coding: "coding";
13309
+ analysis: "analysis";
13310
+ extraction: "extraction";
13311
+ }>>>;
13312
+ demand: z$1.ZodOptional<z$1.ZodEnum<{
13313
+ standard: "standard";
13314
+ light: "light";
13315
+ heavy: "heavy";
13316
+ }>>;
13317
+ reason: z$1.ZodOptional<z$1.ZodEnum<{
13318
+ selected: "selected";
13319
+ retained: "retained";
13320
+ fallback: "fallback";
13321
+ }>>;
13322
+ relation: z$1.ZodOptional<z$1.ZodEnum<{
13323
+ unknown: "unknown";
13324
+ continue: "continue";
13325
+ aside: "aside";
13326
+ new: "new";
13327
+ modify: "modify";
13328
+ }>>;
13329
+ anchorMessageId: z$1.ZodOptional<z$1.ZodString>;
13330
+ }, z$1.core.$strip>;
13331
+ }, z$1.core.$strip>;
13153
13332
  export declare const toolImpactSchema: z$1.ZodObject<{
13154
13333
  label: z$1.ZodString;
13155
13334
  denied: z$1.ZodOptional<z$1.ZodBoolean>;
@@ -14001,6 +14180,21 @@ export declare function catalogTextModelSchema(id: string, free: boolean): z$1.Z
14001
14180
  character: "character";
14002
14181
  word: "word";
14003
14182
  }>>;
14183
+ tasks: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodEnum<{
14184
+ conversation: "conversation";
14185
+ writing: "writing";
14186
+ coding: "coding";
14187
+ analysis: "analysis";
14188
+ extraction: "extraction";
14189
+ }> & z$1.core.$partial, z$1.ZodEnum<{
14190
+ standard: "standard";
14191
+ light: "light";
14192
+ heavy: "heavy";
14193
+ }>>>;
14194
+ listPricing: z$1.ZodOptional<z$1.ZodObject<{
14195
+ inputPerMillionUsd: z$1.ZodNumber;
14196
+ outputPerMillionUsd: z$1.ZodNumber;
14197
+ }, z$1.core.$strip>>;
14004
14198
  }, z$1.core.$loose>;
14005
14199
  /**
14006
14200
  * `id` is handed whole to `gateway.imageModel(...)`, so it is bounded twice: