@freecallai/pro 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +23 -17
  2. package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang-xR8ZhhdJ.js +187 -0
  3. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-CaHRIHab.js +4864 -0
  4. package/dist/KnowledgeArea-_rsydhnt.js +1438 -0
  5. package/dist/{ToolForm-CWpUIVTl.js → ToolForm-Czg67cDT.js} +1 -1
  6. package/dist/{choice-DDg5gNtS.js → choice-Bt2xhoN_.js} +1 -1
  7. package/dist/edition-info/index.js +4 -0
  8. package/dist/filters/index.js +7 -0
  9. package/dist/guard-B7U3S4F1.js +1163 -0
  10. package/dist/{index-D8bcFtWR.js → index-9NM1SHoR.js} +1 -1
  11. package/dist/index-B4-2_sJI.js +10 -0
  12. package/dist/{index-DOEijEGU.js → index-BBv72oZe.js} +10 -10
  13. package/dist/index-BF6MRSMb.js +6 -0
  14. package/dist/index-BQrYBmwR.js +5 -0
  15. package/dist/index-CS2xQQ8W.js +168 -0
  16. package/dist/index-D0bJAQSN.js +327 -0
  17. package/dist/index-D9yqpH_4.js +57 -0
  18. package/dist/index-DCmHHi07.js +71 -0
  19. package/dist/index-DYeJRJY1.js +6 -0
  20. package/dist/{index-CJlAseSN.js → index-DnaEbb6l.js} +1 -1
  21. package/dist/{index-DSgEWJGP.js → index-Dy2Gy3bL.js} +1 -1
  22. package/dist/index-lNhA3N9x.js +379 -0
  23. package/dist/{index-5a9mHHzg.js → index-sjDmbR5o.js} +1 -1
  24. package/dist/index-trxE5T0w.js +6 -0
  25. package/dist/index-uCVrA6xK.js +5 -0
  26. package/dist/index.js +36 -11
  27. package/dist/inline-KPGqYMIR.js +19 -0
  28. package/dist/knowledge-CupkY2rK.js +6 -0
  29. package/dist/{knowledge-DnYGicjn.js → knowledge-DzwXQR-q.js} +1 -1
  30. package/dist/knowledge-type-picker/index.js +5 -0
  31. package/dist/media-extensions-DhRlLKYM.js +321 -0
  32. package/dist/{media-migration-CGOFwdYm.js → media-migration-CbMT2wS0.js} +1 -1
  33. package/dist/{media-upload-Dx45yv6a.js → media-upload-P9WeUHHr.js} +1 -1
  34. package/dist/navigation/index.js +4 -0
  35. package/dist/operations-D8pn-_iW.js +20 -0
  36. package/dist/{question-DGC6JHy5.js → question-C7akkjHn.js} +1 -1
  37. package/dist/{question-D1--acV8.js → question-DXZ8R-34.js} +1 -1
  38. package/dist/rich-text/index.js +57 -53
  39. package/dist/rich-text/legacy-converter/index.js +1271 -340
  40. package/dist/style.css +1 -1
  41. package/dist/switcher/index.js +4 -0
  42. package/dist/types/edition-info/FkpEditionInfo.vue.d.ts +5 -0
  43. package/dist/types/edition-info/index.d.ts +2 -0
  44. package/dist/types/edition-info/types.d.ts +5 -0
  45. package/dist/types/filters/FkpFilter.vue.d.ts +20 -0
  46. package/dist/types/filters/FkpFilterDateRange.vue.d.ts +13 -0
  47. package/dist/types/filters/FkpFilterPeriod.vue.d.ts +17 -0
  48. package/dist/types/filters/FkpSearchableMultiSelect.vue.d.ts +44 -0
  49. package/dist/types/filters/index.d.ts +5 -0
  50. package/dist/types/filters/selection.d.ts +5 -0
  51. package/dist/types/filters/types.d.ts +30 -0
  52. package/dist/types/index.d.ts +7 -1
  53. package/dist/types/knowledge-type-picker/index.d.ts +3 -0
  54. package/dist/types/navigation/FkpNavigation.vue.d.ts +51 -0
  55. package/dist/types/navigation/index.d.ts +2 -0
  56. package/dist/types/navigation/types.d.ts +15 -0
  57. package/dist/types/rich-text/FkpRichText.vue.d.ts +31 -7
  58. package/dist/types/rich-text/__demo__/conversion-fixtures.d.ts +2 -2
  59. package/dist/types/rich-text/__demo__/reasoning-template-examples.d.ts +11 -0
  60. package/dist/types/rich-text/config/descriptor.d.ts +25 -2
  61. package/dist/types/rich-text/config/resolve.d.ts +2 -0
  62. package/dist/types/rich-text/index.d.ts +3 -1
  63. package/dist/types/rich-text/legacy-converter/agent-prompt-preview.d.ts +2 -0
  64. package/dist/types/rich-text/legacy-converter/business-attribute.d.ts +12 -0
  65. package/dist/types/rich-text/legacy-converter/index.d.ts +8 -0
  66. package/dist/types/rich-text/legacy-converter/tool-contract.d.ts +1 -0
  67. package/dist/types/rich-text/model/guard.d.ts +2 -1
  68. package/dist/types/rich-text/model/node-contract.d.ts +3 -5
  69. package/dist/types/rich-text/model/node-identity.d.ts +7 -1
  70. package/dist/types/rich-text/model/question-text.d.ts +2 -4
  71. package/dist/types/rich-text/plugins/attribute/token.d.ts +9 -0
  72. package/dist/types/rich-text/plugins/operations.d.ts +9 -0
  73. package/dist/types/rich-text/plugins/reasoningTemplate/defaults.d.ts +14 -0
  74. package/dist/types/rich-text/plugins/reasoningTemplate/examples.d.ts +9 -0
  75. package/dist/types/rich-text/plugins/separator/token.d.ts +2 -0
  76. package/dist/types/rich-text/plugins/tableKnowledge/descriptor.d.ts +2 -0
  77. package/dist/types/rich-text/plugins/tableKnowledge/index.d.ts +2 -0
  78. package/dist/types/rich-text/plugins/tableKnowledge/token.d.ts +9 -0
  79. package/dist/types/rich-text/plugins/ticket/protocol.d.ts +8 -0
  80. package/dist/types/rich-text/plugins/ticket/token.d.ts +9 -0
  81. package/dist/types/rich-text/plugins/todo/token.d.ts +3 -0
  82. package/dist/types/rich-text/plugins/token-catalog.d.ts +46 -0
  83. package/dist/types/rich-text/plugins/token-definition.d.ts +24 -0
  84. package/dist/types/rich-text/plugins/tool/presentation.d.ts +2 -1
  85. package/dist/types/rich-text/plugins/tool/protocol.d.ts +5 -0
  86. package/dist/types/rich-text/plugins/tool/rules.d.ts +35 -0
  87. package/dist/types/rich-text/plugins/tool/token.d.ts +2 -0
  88. package/dist/types/rich-text/plugins/variable/token.d.ts +2 -0
  89. package/dist/types/rich-text/public/types.d.ts +73 -6
  90. package/dist/types/rich-text/runtime/action-ports.d.ts +6 -1
  91. package/dist/types/rich-text/runtime/file-drop-guard.d.ts +2 -0
  92. package/dist/types/rich-text/runtime/knowledge-clipboard.d.ts +16 -0
  93. package/dist/types/rich-text/runtime/media-policy.d.ts +15 -0
  94. package/dist/types/rich-text/runtime/media-target.d.ts +3 -0
  95. package/dist/types/rich-text/runtime/media-upload-session.d.ts +5 -1
  96. package/dist/types/rich-text/runtime/media-upload-slots.d.ts +4 -0
  97. package/dist/types/rich-text/runtime/schema-plan.d.ts +1 -0
  98. package/dist/types/rich-text/types.d.ts +3 -40
  99. package/dist/types/rich-text/ui/FkpKnowledgeTypePicker.vue.d.ts +38 -0
  100. package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +12 -1
  101. package/dist/types/rich-text/ui/knowledge-type-picker-types.d.ts +14 -0
  102. package/dist/types/rich-text/ui/token-renderer.d.ts +5 -0
  103. package/dist/types/switcher/FkpSwitcher.vue.d.ts +52 -0
  104. package/dist/types/switcher/index.d.ts +2 -0
  105. package/dist/types/switcher/types.d.ts +7 -0
  106. package/package.json +26 -6
  107. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-DnknqQTh.js +0 -4115
  108. package/dist/KnowledgeArea-OPR7smbt.js +0 -923
  109. package/dist/guard-BCatAeT4.js +0 -749
  110. package/dist/index-BsQLwz91.js +0 -5
  111. package/dist/index-CzpY61Qj.js +0 -6
  112. package/dist/index-DxxX09iY.js +0 -6
  113. package/dist/index-nnvfy5q0.js +0 -31
  114. package/dist/index-urNonkMH.js +0 -6
  115. package/dist/index-xAjlBylT.js +0 -5
  116. package/dist/inline-TT_dl8Y3.js +0 -17
  117. package/dist/knowledge-BZCmalF_.js +0 -6
  118. package/dist/media-extensions-ZoxmhIhH.js +0 -276
  119. package/dist/operations-JgnjGx3H.js +0 -19
