@vectoriox/iox-ui 5.113.0 → 5.114.0
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/assist-core/index.d.ts +234 -7
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs +480 -75
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +3 -3
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/generation-core/index.d.ts +5 -0
- package/package.json +1 -1
- package/src/assist-core/assist-facts.ts +36 -0
- package/src/assist-core/assist-turn.ts +28 -6
- package/src/assist-core/brief.ts +4 -0
- package/src/assist-core/field-edits.ts +14 -0
- package/src/assist-core/page-words.ts +503 -0
- package/src/assist-core/public-api.ts +5 -3
- package/src/assist-core/rich-text.ts +3 -0
- package/src/assist-core/surfaces.ts +4 -2
- package/src/generation-core/plan-words.ts +8 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectoriox-iox-ui-assist-core.mjs","sources":["../../../projects/iox-ui/src/assist-core/surfaces.ts","../../../projects/iox-ui/src/assist-core/budget.ts","../../../projects/iox-ui/src/assist-core/brief.ts","../../../projects/iox-ui/src/assist-core/content-fields.ts","../../../projects/iox-ui/src/assist-core/rich-text.ts","../../../projects/iox-ui/src/assist-core/field-values.ts","../../../projects/iox-ui/src/assist-core/summarize-item.ts","../../../projects/iox-ui/src/assist-core/fields-schema.ts","../../../projects/iox-ui/src/assist-core/route-schema.ts","../../../projects/iox-ui/src/assist-core/field-edits.ts","../../../projects/iox-ui/src/assist-core/assist-turn.ts","../../../projects/iox-ui/src/assist-core/assist-locale.ts","../../../projects/iox-ui/src/assist-core/public-api.ts","../../../projects/iox-ui/src/assist-core/vectoriox-iox-ui-assist-core.ts"],"sourcesContent":["import { AiStep } from '@vectoriox/iox-ui/generation-core';\n\n/**\n * The surfaces AI Assist runs on (ai-assist-plan §2, §4): each screen that offers a prompt registers ONE spec — what it\n * may change (families), how an accepted change is committed, which model steps a turn uses, the role actions the\n * server re-checks, whether it reads photos and the focus ladder its chip widens along.\n */\n\nexport enum AssistSurface {\n BuilderPage = 'builderPage',\n ContentItem = 'contentItem',\n ContentFromPhotos = 'contentFromPhotos',\n ContentList = 'contentList',\n SchemaType = 'schemaType',\n ShopProduct = 'shopProduct',\n Media = 'media',\n BuilderSite = 'builderSite',\n FormInbox = 'formInbox',\n}\n\n/** How an accepted turn reaches the studio (plan §3e). */\nexport enum CommitKind {\n /** One builder history step. */\n BuilderStep = 'builderStep',\n /** Written into the screen's form; Save stays the owner's. */\n FormFill = 'formFill',\n /** A server run that writes drafts, with its own Undo. */\n Run = 'run',\n /** Nothing is written: filters, a copied reply. */\n View = 'view',\n}\n\n/** The closed edit families a sentence may be answered in — one strict request each. */\nexport enum EditFamily {\n Words = 'words',\n Sections = 'sections',\n Style = 'style',\n Look = 'look',\n Fields = 'fields',\n Items = 'items',\n View = 'view',\n Schema = 'schema',\n Media = 'media',\n Plan = 'plan',\n}\n\n/** The model steps of a turn — generation-core's `AiStep` rows (Settings ▸ AI ▸ Models), never a second spelling. */\nexport const AssistStep = {\n AssistRoute: AiStep.AssistRoute,\n AssistEdit: AiStep.AssistEdit,\n AssistRead: AiStep.AssistRead,\n} as const;\nexport type AssistStep = typeof AssistStep[keyof typeof AssistStep];\n\n/** One rung of a surface's focus ladder — the chip's ✕ widens to the next rung. */\nexport enum AssistScope {\n Field = 'field',\n Item = 'item',\n Type = 'type',\n Types = 'types',\n Node = 'node',\n Section = 'section',\n Page = 'page',\n Site = 'site',\n Photo = 'photo',\n Photos = 'photos',\n Rows = 'rows',\n Slot = 'slot',\n Library = 'library',\n Submission = 'submission',\n}\n\n/** iox-cms role actions (`roles/enums.ts` `Permissions`) a surface needs — the server re-checks them, never only the client. */\nexport enum AssistPermission {\n SchemaAll = 'schema_all',\n ContentRead = 'content_read',\n ContentCreate = 'content_create',\n ContentUpdate = 'content_update',\n PageRead = 'page_read',\n PageCreate = 'page_create',\n PageUpdate = 'page_update',\n PageDelete = 'page_delete',\n StorageAll = 'storage_all',\n ProductsAll = 'products_all',\n}\n\nexport enum SurfaceStatus {\n Built = 'built',\n Planned = 'planned',\n}\n\nexport interface SurfaceSpec {\n readonly surface: AssistSurface;\n readonly families: ReadonlyArray<EditFamily>;\n readonly commit: CommitKind;\n /** A family committed differently from the surface (the list's items are a Run; its filters a View). */\n readonly familyCommits?: Readonly<Partial<Record<EditFamily, CommitKind>>>;\n /** Model steps a turn may use. Media (S7) uses the picture steps of generation-core, none of these. */\n readonly steps: ReadonlyArray<AssistStep>;\n /** Every one is required. `content_<action>` is specialised per content type when `perContentType`. */\n readonly permissions: ReadonlyArray<AssistPermission>;\n /** A family that needs more than the surface does. */\n readonly familyPermissions?: Readonly<Partial<Record<EditFamily, ReadonlyArray<AssistPermission>>>>;\n /** The content permissions name a type (`content_<type>_<action>`), as the iox-cms guard specialises them. */\n readonly perContentType: boolean;\n readonly readsPhotos: boolean;\n /** The focus ladder, narrowest first. */\n readonly scopes: ReadonlyArray<AssistScope>;\n readonly status: SurfaceStatus;\n}\n\nconst spec = (s: Omit<SurfaceSpec, 'perContentType' | 'readsPhotos'> & Partial<Pick<SurfaceSpec, 'perContentType' | 'readsPhotos'>>): SurfaceSpec => ({\n perContentType: false,\n readsPhotos: false,\n ...s,\n});\n\nexport const SURFACES: Readonly<Record<AssistSurface, SurfaceSpec>> = {\n [AssistSurface.BuilderPage]: spec({\n surface: AssistSurface.BuilderPage,\n families: [EditFamily.Words, EditFamily.Sections, EditFamily.Style, EditFamily.Look],\n commit: CommitKind.BuilderStep,\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.PageUpdate],\n scopes: [AssistScope.Node, AssistScope.Section, AssistScope.Page],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.ContentItem]: spec({\n surface: AssistSurface.ContentItem,\n families: [EditFamily.Fields],\n commit: CommitKind.FormFill,\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.ContentUpdate],\n perContentType: true,\n scopes: [AssistScope.Field, AssistScope.Item, AssistScope.Type],\n status: SurfaceStatus.Built,\n }),\n [AssistSurface.ContentFromPhotos]: spec({\n surface: AssistSurface.ContentFromPhotos,\n families: [EditFamily.Fields, EditFamily.Media],\n commit: CommitKind.Run,\n steps: [AssistStep.AssistRoute, AssistStep.AssistRead, AssistStep.AssistEdit],\n permissions: [AssistPermission.ContentCreate, AssistPermission.StorageAll],\n perContentType: true,\n readsPhotos: true,\n scopes: [AssistScope.Photo, AssistScope.Photos, AssistScope.Type],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.ContentList]: spec({\n surface: AssistSurface.ContentList,\n families: [EditFamily.View, EditFamily.Items],\n commit: CommitKind.View,\n familyCommits: { [EditFamily.Items]: CommitKind.Run },\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.ContentRead],\n familyPermissions: { [EditFamily.Items]: [AssistPermission.ContentCreate, AssistPermission.ContentUpdate] },\n perContentType: true,\n scopes: [AssistScope.Rows, AssistScope.Type],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.SchemaType]: spec({\n surface: AssistSurface.SchemaType,\n families: [EditFamily.Schema],\n commit: CommitKind.FormFill,\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.SchemaAll],\n scopes: [AssistScope.Field, AssistScope.Type, AssistScope.Types],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.ShopProduct]: spec({\n surface: AssistSurface.ShopProduct,\n families: [EditFamily.Fields],\n commit: CommitKind.FormFill,\n steps: [AssistStep.AssistRoute, AssistStep.AssistRead, AssistStep.AssistEdit],\n permissions: [AssistPermission.ProductsAll],\n readsPhotos: true,\n scopes: [AssistScope.Field, AssistScope.Item],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.Media]: spec({\n surface: AssistSurface.Media,\n families: [EditFamily.Media],\n commit: CommitKind.Run,\n steps: [],\n permissions: [AssistPermission.StorageAll],\n readsPhotos: true,\n scopes: [AssistScope.Slot, AssistScope.Library],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.BuilderSite]: spec({\n surface: AssistSurface.BuilderSite,\n families: [EditFamily.Plan, EditFamily.Sections],\n commit: CommitKind.Run,\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.PageCreate, AssistPermission.PageUpdate, AssistPermission.PageDelete],\n familyPermissions: { [EditFamily.Plan]: [AssistPermission.SchemaAll] },\n scopes: [AssistScope.Page, AssistScope.Site],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.FormInbox]: spec({\n surface: AssistSurface.FormInbox,\n families: [EditFamily.Words],\n commit: CommitKind.View,\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.PageRead],\n scopes: [AssistScope.Submission],\n status: SurfaceStatus.Planned,\n }),\n};\n\nexport const surfaceSpec = (surface: AssistSurface): SurfaceSpec => SURFACES[surface];\n\nexport const builtSurfaces = (): AssistSurface[] =>\n Object.values(SURFACES).filter(s => s.status === SurfaceStatus.Built).map(s => s.surface);\n\nexport const commitOf = (surface: AssistSurface, family: EditFamily): CommitKind =>\n SURFACES[surface].familyCommits?.[family] ?? SURFACES[surface].commit;\n\nconst CONTENT_PERMISSION_PREFIX = 'content_';\nconst ALL_SUFFIX = '_all';\n\n/**\n * The permission strings the server checks for a turn on this surface (and these families): `content_<action>` becomes\n * `content_<type>_<action>` on a per-type surface — the same specialisation iox-cms's AuthorizationGuard applies to a\n * `:resource` route, so a user granted only `content_posts_update` may assist on posts and nowhere else.\n */\nexport function surfacePermissions(surface: AssistSurface, contentType?: string, families: ReadonlyArray<EditFamily> = []): string[] {\n const s = SURFACES[surface];\n const all = [...s.permissions, ...families.flatMap(f => s.familyPermissions?.[f] ?? [])];\n const named = all.map(p => {\n if (!s.perContentType || !contentType || !p.startsWith(CONTENT_PERMISSION_PREFIX) || p.endsWith(ALL_SUFFIX)) return p as string;\n return `${CONTENT_PERMISSION_PREFIX}${contentType}_${p.slice(CONTENT_PERMISSION_PREFIX.length)}`;\n });\n return [...new Set(named)];\n}\n","import { JsonSchema, STRICT_SCHEMA_BUDGET, strictSchemaComplexity } from '@vectoriox/iox-ui/generation-core';\n\n/** The house budget every Assist request is held to (plan F6, trap T7) — generation-core's, never a copy and never raised. */\nexport const MAX_ASSIST_PROPERTIES = STRICT_SCHEMA_BUDGET.properties;\n\n/** The route request is small and fast (plan §3a). */\nexport const MAX_ROUTE_PROPERTIES = 12;\n\n/** Around-layer text is a summary: at most this many characters per value (plan §3c). */\nexport const AROUND_TEXT_CHARS = 160;\n\n/** Sibling items sent as examples of voice (plan §3c: 3–5). */\nexport const AROUND_ITEMS_MAX = 5;\n\n/** The session memory sent with a turn: the last turns, one line each (plan §3c). */\nexport const MEMORY_TURNS = 6;\n\nexport class AssistBudgetError extends Error {}\n\n/** What a request's strict schemas break of the house budget — empty when it fits. */\nexport function assistBudgetIssues(schemas: ReadonlyArray<JsonSchema>, maxProperties: number = MAX_ASSIST_PROPERTIES): string[] {\n const c = strictSchemaComplexity(schemas);\n return [\n ...c.unsupported,\n ...(c.properties > maxProperties ? [`${c.properties} properties (budget ${maxProperties})`] : []),\n ...(c.optional > STRICT_SCHEMA_BUDGET.optional ? [`${c.optional} optional (budget ${STRICT_SCHEMA_BUDGET.optional})`] : []),\n ...(c.unions > STRICT_SCHEMA_BUDGET.unions ? [`${c.unions} unions (budget ${STRICT_SCHEMA_BUDGET.unions})`] : []),\n ];\n}\n\nexport function assertAssistBudget(name: string, schemas: ReadonlyArray<JsonSchema>, maxProperties?: number): void {\n const issues = assistBudgetIssues(schemas, maxProperties);\n if (issues.length) throw new AssistBudgetError(`${name}: ${issues.join('; ')}`);\n}\n","import { AssistScope, AssistSurface, EditFamily } from './surfaces';\n\n/**\n * The brief (plan §3c): what the model is told, built by CODE from what the screen holds, sized by distance from the\n * focus. It names things by HANDLE (`f.summary`, `s2`), never by id (rule 3); the handle map that goes with it is\n * kept by the caller and the server, never sent.\n */\nexport interface Brief<TFocus = unknown, TAround = unknown> {\n readonly surface: AssistSurface;\n /** The thing the sentence is about, in full. */\n readonly focus: TFocus;\n /** Its neighbourhood, summarised. */\n readonly around: TAround;\n /** The business reading (kind, voice, facts, languages) — the caller passes it; null when there is none. */\n readonly owner: string | null;\n readonly rules: BriefRules;\n /** The session's last turns, one line each, oldest first. */\n readonly memory: ReadonlyArray<string>;\n}\n\nexport interface BriefRules {\n /** The families a turn on this focus may answer in. */\n readonly families: ReadonlyArray<EditFamily>;\n /** The locale words are written in (a multiLang field gets this one key). */\n readonly locale: string;\n /** What is never written here, each with why — the model leaves it and says it \"needs you\". */\n readonly never: ReadonlyArray<NeverWrite>;\n /** The focus rung and the rungs it can widen to. */\n readonly scope: AssistScope;\n readonly widensTo: ReadonlyArray<AssistScope>;\n}\n\nexport interface NeverWrite {\n readonly handle: string;\n readonly label: string;\n readonly reason: string;\n}\n\n/** What a handle stands for. `path` is the key path inside the target; `id` a record the handle names (never sent). */\nexport interface HandleTarget {\n readonly key: string;\n readonly path: ReadonlyArray<string>;\n readonly id?: string;\n}\n\nexport type HandleMap = Readonly<Record<string, HandleTarget>>;\n\nexport enum AssistIssueCode {\n UnknownHandle = 'unknownHandle',\n NeverWrite = 'neverWrite',\n WrongType = 'wrongType',\n NotAnOption = 'notAnOption',\n Duplicate = 'duplicate',\n WrongLocale = 'wrongLocale',\n HtmlNotAllowed = 'htmlNotAllowed',\n UnknownFamily = 'unknownFamily',\n BadRequest = 'badRequest',\n UnknownSurface = 'unknownSurface',\n SurfaceNotBuilt = 'surfaceNotBuilt',\n EmptySentence = 'emptySentence',\n SentenceTooLong = 'sentenceTooLong',\n MissingHandles = 'missingHandles',\n MissingValues = 'missingValues',\n}\n\nexport interface AssistIssue {\n readonly code: AssistIssueCode;\n readonly handle?: string;\n readonly message: string;\n}\n\n/** A caller's mistake building a brief (a focus that is not on the screen) — never a model answer. */\nexport class AssistBriefError extends Error {\n constructor(readonly code: AssistIssueCode, message: string) {\n super(message);\n }\n}\n\nexport type HandleResolution = { ok: true; target: HandleTarget } | { ok: false; issue: AssistIssue };\n\n/** The one way a handle becomes a key: an unknown handle is refused, never guessed (trap T1). */\nexport function resolveHandle(handles: HandleMap, handle: string): HandleResolution {\n const target = Object.prototype.hasOwnProperty.call(handles, handle) ? handles[handle] : undefined;\n if (target) return { ok: true, target };\n return { ok: false, issue: { code: AssistIssueCode.UnknownHandle, handle, message: `\"${handle}\" is not a handle of this brief` } };\n}\n\n/** Every handle of the list that the brief does not know. */\nexport function unknownHandles(handles: HandleMap, list: ReadonlyArray<string>): AssistIssue[] {\n return list.flatMap(h => {\n const r = resolveHandle(handles, h);\n return 'issue' in r ? [r.issue] : [];\n });\n}\n\nexport const FIELD_HANDLE_PREFIX = 'f.';\nexport const SIBLING_HANDLE_PREFIX = 's';\nexport const fieldHandle = (key: string): string => `${FIELD_HANDLE_PREFIX}${key}`;\n","import { fieldHandle } from './brief';\n\n/**\n * A content type's fields as Assist sees them, read from the REAL stored schema (iox-cms `schemas` row:\n * `{ name, metaData, schemaObject: { properties } }`; each property `{ type, label, controller: { type, options } }` —\n * cms-client `schema-doc/property-def.model.ts`). A multiLang field is `type: 'object'` + `controller.type: 'multiLang'`\n * whose `properties` are its locales (`{ en: {…}, he: {…} }`), each with the inner control.\n *\n * Every field is either WRITABLE (one of the kinds below) or NEVER written, with a reason. Never written:\n * - by what it is: relations, media (ids / URLs), secrets, dates, e-mail, nested structures, a select with no options;\n * - by what it is about — a closed word list over the key and the label (English + Hebrew): money (price, cost, fee,\n * currency, discount, VAT…), stock (quantity, inventory…), product codes (SKU, barcode…), contact facts (phone, e-mail,\n * address, location, hours…), dates and web addresses (slug, URL, link). A field whose controller or type is `money`\n * / `price` / `currency` is money, ready for \"money as a field type\" (AI plan) the day it exists.\n * The model never sees the value of a never-written field, only whether it is filled; the owner fills it (\"needs you\").\n */\n\nexport interface ContentControllerDef {\n readonly type?: string;\n readonly options?: unknown;\n}\n\nexport interface ContentPropertyDef {\n readonly type: string;\n readonly label?: string;\n readonly controller?: ContentControllerDef;\n readonly properties?: Readonly<Record<string, ContentPropertyDef>>;\n readonly items?: ContentPropertyDef;\n readonly required?: boolean;\n readonly rel?: unknown;\n}\n\nexport interface ContentTypeSchema {\n readonly name: string;\n readonly metaData?: { readonly label?: string; readonly previewTextField?: string; readonly previewImageField?: string };\n readonly schemaObject: { readonly properties: Readonly<Record<string, ContentPropertyDef>> };\n}\n\nexport enum AssistFieldKind {\n Text = 'text',\n Textarea = 'textarea',\n /** Written as plain paragraphs, never HTML (trap T6). */\n RichText = 'richText',\n Number = 'number',\n Boolean = 'boolean',\n /** One of the field's options. */\n Choice = 'choice',\n /** Some of the field's options. */\n Choices = 'choices',\n /** A list of words. */\n Tags = 'tags',\n /** Not writable — `never` says why. */\n Other = 'other',\n}\n\nexport enum NeverWriteReason {\n Money = 'money',\n Stock = 'stock',\n ProductCode = 'productCode',\n Contact = 'contact',\n Date = 'date',\n WebAddress = 'webAddress',\n Relation = 'relation',\n Media = 'media',\n Secret = 'secret',\n Structure = 'structure',\n}\n\nexport interface AssistField {\n readonly key: string;\n readonly handle: string;\n readonly label: string;\n readonly kind: AssistFieldKind;\n readonly required: boolean;\n /** Choice / Choices: the option values the field accepts. */\n readonly options?: ReadonlyArray<string>;\n /** multiLang: the locales the field holds, in schema order. */\n readonly locales?: ReadonlyArray<string>;\n readonly never?: NeverWriteReason;\n}\n\n/** iox-cms `RESERVED_SCHEMA_PROPERTIES` + read-time bookkeeping + shop catalog bookkeeping — never a field. */\nconst NOT_FIELDS: ReadonlySet<string> = new Set([\n 'isPublished', 'organization', 'info', 'addedBy', 'created', 'lastUpdate', '_id', 'isSample', 'pricingUnit',\n]);\n\nenum Control {\n Text = 'text',\n Tag = 'tag',\n Textarea = 'textarea',\n RichText = 'richText',\n Number = 'number',\n Range = 'range',\n Switch = 'switch',\n Checkbox = 'checkbox',\n Select = 'select',\n MultiSelect = 'multiSelect',\n CheckboxGroup = 'checkboxGroup',\n Tags = 'tags',\n List = 'list',\n MultiLang = 'multiLang',\n Email = 'email',\n Password = 'password',\n Encrypt = 'encrypt',\n Date = 'date',\n Time = 'time',\n Image = 'image',\n Media = 'media',\n Gallery = 'gallery',\n RelationCombobox = 'relationCombobox',\n Money = 'money',\n Price = 'price',\n Currency = 'currency',\n}\n\nenum DataType {\n String = 'string',\n Array = 'array',\n Object = 'object',\n Rel = 'rel',\n Encrypt = 'encrypt',\n Date = 'date',\n Money = 'money',\n}\n\nconst KIND_OF_CONTROL: Readonly<Partial<Record<string, AssistFieldKind>>> = {\n [Control.Text]: AssistFieldKind.Text,\n [Control.Tag]: AssistFieldKind.Text,\n [Control.Textarea]: AssistFieldKind.Textarea,\n [Control.RichText]: AssistFieldKind.RichText,\n [Control.Number]: AssistFieldKind.Number,\n [Control.Range]: AssistFieldKind.Number,\n [Control.Switch]: AssistFieldKind.Boolean,\n [Control.Checkbox]: AssistFieldKind.Boolean,\n [Control.Select]: AssistFieldKind.Choice,\n [Control.MultiSelect]: AssistFieldKind.Choices,\n [Control.CheckboxGroup]: AssistFieldKind.Choices,\n [Control.Tags]: AssistFieldKind.Tags,\n [Control.List]: AssistFieldKind.Tags,\n};\n\nconst LIST_KINDS: ReadonlySet<AssistFieldKind> = new Set([AssistFieldKind.Choices, AssistFieldKind.Tags]);\nconst CHOICE_KINDS: ReadonlySet<AssistFieldKind> = new Set([AssistFieldKind.Choice, AssistFieldKind.Choices]);\n\nconst NEVER_OF_CONTROL: Readonly<Partial<Record<string, NeverWriteReason>>> = {\n [Control.Email]: NeverWriteReason.Contact,\n [Control.Password]: NeverWriteReason.Secret,\n [Control.Encrypt]: NeverWriteReason.Secret,\n [Control.Date]: NeverWriteReason.Date,\n [Control.Time]: NeverWriteReason.Date,\n [Control.Image]: NeverWriteReason.Media,\n [Control.Media]: NeverWriteReason.Media,\n [Control.Gallery]: NeverWriteReason.Media,\n [Control.RelationCombobox]: NeverWriteReason.Relation,\n [Control.Money]: NeverWriteReason.Money,\n [Control.Price]: NeverWriteReason.Money,\n [Control.Currency]: NeverWriteReason.Money,\n};\n\nconst NEVER_OF_TYPE: Readonly<Partial<Record<string, NeverWriteReason>>> = {\n [DataType.Rel]: NeverWriteReason.Relation,\n [DataType.Encrypt]: NeverWriteReason.Secret,\n [DataType.Date]: NeverWriteReason.Date,\n [DataType.Money]: NeverWriteReason.Money,\n};\n\n/** The closed word list: a key or label word that makes a field a fact the owner gives. */\nconst NEVER_WORDS: ReadonlyArray<readonly [NeverWriteReason, ReadonlyArray<string>, ReadonlyArray<string>]> = [\n [NeverWriteReason.Money,\n ['price', 'prices', 'pricing', 'cost', 'costs', 'amount', 'fee', 'fees', 'currency', 'discount', 'compareat', 'vat', 'tax', 'total', 'salary', 'budget', 'payment'],\n ['מחיר', 'עלות', 'תשלום', 'מע\"מ', 'הנחה']],\n [NeverWriteReason.Stock, ['stock', 'quantity', 'qty', 'inventory'], ['מלאי', 'כמות']],\n [NeverWriteReason.ProductCode, ['sku', 'barcode', 'ean', 'upc', 'gtin', 'isbn', 'mpn'], ['מק\"ט', 'ברקוד']],\n [NeverWriteReason.Contact,\n ['phone', 'tel', 'telephone', 'mobile', 'whatsapp', 'email', 'mail', 'fax', 'address', 'street', 'city', 'zip', 'postcode', 'location', 'hours'],\n ['טלפון', 'נייד', 'וואטסאפ', 'דוא\"ל', 'אימייל', 'מייל', 'כתובת', 'שעות', 'פקס', 'מיקום']],\n [NeverWriteReason.Date, ['date', 'dates', 'time', 'datetime', 'deadline'], ['תאריך']],\n [NeverWriteReason.WebAddress, ['slug', 'url', 'uri', 'href', 'link', 'website', 'route', 'permalink'], ['קישור', 'לינק']],\n];\n\n/** `startDate` → start, date · `ticket_link` → ticket, link · `Price (₪)` → price. */\nfunction words(text: string): string[] {\n return text.replace(/([a-z0-9])([A-Z])/g, '$1 $2').toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);\n}\n\nfunction neverByWords(key: string, label: string): NeverWriteReason | undefined {\n const english = new Set([...words(key), ...words(label)]);\n const raw = `${key} ${label}`;\n return NEVER_WORDS.find(([, en, he]) => en.some(w => english.has(w)) || he.some(w => raw.includes(w)))?.[0];\n}\n\nfunction optionValues(options: unknown): string[] | undefined {\n if (!Array.isArray(options)) return undefined;\n const values = options.map(o => (o && typeof o === 'object' ? (o as { value?: unknown }).value : o))\n .filter(v => v !== undefined && v !== null && v !== '')\n .map(String);\n return values.length ? [...new Set(values)] : undefined;\n}\n\ninterface Shape {\n kind: AssistFieldKind;\n options?: string[];\n never?: NeverWriteReason;\n}\n\nconst other = (never: NeverWriteReason): Shape => ({ kind: AssistFieldKind.Other, never });\n\n/** What one leaf property is, by its type and control alone. */\nfunction leafShape(def: ContentPropertyDef): Shape {\n const control = def.controller?.type ?? '';\n const never = NEVER_OF_TYPE[def.type] ?? NEVER_OF_CONTROL[control] ?? (def.items ? NEVER_OF_CONTROL[def.items.controller?.type ?? ''] : undefined);\n if (never) return other(never);\n const kind = KIND_OF_CONTROL[control];\n const isList = def.type === DataType.Array;\n if (!kind || isList !== LIST_KINDS.has(kind)) return other(NeverWriteReason.Structure);\n if (isList && def.items && def.items.type !== DataType.String) return other(NeverWriteReason.Structure);\n if (!CHOICE_KINDS.has(kind)) return { kind };\n const options = optionValues(def.controller?.options);\n return options ? { kind, options } : other(NeverWriteReason.Structure);\n}\n\nconst isMultiLang = (def: ContentPropertyDef) => def.controller?.type === Control.MultiLang && !!def.properties;\n\nfunction fieldOf(key: string, def: ContentPropertyDef): AssistField {\n const label = def.label || key;\n const base = { key, handle: fieldHandle(key), label, required: !!def.required };\n if (isMultiLang(def)) {\n const locales = Object.keys(def.properties ?? {});\n const inner = locales.length ? leafShape(def.properties![locales[0]]) : other(NeverWriteReason.Structure);\n const never = inner.never ?? neverByWords(key, label);\n return never ? { ...base, kind: AssistFieldKind.Other, locales, never } : { ...base, ...inner, locales };\n }\n if (def.type === DataType.Object) return { ...base, ...other(NeverWriteReason.Structure) };\n const shape = leafShape(def);\n const never = shape.never ?? neverByWords(key, label);\n return never ? { ...base, kind: AssistFieldKind.Other, never } : { ...base, ...shape };\n}\n\n/** A property the item form renders: not bookkeeping, and (a leaf) carrying a control. */\nconst isFormField = (key: string, def: ContentPropertyDef) =>\n !NOT_FIELDS.has(key) && !!def && (def.type === DataType.Object || !!def.controller);\n\n/** Every form field of the type, in schema order, writable or with the reason it is never written. */\nexport function assistFields(schema: ContentTypeSchema): AssistField[] {\n return Object.entries(schema.schemaObject?.properties ?? {})\n .filter(([key, def]) => isFormField(key, def))\n .map(([key, def]) => fieldOf(key, def));\n}\n\nexport const isWritable = (field: AssistField): boolean => !field.never;\n\n/** The type's title field: its `@title` role (`metaData.previewTextField`), else its first text field. */\nexport function titleField(schema: ContentTypeSchema, fields: ReadonlyArray<AssistField> = assistFields(schema)): AssistField | undefined {\n const role = schema.metaData?.previewTextField;\n return fields.find(f => f.key === role) ?? fields.find(f => f.kind === AssistFieldKind.Text);\n}\n","/**\n * Rich text crosses the model boundary as PLAIN PARAGRAPHS in both directions (trap T6): the brief reads the stored\n * value (the item editor's Quill writes HTML) as paragraphs, and an answer's paragraphs become HTML only here, every\n * character escaped — the model never writes markup that reaches a page.\n */\n\nconst BLOCK_END = /<\\/(p|div|h[1-6]|li|blockquote|pre)>|<br\\s*\\/?>/gi;\nconst TAG = /<[^>]*>/g;\nconst HTML_TAG = /<\\/?[a-z][a-z0-9-]*(\\s[^<>]*)?\\/?>/i;\n\nconst ENTITIES: Readonly<Record<string, string>> = { '&': '&', '<': '<', '>': '>', '"': '\"', ''': \"'\", ' ': ' ' };\nconst ESCAPES: Readonly<Record<string, string>> = { '&': '&', '<': '<', '>': '>', '\"': '"', \"'\": ''' };\n\nconst decode = (text: string) => text.replace(/&(amp|lt|gt|quot|#39|nbsp);/g, e => ENTITIES[e] ?? e);\nconst escape = (text: string) => text.replace(/[&<>\"']/g, c => ESCAPES[c]);\n\n/** A stored rich-text value (HTML, or plain text) as its non-empty paragraphs. */\nexport function richTextParagraphs(value: unknown): string[] {\n if (typeof value !== 'string') return [];\n return decode(value.replace(BLOCK_END, '\\n').replace(TAG, ''))\n .split(/\\n+/)\n .map(p => p.replace(/\\s+/g, ' ').trim())\n .filter(Boolean);\n}\n\n/** Paragraphs as the editor's HTML: one `<p>` each, escaped. */\nexport function paragraphsToRichText(paragraphs: ReadonlyArray<string>): string {\n return paragraphs.map(p => `<p>${escape(p.trim())}</p>`).join('');\n}\n\n/** True when a text written by the model carries markup — refused, never stripped. */\nexport const containsHtml = (text: string): boolean => HTML_TAG.test(text);\n","import { AssistFieldKind } from './content-fields';\nimport { richTextParagraphs } from './rich-text';\n\n/** A field's value as the model reads it: text, paragraphs, a number, yes/no, options, words, or per locale. */\nexport type BriefValue = string | number | boolean | ReadonlyArray<string> | Readonly<Record<string, string | ReadonlyArray<string>>> | null;\n\nconst LIST_KINDS: ReadonlySet<AssistFieldKind> = new Set([AssistFieldKind.Choices, AssistFieldKind.Tags]);\n\nexport const isPlainRecord = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object' && !Array.isArray(v);\nconst asStrings = (v: unknown): string[] => (Array.isArray(v) ? v.filter(x => x !== null && x !== undefined && x !== '').map(String) : []);\n\nfunction readNumber(raw: unknown): number | null {\n if (typeof raw === 'number') return Number.isFinite(raw) ? raw : null;\n if (typeof raw !== 'string' || raw.trim() === '') return null;\n const n = Number(raw);\n return Number.isFinite(n) ? n : null;\n}\n\n/** One stored value (a plain field, or one locale of a multiLang field) in its kind's readable form. */\nexport function readFieldValue(kind: AssistFieldKind, raw: unknown): BriefValue {\n if (raw === undefined || raw === null) return null;\n if (kind === AssistFieldKind.RichText) return richTextParagraphs(raw);\n if (LIST_KINDS.has(kind)) return asStrings(raw);\n if (kind === AssistFieldKind.Number) return readNumber(raw);\n if (kind === AssistFieldKind.Boolean) return !!raw;\n return typeof raw === 'string' ? raw : String(raw);\n}\n\nexport function isEmptyFieldValue(v: unknown): boolean {\n if (v === null || v === undefined) return true;\n if (typeof v === 'string') return v.trim() === '';\n if (Array.isArray(v)) return v.length === 0;\n if (isPlainRecord(v)) return Object.values(v).every(isEmptyFieldValue);\n return false;\n}\n\n/** A multiLang value's locales, each read in the field's kind. */\nexport function readLocaleValues(kind: AssistFieldKind, locales: ReadonlyArray<string>, raw: unknown): Record<string, BriefValue> {\n const values = isPlainRecord(raw) ? raw : {};\n return Object.fromEntries(locales.map(l => [l, readFieldValue(kind, values[l])]));\n}\n\n","import { AROUND_ITEMS_MAX, AROUND_TEXT_CHARS, MEMORY_TURNS } from './budget';\nimport { AssistBriefError, AssistIssueCode, Brief, FIELD_HANDLE_PREFIX, HandleMap, HandleTarget, NeverWrite, SIBLING_HANDLE_PREFIX } from './brief';\nimport { AssistField, AssistFieldKind, assistFields, ContentTypeSchema, isWritable, NeverWriteReason, titleField } from './content-fields';\nimport { BriefValue, isEmptyFieldValue, readFieldValue, readLocaleValues } from './field-values';\nimport { AssistScope, AssistSurface, SURFACES } from './surfaces';\n\n/**\n * The brief of surface S2 — one content item (plan §3c, §4 S2). Focus = the item (every field as a handle `f.<key>`,\n * its kind, label, full value, which locales a multiLang field has filled) or ONE field when the owner opened the\n * field's sparkle; around = the rest of the item (when the focus is a field) and up to five sibling items of the type,\n * each value clipped to 160 characters — examples of the studio's voice, never something to copy.\n */\n\nexport type ContentRecord = Readonly<Record<string, unknown>>;\n\nexport interface ItemBriefField {\n readonly handle: string;\n readonly label: string;\n readonly kind: AssistFieldKind;\n readonly required: boolean;\n /** In the write locale for a multiLang field. */\n readonly empty: boolean;\n /** Absent on a never-written field: the model only learns whether it is filled. */\n readonly value?: BriefValue;\n readonly options?: ReadonlyArray<string>;\n readonly locales?: { readonly filled: ReadonlyArray<string>; readonly empty: ReadonlyArray<string> };\n readonly never?: NeverWriteReason;\n}\n\nexport interface ItemFocus {\n readonly scope: AssistScope;\n readonly type: { readonly name: string; readonly label: string };\n /** The item's name as the list shows it ('' for a new item). */\n readonly title: string;\n /** The `@title` field's handle, when the type has one. */\n readonly titleHandle: string | null;\n readonly fields: ReadonlyArray<ItemBriefField>;\n}\n\nexport interface ItemSummary {\n readonly handle: string;\n readonly title: string;\n /** handle → value, ≤ 160 characters. */\n readonly fields: Readonly<Record<string, string>>;\n}\n\nexport interface ItemAround {\n /** The item's other fields, summarised — only when the focus is one field. */\n readonly item: Readonly<Record<string, string>> | null;\n readonly siblings: ReadonlyArray<ItemSummary>;\n}\n\nexport type ItemBrief = Brief<ItemFocus, ItemAround>;\n\nexport interface ItemBriefContext {\n /** The locale the turn writes in. */\n readonly locale: string;\n /** One field's key or handle: the per-field sparkle. */\n readonly focusField?: string;\n /** Other items of the type (the item itself is skipped); the first five are sent. */\n readonly siblings?: ReadonlyArray<ContentRecord>;\n readonly owner?: string | null;\n readonly memory?: ReadonlyArray<string>;\n}\n\nexport interface SummarizedItem {\n readonly brief: ItemBrief;\n readonly handles: HandleMap;\n}\n\nconst ID_KEY = '_id';\nconst ELLIPSIS = '…';\nconst LIST_JOIN = ', ';\nconst PARAGRAPH_JOIN = '\\n\\n';\n\nconst TEXT_KINDS: ReadonlySet<AssistFieldKind> = new Set([AssistFieldKind.Text, AssistFieldKind.Textarea, AssistFieldKind.RichText]);\n\nexport const clipText = (text: string, max: number = AROUND_TEXT_CHARS): string =>\n text.length <= max ? text : `${text.slice(0, max - ELLIPSIS.length).trimEnd()}${ELLIPSIS}`;\n\nfunction briefField(field: AssistField, raw: unknown, locale: string): ItemBriefField {\n const base = { handle: field.handle, label: field.label, kind: field.kind, required: field.required };\n if (field.never) return { ...base, empty: isEmptyFieldValue(raw), never: field.never };\n const options = field.options ? { options: field.options } : {};\n if (field.locales) {\n const values = readLocaleValues(field.kind, field.locales, raw);\n const filled = field.locales.filter(l => !isEmptyFieldValue(values[l]));\n return {\n ...base, ...options,\n empty: isEmptyFieldValue(values[locale]),\n value: values as Record<string, string | ReadonlyArray<string>>,\n locales: { filled, empty: field.locales.filter(l => !filled.includes(l)) },\n };\n }\n const value = readFieldValue(field.kind, raw);\n return { ...base, ...options, empty: isEmptyFieldValue(value), value };\n}\n\nconst localeOrFirst = (values: Record<string, BriefValue>, locale: string): BriefValue =>\n !isEmptyFieldValue(values[locale]) ? values[locale] : Object.values(values).find(v => !isEmptyFieldValue(v)) ?? null;\n\n/** A value as one clipped line: the write locale first (else the first filled one), paragraphs and lists joined. */\nfunction summaryText(field: AssistField, raw: unknown, locale: string): string {\n const value = field.locales ? localeOrFirst(readLocaleValues(field.kind, field.locales, raw), locale) : readFieldValue(field.kind, raw);\n if (value === null) return '';\n const text = Array.isArray(value) ? value.join(field.kind === AssistFieldKind.RichText ? PARAGRAPH_JOIN : LIST_JOIN) : String(value);\n return clipText(text.replace(/\\s+/g, ' ').trim());\n}\n\nfunction summaries(fields: ReadonlyArray<AssistField>, record: ContentRecord, locale: string): Record<string, string> {\n return Object.fromEntries(fields\n .map(f => [f.handle, summaryText(f, record[f.key], locale)] as const)\n .filter(([, text]) => text !== ''));\n}\n\nfunction findFocusField(fields: ReadonlyArray<AssistField>, focus: string): AssistField {\n const found = fields.find(f => f.key === focus || f.handle === focus || f.handle === `${FIELD_HANDLE_PREFIX}${focus}`);\n if (!found) throw new AssistBriefError(AssistIssueCode.UnknownHandle, `\"${focus}\" is not a field of this type`);\n return found;\n}\n\nconst neverList = (fields: ReadonlyArray<AssistField>): NeverWrite[] =>\n fields.filter(f => f.never).map(f => ({ handle: f.handle, label: f.label, reason: f.never as string }));\n\nfunction siblingsOf(record: ContentRecord, siblings: ReadonlyArray<ContentRecord>): ContentRecord[] {\n const own = record[ID_KEY];\n return siblings.filter(s => own === undefined || s[ID_KEY] !== own).slice(0, AROUND_ITEMS_MAX);\n}\n\n/** S2's brief and its handle map: `f.<key>` per field, `s<n>` per sibling (its id stays in the map, never sent). */\nexport function summarizeItem(schema: ContentTypeSchema, item: ContentRecord, ctx: ItemBriefContext): SummarizedItem {\n const fields = assistFields(schema);\n const focused = ctx.focusField ? findFocusField(fields, ctx.focusField) : null;\n const title = titleField(schema, fields);\n const voiceFields = fields.filter(f => isWritable(f) && TEXT_KINDS.has(f.kind));\n const siblings = siblingsOf(item, ctx.siblings ?? []);\n const siblingHandle = (i: number) => `${SIBLING_HANDLE_PREFIX}${i + 1}`;\n const surface = SURFACES[AssistSurface.ContentItem];\n const scope = focused ? AssistScope.Field : AssistScope.Item;\n\n const handles: Record<string, HandleTarget> = Object.fromEntries([\n ...fields.map(f => [f.handle, { key: f.key, path: [f.key] }] as const),\n ...siblings.map((s, i) => [siblingHandle(i), { key: siblingHandle(i), path: [], ...(s[ID_KEY] !== undefined ? { id: String(s[ID_KEY]) } : {}) }] as const),\n ]);\n\n const brief: ItemBrief = {\n surface: AssistSurface.ContentItem,\n focus: {\n scope,\n type: { name: schema.name, label: schema.metaData?.label || schema.name },\n title: title ? summaryText(title, item[title.key], ctx.locale) : '',\n titleHandle: title?.handle ?? null,\n fields: (focused ? [focused] : fields).map(f => briefField(f, item[f.key], ctx.locale)),\n },\n around: {\n item: focused ? summaries(fields.filter(f => f !== focused && isWritable(f)), item, ctx.locale) : null,\n siblings: siblings.map((s, i) => ({\n handle: siblingHandle(i),\n title: title ? summaryText(title, s[title.key], ctx.locale) : '',\n fields: summaries(voiceFields, s, ctx.locale),\n })),\n },\n owner: ctx.owner ?? null,\n rules: {\n families: surface.families,\n locale: ctx.locale,\n never: neverList(fields),\n scope,\n widensTo: surface.scopes.slice(surface.scopes.indexOf(scope) + 1),\n },\n memory: (ctx.memory ?? []).slice(-MEMORY_TURNS),\n };\n return { brief, handles };\n}\n\nexport enum ItemSuggestionKind {\n FillEmpty = 'fillEmpty',\n Translate = 'translate',\n Shorten = 'shorten',\n WriteSeo = 'writeSeo',\n}\n\n/** A quick action the box offers, built from the brief (never canned text — the client words it). */\nexport interface ItemSuggestion {\n readonly kind: ItemSuggestionKind;\n readonly handles: ReadonlyArray<string>;\n /** Translate: the locale to fill. */\n readonly locale?: string;\n}\n\n/** A text this long is worth a \"Shorten\". */\nexport const SHORTEN_FROM_CHARS = 280;\nconst SEO_WORDS: ReadonlyArray<string> = ['seo', 'meta'];\n\nconst textLength = (v: BriefValue | undefined): number =>\n typeof v === 'string' ? v.length : Array.isArray(v) ? v.join(' ').length : 0;\n\nfunction translations(writable: ReadonlyArray<ItemBriefField>): ItemSuggestion[] {\n const byLocale = new Map<string, string[]>();\n for (const f of writable) {\n if (!f.locales || !f.locales.filled.length) continue;\n for (const l of f.locales.empty) byLocale.set(l, [...(byLocale.get(l) ?? []), f.handle]);\n }\n return [...byLocale].map(([locale, handles]) => ({ kind: ItemSuggestionKind.Translate, locale, handles }));\n}\n\n/** S2's quick actions: Fill empty fields, Translate to <locale>, Shorten, Write SEO — each only when it applies. */\nexport function itemSuggestions(brief: ItemBrief): ItemSuggestion[] {\n const writable = brief.focus.fields.filter(f => !f.never);\n const empty = writable.filter(f => f.empty).map(f => f.handle);\n const long = writable.filter(f => TEXT_KINDS.has(f.kind) && !f.locales && textLength(f.value) >= SHORTEN_FROM_CHARS).map(f => f.handle);\n const seo = writable.filter(f => SEO_WORDS.some(w => f.handle.slice(FIELD_HANDLE_PREFIX.length).toLowerCase().startsWith(w))).map(f => f.handle);\n return [\n ...(empty.length ? [{ kind: ItemSuggestionKind.FillEmpty, handles: empty }] : []),\n ...translations(writable),\n ...(long.length ? [{ kind: ItemSuggestionKind.Shorten, handles: long }] : []),\n ...(seo.length ? [{ kind: ItemSuggestionKind.WriteSeo, handles: seo }] : []),\n ];\n}\n","import { jsonClosedObject, jsonListOf, jsonOneOf, JsonSchema, jsonText } from '@vectoriox/iox-ui/generation-core';\n\nimport { assertAssistBudget, MAX_ASSIST_PROPERTIES } from './budget';\nimport { AssistBriefError, AssistIssueCode } from './brief';\nimport { AssistField, AssistFieldKind, assistFields, ContentTypeSchema, isWritable } from './content-fields';\n\n/**\n * The strict output format of family `fields` for one content type (plan §3b): one property per WRITABLE field, keyed\n * by its handle, every key required, every object closed. \"Leave it as it is\" is the kind's NONE value — `''` for a\n * text, a number (written in digits), a yes/no or a choice, `[]` for paragraphs and lists — never `null`: the house\n * budget allows 8 unions a request, so nullable fields would cap a part at 8 fields; the house wire (plan-edits) uses\n * the same \"every key required, each with its none\". So Assist never EMPTIES a field — clearing one is the owner's.\n * Rich text is a list of plain paragraphs (trap T6); a multiLang field is written in ONE locale (trap T5). A type with\n * more writable fields than one request holds is split into parts, each ≤ 40 properties (trap T7 — never raised).\n */\n\nexport enum FieldsAnswerKey {\n Fields = 'fields',\n Note = 'note',\n}\n\n/** The answer object's own keys, beside the fields. */\nconst PART_OWN_PROPERTIES = Object.keys(FieldsAnswerKey).length;\n\n/** How many fields one request carries. */\nexport const FIELDS_PER_PART = MAX_ASSIST_PROPERTIES - PART_OWN_PROPERTIES;\n\nexport const NONE_TEXT = '';\nexport const BOOLEAN_TRUE = 'true';\nexport const BOOLEAN_FALSE = 'false';\n\nexport interface FieldsSchemaOptions {\n /** The locale a multiLang field is written in. */\n readonly locale: string;\n /** Only these fields (keys or handles) — the focus. Default: every writable field. */\n readonly fields?: ReadonlyArray<string>;\n}\n\nexport interface FieldsSchemas {\n /** One strict format per request. Empty when nothing is writable. */\n readonly parts: JsonSchema[];\n /** Per part, the handles it carries. */\n readonly handles: string[][];\n}\n\nconst LEAVE_TEXT = `'' leaves it as it is`;\nconst LEAVE_LIST = '[] leaves it as it is';\n\nfunction kindSchema(field: AssistField): { schema: JsonSchema; says: string } {\n const options = [...(field.options ?? [])];\n switch (field.kind) {\n case AssistFieldKind.RichText: return { schema: jsonListOf(jsonText()), says: `paragraphs of plain text, no markup; ${LEAVE_LIST}` };\n case AssistFieldKind.Number: return { schema: jsonText(), says: `a number in digits; ${LEAVE_TEXT}` };\n case AssistFieldKind.Boolean: return { schema: jsonOneOf([NONE_TEXT, BOOLEAN_TRUE, BOOLEAN_FALSE]), says: `yes or no; ${LEAVE_TEXT}` };\n case AssistFieldKind.Choice: return { schema: jsonOneOf([NONE_TEXT, ...options]), says: `one of its options; ${LEAVE_TEXT}` };\n case AssistFieldKind.Choices: return { schema: jsonListOf(jsonOneOf(options)), says: `some of its options; ${LEAVE_LIST}` };\n case AssistFieldKind.Tags: return { schema: jsonListOf(jsonText()), says: `a list of short words; ${LEAVE_LIST}` };\n case AssistFieldKind.Textarea: return { schema: jsonText(), says: `plain text, may run several sentences; ${LEAVE_TEXT}` };\n default: return { schema: jsonText(), says: `one line of plain text; ${LEAVE_TEXT}` };\n }\n}\n\nfunction fieldSchema(field: AssistField, locale: string): JsonSchema {\n const { schema, says } = kindSchema(field);\n const inLocale = field.locales ? ` Written in ${locale} only.` : '';\n return { ...schema, description: `${field.label}${field.required ? ' (required)' : ''} — ${says}.${inLocale}` };\n}\n\nfunction chosen(all: ReadonlyArray<AssistField>, wanted: ReadonlyArray<string> | undefined): AssistField[] {\n if (!wanted) return all.filter(isWritable);\n return wanted.map(w => {\n const f = all.find(x => x.key === w || x.handle === w);\n if (!f) throw new AssistBriefError(AssistIssueCode.UnknownHandle, `\"${w}\" is not a field of this type`);\n return f;\n }).filter(isWritable);\n}\n\n/** Splits n fields into the fewest parts that fit, as even as they come. */\nfunction split<T>(list: ReadonlyArray<T>, max: number): T[][] {\n if (!list.length) return [];\n const count = Math.ceil(list.length / max);\n const size = Math.ceil(list.length / count);\n return Array.from({ length: count }, (_, i) => list.slice(i * size, (i + 1) * size));\n}\n\nfunction partSchema(fields: ReadonlyArray<AssistField>, locale: string, part: number, of: number): JsonSchema {\n const properties = Object.fromEntries(fields.map(f => [f.handle, fieldSchema(f, locale)]));\n const which = of > 1 ? ` (part ${part + 1} of ${of})` : '';\n return jsonClosedObject({\n [FieldsAnswerKey.Fields]: jsonClosedObject(properties, fields.map(f => f.handle), `Per field${which}: its new value, or its leave value.`),\n [FieldsAnswerKey.Note]: { ...jsonText(), description: 'One short line for the owner on what changed, or what needs them.' },\n }, Object.values(FieldsAnswerKey));\n}\n\nexport function fieldsJsonSchema(schema: ContentTypeSchema, options: FieldsSchemaOptions): FieldsSchemas {\n const groups = split(chosen(assistFields(schema), options.fields), FIELDS_PER_PART);\n const parts = groups.map((g, i) => partSchema(g, options.locale, i, groups.length));\n parts.forEach((p, i) => assertAssistBudget(`fields ${schema.name} part ${i + 1}`, [p]));\n return { parts, handles: groups.map(g => g.map(f => f.handle)) };\n}\n\n/** One field's answer as the model wrote it. */\nexport interface FieldEdit {\n readonly handle: string;\n readonly value: unknown;\n}\n\nconst isLeave = (v: unknown) => v === null || v === undefined || v === NONE_TEXT || (Array.isArray(v) && v.length === 0);\n\n/** The parts' answers → the edits they make (every leave value dropped). */\nexport function decodeFieldsAnswers(answers: ReadonlyArray<unknown>): FieldEdit[] {\n return answers.flatMap(answer => {\n const fields = answer && typeof answer === 'object' ? (answer as Record<string, unknown>)[FieldsAnswerKey.Fields] : undefined;\n if (!fields || typeof fields !== 'object' || Array.isArray(fields)) return [];\n return Object.entries(fields as Record<string, unknown>).filter(([, v]) => !isLeave(v)).map(([handle, value]) => ({ handle, value }));\n });\n}\n","import { jsonAnyOf, jsonClosedObject, jsonListOf, jsonOneOf, JsonSchema, jsonText } from '@vectoriox/iox-ui/generation-core';\n\nimport { assertAssistBudget, MAX_ROUTE_PROPERTIES } from './budget';\nimport { AssistIssue, AssistIssueCode } from './brief';\nimport { AssistSurface, EditFamily, SURFACES } from './surfaces';\n\n/**\n * The route request (plan §3c rule 5): the first, small, fast question of every turn — which of THIS surface's\n * families the sentence needs, or `cannot` with one line for the owner. Its family enum is the surface's, so the model\n * cannot route a content-item sentence to the builder's Style.\n */\n\nexport enum RouteAnswerKey {\n Families = 'families',\n Cannot = 'cannot',\n Reply = 'reply',\n}\n\nexport function routeJsonSchema(surface: AssistSurface): JsonSchema {\n const schema = jsonClosedObject({\n [RouteAnswerKey.Families]: { ...jsonListOf(jsonOneOf(SURFACES[surface].families)), description: 'The kinds of change the sentence asks for, in the order to make them. [] when it cannot be done here.' },\n [RouteAnswerKey.Cannot]: { ...jsonAnyOf([jsonText(), { type: 'null' }]), description: 'Why it cannot be done here, in one line in the sentence\\'s language — or null.' },\n [RouteAnswerKey.Reply]: { ...jsonText(), description: 'One short line to the owner, in the sentence\\'s language.' },\n }, Object.values(RouteAnswerKey));\n assertAssistBudget(`route ${surface}`, [schema], MAX_ROUTE_PROPERTIES);\n return schema;\n}\n\nexport interface AssistRoute {\n readonly ok: boolean;\n readonly families: ReadonlyArray<EditFamily>;\n readonly cannot: string | null;\n readonly reply: string;\n readonly issues: ReadonlyArray<AssistIssue>;\n}\n\nconst text = (v: unknown): string => (typeof v === 'string' ? v.trim() : '');\n\n/** A route answer, checked against its surface: a family the surface does not have is refused, repeats dropped. */\nexport function readRoute(surface: AssistSurface, answer: unknown): AssistRoute {\n const a = (answer && typeof answer === 'object' ? answer : {}) as Record<string, unknown>;\n const allowed = new Set<string>(SURFACES[surface].families);\n const named = Array.isArray(a[RouteAnswerKey.Families]) ? (a[RouteAnswerKey.Families] as unknown[]).map(String) : [];\n const issues: AssistIssue[] = named.filter(f => !allowed.has(f))\n .map(f => ({ code: AssistIssueCode.UnknownFamily, message: `\"${f}\" is not a family of ${surface}` }));\n const families = [...new Set(named.filter(f => allowed.has(f)))] as EditFamily[];\n const cannot = text(a[RouteAnswerKey.Cannot]) || null;\n return { ok: !issues.length, families: cannot ? [] : families, cannot, reply: text(a[RouteAnswerKey.Reply]), issues };\n}\n","import { AssistIssue, AssistIssueCode, HandleMap, resolveHandle } from './brief';\nimport { AssistField, AssistFieldKind, assistFields, ContentTypeSchema } from './content-fields';\nimport { BOOLEAN_FALSE, BOOLEAN_TRUE, FieldEdit } from './fields-schema';\nimport { BriefValue, isPlainRecord, readFieldValue } from './field-values';\nimport { containsHtml, paragraphsToRichText } from './rich-text';\nimport { ContentRecord } from './summarize-item';\n\n/**\n * Family `fields`, applied (plan §3c rule 6): the SAME pure check runs on the server (on a copy, before the turn is\n * shown) and in the client (the trial in the form). All or none — one refused edit refuses the turn, which is re-asked\n * once with the issues, never repaired in code. Never mutates its input.\n * - a handle maps back through the brief's map; an unknown one is refused (T1);\n * - a never-written field, a wrong type, a choice outside the options, markup in a text: refused;\n * - a multiLang field gets ONE locale key, the others kept (T5);\n * - rich text is stored as escaped `<p>` paragraphs; the change carries the paragraphs (T6);\n * - a field the owner edited since the last turn is KEPT unless the sentence names it (rule 9);\n * - an edit that changes nothing is dropped.\n */\n\nexport interface FieldEditContext {\n readonly schema: ContentTypeSchema;\n readonly handles: HandleMap;\n /** The locale a multiLang field is written in. */\n readonly locale: string;\n /** Fields (keys or handles) the owner changed since the last AI turn. */\n readonly ownerEdited?: ReadonlyArray<string>;\n /** Fields (keys or handles) the sentence names. Default: read from `sentence` by `fieldsNamedIn`. */\n readonly named?: ReadonlyArray<string>;\n readonly sentence?: string;\n}\n\nexport interface FieldChange {\n readonly handle: string;\n readonly key: string;\n readonly label: string;\n readonly kind: AssistFieldKind;\n /** Readable: text, paragraphs, a number, yes/no, options, words. */\n readonly before: BriefValue;\n readonly after: BriefValue;\n readonly locale?: string;\n}\n\nexport interface FieldEditsOutcome {\n readonly ok: boolean;\n /** The record with every change applied (stored form) — a copy of the input when refused. */\n readonly result: ContentRecord;\n readonly changes: ReadonlyArray<FieldChange>;\n /** Proposed, but the owner edited the field since and the sentence did not name it. */\n readonly kept: ReadonlyArray<FieldChange>;\n readonly issues: ReadonlyArray<AssistIssue>;\n}\n\ntype Coerced = { ok: true; stored: unknown; readable: BriefValue } | { ok: false; code: AssistIssueCode; message: string };\n\nconst refuse = (code: AssistIssueCode, message: string): Coerced => ({ ok: false, code, message });\nconst wrongType = (what: string) => refuse(AssistIssueCode.WrongType, `expected ${what}`);\nconst fine = (stored: unknown, readable: BriefValue = stored as BriefValue): Coerced => ({ ok: true, stored, readable });\n\nfunction coerceText(value: unknown): Coerced {\n if (typeof value !== 'string' || !value.trim()) return wrongType('a non-empty text');\n if (containsHtml(value)) return refuse(AssistIssueCode.HtmlNotAllowed, 'markup is not written by Assist');\n return fine(value.trim());\n}\n\nfunction coerceWords(value: unknown): { words: string[] } | Coerced {\n if (!Array.isArray(value) || value.some(v => typeof v !== 'string')) return wrongType('a list of texts');\n const words = [...new Set((value as string[]).map(v => v.trim()).filter(Boolean))];\n if (!words.length) return wrongType('at least one text');\n if (words.some(containsHtml)) return refuse(AssistIssueCode.HtmlNotAllowed, 'markup is not written by Assist');\n return { words };\n}\n\nfunction coerceNumber(value: unknown): Coerced {\n const n = typeof value === 'number' ? value : typeof value === 'string' && value.trim() !== '' ? Number(value.trim()) : NaN;\n return Number.isFinite(n) ? fine(n) : wrongType('a number');\n}\n\nfunction coerceBoolean(value: unknown): Coerced {\n if (typeof value === 'boolean') return fine(value);\n if (value === BOOLEAN_TRUE || value === BOOLEAN_FALSE) return fine(value === BOOLEAN_TRUE);\n return wrongType('yes or no');\n}\n\nfunction coerceChoice(field: AssistField, value: unknown): Coerced {\n if (typeof value !== 'string') return wrongType('one of the options');\n return field.options?.includes(value) ? fine(value) : refuse(AssistIssueCode.NotAnOption, `\"${value}\" is not an option of ${field.label}`);\n}\n\nfunction coerceList(field: AssistField, value: unknown): Coerced {\n const read = coerceWords(value);\n if (!('words' in read)) return read;\n if (field.kind === AssistFieldKind.Choices) {\n const outside = read.words.filter(w => !field.options?.includes(w));\n if (outside.length) return refuse(AssistIssueCode.NotAnOption, `${outside.map(w => `\"${w}\"`).join(', ')} not an option of ${field.label}`);\n }\n return fine(read.words);\n}\n\nfunction coerceRichText(value: unknown): Coerced {\n const read = coerceWords(value);\n if (!('words' in read)) return read;\n return fine(paragraphsToRichText(read.words), read.words);\n}\n\nfunction coerce(field: AssistField, value: unknown): Coerced {\n switch (field.kind) {\n case AssistFieldKind.RichText: return coerceRichText(value);\n case AssistFieldKind.Number: return coerceNumber(value);\n case AssistFieldKind.Boolean: return coerceBoolean(value);\n case AssistFieldKind.Choice: return coerceChoice(field, value);\n case AssistFieldKind.Choices:\n case AssistFieldKind.Tags: return coerceList(field, value);\n default: return coerceText(value);\n }\n}\n\nconst NAME_MIN_CHARS = 3;\n\n/** The fields a sentence names by label, key or handle (case-insensitive) — rule 9's \"unless the sentence names it\". */\nexport function fieldsNamedIn(sentence: string, fields: ReadonlyArray<AssistField>): string[] {\n const s = sentence.toLowerCase();\n if (!s.trim()) return [];\n return fields.filter(f => [f.label, f.key, f.handle].some(n => n.length >= NAME_MIN_CHARS && s.includes(n.toLowerCase()))).map(f => f.key);\n}\n\nconst names = (list: ReadonlyArray<string> | undefined, fields: ReadonlyArray<AssistField>): Set<string> =>\n new Set((list ?? []).map(n => fields.find(f => f.key === n || f.handle === n)?.key ?? n));\n\ninterface Planned {\n field: AssistField;\n stored: unknown;\n change: FieldChange;\n}\n\nfunction plan(field: AssistField, handle: string, values: ContentRecord, coerced: { stored: unknown; readable: BriefValue }, locale: string): Planned | null {\n const raw = values[field.key];\n const own = field.locales ? (isPlainRecord(raw) ? raw : {}) : null;\n const before = readFieldValue(field.kind, own ? own[locale] : raw);\n if (JSON.stringify(before) === JSON.stringify(coerced.readable)) return null;\n const stored = own ? { ...own, [locale]: coerced.stored } : coerced.stored;\n const change: FieldChange = {\n handle, key: field.key, label: field.label, kind: field.kind, before, after: coerced.readable, ...(own ? { locale } : {}),\n };\n return { field, stored, change };\n}\n\nexport function applyFieldEdits(values: ContentRecord, edits: ReadonlyArray<FieldEdit>, ctx: FieldEditContext): FieldEditsOutcome {\n const fields = assistFields(ctx.schema);\n const issues: AssistIssue[] = [];\n const planned: Planned[] = [];\n const seen = new Set<string>();\n const issue = (code: AssistIssueCode, handle: string, message: string) => issues.push({ code, handle, message });\n\n for (const edit of edits) {\n const resolved = resolveHandle(ctx.handles, edit.handle);\n if ('issue' in resolved) { issues.push(resolved.issue); continue; }\n const field = fields.find(f => f.key === resolved.target.key);\n if (!field) { issue(AssistIssueCode.UnknownHandle, edit.handle, `\"${edit.handle}\" is not a field of ${ctx.schema.name}`); continue; }\n if (seen.has(field.key)) { issue(AssistIssueCode.Duplicate, edit.handle, `${field.label} is written twice`); continue; }\n seen.add(field.key);\n if (field.never) { issue(AssistIssueCode.NeverWrite, edit.handle, `${field.label} is never written by Assist (${field.never})`); continue; }\n if (field.locales && !field.locales.includes(ctx.locale)) { issue(AssistIssueCode.WrongLocale, edit.handle, `${field.label} has no ${ctx.locale}`); continue; }\n const coerced = coerce(field, edit.value);\n if ('code' in coerced) { issue(coerced.code, edit.handle, `${field.label}: ${coerced.message}`); continue; }\n const p = plan(field, edit.handle, values, coerced, ctx.locale);\n if (p) planned.push(p);\n }\n\n if (issues.length) return { ok: false, result: { ...values }, changes: [], kept: [], issues };\n\n const edited = names(ctx.ownerEdited, fields);\n const named = names(ctx.named ?? fieldsNamedIn(ctx.sentence ?? '', fields), fields);\n const isKept = (p: Planned) => edited.has(p.field.key) && !named.has(p.field.key);\n const applied = planned.filter(p => !isKept(p));\n const result: Record<string, unknown> = { ...values };\n for (const p of applied) result[p.field.key] = p.stored;\n return { ok: true, result, changes: applied.map(p => p.change), kept: planned.filter(isKept).map(p => p.change), issues: [] };\n}\n","import { AROUND_TEXT_CHARS, MEMORY_TURNS } from './budget';\nimport { AssistIssue, AssistIssueCode, Brief, HandleMap } from './brief';\nimport { FieldChange } from './field-edits';\nimport { FieldEdit } from './fields-schema';\nimport { ContentRecord, clipText } from './summarize-item';\nimport { AssistSurface, CommitKind, EditFamily, SURFACES, SurfaceStatus } from './surfaces';\n\n/**\n * The turn wire (plan §3d) — what cms-client posts and polls and iox-cms stores and answers, ONE definition both sides\n * import (generation-core `ai-run.ts` is the precedent for generations). A turn is a document on the jobs runner:\n * POST answers 202 `{ turnId }`, the client polls the turn every 750 ms until it is terminal.\n */\n\nexport enum AssistTurnStatus {\n Queued = 'queued',\n Routing = 'routing',\n Editing = 'editing',\n Done = 'done',\n Refused = 'refused',\n Failed = 'failed',\n}\n\nconst TERMINAL: ReadonlySet<AssistTurnStatus> = new Set([AssistTurnStatus.Done, AssistTurnStatus.Refused, AssistTurnStatus.Failed]);\n\nexport const isTerminalTurn = (status: AssistTurnStatus): boolean => TERMINAL.has(status);\n\n/** Auto = the step's model from Settings ▸ AI ▸ Models (A-D14). */\nexport const ASSIST_MODEL_AUTO = 'auto';\n\n/** `'auto'` or a model id. */\nexport type AssistModelChoice = typeof ASSIST_MODEL_AUTO | string;\n\nexport const ASSIST_POLL_MS = 750;\n\nexport const MAX_SENTENCE_CHARS = 2000;\n\nexport interface AssistTurnRequest {\n readonly surface: AssistSurface;\n /** `assistSessionKey(surface, target)`; the server adds the user. */\n readonly sessionKey: string;\n readonly sentence: string;\n readonly model: AssistModelChoice;\n readonly contentType?: string;\n readonly itemId?: string;\n readonly brief: Brief;\n readonly handles: HandleMap;\n /** A form-fill surface: the form's current values (it may be unsaved) — the edits are checked against them. */\n readonly values?: ContentRecord;\n /** Field keys the owner changed since the last AI turn — kept unless the sentence names them (rule 9). */\n readonly ownerEdited?: ReadonlyArray<string>;\n}\n\n/** POST's 202 answer. */\nexport interface AssistTurnAccepted {\n readonly turnId: string;\n}\n\n/** A turn's own refusals and failures, beside generation-core's `AiRefusalCode`s (credits, plan, key), which a turn returns as they are. */\nexport enum AssistRefusalCode {\n /** The turn machinery runs, no model is connected yet. */\n NotConnected = 'ai.assistNotConnected',\n /** The turn spent its own credit cap (trap T8) before a call it still needed. */\n TurnBudget = 'ai.assistTurnBudget',\n /** The routed families need a permission the person who asked does not hold. */\n Permission = 'ai.assistPermission',\n /** A process died during this turn's call more often than one resume allows. */\n Interrupted = 'ai.assistInterrupted',\n /** The provider call threw — the turn ends; the owner may ask again. */\n CallFailed = 'ai.assistCallFailed',\n /** The model's answer broke the check twice (the first time it was re-asked with the issues). */\n InvalidAnswer = 'ai.assistInvalidAnswer',\n /** The chosen model is not on the vetted list for this step, and the turn runs on IOX credits. */\n ModelNotOffered = 'ai.assistModelNotOffered',\n /** The chosen model cannot do the step (on the studio's own key any model may be typed; this one lacks a need). */\n ModelDeclined = 'ai.assistModelDeclined',\n}\n\nexport interface AssistTurnRefusal {\n /** An `AssistRefusalCode` or an `AiRefusalCode` — a string, so both fit. */\n readonly code: string;\n readonly message: string;\n}\n\nexport interface AssistTurn {\n readonly id: string;\n readonly surface: AssistSurface;\n readonly sessionKey: string;\n readonly status: AssistTurnStatus;\n readonly sentence: string;\n /** The model it ran on (Auto resolved) — the one the ledger row names (R-H11). */\n readonly model?: string;\n readonly families?: ReadonlyArray<EditFamily>;\n readonly reply?: string;\n readonly edits?: ReadonlyArray<FieldEdit>;\n readonly changes?: ReadonlyArray<FieldChange>;\n readonly kept?: ReadonlyArray<FieldChange>;\n readonly issues?: ReadonlyArray<AssistIssue>;\n readonly refusal?: AssistTurnRefusal;\n readonly credits?: number;\n /** ISO time. */\n readonly createdAt: string;\n}\n\nexport enum AssistRouteKey {\n Turns = 'turns',\n Turn = 'turn',\n Session = 'session',\n}\n\n/** The path templates, `:param` filled by `assistPath` — neither side hand-types a URL. */\nexport const ASSIST_ROUTES: Readonly<Record<AssistRouteKey, string>> = {\n [AssistRouteKey.Turns]: 'admin/api/org/:orgId/ai/assist/turns',\n [AssistRouteKey.Turn]: 'admin/api/org/:orgId/ai/assist/turns/:turnId',\n [AssistRouteKey.Session]: 'admin/api/org/:orgId/ai/assist/sessions/:sessionKey',\n};\n\nexport class AssistPathError extends Error {}\n\n/** A route with its params filled, each URL-encoded; a missing param throws. */\nexport function assistPath(route: AssistRouteKey, params: Readonly<Record<string, string>>): string {\n return ASSIST_ROUTES[route].replace(/:([A-Za-z]+)/g, (_, name: string) => {\n const value = params[name];\n if (!value) throw new AssistPathError(`${route}: no ${name}`);\n return encodeURIComponent(value);\n });\n}\n\n/** What a session is about, beside its surface (A-D9: per user × surface × target). */\nexport interface AssistTarget {\n readonly contentType?: string;\n readonly itemId?: string | null;\n readonly pageId?: string;\n readonly submissionId?: string;\n}\n\nconst SESSION_TARGET_KEYS: Readonly<Record<AssistSurface, ReadonlyArray<keyof AssistTarget>>> = {\n [AssistSurface.BuilderPage]: ['pageId'],\n [AssistSurface.ContentItem]: ['contentType', 'itemId'],\n [AssistSurface.ContentFromPhotos]: ['contentType'],\n [AssistSurface.ContentList]: ['contentType'],\n [AssistSurface.SchemaType]: ['contentType'],\n [AssistSurface.ShopProduct]: ['itemId'],\n [AssistSurface.Media]: [],\n [AssistSurface.BuilderSite]: [],\n [AssistSurface.FormInbox]: ['submissionId'],\n};\n\n/** A target not saved yet. */\nexport const NEW_TARGET = 'new';\nconst SESSION_SEPARATOR = ':';\n\n/** `contentItem:projects:<itemId|new>` — each part encoded, so a value never carries the separator. */\nexport function assistSessionKey(surface: AssistSurface, target: AssistTarget = {}): string {\n const parts = SESSION_TARGET_KEYS[surface].map(k => encodeURIComponent(target[k] || NEW_TARGET));\n return [surface, ...parts].join(SESSION_SEPARATOR);\n}\n\nexport interface AssistMemoryLine {\n readonly turnId: string;\n readonly createdAt: string;\n readonly line: string;\n}\n\nconst SENTENCE_IN_MEMORY_CHARS = 80;\n\nfunction outcome(turn: AssistTurn): string {\n const named = (list: ReadonlyArray<FieldChange> | undefined) =>\n (list ?? []).map(c => (c.locale ? `${c.label} (${c.locale})` : c.label)).join(', ');\n switch (turn.status) {\n case AssistTurnStatus.Refused: return `refused: ${turn.refusal?.message ?? ''}`.trim();\n case AssistTurnStatus.Failed: return 'failed';\n case AssistTurnStatus.Done: {\n const changed = named(turn.changes);\n const kept = named(turn.kept);\n const head = changed ? `changed ${changed}` : `no change${turn.reply ? `: ${turn.reply}` : ''}`;\n return kept ? `${head}; kept ${kept} (the owner edited it)` : head;\n }\n default: return turn.status;\n }\n}\n\n/** One line the next turn reads as memory — never a tree, a record or a value. */\nexport function memoryLine(turn: AssistTurn): AssistMemoryLine {\n const asked = clipText(turn.sentence.replace(/\\s+/g, ' ').trim(), SENTENCE_IN_MEMORY_CHARS);\n return { turnId: turn.id, createdAt: turn.createdAt, line: clipText(`\"${asked}\" → ${outcome(turn)}`, AROUND_TEXT_CHARS) };\n}\n\n/** `GET …/ai/assist/sessions/:sessionKey` — the memory the next turn is sent. */\nexport interface AssistSession {\n readonly sessionKey: string;\n readonly lines: ReadonlyArray<AssistMemoryLine>;\n}\n\n/** A session's answer from its stored turns (those of another session are ignored). */\nexport function assistSession(sessionKey: string, turns: ReadonlyArray<AssistTurn>): AssistSession {\n return { sessionKey, lines: sessionMemory(turns.filter(t => t.sessionKey === sessionKey)) };\n}\n\n/** A session's memory: its last `MEMORY_TURNS` finished turns, oldest first. */\nexport function sessionMemory(turns: ReadonlyArray<AssistTurn>): AssistMemoryLine[] {\n return turns\n .filter(t => isTerminalTurn(t.status))\n .slice()\n .sort((a, b) => a.createdAt.localeCompare(b.createdAt))\n .slice(-MEMORY_TURNS)\n .map(memoryLine);\n}\n\nconst isObject = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object' && !Array.isArray(v);\nconst nonEmpty = (v: unknown): v is string => typeof v === 'string' && v.trim() !== '';\n\n/** Absent, or a list of non-empty field keys. */\nconst isOwnerEdited = (v: unknown): boolean => v === undefined || (Array.isArray(v) && v.every(nonEmpty));\n\n/** A key `assistSessionKey` made for this surface. */\nexport const isSessionOf = (key: unknown, surface: AssistSurface): boolean =>\n nonEmpty(key) && (key === surface || key.startsWith(`${surface}${SESSION_SEPARATOR}`));\n\n/** What the server refuses in a posted turn before anything runs. Empty = accepted. */\nexport function validateTurnRequest(req: unknown): AssistIssue[] {\n const issue = (code: AssistIssueCode, message: string): AssistIssue => ({ code, message });\n if (!isObject(req)) return [issue(AssistIssueCode.BadRequest, 'a turn is an object')];\n const surface = req['surface'] as AssistSurface;\n const spec = Object.prototype.hasOwnProperty.call(SURFACES, surface) ? SURFACES[surface] : undefined;\n if (!spec) return [issue(AssistIssueCode.UnknownSurface, `\"${String(surface)}\" is not a surface`)];\n const sentence = req['sentence'];\n const brief = req['brief'];\n return [\n ...(spec.status !== SurfaceStatus.Built ? [issue(AssistIssueCode.SurfaceNotBuilt, `${surface} is not built yet`)] : []),\n ...(!isSessionOf(req['sessionKey'], surface) ? [issue(AssistIssueCode.BadRequest, `the session key is not a ${surface} session`)] : []),\n ...(!nonEmpty(sentence) ? [issue(AssistIssueCode.EmptySentence, 'the sentence is empty')] : []),\n ...(nonEmpty(sentence) && sentence.length > MAX_SENTENCE_CHARS ? [issue(AssistIssueCode.SentenceTooLong, `the sentence is over ${MAX_SENTENCE_CHARS} characters`)] : []),\n ...(!nonEmpty(req['model']) ? [issue(AssistIssueCode.BadRequest, 'no model choice (auto or a model id)')] : []),\n ...(!isObject(brief) || brief['surface'] !== surface ? [issue(AssistIssueCode.BadRequest, `the brief is not a ${surface} brief`)] : []),\n ...(!isObject(req['handles']) || !Object.keys(req['handles']).length ? [issue(AssistIssueCode.MissingHandles, 'the brief\\'s handles are missing')] : []),\n ...(spec.commit === CommitKind.FormFill && !isObject(req['values']) ? [issue(AssistIssueCode.MissingValues, 'a form-fill turn carries the form\\'s values')] : []),\n ...(!isOwnerEdited(req['ownerEdited']) ? [issue(AssistIssueCode.BadRequest, 'ownerEdited is a list of field keys')] : []),\n ...(spec.perContentType && !nonEmpty(req['contentType']) ? [issue(AssistIssueCode.BadRequest, `${surface} names its content type`)] : []),\n ];\n}\n","import { AssistField } from './content-fields';\nimport { isEmptyFieldValue, isPlainRecord } from './field-values';\nimport { ContentRecord } from './summarize-item';\n\n/**\n * The ONE locale a content-item turn writes in (plan §3c rule 8, trap T5) — decided the same way by the server and the\n * client: a multiLang field gets this key and no other. The sentence decides when it names a language (\"translate the\n * summary to English\", \"תרגם לאנגלית\") — matched against the runtime's own language names (`Intl.DisplayNames`) in the\n * languages the admin speaks, never a hand-kept list; the last one named wins. Otherwise the item's own language: the\n * locale most of its multiLang fields are filled in (schema order breaks a tie); else the admin's; else the first.\n */\n\n/** The languages whose names a sentence may use — the admin's two UI languages. */\nexport const LOCALE_NAME_LANGUAGES: ReadonlyArray<string> = ['en', 'he'];\n\nconst DISPLAY_TYPE_LANGUAGE = 'language';\n\n/** Every locale the type's multiLang fields hold, in schema order. */\nexport function itemLocales(fields: ReadonlyArray<AssistField>): string[] {\n return [...new Set(fields.flatMap(f => f.locales ?? []))];\n}\n\nfunction displayName(locale: string, inLanguage: string): string | null {\n try {\n const name = new Intl.DisplayNames([inLanguage], { type: DISPLAY_TYPE_LANGUAGE }).of(locale);\n return name && name !== locale ? name : null;\n } catch {\n return null;\n }\n}\n\nfunction languageNames(locale: string, languages: ReadonlyArray<string>): string[] {\n return languages.flatMap(lang => {\n const name = displayName(locale, lang);\n return name ? [name.toLowerCase()] : [];\n });\n}\n\n/** The last position a locale's name appears at in the sentence, or -1. */\nfunction lastMention(sentence: string, locale: string, languages: ReadonlyArray<string>): number {\n const s = sentence.toLowerCase();\n return Math.max(-1, ...languageNames(locale, languages).map(n => s.lastIndexOf(n)));\n}\n\n/** The locale the sentence names; the last one named wins (\"the Hebrew summary to English\" → en). */\nexport function namedLocale(sentence: string, locales: ReadonlyArray<string>, languages: ReadonlyArray<string> = LOCALE_NAME_LANGUAGES): string | null {\n const named = locales\n .map(locale => ({ locale, at: lastMention(sentence, locale, languages) }))\n .filter(m => m.at >= 0)\n .sort((a, b) => b.at - a.at);\n return named[0]?.locale ?? null;\n}\n\n/** The locale most of the item's multiLang fields are filled in (schema order breaks a tie); else the UI's; else the first. */\nexport function primaryLocale(fields: ReadonlyArray<AssistField>, values: ContentRecord, uiLang: string): string {\n const locales = itemLocales(fields);\n if (!locales.length) return uiLang;\n const filled = (locale: string) => fields.filter(f => {\n const v = values[f.key];\n return f.locales?.includes(locale) && isPlainRecord(v) && !isEmptyFieldValue(v[locale]);\n }).length;\n const best = locales.reduce((a, b) => (filled(b) > filled(a) ? b : a));\n if (filled(best) > 0) return best;\n return locales.includes(uiLang) ? uiLang : locales[0];\n}\n\n/** The write locale of a content-item turn. */\nexport function turnLocale(sentence: string, fields: ReadonlyArray<AssistField>, values: ContentRecord, uiLang: string): string {\n return namedLocale(sentence, itemLocales(fields)) ?? primaryLocale(fields, values, uiLang);\n}\n\n/** The language's own name in the admin's language (`en` → \"English\" / \"אנגלית\"). */\nexport const languageName = (locale: string, uiLang: string): string => displayName(locale, uiLang) ?? locale;\n","/**\n * @vectoriox/iox-ui/assist-core — the shared, FRAMEWORK-FREE vocabulary of AI Assist (iox-ai-guidance\n * `architecture/ai/ai-assist-plan.md` §3b): the surfaces and their specs, the brief and its handle map, the route\n * request, and family `fields` for surface S2 (one content item) — its brief (`summarizeItem`), its strict output format\n * (`fieldsJsonSchema`) and the ONE check that applies an answer (`applyFieldEdits`), run by iox-cms on a copy and by\n * cms-client as the trial. Pure: no transport, no clock, no randomness.\n * ⚠️ Not re-exported from the main entry. Consumers wire the usual trio — ng-package raw-ts assets, jest\n * moduleNameMapper, tsconfig paths — or `nest start` dies with ERR_REQUIRE_ESM. It imports generation-core (the strict\n * schema builders and budget), so a consumer maps both.\n * TODO(after the 2026-11-19 demo): extract the fact gate `factIssues` out of generation-core's `planWordIssues` into\n * this entry (plan §3b, R-H2) — `planWordIssues` becomes its caller; deferred because it edits generation-core.\n */\nexport * from './surfaces';\nexport * from './budget';\nexport * from './brief';\nexport * from './content-fields';\nexport * from './rich-text';\nexport * from './field-values';\nexport * from './summarize-item';\nexport * from './fields-schema';\nexport * from './route-schema';\nexport * from './field-edits';\nexport * from './assist-turn';\nexport * from './assist-locale';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["LIST_KINDS"],"mappings":";;AAEA;;;;AAIG;IAES;AAAZ,CAAA,UAAY,aAAa,EAAA;AACrB,IAAA,aAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,aAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,aAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,aAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,aAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,aAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,aAAA,CAAA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CAAC,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACtE,IAAA,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,IAAI;AACjC,IAAA,OAAO,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;AACzD;AAEA;AACM,SAAU,UAAU,CAAC,QAAgB,EAAE,MAAkC,EAAE,MAAqB,EAAE,MAAc,EAAA;AAClH,IAAA,OAAO,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;AAC9F;AAEA;AACO,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,MAAc,KAAa,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI;;ACxEvG;;;;;;;;;;;AAWG;;ACXH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"vectoriox-iox-ui-assist-core.mjs","sources":["../../../projects/iox-ui/src/assist-core/surfaces.ts","../../../projects/iox-ui/src/assist-core/budget.ts","../../../projects/iox-ui/src/assist-core/brief.ts","../../../projects/iox-ui/src/assist-core/content-fields.ts","../../../projects/iox-ui/src/assist-core/rich-text.ts","../../../projects/iox-ui/src/assist-core/field-values.ts","../../../projects/iox-ui/src/assist-core/summarize-item.ts","../../../projects/iox-ui/src/assist-core/fields-schema.ts","../../../projects/iox-ui/src/assist-core/route-schema.ts","../../../projects/iox-ui/src/assist-core/assist-facts.ts","../../../projects/iox-ui/src/assist-core/field-edits.ts","../../../projects/iox-ui/src/assist-core/assist-locale.ts","../../../projects/iox-ui/src/assist-core/page-words.ts","../../../projects/iox-ui/src/assist-core/assist-turn.ts","../../../projects/iox-ui/src/assist-core/public-api.ts","../../../projects/iox-ui/src/assist-core/vectoriox-iox-ui-assist-core.ts"],"sourcesContent":["import { AiStep } from '@vectoriox/iox-ui/generation-core';\n\n/**\n * The surfaces AI Assist runs on (ai-assist-plan §2, §4): each screen that offers a prompt registers ONE spec — what it\n * may change (families), how an accepted change is committed, which model steps a turn uses, the role actions the\n * server re-checks, whether it reads photos and the focus ladder its chip widens along.\n */\n\nexport enum AssistSurface {\n BuilderPage = 'builderPage',\n ContentItem = 'contentItem',\n ContentFromPhotos = 'contentFromPhotos',\n ContentList = 'contentList',\n SchemaType = 'schemaType',\n ShopProduct = 'shopProduct',\n Media = 'media',\n BuilderSite = 'builderSite',\n FormInbox = 'formInbox',\n}\n\n/** How an accepted turn reaches the studio (plan §3e). */\nexport enum CommitKind {\n /** One builder history step. */\n BuilderStep = 'builderStep',\n /** Written into the screen's form; Save stays the owner's. */\n FormFill = 'formFill',\n /** A server run that writes drafts, with its own Undo. */\n Run = 'run',\n /** Nothing is written: filters, a copied reply. */\n View = 'view',\n}\n\n/** The closed edit families a sentence may be answered in — one strict request each. */\nexport enum EditFamily {\n Words = 'words',\n Sections = 'sections',\n Style = 'style',\n Look = 'look',\n Fields = 'fields',\n Items = 'items',\n View = 'view',\n Schema = 'schema',\n Media = 'media',\n Plan = 'plan',\n}\n\n/** The model steps of a turn — generation-core's `AiStep` rows (Settings ▸ AI ▸ Models), never a second spelling. */\nexport const AssistStep = {\n AssistRoute: AiStep.AssistRoute,\n AssistEdit: AiStep.AssistEdit,\n AssistRead: AiStep.AssistRead,\n} as const;\nexport type AssistStep = typeof AssistStep[keyof typeof AssistStep];\n\n/** One rung of a surface's focus ladder — the chip's ✕ widens to the next rung. */\nexport enum AssistScope {\n Field = 'field',\n Item = 'item',\n Type = 'type',\n Types = 'types',\n Node = 'node',\n Section = 'section',\n Page = 'page',\n Site = 'site',\n Photo = 'photo',\n Photos = 'photos',\n Rows = 'rows',\n Slot = 'slot',\n Library = 'library',\n Submission = 'submission',\n}\n\n/** iox-cms role actions (`roles/enums.ts` `Permissions`) a surface needs — the server re-checks them, never only the client. */\nexport enum AssistPermission {\n SchemaAll = 'schema_all',\n ContentRead = 'content_read',\n ContentCreate = 'content_create',\n ContentUpdate = 'content_update',\n PageRead = 'page_read',\n PageCreate = 'page_create',\n PageUpdate = 'page_update',\n PageDelete = 'page_delete',\n StorageAll = 'storage_all',\n ProductsAll = 'products_all',\n}\n\nexport enum SurfaceStatus {\n Built = 'built',\n Planned = 'planned',\n}\n\nexport interface SurfaceSpec {\n readonly surface: AssistSurface;\n readonly families: ReadonlyArray<EditFamily>;\n readonly commit: CommitKind;\n /** A family committed differently from the surface (the list's items are a Run; its filters a View). */\n readonly familyCommits?: Readonly<Partial<Record<EditFamily, CommitKind>>>;\n /** Model steps a turn may use. Media (S7) uses the picture steps of generation-core, none of these. */\n readonly steps: ReadonlyArray<AssistStep>;\n /** Every one is required. `content_<action>` is specialised per content type when `perContentType`. */\n readonly permissions: ReadonlyArray<AssistPermission>;\n /** A family that needs more than the surface does. */\n readonly familyPermissions?: Readonly<Partial<Record<EditFamily, ReadonlyArray<AssistPermission>>>>;\n /** The content permissions name a type (`content_<type>_<action>`), as the iox-cms guard specialises them. */\n readonly perContentType: boolean;\n readonly readsPhotos: boolean;\n /** The focus ladder, narrowest first. */\n readonly scopes: ReadonlyArray<AssistScope>;\n readonly status: SurfaceStatus;\n}\n\nconst spec = (s: Omit<SurfaceSpec, 'perContentType' | 'readsPhotos'> & Partial<Pick<SurfaceSpec, 'perContentType' | 'readsPhotos'>>): SurfaceSpec => ({\n perContentType: false,\n readsPhotos: false,\n ...s,\n});\n\nexport const SURFACES: Readonly<Record<AssistSurface, SurfaceSpec>> = {\n // S1 offers only the families the server answers (the route can never pick one it cannot): Words first (AI2a);\n // Style, Sections and Look & motion join as each slice ships (ai-assist-plan §6, AI2).\n [AssistSurface.BuilderPage]: spec({\n surface: AssistSurface.BuilderPage,\n families: [EditFamily.Words],\n commit: CommitKind.BuilderStep,\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.PageUpdate],\n scopes: [AssistScope.Node, AssistScope.Section, AssistScope.Page],\n status: SurfaceStatus.Built,\n }),\n [AssistSurface.ContentItem]: spec({\n surface: AssistSurface.ContentItem,\n families: [EditFamily.Fields],\n commit: CommitKind.FormFill,\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.ContentUpdate],\n perContentType: true,\n scopes: [AssistScope.Field, AssistScope.Item, AssistScope.Type],\n status: SurfaceStatus.Built,\n }),\n [AssistSurface.ContentFromPhotos]: spec({\n surface: AssistSurface.ContentFromPhotos,\n families: [EditFamily.Fields, EditFamily.Media],\n commit: CommitKind.Run,\n steps: [AssistStep.AssistRoute, AssistStep.AssistRead, AssistStep.AssistEdit],\n permissions: [AssistPermission.ContentCreate, AssistPermission.StorageAll],\n perContentType: true,\n readsPhotos: true,\n scopes: [AssistScope.Photo, AssistScope.Photos, AssistScope.Type],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.ContentList]: spec({\n surface: AssistSurface.ContentList,\n families: [EditFamily.View, EditFamily.Items],\n commit: CommitKind.View,\n familyCommits: { [EditFamily.Items]: CommitKind.Run },\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.ContentRead],\n familyPermissions: { [EditFamily.Items]: [AssistPermission.ContentCreate, AssistPermission.ContentUpdate] },\n perContentType: true,\n scopes: [AssistScope.Rows, AssistScope.Type],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.SchemaType]: spec({\n surface: AssistSurface.SchemaType,\n families: [EditFamily.Schema],\n commit: CommitKind.FormFill,\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.SchemaAll],\n scopes: [AssistScope.Field, AssistScope.Type, AssistScope.Types],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.ShopProduct]: spec({\n surface: AssistSurface.ShopProduct,\n families: [EditFamily.Fields],\n commit: CommitKind.FormFill,\n steps: [AssistStep.AssistRoute, AssistStep.AssistRead, AssistStep.AssistEdit],\n permissions: [AssistPermission.ProductsAll],\n readsPhotos: true,\n scopes: [AssistScope.Field, AssistScope.Item],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.Media]: spec({\n surface: AssistSurface.Media,\n families: [EditFamily.Media],\n commit: CommitKind.Run,\n steps: [],\n permissions: [AssistPermission.StorageAll],\n readsPhotos: true,\n scopes: [AssistScope.Slot, AssistScope.Library],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.BuilderSite]: spec({\n surface: AssistSurface.BuilderSite,\n families: [EditFamily.Plan, EditFamily.Sections],\n commit: CommitKind.Run,\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.PageCreate, AssistPermission.PageUpdate, AssistPermission.PageDelete],\n familyPermissions: { [EditFamily.Plan]: [AssistPermission.SchemaAll] },\n scopes: [AssistScope.Page, AssistScope.Site],\n status: SurfaceStatus.Planned,\n }),\n [AssistSurface.FormInbox]: spec({\n surface: AssistSurface.FormInbox,\n families: [EditFamily.Words],\n commit: CommitKind.View,\n steps: [AssistStep.AssistRoute, AssistStep.AssistEdit],\n permissions: [AssistPermission.PageRead],\n scopes: [AssistScope.Submission],\n status: SurfaceStatus.Planned,\n }),\n};\n\nexport const surfaceSpec = (surface: AssistSurface): SurfaceSpec => SURFACES[surface];\n\nexport const builtSurfaces = (): AssistSurface[] =>\n Object.values(SURFACES).filter(s => s.status === SurfaceStatus.Built).map(s => s.surface);\n\nexport const commitOf = (surface: AssistSurface, family: EditFamily): CommitKind =>\n SURFACES[surface].familyCommits?.[family] ?? SURFACES[surface].commit;\n\nconst CONTENT_PERMISSION_PREFIX = 'content_';\nconst ALL_SUFFIX = '_all';\n\n/**\n * The permission strings the server checks for a turn on this surface (and these families): `content_<action>` becomes\n * `content_<type>_<action>` on a per-type surface — the same specialisation iox-cms's AuthorizationGuard applies to a\n * `:resource` route, so a user granted only `content_posts_update` may assist on posts and nowhere else.\n */\nexport function surfacePermissions(surface: AssistSurface, contentType?: string, families: ReadonlyArray<EditFamily> = []): string[] {\n const s = SURFACES[surface];\n const all = [...s.permissions, ...families.flatMap(f => s.familyPermissions?.[f] ?? [])];\n const named = all.map(p => {\n if (!s.perContentType || !contentType || !p.startsWith(CONTENT_PERMISSION_PREFIX) || p.endsWith(ALL_SUFFIX)) return p as string;\n return `${CONTENT_PERMISSION_PREFIX}${contentType}_${p.slice(CONTENT_PERMISSION_PREFIX.length)}`;\n });\n return [...new Set(named)];\n}\n","import { JsonSchema, STRICT_SCHEMA_BUDGET, strictSchemaComplexity } from '@vectoriox/iox-ui/generation-core';\n\n/** The house budget every Assist request is held to (plan F6, trap T7) — generation-core's, never a copy and never raised. */\nexport const MAX_ASSIST_PROPERTIES = STRICT_SCHEMA_BUDGET.properties;\n\n/** The route request is small and fast (plan §3a). */\nexport const MAX_ROUTE_PROPERTIES = 12;\n\n/** Around-layer text is a summary: at most this many characters per value (plan §3c). */\nexport const AROUND_TEXT_CHARS = 160;\n\n/** Sibling items sent as examples of voice (plan §3c: 3–5). */\nexport const AROUND_ITEMS_MAX = 5;\n\n/** The session memory sent with a turn: the last turns, one line each (plan §3c). */\nexport const MEMORY_TURNS = 6;\n\nexport class AssistBudgetError extends Error {}\n\n/** What a request's strict schemas break of the house budget — empty when it fits. */\nexport function assistBudgetIssues(schemas: ReadonlyArray<JsonSchema>, maxProperties: number = MAX_ASSIST_PROPERTIES): string[] {\n const c = strictSchemaComplexity(schemas);\n return [\n ...c.unsupported,\n ...(c.properties > maxProperties ? [`${c.properties} properties (budget ${maxProperties})`] : []),\n ...(c.optional > STRICT_SCHEMA_BUDGET.optional ? [`${c.optional} optional (budget ${STRICT_SCHEMA_BUDGET.optional})`] : []),\n ...(c.unions > STRICT_SCHEMA_BUDGET.unions ? [`${c.unions} unions (budget ${STRICT_SCHEMA_BUDGET.unions})`] : []),\n ];\n}\n\nexport function assertAssistBudget(name: string, schemas: ReadonlyArray<JsonSchema>, maxProperties?: number): void {\n const issues = assistBudgetIssues(schemas, maxProperties);\n if (issues.length) throw new AssistBudgetError(`${name}: ${issues.join('; ')}`);\n}\n","import { AssistScope, AssistSurface, EditFamily } from './surfaces';\n\n/**\n * The brief (plan §3c): what the model is told, built by CODE from what the screen holds, sized by distance from the\n * focus. It names things by HANDLE (`f.summary`, `s2`), never by id (rule 3); the handle map that goes with it is\n * kept by the caller and the server, never sent.\n */\nexport interface Brief<TFocus = unknown, TAround = unknown> {\n readonly surface: AssistSurface;\n /** The thing the sentence is about, in full. */\n readonly focus: TFocus;\n /** Its neighbourhood, summarised. */\n readonly around: TAround;\n /** The business reading (kind, voice, facts, languages) — the caller passes it; null when there is none. */\n readonly owner: string | null;\n readonly rules: BriefRules;\n /** The session's last turns, one line each, oldest first. */\n readonly memory: ReadonlyArray<string>;\n}\n\nexport interface BriefRules {\n /** The families a turn on this focus may answer in. */\n readonly families: ReadonlyArray<EditFamily>;\n /** The locale words are written in (a multiLang field gets this one key). */\n readonly locale: string;\n /** What is never written here, each with why — the model leaves it and says it \"needs you\". */\n readonly never: ReadonlyArray<NeverWrite>;\n /** The focus rung and the rungs it can widen to. */\n readonly scope: AssistScope;\n readonly widensTo: ReadonlyArray<AssistScope>;\n}\n\nexport interface NeverWrite {\n readonly handle: string;\n readonly label: string;\n readonly reason: string;\n}\n\n/** What a handle stands for. `path` is the key path inside the target; `id` a record the handle names (never sent). */\nexport interface HandleTarget {\n readonly key: string;\n readonly path: ReadonlyArray<string>;\n readonly id?: string;\n}\n\nexport type HandleMap = Readonly<Record<string, HandleTarget>>;\n\nexport enum AssistIssueCode {\n UnknownHandle = 'unknownHandle',\n NeverWrite = 'neverWrite',\n WrongType = 'wrongType',\n NotAnOption = 'notAnOption',\n Duplicate = 'duplicate',\n WrongLocale = 'wrongLocale',\n HtmlNotAllowed = 'htmlNotAllowed',\n UnknownFamily = 'unknownFamily',\n BadRequest = 'badRequest',\n UnknownSurface = 'unknownSurface',\n SurfaceNotBuilt = 'surfaceNotBuilt',\n EmptySentence = 'emptySentence',\n SentenceTooLong = 'sentenceTooLong',\n MissingHandles = 'missingHandles',\n MissingValues = 'missingValues',\n /** Looks like an e-mail, phone, price or time nobody gave (generation-core `factIssues`, R-H2). */\n InventedFact = 'inventedFact',\n /** A word this site must not use. */\n AvoidWord = 'avoidWord',\n}\n\nexport interface AssistIssue {\n readonly code: AssistIssueCode;\n readonly handle?: string;\n readonly message: string;\n}\n\n/** A caller's mistake building a brief (a focus that is not on the screen) — never a model answer. */\nexport class AssistBriefError extends Error {\n constructor(readonly code: AssistIssueCode, message: string) {\n super(message);\n }\n}\n\nexport type HandleResolution = { ok: true; target: HandleTarget } | { ok: false; issue: AssistIssue };\n\n/** The one way a handle becomes a key: an unknown handle is refused, never guessed (trap T1). */\nexport function resolveHandle(handles: HandleMap, handle: string): HandleResolution {\n const target = Object.prototype.hasOwnProperty.call(handles, handle) ? handles[handle] : undefined;\n if (target) return { ok: true, target };\n return { ok: false, issue: { code: AssistIssueCode.UnknownHandle, handle, message: `\"${handle}\" is not a handle of this brief` } };\n}\n\n/** Every handle of the list that the brief does not know. */\nexport function unknownHandles(handles: HandleMap, list: ReadonlyArray<string>): AssistIssue[] {\n return list.flatMap(h => {\n const r = resolveHandle(handles, h);\n return 'issue' in r ? [r.issue] : [];\n });\n}\n\nexport const FIELD_HANDLE_PREFIX = 'f.';\nexport const SIBLING_HANDLE_PREFIX = 's';\nexport const fieldHandle = (key: string): string => `${FIELD_HANDLE_PREFIX}${key}`;\n","import { fieldHandle } from './brief';\n\n/**\n * A content type's fields as Assist sees them, read from the REAL stored schema (iox-cms `schemas` row:\n * `{ name, metaData, schemaObject: { properties } }`; each property `{ type, label, controller: { type, options } }` —\n * cms-client `schema-doc/property-def.model.ts`). A multiLang field is `type: 'object'` + `controller.type: 'multiLang'`\n * whose `properties` are its locales (`{ en: {…}, he: {…} }`), each with the inner control.\n *\n * Every field is either WRITABLE (one of the kinds below) or NEVER written, with a reason. Never written:\n * - by what it is: relations, media (ids / URLs), secrets, dates, e-mail, nested structures, a select with no options;\n * - by what it is about — a closed word list over the key and the label (English + Hebrew): money (price, cost, fee,\n * currency, discount, VAT…), stock (quantity, inventory…), product codes (SKU, barcode…), contact facts (phone, e-mail,\n * address, location, hours…), dates and web addresses (slug, URL, link). A field whose controller or type is `money`\n * / `price` / `currency` is money, ready for \"money as a field type\" (AI plan) the day it exists.\n * The model never sees the value of a never-written field, only whether it is filled; the owner fills it (\"needs you\").\n */\n\nexport interface ContentControllerDef {\n readonly type?: string;\n readonly options?: unknown;\n}\n\nexport interface ContentPropertyDef {\n readonly type: string;\n readonly label?: string;\n readonly controller?: ContentControllerDef;\n readonly properties?: Readonly<Record<string, ContentPropertyDef>>;\n readonly items?: ContentPropertyDef;\n readonly required?: boolean;\n readonly rel?: unknown;\n}\n\nexport interface ContentTypeSchema {\n readonly name: string;\n readonly metaData?: { readonly label?: string; readonly previewTextField?: string; readonly previewImageField?: string };\n readonly schemaObject: { readonly properties: Readonly<Record<string, ContentPropertyDef>> };\n}\n\nexport enum AssistFieldKind {\n Text = 'text',\n Textarea = 'textarea',\n /** Written as plain paragraphs, never HTML (trap T6). */\n RichText = 'richText',\n Number = 'number',\n Boolean = 'boolean',\n /** One of the field's options. */\n Choice = 'choice',\n /** Some of the field's options. */\n Choices = 'choices',\n /** A list of words. */\n Tags = 'tags',\n /** Not writable — `never` says why. */\n Other = 'other',\n}\n\nexport enum NeverWriteReason {\n Money = 'money',\n Stock = 'stock',\n ProductCode = 'productCode',\n Contact = 'contact',\n Date = 'date',\n WebAddress = 'webAddress',\n Relation = 'relation',\n Media = 'media',\n Secret = 'secret',\n Structure = 'structure',\n}\n\nexport interface AssistField {\n readonly key: string;\n readonly handle: string;\n readonly label: string;\n readonly kind: AssistFieldKind;\n readonly required: boolean;\n /** Choice / Choices: the option values the field accepts. */\n readonly options?: ReadonlyArray<string>;\n /** multiLang: the locales the field holds, in schema order. */\n readonly locales?: ReadonlyArray<string>;\n readonly never?: NeverWriteReason;\n}\n\n/** iox-cms `RESERVED_SCHEMA_PROPERTIES` + read-time bookkeeping + shop catalog bookkeeping — never a field. */\nconst NOT_FIELDS: ReadonlySet<string> = new Set([\n 'isPublished', 'organization', 'info', 'addedBy', 'created', 'lastUpdate', '_id', 'isSample', 'pricingUnit',\n]);\n\nenum Control {\n Text = 'text',\n Tag = 'tag',\n Textarea = 'textarea',\n RichText = 'richText',\n Number = 'number',\n Range = 'range',\n Switch = 'switch',\n Checkbox = 'checkbox',\n Select = 'select',\n MultiSelect = 'multiSelect',\n CheckboxGroup = 'checkboxGroup',\n Tags = 'tags',\n List = 'list',\n MultiLang = 'multiLang',\n Email = 'email',\n Password = 'password',\n Encrypt = 'encrypt',\n Date = 'date',\n Time = 'time',\n Image = 'image',\n Media = 'media',\n Gallery = 'gallery',\n RelationCombobox = 'relationCombobox',\n Money = 'money',\n Price = 'price',\n Currency = 'currency',\n}\n\nenum DataType {\n String = 'string',\n Array = 'array',\n Object = 'object',\n Rel = 'rel',\n Encrypt = 'encrypt',\n Date = 'date',\n Money = 'money',\n}\n\nconst KIND_OF_CONTROL: Readonly<Partial<Record<string, AssistFieldKind>>> = {\n [Control.Text]: AssistFieldKind.Text,\n [Control.Tag]: AssistFieldKind.Text,\n [Control.Textarea]: AssistFieldKind.Textarea,\n [Control.RichText]: AssistFieldKind.RichText,\n [Control.Number]: AssistFieldKind.Number,\n [Control.Range]: AssistFieldKind.Number,\n [Control.Switch]: AssistFieldKind.Boolean,\n [Control.Checkbox]: AssistFieldKind.Boolean,\n [Control.Select]: AssistFieldKind.Choice,\n [Control.MultiSelect]: AssistFieldKind.Choices,\n [Control.CheckboxGroup]: AssistFieldKind.Choices,\n [Control.Tags]: AssistFieldKind.Tags,\n [Control.List]: AssistFieldKind.Tags,\n};\n\nconst LIST_KINDS: ReadonlySet<AssistFieldKind> = new Set([AssistFieldKind.Choices, AssistFieldKind.Tags]);\nconst CHOICE_KINDS: ReadonlySet<AssistFieldKind> = new Set([AssistFieldKind.Choice, AssistFieldKind.Choices]);\n\nconst NEVER_OF_CONTROL: Readonly<Partial<Record<string, NeverWriteReason>>> = {\n [Control.Email]: NeverWriteReason.Contact,\n [Control.Password]: NeverWriteReason.Secret,\n [Control.Encrypt]: NeverWriteReason.Secret,\n [Control.Date]: NeverWriteReason.Date,\n [Control.Time]: NeverWriteReason.Date,\n [Control.Image]: NeverWriteReason.Media,\n [Control.Media]: NeverWriteReason.Media,\n [Control.Gallery]: NeverWriteReason.Media,\n [Control.RelationCombobox]: NeverWriteReason.Relation,\n [Control.Money]: NeverWriteReason.Money,\n [Control.Price]: NeverWriteReason.Money,\n [Control.Currency]: NeverWriteReason.Money,\n};\n\nconst NEVER_OF_TYPE: Readonly<Partial<Record<string, NeverWriteReason>>> = {\n [DataType.Rel]: NeverWriteReason.Relation,\n [DataType.Encrypt]: NeverWriteReason.Secret,\n [DataType.Date]: NeverWriteReason.Date,\n [DataType.Money]: NeverWriteReason.Money,\n};\n\n/** The closed word list: a key or label word that makes a field a fact the owner gives. */\nconst NEVER_WORDS: ReadonlyArray<readonly [NeverWriteReason, ReadonlyArray<string>, ReadonlyArray<string>]> = [\n [NeverWriteReason.Money,\n ['price', 'prices', 'pricing', 'cost', 'costs', 'amount', 'fee', 'fees', 'currency', 'discount', 'compareat', 'vat', 'tax', 'total', 'salary', 'budget', 'payment'],\n ['מחיר', 'עלות', 'תשלום', 'מע\"מ', 'הנחה']],\n [NeverWriteReason.Stock, ['stock', 'quantity', 'qty', 'inventory'], ['מלאי', 'כמות']],\n [NeverWriteReason.ProductCode, ['sku', 'barcode', 'ean', 'upc', 'gtin', 'isbn', 'mpn'], ['מק\"ט', 'ברקוד']],\n [NeverWriteReason.Contact,\n ['phone', 'tel', 'telephone', 'mobile', 'whatsapp', 'email', 'mail', 'fax', 'address', 'street', 'city', 'zip', 'postcode', 'location', 'hours'],\n ['טלפון', 'נייד', 'וואטסאפ', 'דוא\"ל', 'אימייל', 'מייל', 'כתובת', 'שעות', 'פקס', 'מיקום']],\n [NeverWriteReason.Date, ['date', 'dates', 'time', 'datetime', 'deadline'], ['תאריך']],\n [NeverWriteReason.WebAddress, ['slug', 'url', 'uri', 'href', 'link', 'website', 'route', 'permalink'], ['קישור', 'לינק']],\n];\n\n/** `startDate` → start, date · `ticket_link` → ticket, link · `Price (₪)` → price. */\nfunction words(text: string): string[] {\n return text.replace(/([a-z0-9])([A-Z])/g, '$1 $2').toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);\n}\n\nfunction neverByWords(key: string, label: string): NeverWriteReason | undefined {\n const english = new Set([...words(key), ...words(label)]);\n const raw = `${key} ${label}`;\n return NEVER_WORDS.find(([, en, he]) => en.some(w => english.has(w)) || he.some(w => raw.includes(w)))?.[0];\n}\n\nfunction optionValues(options: unknown): string[] | undefined {\n if (!Array.isArray(options)) return undefined;\n const values = options.map(o => (o && typeof o === 'object' ? (o as { value?: unknown }).value : o))\n .filter(v => v !== undefined && v !== null && v !== '')\n .map(String);\n return values.length ? [...new Set(values)] : undefined;\n}\n\ninterface Shape {\n kind: AssistFieldKind;\n options?: string[];\n never?: NeverWriteReason;\n}\n\nconst other = (never: NeverWriteReason): Shape => ({ kind: AssistFieldKind.Other, never });\n\n/** What one leaf property is, by its type and control alone. */\nfunction leafShape(def: ContentPropertyDef): Shape {\n const control = def.controller?.type ?? '';\n const never = NEVER_OF_TYPE[def.type] ?? NEVER_OF_CONTROL[control] ?? (def.items ? NEVER_OF_CONTROL[def.items.controller?.type ?? ''] : undefined);\n if (never) return other(never);\n const kind = KIND_OF_CONTROL[control];\n const isList = def.type === DataType.Array;\n if (!kind || isList !== LIST_KINDS.has(kind)) return other(NeverWriteReason.Structure);\n if (isList && def.items && def.items.type !== DataType.String) return other(NeverWriteReason.Structure);\n if (!CHOICE_KINDS.has(kind)) return { kind };\n const options = optionValues(def.controller?.options);\n return options ? { kind, options } : other(NeverWriteReason.Structure);\n}\n\nconst isMultiLang = (def: ContentPropertyDef) => def.controller?.type === Control.MultiLang && !!def.properties;\n\nfunction fieldOf(key: string, def: ContentPropertyDef): AssistField {\n const label = def.label || key;\n const base = { key, handle: fieldHandle(key), label, required: !!def.required };\n if (isMultiLang(def)) {\n const locales = Object.keys(def.properties ?? {});\n const inner = locales.length ? leafShape(def.properties![locales[0]]) : other(NeverWriteReason.Structure);\n const never = inner.never ?? neverByWords(key, label);\n return never ? { ...base, kind: AssistFieldKind.Other, locales, never } : { ...base, ...inner, locales };\n }\n if (def.type === DataType.Object) return { ...base, ...other(NeverWriteReason.Structure) };\n const shape = leafShape(def);\n const never = shape.never ?? neverByWords(key, label);\n return never ? { ...base, kind: AssistFieldKind.Other, never } : { ...base, ...shape };\n}\n\n/** A property the item form renders: not bookkeeping, and (a leaf) carrying a control. */\nconst isFormField = (key: string, def: ContentPropertyDef) =>\n !NOT_FIELDS.has(key) && !!def && (def.type === DataType.Object || !!def.controller);\n\n/** Every form field of the type, in schema order, writable or with the reason it is never written. */\nexport function assistFields(schema: ContentTypeSchema): AssistField[] {\n return Object.entries(schema.schemaObject?.properties ?? {})\n .filter(([key, def]) => isFormField(key, def))\n .map(([key, def]) => fieldOf(key, def));\n}\n\nexport const isWritable = (field: AssistField): boolean => !field.never;\n\n/** The type's title field: its `@title` role (`metaData.previewTextField`), else its first text field. */\nexport function titleField(schema: ContentTypeSchema, fields: ReadonlyArray<AssistField> = assistFields(schema)): AssistField | undefined {\n const role = schema.metaData?.previewTextField;\n return fields.find(f => f.key === role) ?? fields.find(f => f.kind === AssistFieldKind.Text);\n}\n","/**\n * Rich text crosses the model boundary as PLAIN PARAGRAPHS in both directions (trap T6): the brief reads the stored\n * value (the item editor's Quill writes HTML) as paragraphs, and an answer's paragraphs become HTML only here, every\n * character escaped — the model never writes markup that reaches a page.\n */\n\nconst BLOCK_END = /<\\/(p|div|h[1-6]|li|blockquote|pre)>|<br\\s*\\/?>/gi;\nconst TAG = /<[^>]*>/g;\nconst HTML_TAG = /<\\/?[a-z][a-z0-9-]*(\\s[^<>]*)?\\/?>/i;\n\nconst ENTITIES: Readonly<Record<string, string>> = { '&': '&', '<': '<', '>': '>', '"': '\"', ''': \"'\", ' ': ' ' };\nconst ESCAPES: Readonly<Record<string, string>> = { '&': '&', '<': '<', '>': '>', '\"': '"', \"'\": ''' };\n\nconst decode = (text: string) => text.replace(/&(amp|lt|gt|quot|#39|nbsp);/g, e => ENTITIES[e] ?? e);\nconst escape = (text: string) => text.replace(/[&<>\"']/g, c => ESCAPES[c]);\n\n/** A stored rich-text value (HTML, or plain text) as its non-empty paragraphs. */\nexport function richTextParagraphs(value: unknown): string[] {\n if (typeof value !== 'string') return [];\n return decode(value.replace(BLOCK_END, '\\n').replace(TAG, ''))\n .split(/\\n+/)\n .map(p => p.replace(/\\s+/g, ' ').trim())\n .filter(Boolean);\n}\n\n/** One line of plain text as stored HTML: every character escaped (a heading's or a button's words). */\nexport const escapeText = (text: string): string => escape(text);\n\n/** Paragraphs as the editor's HTML: one `<p>` each, escaped. */\nexport function paragraphsToRichText(paragraphs: ReadonlyArray<string>): string {\n return paragraphs.map(p => `<p>${escape(p.trim())}</p>`).join('');\n}\n\n/** True when a text written by the model carries markup — refused, never stripped. */\nexport const containsHtml = (text: string): boolean => HTML_TAG.test(text);\n","import { AssistFieldKind } from './content-fields';\nimport { richTextParagraphs } from './rich-text';\n\n/** A field's value as the model reads it: text, paragraphs, a number, yes/no, options, words, or per locale. */\nexport type BriefValue = string | number | boolean | ReadonlyArray<string> | Readonly<Record<string, string | ReadonlyArray<string>>> | null;\n\nconst LIST_KINDS: ReadonlySet<AssistFieldKind> = new Set([AssistFieldKind.Choices, AssistFieldKind.Tags]);\n\nexport const isPlainRecord = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object' && !Array.isArray(v);\nconst asStrings = (v: unknown): string[] => (Array.isArray(v) ? v.filter(x => x !== null && x !== undefined && x !== '').map(String) : []);\n\nfunction readNumber(raw: unknown): number | null {\n if (typeof raw === 'number') return Number.isFinite(raw) ? raw : null;\n if (typeof raw !== 'string' || raw.trim() === '') return null;\n const n = Number(raw);\n return Number.isFinite(n) ? n : null;\n}\n\n/** One stored value (a plain field, or one locale of a multiLang field) in its kind's readable form. */\nexport function readFieldValue(kind: AssistFieldKind, raw: unknown): BriefValue {\n if (raw === undefined || raw === null) return null;\n if (kind === AssistFieldKind.RichText) return richTextParagraphs(raw);\n if (LIST_KINDS.has(kind)) return asStrings(raw);\n if (kind === AssistFieldKind.Number) return readNumber(raw);\n if (kind === AssistFieldKind.Boolean) return !!raw;\n return typeof raw === 'string' ? raw : String(raw);\n}\n\nexport function isEmptyFieldValue(v: unknown): boolean {\n if (v === null || v === undefined) return true;\n if (typeof v === 'string') return v.trim() === '';\n if (Array.isArray(v)) return v.length === 0;\n if (isPlainRecord(v)) return Object.values(v).every(isEmptyFieldValue);\n return false;\n}\n\n/** A multiLang value's locales, each read in the field's kind. */\nexport function readLocaleValues(kind: AssistFieldKind, locales: ReadonlyArray<string>, raw: unknown): Record<string, BriefValue> {\n const values = isPlainRecord(raw) ? raw : {};\n return Object.fromEntries(locales.map(l => [l, readFieldValue(kind, values[l])]));\n}\n\n","import { AROUND_ITEMS_MAX, AROUND_TEXT_CHARS, MEMORY_TURNS } from './budget';\nimport { AssistBriefError, AssistIssueCode, Brief, FIELD_HANDLE_PREFIX, HandleMap, HandleTarget, NeverWrite, SIBLING_HANDLE_PREFIX } from './brief';\nimport { AssistField, AssistFieldKind, assistFields, ContentTypeSchema, isWritable, NeverWriteReason, titleField } from './content-fields';\nimport { BriefValue, isEmptyFieldValue, readFieldValue, readLocaleValues } from './field-values';\nimport { AssistScope, AssistSurface, SURFACES } from './surfaces';\n\n/**\n * The brief of surface S2 — one content item (plan §3c, §4 S2). Focus = the item (every field as a handle `f.<key>`,\n * its kind, label, full value, which locales a multiLang field has filled) or ONE field when the owner opened the\n * field's sparkle; around = the rest of the item (when the focus is a field) and up to five sibling items of the type,\n * each value clipped to 160 characters — examples of the studio's voice, never something to copy.\n */\n\nexport type ContentRecord = Readonly<Record<string, unknown>>;\n\nexport interface ItemBriefField {\n readonly handle: string;\n readonly label: string;\n readonly kind: AssistFieldKind;\n readonly required: boolean;\n /** In the write locale for a multiLang field. */\n readonly empty: boolean;\n /** Absent on a never-written field: the model only learns whether it is filled. */\n readonly value?: BriefValue;\n readonly options?: ReadonlyArray<string>;\n readonly locales?: { readonly filled: ReadonlyArray<string>; readonly empty: ReadonlyArray<string> };\n readonly never?: NeverWriteReason;\n}\n\nexport interface ItemFocus {\n readonly scope: AssistScope;\n readonly type: { readonly name: string; readonly label: string };\n /** The item's name as the list shows it ('' for a new item). */\n readonly title: string;\n /** The `@title` field's handle, when the type has one. */\n readonly titleHandle: string | null;\n readonly fields: ReadonlyArray<ItemBriefField>;\n}\n\nexport interface ItemSummary {\n readonly handle: string;\n readonly title: string;\n /** handle → value, ≤ 160 characters. */\n readonly fields: Readonly<Record<string, string>>;\n}\n\nexport interface ItemAround {\n /** The item's other fields, summarised — only when the focus is one field. */\n readonly item: Readonly<Record<string, string>> | null;\n readonly siblings: ReadonlyArray<ItemSummary>;\n}\n\nexport type ItemBrief = Brief<ItemFocus, ItemAround>;\n\nexport interface ItemBriefContext {\n /** The locale the turn writes in. */\n readonly locale: string;\n /** One field's key or handle: the per-field sparkle. */\n readonly focusField?: string;\n /** Other items of the type (the item itself is skipped); the first five are sent. */\n readonly siblings?: ReadonlyArray<ContentRecord>;\n readonly owner?: string | null;\n readonly memory?: ReadonlyArray<string>;\n}\n\nexport interface SummarizedItem {\n readonly brief: ItemBrief;\n readonly handles: HandleMap;\n}\n\nconst ID_KEY = '_id';\nconst ELLIPSIS = '…';\nconst LIST_JOIN = ', ';\nconst PARAGRAPH_JOIN = '\\n\\n';\n\nconst TEXT_KINDS: ReadonlySet<AssistFieldKind> = new Set([AssistFieldKind.Text, AssistFieldKind.Textarea, AssistFieldKind.RichText]);\n\nexport const clipText = (text: string, max: number = AROUND_TEXT_CHARS): string =>\n text.length <= max ? text : `${text.slice(0, max - ELLIPSIS.length).trimEnd()}${ELLIPSIS}`;\n\nfunction briefField(field: AssistField, raw: unknown, locale: string): ItemBriefField {\n const base = { handle: field.handle, label: field.label, kind: field.kind, required: field.required };\n if (field.never) return { ...base, empty: isEmptyFieldValue(raw), never: field.never };\n const options = field.options ? { options: field.options } : {};\n if (field.locales) {\n const values = readLocaleValues(field.kind, field.locales, raw);\n const filled = field.locales.filter(l => !isEmptyFieldValue(values[l]));\n return {\n ...base, ...options,\n empty: isEmptyFieldValue(values[locale]),\n value: values as Record<string, string | ReadonlyArray<string>>,\n locales: { filled, empty: field.locales.filter(l => !filled.includes(l)) },\n };\n }\n const value = readFieldValue(field.kind, raw);\n return { ...base, ...options, empty: isEmptyFieldValue(value), value };\n}\n\nconst localeOrFirst = (values: Record<string, BriefValue>, locale: string): BriefValue =>\n !isEmptyFieldValue(values[locale]) ? values[locale] : Object.values(values).find(v => !isEmptyFieldValue(v)) ?? null;\n\n/** A value as one clipped line: the write locale first (else the first filled one), paragraphs and lists joined. */\nfunction summaryText(field: AssistField, raw: unknown, locale: string): string {\n const value = field.locales ? localeOrFirst(readLocaleValues(field.kind, field.locales, raw), locale) : readFieldValue(field.kind, raw);\n if (value === null) return '';\n const text = Array.isArray(value) ? value.join(field.kind === AssistFieldKind.RichText ? PARAGRAPH_JOIN : LIST_JOIN) : String(value);\n return clipText(text.replace(/\\s+/g, ' ').trim());\n}\n\nfunction summaries(fields: ReadonlyArray<AssistField>, record: ContentRecord, locale: string): Record<string, string> {\n return Object.fromEntries(fields\n .map(f => [f.handle, summaryText(f, record[f.key], locale)] as const)\n .filter(([, text]) => text !== ''));\n}\n\nfunction findFocusField(fields: ReadonlyArray<AssistField>, focus: string): AssistField {\n const found = fields.find(f => f.key === focus || f.handle === focus || f.handle === `${FIELD_HANDLE_PREFIX}${focus}`);\n if (!found) throw new AssistBriefError(AssistIssueCode.UnknownHandle, `\"${focus}\" is not a field of this type`);\n return found;\n}\n\nconst neverList = (fields: ReadonlyArray<AssistField>): NeverWrite[] =>\n fields.filter(f => f.never).map(f => ({ handle: f.handle, label: f.label, reason: f.never as string }));\n\nfunction siblingsOf(record: ContentRecord, siblings: ReadonlyArray<ContentRecord>): ContentRecord[] {\n const own = record[ID_KEY];\n return siblings.filter(s => own === undefined || s[ID_KEY] !== own).slice(0, AROUND_ITEMS_MAX);\n}\n\n/** S2's brief and its handle map: `f.<key>` per field, `s<n>` per sibling (its id stays in the map, never sent). */\nexport function summarizeItem(schema: ContentTypeSchema, item: ContentRecord, ctx: ItemBriefContext): SummarizedItem {\n const fields = assistFields(schema);\n const focused = ctx.focusField ? findFocusField(fields, ctx.focusField) : null;\n const title = titleField(schema, fields);\n const voiceFields = fields.filter(f => isWritable(f) && TEXT_KINDS.has(f.kind));\n const siblings = siblingsOf(item, ctx.siblings ?? []);\n const siblingHandle = (i: number) => `${SIBLING_HANDLE_PREFIX}${i + 1}`;\n const surface = SURFACES[AssistSurface.ContentItem];\n const scope = focused ? AssistScope.Field : AssistScope.Item;\n\n const handles: Record<string, HandleTarget> = Object.fromEntries([\n ...fields.map(f => [f.handle, { key: f.key, path: [f.key] }] as const),\n ...siblings.map((s, i) => [siblingHandle(i), { key: siblingHandle(i), path: [], ...(s[ID_KEY] !== undefined ? { id: String(s[ID_KEY]) } : {}) }] as const),\n ]);\n\n const brief: ItemBrief = {\n surface: AssistSurface.ContentItem,\n focus: {\n scope,\n type: { name: schema.name, label: schema.metaData?.label || schema.name },\n title: title ? summaryText(title, item[title.key], ctx.locale) : '',\n titleHandle: title?.handle ?? null,\n fields: (focused ? [focused] : fields).map(f => briefField(f, item[f.key], ctx.locale)),\n },\n around: {\n item: focused ? summaries(fields.filter(f => f !== focused && isWritable(f)), item, ctx.locale) : null,\n siblings: siblings.map((s, i) => ({\n handle: siblingHandle(i),\n title: title ? summaryText(title, s[title.key], ctx.locale) : '',\n fields: summaries(voiceFields, s, ctx.locale),\n })),\n },\n owner: ctx.owner ?? null,\n rules: {\n families: surface.families,\n locale: ctx.locale,\n never: neverList(fields),\n scope,\n widensTo: surface.scopes.slice(surface.scopes.indexOf(scope) + 1),\n },\n memory: (ctx.memory ?? []).slice(-MEMORY_TURNS),\n };\n return { brief, handles };\n}\n\nexport enum ItemSuggestionKind {\n FillEmpty = 'fillEmpty',\n Translate = 'translate',\n Shorten = 'shorten',\n WriteSeo = 'writeSeo',\n}\n\n/** A quick action the box offers, built from the brief (never canned text — the client words it). */\nexport interface ItemSuggestion {\n readonly kind: ItemSuggestionKind;\n readonly handles: ReadonlyArray<string>;\n /** Translate: the locale to fill. */\n readonly locale?: string;\n}\n\n/** A text this long is worth a \"Shorten\". */\nexport const SHORTEN_FROM_CHARS = 280;\nconst SEO_WORDS: ReadonlyArray<string> = ['seo', 'meta'];\n\nconst textLength = (v: BriefValue | undefined): number =>\n typeof v === 'string' ? v.length : Array.isArray(v) ? v.join(' ').length : 0;\n\nfunction translations(writable: ReadonlyArray<ItemBriefField>): ItemSuggestion[] {\n const byLocale = new Map<string, string[]>();\n for (const f of writable) {\n if (!f.locales || !f.locales.filled.length) continue;\n for (const l of f.locales.empty) byLocale.set(l, [...(byLocale.get(l) ?? []), f.handle]);\n }\n return [...byLocale].map(([locale, handles]) => ({ kind: ItemSuggestionKind.Translate, locale, handles }));\n}\n\n/** S2's quick actions: Fill empty fields, Translate to <locale>, Shorten, Write SEO — each only when it applies. */\nexport function itemSuggestions(brief: ItemBrief): ItemSuggestion[] {\n const writable = brief.focus.fields.filter(f => !f.never);\n const empty = writable.filter(f => f.empty).map(f => f.handle);\n const long = writable.filter(f => TEXT_KINDS.has(f.kind) && !f.locales && textLength(f.value) >= SHORTEN_FROM_CHARS).map(f => f.handle);\n const seo = writable.filter(f => SEO_WORDS.some(w => f.handle.slice(FIELD_HANDLE_PREFIX.length).toLowerCase().startsWith(w))).map(f => f.handle);\n return [\n ...(empty.length ? [{ kind: ItemSuggestionKind.FillEmpty, handles: empty }] : []),\n ...translations(writable),\n ...(long.length ? [{ kind: ItemSuggestionKind.Shorten, handles: long }] : []),\n ...(seo.length ? [{ kind: ItemSuggestionKind.WriteSeo, handles: seo }] : []),\n ];\n}\n","import { jsonClosedObject, jsonListOf, jsonOneOf, JsonSchema, jsonText } from '@vectoriox/iox-ui/generation-core';\n\nimport { assertAssistBudget, MAX_ASSIST_PROPERTIES } from './budget';\nimport { AssistBriefError, AssistIssueCode } from './brief';\nimport { AssistField, AssistFieldKind, assistFields, ContentTypeSchema, isWritable } from './content-fields';\n\n/**\n * The strict output format of family `fields` for one content type (plan §3b): one property per WRITABLE field, keyed\n * by its handle, every key required, every object closed. \"Leave it as it is\" is the kind's NONE value — `''` for a\n * text, a number (written in digits), a yes/no or a choice, `[]` for paragraphs and lists — never `null`: the house\n * budget allows 8 unions a request, so nullable fields would cap a part at 8 fields; the house wire (plan-edits) uses\n * the same \"every key required, each with its none\". So Assist never EMPTIES a field — clearing one is the owner's.\n * Rich text is a list of plain paragraphs (trap T6); a multiLang field is written in ONE locale (trap T5). A type with\n * more writable fields than one request holds is split into parts, each ≤ 40 properties (trap T7 — never raised).\n */\n\nexport enum FieldsAnswerKey {\n Fields = 'fields',\n Note = 'note',\n}\n\n/** The answer object's own keys, beside the fields. */\nconst PART_OWN_PROPERTIES = Object.keys(FieldsAnswerKey).length;\n\n/** How many fields one request carries. */\nexport const FIELDS_PER_PART = MAX_ASSIST_PROPERTIES - PART_OWN_PROPERTIES;\n\nexport const NONE_TEXT = '';\nexport const BOOLEAN_TRUE = 'true';\nexport const BOOLEAN_FALSE = 'false';\n\nexport interface FieldsSchemaOptions {\n /** The locale a multiLang field is written in. */\n readonly locale: string;\n /** Only these fields (keys or handles) — the focus. Default: every writable field. */\n readonly fields?: ReadonlyArray<string>;\n}\n\nexport interface FieldsSchemas {\n /** One strict format per request. Empty when nothing is writable. */\n readonly parts: JsonSchema[];\n /** Per part, the handles it carries. */\n readonly handles: string[][];\n}\n\nconst LEAVE_TEXT = `'' leaves it as it is`;\nconst LEAVE_LIST = '[] leaves it as it is';\n\nfunction kindSchema(field: AssistField): { schema: JsonSchema; says: string } {\n const options = [...(field.options ?? [])];\n switch (field.kind) {\n case AssistFieldKind.RichText: return { schema: jsonListOf(jsonText()), says: `paragraphs of plain text, no markup; ${LEAVE_LIST}` };\n case AssistFieldKind.Number: return { schema: jsonText(), says: `a number in digits; ${LEAVE_TEXT}` };\n case AssistFieldKind.Boolean: return { schema: jsonOneOf([NONE_TEXT, BOOLEAN_TRUE, BOOLEAN_FALSE]), says: `yes or no; ${LEAVE_TEXT}` };\n case AssistFieldKind.Choice: return { schema: jsonOneOf([NONE_TEXT, ...options]), says: `one of its options; ${LEAVE_TEXT}` };\n case AssistFieldKind.Choices: return { schema: jsonListOf(jsonOneOf(options)), says: `some of its options; ${LEAVE_LIST}` };\n case AssistFieldKind.Tags: return { schema: jsonListOf(jsonText()), says: `a list of short words; ${LEAVE_LIST}` };\n case AssistFieldKind.Textarea: return { schema: jsonText(), says: `plain text, may run several sentences; ${LEAVE_TEXT}` };\n default: return { schema: jsonText(), says: `one line of plain text; ${LEAVE_TEXT}` };\n }\n}\n\nfunction fieldSchema(field: AssistField, locale: string): JsonSchema {\n const { schema, says } = kindSchema(field);\n const inLocale = field.locales ? ` Written in ${locale} only.` : '';\n return { ...schema, description: `${field.label}${field.required ? ' (required)' : ''} — ${says}.${inLocale}` };\n}\n\nfunction chosen(all: ReadonlyArray<AssistField>, wanted: ReadonlyArray<string> | undefined): AssistField[] {\n if (!wanted) return all.filter(isWritable);\n return wanted.map(w => {\n const f = all.find(x => x.key === w || x.handle === w);\n if (!f) throw new AssistBriefError(AssistIssueCode.UnknownHandle, `\"${w}\" is not a field of this type`);\n return f;\n }).filter(isWritable);\n}\n\n/** Splits n fields into the fewest parts that fit, as even as they come. */\nfunction split<T>(list: ReadonlyArray<T>, max: number): T[][] {\n if (!list.length) return [];\n const count = Math.ceil(list.length / max);\n const size = Math.ceil(list.length / count);\n return Array.from({ length: count }, (_, i) => list.slice(i * size, (i + 1) * size));\n}\n\nfunction partSchema(fields: ReadonlyArray<AssistField>, locale: string, part: number, of: number): JsonSchema {\n const properties = Object.fromEntries(fields.map(f => [f.handle, fieldSchema(f, locale)]));\n const which = of > 1 ? ` (part ${part + 1} of ${of})` : '';\n return jsonClosedObject({\n [FieldsAnswerKey.Fields]: jsonClosedObject(properties, fields.map(f => f.handle), `Per field${which}: its new value, or its leave value.`),\n [FieldsAnswerKey.Note]: { ...jsonText(), description: 'One short line for the owner on what changed, or what needs them.' },\n }, Object.values(FieldsAnswerKey));\n}\n\nexport function fieldsJsonSchema(schema: ContentTypeSchema, options: FieldsSchemaOptions): FieldsSchemas {\n const groups = split(chosen(assistFields(schema), options.fields), FIELDS_PER_PART);\n const parts = groups.map((g, i) => partSchema(g, options.locale, i, groups.length));\n parts.forEach((p, i) => assertAssistBudget(`fields ${schema.name} part ${i + 1}`, [p]));\n return { parts, handles: groups.map(g => g.map(f => f.handle)) };\n}\n\n/** One field's answer as the model wrote it. */\nexport interface FieldEdit {\n readonly handle: string;\n readonly value: unknown;\n}\n\nconst isLeave = (v: unknown) => v === null || v === undefined || v === NONE_TEXT || (Array.isArray(v) && v.length === 0);\n\n/** The parts' answers → the edits they make (every leave value dropped). */\nexport function decodeFieldsAnswers(answers: ReadonlyArray<unknown>): FieldEdit[] {\n return answers.flatMap(answer => {\n const fields = answer && typeof answer === 'object' ? (answer as Record<string, unknown>)[FieldsAnswerKey.Fields] : undefined;\n if (!fields || typeof fields !== 'object' || Array.isArray(fields)) return [];\n return Object.entries(fields as Record<string, unknown>).filter(([, v]) => !isLeave(v)).map(([handle, value]) => ({ handle, value }));\n });\n}\n","import { jsonAnyOf, jsonClosedObject, jsonListOf, jsonOneOf, JsonSchema, jsonText } from '@vectoriox/iox-ui/generation-core';\n\nimport { assertAssistBudget, MAX_ROUTE_PROPERTIES } from './budget';\nimport { AssistIssue, AssistIssueCode } from './brief';\nimport { AssistSurface, EditFamily, SURFACES } from './surfaces';\n\n/**\n * The route request (plan §3c rule 5): the first, small, fast question of every turn — which of THIS surface's\n * families the sentence needs, or `cannot` with one line for the owner. Its family enum is the surface's, so the model\n * cannot route a content-item sentence to the builder's Style.\n */\n\nexport enum RouteAnswerKey {\n Families = 'families',\n Cannot = 'cannot',\n Reply = 'reply',\n}\n\nexport function routeJsonSchema(surface: AssistSurface): JsonSchema {\n const schema = jsonClosedObject({\n [RouteAnswerKey.Families]: { ...jsonListOf(jsonOneOf(SURFACES[surface].families)), description: 'The kinds of change the sentence asks for, in the order to make them. [] when it cannot be done here.' },\n [RouteAnswerKey.Cannot]: { ...jsonAnyOf([jsonText(), { type: 'null' }]), description: 'Why it cannot be done here, in one line in the sentence\\'s language — or null.' },\n [RouteAnswerKey.Reply]: { ...jsonText(), description: 'One short line to the owner, in the sentence\\'s language.' },\n }, Object.values(RouteAnswerKey));\n assertAssistBudget(`route ${surface}`, [schema], MAX_ROUTE_PROPERTIES);\n return schema;\n}\n\nexport interface AssistRoute {\n readonly ok: boolean;\n readonly families: ReadonlyArray<EditFamily>;\n readonly cannot: string | null;\n readonly reply: string;\n readonly issues: ReadonlyArray<AssistIssue>;\n}\n\nconst text = (v: unknown): string => (typeof v === 'string' ? v.trim() : '');\n\n/** A route answer, checked against its surface: a family the surface does not have is refused, repeats dropped. */\nexport function readRoute(surface: AssistSurface, answer: unknown): AssistRoute {\n const a = (answer && typeof answer === 'object' ? answer : {}) as Record<string, unknown>;\n const allowed = new Set<string>(SURFACES[surface].families);\n const named = Array.isArray(a[RouteAnswerKey.Families]) ? (a[RouteAnswerKey.Families] as unknown[]).map(String) : [];\n const issues: AssistIssue[] = named.filter(f => !allowed.has(f))\n .map(f => ({ code: AssistIssueCode.UnknownFamily, message: `\"${f}\" is not a family of ${surface}` }));\n const families = [...new Set(named.filter(f => allowed.has(f)))] as EditFamily[];\n const cannot = text(a[RouteAnswerKey.Cannot]) || null;\n return { ok: !issues.length, families: cannot ? [] : families, cannot, reply: text(a[RouteAnswerKey.Reply]), issues };\n}\n","import { factIssues, PlanWordContext, PlanWordIssueCode } from '@vectoriox/iox-ui/generation-core';\n\nimport { AssistIssue, AssistIssueCode } from './brief';\n\n/**\n * The fact gate of every Assist family (ai-assist-plan §3c rule 4, R-H2): generation-core's `factIssues` — the SAME judge\n * the plan uses — over the words a model wrote. What counts as the owner's: their reading's facts, the sentence they\n * typed, and the words already on what they are editing (a phone already on their page is theirs to keep or move).\n */\n\n/** The owner's words to avoid and own facts (the business reading); absent → none beyond the known texts. */\nexport type AssistWordContext = Partial<PlanWordContext>;\n\nconst CODES: Readonly<Record<string, AssistIssueCode>> = {\n [PlanWordIssueCode.InventedFact]: AssistIssueCode.InventedFact,\n [PlanWordIssueCode.AvoidWord]: AssistIssueCode.AvoidWord,\n};\n\nexport interface WrittenWords {\n readonly handle: string;\n readonly text: string;\n}\n\nexport function assistFactIssues(written: ReadonlyArray<WrittenWords>, ctx: {\n readonly words?: AssistWordContext;\n readonly sentence?: string;\n /** The texts already on the thing being edited. */\n readonly existing: ReadonlyArray<string>;\n}): AssistIssue[] {\n if (!written.length) return [];\n return factIssues(written.map(w => ({ path: w.handle, text: w.text })), {\n avoidWords: ctx.words?.avoidWords ?? [],\n facts: ctx.words?.facts ?? {},\n known: [...(ctx.words?.known ?? []), ...(ctx.sentence ? [ctx.sentence] : []), ...ctx.existing],\n }).map(f => ({ code: CODES[f.code] ?? AssistIssueCode.InventedFact, handle: f.path, message: f.message }));\n}\n","import { assistFactIssues, AssistWordContext } from './assist-facts';\nimport { AssistIssue, AssistIssueCode, HandleMap, resolveHandle } from './brief';\nimport { AssistField, AssistFieldKind, assistFields, ContentTypeSchema } from './content-fields';\nimport { BOOLEAN_FALSE, BOOLEAN_TRUE, FieldEdit } from './fields-schema';\nimport { BriefValue, isPlainRecord, readFieldValue } from './field-values';\nimport { containsHtml, paragraphsToRichText } from './rich-text';\nimport { ContentRecord } from './summarize-item';\n\n/**\n * Family `fields`, applied (plan §3c rule 6): the SAME pure check runs on the server (on a copy, before the turn is\n * shown) and in the client (the trial in the form). All or none — one refused edit refuses the turn, which is re-asked\n * once with the issues, never repaired in code. Never mutates its input.\n * - a handle maps back through the brief's map; an unknown one is refused (T1);\n * - a never-written field, a wrong type, a choice outside the options, markup in a text: refused;\n * - a multiLang field gets ONE locale key, the others kept (T5);\n * - rich text is stored as escaped `<p>` paragraphs; the change carries the paragraphs (T6);\n * - a field the owner edited since the last turn is KEPT unless the sentence names it (rule 9);\n * - an edit that changes nothing is dropped.\n */\n\nexport interface FieldEditContext {\n readonly schema: ContentTypeSchema;\n readonly handles: HandleMap;\n /** The locale a multiLang field is written in. */\n readonly locale: string;\n /** Fields (keys or handles) the owner changed since the last AI turn. */\n readonly ownerEdited?: ReadonlyArray<string>;\n /** Fields (keys or handles) the sentence names. Default: read from `sentence` by `fieldsNamedIn`. */\n readonly named?: ReadonlyArray<string>;\n readonly sentence?: string;\n /** The owner's words to avoid and own facts (R-H2) — a fact in the sentence or already in the item is theirs. */\n readonly words?: AssistWordContext;\n}\n\nexport interface FieldChange {\n readonly handle: string;\n readonly key: string;\n readonly label: string;\n readonly kind: AssistFieldKind;\n /** Readable: text, paragraphs, a number, yes/no, options, words. */\n readonly before: BriefValue;\n readonly after: BriefValue;\n readonly locale?: string;\n}\n\nexport interface FieldEditsOutcome {\n readonly ok: boolean;\n /** The record with every change applied (stored form) — a copy of the input when refused. */\n readonly result: ContentRecord;\n readonly changes: ReadonlyArray<FieldChange>;\n /** Proposed, but the owner edited the field since and the sentence did not name it. */\n readonly kept: ReadonlyArray<FieldChange>;\n readonly issues: ReadonlyArray<AssistIssue>;\n}\n\ntype Coerced = { ok: true; stored: unknown; readable: BriefValue } | { ok: false; code: AssistIssueCode; message: string };\n\nconst refuse = (code: AssistIssueCode, message: string): Coerced => ({ ok: false, code, message });\nconst wrongType = (what: string) => refuse(AssistIssueCode.WrongType, `expected ${what}`);\nconst fine = (stored: unknown, readable: BriefValue = stored as BriefValue): Coerced => ({ ok: true, stored, readable });\n\nfunction coerceText(value: unknown): Coerced {\n if (typeof value !== 'string' || !value.trim()) return wrongType('a non-empty text');\n if (containsHtml(value)) return refuse(AssistIssueCode.HtmlNotAllowed, 'markup is not written by Assist');\n return fine(value.trim());\n}\n\nfunction coerceWords(value: unknown): { words: string[] } | Coerced {\n if (!Array.isArray(value) || value.some(v => typeof v !== 'string')) return wrongType('a list of texts');\n const words = [...new Set((value as string[]).map(v => v.trim()).filter(Boolean))];\n if (!words.length) return wrongType('at least one text');\n if (words.some(containsHtml)) return refuse(AssistIssueCode.HtmlNotAllowed, 'markup is not written by Assist');\n return { words };\n}\n\nfunction coerceNumber(value: unknown): Coerced {\n const n = typeof value === 'number' ? value : typeof value === 'string' && value.trim() !== '' ? Number(value.trim()) : NaN;\n return Number.isFinite(n) ? fine(n) : wrongType('a number');\n}\n\nfunction coerceBoolean(value: unknown): Coerced {\n if (typeof value === 'boolean') return fine(value);\n if (value === BOOLEAN_TRUE || value === BOOLEAN_FALSE) return fine(value === BOOLEAN_TRUE);\n return wrongType('yes or no');\n}\n\nfunction coerceChoice(field: AssistField, value: unknown): Coerced {\n if (typeof value !== 'string') return wrongType('one of the options');\n return field.options?.includes(value) ? fine(value) : refuse(AssistIssueCode.NotAnOption, `\"${value}\" is not an option of ${field.label}`);\n}\n\nfunction coerceList(field: AssistField, value: unknown): Coerced {\n const read = coerceWords(value);\n if (!('words' in read)) return read;\n if (field.kind === AssistFieldKind.Choices) {\n const outside = read.words.filter(w => !field.options?.includes(w));\n if (outside.length) return refuse(AssistIssueCode.NotAnOption, `${outside.map(w => `\"${w}\"`).join(', ')} not an option of ${field.label}`);\n }\n return fine(read.words);\n}\n\nfunction coerceRichText(value: unknown): Coerced {\n const read = coerceWords(value);\n if (!('words' in read)) return read;\n return fine(paragraphsToRichText(read.words), read.words);\n}\n\nfunction coerce(field: AssistField, value: unknown): Coerced {\n switch (field.kind) {\n case AssistFieldKind.RichText: return coerceRichText(value);\n case AssistFieldKind.Number: return coerceNumber(value);\n case AssistFieldKind.Boolean: return coerceBoolean(value);\n case AssistFieldKind.Choice: return coerceChoice(field, value);\n case AssistFieldKind.Choices:\n case AssistFieldKind.Tags: return coerceList(field, value);\n default: return coerceText(value);\n }\n}\n\nconst NAME_MIN_CHARS = 3;\n\n/** The fields a sentence names by label, key or handle (case-insensitive) — rule 9's \"unless the sentence names it\". */\nexport function fieldsNamedIn(sentence: string, fields: ReadonlyArray<AssistField>): string[] {\n const s = sentence.toLowerCase();\n if (!s.trim()) return [];\n return fields.filter(f => [f.label, f.key, f.handle].some(n => n.length >= NAME_MIN_CHARS && s.includes(n.toLowerCase()))).map(f => f.key);\n}\n\nconst names = (list: ReadonlyArray<string> | undefined, fields: ReadonlyArray<AssistField>): Set<string> =>\n new Set((list ?? []).map(n => fields.find(f => f.key === n || f.handle === n)?.key ?? n));\n\ninterface Planned {\n field: AssistField;\n stored: unknown;\n change: FieldChange;\n}\n\nfunction plan(field: AssistField, handle: string, values: ContentRecord, coerced: { stored: unknown; readable: BriefValue }, locale: string): Planned | null {\n const raw = values[field.key];\n const own = field.locales ? (isPlainRecord(raw) ? raw : {}) : null;\n const before = readFieldValue(field.kind, own ? own[locale] : raw);\n if (JSON.stringify(before) === JSON.stringify(coerced.readable)) return null;\n const stored = own ? { ...own, [locale]: coerced.stored } : coerced.stored;\n const change: FieldChange = {\n handle, key: field.key, label: field.label, kind: field.kind, before, after: coerced.readable, ...(own ? { locale } : {}),\n };\n return { field, stored, change };\n}\n\n/** The words in a value (a text, paragraphs, a list, a multiLang record) — what the fact gate reads. */\nfunction wordsOf(value: unknown): string[] {\n if (typeof value === 'string') return value.trim() ? [value] : [];\n if (Array.isArray(value)) return value.flatMap(wordsOf);\n if (isPlainRecord(value)) return Object.values(value).flatMap(wordsOf);\n return [];\n}\n\nexport function applyFieldEdits(values: ContentRecord, edits: ReadonlyArray<FieldEdit>, ctx: FieldEditContext): FieldEditsOutcome {\n const fields = assistFields(ctx.schema);\n const issues: AssistIssue[] = [];\n const planned: Planned[] = [];\n const seen = new Set<string>();\n const issue = (code: AssistIssueCode, handle: string, message: string) => issues.push({ code, handle, message });\n\n for (const edit of edits) {\n const resolved = resolveHandle(ctx.handles, edit.handle);\n if ('issue' in resolved) { issues.push(resolved.issue); continue; }\n const field = fields.find(f => f.key === resolved.target.key);\n if (!field) { issue(AssistIssueCode.UnknownHandle, edit.handle, `\"${edit.handle}\" is not a field of ${ctx.schema.name}`); continue; }\n if (seen.has(field.key)) { issue(AssistIssueCode.Duplicate, edit.handle, `${field.label} is written twice`); continue; }\n seen.add(field.key);\n if (field.never) { issue(AssistIssueCode.NeverWrite, edit.handle, `${field.label} is never written by Assist (${field.never})`); continue; }\n if (field.locales && !field.locales.includes(ctx.locale)) { issue(AssistIssueCode.WrongLocale, edit.handle, `${field.label} has no ${ctx.locale}`); continue; }\n const coerced = coerce(field, edit.value);\n if ('code' in coerced) { issue(coerced.code, edit.handle, `${field.label}: ${coerced.message}`); continue; }\n const p = plan(field, edit.handle, values, coerced, ctx.locale);\n if (p) planned.push(p);\n }\n\n issues.push(...assistFactIssues(planned.flatMap(p => wordsOf(p.change.after).map(text => ({ handle: p.change.handle, text }))), {\n words: ctx.words, sentence: ctx.sentence, existing: Object.values(values).flatMap(wordsOf),\n }));\n if (issues.length) return { ok: false, result: { ...values }, changes: [], kept: [], issues };\n\n const edited = names(ctx.ownerEdited, fields);\n const named = names(ctx.named ?? fieldsNamedIn(ctx.sentence ?? '', fields), fields);\n const isKept = (p: Planned) => edited.has(p.field.key) && !named.has(p.field.key);\n const applied = planned.filter(p => !isKept(p));\n const result: Record<string, unknown> = { ...values };\n for (const p of applied) result[p.field.key] = p.stored;\n return { ok: true, result, changes: applied.map(p => p.change), kept: planned.filter(isKept).map(p => p.change), issues: [] };\n}\n","import { AssistField } from './content-fields';\nimport { isEmptyFieldValue, isPlainRecord } from './field-values';\nimport { ContentRecord } from './summarize-item';\n\n/**\n * The ONE locale a content-item turn writes in (plan §3c rule 8, trap T5) — decided the same way by the server and the\n * client: a multiLang field gets this key and no other. The sentence decides when it names a language (\"translate the\n * summary to English\", \"תרגם לאנגלית\") — matched against the runtime's own language names (`Intl.DisplayNames`) in the\n * languages the admin speaks, never a hand-kept list; the last one named wins. Otherwise the item's own language: the\n * locale most of its multiLang fields are filled in (schema order breaks a tie); else the admin's; else the first.\n */\n\n/** The languages whose names a sentence may use — the admin's two UI languages. */\nexport const LOCALE_NAME_LANGUAGES: ReadonlyArray<string> = ['en', 'he'];\n\nconst DISPLAY_TYPE_LANGUAGE = 'language';\n\n/** Every locale the type's multiLang fields hold, in schema order. */\nexport function itemLocales(fields: ReadonlyArray<AssistField>): string[] {\n return [...new Set(fields.flatMap(f => f.locales ?? []))];\n}\n\nfunction displayName(locale: string, inLanguage: string): string | null {\n try {\n const name = new Intl.DisplayNames([inLanguage], { type: DISPLAY_TYPE_LANGUAGE }).of(locale);\n return name && name !== locale ? name : null;\n } catch {\n return null;\n }\n}\n\nfunction languageNames(locale: string, languages: ReadonlyArray<string>): string[] {\n return languages.flatMap(lang => {\n const name = displayName(locale, lang);\n return name ? [name.toLowerCase()] : [];\n });\n}\n\n/** The last position a locale's name appears at in the sentence, or -1. */\nfunction lastMention(sentence: string, locale: string, languages: ReadonlyArray<string>): number {\n const s = sentence.toLowerCase();\n return Math.max(-1, ...languageNames(locale, languages).map(n => s.lastIndexOf(n)));\n}\n\n/** The locale the sentence names; the last one named wins (\"the Hebrew summary to English\" → en). */\nexport function namedLocale(sentence: string, locales: ReadonlyArray<string>, languages: ReadonlyArray<string> = LOCALE_NAME_LANGUAGES): string | null {\n const named = locales\n .map(locale => ({ locale, at: lastMention(sentence, locale, languages) }))\n .filter(m => m.at >= 0)\n .sort((a, b) => b.at - a.at);\n return named[0]?.locale ?? null;\n}\n\n/** The locale most of the item's multiLang fields are filled in (schema order breaks a tie); else the UI's; else the first. */\nexport function primaryLocale(fields: ReadonlyArray<AssistField>, values: ContentRecord, uiLang: string): string {\n const locales = itemLocales(fields);\n if (!locales.length) return uiLang;\n const filled = (locale: string) => fields.filter(f => {\n const v = values[f.key];\n return f.locales?.includes(locale) && isPlainRecord(v) && !isEmptyFieldValue(v[locale]);\n }).length;\n const best = locales.reduce((a, b) => (filled(b) > filled(a) ? b : a));\n if (filled(best) > 0) return best;\n return locales.includes(uiLang) ? uiLang : locales[0];\n}\n\n/** The write locale of a content-item turn. */\nexport function turnLocale(sentence: string, fields: ReadonlyArray<AssistField>, values: ContentRecord, uiLang: string): string {\n return namedLocale(sentence, itemLocales(fields)) ?? primaryLocale(fields, values, uiLang);\n}\n\n/** The language's own name in the admin's language (`en` → \"English\" / \"אנגלית\"). */\nexport const languageName = (locale: string, uiLang: string): string => displayName(locale, uiLang) ?? locale;\n","import { jsonClosedObject, jsonListOf, JsonSchema, jsonText, SerializedNode, walkSerialized } from '@vectoriox/iox-ui/generation-core';\n\nimport { assistFactIssues, AssistWordContext } from './assist-facts';\nimport { namedLocale } from './assist-locale';\nimport { assertAssistBudget, MAX_ASSIST_PROPERTIES } from './budget';\nimport { AssistIssue, AssistIssueCode, Brief, BriefRules, HandleMap, NeverWrite, resolveHandle } from './brief';\nimport { containsHtml, escapeText, paragraphsToRichText, richTextParagraphs } from './rich-text';\nimport { clipText } from './summarize-item';\nimport { AssistScope, AssistSurface, EditFamily, SURFACES } from './surfaces';\n\n/**\n * Surface S1 (the builder, this page), family `words` (ai-assist-plan §4, ai-session-panel-plan §3b–§3d): the page as\n * the model sees it — sections in order, each a handle (`s0`), the parts that carry words as handles (`s0.heading1`,\n * `s2.button1`) with their kind and words — never a node id, a style value or the tree. The SAME pure functions run on\n * the server (the brief it trusts, the check on a copy) and in the builder (the trial on the canvas):\n * - `summarizePage` — the brief + the handle map (handle → node id + prop), sized by distance from the selection;\n * - `wordsJsonSchema` — the strict format, one property per writable handle of the focus, ≤ 40 a request;\n * - `applyWordEdits` — all or none on a COPY: unknown or bound handles, markup, an empty text, a word to avoid or a fact\n * nobody gave are refused (re-asked once by the server, never repaired here).\n */\n\n/** What a part is, as the owner and the model call it. */\nexport enum PagePartKind {\n Heading = 'heading',\n Text = 'text',\n Button = 'button',\n Link = 'link',\n Image = 'image',\n Field = 'field',\n Slide = 'slide',\n Video = 'video',\n}\n\ninterface WordSlot {\n readonly prop: string;\n readonly kind: PagePartKind;\n /** A second words prop of the same node (`s0.field1.placeholder`). */\n readonly suffix?: string;\n /** What these words are, for the model. */\n readonly says: string;\n}\n\n/** Which saved prop holds a type's words (node baselines). One table — ARIA labels are left to the author. */\nexport const PAGE_WORD_SLOTS: Readonly<Record<string, ReadonlyArray<WordSlot>>> = {\n Heading: [{ prop: 'content', kind: PagePartKind.Heading, says: 'a heading' }],\n Text: [{ prop: 'content', kind: PagePartKind.Text, says: 'text' }],\n Button: [{ prop: 'label', kind: PagePartKind.Button, says: 'a button\\'s words' }],\n SubmitButton: [{ prop: 'label', kind: PagePartKind.Button, says: 'a form\\'s send button' }],\n Link: [{ prop: 'label', kind: PagePartKind.Link, says: 'a link\\'s words' }],\n Field: [\n { prop: 'label', kind: PagePartKind.Field, says: 'a form field\\'s label' },\n { prop: 'placeholder', kind: PagePartKind.Field, suffix: 'placeholder', says: 'the hint inside an empty form field' },\n ],\n Image: [{ prop: 'alt', kind: PagePartKind.Image, says: 'a picture\\'s description for people who cannot see it' }],\n SliderSlide: [{ prop: 'caption', kind: PagePartKind.Slide, says: 'a slide\\'s caption' }],\n Video: [{ prop: 'title', kind: PagePartKind.Video, says: 'a video\\'s title' }],\n};\n\n/** A Text wearing this element style is a ButtonBlock's words — a button to the owner. */\nconst BUTTON_LABEL_STYLE = 'button-label';\n\n/** Focus words are sent whole up to this; Around words are summaries (`AROUND_TEXT_CHARS`). */\nexport const FOCUS_TEXT_CHARS = 1200;\n\nconst BLOCK_MARKUP = /<(p|div|h[1-6]|li|blockquote|br)\\b/i;\n\n/** A stored words value written as paragraphs (rich) or one plain line. */\nconst isRich = (value: unknown): boolean => typeof value === 'string' && BLOCK_MARKUP.test(value);\n\n/** A stored words value as the owner reads it. */\nexport function readableWords(value: unknown): string {\n return richTextParagraphs(value).join('\\n');\n}\n\nexport interface PagePart {\n readonly handle: string;\n readonly kind: PagePartKind;\n /** \"Heading 1\", \"Button 2\" — how the change card names it. */\n readonly label: string;\n readonly words: string;\n /** Written as paragraphs (a list) rather than one line. */\n readonly paragraphs?: boolean;\n /** `Projects ▸ title`: bound words change with their item, never here. */\n readonly bound?: string;\n readonly style?: string;\n readonly role?: string;\n}\n\nexport interface PageSectionSummary {\n readonly handle: string;\n /** The section's own name (\"Hero\", \"Our work\") or \"Section 3\". */\n readonly label: string;\n readonly parts: ReadonlyArray<PagePart>;\n}\n\nexport interface PageFocus {\n readonly scope: AssistScope;\n readonly page: { readonly name: string; readonly route: string };\n readonly sections: ReadonlyArray<PageSectionSummary>;\n /** The selection's handles (the node and the parts inside it) — \"this\". Empty on a page focus. */\n readonly selected: ReadonlyArray<string>;\n /** The selection as the owner sees it (\"Hero ▸ Heading 1\"). */\n readonly selectedLabel?: string;\n}\n\nexport interface PageAround {\n /** The other sections, one line each. */\n readonly sections: ReadonlyArray<{ readonly handle: string; readonly label: string; readonly headline: string }>;\n /** The site's other pages, by name. */\n readonly pages: ReadonlyArray<string>;\n}\n\nexport type PageBrief = Brief<PageFocus, PageAround>;\n\nexport interface PageBriefContext {\n readonly locale: string;\n readonly page: { readonly name: string; readonly route: string };\n /** The selected node, when there is one. */\n readonly selectedId?: string | null;\n /** A rung wider than the selection (the chip's ✕). Default: node when something is selected, else page. */\n readonly scope?: AssistScope;\n readonly pages?: ReadonlyArray<string>;\n readonly owner?: string | null;\n readonly memory?: ReadonlyArray<string>;\n}\n\nexport interface SummarizedPage {\n readonly brief: PageBrief;\n /** Every WRITABLE words handle of the page → its node id and prop. Bound parts are not in it. */\n readonly handles: HandleMap;\n /** The writable handles of the focus — what a words request carries. */\n readonly focusHandles: ReadonlyArray<string>;\n /** Every part of the page with its node id (for the client to outline a change) — never sent. */\n readonly nodes: Readonly<Record<string, string>>;\n}\n\nconst sectionHandle = (index: number): string => `s${index}`;\n\nconst capitalise = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);\n\n/** \"Hero · ground\" → \"Hero\"; a composed section's id label (\"hero-1\") reads as words. */\nfunction sectionLabel(node: SerializedNode, index: number): string {\n const own = (node.label ?? '').split(' · ')[0].trim();\n return own ? capitalise(own.replace(/[-_]+/g, ' ')) : `Section ${index + 1}`;\n}\n\nfunction boundLabel(node: SerializedNode, prop: string): string | undefined {\n const b = (node.bindings ?? []).find(x => x.prop === prop);\n return b ? [b.source, b.path].filter(Boolean).join(' ▸ ') : undefined;\n}\n\nfunction slotsOf(node: SerializedNode): ReadonlyArray<WordSlot> {\n const slots = PAGE_WORD_SLOTS[node.type] ?? [];\n if (node.type === 'Text' && node.elementStyle === BUTTON_LABEL_STYLE) return slots.map(s => ({ ...s, kind: PagePartKind.Button, says: 'a button\\'s words' }));\n return slots;\n}\n\ninterface Walked {\n readonly part: PagePart;\n readonly section: number;\n readonly nodeId: string;\n readonly prop: string;\n /** Node ids from the section root down to the node. */\n readonly lineage: ReadonlyArray<string>;\n}\n\n/** Every words part of the page, in reading order, with its handle. */\nfunction walkParts(layout: ReadonlyArray<SerializedNode>): Walked[] {\n const out: Walked[] = [];\n layout.forEach((root, index) => {\n const counts = new Map<PagePartKind, number>();\n const visit = (node: SerializedNode, lineage: string[]) => {\n for (const slot of slotsOf(node)) {\n if (!slot.suffix) counts.set(slot.kind, (counts.get(slot.kind) ?? 0) + 1);\n const n = counts.get(slot.kind) ?? 1;\n const base = `${sectionHandle(index)}.${slot.kind}${n}`;\n const value = node.props?.[slot.prop];\n const bound = boundLabel(node, slot.prop);\n const part: PagePart = {\n handle: slot.suffix ? `${base}.${slot.suffix}` : base,\n kind: slot.kind,\n label: `${capitalise(slot.kind)} ${n}${slot.suffix ? ` · ${slot.suffix}` : ''}`,\n words: readableWords(value),\n ...(isRich(value) ? { paragraphs: true } : {}),\n ...(bound ? { bound } : {}),\n ...(node.elementStyle ? { style: node.elementStyle } : {}),\n ...(node.role ? { role: node.role } : {}),\n };\n out.push({ part, section: index, nodeId: node.id, prop: slot.prop, lineage: [...lineage, node.id] });\n }\n for (const child of node.children ?? []) visit(child, [...lineage, node.id]);\n };\n visit(root, []);\n });\n return out;\n}\n\nconst WIDENS: Readonly<Partial<Record<AssistScope, ReadonlyArray<AssistScope>>>> = {\n [AssistScope.Node]: [AssistScope.Section, AssistScope.Page],\n [AssistScope.Section]: [AssistScope.Page],\n [AssistScope.Page]: [],\n};\n\n/** The section a node is in (its index), or -1. */\nfunction sectionOf(layout: ReadonlyArray<SerializedNode>, id: string): number {\n let found = -1;\n layout.forEach((root, index) => walkSerialized([root], n => { if (n.id === id) found = index; }));\n return found;\n}\n\n/**\n * The page as the model sees it. The selection decides the focus: a node → its section in full, its own parts as\n * \"this\"; a section → that section; nothing (or the page rung) → every section. The other sections are one line each.\n */\nexport function summarizePage(layout: ReadonlyArray<SerializedNode>, ctx: PageBriefContext): SummarizedPage {\n const walked = walkParts(layout);\n const selectedSection = ctx.selectedId ? sectionOf(layout, ctx.selectedId) : -1;\n const isSectionRoot = selectedSection >= 0 && layout[selectedSection].id === ctx.selectedId;\n const asked = ctx.scope ?? (selectedSection < 0 ? AssistScope.Page : isSectionRoot ? AssistScope.Section : AssistScope.Node);\n const scope = selectedSection < 0 ? AssistScope.Page : asked;\n\n const inFocus = (w: Walked) => scope === AssistScope.Page || w.section === selectedSection;\n const selectedParts = scope === AssistScope.Node ? walked.filter(w => w.lineage.includes(ctx.selectedId!)) : [];\n\n const sections: PageSectionSummary[] = layout\n .map((root, index) => ({ root, index }))\n .filter(({ index }) => scope === AssistScope.Page || index === selectedSection)\n .map(({ root, index }) => ({\n handle: sectionHandle(index),\n label: sectionLabel(root, index),\n parts: walked.filter(w => w.section === index).map(w => ({ ...w.part, words: clipText(w.part.words, FOCUS_TEXT_CHARS) })),\n }));\n const around = layout\n .map((root, index) => ({ root, index }))\n .filter(({ index }) => scope !== AssistScope.Page && index !== selectedSection)\n .map(({ root, index }) => {\n const first = walked.find(w => w.section === index && w.part.words && (w.part.kind === PagePartKind.Heading || w.part.kind === PagePartKind.Text));\n return { handle: sectionHandle(index), label: sectionLabel(root, index), headline: clipText(first?.part.words ?? '') };\n });\n\n const handles: Record<string, { key: string; path: string[]; id: string }> = {};\n const nodes: Record<string, string> = {};\n for (const w of walked) {\n nodes[w.part.handle] = w.nodeId;\n if (!w.part.bound) handles[w.part.handle] = { key: w.prop, path: [], id: w.nodeId };\n }\n layout.forEach((root, index) => { nodes[sectionHandle(index)] = root.id; });\n\n const focusWalked = scope === AssistScope.Node && selectedParts.length ? selectedParts : walked.filter(inFocus);\n const never: NeverWrite[] = focusWalked.filter(w => w.part.bound)\n .map(w => ({ handle: w.part.handle, label: w.part.label, reason: `its words come from ${w.part.bound} — change them in that item` }));\n const rules: BriefRules = {\n families: SURFACES[AssistSurface.BuilderPage].families,\n locale: ctx.locale,\n never,\n scope,\n widensTo: WIDENS[scope] ?? [],\n };\n const selectedNode = selectedParts[0];\n const focus: PageFocus = {\n scope,\n page: ctx.page,\n sections,\n selected: selectedParts.map(w => w.part.handle),\n ...(selectedNode ? { selectedLabel: `${sections[0]?.label ?? ''} ▸ ${selectedNode.part.label}` } : {}),\n };\n return {\n brief: {\n surface: AssistSurface.BuilderPage,\n focus,\n around: { sections: around, pages: [...(ctx.pages ?? [])] },\n owner: ctx.owner ?? null,\n rules,\n memory: [...(ctx.memory ?? [])],\n },\n handles,\n focusHandles: focusWalked.filter(w => !w.part.bound).map(w => w.part.handle),\n nodes,\n };\n}\n\nexport enum WordsAnswerKey {\n Words = 'words',\n Note = 'note',\n}\n\n/** How many words handles one request carries. */\nexport const WORDS_PER_PART = MAX_ASSIST_PROPERTIES - Object.keys(WordsAnswerKey).length;\n\nexport interface WordsSchemas {\n readonly parts: JsonSchema[];\n readonly handles: string[][];\n}\n\nfunction split<T>(list: ReadonlyArray<T>, max: number): T[][] {\n if (!list.length) return [];\n const count = Math.ceil(list.length / max);\n const size = Math.ceil(list.length / count);\n return Array.from({ length: count }, (_, i) => list.slice(i * size, (i + 1) * size));\n}\n\nfunction partSlot(part: PagePart, locale: string): JsonSchema {\n const where = `${part.label}${part.style ? ` (${part.style})` : ''}`;\n if (part.paragraphs) {\n return { ...jsonListOf(jsonText()), description: `${where} — paragraphs of plain text in ${locale}; [] leaves it as it is.` };\n }\n return { ...jsonText(), description: `${where} — one line of plain text in ${locale}; '' leaves it as it is.` };\n}\n\n/** The strict format of family `words` for the focus: every writable handle answered (new words, or its leave value). */\nexport function wordsJsonSchema(summary: SummarizedPage): WordsSchemas {\n const byHandle = new Map(summary.brief.focus.sections.flatMap(s => s.parts).map(p => [p.handle, p]));\n const writable = summary.focusHandles.map(h => byHandle.get(h)).filter((p): p is PagePart => !!p);\n const groups = split(writable, WORDS_PER_PART);\n const parts = groups.map((g, i) => {\n const which = groups.length > 1 ? ` (part ${i + 1} of ${groups.length})` : '';\n return jsonClosedObject({\n [WordsAnswerKey.Words]: jsonClosedObject(\n Object.fromEntries(g.map(p => [p.handle, partSlot(p, summary.brief.rules.locale)])),\n g.map(p => p.handle),\n `Per part${which}: its new words, or its leave value.`,\n ),\n [WordsAnswerKey.Note]: { ...jsonText(), description: 'One short line for the owner on what changed, or what needs them.' },\n }, Object.values(WordsAnswerKey));\n });\n parts.forEach((p, i) => assertAssistBudget(`words part ${i + 1}`, [p]));\n return { parts, handles: groups.map(g => g.map(p => p.handle)) };\n}\n\n/** One part's answer as the model wrote it: a line, or paragraphs. */\nexport interface WordEdit {\n readonly handle: string;\n readonly value: string | ReadonlyArray<string>;\n}\n\nconst isLeave = (v: unknown) => v === null || v === undefined || v === '' || (Array.isArray(v) && v.length === 0);\n\n/** The parts' answers → the edits they make (every leave value dropped). */\nexport function decodeWordsAnswers(answers: ReadonlyArray<unknown>): WordEdit[] {\n return answers.flatMap(answer => {\n const words = answer && typeof answer === 'object' ? (answer as Record<string, unknown>)[WordsAnswerKey.Words] : undefined;\n if (!words || typeof words !== 'object' || Array.isArray(words)) return [];\n return Object.entries(words as Record<string, unknown>).filter(([, v]) => !isLeave(v))\n .map(([handle, value]) => ({ handle, value: value as WordEdit['value'] }));\n });\n}\n\nexport interface WordChange {\n readonly handle: string;\n /** The node the change is on — the builder outlines it; never sent to the model. */\n readonly nodeId: string;\n readonly kind: PagePartKind;\n readonly label: string;\n readonly before: string;\n readonly after: string;\n}\n\nexport interface WordEditContext {\n readonly handles: HandleMap;\n /** Handles the brief says are never written (bound words). */\n readonly never?: ReadonlyArray<NeverWrite>;\n /** The owner's sentence — a fact in it is theirs. */\n readonly sentence?: string;\n /** The owner's words to avoid and own facts (the business reading); none known → none allowed beyond the page's. */\n readonly words?: AssistWordContext;\n}\n\nexport interface WordEditsOutcome {\n readonly ok: boolean;\n /** The layout with every change applied — the input untouched; a copy of it when refused. */\n readonly result: SerializedNode[];\n readonly changes: ReadonlyArray<WordChange>;\n readonly issues: ReadonlyArray<AssistIssue>;\n}\n\n/** Every words value already on the page — its facts are the owner's (R-H2). */\nfunction pageTexts(layout: ReadonlyArray<SerializedNode>): string[] {\n const out: string[] = [];\n walkSerialized(layout, node => {\n for (const slot of slotsOf(node)) {\n const text = readableWords(node.props?.[slot.prop]);\n if (text) out.push(text);\n }\n });\n return out;\n}\n\nfunction partLabel(node: SerializedNode, prop: string, handle: string): { kind: PagePartKind; label: string } {\n const slot = slotsOf(node).find(s => s.prop === prop);\n const kind = slot?.kind ?? PagePartKind.Text;\n const tail = handle.split('.').slice(1).join(' ').replace(/^([a-z]+)(\\d+)/, (_, k: string, n: string) => `${capitalise(k)} ${n}`);\n return { kind, label: tail || capitalise(kind) };\n}\n\n/**\n * Family `words`, applied — the SAME check on the server (before a turn is shown) and in the builder (the trial). All\n * or none; never mutates its input. A part written as paragraphs takes paragraphs (stored as escaped `<p>`), a line\n * takes one line (stored escaped). An edit that changes nothing is dropped.\n */\nexport function applyWordEdits(layout: ReadonlyArray<SerializedNode>, edits: ReadonlyArray<WordEdit>, ctx: WordEditContext): WordEditsOutcome {\n const result = JSON.parse(JSON.stringify(layout)) as SerializedNode[];\n const byId = new Map<string, SerializedNode>();\n walkSerialized(result, n => byId.set(n.id, n));\n const never = new Map((ctx.never ?? []).map(n => [n.handle, n]));\n const issues: AssistIssue[] = [];\n const changes: WordChange[] = [];\n const seen = new Set<string>();\n const written: Array<{ handle: string; text: string }> = [];\n\n for (const edit of edits) {\n const refuse = (code: AssistIssueCode, message: string) => issues.push({ code, handle: edit.handle, message });\n if (seen.has(edit.handle)) { refuse(AssistIssueCode.Duplicate, `\"${edit.handle}\" is answered twice`); continue; }\n seen.add(edit.handle);\n const kept = never.get(edit.handle);\n if (kept) { refuse(AssistIssueCode.NeverWrite, `${kept.label}: ${kept.reason}`); continue; }\n const resolved = resolveHandle(ctx.handles, edit.handle);\n if ('issue' in resolved) { issues.push(resolved.issue); continue; }\n const node = resolved.target.id ? byId.get(resolved.target.id) : undefined;\n if (!node) { refuse(AssistIssueCode.UnknownHandle, `\"${edit.handle}\" is no longer on the page`); continue; }\n const prop = resolved.target.key;\n const before = node.props?.[prop];\n const rich = isRich(before);\n const lines = typeof edit.value === 'string' ? [edit.value] : Array.isArray(edit.value) ? [...edit.value] : null;\n if (!lines || lines.some(l => typeof l !== 'string')) { refuse(AssistIssueCode.WrongType, rich ? 'expected paragraphs of text' : 'expected one line of text'); continue; }\n const clean = lines.map(l => l.replace(/\\s+/g, ' ').trim()).filter(Boolean);\n if (!clean.length) { refuse(AssistIssueCode.WrongType, 'expected words — leave a part as it is with its leave value'); continue; }\n if (clean.some(containsHtml)) { refuse(AssistIssueCode.HtmlNotAllowed, 'markup is not written by Assist'); continue; }\n if (!rich && clean.length > 1) { refuse(AssistIssueCode.WrongType, 'this part is one line'); continue; }\n const stored = rich ? paragraphsToRichText(clean) : escapeText(clean[0]);\n const readable = clean.join('\\n');\n if (readable === readableWords(before)) continue;\n written.push({ handle: edit.handle, text: readable });\n node.props = { ...(node.props ?? {}), [prop]: stored };\n changes.push({ handle: edit.handle, nodeId: node.id, ...partLabel(node, prop, edit.handle), before: readableWords(before), after: readable });\n }\n\n issues.push(...assistFactIssues(written, { words: ctx.words, sentence: ctx.sentence, existing: pageTexts(layout) }));\n\n if (issues.length) return { ok: false, result: JSON.parse(JSON.stringify(layout)) as SerializedNode[], changes: [], issues };\n return { ok: true, result, changes, issues: [] };\n}\n\nexport enum PageSuggestionKind {\n /** The selection's words, rewritten as the owner asks. */\n Rewrite = 'rewrite',\n Shorten = 'shorten',\n FillEmpty = 'fillEmpty',\n /** Pictures with no description for people who cannot see them. */\n DescribePictures = 'describePictures',\n}\n\n/** A quick action the Ask box offers, built from the brief (never canned text — the client words it). */\nexport interface PageSuggestion {\n readonly kind: PageSuggestionKind;\n readonly handles: ReadonlyArray<string>;\n}\n\n/** A heading this long, or a text this long, is worth a \"Shorten\". */\nexport const SHORTEN_HEADING_FROM_CHARS = 60;\nexport const SHORTEN_TEXT_FROM_CHARS = 280;\n\nconst tooLong = (p: PagePart) => p.words.length >= (p.kind === PagePartKind.Heading ? SHORTEN_HEADING_FROM_CHARS : SHORTEN_TEXT_FROM_CHARS);\n\n/** S1's quick actions — each only when it applies to the focus. */\nexport function pageSuggestions(summary: SummarizedPage): PageSuggestion[] {\n const writable = new Set(summary.focusHandles);\n const parts = summary.brief.focus.sections.flatMap(s => s.parts).filter(p => writable.has(p.handle));\n const pick = (test: (p: PagePart) => boolean) => parts.filter(test).map(p => p.handle);\n const selected = summary.brief.focus.selected.filter(h => writable.has(h));\n const long = pick(p => p.kind !== PagePartKind.Image && tooLong(p));\n const empty = pick(p => p.kind !== PagePartKind.Image && !p.words);\n const pictures = pick(p => p.kind === PagePartKind.Image && !p.words);\n return [\n ...(selected.length ? [{ kind: PageSuggestionKind.Rewrite, handles: selected }] : []),\n ...(long.length ? [{ kind: PageSuggestionKind.Shorten, handles: long }] : []),\n ...(empty.length ? [{ kind: PageSuggestionKind.FillEmpty, handles: empty }] : []),\n ...(pictures.length ? [{ kind: PageSuggestionKind.DescribePictures, handles: pictures }] : []),\n ];\n}\n\nconst HEBREW_LETTER = /[-]/g;\nconst LATIN_LETTER = /[A-Za-zÀ-ɏ]/g;\nconst LOCALE_SHAPE = /^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})?$/;\nconst HEBREW = 'he';\nconst ENGLISH = 'en';\n\n/**\n * The ONE locale a page turn writes in (ai-session-panel-plan §3h) — the server's and the builder's: a language the\n * sentence names (\"translate this to English\") → the page's own locale → the script its words are written in (a Hebrew\n * page edited in English still gets Hebrew words) → the admin's language.\n */\nexport function pageWriteLocale(layout: ReadonlyArray<SerializedNode>, ctx: { readonly sentence: string; readonly stored?: string | null; readonly uiLang: string }): string {\n const stored = ctx.stored && LOCALE_SHAPE.test(ctx.stored) ? ctx.stored : null;\n const named = namedLocale(ctx.sentence, [...new Set([...(stored ? [stored] : []), ENGLISH, HEBREW])]);\n if (named) return named;\n if (stored) return stored;\n const words = pageTexts(layout).join(' ');\n const hebrew = (words.match(HEBREW_LETTER) ?? []).length;\n const latin = (words.match(LATIN_LETTER) ?? []).length;\n if (hebrew > latin) return HEBREW;\n if (latin > hebrew) return ctx.uiLang === HEBREW ? ENGLISH : ctx.uiLang;\n return ctx.uiLang;\n}\n","import { AROUND_TEXT_CHARS, MEMORY_TURNS } from './budget';\nimport { AssistIssue, AssistIssueCode, Brief, HandleMap } from './brief';\nimport type { SerializedNode } from '@vectoriox/iox-ui/generation-core';\n\nimport { FieldChange } from './field-edits';\nimport { FieldEdit } from './fields-schema';\nimport { WordChange, WordEdit } from './page-words';\nimport { ContentRecord, clipText } from './summarize-item';\nimport { AssistScope, AssistSurface, CommitKind, EditFamily, SURFACES, SurfaceStatus } from './surfaces';\n\n/**\n * The turn wire (plan §3d) — what cms-client posts and polls and iox-cms stores and answers, ONE definition both sides\n * import (generation-core `ai-run.ts` is the precedent for generations). A turn is a document on the jobs runner:\n * POST answers 202 `{ turnId }`, the client polls the turn every 750 ms until it is terminal.\n */\n\nexport enum AssistTurnStatus {\n Queued = 'queued',\n Routing = 'routing',\n Editing = 'editing',\n Done = 'done',\n Refused = 'refused',\n Failed = 'failed',\n}\n\nconst TERMINAL: ReadonlySet<AssistTurnStatus> = new Set([AssistTurnStatus.Done, AssistTurnStatus.Refused, AssistTurnStatus.Failed]);\n\nexport const isTerminalTurn = (status: AssistTurnStatus): boolean => TERMINAL.has(status);\n\n/** Auto = the step's model from Settings ▸ AI ▸ Models (A-D14). */\nexport const ASSIST_MODEL_AUTO = 'auto';\n\n/** `'auto'` or a model id. */\nexport type AssistModelChoice = typeof ASSIST_MODEL_AUTO | string;\n\nexport const ASSIST_POLL_MS = 750;\n\nexport const MAX_SENTENCE_CHARS = 2000;\n\nexport interface AssistTurnRequest {\n readonly surface: AssistSurface;\n /** `assistSessionKey(surface, target)`; the server adds the user. */\n readonly sessionKey: string;\n readonly sentence: string;\n readonly model: AssistModelChoice;\n readonly contentType?: string;\n readonly itemId?: string;\n readonly brief: Brief;\n readonly handles: HandleMap;\n /** A form-fill surface: the form's current values (it may be unsaved) — the edits are checked against them. */\n readonly values?: ContentRecord;\n /** Field keys the owner changed since the last AI turn — kept unless the sentence names them (rule 9). */\n readonly ownerEdited?: ReadonlyArray<string>;\n /** A builder surface: the page the turn is about. */\n readonly pageId?: string;\n /** A builder surface: the page's layout as the canvas holds it now (it may be unsaved) — the saved shape. */\n readonly layout?: ReadonlyArray<SerializedNode>;\n /** A builder surface: the selected node (\"this\"), or none. */\n readonly selectedId?: string | null;\n /** The focus rung the owner widened to (the chip's ✕); absent = what the selection gives. */\n readonly scope?: AssistScope;\n /** A builder surface: the page as the owner names it. */\n readonly page?: { readonly name: string; readonly route: string };\n}\n\n/** What a turn proposes, per family: a field's value (`fields`) or a part's words (`words`). */\nexport type AssistEdit = FieldEdit | WordEdit;\n\n/** What a turn changed, as the card says it. */\nexport type AssistChange = FieldChange | WordChange;\n\n/** POST's 202 answer. */\nexport interface AssistTurnAccepted {\n readonly turnId: string;\n}\n\n/** A turn's own refusals and failures, beside generation-core's `AiRefusalCode`s (credits, plan, key), which a turn returns as they are. */\nexport enum AssistRefusalCode {\n /** The turn machinery runs, no model is connected yet. */\n NotConnected = 'ai.assistNotConnected',\n /** The turn spent its own credit cap (trap T8) before a call it still needed. */\n TurnBudget = 'ai.assistTurnBudget',\n /** The routed families need a permission the person who asked does not hold. */\n Permission = 'ai.assistPermission',\n /** A process died during this turn's call more often than one resume allows. */\n Interrupted = 'ai.assistInterrupted',\n /** The provider call threw — the turn ends; the owner may ask again. */\n CallFailed = 'ai.assistCallFailed',\n /** The model's answer broke the check twice (the first time it was re-asked with the issues). */\n InvalidAnswer = 'ai.assistInvalidAnswer',\n /** The chosen model is not on the vetted list for this step, and the turn runs on IOX credits. */\n ModelNotOffered = 'ai.assistModelNotOffered',\n /** The chosen model cannot do the step (on the studio's own key any model may be typed; this one lacks a need). */\n ModelDeclined = 'ai.assistModelDeclined',\n}\n\nexport interface AssistTurnRefusal {\n /** An `AssistRefusalCode` or an `AiRefusalCode` — a string, so both fit. */\n readonly code: string;\n readonly message: string;\n}\n\nexport interface AssistTurn {\n readonly id: string;\n readonly surface: AssistSurface;\n readonly sessionKey: string;\n readonly status: AssistTurnStatus;\n readonly sentence: string;\n /** The model it ran on (Auto resolved) — the one the ledger row names (R-H11). */\n readonly model?: string;\n readonly families?: ReadonlyArray<EditFamily>;\n readonly reply?: string;\n readonly edits?: ReadonlyArray<AssistEdit>;\n readonly changes?: ReadonlyArray<AssistChange>;\n readonly kept?: ReadonlyArray<AssistChange>;\n readonly issues?: ReadonlyArray<AssistIssue>;\n readonly refusal?: AssistTurnRefusal;\n readonly credits?: number;\n /** ISO time. */\n readonly createdAt: string;\n}\n\nexport enum AssistRouteKey {\n Turns = 'turns',\n Turn = 'turn',\n Session = 'session',\n}\n\n/** The path templates, `:param` filled by `assistPath` — neither side hand-types a URL. */\nexport const ASSIST_ROUTES: Readonly<Record<AssistRouteKey, string>> = {\n [AssistRouteKey.Turns]: 'admin/api/org/:orgId/ai/assist/turns',\n [AssistRouteKey.Turn]: 'admin/api/org/:orgId/ai/assist/turns/:turnId',\n [AssistRouteKey.Session]: 'admin/api/org/:orgId/ai/assist/sessions/:sessionKey',\n};\n\nexport class AssistPathError extends Error {}\n\n/** A route with its params filled, each URL-encoded; a missing param throws. */\nexport function assistPath(route: AssistRouteKey, params: Readonly<Record<string, string>>): string {\n return ASSIST_ROUTES[route].replace(/:([A-Za-z]+)/g, (_, name: string) => {\n const value = params[name];\n if (!value) throw new AssistPathError(`${route}: no ${name}`);\n return encodeURIComponent(value);\n });\n}\n\n/** What a session is about, beside its surface (A-D9: per user × surface × target). */\nexport interface AssistTarget {\n readonly contentType?: string;\n readonly itemId?: string | null;\n readonly pageId?: string;\n readonly submissionId?: string;\n}\n\nconst SESSION_TARGET_KEYS: Readonly<Record<AssistSurface, ReadonlyArray<keyof AssistTarget>>> = {\n [AssistSurface.BuilderPage]: ['pageId'],\n [AssistSurface.ContentItem]: ['contentType', 'itemId'],\n [AssistSurface.ContentFromPhotos]: ['contentType'],\n [AssistSurface.ContentList]: ['contentType'],\n [AssistSurface.SchemaType]: ['contentType'],\n [AssistSurface.ShopProduct]: ['itemId'],\n [AssistSurface.Media]: [],\n [AssistSurface.BuilderSite]: [],\n [AssistSurface.FormInbox]: ['submissionId'],\n};\n\n/** A target not saved yet. */\nexport const NEW_TARGET = 'new';\nconst SESSION_SEPARATOR = ':';\n\n/** `contentItem:projects:<itemId|new>` — each part encoded, so a value never carries the separator. */\nexport function assistSessionKey(surface: AssistSurface, target: AssistTarget = {}): string {\n const parts = SESSION_TARGET_KEYS[surface].map(k => encodeURIComponent(target[k] || NEW_TARGET));\n return [surface, ...parts].join(SESSION_SEPARATOR);\n}\n\nexport interface AssistMemoryLine {\n readonly turnId: string;\n readonly createdAt: string;\n readonly line: string;\n}\n\nconst SENTENCE_IN_MEMORY_CHARS = 80;\n\nfunction outcome(turn: AssistTurn): string {\n const named = (list: ReadonlyArray<AssistChange> | undefined) =>\n (list ?? []).map(c => ('locale' in c && c.locale ? `${c.label} (${c.locale})` : c.label)).join(', ');\n switch (turn.status) {\n case AssistTurnStatus.Refused: return `refused: ${turn.refusal?.message ?? ''}`.trim();\n case AssistTurnStatus.Failed: return 'failed';\n case AssistTurnStatus.Done: {\n const changed = named(turn.changes);\n const kept = named(turn.kept);\n const head = changed ? `changed ${changed}` : `no change${turn.reply ? `: ${turn.reply}` : ''}`;\n return kept ? `${head}; kept ${kept} (the owner edited it)` : head;\n }\n default: return turn.status;\n }\n}\n\n/** One line the next turn reads as memory — never a tree, a record or a value. */\nexport function memoryLine(turn: AssistTurn): AssistMemoryLine {\n const asked = clipText(turn.sentence.replace(/\\s+/g, ' ').trim(), SENTENCE_IN_MEMORY_CHARS);\n return { turnId: turn.id, createdAt: turn.createdAt, line: clipText(`\"${asked}\" → ${outcome(turn)}`, AROUND_TEXT_CHARS) };\n}\n\n/** `GET …/ai/assist/sessions/:sessionKey` — the memory the next turn is sent. */\nexport interface AssistSession {\n readonly sessionKey: string;\n readonly lines: ReadonlyArray<AssistMemoryLine>;\n}\n\n/** A session's answer from its stored turns (those of another session are ignored). */\nexport function assistSession(sessionKey: string, turns: ReadonlyArray<AssistTurn>): AssistSession {\n return { sessionKey, lines: sessionMemory(turns.filter(t => t.sessionKey === sessionKey)) };\n}\n\n/** A session's memory: its last `MEMORY_TURNS` finished turns, oldest first. */\nexport function sessionMemory(turns: ReadonlyArray<AssistTurn>): AssistMemoryLine[] {\n return turns\n .filter(t => isTerminalTurn(t.status))\n .slice()\n .sort((a, b) => a.createdAt.localeCompare(b.createdAt))\n .slice(-MEMORY_TURNS)\n .map(memoryLine);\n}\n\nconst isObject = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object' && !Array.isArray(v);\nconst nonEmpty = (v: unknown): v is string => typeof v === 'string' && v.trim() !== '';\n\n/** Absent, or a list of non-empty field keys. */\nconst isOwnerEdited = (v: unknown): boolean => v === undefined || (Array.isArray(v) && v.every(nonEmpty));\n\n/** A key `assistSessionKey` made for this surface. */\nexport const isSessionOf = (key: unknown, surface: AssistSurface): boolean =>\n nonEmpty(key) && (key === surface || key.startsWith(`${surface}${SESSION_SEPARATOR}`));\n\n/** What the server refuses in a posted turn before anything runs. Empty = accepted. */\nexport function validateTurnRequest(req: unknown): AssistIssue[] {\n const issue = (code: AssistIssueCode, message: string): AssistIssue => ({ code, message });\n if (!isObject(req)) return [issue(AssistIssueCode.BadRequest, 'a turn is an object')];\n const surface = req['surface'] as AssistSurface;\n const spec = Object.prototype.hasOwnProperty.call(SURFACES, surface) ? SURFACES[surface] : undefined;\n if (!spec) return [issue(AssistIssueCode.UnknownSurface, `\"${String(surface)}\" is not a surface`)];\n const sentence = req['sentence'];\n const brief = req['brief'];\n return [\n ...(spec.status !== SurfaceStatus.Built ? [issue(AssistIssueCode.SurfaceNotBuilt, `${surface} is not built yet`)] : []),\n ...(!isSessionOf(req['sessionKey'], surface) ? [issue(AssistIssueCode.BadRequest, `the session key is not a ${surface} session`)] : []),\n ...(!nonEmpty(sentence) ? [issue(AssistIssueCode.EmptySentence, 'the sentence is empty')] : []),\n ...(nonEmpty(sentence) && sentence.length > MAX_SENTENCE_CHARS ? [issue(AssistIssueCode.SentenceTooLong, `the sentence is over ${MAX_SENTENCE_CHARS} characters`)] : []),\n ...(!nonEmpty(req['model']) ? [issue(AssistIssueCode.BadRequest, 'no model choice (auto or a model id)')] : []),\n ...(!isObject(brief) || brief['surface'] !== surface ? [issue(AssistIssueCode.BadRequest, `the brief is not a ${surface} brief`)] : []),\n ...(!isObject(req['handles']) || !Object.keys(req['handles']).length ? [issue(AssistIssueCode.MissingHandles, 'the brief\\'s handles are missing')] : []),\n ...(spec.commit === CommitKind.FormFill && !isObject(req['values']) ? [issue(AssistIssueCode.MissingValues, 'a form-fill turn carries the form\\'s values')] : []),\n ...(spec.commit === CommitKind.BuilderStep && (!Array.isArray(req['layout']) || !req['layout'].length || !req['layout'].every(isObject))\n ? [issue(AssistIssueCode.MissingValues, 'a builder turn carries the page\\'s layout')] : []),\n ...(spec.commit === CommitKind.BuilderStep && !nonEmpty(req['pageId']) ? [issue(AssistIssueCode.BadRequest, `${surface} names its page`)] : []),\n ...(!isOwnerEdited(req['ownerEdited']) ? [issue(AssistIssueCode.BadRequest, 'ownerEdited is a list of field keys')] : []),\n ...(spec.perContentType && !nonEmpty(req['contentType']) ? [issue(AssistIssueCode.BadRequest, `${surface} names its content type`)] : []),\n ];\n}\n","/**\n * @vectoriox/iox-ui/assist-core — the shared, FRAMEWORK-FREE vocabulary of AI Assist (iox-ai-guidance\n * `architecture/ai/ai-assist-plan.md` §3b): the surfaces and their specs, the brief and its handle map, the route\n * request, and family `fields` for surface S2 (one content item) — its brief (`summarizeItem`), its strict output format\n * (`fieldsJsonSchema`) and the ONE check that applies an answer (`applyFieldEdits`), run by iox-cms on a copy and by\n * cms-client as the trial — and family `words` for surface S1 (the builder, this page): `summarizePage`, `wordsJsonSchema`,\n * `applyWordEdits`, `pageSuggestions`. Every family's words pass ONE fact gate (`assistFactIssues` over generation-core's\n * `factIssues`, R-H2). Pure: no transport, no clock, no randomness.\n * ⚠️ Not re-exported from the main entry. Consumers wire the usual trio — ng-package raw-ts assets, jest\n * moduleNameMapper, tsconfig paths — or `nest start` dies with ERR_REQUIRE_ESM. It imports generation-core (the strict\n * schema builders and budget), so a consumer maps both.\n */\nexport * from './surfaces';\nexport * from './budget';\nexport * from './brief';\nexport * from './content-fields';\nexport * from './rich-text';\nexport * from './field-values';\nexport * from './summarize-item';\nexport * from './fields-schema';\nexport * from './route-schema';\nexport * from './assist-facts';\nexport * from './field-edits';\nexport * from './page-words';\nexport * from './assist-turn';\nexport * from './assist-locale';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["LIST_KINDS","split","isLeave"],"mappings":";;AAEA;;;;AAIG;IAES;AAAZ,CAAA,UAAY,aAAa,EAAA;AACrB,IAAA,aAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,aAAA,CAAA,aAAA,CAAA,GAAA,aAA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