@rytass/bpm-core-react 0.17.0 → 0.17.1
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/CHANGELOG.md +13 -0
- package/dist/chunks/admin-pickers-BRHk3qKq.cjs +2 -0
- package/dist/chunks/admin-pickers-BRHk3qKq.cjs.map +1 -0
- package/dist/chunks/{admin-pickers-DxhzECkD.js → admin-pickers-Djq3h-UR.js} +41 -39
- package/dist/chunks/admin-pickers-Djq3h-UR.js.map +1 -0
- package/dist/chunks/{categories-DjENouRm.cjs → categories-AxxhqjLZ.cjs} +2 -2
- package/dist/chunks/{categories-DjENouRm.cjs.map → categories-AxxhqjLZ.cjs.map} +1 -1
- package/dist/chunks/{categories-1gKxeEqw.js → categories-riC33J_j.js} +2 -2
- package/dist/chunks/{categories-1gKxeEqw.js.map → categories-riC33J_j.js.map} +1 -1
- package/dist/chunks/{compose-DZ7RKvUp.cjs → compose-B7TtrpQJ.cjs} +2 -2
- package/dist/chunks/{compose-DZ7RKvUp.cjs.map → compose-B7TtrpQJ.cjs.map} +1 -1
- package/dist/chunks/{compose-Crklayzy.js → compose-_pREPtfN.js} +2 -2
- package/dist/chunks/{compose-Crklayzy.js.map → compose-_pREPtfN.js.map} +1 -1
- package/dist/chunks/{designer-D9eFma1W.js → designer-BiywgNXs.js} +2 -2
- package/dist/chunks/{designer-D9eFma1W.js.map → designer-BiywgNXs.js.map} +1 -1
- package/dist/chunks/{designer-sJGTGYOf.cjs → designer-ttAqv859.cjs} +2 -2
- package/dist/chunks/{designer-sJGTGYOf.cjs.map → designer-ttAqv859.cjs.map} +1 -1
- package/dist/chunks/{orgs-Dr0FFoZo.cjs → orgs-C8usknWb.cjs} +2 -2
- package/dist/chunks/{orgs-Dr0FFoZo.cjs.map → orgs-C8usknWb.cjs.map} +1 -1
- package/dist/chunks/{orgs-CY0i1fie.js → orgs-Lg7tXv2u.js} +2 -2
- package/dist/chunks/{orgs-CY0i1fie.js.map → orgs-Lg7tXv2u.js.map} +1 -1
- package/dist/chunks/{users-BCyePbwB.js → users-DRbuDYF1.js} +2 -2
- package/dist/chunks/{users-BCyePbwB.js.map → users-DRbuDYF1.js.map} +1 -1
- package/dist/chunks/{users-DVBJluFR.cjs → users-DVQicZIo.cjs} +2 -2
- package/dist/chunks/{users-DVBJluFR.cjs.map → users-DVQicZIo.cjs.map} +1 -1
- package/dist/components/admin-pickers.d.cts +65 -0
- package/dist/components/approval-instance-list-page.d.cts +17 -0
- package/dist/components/bpm-form-field.d.cts +10 -0
- package/dist/components/bpm-notification-bell-button.d.cts +22 -0
- package/dist/components/dashboard-page.d.cts +7 -0
- package/dist/components/notification-drawer.d.cts +11 -0
- package/dist/components/org-unit-tree-draft-editor.d.cts +24 -0
- package/dist/components/org-unit-tree-draft-editor.d.ts +1 -1
- package/dist/components/pdf-preview.d.cts +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +15 -0
- package/dist/index.d.ts +15 -15
- package/dist/index.js +1 -1
- package/dist/lib/auth-provider.d.cts +37 -0
- package/dist/lib/format-date-time.d.cts +5 -0
- package/dist/lib/format-member-label.d.cts +12 -0
- package/dist/lib/member-profile-resolution.d.cts +48 -0
- package/dist/lib/notification-drawer-provider.d.cts +27 -0
- package/dist/lib/notification-unread-provider.d.cts +25 -0
- package/dist/lib/org-tree-draft.d.cts +27 -0
- package/dist/lib/providers.d.cts +31 -0
- package/dist/lib/router-adapter.d.cts +47 -0
- package/dist/lib/routes-config.d.cts +117 -0
- package/dist/lib/task-node-label.d.cts +10 -0
- package/dist/lib/use-bpm-logout.d.cts +12 -0
- package/dist/lib/use-bpm-member.d.cts +17 -0
- package/dist/next/BPMNextProviders.d.cts +51 -0
- package/dist/next/index.d.cts +2 -0
- package/dist/next/index.d.ts +2 -2
- package/dist/next/workflow-chat-route.d.cts +17 -0
- package/dist/pages/admin/delegations/index.d.cts +4 -0
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.d.cts +4 -0
- package/dist/pages/admin/orgs/index.js +1 -1
- package/dist/pages/admin/users/index.cjs +1 -1
- package/dist/pages/admin/users/index.d.cts +4 -0
- package/dist/pages/admin/users/index.js +1 -1
- package/dist/pages/admin/webhook-endpoints/index.d.cts +4 -0
- package/dist/pages/cc/index.d.cts +16 -0
- package/dist/pages/dashboard/index.d.cts +16 -0
- package/dist/pages/delegations/index.d.cts +4 -0
- package/dist/pages/inbox/index.d.cts +16 -0
- package/dist/pages/instances/detail/index.d.cts +23 -0
- package/dist/pages/instances/new/index.d.cts +20 -0
- package/dist/pages/login/index.d.cts +21 -0
- package/dist/pages/root/index.d.cts +18 -0
- package/dist/pages/search/index.d.cts +16 -0
- package/dist/pages/sent/index.d.cts +16 -0
- package/dist/pages/settings/notifications/index.d.cts +4 -0
- package/dist/pages/templates/categories/index.cjs +1 -1
- package/dist/pages/templates/categories/index.d.cts +4 -0
- package/dist/pages/templates/categories/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.d.cts +25 -0
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.d.cts +8 -0
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/pages/templates/index.d.cts +4 -0
- package/dist/pages/templates/versions/index.d.cts +8 -0
- package/dist/views/admin/delegations/AdminDelegationsView.d.cts +2 -0
- package/dist/views/admin/delegations/index.d.cts +1 -0
- package/dist/views/admin/delegations/index.d.ts +1 -1
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.d.cts +4 -0
- package/dist/views/admin/index.d.ts +4 -4
- package/dist/views/admin/index.js +2 -2
- package/dist/views/admin/orgs/AdminOrgsView.d.cts +2 -0
- package/dist/views/admin/orgs/index.cjs +1 -1
- package/dist/views/admin/orgs/index.d.cts +1 -0
- package/dist/views/admin/orgs/index.d.ts +1 -1
- package/dist/views/admin/orgs/index.js +1 -1
- package/dist/views/admin/users/AdminUsersView.d.cts +2 -0
- package/dist/views/admin/users/MemberTaskReassignModal.d.cts +13 -0
- package/dist/views/admin/users/index.cjs +1 -1
- package/dist/views/admin/users/index.d.cts +1 -0
- package/dist/views/admin/users/index.d.ts +1 -1
- package/dist/views/admin/users/index.js +1 -1
- package/dist/views/admin/webhook-endpoints/AdminWebhookEndpointsView.d.cts +8 -0
- package/dist/views/admin/webhook-endpoints/index.d.cts +1 -0
- package/dist/views/admin/webhook-endpoints/index.d.ts +1 -1
- package/dist/views/cc/CcView.d.cts +7 -0
- package/dist/views/cc/index.d.cts +1 -0
- package/dist/views/cc/index.d.ts +1 -1
- package/dist/views/dashboard/DashboardView.d.cts +7 -0
- package/dist/views/dashboard/index.d.cts +1 -0
- package/dist/views/dashboard/index.d.ts +1 -1
- package/dist/views/delegations/DelegationsView.d.cts +2 -0
- package/dist/views/delegations/index.d.cts +1 -0
- package/dist/views/delegations/index.d.ts +1 -1
- package/dist/views/forms/builder/FormBuilderView.d.cts +18 -0
- package/dist/views/forms/builder/index.d.cts +1 -0
- package/dist/views/forms/builder/index.d.ts +1 -1
- package/dist/views/forms/builder/json-code-editor.d.cts +11 -0
- package/dist/views/forms/renderer/FormRendererView.d.cts +24 -0
- package/dist/views/forms/renderer/FormRendererView.d.ts +1 -1
- package/dist/views/forms/renderer/form-data-source-field.d.cts +65 -0
- package/dist/views/forms/renderer/form-field-link.d.cts +16 -0
- package/dist/views/forms/renderer/index.d.cts +2 -0
- package/dist/views/forms/renderer/index.d.ts +2 -2
- package/dist/views/forms/renderer/member-field-options.d.cts +39 -0
- package/dist/views/forms/renderer/member-field.d.cts +21 -0
- package/dist/views/inbox/InboxView.d.cts +7 -0
- package/dist/views/inbox/index.d.cts +1 -0
- package/dist/views/inbox/index.d.ts +1 -1
- package/dist/views/instances/detail/InstanceDetailView.d.cts +27 -0
- package/dist/views/instances/detail/index.d.cts +7 -0
- package/dist/views/instances/detail/index.d.ts +7 -7
- package/dist/views/instances/detail/sections/InstanceAttachmentsSection.d.cts +15 -0
- package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +36 -0
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +1 -1
- package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +29 -0
- package/dist/views/instances/detail/sections/InstanceSignaturesSection.d.cts +14 -0
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +55 -0
- package/dist/views/instances/detail/sections/InstanceWebhookDeliveriesSection.d.cts +20 -0
- package/dist/views/instances/detail/sections/container-helpers.d.cts +10 -0
- package/dist/views/instances/detail/sections/container-helpers.d.ts +1 -1
- package/dist/views/instances/detail/sections/shared.d.cts +141 -0
- package/dist/views/instances/detail/submitted-by.d.cts +23 -0
- package/dist/views/instances/index.d.cts +1 -0
- package/dist/views/instances/index.d.ts +1 -1
- package/dist/views/instances/new/InstanceNewView.d.cts +15 -0
- package/dist/views/instances/new/index.d.cts +1 -0
- package/dist/views/instances/new/index.d.ts +1 -1
- package/dist/views/login/LoginView.d.cts +47 -0
- package/dist/views/login/index.d.cts +1 -0
- package/dist/views/login/index.d.ts +1 -1
- package/dist/views/root/RootView.d.cts +10 -0
- package/dist/views/root/index.d.cts +1 -0
- package/dist/views/root/index.d.ts +1 -1
- package/dist/views/search/SearchView.d.cts +7 -0
- package/dist/views/search/index.d.cts +1 -0
- package/dist/views/search/index.d.ts +1 -1
- package/dist/views/sent/SentView.d.cts +7 -0
- package/dist/views/sent/index.d.cts +1 -0
- package/dist/views/sent/index.d.ts +1 -1
- package/dist/views/settings/index.d.cts +1 -0
- package/dist/views/settings/index.d.ts +1 -1
- package/dist/views/settings/notifications/SettingsNotificationsView.d.cts +2 -0
- package/dist/views/settings/notifications/index.d.cts +1 -0
- package/dist/views/settings/notifications/index.d.ts +1 -1
- package/dist/views/templates/TemplatesView.d.cts +7 -0
- package/dist/views/templates/categories/TemplateCategoriesView.d.cts +2 -0
- package/dist/views/templates/categories/index.cjs +1 -1
- package/dist/views/templates/categories/index.d.cts +1 -0
- package/dist/views/templates/categories/index.d.ts +1 -1
- package/dist/views/templates/categories/index.js +1 -1
- package/dist/views/templates/compose/TemplateComposeWizardView.d.cts +21 -0
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.d.cts +2 -0
- package/dist/views/templates/compose/index.d.ts +2 -2
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/compose/steps/ComposeFormStep.d.cts +15 -0
- package/dist/views/templates/compose/steps/ComposeReviewStep.d.cts +12 -0
- package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.cts +22 -0
- package/dist/views/templates/compose/use-template-compose-wizard.d.cts +46 -0
- package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.cts +20 -0
- package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.ts +1 -1
- package/dist/views/templates/designer/TemplateDesignerView.d.cts +65 -0
- package/dist/views/templates/designer/chrome-workflow-chat.d.cts +12 -0
- package/dist/views/templates/designer/chrome-workflow-chat.d.ts +1 -1
- package/dist/views/templates/designer/decision-policy-options.d.cts +8 -0
- package/dist/views/templates/designer/designer-version-labels.d.cts +12 -0
- package/dist/views/templates/designer/dry-run-assignee-label.d.cts +28 -0
- package/dist/views/templates/designer/dry-run-sample-data.d.cts +9 -0
- package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +35 -0
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.d.cts +1 -0
- package/dist/views/templates/designer/index.d.ts +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/designer/notify-webhook-designer.d.cts +74 -0
- package/dist/views/templates/designer/position-level-options.d.cts +17 -0
- package/dist/views/templates/designer/use-workflow-chat.d.cts +21 -0
- package/dist/views/templates/designer/use-workflow-chat.d.ts +1 -1
- package/dist/views/templates/designer/use-workflow-designer-controller.d.cts +41 -0
- package/dist/views/templates/designer/workflow-chat-drawer.d.cts +16 -0
- package/dist/views/templates/designer/workflow-chat-drawer.d.ts +1 -1
- package/dist/views/templates/index.cjs +1 -1
- package/dist/views/templates/index.d.cts +3 -0
- package/dist/views/templates/index.d.ts +3 -3
- package/dist/views/templates/index.js +1 -1
- package/dist/views/templates/versions/TemplateVersionsView.d.cts +5 -0
- package/dist/views/templates/versions/index.d.cts +1 -0
- package/dist/views/templates/versions/index.d.ts +1 -1
- package/dist/views/workflow/index.d.cts +4 -0
- package/dist/views/workflow/index.d.ts +4 -4
- package/package.json +387 -147
- package/dist/chunks/admin-pickers-DxhzECkD.js.map +0 -1
- package/dist/chunks/admin-pickers-qe3j--gX.cjs +0 -2
- package/dist/chunks/admin-pickers-qe3j--gX.cjs.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Framework-agnostic view for the BPM "sent" inbox — instances the current
|
|
4
|
+
* member has initiated or submitted on someone's behalf. Mechanical port of
|
|
5
|
+
* `apps/client/src/app/sent/page.tsx`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function SentView(): ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SentView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './SentView';
|
|
1
|
+
export * from './SentView.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './notifications/index.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './notifications';
|
|
1
|
+
export * from './notifications/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SettingsNotificationsView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './SettingsNotificationsView';
|
|
1
|
+
export * from './SettingsNotificationsView.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/categories-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/categories-AxxhqjLZ.cjs");exports.TemplateCategoriesView=e.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TemplateCategoriesView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './TemplateCategoriesView';
|
|
1
|
+
export * from './TemplateCategoriesView.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as TemplateCategoriesView } from "../../../chunks/categories-
|
|
1
|
+
export { t as TemplateCategoriesView } from "../../../chunks/categories-riC33J_j.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export interface TemplateComposeWizardViewProps {
|
|
3
|
+
/**
|
|
4
|
+
* Show the workflow designer AI assistant inside Step 1 (流程設計). Opt-in,
|
|
5
|
+
* default hidden — the server page maps `BPM_AI_ASSISTANT_ENABLED` to it.
|
|
6
|
+
*/
|
|
7
|
+
readonly showAiAssistant?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the LLM backend is configured (host has an API key). When `false`
|
|
10
|
+
* the AI button shows disabled as a placeholder. Default `false`.
|
|
11
|
+
*/
|
|
12
|
+
readonly aiAssistantAvailable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Unified "form + flow" template creation wizard. Walks the user through
|
|
16
|
+
* Step 0 表單設計 → Step 1 流程設計 → Step 2 檢視並發佈, then commits both
|
|
17
|
+
* sides atomically through `composeApprovalTemplateWithForm`. This is the
|
|
18
|
+
* template entry point; the form builder is intentionally controlled here
|
|
19
|
+
* instead of exposed as a standalone `/forms` page.
|
|
20
|
+
*/
|
|
21
|
+
export declare function TemplateComposeWizardView({ aiAssistantAvailable, showAiAssistant, }?: TemplateComposeWizardViewProps): ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/compose-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/compose-B7TtrpQJ.cjs");exports.EMPTY_COMPOSE_FORM_SCHEMA=e.n,exports.EMPTY_COMPOSE_FORM_UI_SCHEMA=e.r,exports.TemplateComposeWizardView=e.t,exports.useTemplateComposeWizard=e.i;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './TemplateComposeWizardView';
|
|
2
|
-
export * from './use-template-compose-wizard';
|
|
1
|
+
export * from './TemplateComposeWizardView.js';
|
|
2
|
+
export * from './use-template-compose-wizard.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as EMPTY_COMPOSE_FORM_SCHEMA, r as EMPTY_COMPOSE_FORM_UI_SCHEMA, t as TemplateComposeWizardView, i as useTemplateComposeWizard } from "../../../chunks/compose-
|
|
1
|
+
export { n as EMPTY_COMPOSE_FORM_SCHEMA, r as EMPTY_COMPOSE_FORM_UI_SCHEMA, t as TemplateComposeWizardView, i as useTemplateComposeWizard } from "../../../chunks/compose-_pREPtfN.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
export interface ComposeFormStepProps {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly categoryId: string | null;
|
|
6
|
+
readonly formSchema: FormDefinitionSchema;
|
|
7
|
+
readonly formUiSchema: FormUiSchema;
|
|
8
|
+
readonly onNameChange: (value: string) => void;
|
|
9
|
+
readonly onCategoryIdChange: (value: string | null) => void;
|
|
10
|
+
readonly onFormChange: (next: {
|
|
11
|
+
readonly schema: FormDefinitionSchema;
|
|
12
|
+
readonly uiSchema: FormUiSchema;
|
|
13
|
+
}) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function ComposeFormStep({ categoryId, formSchema, formUiSchema, name, onCategoryIdChange, onFormChange, onNameChange, }: ComposeFormStepProps): ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
export interface ComposeReviewStepProps {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly formSchema: FormDefinitionSchema;
|
|
7
|
+
readonly formUiSchema: FormUiSchema;
|
|
8
|
+
readonly workflowDefinition: WorkflowDefinition | null;
|
|
9
|
+
readonly initiatorPolicyCel: string | null;
|
|
10
|
+
readonly publishError: string | null;
|
|
11
|
+
}
|
|
12
|
+
export declare function ComposeReviewStep({ formSchema, formUiSchema, initiatorPolicyCel, name, publishError, workflowDefinition, }: ComposeReviewStepProps): ReactElement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
export interface ComposeWorkflowStepProps {
|
|
5
|
+
readonly formSchema: FormDefinitionSchema;
|
|
6
|
+
readonly workflowDefinition: WorkflowDefinition | null;
|
|
7
|
+
readonly initiatorPolicyCel: string | null;
|
|
8
|
+
readonly onWorkflowChange: (definition: WorkflowDefinition) => void;
|
|
9
|
+
readonly onInitiatorPolicyChange: (cel: string | null) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Show the AI assistant button inside the embedded designer's side panel.
|
|
12
|
+
* Follows the same opt-in contract as the standalone designer page; default
|
|
13
|
+
* hidden. Wired up the stack from the server page's `BPM_AI_ASSISTANT_ENABLED`.
|
|
14
|
+
*/
|
|
15
|
+
readonly showAiAssistant?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the LLM backend is configured (host has an API key). When `false`
|
|
18
|
+
* the AI button shows disabled as a placeholder. Default `false`.
|
|
19
|
+
*/
|
|
20
|
+
readonly aiAssistantAvailable?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function ComposeWorkflowStep({ aiAssistantAvailable, formSchema, initiatorPolicyCel, onInitiatorPolicyChange, onWorkflowChange, showAiAssistant, workflowDefinition, }: ComposeWorkflowStepProps): ReactElement;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
2
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
3
|
+
import { ComposeApprovalTemplateWithFormResult } from '@rytass/bpm-core-client/template';
|
|
4
|
+
export type ComposeWizardStep = 0 | 1 | 2;
|
|
5
|
+
export type ComposePublishPhase = 'error' | 'idle' | 'submitting' | 'success';
|
|
6
|
+
export declare const EMPTY_COMPOSE_FORM_SCHEMA: FormDefinitionSchema;
|
|
7
|
+
export declare const EMPTY_COMPOSE_FORM_UI_SCHEMA: FormUiSchema;
|
|
8
|
+
export interface TemplateComposeWizard {
|
|
9
|
+
readonly currentStep: ComposeWizardStep;
|
|
10
|
+
/**
|
|
11
|
+
* Single user-facing name. Persisted to both the template and the form
|
|
12
|
+
* (`templateName` / `formName`) at the `composeApprovalTemplateWithForm`
|
|
13
|
+
* boundary — the DB keeps two columns, the UI keeps one field.
|
|
14
|
+
*/
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly categoryId: string | null;
|
|
17
|
+
readonly formSchema: FormDefinitionSchema;
|
|
18
|
+
readonly formUiSchema: FormUiSchema;
|
|
19
|
+
readonly workflowDefinition: WorkflowDefinition | null;
|
|
20
|
+
readonly initiatorPolicyCel: string | null;
|
|
21
|
+
readonly publishPhase: ComposePublishPhase;
|
|
22
|
+
readonly publishError: string | null;
|
|
23
|
+
readonly canLeaveBasics: boolean;
|
|
24
|
+
readonly goToStep: (step: ComposeWizardStep) => void;
|
|
25
|
+
readonly goNext: () => void;
|
|
26
|
+
readonly goBack: () => void;
|
|
27
|
+
readonly setName: (value: string) => void;
|
|
28
|
+
readonly setCategoryId: (value: string | null) => void;
|
|
29
|
+
readonly setFormValue: (next: {
|
|
30
|
+
readonly schema: FormDefinitionSchema;
|
|
31
|
+
readonly uiSchema: FormUiSchema;
|
|
32
|
+
}) => void;
|
|
33
|
+
readonly setWorkflowDefinition: (definition: WorkflowDefinition) => void;
|
|
34
|
+
readonly setInitiatorPolicyCel: (cel: string | null) => void;
|
|
35
|
+
readonly publish: () => Promise<ComposeApprovalTemplateWithFormResult | null>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Owns the cross-step state for the unified "form + flow" template wizard.
|
|
39
|
+
*
|
|
40
|
+
* Step 0 (表單) edits `formSchema`/`formUiSchema`; that same in-memory schema
|
|
41
|
+
* feeds Step 1 (流程) as the field source for condition branches, so the
|
|
42
|
+
* embedded designer never needs a published form version. Step 2 (檢視發佈)
|
|
43
|
+
* submits everything through the atomic `composeApprovalTemplateWithForm`
|
|
44
|
+
* mutation.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useTemplateComposeWizard(): TemplateComposeWizard;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormFieldDefinition } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { NotifyWebhookTarget } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
import { NotifyWebhookDesignerEndpoint } from './notify-webhook-designer.cjs';
|
|
5
|
+
export type NotifyWebhookCatalogState = 'loading' | 'ready' | 'unavailable';
|
|
6
|
+
export interface NotifyWebhookTargetsEditorProps {
|
|
7
|
+
/** Every endpoint the catalog lists, deprecated ones included. */
|
|
8
|
+
readonly catalog: readonly NotifyWebhookDesignerEndpoint[];
|
|
9
|
+
readonly catalogState: NotifyWebhookCatalogState;
|
|
10
|
+
/** `null` when no form is bound yet, so fields cannot be picked. */
|
|
11
|
+
readonly formFields: readonly FormFieldDefinition[] | null;
|
|
12
|
+
readonly onChange: (targets: readonly NotifyWebhookTarget[]) => void;
|
|
13
|
+
readonly targets: readonly NotifyWebhookTarget[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Edits a NOTIFY node's webhook targets (ADR 18 §3.3). Parameters come from
|
|
17
|
+
* the endpoint catalog, so the author only picks an endpoint and binds each
|
|
18
|
+
* parameter; a URL, header or secret is never shown or entered here.
|
|
19
|
+
*/
|
|
20
|
+
export declare function NotifyWebhookTargetsEditor({ catalog, catalogState, formFields, onChange, targets, }: NotifyWebhookTargetsEditorProps): ReactElement | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { FormFieldDefinition } from '@rytass/bpm-core-shared/form';
|
|
3
3
|
import { NotifyWebhookTarget } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
-
import { NotifyWebhookDesignerEndpoint } from './notify-webhook-designer';
|
|
4
|
+
import { NotifyWebhookDesignerEndpoint } from './notify-webhook-designer.js';
|
|
5
5
|
export type NotifyWebhookCatalogState = 'loading' | 'ready' | 'unavailable';
|
|
6
6
|
export interface NotifyWebhookTargetsEditorProps {
|
|
7
7
|
/** Every endpoint the catalog lists, deprecated ones included. */
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
export interface TemplateDesignerViewProps {
|
|
5
|
+
/**
|
|
6
|
+
* Template id to load. Required in non-embedded mode; unused in embedded mode.
|
|
7
|
+
*/
|
|
8
|
+
readonly templateId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* When `true`, the component operates in embedded / wizard mode:
|
|
11
|
+
* - No `readTemplateDesigner` call (no templateId needed).
|
|
12
|
+
* - Only org data is loaded for approver pickers.
|
|
13
|
+
* - PageHeader / ContentHeader, form-version binding, and dry-run are hidden.
|
|
14
|
+
* - The AI assistant, when `showAiAssistant` is set, is offered through a
|
|
15
|
+
* button in the side "流程工具" panel (the PageHeader button it normally
|
|
16
|
+
* lives in is hidden here), and drives the same embedded canvas.
|
|
17
|
+
* - Mutations flow out via `onWorkflowChange` / `onInitiatorPolicyChange`
|
|
18
|
+
* rather than save-draft / publish actions.
|
|
19
|
+
* Default `false`.
|
|
20
|
+
*/
|
|
21
|
+
readonly embedded?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* In embedded mode: the formSchema used for condition-edge compilation,
|
|
24
|
+
* injected from outside (e.g. the wizard already knows the form). Replaces
|
|
25
|
+
* the "bind form version" picker. Pass `null` to clear.
|
|
26
|
+
*/
|
|
27
|
+
readonly formSchemaOverride?: FormDefinitionSchema | null;
|
|
28
|
+
/**
|
|
29
|
+
* In embedded mode: the initial workflow definition to seed the canvas.
|
|
30
|
+
* Falls back to an empty start→end workflow when omitted.
|
|
31
|
+
*/
|
|
32
|
+
readonly initialWorkflowDefinition?: WorkflowDefinition;
|
|
33
|
+
/**
|
|
34
|
+
* In embedded mode: the initial initiator-policy CEL expression.
|
|
35
|
+
* Falls back to `null` (no policy) when omitted.
|
|
36
|
+
*/
|
|
37
|
+
readonly initialInitiatorPolicyCel?: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* In embedded mode: called whenever the workflow definition changes so the
|
|
40
|
+
* host can persist the current canvas state.
|
|
41
|
+
*/
|
|
42
|
+
readonly onWorkflowChange?: (definition: WorkflowDefinition) => void;
|
|
43
|
+
/**
|
|
44
|
+
* In embedded mode: called whenever the initiator-policy CEL changes.
|
|
45
|
+
*/
|
|
46
|
+
readonly onInitiatorPolicyChange?: (cel: string | null) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Render the "試跑流程" (dry-run) button at all. Default `true`. Hosts can
|
|
49
|
+
* pass `false` to hide it (e.g. deployments that don't expose dry-run).
|
|
50
|
+
* Has no effect in embedded mode, where the PageHeader is hidden entirely.
|
|
51
|
+
*/
|
|
52
|
+
readonly showDryRun?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Render the AI assistant toggle at all. Default `false` — the feature is
|
|
55
|
+
* hidden unless the host opts in (e.g. a deployment that has it configured).
|
|
56
|
+
*/
|
|
57
|
+
readonly showAiAssistant?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the LLM backend is configured (e.g. the host has an API key set).
|
|
60
|
+
* Default `true`. When `false`, the toggle is shown but disabled and labelled
|
|
61
|
+
* as not configured — a placeholder rather than a broken feature.
|
|
62
|
+
*/
|
|
63
|
+
readonly aiAssistantAvailable?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare function TemplateDesignerView({ aiAssistantAvailable, embedded, formSchemaOverride, initialInitiatorPolicyCel, initialWorkflowDefinition, onInitiatorPolicyChange, onWorkflowChange, showAiAssistant, showDryRun, templateId, }: TemplateDesignerViewProps): ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UIMessage } from 'ai';
|
|
2
|
+
import { WorkflowDesignerController } from './use-workflow-designer-controller.cjs';
|
|
3
|
+
export interface UseChromeWorkflowChatResult {
|
|
4
|
+
/** True only when the on-device model is usable in this browser. */
|
|
5
|
+
readonly available: boolean;
|
|
6
|
+
readonly messages: readonly UIMessage[];
|
|
7
|
+
readonly status: 'ready' | 'submitted' | 'streaming' | 'error';
|
|
8
|
+
readonly send: (text: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useChromeWorkflowChat({ controller, }: {
|
|
11
|
+
readonly controller: WorkflowDesignerController;
|
|
12
|
+
}): UseChromeWorkflowChatResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UIMessage } from 'ai';
|
|
2
|
-
import { WorkflowDesignerController } from './use-workflow-designer-controller';
|
|
2
|
+
import { WorkflowDesignerController } from './use-workflow-designer-controller.js';
|
|
3
3
|
export interface UseChromeWorkflowChatResult {
|
|
4
4
|
/** True only when the on-device model is usable in this browser. */
|
|
5
5
|
readonly available: boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DecisionPolicy } from '@rytass/bpm-core-shared/workflow';
|
|
2
|
+
export type DecisionPolicyOption = Readonly<{
|
|
3
|
+
id: DecisionPolicy['type'];
|
|
4
|
+
name: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const DECISION_POLICY_OPTIONS: readonly DecisionPolicyOption[];
|
|
7
|
+
export declare function readDecisionPolicyHint(policy: DecisionPolicy | undefined): string;
|
|
8
|
+
export declare function readDecisionPolicyOption(type: DecisionPolicy['type']): DecisionPolicyOption;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Header line of the designer. A published template version is named
|
|
3
|
+
* explicitly because the bound form's own version sits right below it, and a
|
|
4
|
+
* reader seeing only "v1" there takes it for the template's version.
|
|
5
|
+
*/
|
|
6
|
+
export declare function readTemplateVersionDescription(input: {
|
|
7
|
+
draftVersion: number | null;
|
|
8
|
+
hasPublishedVersion: boolean;
|
|
9
|
+
publishedVersion: number | null;
|
|
10
|
+
}): string;
|
|
11
|
+
/** The bound form's version, labelled so it is not mistaken for the template's. */
|
|
12
|
+
export declare function readFormVersionLabel(formName: string, version: number): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type NamedRecord = Readonly<{
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}>;
|
|
5
|
+
type FormFieldRecord = Readonly<{
|
|
6
|
+
fieldKey: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type DryRunAssigneeDirectory = Readonly<{
|
|
10
|
+
/** Fields of the schema the dry run samples, to name a member placeholder. */
|
|
11
|
+
formFields: readonly FormFieldRecord[];
|
|
12
|
+
/** Display name of a real member id, or `null` when it is not known. */
|
|
13
|
+
memberName: (memberId: string) => string | null;
|
|
14
|
+
orgUnits: readonly NamedRecord[];
|
|
15
|
+
positions: readonly NamedRecord[];
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* The dry run cannot know who a position / org-unit / manager-chain resolver
|
|
19
|
+
* would pick (that depends on the submitter and the directory at submit
|
|
20
|
+
* time), so the engine reports a `<kind>:<ids>` placeholder instead of a
|
|
21
|
+
* member id. This turns each placeholder into a sentence a template author can
|
|
22
|
+
* read; a real member id becomes the member's name, and anything else is
|
|
23
|
+
* returned untouched so an unexpected value stays visible.
|
|
24
|
+
*
|
|
25
|
+
* The placeholder shapes mirror `resolveDryRunAssigneeMemberId` in the engine.
|
|
26
|
+
*/
|
|
27
|
+
export declare function readDryRunAssigneeLabel(assignee: string, directory: DryRunAssigneeDirectory): string;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
|
|
2
|
+
export declare function readDryRunSampleFormData(schema: FormDefinitionSchema | null): Readonly<Record<string, unknown>>;
|
|
3
|
+
/**
|
|
4
|
+
* Sample value of a member field: a placeholder the dry-run result labels as
|
|
5
|
+
* "whoever this field names", never the dry-run initiator — a real submitter
|
|
6
|
+
* picks someone else, and sampling the initiator would make a node that
|
|
7
|
+
* excludes the initiator look skipped or stopped when it would not be.
|
|
8
|
+
*/
|
|
9
|
+
export declare function readDryRunFormMemberPlaceholder(fieldKey: string): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
|
|
2
|
+
export type MemberFieldOption = Readonly<{
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
/**
|
|
6
|
+
* Set when the field can be empty at submit time (optional, hidden by a
|
|
7
|
+
* visibility rule, or a store-only hidden field); the node would then find no
|
|
8
|
+
* approver, so publishing refuses it. Still selectable, so the stored choice
|
|
9
|
+
* stays visible until the form or the node is fixed.
|
|
10
|
+
*/
|
|
11
|
+
warning?: string;
|
|
12
|
+
}>;
|
|
13
|
+
export type DynamicFormFieldChoice = Readonly<{
|
|
14
|
+
/** What the picker offers; includes the stale stored key when there is one. */
|
|
15
|
+
options: readonly MemberFieldOption[];
|
|
16
|
+
/** Hint under the picker, or `null` when nothing needs saying. */
|
|
17
|
+
problem: string | null;
|
|
18
|
+
selected: MemberFieldOption | null;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const NO_MEMBER_FIELD_HINT = "\u8868\u55AE\u4E2D\u6C92\u6709\u300C\u4EBA\u54E1\u9078\u64C7\u300D\u6B04\u4F4D\uFF0C\u8ACB\u5148\u5230\u8868\u55AE\u8A2D\u8A08\u52A0\u5165";
|
|
21
|
+
/** Only member fields can feed a 依表單欄位指定 approver resolver. */
|
|
22
|
+
export declare function readMemberFieldOptions(schema: FormDefinitionSchema | null): readonly MemberFieldOption[];
|
|
23
|
+
/**
|
|
24
|
+
* The member-field picker for the 依表單欄位指定 resolver. A stored `formPath`
|
|
25
|
+
* that no longer names a member field of the bound form (the form was switched
|
|
26
|
+
* or edited, or the template came from the API) stays visible as its own
|
|
27
|
+
* option together with a warning, instead of being cleared behind the user's
|
|
28
|
+
* back — the resolver stays invalid until a real field is chosen.
|
|
29
|
+
*/
|
|
30
|
+
export declare function readDynamicFormFieldChoice(schema: FormDefinitionSchema | null, formPath: string): DynamicFormFieldChoice;
|
|
31
|
+
/**
|
|
32
|
+
* 依表單欄位:<label>; the field key when the form does not have it (any
|
|
33
|
+
* more), and a marker when the key names something that is not a member field.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readDynamicFormSummary(schema: FormDefinitionSchema | null, formPath: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/designer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/designer-ttAqv859.cjs");exports.TemplateDesignerView=e.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TemplateDesignerView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './TemplateDesignerView';
|
|
1
|
+
export * from './TemplateDesignerView.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as TemplateDesignerView } from "../../../chunks/designer-
|
|
1
|
+
export { t as TemplateDesignerView } from "../../../chunks/designer-BiywgNXs.js";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { FormFieldDefinition } from '@rytass/bpm-core-shared/form';
|
|
2
|
+
import { NotifyWebhookBindingSource, NotifyWebhookContextPath, NotifyWebhookParameterType, NotifyWebhookTarget, WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
3
|
+
import { NotifyWebhookEndpointContract } from '@rytass/bpm-core-shared/workflow-graph';
|
|
4
|
+
export type NotifyWebhookBindingKind = NotifyWebhookBindingSource['kind'];
|
|
5
|
+
/** The catalog fields the designer reads; a subset of the client record. */
|
|
6
|
+
export interface NotifyWebhookDesignerEndpoint extends NotifyWebhookEndpointContract {
|
|
7
|
+
readonly deprecated: boolean;
|
|
8
|
+
readonly description: string | null;
|
|
9
|
+
/** Switched off by an administrator (database endpoints). */
|
|
10
|
+
readonly disabled?: boolean;
|
|
11
|
+
readonly key: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly parameters: readonly {
|
|
14
|
+
readonly description: string | null;
|
|
15
|
+
readonly key: string;
|
|
16
|
+
readonly label: string;
|
|
17
|
+
readonly required: boolean;
|
|
18
|
+
readonly type: NotifyWebhookParameterType;
|
|
19
|
+
}[];
|
|
20
|
+
/** `DATABASE` endpoints are maintained in the back office. */
|
|
21
|
+
readonly source?: 'DATABASE' | 'REGISTRY';
|
|
22
|
+
readonly version: number;
|
|
23
|
+
}
|
|
24
|
+
type DesignerParameter = NotifyWebhookDesignerEndpoint['parameters'][number];
|
|
25
|
+
export declare const NOTIFY_WEBHOOK_CONTEXT_PATH_LABELS: Readonly<Record<NotifyWebhookContextPath, string>>;
|
|
26
|
+
export declare const NOTIFY_WEBHOOK_PARAMETER_TYPE_LABELS: Readonly<Record<NotifyWebhookParameterType, string>>;
|
|
27
|
+
export declare function readNotifyWebhookEndpointOptionId(endpoint: {
|
|
28
|
+
readonly key: string;
|
|
29
|
+
readonly version: number;
|
|
30
|
+
}): string;
|
|
31
|
+
export declare function findNotifyWebhookEndpoint(endpoints: readonly NotifyWebhookDesignerEndpoint[], reference: {
|
|
32
|
+
readonly key: string;
|
|
33
|
+
readonly version: number;
|
|
34
|
+
}): NotifyWebhookDesignerEndpoint | null;
|
|
35
|
+
/**
|
|
36
|
+
* The sources a parameter can take. A `CONTEXT` path is always a string, and
|
|
37
|
+
* a `CONSTANT` cannot hold a list, so those are only offered where they fit.
|
|
38
|
+
*/
|
|
39
|
+
export declare function readNotifyWebhookBindingKinds(type: NotifyWebhookParameterType): readonly NotifyWebhookBindingKind[];
|
|
40
|
+
export declare function readCompatibleFormFields(formFields: readonly FormFieldDefinition[], type: NotifyWebhookParameterType): readonly FormFieldDefinition[];
|
|
41
|
+
/** The value a binding starts with when its source kind is picked. */
|
|
42
|
+
export declare function createNotifyWebhookBindingSource(kind: NotifyWebhookBindingKind, parameter: DesignerParameter, formFields: readonly FormFieldDefinition[]): NotifyWebhookBindingSource;
|
|
43
|
+
/**
|
|
44
|
+
* Reads a typed constant from a text input. A number parameter takes plain
|
|
45
|
+
* decimals only (no `0x1f`, no exponent); anything else, including a number
|
|
46
|
+
* still being typed such as `1.`, stays text so the publish check can point
|
|
47
|
+
* at it instead of the input silently changing what was typed.
|
|
48
|
+
*/
|
|
49
|
+
export declare function readNotifyWebhookConstantValue(type: NotifyWebhookParameterType, raw: string): boolean | number | string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the editor can render a node's `webhooks` at all. Parsed JSON is
|
|
52
|
+
* saved as a draft without the structural lint, so a hand-edited list may
|
|
53
|
+
* hold values the editor would throw on.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isNotifyWebhookListEditable(webhooks: unknown): boolean;
|
|
56
|
+
/** Sets, or with `null` removes, the binding for one parameter. */
|
|
57
|
+
export declare function setNotifyWebhookBinding(target: NotifyWebhookTarget, parameter: string, from: NotifyWebhookBindingSource | null): NotifyWebhookTarget;
|
|
58
|
+
/**
|
|
59
|
+
* Points a target at another endpoint, keeping the id (deliveries are keyed
|
|
60
|
+
* by it) and every binding whose parameter the new endpoint still declares
|
|
61
|
+
* with a type the bound value fits.
|
|
62
|
+
*/
|
|
63
|
+
export declare function switchNotifyWebhookEndpoint(target: NotifyWebhookTarget, endpoint: NotifyWebhookDesignerEndpoint, formFields: readonly FormFieldDefinition[]): NotifyWebhookTarget;
|
|
64
|
+
/**
|
|
65
|
+
* The publish check the backend runs against the catalog, worded for the
|
|
66
|
+
* designer. Only structurally valid targets are checked; shape problems are
|
|
67
|
+
* already reported by the shared structural lint.
|
|
68
|
+
*/
|
|
69
|
+
export declare function readNotifyWebhookDesignerIssues({ definition, endpoints, formFields, }: {
|
|
70
|
+
readonly definition: WorkflowDefinition;
|
|
71
|
+
readonly endpoints: readonly NotifyWebhookDesignerEndpoint[];
|
|
72
|
+
readonly formFields: readonly FormFieldDefinition[];
|
|
73
|
+
}): readonly string[];
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PositionRecord } from '@rytass/bpm-core-client/organization';
|
|
2
|
+
export type PositionLevelOption = Readonly<{
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: number;
|
|
6
|
+
}>;
|
|
7
|
+
type PositionLevelSource = Pick<PositionRecord, 'level' | 'name'>;
|
|
8
|
+
/**
|
|
9
|
+
* One option per distinct position level in the directory, highest first, each
|
|
10
|
+
* labelled with the positions sitting on that level. A saved level that no
|
|
11
|
+
* position carries (positions deleted or not loaded yet) is still offered so
|
|
12
|
+
* the select never renders blank and the stored value is not silently changed.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readMinPositionLevelOptions(positions: readonly PositionLevelSource[], currentLevel: number): readonly PositionLevelOption[];
|
|
15
|
+
/** The highest level in the directory, or `1` when there are no positions. */
|
|
16
|
+
export declare function readDefaultMinPositionLevel(positions: readonly PositionLevelSource[]): number;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UseChatHelpers } from '@ai-sdk/react';
|
|
2
|
+
import { UIMessage } from 'ai';
|
|
3
|
+
import { WorkflowDesignerController } from './use-workflow-designer-controller.cjs';
|
|
4
|
+
/**
|
|
5
|
+
* Connects the workflow designer chat UI to the LLM.
|
|
6
|
+
*
|
|
7
|
+
* The server route (`@rytass/bpm-core-react/next/workflow-chat-route`) advertises
|
|
8
|
+
* the workflow tools with no `execute`, so every tool call is forwarded here.
|
|
9
|
+
* `onToolCall` runs it against the same {@link WorkflowDesignerController} the UI
|
|
10
|
+
* uses — so the assistant draws on the canvas exactly as a user would — and feeds
|
|
11
|
+
* the resulting snapshot back to the model, forming the observe→act loop.
|
|
12
|
+
*
|
|
13
|
+
* All tools are dynamic on the client (their names are not statically wired into
|
|
14
|
+
* `useChat`), so we handle (not skip) `toolCall.dynamic`.
|
|
15
|
+
*/
|
|
16
|
+
export interface UseWorkflowChatOptions {
|
|
17
|
+
readonly controller: WorkflowDesignerController;
|
|
18
|
+
/** Chat API route. Defaults to same-origin `/api/chat`. */
|
|
19
|
+
readonly api?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function useWorkflowChat({ controller, api, }: UseWorkflowChatOptions): UseChatHelpers<UIMessage>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseChatHelpers } from '@ai-sdk/react';
|
|
2
2
|
import { UIMessage } from 'ai';
|
|
3
|
-
import { WorkflowDesignerController } from './use-workflow-designer-controller';
|
|
3
|
+
import { WorkflowDesignerController } from './use-workflow-designer-controller.js';
|
|
4
4
|
/**
|
|
5
5
|
* Connects the workflow designer chat UI to the LLM.
|
|
6
6
|
*
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { WorkflowCommand, WorkflowCommandResult, WorkflowDesignerState, WorkflowMacroCommand, WorkflowDirectory, WorkflowSnapshot, WorkflowTool, WorkflowToolResult } from '@rytass/bpm-core-shared';
|
|
2
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
3
|
+
/**
|
|
4
|
+
* Bridges the pure, framework-agnostic workflow command layer
|
|
5
|
+
* (`@rytass/bpm-core-shared`) to React. It owns the {@link WorkflowDesignerState}
|
|
6
|
+
* and is the single dispatch path through which both the designer UI and the
|
|
7
|
+
* LLM assistant mutate the workflow — guaranteeing the assistant can do exactly
|
|
8
|
+
* what a user can.
|
|
9
|
+
*
|
|
10
|
+
* The pure reducer only describes logical structure; this hook injects the
|
|
11
|
+
* pixel concern: whenever a command reports `effects.layout`, the supplied
|
|
12
|
+
* `layout` function (dagre) recomputes node positions, and `onLayout` is invoked
|
|
13
|
+
* so the host can refit the viewport.
|
|
14
|
+
*/
|
|
15
|
+
export interface UseWorkflowDesignerControllerOptions {
|
|
16
|
+
readonly initialState: WorkflowDesignerState;
|
|
17
|
+
/** Recompute node pixel positions (dagre) — runs after topology changes. */
|
|
18
|
+
readonly layout: (definition: WorkflowDefinition) => WorkflowDefinition;
|
|
19
|
+
/** Notified with the laid-out definition so the host can refit the viewport. */
|
|
20
|
+
readonly onLayout?: (definition: WorkflowDefinition) => void;
|
|
21
|
+
/** Org directory backing the LLM's member/org lookup query tools. */
|
|
22
|
+
readonly directory?: WorkflowDirectory;
|
|
23
|
+
}
|
|
24
|
+
export interface WorkflowDesignerController {
|
|
25
|
+
readonly state: WorkflowDesignerState;
|
|
26
|
+
readonly snapshot: WorkflowSnapshot;
|
|
27
|
+
/** The advertised LLM tool catalog (JSON Schema input contracts). */
|
|
28
|
+
readonly tools: readonly WorkflowTool[];
|
|
29
|
+
/** Dispatch a single primitive command. */
|
|
30
|
+
readonly dispatch: (command: WorkflowCommand) => WorkflowCommandResult;
|
|
31
|
+
/** Dispatch a high-level macro command. */
|
|
32
|
+
readonly dispatchMacro: (command: WorkflowMacroCommand) => WorkflowCommandResult;
|
|
33
|
+
/** Execute an LLM tool call by name; mutations commit + relayout. Async
|
|
34
|
+
* because directory query tools may fetch from the host. */
|
|
35
|
+
readonly executeTool: (toolName: string, input: unknown) => Promise<WorkflowToolResult>;
|
|
36
|
+
/** Replace the whole state (e.g. after loading a draft from the server). */
|
|
37
|
+
readonly replaceState: (next: WorkflowDesignerState | ((current: WorkflowDesignerState) => WorkflowDesignerState)) => void;
|
|
38
|
+
/** Imperatively read the latest committed state (avoids stale closures). */
|
|
39
|
+
readonly getState: () => WorkflowDesignerState;
|
|
40
|
+
}
|
|
41
|
+
export declare function useWorkflowDesignerController({ directory, initialState, layout, onLayout, }: UseWorkflowDesignerControllerOptions): WorkflowDesignerController;
|