@freecallai/pro 0.0.2 → 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 (116) 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-BSJxTJ7U.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-BnFTr8u9.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-CG2j9Znw.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-Cj-3xrxd.js → media-migration-CbMT2wS0.js} +1 -1
  33. package/dist/{media-upload-D7DpMJYx.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 +1129 -643
  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 +18 -5
  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 +2 -3
  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 +9 -29
  65. package/dist/types/rich-text/legacy-converter/index.d.ts +8 -1
  66. package/dist/types/rich-text/legacy-converter/tool-contract.d.ts +1 -5
  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 +1 -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 +63 -6
  90. package/dist/types/rich-text/runtime/action-ports.d.ts +6 -1
  91. package/dist/types/rich-text/runtime/knowledge-clipboard.d.ts +16 -0
  92. package/dist/types/rich-text/runtime/media-target.d.ts +2 -0
  93. package/dist/types/rich-text/runtime/media-upload-session.d.ts +1 -1
  94. package/dist/types/rich-text/runtime/schema-plan.d.ts +1 -0
  95. package/dist/types/rich-text/types.d.ts +3 -40
  96. package/dist/types/rich-text/ui/FkpKnowledgeTypePicker.vue.d.ts +38 -0
  97. package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +7 -3
  98. package/dist/types/rich-text/ui/knowledge-type-picker-types.d.ts +14 -0
  99. package/dist/types/rich-text/ui/token-renderer.d.ts +5 -0
  100. package/dist/types/switcher/FkpSwitcher.vue.d.ts +52 -0
  101. package/dist/types/switcher/index.d.ts +2 -0
  102. package/dist/types/switcher/types.d.ts +7 -0
  103. package/package.json +26 -6
  104. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-BuMz8Tyy.js +0 -4416
  105. package/dist/KnowledgeArea-BkRVWFrg.js +0 -1224
  106. package/dist/index-BVHYCLDv.js +0 -5
  107. package/dist/index-CzpY61Qj.js +0 -6
  108. package/dist/index-DxxX09iY.js +0 -6
  109. package/dist/index-kOPLn4DD.js +0 -5
  110. package/dist/index-nnvfy5q0.js +0 -31
  111. package/dist/index-urNonkMH.js +0 -6
  112. package/dist/inline-TT_dl8Y3.js +0 -17
  113. package/dist/knowledge-BZCmalF_.js +0 -6
  114. package/dist/media-extensions-ZoxmhIhH.js +0 -276
  115. package/dist/operations-JgnjGx3H.js +0 -19
  116. package/dist/rules-CC6NoltX.js +0 -811
@@ -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,9 +2,10 @@ 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, AddKnowledgeSceneRequest, 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
10
  change: (scene: KnowledgeSceneV1, meta: ChangeMeta) => any;
10
11
  help: (request: {
@@ -16,6 +17,9 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
16
17
  uploading: number;
17
18
  requesting: number;
18
19
  }) => any;
20
+ configure: (request: {
21
+ capabilityId: "agentSelect" | "tagged";
22
+ }) => any;
19
23
  "add-scene": (request: AddKnowledgeSceneRequest) => any;
20
24
  }, string, import('vue').PublicProps, Readonly<FkpRichTextProps> & Readonly<{
21
25
  onChange?: ((scene: KnowledgeSceneV1, meta: ChangeMeta) => any) | undefined;
@@ -28,6 +32,9 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
28
32
  uploading: number;
29
33
  requesting: number;
30
34
  }) => any) | undefined;
35
+ onConfigure?: ((request: {
36
+ capabilityId: "agentSelect" | "tagged";
37
+ }) => any) | undefined;
31
38
  "onAdd-scene"?: ((request: AddKnowledgeSceneRequest) => any) | undefined;
32
39
  }>, {
33
40
  readonly: boolean;
@@ -47,6 +54,7 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
47
54
  placeholder?: string;
48
55
  referencePlaceholder?: boolean;
49
56
  schemaPlan: import('./runtime/schema-plan').KnowledgeSchemaPlan;
57
+ pasteCapabilities?: readonly import('./runtime/knowledge-clipboard').PasteCapability[];
50
58
  activeChoiceId?: string | null;
51
59
  }> & Readonly<{
52
60
  "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
@@ -68,7 +76,7 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
68
76
  }) => any) | undefined;