@@ -0,0 +1,51 @@
1
+ import { ProNavItem, ProNavGroup } from './types';
2
+ type __VLS_Props = {
3
+ products: ProNavItem[];
4
+ groups?: ProNavGroup[];
5
+ productOrder?: string[];
6
+ selectedKey?: string;
7
+ collapsed?: boolean;
8
+ };
9
+ declare function __VLS_template(): {
10
+ attrs: Partial<{}>;
11
+ slots: {
12
+ 'product-icon'?(_: {
13
+ item: any;
14
+ }): any;
15
+ 'product-icon'?(_: {
16
+ item: ProNavItem;
17
+ }): any;
18
+ 'product-icon'?(_: {
19
+ item: ProNavItem;
20
+ }): any;
21
+ };
22
+ refs: {
23
+ editButton: HTMLButtonElement;
24
+ };
25
+ rootEl: HTMLElement;
26
+ };
27
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
28
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
29
+ open: (key: string, item: ProNavItem) => any;
30
+ select: (key: string) => any;
31
+ "update:productOrder": (order: string[]) => any;
32
+ orderChange: (order: string[]) => any;
33
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
34
+ onOpen?: ((key: string, item: ProNavItem) => any) | undefined;
35
+ onSelect?: ((key: string) => any) | undefined;
36
+ "onUpdate:productOrder"?: ((order: string[]) => any) | undefined;
37
+ onOrderChange?: ((order: string[]) => any) | undefined;
38
+ }>, {
39
+ groups: ProNavGroup[];
40
+ productOrder: string[];
41
+ collapsed: boolean;
42
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
43
+ editButton: HTMLButtonElement;
44
+ }, HTMLElement>;
45
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
46
+ export default _default;
47
+ type __VLS_WithTemplateSlots<T, S> = T & {
48
+ new (): {
49
+ $slots: S;
50
+ };
51
+ };
@@ -0,0 +1,2 @@
1
+ export { default as FkpNavigation } from './FkpNavigation.vue';
2
+ export type { ProNavItem, ProNavGroup } from './types';
@@ -0,0 +1,15 @@
1
+ import { FkpIconName } from '@freecallai/icons';
2
+ export interface ProNavItem {
3
+ key: string;
4
+ label: string;
5
+ icon?: FkpIconName;
6
+ iconUrl?: string;
7
+ disabled?: boolean;
8
+ /** Show a hover affordance and emit open instead of select. The host owns navigation. */
9
+ opensInNewTab?: boolean;
10
+ }
11
+ export interface ProNavGroup extends ProNavItem {
12
+ children: ProNavItem[];
13
+ }
14
+ /** Ignore stale/duplicate saved keys and append newly authorized products. */
15
+ export declare function resolveProductOrder(products: ProNavItem[], order: string[]): ProNavItem[];
@@ -2,39 +2,47 @@ import { JSONContent } from '@tiptap/core';
2
2
  import { ChoiceTokenKind } from './model/node-contract';
