@freecallai/pro 0.0.2 → 0.0.4

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-DYwu7oQs.js +187 -0
  3. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-BowbZoTQ.js +4885 -0
  4. package/dist/KnowledgeArea-BH-_uF6R.js +1438 -0
  5. package/dist/{ToolForm-BSJxTJ7U.js → ToolForm-C6XW31Y7.js} +1 -1
  6. package/dist/{choice-DDg5gNtS.js → choice-C1SxozNA.js} +1 -1
  7. package/dist/edition-info/index.js +4 -0
  8. package/dist/filters/index.js +7 -0
  9. package/dist/guard-CXpVx8UR.js +1168 -0
  10. package/dist/{index-D8bcFtWR.js → index-9NM1SHoR.js} +1 -1
  11. package/dist/{index-BnFTr8u9.js → index-B8jg37Wj.js} +10 -10
  12. package/dist/index-BqXNMfLG.js +57 -0
  13. package/dist/index-CM0MN2DT.js +6 -0
  14. package/dist/index-CS2xQQ8W.js +168 -0
  15. package/dist/index-CZc2Gyjb.js +6 -0
  16. package/dist/index-Cy4DqT8R.js +10 -0
  17. package/dist/index-D0bJAQSN.js +327 -0
  18. package/dist/index-DAZ1ulyA.js +5 -0
  19. package/dist/index-DCmHHi07.js +71 -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-F7lDP1lI.js +5 -0
  23. package/dist/{index-CG2j9Znw.js → index-UjI4WA5F.js} +1 -1
  24. package/dist/index-bSNw0XAf.js +6 -0
  25. package/dist/index-lNhA3N9x.js +379 -0
  26. package/dist/index.js +36 -11
  27. package/dist/inline-Zj7Hqg-_.js +19 -0
  28. package/dist/knowledge-DaTnF2IW.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-wlcCEdtg.js +324 -0
  32. package/dist/{media-migration-Cj-3xrxd.js → media-migration-C2QLMSpd.js} +1 -1
  33. package/dist/{media-upload-D7DpMJYx.js → media-upload-D9MYBbLg.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 +1250 -666
  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 +27 -7
  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
@@ -6,7 +6,7 @@ export interface AddKnowledgeSceneRequest {
6
6
  position: 'start';
7
7
  }
8
8
  export type CapabilitySlot = 'questionAction' | 'knowledgeInline' | 'knowledgeBlock' | 'sceneAction' | 'toolbarOnly';
9
- export type CapabilityId = 'todo' | 'ticket' | 'originalReply' | 'memory' | 'tagged' | 'variable' | 'image' | 'video' | 'separator' | 'attribute' | 'tool' | 'agentSelect' | 'reasoningPolish' | 'reasoningTemplate';
9
+ export type CapabilityId = 'todo' | 'ticket' | 'tableKnowledge' | 'originalReply' | 'memory' | 'tagged' | 'variable' | 'image' | 'video' | 'separator' | 'attribute' | 'tool' | 'agentSelect' | 'reasoningPolish' | 'reasoningTemplate';
10
10
  export interface KnowledgeSceneV1 {
11
11
  /** 场景数据版本,固定为 1。
12
12
  * @en Scene schema version, currently 1.
@@ -32,10 +32,18 @@ export interface KnowledgeSceneV1 {
32
32
  knowledge: {
33
33
  doc: JSONContent | null;
34
34
  retainedDoc?: JSONContent | null;
35
+ /** 旧 Agent 只有名称时 id 为空;invalid 引用仅展示,不用于调用。
36
+ * @en Name-only legacy references have an empty ID; invalid references cannot be invoked.
37
+ */
35
38
  agentRef?: {
36
39
  id: string;
37
40
  name: string;
41
+ invalid?: boolean;
38
42
  } | null;
43
+ /** 旧 Agent 记录附带的只读正文快照,与宿主实时提示词独立保存。
44
+ * @en Read-only legacy Agent body snapshot, separate from the host's live prompt.
45
+ */
46
+ agentBody?: JSONContent | null;
39
47
  };
40
48
  /** 按能力 ID 保存的版本化插件状态,不与问法文本混写。
41
49
  * @en Versioned plugin state keyed by capability ID, separate from question text.
@@ -271,9 +279,9 @@ export interface ChangeMeta {
271
279
  /** 变更来源。
272
280
  * @en Origin of the change.
273
281
  */
274
- origin: 'user' | 'plugin' | 'typeSwitch' | 'undo';
275
- /** 插件变更时的能力 ID。
276
- * @en Capability ID for a plugin-origin change.
282
+ origin: 'user' | 'plugin' | 'api' | 'typeSwitch' | 'undo';
283
+ /** 插件或 API 插入能力内容时的能力 ID。
284
+ * @en Capability ID for plugin changes or API capability insertion.
277
285
  */
278
286
  capabilityId?: CapabilityId;
279
287
  }