69
77
  "onLeave-choice"?: (() => any) | undefined;
70
78
  }>, {
71
- pasteFileText: (event: ClipboardEvent) => void;
79
+ pasteClipboardContent: (event: ClipboardEvent) => MediaTarget | null;
72
80
  isSelectionInsideOriginalReply: () => boolean;
73
81
  insertToken: (kind: string, key: string, label: string, token?: string) => void;
74
82
  insertOriginal: () => void;
@@ -80,7 +88,7 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
80
88
  url: string;
81
89
  kind: "image" | "video";
82
90
  posterUrl?: string;
83
- }, name: string, target?: MediaTarget) => boolean;
91
+ }, name: string, target: MediaTarget, refocus: boolean) => JSONContent | null;
84
92
  insertPendingMedia: (file: File, kind: "image" | "video", target: MediaTarget) => string | null;
85
93
  insertPendingMediaBatch: (files: Array<{
86
94
  file: File;
@@ -127,6 +135,8 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
127
135
  focused: boolean;
128
136
  } | null>) => void;
129
137
  captureMediaTarget: () => MediaTarget | null;
138
+ whenReady: () => Promise<boolean>;
139
+ captureEndTarget: () => MediaTarget | null;
130
140
  captureMediaTargetAt: (clientX: number, clientY: number) => MediaTarget | null;
131
141
  focus: () => boolean | undefined;
132
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;
@@ -164,6 +174,7 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
164
174
  placeholder?: string;
165
175
  referencePlaceholder?: boolean;
166
176
  schemaPlan: import('./runtime/schema-plan').KnowledgeSchemaPlan;
177
+ pasteCapabilities?: readonly import('./runtime/knowledge-clipboard').PasteCapability[];
167
178
  activeChoiceId?: string | null;
168
179
  }> & Readonly<{
169
180
  "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
@@ -185,7 +196,7 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
185
196
  }) => any) | undefined;
186
197
  "onLeave-choice"?: (() => any) | undefined;
187
198
  }>, {
188
- pasteFileText: (event: ClipboardEvent) => void;
199
+ pasteClipboardContent: (event: ClipboardEvent) => MediaTarget | null;
189
200
  isSelectionInsideOriginalReply: () => boolean;
190
201
  insertToken: (kind: string, key: string, label: string, token?: string) => void;
191
202
  insertOriginal: () => void;
@@ -197,7 +208,7 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
197
208
  url: string;
198
209
  kind: "image" | "video";
199
210
  posterUrl?: string;
200
- }, name: string, target?: MediaTarget) => boolean;
211
+ }, name: string, target: MediaTarget, refocus: boolean) => JSONContent | null;
201
212
  insertPendingMedia: (file: File, kind: "image" | "video", target: MediaTarget) => string | null;