3
3
  import { MediaTarget } from './runtime/media-target';
4
4
  import { PluginPlan } from './runtime/operations';
5
- import { CapabilityId, ChangeMeta, EditorDiagnostic, FkpRichTextProps, KnowledgeSceneV1 } from './public/types';
5
+ import { CapabilityId, AddKnowledgeSceneRequest, ChangeMeta, EditorDiagnostic, FkpRichTextProps, RichTextInsertInput, RichTextInsertResult, KnowledgeSceneV1 } from './public/types';
6
6
  declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
7
7
  undoTypeSwitch(): boolean;
8
+ insertContent(input: RichTextInsertInput): Promise<RichTextInsertResult>;
8
9
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
- delete: () => any;
10
+ change: (scene: KnowledgeSceneV1, meta: ChangeMeta) => any;
10
11
  help: (request: {
11
12
  capabilityId: CapabilityId;
12
13
  }) => any;
13
- change: (scene: KnowledgeSceneV1, meta: ChangeMeta) => any;
14
14
  "update:modelValue": (scene: KnowledgeSceneV1) => any;
15
15
  diagnostic: (issue: EditorDiagnostic) => any;
16
16
  "busy-change": (busy: {
17
17
  uploading: number;
18
18
  requesting: number;
19
19
  }) => any;
20
+ configure: (request: {
21
+ capabilityId: "agentSelect" | "tagged";
22
+ }) => any;
23
+ "add-scene": (request: AddKnowledgeSceneRequest) => any;
20
24
  }, string, import('vue').PublicProps, Readonly<FkpRichTextProps> & Readonly<{
21
- onDelete?: (() => any) | undefined;
25
+ onChange?: ((scene: KnowledgeSceneV1, meta: ChangeMeta) => any) | undefined;
22
26
  onHelp?: ((request: {
23
27
  capabilityId: CapabilityId;
24
28
  }) => any) | undefined;
25
- onChange?: ((scene: KnowledgeSceneV1, meta: ChangeMeta) => any) | undefined;
26
29
  "onUpdate:modelValue"?: ((scene: KnowledgeSceneV1) => any) | undefined;
27
30
  onDiagnostic?: ((issue: EditorDiagnostic) => any) | undefined;
28
31
  "onBusy-change"?: ((busy: {
29
32
  uploading: number;
30
33
  requesting: number;
31
34
  }) => any) | undefined;
35
+ onConfigure?: ((request: {
36
+ capabilityId: "agentSelect" | "tagged";
37
+ }) => any) | undefined;
38
+ "onAdd-scene"?: ((request: AddKnowledgeSceneRequest) => any) | undefined;
32
39
  }>, {
33
40
  readonly: boolean;
34
41
  disabled: boolean;
35
42
  sceneKey: string;
36
43
  modelValue: KnowledgeSceneV1;
37
44
  ackRevision: number;
45
+ typeSelectionMode: "switch" | "add";
38
46
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
39
47
  sceneRoot: HTMLElement;
40
48
  toolbar: HTMLDivElement;
@@ -46,6 +54,7 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
46
54
  placeholder?: string;
47
55
  referencePlaceholder?: boolean;
48
56
  schemaPlan: import('./runtime/schema-plan').KnowledgeSchemaPlan;
57
+ pasteCapabilities?: readonly import('./runtime/knowledge-clipboard').PasteCapability[];
49
58
  activeChoiceId?: string | null;
50
59
  }> & Readonly<{
51
60
  "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
@@ -67,6 +76,7 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
67
76
  }) => any) | undefined;
68
77
  "onLeave-choice"?: (() => any) | undefined;
69
78
  }>, {
79
+ pasteClipboardContent: (event: ClipboardEvent) => MediaTarget | null;
70
80
  isSelectionInsideOriginalReply: () => boolean;
71
81
  insertToken: (kind: string, key: string, label: string, token?: string) => void;
72
82
  insertOriginal: () => void;
@@ -78,8 +88,12 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
78
88
  url: string;
79
89
  kind: "image" | "video";
80
90
  posterUrl?: string;
81
- }, name: string, target?: MediaTarget) => boolean;
91
+ }, name: string, target: MediaTarget, refocus: boolean) => JSONContent | null;
82
92
  insertPendingMedia: (file: File, kind: "image" | "video", target: MediaTarget) => string | null;