@@ -449,11 +457,27 @@ export interface AgentPrompt extends AgentSummary {
449
457
  * @en Read-only preview of the Agent prompt.
450
458
  */
451
459
  prompt: string;
460
+ /** 宿主解析后的只读提示词片段;不写入知识正文。 */
461
+ preview?: AgentPromptPreviewPart[];
452
462
  /** 可选的 Agent 提示词版本。
453
463
  * @en Optional Agent prompt revision.
454
464
  */
455
465
  revision?: string;
456
466
  }
467
+ export type AgentPromptPreviewPart = {
468
+ type: 'text';
469
+ text: string;
470
+ } | {
471
+ type: 'break';
472
+ } | {
473
+ type: 'tag';
474
+ kind: string;
475
+ label: string;
476
+ } | {
477
+ type: 'media';
478
+ kind: 'image' | 'video';
479
+ url: string;
480
+ };
457
481
  export interface MediaAsset {
458
482
  /** 持久化资源 ID。
459
483
  * @en Persisted asset ID.
@@ -502,8 +526,8 @@ export interface RichTextHostPorts {
502
526
  getAgentPrompt?: (input: {
503
527
  agentId: string;
504
528
  }, ctx: PortRequestContext) => Promise<PortResult<AgentPrompt>>;
505
- /** 查询待办、工单、打标、属性、工具和推理模板等能力选项;工单使用 capabilityId: 'ticket'。
506
- * @en Query options for todo, tickets, tagging, attributes, tools, and reasoning templates; tickets use capabilityId: 'ticket'.
529
+ /** 查询待办、工单、表格知识、打标、属性、工具和推理模板等能力选项;表格知识使用 tableKnowledge,工单使用 capabilityId: 'ticket'。
530
+ * @en Query options for todo, tickets, tableKnowledge, tagging, attributes, tools, and reasoning templates; tickets use capabilityId: 'ticket'.
507
531
  */
508
532
  listCapabilityOptions?: (input: {
509
533
  capabilityId: string;
@@ -593,6 +617,39 @@ export interface FkpRichTextHandle {
593
617
  * @en Undo the most recent uninterrupted knowledge type switch.
594
618
  */
595
619
  undoTypeSwitch(): boolean;
620
+ /** 在最近的有效光标处插入纯文本、媒体资源或已注册的知识区插件内容;没有光标时追加到知识区末尾;失败时不修改场景。
621
+ * @en Insert plain text, a media asset, or a registered knowledge plugin action at the last valid caret, or append to the knowledge area when no caret exists; failures leave the scene unchanged.
622
+ */
623
+ insertContent(input: RichTextInsertInput): Promise<RichTextInsertResult>;
624
+ }
625
+ /** 插件选项由宿主提供,运行时仍按当前知识类型、权限和插件规则校验。
626
+ * @en Host-supplied plugin option, checked against the current type, policy, and plugin rules.
627
+ */
628
+ export interface RichTextInsertOption {
629
+ id: string;
630
+ label: string;
631
+ token?: string;
632
+ params?: Record<string, unknown>;
596
633
  }
634
+ export type RichTextInsertInput = {
635
+ type: 'text';
636
+ text: string;
637
+ } | {
638
+ type: 'media';
639
+ asset: MediaAsset;
640
+ name?: string;
641
+ } | {
642
+ type: 'capability';
643
+ capabilityId: CapabilityId;
644
+ option?: RichTextInsertOption;
645
+ };
646
+ export type RichTextInsertResult = {
647
+ ok: true;
648
+ revision: number;
649
+ } | {
650
+ ok: false;
651
+ code: string;
652
+ message: string;
653
+ };
597
654
  export declare const emptyDoc: () => JSONContent;
598
655
  export declare const emptyScene: (type?: KnowledgeType) => KnowledgeSceneV1;
@@ -5,7 +5,12 @@ export type HostActionId = HostAction['id'];
5
5
  type HostActionPort<A extends HostActionId> = Extract<HostAction, {
6
6
  id: A;
7
7
  }>['requiredPorts'][number];
8
- export type ActionPorts<A extends HostActionId> = Readonly<Required<Pick<RichTextHostPorts, HostActionPort<A>>>>;
8
+ type OptionalActionPort<A extends HostActionId> = Extract<HostAction, {
9
+ id: A;
10
+ }> extends {
11
+ optionalPorts: readonly (infer P)[];
12
+ } ? Extract<P, keyof RichTextHostPorts> : never;
13
+ export type ActionPorts<A extends HostActionId> = Readonly<Required<Pick<RichTextHostPorts, HostActionPort<A>>> & Partial<Pick<RichTextHostPorts, OptionalActionPort<A>>>>;
9
14
  /** Only callbacks named by this action enter its execution context. */
10
15
  export declare function projectDeclaredPorts(descriptor: CapabilityDescriptor, actionId: string, ports: RichTextHostPorts | undefined): Readonly<Partial<RichTextHostPorts>> | null;
11
16
  /** Read-only view data is projected without creating an editor action. */
@@ -0,0 +1,16 @@
1
+ import { Slice, Schema } from '@tiptap/pm/model';
2
+ import { CapabilityId, CapabilitySlot } from '../public/types';
3
+ export type PasteCapability = Pick<{
4
+ id: CapabilityId;
5
+ slot: CapabilitySlot;
6
+ }, 'id' | 'slot'>;
7
+ /** The copied fragment has node markers, with no editor-specific outer wrapper. */
8
+ export declare function writeKnowledgeClipboard(data: DataTransfer, slice: Slice, schema: Schema): boolean;
9
+ export interface KnowledgeHtmlReadResult {
10
+ slice: Slice | null;
11
+ /** True when HTML was parsed, including content intentionally filtered out. */
12
+ handled: boolean;
13
+ }
14
+ /** Parse only structural text and currently insertable rich-text nodes. */
15
+ export declare function readKnowledgeHtmlResult(html: string, schema: Schema, capabilities: readonly PasteCapability[], files?: readonly File[]): KnowledgeHtmlReadResult;
16
+ export declare function readKnowledgeHtml(html: string, schema: Schema, capabilities: readonly PasteCapability[], files?: readonly File[]): Slice | null;
@@ -5,5 +5,7 @@ export interface MediaTarget {
5
5
  dispose(): void;
6
6
  }
7
7
  export declare function captureMediaTarget(editor: Editor): MediaTarget;
8
+ /** Insert after already pasted content without replacing a selected media node. */
9
+ export declare function captureMediaTargetAtBoundary(editor: Editor, initialPosition: number): MediaTarget | null;
8
10
  export declare function captureMediaTargetAt(editor: Editor, clientX: number, clientY: number): MediaTarget | null;
9
11
  export declare function captureMediaTargetAtPosition(editor: Editor, position: number): MediaTarget | null;
@@ -44,7 +44,7 @@ export interface MediaUploadSessionHost {
44
44
  track(controller: AbortController, start: boolean): void;
45
45
  diagnostic(code: string, message: string, source: 'config' | 'plugin' | 'port' | 'validation', kind?: MediaKind): void;
46
46
  portDiagnostic(error: PortError, kind: MediaKind): void;
47
- notify?(type: 'info' | 'success' | 'error', message: string): void;
47
+ notify?(type: 'info' | 'success' | 'warning' | 'error', message: string): void;
48
48
  applyNodeUpdate(plan: UpdatePlan, kind: MediaKind): boolean;
49
49
  }
50
50
  /** Owns upload files, selection bookmark, and async completion across scene changes. */
@@ -4,6 +4,7 @@ type CapabilityAccess = {
4
4
  id: CapabilityId;
5
5
  slot: CapabilitySlot;
6
6
  canInsert: boolean;
7
+ canInsertProvided?: boolean;
7
8
  };
8
9
  export interface KnowledgeSchemaPlan {
9
10
  businessToken: boolean;
@@ -1,40 +1,3 @@
1
- import { JSONContent } from '@tiptap/core';
2
- export type KnowledgeMode = 'normal' | 'reasoning';
3
- export interface KnowledgeSettings {
4
- mode: KnowledgeMode;
5
- memory: boolean;
6
- tagged: boolean;
7
- todo: boolean;
8
- original: boolean;
9
- }
10
- export interface VariableOption {
11
- key: string;
12
- label: string;
13
- group?: string;
14
- }
15
- export interface MediaUploadResult {
16
- url: string;
17
- id?: string;
18
- poster?: string;
19
- }
20
- export type MediaUploader = (file: File, context: {
21
- signal: AbortSignal;
22
- }) => Promise<MediaUploadResult>;
23
- export interface EditorChange {
24
- json: JSONContent;
25
- html: string;
26
- text: string;
27
- }
28
- export interface FkpRichTextProps {
29
- modelValue?: JSONContent;
30
- question?: string;
31
- settings?: KnowledgeSettings;
32
- variables?: VariableOption[];
33
- readonly?: boolean;
34
- disabled?: boolean;
35
- placeholder?: string;
36
- maxHeight?: number;
37
- maxFileSize?: number;
38
- upload?: MediaUploader;
39
- }
40
- export declare const defaultSettings: () => KnowledgeSettings;
1
+ import { KnowledgeType } from './public/types';
2
+ /** @deprecated Use KnowledgeType for the current three-type scene model. */
3
+ export type KnowledgeMode = Extract<KnowledgeType, 'normal' | 'reasoning'>;
@@ -0,0 +1,38 @@
1
+ import { AddKnowledgeSceneRequest, KnowledgeType } from '../public/types';
2
+ import { FkpKnowledgeTypePickerProps } from './knowledge-type-picker-types';
3
+ declare function __VLS_template(): {
4
+ attrs: Partial<{}>;
5
+ slots: {
6
+ default?(_: {}): any;
7
+ };
8
+ refs: {
9
+ root: HTMLDivElement;
10
+ };
11
+ rootEl: HTMLDivElement;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: import('vue').DefineComponent<FkpKnowledgeTypePickerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
+ create: (request: AddKnowledgeSceneRequest) => any;
16
+ select: (type: KnowledgeType) => any;
17
+ "update:open": (open: boolean, source: "click" | "hover" | "select" | "leave" | "outside" | "escape") => any;
18
+ }, string, import('vue').PublicProps, Readonly<FkpKnowledgeTypePickerProps> & Readonly<{
19
+ onCreate?: ((request: AddKnowledgeSceneRequest) => any) | undefined;
20
+ onSelect?: ((type: KnowledgeType) => any) | undefined;
21
+ "onUpdate:open"?: ((open: boolean, source: "click" | "hover" | "select" | "leave" | "outside" | "escape") => any) | undefined;
22
+ }>, {
23
+ open: boolean | null;
24
+ disabled: boolean;
25
+ currentType: KnowledgeType;
26
+ mode: "add" | "switch";
27
+ trigger: "button" | "toolbar";
28
+ buttonLabel: string;
29
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
30
+ root: HTMLDivElement;
31
+ }, HTMLDivElement>;
32
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
33
+ export default _default;
34
+ type __VLS_WithTemplateSlots<T, S> = T & {
35
+ new (): {
36
+ $slots: S;
37
+ };
38
+ };
@@ -1,5 +1,6 @@
1
1
  import { JSONContent } from '@tiptap/core';
2
2
  import { KnowledgeSchemaPlan } from '../runtime/schema-plan';
3
+ import { PasteCapability } from '../runtime/knowledge-clipboard';
3
4
  import { ChoiceTokenKind } from '../model/node-contract';
4
5
  import { MediaNodeState } from '../runtime/media-state';
5
6
  import { NodeMutationPlan, PluginPlan } from '../runtime/operations';
@@ -10,6 +11,7 @@ type __VLS_Props = {
10
11
  placeholder?: string;
11
12
  referencePlaceholder?: boolean;
12
13
  schemaPlan: KnowledgeSchemaPlan;
14
+ pasteCapabilities?: readonly PasteCapability[];
13
15
  activeChoiceId?: string | null;
14
16
  };
15
17
  declare function insertToken(kind: string, key: string, label: string, token?: string): void;
@@ -22,7 +24,7 @@ declare function insertMedia(asset: {
22
24
  url: string;
23
25
  kind: 'image' | 'video';
24
26
  posterUrl?: string;
25
- }, name: string, target?: MediaTarget): boolean;
27
+ }, name: string, target: MediaTarget, refocus: boolean): JSONContent | null;
26
28
  declare function insertPendingMedia(file: File, kind: 'image' | 'video', target: MediaTarget): string | null;
27
29
  declare function insertPendingMediaBatch(files: Array<{
28
30
  file: File;
@@ -54,9 +56,9 @@ declare function captureSelection(): {
54
56
  focused: boolean;
55
57
  } | null;
56
58
  declare function restoreSelection(selection: ReturnType<typeof captureSelection>): void;
57
- declare function pasteFileText(event: ClipboardEvent): void;
59
+ declare function pasteClipboardContent(event: ClipboardEvent): MediaTarget | null;
58
60
  declare const _default: import('vue').DefineComponent<__VLS_Props, {
59
- pasteFileText: typeof pasteFileText;
61
+ pasteClipboardContent: typeof pasteClipboardContent;
60
62
  isSelectionInsideOriginalReply: () => boolean;
61
63
  insertToken: typeof insertToken;
62
64
  insertOriginal: typeof insertOriginal;
@@ -77,6 +79,8 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
77
79
  captureSelection: typeof captureSelection;
78
80
  restoreSelection: typeof restoreSelection;
79
81
  captureMediaTarget: () => MediaTarget | null;
82
+ whenReady: () => Promise<boolean>;
83
+ captureEndTarget: () => MediaTarget | null;
80
84
  captureMediaTargetAt: (clientX: number, clientY: number) => MediaTarget | null;
81
85
  focus: () => boolean | undefined;
82
86
  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;
@@ -0,0 +1,14 @@
1
+ import { KnowledgeType } from '../public/types';
2
+ export interface FkpKnowledgeTypePickerProps {
3
+ /** 当前工具栏显示的知识类型。 */
4
+ currentType?: KnowledgeType;
5
+ /** add 发出 create 回调;switch 仅发出 select 供宿主确认切换。 */
6
+ mode?: 'add' | 'switch';
7
+ /** button 用于业务页面独立的“添加知识”入口;toolbar 用于富文本工具栏。 */
8
+ trigger?: 'button' | 'toolbar';
9
+ buttonLabel?: string;
10
+ disabled?: boolean;
11
+ /** 可选受控展开状态;不传时组件自行管理。 */
12
+ open?: boolean | null;
13
+ ariaKeyshortcuts?: string;
14
+ }
@@ -0,0 +1,5 @@
1
+ import { DOMOutputSpec } from '@tiptap/pm/model';
2
+ import { TokenAttrs } from '../plugins/token-definition';
3
+ /** Structural templates shared across plugins; no capability IDs are enumerated. */
4
+ export declare function renderBusinessToken(attrs: TokenAttrs): DOMOutputSpec;
5
+ export declare function serializeBusinessToken(attrs: TokenAttrs): string;
@@ -0,0 +1,52 @@
1
+ import { SwitcherOption, SwitcherValue } from './types';
2
+ type __VLS_Props = {
3
+ modelValue?: SwitcherValue;
4
+ options?: SwitcherOption[];
5
+ disabled?: boolean;
6
+ loading?: boolean;
7
+ placeholder?: string;
8
+ ariaLabel?: string;
9
+ iconUrl?: string;
10
+ searchable?: boolean;
11
+ searchPlaceholder?: string;
12
+ };
13
+ declare function __VLS_template(): {
14
+ attrs: Partial<{}>;
15
+ slots: {
16
+ 'option-icon'?(_: {
17
+ option: any;
18
+ }): any;
19
+ icon?(_: {
20
+ option: SwitcherOption | undefined;
21
+ }): any;
22
+ };
23
+ refs: {
24
+ root: HTMLSpanElement;
25
+ };
26
+ rootEl: any;
27
+ };
28
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
29
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
30
+ change: (value: SwitcherValue, option: SwitcherOption) => any;
31
+ "update:modelValue": (value: SwitcherValue) => any;
32
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
33
+ onChange?: ((value: SwitcherValue, option: SwitcherOption) => any) | undefined;
34
+ "onUpdate:modelValue"?: ((value: SwitcherValue) => any) | undefined;
35
+ }>, {
36
+ options: SwitcherOption[];
37
+ disabled: boolean;
38
+ placeholder: string;
39
+ loading: boolean;
40
+ searchPlaceholder: string;
41
+ ariaLabel: string;
42
+ searchable: boolean;
43
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
44
+ root: HTMLSpanElement;
45
+ }, any>;
46
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
47
+ export default _default;
48
+ type __VLS_WithTemplateSlots<T, S> = T & {
49
+ new (): {
50
+ $slots: S;
51
+ };
52
+ };
@@ -0,0 +1,2 @@
1
+ export { default as FkpSwitcher } from './FkpSwitcher.vue';
2
+ export type { SwitcherOption, SwitcherValue } from './types';
@@ -0,0 +1,7 @@
1
+ export type SwitcherValue = string | number | boolean;
2
+ export interface SwitcherOption {
3
+ value: SwitcherValue;
4
+ label: string;
5
+ disabled?: boolean;
6
+ iconUrl?: string;
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freecallai/pro",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "福客AI业务组件库",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -21,11 +21,31 @@
21
21
  "types": "./dist/types/rich-text/index.d.ts",
22
22
  "import": "./dist/rich-text/index.js"
23
23
  },
24
+ "./knowledge-type-picker": {
25
+ "types": "./dist/types/knowledge-type-picker/index.d.ts",
26
+ "import": "./dist/knowledge-type-picker/index.js"
27
+ },
24
28
  "./rich-text/legacy-converter": {
25
29
  "types": "./dist/types/rich-text/legacy-converter/index.d.ts",
26
30
  "import": "./dist/rich-text/legacy-converter/index.js"
27
31
  },
28
- "./style.css": "./dist/style.css"
32
+ "./style.css": "./dist/style.css",
33
+ "./switcher": {
34
+ "types": "./dist/types/switcher/index.d.ts",
35
+ "import": "./dist/switcher/index.js"
36
+ },
37
+ "./edition-info": {
38
+ "types": "./dist/types/edition-info/index.d.ts",
39
+ "import": "./dist/edition-info/index.js"
40
+ },
41
+ "./filters": {
42
+ "types": "./dist/types/filters/index.d.ts",
43
+ "import": "./dist/filters/index.js"
44
+ },
45
+ "./navigation": {
46
+ "types": "./dist/types/navigation/index.d.ts",
47
+ "import": "./dist/navigation/index.js"
48
+ }
29
49
  },
30
50
  "files": [
31
51
  "dist",
@@ -35,7 +55,7 @@
35
55
  "**/*.css"
36
56
  ],
37
57
  "peerDependencies": {
38
- "@freecallai/ui": "^0.0.1",
58
+ "@freecallai/ui": "^0.0.3",
39
59
  "vue": "^3.5.13"
40
60
  },
41
61
  "dependencies": {
@@ -44,7 +64,7 @@
44
64
  "@tiptap/pm": "^3.0.0",
45
65
  "@tiptap/starter-kit": "^3.0.0",
46
66
  "@tiptap/vue-3": "^3.0.0",
47
- "@freecallai/icons": "0.0.1"
67
+ "@freecallai/icons": "0.0.2"
48
68
  },
49
69
  "devDependencies": {
50
70
  "@types/node": "^22.0.0",
@@ -57,15 +77,15 @@
57
77
  "vue": "^3.5.13",
58
78
  "vue-tsc": "^2.2.0",
59
79
  "@arco-design/arco-vue-scripts": "0.2.10",
60
- "@freecallai/ui": "0.0.1"
80
+ "@freecallai/ui": "0.0.3"
61
81
  },
62
82
  "publishConfig": {
63
83
  "registry": "https://registry.npmjs.org/",
64
84
  "access": "public"
65
85
  },
66
86
  "scripts": {
67
- "build": "node scripts/check-rich-text-boundaries.mjs && vue-tsc --noEmit && vite build",
68
- "check:boundaries": "node scripts/check-rich-text-boundaries.mjs",
87
+ "build": "pnpm check:boundaries && vue-tsc --noEmit && vite build",
88
+ "check:boundaries": "node scripts/check-workspace-boundaries.mjs && node scripts/check-rich-text-boundaries.mjs",
69
89
  "docgen": "arco-vue-scripts docgen",
70
90
  "typecheck": "vue-tsc --noEmit",
71
91
  "test": "vitest run"