202
213
  insertPendingMediaBatch: (files: Array<{
203
214
  file: File;
@@ -244,6 +255,8 @@ declare const _default: import('vue').DefineComponent<FkpRichTextProps, {
244
255
  focused: boolean;
245
256
  } | null>) => void;
246
257
  captureMediaTarget: () => MediaTarget | null;
258
+ whenReady: () => Promise<boolean>;
259
+ captureEndTarget: () => MediaTarget | null;
247
260
  captureMediaTargetAt: (clientX: number, clientY: number) => MediaTarget | null;
248
261
  focus: () => boolean | undefined;
249
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;
@@ -1,12 +1,11 @@
1
1
  import { JSONContent } from '@tiptap/core';
2
- interface ReasoningTemplateExample {
2
+ export interface ReasoningTemplateExample {
3
3
  id: string;
4
4
  label: string;
5
5
  name: string;
6
6
  question: string;
7
7
  content: string;
8
8
  }
9
- /** Demo-only examples. Production templates are supplied by the host ports. */
9
+ /** Bundled examples used when the host does not supply reasoning templates. */
10
10
  export declare const reasoningTemplateExamples: ReasoningTemplateExample[];
11
11
  export declare function reasoningTemplateDocument(example: ReasoningTemplateExample): JSONContent;
12
- export {};
@@ -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, AddKnowledgeSceneRequest, 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[];
@@ -1,32 +1,12 @@
1
1
  /** csr-webui's bizAttributeCatalog response; IDs, keys and names are stable protocol data. */
2
- declare const catalog: readonly [{
3
- readonly id: 1;
4
- readonly key: "focus_goods_name";
5
- readonly name: "焦点商品名称";
6
- }, {
7
- readonly id: 2;
8
- readonly key: "focus_goods_info";
9
- readonly name: "焦点商品信息";
10
- }, {
11
- readonly id: 3;
12
- readonly key: "focus_goods_sku";
13
- readonly name: "焦点商品sku信息";
14
- }, {
15
- readonly id: 4;
16
- readonly key: "focus_order_amount";
17
- readonly name: "焦点订单实付金额";
18
- }, {
19
- readonly id: 5;
20
- readonly key: "focus_order_status";
21
- readonly name: "焦点订单状态";
22
- }, {
23
- readonly id: 6;
24
- readonly key: "shop_name";
25
- readonly name: "店铺名称";
26
- }];
27
- export type LegacyBusinessAttribute = (typeof catalog)[number];
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[];
28
9
  export declare const LEGACY_BUSINESS_ATTRIBUTES: readonly LegacyBusinessAttribute[];
29
- export declare function legacyBusinessAttributeByName(name: string): LegacyBusinessAttribute | undefined;
30
- export declare function legacyBusinessAttributeByKey(key: string): LegacyBusinessAttribute | undefined;
10
+ export declare function legacyBusinessAttributeByName(name: string, attributes?: readonly LegacyBusinessAttribute[]): LegacyBusinessAttribute | undefined;
11
+ export declare function legacyBusinessAttributeByKey(key: string, attributes?: readonly LegacyBusinessAttribute[]): LegacyBusinessAttribute | undefined;
31
12
  export declare function legacyBusinessAttributeToken(name: string): string;
32
- export {};
@@ -1,5 +1,8 @@
1
1
  import { KnowledgeSceneV1 } from '../public/types';
2
- export { LEGACY_BUSINESS_ATTRIBUTES } from './business-attribute';
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';
3
6
  /** The old knowledge item. Unrelated backend fields are copied through on export. */
4
7
  export interface LegacyKnowledgeItem {
5
8
  web_content?: string;
@@ -21,10 +24,14 @@ export interface LegacyReferenceResolver {
21
24
  } | null;
22
25
  }
23
26
  export interface LegacyImportOptions {
27
+ /** Complete authoritative host catalog; omitted preserves the six legacy entries. */
28
+ businessAttributes?: readonly LegacyBusinessAttribute[];
24
29
  /** The parent condition owns the question when it is absent from web_content. */
25
30
  questionText?: string;
26
31
  }
27
32
  export interface LegacyExportOptions {
33
+ /** Use the same host catalog used to insert/import attribute references. */
34
+ businessAttributes?: readonly LegacyBusinessAttribute[];
28
35
  /** Real updateCondition content items normally store the question outside web_content. */
29
36
  questionStorage?: 'external' | 'inline';
30
37
  }
@@ -1,5 +1 @@
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;
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;
@@ -1,5 +1,6 @@
1
1
  import { JSONContent } from '@tiptap/core';
2
2
  export declare const isSmallPaymentYuan: (value: unknown) => value is string;
3
+ export declare const isOrderRemarkId: (value: unknown) => value is string;
3
4
  export declare const orderRemarkFlags: {
4
5
  readonly none: "不标记";
5
6
  readonly red: "红色";
@@ -0,0 +1,2 @@
1
+ import { BusinessTokenDefinition } from '../token-definition';
2
+ export declare const toolToken: BusinessTokenDefinition;
@@ -0,0 +1,2 @@
1
+ import { BusinessTokenDefinition } from '../token-definition';
2
+ export declare const variableToken: BusinessTokenDefinition;