@vectoriox/iox-ui 5.140.0 → 5.141.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.
@@ -1554,12 +1554,29 @@ interface AssistTarget {
1554
1554
  declare const NEW_TARGET = "new";
1555
1555
  /** `contentItem:projects:<itemId|new>` — each part encoded, so a value never carries the separator. */
1556
1556
  declare function assistSessionKey(surface: AssistSurface, target?: AssistTarget): string;
1557
+ /** What a remembered turn came to — the screen says it in the admin's language (iox-cms-client#85: the thread showed the
1558
+ * model's English "no change" on a Hebrew screen). */
1559
+ declare enum AssistMemoryOutcome {
1560
+ Changed = "changed",
1561
+ NoChange = "noChange",
1562
+ Drafted = "drafted",
1563
+ Refused = "refused",
1564
+ Failed = "failed",
1565
+ /** Still running, or a status this list does not name. */
1566
+ Other = "other"
1567
+ }
1557
1568
  interface AssistMemoryLine {
1558
1569
  readonly turnId: string;
1559
1570
  readonly createdAt: string;
1571
+ /** The line the NEXT TURN reads (the model's memory, English) — never shown to the owner as it is. */
1560
1572
  readonly line: string;
1573
+ /** What the owner asked, clipped as in `line`. */
1574
+ readonly asked?: string;
1575
+ /** What it came to, and how many things changed / were drafted — for the screen. */
1576
+ readonly outcome?: AssistMemoryOutcome;
1577
+ readonly count?: number;
1561
1578
  }
1562
- /** One line the next turn reads as memory — never a tree, a record or a value. */
1579
+ /** One line the next turn reads as memory — never a tree, a record or a value — and what the screen says of it. */
1563
1580
  declare function memoryLine(turn: AssistTurn): AssistMemoryLine;
1564
1581
  /** `GET …/ai/assist/sessions/:sessionKey` — the memory the next turn is sent. */
1565
1582
  interface AssistSession {
@@ -1595,5 +1612,5 @@ declare function turnLocale(sentence: string, fields: ReadonlyArray<AssistField>
1595
1612
  /** The language's own name in the admin's language (`en` → "English" / "אנגלית"). */
1596
1613
  declare const languageName: (locale: string, uiLang: string) => string;
1597
1614
 
1598
- export { AI_DRAFT_SOURCE, AROUND_ITEMS_MAX, AROUND_TEXT_CHARS, ASK_SECTION_PATTERNS, ASK_STYLE_SETS, ASSIST_MODEL_AUTO, ASSIST_POLL_MS, ASSIST_ROUTES, AssistBriefError, AssistBudgetError, AssistFieldKind, AssistHandOff, AssistIssueCode, AssistPathError, AssistPermission, AssistRefusalCode, AssistRouteKey, AssistRunStatus, AssistScope, AssistStep, AssistSurface, AssistTurnStatus, BOOLEAN_FALSE, BOOLEAN_TRUE, CommitKind, EditFamily, FIELDS_PER_PART, FIELD_HANDLE_PREFIX, FOCUS_TEXT_CHARS, FieldsAnswerKey, ItemSuggestionKind, LOCALE_NAME_LANGUAGES, LOOK_AXES, LOOK_AXIS_LABELS, LOOK_KEEP, LookAnswerKey, LookAxis, LookButtons, MAX_ASSIST_PHOTOS, MAX_ASSIST_PROPERTIES, MAX_ROUTE_PROPERTIES, MAX_SENTENCE_CHARS, MEMORY_TURNS, MODE_LABELS, NEW_TARGET, NONE_TEXT, NeverWriteReason, OWNER_FILL_MAX_CHARS, PAGE_WORD_SLOTS, PHOTOS_PER_READ, PHOTO_GROUP_HANDLE_PREFIX, PageChangeOp, PagePartKind, PageSuggestionKind, PhotoAnswerKey, PhotoGrouping, RouteAnswerKey, SECTION_START, SHORTEN_FROM_CHARS, SHORTEN_HEADING_FROM_CHARS, SHORTEN_TEXT_FROM_CHARS, SIBLING_HANDLE_PREFIX, SURFACES, SectionChangeKind, SectionsAnswerKey, StyleAnswerKey, SurfaceStatus, ValueSource, WORDS_PER_PART, WordsAnswerKey, adjustAxesOf, aiDraftStamp, applyFieldEdits, applyLookEdits, applyPageEdits, applySectionEdits, applyStyleEdits, applyWordEdits, askSectionPatternNames, askableStyles, assertAssistBudget, assistBudgetIssues, assistFactIssues, assistFields, assistPath, assistSession, assistSessionKey, builtSurfaces, clipText, commitOf, containsHtml, decodeFieldsAnswers, decodeLookAnswers, decodePhotoDraftAnswers, decodeSectionsAnswers, decodeStyleAnswers, decodeWordsAnswers, draftFromPhotos, escapeText, fieldHandle, fieldsJsonSchema, fieldsNamedIn, groupPhotos, isAiDraft, isEmptyFieldValue, isPlainRecord, isRunBusy, isSchemeEdit, isSectionEdit, isSessionOf, isSiteLookEdit, isSizeEdit, isStyleEdit, isTerminalTurn, isWritable, itemLocales, itemSuggestions, languageName, lookAxisValue, lookHex, lookJsonSchema, lookNames, memoryLine, namedLocale, ownerFillFields, ownerFillIssues, pageLooks, pageSuggestions, pageWriteLocale, paragraphsToRichText, photoDraftJsonSchema, photoGroupBrief, photoGroupHandle, photoReadCount, photoSlots, primaryLocale, readFieldValue, readLocaleValues, readRoute, readableWords, resolveHandle, richTextParagraphs, routeJsonSchema, sectionLabel, sectionPatternOf, sectionsJsonSchema, serializedBaselineStyles, sessionMemory, styleJsonSchema, suggestPhotoType, summarizeItem, summarizeLook, summarizePage, summarizePhotos, surfacePermissions, surfaceSpec, surfaceUndoPermissions, takesPhotos, titleField, turnLocale, unknownHandles, validateRunRequest, validateTurnRequest, withOwnerFill, wordsJsonSchema };
1615
+ export { AI_DRAFT_SOURCE, AROUND_ITEMS_MAX, AROUND_TEXT_CHARS, ASK_SECTION_PATTERNS, ASK_STYLE_SETS, ASSIST_MODEL_AUTO, ASSIST_POLL_MS, ASSIST_ROUTES, AssistBriefError, AssistBudgetError, AssistFieldKind, AssistHandOff, AssistIssueCode, AssistMemoryOutcome, AssistPathError, AssistPermission, AssistRefusalCode, AssistRouteKey, AssistRunStatus, AssistScope, AssistStep, AssistSurface, AssistTurnStatus, BOOLEAN_FALSE, BOOLEAN_TRUE, CommitKind, EditFamily, FIELDS_PER_PART, FIELD_HANDLE_PREFIX, FOCUS_TEXT_CHARS, FieldsAnswerKey, ItemSuggestionKind, LOCALE_NAME_LANGUAGES, LOOK_AXES, LOOK_AXIS_LABELS, LOOK_KEEP, LookAnswerKey, LookAxis, LookButtons, MAX_ASSIST_PHOTOS, MAX_ASSIST_PROPERTIES, MAX_ROUTE_PROPERTIES, MAX_SENTENCE_CHARS, MEMORY_TURNS, MODE_LABELS, NEW_TARGET, NONE_TEXT, NeverWriteReason, OWNER_FILL_MAX_CHARS, PAGE_WORD_SLOTS, PHOTOS_PER_READ, PHOTO_GROUP_HANDLE_PREFIX, PageChangeOp, PagePartKind, PageSuggestionKind, PhotoAnswerKey, PhotoGrouping, RouteAnswerKey, SECTION_START, SHORTEN_FROM_CHARS, SHORTEN_HEADING_FROM_CHARS, SHORTEN_TEXT_FROM_CHARS, SIBLING_HANDLE_PREFIX, SURFACES, SectionChangeKind, SectionsAnswerKey, StyleAnswerKey, SurfaceStatus, ValueSource, WORDS_PER_PART, WordsAnswerKey, adjustAxesOf, aiDraftStamp, applyFieldEdits, applyLookEdits, applyPageEdits, applySectionEdits, applyStyleEdits, applyWordEdits, askSectionPatternNames, askableStyles, assertAssistBudget, assistBudgetIssues, assistFactIssues, assistFields, assistPath, assistSession, assistSessionKey, builtSurfaces, clipText, commitOf, containsHtml, decodeFieldsAnswers, decodeLookAnswers, decodePhotoDraftAnswers, decodeSectionsAnswers, decodeStyleAnswers, decodeWordsAnswers, draftFromPhotos, escapeText, fieldHandle, fieldsJsonSchema, fieldsNamedIn, groupPhotos, isAiDraft, isEmptyFieldValue, isPlainRecord, isRunBusy, isSchemeEdit, isSectionEdit, isSessionOf, isSiteLookEdit, isSizeEdit, isStyleEdit, isTerminalTurn, isWritable, itemLocales, itemSuggestions, languageName, lookAxisValue, lookHex, lookJsonSchema, lookNames, memoryLine, namedLocale, ownerFillFields, ownerFillIssues, pageLooks, pageSuggestions, pageWriteLocale, paragraphsToRichText, photoDraftJsonSchema, photoGroupBrief, photoGroupHandle, photoReadCount, photoSlots, primaryLocale, readFieldValue, readLocaleValues, readRoute, readableWords, resolveHandle, richTextParagraphs, routeJsonSchema, sectionLabel, sectionPatternOf, sectionsJsonSchema, serializedBaselineStyles, sessionMemory, styleJsonSchema, suggestPhotoType, summarizeItem, summarizeLook, summarizePage, summarizePhotos, surfacePermissions, surfaceSpec, surfaceUndoPermissions, takesPhotos, titleField, turnLocale, unknownHandles, validateRunRequest, validateTurnRequest, withOwnerFill, wordsJsonSchema };
1599
1616
  export type { AiDraftStamp, AssistChange, AssistEdit, AssistField, AssistIssue, AssistMemoryLine, AssistModelChoice, AssistPhoto, AssistRoute, AssistRunRequest, AssistRunView, AssistSession, AssistTarget, AssistTurn, AssistTurnAccepted, AssistTurnProgress, AssistTurnRefusal, AssistTurnRequest, AssistWordContext, BaselineStyles, Brief, BriefRules, BriefValue, ContentControllerDef, ContentPropertyDef, ContentRecord, ContentTypeSchema, DraftValue, FieldChange, FieldEdit, FieldEditContext, FieldEditsOutcome, FieldsSchemaExtra, FieldsSchemaOptions, FieldsSchemas, HandleMap, HandleResolution, HandleTarget, ItemAround, ItemBrief, ItemBriefContext, ItemBriefField, ItemFocus, ItemSuggestion, ItemSummary, KeptDraft, LookEditsOutcome, LookMap, LookSchemas, LookSummary, LookTarget, NeverWrite, NodeStyleEdit, PageAround, PageBrief, PageBriefContext, PageChange, PageEdit, PageEditContext, PageEditsOutcome, PageFocus, PageLook, PagePart, PageSectionSummary, PageSuggestion, PhotoBriefField, PhotoDraft, PhotoDraftAnswer, PhotoDraftContext, PhotoDraftOutcome, PhotoGroup, PhotoSlots, PhotosAround, PhotosBrief, PhotosBriefContext, PhotosFocus, SchemeEdit, SectionAdd, SectionChange, SectionEdit, SectionEditContext, SectionEditsOutcome, SectionMap, SectionMove, SectionRemove, SectionSwap, SectionTarget, SiteLookChange, SiteLookEdit, SizeEdit, StyleChange, StyleEdit, StyleEditContext, StyleEditsOutcome, StyleSchemas, SummarizedItem, SummarizedPage, SummarizedPhotos, SurfaceSpec, WalkedLook, WordChange, WordEdit, WordEditContext, WordEditsOutcome, WordsSchemas, WrittenWords };
@@ -2835,6 +2835,18 @@ function assistSessionKey(surface, target = {}) {
2835
2835
  const parts = SESSION_TARGET_KEYS[surface].map(k => encodeURIComponent(target[k] || NEW_TARGET));
2836
2836
  return [surface, ...parts].join(SESSION_SEPARATOR);
2837
2837
  }
2838
+ /** What a remembered turn came to — the screen says it in the admin's language (iox-cms-client#85: the thread showed the
2839
+ * model's English "no change" on a Hebrew screen). */
2840
+ var AssistMemoryOutcome;
2841
+ (function (AssistMemoryOutcome) {
2842
+ AssistMemoryOutcome["Changed"] = "changed";
2843
+ AssistMemoryOutcome["NoChange"] = "noChange";
2844
+ AssistMemoryOutcome["Drafted"] = "drafted";
2845
+ AssistMemoryOutcome["Refused"] = "refused";
2846
+ AssistMemoryOutcome["Failed"] = "failed";
2847
+ /** Still running, or a status this list does not name. */
2848
+ AssistMemoryOutcome["Other"] = "other";
2849
+ })(AssistMemoryOutcome || (AssistMemoryOutcome = {}));
2838
2850
  const SENTENCE_IN_MEMORY_CHARS = 80;
2839
2851
  function outcome(turn) {
2840
2852
  const named = (list) => (list ?? []).map(c => (isLookChange(c) ? `${c.label} → ${c.after}` : 'locale' in c && c.locale ? `${c.label} (${c.locale})` : c.label)).join(', ');
@@ -2852,10 +2864,24 @@ function outcome(turn) {
2852
2864
  default: return turn.status;
2853
2865
  }
2854
2866
  }
2855
- /** One line the next turn reads as memory — never a tree, a record or a value. */
2867
+ /** What a turn came to, for the screen (`AssistMemoryLine.outcome`). */
2868
+ function outcomeKind(turn) {
2869
+ switch (turn.status) {
2870
+ case AssistTurnStatus.Refused: return { outcome: AssistMemoryOutcome.Refused, count: 0 };
2871
+ case AssistTurnStatus.Failed: return { outcome: AssistMemoryOutcome.Failed, count: 0 };
2872
+ case AssistTurnStatus.Done: {
2873
+ if (turn.drafts?.length)
2874
+ return { outcome: AssistMemoryOutcome.Drafted, count: turn.drafts.length };
2875
+ const changed = turn.changes?.length ?? 0;
2876
+ return { outcome: changed ? AssistMemoryOutcome.Changed : AssistMemoryOutcome.NoChange, count: changed };
2877
+ }
2878
+ default: return { outcome: AssistMemoryOutcome.Other, count: 0 };
2879
+ }
2880
+ }
2881
+ /** One line the next turn reads as memory — never a tree, a record or a value — and what the screen says of it. */
2856
2882
  function memoryLine(turn) {
2857
2883
  const asked = clipText(turn.sentence.replace(/\s+/g, ' ').trim(), SENTENCE_IN_MEMORY_CHARS);
2858
- return { turnId: turn.id, createdAt: turn.createdAt, line: clipText(`"${asked}" → ${outcome(turn)}`, AROUND_TEXT_CHARS) };
2884
+ return { turnId: turn.id, createdAt: turn.createdAt, line: clipText(`"${asked}" → ${outcome(turn)}`, AROUND_TEXT_CHARS), asked, ...outcomeKind(turn) };
2859
2885
  }
2860
2886
  /** A session's answer from its stored turns (those of another session are ignored). */
2861
2887
  function assistSession(sessionKey, turns) {
@@ -2944,5 +2970,5 @@ function validateTurnRequest(req) {
2944
2970
  * Generated bundle index. Do not edit.
2945
2971
  */
2946
2972
 
2947
- export { AI_DRAFT_SOURCE, AROUND_ITEMS_MAX, AROUND_TEXT_CHARS, ASK_SECTION_PATTERNS, ASK_STYLE_SETS, ASSIST_MODEL_AUTO, ASSIST_POLL_MS, ASSIST_ROUTES, AssistBriefError, AssistBudgetError, AssistFieldKind, AssistHandOff, AssistIssueCode, AssistPathError, AssistPermission, AssistRefusalCode, AssistRouteKey, AssistRunStatus, AssistScope, AssistStep, AssistSurface, AssistTurnStatus, BOOLEAN_FALSE, BOOLEAN_TRUE, CommitKind, EditFamily, FIELDS_PER_PART, FIELD_HANDLE_PREFIX, FOCUS_TEXT_CHARS, FieldsAnswerKey, ItemSuggestionKind, LOCALE_NAME_LANGUAGES, LOOK_AXES, LOOK_AXIS_LABELS, LOOK_KEEP, LookAnswerKey, LookAxis, LookButtons, MAX_ASSIST_PHOTOS, MAX_ASSIST_PROPERTIES, MAX_ROUTE_PROPERTIES, MAX_SENTENCE_CHARS, MEMORY_TURNS, MODE_LABELS, NEW_TARGET, NONE_TEXT, NeverWriteReason, OWNER_FILL_MAX_CHARS, PAGE_WORD_SLOTS, PHOTOS_PER_READ, PHOTO_GROUP_HANDLE_PREFIX, PageChangeOp, PagePartKind, PageSuggestionKind, PhotoAnswerKey, PhotoGrouping, RouteAnswerKey, SECTION_START, SHORTEN_FROM_CHARS, SHORTEN_HEADING_FROM_CHARS, SHORTEN_TEXT_FROM_CHARS, SIBLING_HANDLE_PREFIX, SURFACES, SectionChangeKind, SectionsAnswerKey, StyleAnswerKey, SurfaceStatus, ValueSource, WORDS_PER_PART, WordsAnswerKey, adjustAxesOf, aiDraftStamp, applyFieldEdits, applyLookEdits, applyPageEdits, applySectionEdits, applyStyleEdits, applyWordEdits, askSectionPatternNames, askableStyles, assertAssistBudget, assistBudgetIssues, assistFactIssues, assistFields, assistPath, assistSession, assistSessionKey, builtSurfaces, clipText, commitOf, containsHtml, decodeFieldsAnswers, decodeLookAnswers, decodePhotoDraftAnswers, decodeSectionsAnswers, decodeStyleAnswers, decodeWordsAnswers, draftFromPhotos, escapeText, fieldHandle, fieldsJsonSchema, fieldsNamedIn, groupPhotos, isAiDraft, isEmptyFieldValue, isPlainRecord, isRunBusy, isSchemeEdit, isSectionEdit, isSessionOf, isSiteLookEdit, isSizeEdit, isStyleEdit, isTerminalTurn, isWritable, itemLocales, itemSuggestions, languageName, lookAxisValue, lookHex, lookJsonSchema, lookNames, memoryLine, namedLocale, ownerFillFields, ownerFillIssues, pageLooks, pageSuggestions, pageWriteLocale, paragraphsToRichText, photoDraftJsonSchema, photoGroupBrief, photoGroupHandle, photoReadCount, photoSlots, primaryLocale, readFieldValue, readLocaleValues, readRoute, readableWords, resolveHandle, richTextParagraphs, routeJsonSchema, sectionLabel, sectionPatternOf, sectionsJsonSchema, serializedBaselineStyles, sessionMemory, styleJsonSchema, suggestPhotoType, summarizeItem, summarizeLook, summarizePage, summarizePhotos, surfacePermissions, surfaceSpec, surfaceUndoPermissions, takesPhotos, titleField, turnLocale, unknownHandles, validateRunRequest, validateTurnRequest, withOwnerFill, wordsJsonSchema };
2973
+ export { AI_DRAFT_SOURCE, AROUND_ITEMS_MAX, AROUND_TEXT_CHARS, ASK_SECTION_PATTERNS, ASK_STYLE_SETS, ASSIST_MODEL_AUTO, ASSIST_POLL_MS, ASSIST_ROUTES, AssistBriefError, AssistBudgetError, AssistFieldKind, AssistHandOff, AssistIssueCode, AssistMemoryOutcome, AssistPathError, AssistPermission, AssistRefusalCode, AssistRouteKey, AssistRunStatus, AssistScope, AssistStep, AssistSurface, AssistTurnStatus, BOOLEAN_FALSE, BOOLEAN_TRUE, CommitKind, EditFamily, FIELDS_PER_PART, FIELD_HANDLE_PREFIX, FOCUS_TEXT_CHARS, FieldsAnswerKey, ItemSuggestionKind, LOCALE_NAME_LANGUAGES, LOOK_AXES, LOOK_AXIS_LABELS, LOOK_KEEP, LookAnswerKey, LookAxis, LookButtons, MAX_ASSIST_PHOTOS, MAX_ASSIST_PROPERTIES, MAX_ROUTE_PROPERTIES, MAX_SENTENCE_CHARS, MEMORY_TURNS, MODE_LABELS, NEW_TARGET, NONE_TEXT, NeverWriteReason, OWNER_FILL_MAX_CHARS, PAGE_WORD_SLOTS, PHOTOS_PER_READ, PHOTO_GROUP_HANDLE_PREFIX, PageChangeOp, PagePartKind, PageSuggestionKind, PhotoAnswerKey, PhotoGrouping, RouteAnswerKey, SECTION_START, SHORTEN_FROM_CHARS, SHORTEN_HEADING_FROM_CHARS, SHORTEN_TEXT_FROM_CHARS, SIBLING_HANDLE_PREFIX, SURFACES, SectionChangeKind, SectionsAnswerKey, StyleAnswerKey, SurfaceStatus, ValueSource, WORDS_PER_PART, WordsAnswerKey, adjustAxesOf, aiDraftStamp, applyFieldEdits, applyLookEdits, applyPageEdits, applySectionEdits, applyStyleEdits, applyWordEdits, askSectionPatternNames, askableStyles, assertAssistBudget, assistBudgetIssues, assistFactIssues, assistFields, assistPath, assistSession, assistSessionKey, builtSurfaces, clipText, commitOf, containsHtml, decodeFieldsAnswers, decodeLookAnswers, decodePhotoDraftAnswers, decodeSectionsAnswers, decodeStyleAnswers, decodeWordsAnswers, draftFromPhotos, escapeText, fieldHandle, fieldsJsonSchema, fieldsNamedIn, groupPhotos, isAiDraft, isEmptyFieldValue, isPlainRecord, isRunBusy, isSchemeEdit, isSectionEdit, isSessionOf, isSiteLookEdit, isSizeEdit, isStyleEdit, isTerminalTurn, isWritable, itemLocales, itemSuggestions, languageName, lookAxisValue, lookHex, lookJsonSchema, lookNames, memoryLine, namedLocale, ownerFillFields, ownerFillIssues, pageLooks, pageSuggestions, pageWriteLocale, paragraphsToRichText, photoDraftJsonSchema, photoGroupBrief, photoGroupHandle, photoReadCount, photoSlots, primaryLocale, readFieldValue, readLocaleValues, readRoute, readableWords, resolveHandle, richTextParagraphs, routeJsonSchema, sectionLabel, sectionPatternOf, sectionsJsonSchema, serializedBaselineStyles, sessionMemory, styleJsonSchema, suggestPhotoType, summarizeItem, summarizeLook, summarizePage, summarizePhotos, surfacePermissions, surfaceSpec, surfaceUndoPermissions, takesPhotos, titleField, turnLocale, unknownHandles, validateRunRequest, validateTurnRequest, withOwnerFill, wordsJsonSchema };
2948
2974
  //# sourceMappingURL=vectoriox-iox-ui-assist-core.mjs.map