@nocobase/client 2.1.0-beta.15 → 2.1.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/ai/index.d.ts CHANGED
@@ -8,4 +8,5 @@
8
8
  */
9
9
  export * from './ai-manager';
10
10
  export * from './tools-manager';
11
+ export * from './skills-manager';
11
12
  export * from './utils';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export * from './types';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export type SkillsScope = 'SPECIFIED' | 'GENERAL' | 'CUSTOM';
10
+ export type SkillsEntry = {
11
+ scope: SkillsScope;
12
+ name: string;
13
+ description: string;
14
+ content?: string;
15
+ tools?: string[];
16
+ title?: string;
17
+ about?: string;
18
+ from?: string;
19
+ };
20
+ export type SkillsFilter = {
21
+ scope?: SkillsScope;
22
+ name?: string;
23
+ };
@@ -7,6 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import type { ComponentType } from 'react';
10
+ import type { ModalProps } from 'antd';
10
11
  import type { Application } from '../../application';
11
12
  import { Registry } from '@nocobase/utils/client';
12
13
  export interface ToolsManager extends ToolsRegistration {
@@ -16,12 +17,18 @@ export interface ToolsManager extends ToolsRegistration {
16
17
  export interface ToolsRegistration {
17
18
  registerTools(name: string, options: ToolsOptions): void;
18
19
  }
20
+ export type ToolModalProps = Pick<ModalProps, 'width' | 'styles'>;
19
21
  export type ToolsOptions = {
20
22
  ui?: {
21
23
  card?: ComponentType<ToolsUIProperties>;
22
24
  modal?: {
23
25
  title?: string;
24
26
  okText?: string;
27
+ props?: ToolModalProps;
28
+ footer?: ComponentType<{
29
+ tool: ToolCall;
30
+ }>;
31
+ hideOkButton?: boolean;
25
32
  useOnOk?: (decisions: ToolsUIProperties['decisions'], adjustArgs: Record<string, any>) => {
26
33
  onOk: () => void | Promise<void>;
27
34
  };
@@ -47,6 +54,7 @@ export type ToolCall<T = unknown> = {
47
54
  export type FrontendTools = ToolsOptions;
48
55
  export type BackendTools = {
49
56
  scope: Scope;
57
+ from: From;
50
58
  defaultPermission?: Permission;
51
59
  silence?: boolean;
52
60
  introduction?: {
@@ -69,12 +77,14 @@ export type ToolsUIProperties<ToolCallArgs = unknown> = {
69
77
  export type DecisionActions = {
70
78
  approve: () => Promise<void>;
71
79
  edit: (args: any) => Promise<void>;
72
- reject: (message: string) => Promise<void>;
80
+ reject: (message?: string) => Promise<void>;
73
81
  };
74
82
  export type ToolsFilter = {
75
83
  scope?: Scope;
76
84
  defaultPermission?: Permission;
77
85
  silence?: boolean;
86
+ sessionId?: string;
78
87
  };
79
88
  export type Scope = 'SPECIFIED' | 'GENERAL' | 'CUSTOM';
80
89
  export type Permission = 'ASK' | 'ALLOW';
90
+ export type From = 'loader' | 'workflow' | 'mcp';
@@ -18,7 +18,7 @@ import { SchemaInitializer, SchemaInitializerManager } from './schema-initialize
18
18
  import { SchemaSettings, SchemaSettingsItemType, SchemaSettingsManager } from './schema-settings';
19
19
  import { CollectionFieldInterfaceComponentOption } from '../data-source/collection-field-interface/CollectionFieldInterface';
20
20
  import { DataSourceManager, type DataSourceManagerOptions } from '../data-source/data-source/DataSourceManager';
21
- import { FlowEngine, FlowEngineContext } from '@nocobase/flow-engine';
21
+ import { FlowEngine, FlowEngineContext, FlowModel } from '@nocobase/flow-engine';
22
22
  import type { CollectionFieldInterfaceFactory } from '../data-source';
23
23
  import type { Plugin } from './Plugin';
24
24
  import type { RequireJS } from './utils/requirejs';
@@ -105,6 +105,7 @@ export declare class Application {
105
105
  globalVarCtxs: Record<string, any>;
106
106
  jsonLogic: JsonLogic;
107
107
  flowEngine: FlowEngine;
108
+ model: ApplicationModel;
108
109
  context: FlowEngineContext & {
109
110
  pluginSettingsRouter: PluginSettingsManager;
110
111
  pluginManager: PluginManager;
@@ -203,4 +204,7 @@ export declare class Application {
203
204
  Component: ComponentType;
204
205
  }): void;
205
206
  }
207
+ declare class ApplicationModel extends FlowModel {
208
+ render(): React.JSX.Element;
209
+ }
206
210
  export {};
@@ -21,7 +21,9 @@ export declare class TableColumnModel extends DisplayItemModel {
21
21
  afterAddAsSubModel(): Promise<void>;
22
22
  renderHiddenInConfig(): React.ReactNode | undefined;
23
23
  static defineChildren(ctx: FlowModelContext): any;
24
- getColumnProps(): TableColumnProps;
24
+ getColumnProps(): TableColumnProps & {
25
+ sortField?: string;
26
+ };
25
27
  onInit(options: any): void;
26
28
  renderItem(): any;
27
29
  }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ type AssociationTitleFieldModel = {
10
+ fieldPath?: string;
11
+ props?: {
12
+ dataIndex?: string;
13
+ titleField?: string;
14
+ };
15
+ collectionField?: {
16
+ name?: string;
17
+ targetCollectionTitleFieldName?: string;
18
+ isAssociationField?: () => boolean;
19
+ };
20
+ getStepParams?: (flowKey: string, stepKey: string) => {
21
+ label?: string;
22
+ } | undefined;
23
+ };
24
+ export declare function getSavedAssociationTitleField(model: AssociationTitleFieldModel): string;
25
+ export declare function getTableColumnSortField(model: AssociationTitleFieldModel): string;
26
+ export declare function resolveTableSorterField(sorter: {
27
+ field?: string;
28
+ column?: {
29
+ sortField?: string;
30
+ };
31
+ }): string;
32
+ export {};
package/es/index.css CHANGED
@@ -1 +1 @@
1
- ::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--colorBgScrollTrack)}::-webkit-scrollbar-thumb{background:var(--colorBgScrollBar);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)}::-webkit-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)}.rc-virtual-list-scrollbar-thumb{background:var(--colorBgScrollBar)!important}.rc-virtual-list-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)!important}.rc-virtual-list-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)!important}.ant-menu-submenu-popup{-webkit-backdrop-filter:none;backdrop-filter:none}.ant-menu-item.ant-menu-item-only-child.ant-pro-base-menu-horizontal-menu-item:active{background-color:var(--colorBgMenuItemSelected)!important}.nb-hidden{display:none}.nb-dialog-overflow-hidden .ant-modal-content{overflow:hidden}.ant-layout-sider .ant-menu{background:var(--colorBgSider)!important}.ant-layout-sider .ant-menu .ant-menu-item{color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-item:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-item:active{background-color:var(--colorBgSiderMenuActive)!important}.ant-layout-sider .ant-menu .ant-menu-item.ant-menu-item-selected{background-color:var(--colorBgSiderMenuActive)!important;color:var(--colorTextSiderMenuActive)!important}.ant-layout-sider .ant-menu .ant-menu-submenu .ant-menu-submenu-title{color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-submenu .ant-menu-submenu-title:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-submenu.ant-menu-submenu-selected .ant-menu-submenu-title{color:var(--colorTextSiderMenuActive)!important;color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-submenu.ant-menu-submenu-selected .ant-menu-submenu-title:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-submenu.ant-menu-submenu-selected.ant-menu-submenu-selected>.ant-menu-submenu-title{color:var(--colorTextSiderMenuActive)!important}.ant-btn.ant-btn-danger{text-shadow:none;box-shadow:none}.ant-formily-item-label{color:#000000d9;font-weight:600}.ant-table-pagination.ant-pagination{margin-bottom:0!important}.ant-formily-item{font-size:inherit!important}.ant-formily-item-bordered-none .ant-formily-item-feedback-layout-loose{margin-bottom:0!important}.ant-formily-item-control-content-component .ant-tag{white-space:pre-wrap}html body{--adm-font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}
1
+ ::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--colorBgScrollTrack)}::-webkit-scrollbar-thumb{background:var(--colorBgScrollBar);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)}::-webkit-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)}.rc-virtual-list-scrollbar-thumb{background:var(--colorBgScrollBar)!important}.rc-virtual-list-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)!important}.rc-virtual-list-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)!important}.ant-menu-submenu-popup{-webkit-backdrop-filter:none;backdrop-filter:none}.ant-menu-item.ant-menu-item-only-child.ant-pro-base-menu-horizontal-menu-item:active{background-color:var(--colorBgMenuItemSelected)!important}.nb-hidden{display:none}.nb-dialog-overflow-hidden .ant-modal-content{overflow:hidden}.ant-layout-sider .ant-menu{background:var(--colorBgSider)!important}.ant-layout-sider .ant-menu .ant-menu-item{color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-item:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-item:active{background-color:var(--colorBgSiderMenuActive)!important}.ant-layout-sider .ant-menu .ant-menu-item.ant-menu-item-selected{background-color:var(--colorBgSiderMenuActive)!important;color:var(--colorTextSiderMenuActive)!important}.ant-layout-sider .ant-menu .ant-menu-submenu .ant-menu-submenu-title{color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-submenu .ant-menu-submenu-title:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-submenu.ant-menu-submenu-selected .ant-menu-submenu-title{color:var(--colorTextSiderMenu)!important}.ant-layout-sider .ant-menu .ant-menu-submenu.ant-menu-submenu-selected .ant-menu-submenu-title:hover{background-color:var(--colorBgSiderMenuHover)!important;color:var(--colorTextSiderMenuHover)!important}.ant-layout-sider .ant-menu .ant-menu-submenu.ant-menu-submenu-selected.ant-menu-submenu-selected>.ant-menu-submenu-title{color:var(--colorTextSiderMenuActive)!important}.ant-btn.ant-btn-danger{text-shadow:none;box-shadow:none}.ant-formily-item-label{color:#000000d9;font-weight:600}.ant-table-pagination.ant-pagination{margin-bottom:0!important}.ant-formily-item{font-size:inherit!important}.ant-formily-item-bordered-none .ant-formily-item-feedback-layout-loose{margin-bottom:0!important}.ant-formily-item-control-content-component .ant-tag{white-space:pre-wrap}html body{--adm-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}