93
+ insertPendingMediaBatch: (files: Array<{
94
+ file: File;
95
+ kind: "image" | "video";
96
+ }>, target: MediaTarget) => string[] | null;
83
97
  applyNodeUpdate: (plan: Extract<PluginPlan, {
84
98
  kind: "updateNode";
85
99
  }>, owner: "image" | "video") => boolean;
@@ -121,6 +135,8 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
121
135
  focused: boolean;
122
136
  } | null>) => void;
123
137
  captureMediaTarget: () => MediaTarget | null;
138
+ whenReady: () => Promise<boolean>;
139
+ captureEndTarget: () => MediaTarget | null;
124
140
  captureMediaTargetAt: (clientX: number, clientY: number) => MediaTarget | null;
125
141
  focus: () => boolean | undefined;
126
142
  getJSON: () => import('@tiptap/core').DocumentType<Record<string, any> | undefined, import('@tiptap/core').NodeType<string, Record<string, any> | undefined, any, (import('@tiptap/core').NodeType<any, any, any, any> | import('@tiptap/core').TextType<import('@tiptap/core').MarkType<any, any>>)[]>[]> | undefined;
@@ -158,6 +174,7 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
158
174
  placeholder?: string;
159
175
  referencePlaceholder?: boolean;
160
176
  schemaPlan: import('./runtime/schema-plan').KnowledgeSchemaPlan;
177
+ pasteCapabilities?: readonly import('./runtime/knowledge-clipboard').PasteCapability[];
161
178
  activeChoiceId?: string | null;
162
179
  }> & Readonly<{
163
180
  "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
@@ -179,6 +196,7 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
179
196
  }) => any) | undefined;
180
197
  "onLeave-choice"?: (() => any) | undefined;
181
198
  }>, {
199
+ pasteClipboardContent: (event: ClipboardEvent) => MediaTarget | null;
182
200
  isSelectionInsideOriginalReply: () => boolean;
183
201
  insertToken: (kind: string, key: string, label: string, token?: string) => void;
184
202
  insertOriginal: () => void;
@@ -190,8 +208,12 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
190
208
  url: string;
191
209
  kind: "image" | "video";
192
210
  posterUrl?: string;
193
- }, name: string, target?: MediaTarget) => boolean;
211
+ }, name: string, target: MediaTarget, refocus: boolean) => JSONContent | null;
194
212
  insertPendingMedia: (file: File, kind: "image" | "video", target: MediaTarget) => string | null;
213
+ insertPendingMediaBatch: (files: Array<{
214
+ file: File;
215
+ kind: "image" | "video";
216
+ }>, target: MediaTarget) => string[] | null;
195
217
  applyNodeUpdate: (plan: Extract<PluginPlan, {
196
218
  kind: "updateNode";
197
219
  }>, owner: "image" | "video") => boolean;
@@ -233,6 +255,8 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
233
255
  focused: boolean;
234
256
  } | null>) => void;
235
257
  captureMediaTarget: () => MediaTarget | null;
258
+ whenReady: () => Promise<boolean>;
259
+ captureEndTarget: () => MediaTarget | null;
236
260
  captureMediaTargetAt: (clientX: number, clientY: number) => MediaTarget | null;
237
261
  focus: () => boolean | undefined;
238
262
  getJSON: () => import('@tiptap/core').DocumentType<Record<string, any> | undefined, import('@tiptap/core').NodeType<string, Record<string, any> | undefined, any, (import('@tiptap/core').NodeType<any, any, any, any> | import('@tiptap/core').TextType<import('@tiptap/core').MarkType<any, any>>)[]>[]> | undefined;
@@ -1,5 +1,5 @@
1
- import { KnowledgeSceneV1 } from '../public/types';
2
- import { LegacyKnowledgeItem, LegacyReferenceResolver } from '../legacy-converter';
1
+ import { KnowledgeSceneV1 } from '../../index.ts';
2
+ import { LegacyKnowledgeItem, LegacyReferenceResolver } from '../legacy-converter/index.ts';
3
3
  export interface ConversionFixture {
4
4
  id: string;
5
5
  label: string;
@@ -0,0 +1,11 @@
1
+ import { JSONContent } from '@tiptap/core';
2
+ export interface ReasoningTemplateExample {
3
+ id: string;
4
+ label: string;
5
+ name: string;
6
+ question: string;
7
+ content: string;
8
+ }
9
+ /** Bundled examples used when the host does not supply reasoning templates. */
10
+ export declare const reasoningTemplateExamples: ReasoningTemplateExample[];
11
+ export declare function reasoningTemplateDocument(example: ReasoningTemplateExample): JSONContent;
@@ -1,9 +1,11 @@
1
+ import { FkpIconName } from '@freecallai/icons';
1
2
  import { CapabilityId, CapabilitySlot, KnowledgeType, RichTextHostPorts } from '../public/types';
2
3
  export declare const optionSourcePort: {
3
4
  readonly agents: "searchAgents";
4
5
  readonly variables: "listVariables";
5
6
  readonly flatTags: "listCapabilityOptions";
6
7
  readonly capabilities: "listCapabilityOptions";
8
+ readonly reasoningTemplates: "listCapabilityOptions";
7
9
  };
8
10
  export declare const hostActions: {
9
11
  readonly agentOpenConfig: {
@@ -24,7 +26,8 @@ export declare const hostActions: {
24
26
  };
25
27
  readonly reasoningTemplateLoad: {
26
28
  readonly id: "reasoningTemplate.load";
27
- readonly requiredPorts: readonly ["getReasoningTemplate"];
29
+ readonly requiredPorts: readonly [];
30
+ readonly optionalPorts: readonly ["getReasoningTemplate", "listCapabilityOptions"];
28
31
  };
29
32
  };
30
33
  export interface CapabilityDescriptor {
@@ -33,13 +36,32 @@ export interface CapabilityDescriptor {
33
36
  dataVersion: number;
34
37
  implementation: 'plugin' | 'host';
35
38
  label: string;
39
+ /** Optional full name used when a type change removes this capability. */
40
+ removalLabel?: string;
36
41
  slot: CapabilitySlot;
37
42
  order: number;
38
43
  types: readonly KnowledgeType[];
39
- icon: string;
44
+ icon: FkpIconName;
45
+ /** Trusted, local presentation metadata; never supplied by remote rules. */
46
+ menu?: {
47
+ title: string;
48
+ searchLabel: string;
49
+ classes: readonly string[];
50
+ width?: number;
51
+ helpClass: string;
52
+ guidance?: readonly string[];
53
+ guidanceClass?: string;
54
+ headingClass?: string;
55
+ badge?: {
56
+ text: string;
57
+ className: string;
58
+ dotClass: string;
59
+ };
60
+ };
40
61
  actions?: readonly {
41
62
  id: string;
42
63
  requiredPorts: readonly (keyof RichTextHostPorts)[];
64
+ optionalPorts?: readonly (keyof RichTextHostPorts)[];
43
65
  }[];
44
66
  /** Read-only view data dependencies; they do not execute editor operations. */
45
67
  readPorts?: readonly (keyof RichTextHostPorts)[];
@@ -54,5 +76,6 @@ export interface CapabilityDescriptor {
54
76
  uiPorts?: readonly (keyof RichTextHostPorts)[];
55
77
  questionTag?: {
56
78
  kind: 'todo' | 'default';
79
+ protocolLabel: string;
57
80
  };
58
81
  }
@@ -4,6 +4,8 @@ import { SelectionOptions } from './selection-options';
4
4
  import { EditorDiagnostic, FkpRichTextProps, KnowledgeType } from '../public/types';
5
5
  export interface ResolvedCapability extends CapabilityDescriptor {
6
6
  canInsert: boolean;
7
+ /** Programmatic insertion supplies its own option or asset; menu/upload ports are not needed. */
8
+ canInsertProvided: boolean;
7
9
  visible: boolean;
8
10
  options?: MediaOptions | SelectionOptions;
9
11
  }
@@ -1,6 +1,8 @@
1
1
  export { default } from './FkpRichText.vue';
2
2
  export { default as FkpRichText } from './FkpRichText.vue';
3
- export type { FkpRichTextProps, FkpRichTextHandle, KnowledgeSceneV1, KnowledgeConditionV1, MigrationIssueV1, LoadedConditionV1, LegacyReadonlyConditionV1, ConditionLoadV1, SaveConditionInputV1, SavedConditionV1, KnowledgePersistenceAdapterV1, KnowledgeType, CapabilityId, CapabilitySlot, CapabilityRuleV1, SceneConfigInputV1, RichTextHostPorts, PortRequestContext, PortResult, PortErrorCode, Page, CapabilityOption, ToolFormField, ToolFormDefinition, VariableOption, AgentSummary, AgentPrompt, MediaAsset, SceneConfigLayersV1, HostPolicySnapshotV1, EditorDiagnostic, ChangeMeta, } from './public/types';
3
+ export { default as FkpKnowledgeTypePicker } from './ui/FkpKnowledgeTypePicker.vue';
4
+ export type { FkpKnowledgeTypePickerProps } from './ui/knowledge-type-picker-types';
5
+ export type { FkpRichTextProps, FkpRichTextHandle, RichTextInsertInput, RichTextInsertOption, RichTextInsertResult, KnowledgeSceneV1, KnowledgeConditionV1, MigrationIssueV1, LoadedConditionV1, LegacyReadonlyConditionV1, ConditionLoadV1, SaveConditionInputV1, SavedConditionV1, KnowledgePersistenceAdapterV1, KnowledgeType, AddKnowledgeSceneRequest, CapabilityId, CapabilitySlot, CapabilityRuleV1, SceneConfigInputV1, RichTextHostPorts, PortRequestContext, PortResult, PortErrorCode, Page, CapabilityOption, ToolFormField, ToolFormDefinition, VariableOption, AgentSummary, AgentPrompt, AgentPromptPreviewPart, MediaAsset, SceneConfigLayersV1, HostPolicySnapshotV1, EditorDiagnostic, ChangeMeta, } from './public/types';
4
6
  export { emptyScene, emptyDoc } from './public/types';
5
7
  export { resolveSceneConfig } from './config/resolve';
6
8
  export { validateKnowledgeScenes } from './model/validate';
@@ -0,0 +1,2 @@
1
+ import { AgentPromptPreviewPart } from '../public/types';
2
+ export declare function agentPromptPreview(html: string | null | undefined, plain: string | null | undefined): AgentPromptPreviewPart[];
@@ -0,0 +1,12 @@
1
+ /** csr-webui's bizAttributeCatalog response; IDs, keys and names are stable protocol data. */
2
+ export interface LegacyBusinessAttribute {
3
+ id: string | number;
4
+ key: string;
5
+ name: string;
6
+ }
7
+ /** Reject ambiguous or unrepresentable host catalog entries before converting data. */
8
+ export declare function isLegacyBusinessAttributeCatalog(value: unknown): value is readonly LegacyBusinessAttribute[];
9
+ export declare const LEGACY_BUSINESS_ATTRIBUTES: readonly LegacyBusinessAttribute[];
10
+ export declare function legacyBusinessAttributeByName(name: string, attributes?: readonly LegacyBusinessAttribute[]): LegacyBusinessAttribute | undefined;
11
+ export declare function legacyBusinessAttributeByKey(key: string, attributes?: readonly LegacyBusinessAttribute[]): LegacyBusinessAttribute | undefined;
12
+ export declare function legacyBusinessAttributeToken(name: string): string;
@@ -1,4 +1,8 @@
1
1
  import { KnowledgeSceneV1 } from '../public/types';
2
+ import { LegacyBusinessAttribute } from './business-attribute';
3
+ export { LEGACY_BUSINESS_ATTRIBUTES, isLegacyBusinessAttributeCatalog, } from './business-attribute';
4
+ export type { LegacyBusinessAttribute } from './business-attribute';
5
+ export { agentPromptPreview } from './agent-prompt-preview';
2
6
  /** The old knowledge item. Unrelated backend fields are copied through on export. */
3
7
  export interface LegacyKnowledgeItem {
4
8
  web_content?: string;
@@ -20,10 +24,14 @@ export interface LegacyReferenceResolver {
20
24
  } | null;
21
25
  }
22
26
  export interface LegacyImportOptions {
27
+ /** Complete authoritative host catalog; omitted preserves the six legacy entries. */
28
+ businessAttributes?: readonly LegacyBusinessAttribute[];
23
29
  /** The parent condition owns the question when it is absent from web_content. */
24
30
  questionText?: string;
25
31
  }
26
32
  export interface LegacyExportOptions {
33
+ /** Use the same host catalog used to insert/import attribute references. */
34
+ businessAttributes?: readonly LegacyBusinessAttribute[];
27
35
  /** Real updateCondition content items normally store the question outside web_content. */
28
36
  questionStorage?: 'external' | 'inline';
29
37
  }
@@ -0,0 +1 @@
1
+ export { parseLegacyToolText, formatLegacyToolText, parseEncodedOrderRemark, } from '../plugins/tool/protocol';
@@ -1,7 +1,8 @@
1
1
  import { JSONContent } from '@tiptap/core';
2
2
  import { KnowledgeSceneV1 } from '../public/types';
3
3
  export declare const isKnownNodeType: (type: string) => boolean;
4
- export declare function findUnsupportedContent(doc: JSONContent | null, rootPath?: string): string | null;
4
+ /** Agent snapshots validate node structure without applying insert placement rules. */
5
+ export declare function findUnsupportedContent(doc: JSONContent | null, rootPath?: string, allowStoredReplyTags?: boolean): string | null;
5
6
  /** The minimum shape required for the scene shell to render safely. */
6
7
  export declare function isRenderableSceneShell(value: unknown): value is KnowledgeSceneV1;
7
8
  export declare function findUnsupportedScene(value: unknown): string | null;
@@ -1,8 +1,6 @@
1
- /** Persisted node kinds. A new kind must be added here before it can enter a scene. */
2
- export declare const BUSINESS_TOKEN_KINDS: readonly ["todo", "ticket", "variable", "attribute", "tool", "separator"];
3
- export type BusinessTokenKind = (typeof BUSINESS_TOKEN_KINDS)[number];
4
- export declare const CHOICE_TOKEN_KINDS: readonly ["todo", "ticket", "attribute"];
5
- export type ChoiceTokenKind = (typeof CHOICE_TOKEN_KINDS)[number];
1
+ import { BusinessTokenKind, ChoiceTokenKind } from '../plugins/token-catalog';
2
+ export { BUSINESS_TOKEN_KINDS, CHOICE_TOKEN_KINDS, getBusinessTokenDefinition, } from '../plugins/token-catalog';
3
+ export type { BusinessTokenKind, ChoiceTokenKind, } from '../plugins/token-catalog';
6
4
  export declare const MEDIA_KINDS: readonly ["image", "video"];
7
5
  export type MediaKind = (typeof MEDIA_KINDS)[number];
8
6
  export declare const isBusinessTokenKind: (value: unknown) => value is BusinessTokenKind;
@@ -1,6 +1,12 @@
1
1
  import { JSONContent } from '@tiptap/core';
2
+ import { CapabilityId, CapabilitySlot } from '../public/types';
2
3
  export declare const isIdentifiedNodeType: (type: string) => boolean;
3
- export declare function ownerOfIdentifiedNode(type: string, attrs?: Record<string, unknown>): string | null;
4
+ export declare function ownerOfIdentifiedNode(type: string, attrs?: Record<string, unknown>): CapabilityId | null;
5
+ /** Structural legacy separators use the same placement policy as inline ones. */
6
+ export declare function nodeCapability(node: JSONContent): {
7
+ id: CapabilityId;
8
+ slot: CapabilitySlot;
9
+ } | null;
4
10
  export declare function hasNestedIdentifiedNode(node: JSONContent): boolean;
5
11
  export declare const trustedNodeIdsMeta = "fkpTrustedNodeIds";
6
12
  export declare function collectIdentifiedNodeIds(content: JSONContent | JSONContent[]): string[];
@@ -1,10 +1,9 @@
1
- import { KnowledgeSceneV1 } from '../public/types';
2
- type SelectionCapability = 'todo' | 'tagged';
1
+ import { CapabilityId, KnowledgeSceneV1 } from '../public/types';
3
2
  /** Historical/current brackets and line breaks are reserved intent delimiters. */
4
3
  export declare function hasQuestionDelimiter(text: string): boolean;
5
4
  /** Plan labels must remain one unambiguous model-protocol token. */
6
5
  export declare function hasPlanLabelDelimiter(label: string): boolean;
7
- export declare function selectedQuestionOption(scene: KnowledgeSceneV1, id: SelectionCapability): {
6
+ export declare function selectedQuestionOption(scene: KnowledgeSceneV1, id: CapabilityId): {
8
7
  id: string;
9
8
  label: string;
10
9
  } | null;
@@ -12,4 +11,3 @@ export declare function selectedQuestionOption(scene: KnowledgeSceneV1, id: Sele
12
11
  export declare function serializeQuestionTagsForModel(scene: KnowledgeSceneV1): string;
13
12
  /** Produces the complete intent line when the host sends a prompt to the model. */
14
13
  export declare function serializeQuestionForModel(scene: KnowledgeSceneV1): string;
15
- export {};
@@ -0,0 +1,9 @@
1
+ export declare const attributeToken: {
2
+ allowInOriginalReply: false;
3
+ choice: true;
4
+ requiresInsertToken?: true;
5
+ allowsParams?: true;
6
+ present(attrs: import('../token-definition').TokenAttrs): import('../token-definition').TokenPresentation;
7
+ serialize(attrs: import('../token-definition').TokenAttrs): string;
8
+ validate?(attrs: import('../token-definition').TokenAttrs): string | null;
9
+ };
@@ -77,10 +77,19 @@ export interface CapabilityModule {
77
77
  apiVersion: 1;
78
78
  dataVersion: number;
79
79
  actions: Readonly<Record<string, CapabilityAction>>;
80
+ /** Final synchronous check against the live scene after an async insert action. */
81
+ validateInsert?(input: PluginInput, scene: Readonly<KnowledgeSceneV1>): {
82
+ ok: true;
83
+ } | {
84
+ ok: false;
85
+ code: string;
86
+ message: string;
87
+ };
80
88
  }
81
89
  /** Shared behavior used by individual, identity-bound plugin modules. */
82
90
  export interface SharedCapabilityImplementation {
83
91
  execute(id: CapabilityId, input: PluginInput, scene: Readonly<KnowledgeSceneV1>): readonly PluginOperation[];
92
+ validateInsert?: CapabilityModule['validateInsert'];
84
93
  }
85
94
  export declare function bindCapability(id: CapabilityId, slot: CapabilitySlot, implementation: SharedCapabilityImplementation): CapabilityModule;
86
95
  export {};
@@ -0,0 +1,14 @@
1
+ import { JSONContent } from '@tiptap/core';
2
+ import { CapabilityOption, Page, PortResult } from '../../public/types';
3
+ import { PluginActionContext } from '../operations';
4
+ export declare function isDefaultTemplateCursor(cursor: string | undefined): boolean;
5
+ export declare function defaultTemplateOptions(query: {
6
+ search?: string;
7
+ cursor?: string;
8
+ limit: number;
9
+ }): PortResult<Page<CapabilityOption>>;
10
+ /** Resolve references through declared host ports; never persist the demo's fake todo ID. */
11
+ export declare function loadDefaultTemplate(id: string, context: PluginActionContext): Promise<PortResult<{
12
+ question: string;
13
+ doc: JSONContent;
14
+ }> | null>;
@@ -0,0 +1,9 @@
1
+ export interface ReasoningTemplateExample {
2
+ id: string;
3
+ label: string;
4
+ name: string;
5
+ question: string;
6
+ content: string;
7
+ }
8
+ /** Bundled examples used when the host does not supply reasoning templates. */
9
+ export declare const reasoningTemplateExamples: ReasoningTemplateExample[];
@@ -0,0 +1,2 @@
1
+ import { BusinessTokenDefinition } from '../token-definition';
2
+ export declare const separatorToken: BusinessTokenDefinition;
@@ -0,0 +1,2 @@
1
+ import { CapabilityDescriptor } from '../../config/descriptor';
2
+ export declare const tableKnowledgeDescriptors: readonly CapabilityDescriptor[];
@@ -0,0 +1,2 @@
1
+ declare const _default: import('../operations').CapabilityModule;
2
+ export default _default;
@@ -0,0 +1,9 @@
1
+ export declare const tableKnowledgeToken: {
2
+ validate: (attrs: Readonly<Record<string, unknown>>) => "label" | null;
3
+ choice: true;
4
+ requiresInsertToken?: true;
5
+ allowsParams?: true;
6
+ allowInOriginalReply?: false;
7
+ present(attrs: import('../token-definition').TokenAttrs): import('../token-definition').TokenPresentation;
8
+ serialize(attrs: import('../token-definition').TokenAttrs): string;
9
+ };
@@ -0,0 +1,8 @@
1
+ export declare function parseTicketText(text: string): {
2
+ key: string;
3
+ label: string;
4
+ params?: {
5
+ protocol: 'legacy';
6
+ };
7
+ } | null;
8
+ export declare function formatTicketText(key: string, label: string, params?: Record<string, unknown> | null): string;
@@ -0,0 +1,9 @@
1
+ export declare const ticketToken: {
2
+ allowsParams: true;
3
+ validate(attrs: Readonly<Record<string, unknown>>): "label" | "params" | "key" | null;
4
+ choice: true;
5
+ requiresInsertToken?: true;
6
+ allowInOriginalReply?: false;
7
+ present(attrs: import('../token-definition').TokenAttrs): import('../token-definition').TokenPresentation;
8
+ serialize(attrs: import('../token-definition').TokenAttrs): string;
9
+ };
@@ -0,0 +1,3 @@
1
+ export declare const todoToken: import('../token-definition').BusinessTokenDefinition & {
2
+ choice: true;
3
+ };
@@ -0,0 +1,46 @@
1
+ import { BusinessTokenDefinition } from './token-definition';
2
+ /** One registration per persisted inline kind; all behavior lives with its owner. */
3
+ export declare const tokenCatalog: {
4
+ todo: BusinessTokenDefinition & {
5
+ choice: true;
6
+ };
7
+ ticket: {
8
+ allowsParams: true;
9
+ validate(attrs: Readonly<Record<string, unknown>>): "label" | "params" | "key" | null;
10
+ choice: true;
11
+ requiresInsertToken?: true;
12
+ allowInOriginalReply?: false;
13
+ present(attrs: import('./token-definition').TokenAttrs): import('./token-definition').TokenPresentation;
14
+ serialize(attrs: import('./token-definition').TokenAttrs): string;
15
+ };
16
+ tableKnowledge: {
17
+ validate: (attrs: Readonly<Record<string, unknown>>) => "label" | null;
18
+ choice: true;
19
+ requiresInsertToken?: true;
20
+ allowsParams?: true;
21
+ allowInOriginalReply?: false;
22
+ present(attrs: import('./token-definition').TokenAttrs): import('./token-definition').TokenPresentation;
23
+ serialize(attrs: import('./token-definition').TokenAttrs): string;
24
+ };
25
+ variable: BusinessTokenDefinition;
26
+ attribute: {
27
+ allowInOriginalReply: false;
28
+ choice: true;
29
+ requiresInsertToken?: true;
30
+ allowsParams?: true;
31
+ present(attrs: import('./token-definition').TokenAttrs): import('./token-definition').TokenPresentation;
32
+ serialize(attrs: import('./token-definition').TokenAttrs): string;
33
+ validate?(attrs: import('./token-definition').TokenAttrs): string | null;
34
+ };
35
+ tool: BusinessTokenDefinition;
36
+ separator: BusinessTokenDefinition;
37
+ };
38
+ export type BusinessTokenKind = keyof typeof tokenCatalog;
39
+ export type ChoiceTokenKind = {
40
+ [K in BusinessTokenKind]: (typeof tokenCatalog)[K] extends {
41
+ choice: true;
42
+ } ? K : never;
43
+ }[BusinessTokenKind];
44
+ export declare function getBusinessTokenDefinition(kind: unknown): BusinessTokenDefinition | undefined;
45
+ export declare const BUSINESS_TOKEN_KINDS: BusinessTokenKind[];
46
+ export declare const CHOICE_TOKEN_KINDS: ChoiceTokenKind[];
@@ -0,0 +1,24 @@
1
+ import { FkpIconName } from '@freecallai/icons';
2
+ export type TokenAttrs = Readonly<Record<string, unknown>>;
3
+ export interface TokenPresentation {
4
+ layout: 'choice' | 'inline' | 'tool' | 'toolNote';
5
+ icon: FkpIconName;
6
+ label: string;
7
+ ariaLabel: string;
8
+ className?: string;
9
+ summary?: string;
10
+ }
11
+ /** Pure metadata/codecs: importing these contracts never loads editor views. */
12
+ export interface BusinessTokenDefinition {
13
+ choice?: true;
14
+ requiresInsertToken?: true;
15
+ allowsParams?: true;
16
+ allowInOriginalReply?: false;
17
+ present(attrs: TokenAttrs): TokenPresentation;
18
+ serialize(attrs: TokenAttrs): string;
19
+ /** Return the relative attribute field that cannot be represented safely. */
20
+ validate?(attrs: TokenAttrs): string | null;
21
+ }
22
+ export declare function choiceToken(label: string, icon: FkpIconName, serialize: BusinessTokenDefinition['serialize']): BusinessTokenDefinition & {
23
+ choice: true;
24
+ };
@@ -1,6 +1,7 @@
1
+ import { FkpIconName } from '@freecallai/icons';
1
2
  export interface ToolTokenPresentation {
2
3
  label: string;
3
- iconGlyph: string;
4
+ icon: FkpIconName;
4
5
  summary: string;
5
6
  }
6
7
  /** Built-in tool display rules live with the tool plugin, not the editor schema. */
@@ -0,0 +1,5 @@
1
+ import { JSONContent } from '@tiptap/core';
2
+ export declare function parseLegacyToolText(text: string): JSONContent | null;
3
+ export declare function formatLegacyToolText(node: JSONContent): string | null;
4
+ /** Older csr-webui drafts stored encoded JSON before the explicit span protocol. */
5
+ export declare function parseEncodedOrderRemark(value: string): JSONContent | null;