@rytass/bpm-core-react 0.18.1 → 0.20.0
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 +52 -0
- package/dist/chunks/{FormBuilderView-vQfVc08Z.js → FormBuilderView-CFRiw04B.js} +563 -475
- package/dist/chunks/FormBuilderView-CFRiw04B.js.map +1 -0
- package/dist/chunks/FormBuilderView-CpUgbSbt.cjs +3 -0
- package/dist/chunks/FormBuilderView-CpUgbSbt.cjs.map +1 -0
- package/dist/chunks/FormRendererView-GfbVWEGa.js +1321 -0
- package/dist/chunks/FormRendererView-GfbVWEGa.js.map +1 -0
- package/dist/chunks/FormRendererView-lYSaR8CQ.cjs +6 -0
- package/dist/chunks/FormRendererView-lYSaR8CQ.cjs.map +1 -0
- package/dist/chunks/{compose-DtfX8DQ9.cjs → compose-Bb5bUVFd.cjs} +2 -2
- package/dist/chunks/{compose-DtfX8DQ9.cjs.map → compose-Bb5bUVFd.cjs.map} +1 -1
- package/dist/chunks/{compose-D9ipJpF_.js → compose-egQlRjuZ.js} +5 -4
- package/dist/chunks/{compose-D9ipJpF_.js.map → compose-egQlRjuZ.js.map} +1 -1
- package/dist/chunks/{delegations-BfhCDz5e.js → delegations-9-yvWWws.js} +3 -2
- package/dist/chunks/delegations-9-yvWWws.js.map +1 -0
- package/dist/chunks/delegations-CVmtpkRn.cjs +2 -0
- package/dist/chunks/delegations-CVmtpkRn.cjs.map +1 -0
- package/dist/chunks/delegations-CrfjsH94.cjs +2 -0
- package/dist/chunks/delegations-CrfjsH94.cjs.map +1 -0
- package/dist/chunks/{delegations-DBh5TT6G.js → delegations-CxnNvTCc.js} +3 -2
- package/dist/chunks/delegations-CxnNvTCc.js.map +1 -0
- package/dist/chunks/designer-CX9bhYJS.cjs +69 -0
- package/dist/chunks/designer-CX9bhYJS.cjs.map +1 -0
- package/dist/chunks/{designer-ubnZbP-A.js → designer-CZDlQ9Nf.js} +2341 -1584
- package/dist/chunks/designer-CZDlQ9Nf.js.map +1 -0
- package/dist/chunks/{detail-C6XKZjlF.js → detail-ByZV1XaI.js} +853 -840
- package/dist/chunks/detail-ByZV1XaI.js.map +1 -0
- package/dist/chunks/detail-ChseSF55.cjs +5 -0
- package/dist/chunks/detail-ChseSF55.cjs.map +1 -0
- package/dist/chunks/{approver-filled-form-B4zPg9kz.cjs → instance-error-message-DTARGbGo.cjs} +2 -2
- package/dist/chunks/instance-error-message-DTARGbGo.cjs.map +1 -0
- package/dist/chunks/{approver-filled-form-Bgazhbvd.js → instance-error-message-q6gy5evy.js} +44 -36
- package/dist/chunks/instance-error-message-q6gy5evy.js.map +1 -0
- package/dist/chunks/workflow-chat-prompt-B4wCFKPB.js +25 -0
- package/dist/chunks/workflow-chat-prompt-B4wCFKPB.js.map +1 -0
- package/dist/chunks/workflow-chat-prompt-B803qVdt.cjs +27 -0
- package/dist/chunks/workflow-chat-prompt-B803qVdt.cjs.map +1 -0
- package/dist/next/workflow-chat-route.cjs +8 -19
- package/dist/next/workflow-chat-route.cjs.map +1 -1
- package/dist/next/workflow-chat-route.d.cts +92 -4
- package/dist/next/workflow-chat-route.d.ts +92 -4
- package/dist/next/workflow-chat-route.js +127 -19
- package/dist/next/workflow-chat-route.js.map +1 -1
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.js +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/views/admin/delegations/index.cjs +1 -1
- package/dist/views/admin/delegations/index.js +1 -1
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.js +1 -1
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/index.js +1 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/renderer/FormRendererView.d.cts +25 -2
- package/dist/views/forms/renderer/FormRendererView.d.ts +25 -2
- package/dist/views/forms/renderer/file-upload-field.d.cts +84 -0
- package/dist/views/forms/renderer/file-upload-field.d.ts +84 -0
- package/dist/views/forms/renderer/form-data-source-field.d.cts +9 -1
- package/dist/views/forms/renderer/form-data-source-field.d.ts +9 -1
- package/dist/views/forms/renderer/form-value-readers.d.cts +7 -0
- package/dist/views/forms/renderer/form-value-readers.d.ts +7 -0
- package/dist/views/forms/renderer/index.cjs +1 -1
- package/dist/views/forms/renderer/index.d.cts +1 -0
- package/dist/views/forms/renderer/index.d.ts +1 -0
- package/dist/views/forms/renderer/index.js +1 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +20 -3
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +20 -3
- package/dist/views/instances/detail/sections/shared.d.cts +1 -2
- package/dist/views/instances/detail/sections/shared.d.ts +1 -2
- package/dist/views/instances/instance-error-message.d.cts +5 -0
- package/dist/views/instances/instance-error-message.d.ts +5 -0
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.cjs.map +1 -1
- package/dist/views/instances/new/index.js +79 -76
- package/dist/views/instances/new/index.js.map +1 -1
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/designer/designer-version-labels.d.cts +7 -0
- package/dist/views/templates/designer/designer-version-labels.d.ts +7 -0
- package/dist/views/templates/designer/expression/DialectUpgradeModal.d.cts +25 -0
- package/dist/views/templates/designer/expression/DialectUpgradeModal.d.ts +25 -0
- package/dist/views/templates/designer/expression/ExpressionField.d.cts +79 -0
- package/dist/views/templates/designer/expression/ExpressionField.d.ts +79 -0
- package/dist/views/templates/designer/expression/use-workflow-expression-references.d.cts +22 -0
- package/dist/views/templates/designer/expression/use-workflow-expression-references.d.ts +22 -0
- package/dist/views/templates/designer/expression/workflow-expression-edits.d.cts +58 -0
- package/dist/views/templates/designer/expression/workflow-expression-edits.d.ts +58 -0
- package/dist/views/templates/designer/expression/workflow-expression-tools.d.cts +14 -0
- package/dist/views/templates/designer/expression/workflow-expression-tools.d.ts +14 -0
- package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.cts +7 -1
- package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.ts +7 -1
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/designer/notify-webhook-designer.d.cts +8 -0
- package/dist/views/templates/designer/notify-webhook-designer.d.ts +8 -0
- package/dist/views/templates/designer/use-workflow-designer-controller.d.cts +8 -2
- package/dist/views/templates/designer/use-workflow-designer-controller.d.ts +8 -2
- package/dist/views/templates/designer/workflow-chat-prompt.d.cts +18 -0
- package/dist/views/templates/designer/workflow-chat-prompt.d.ts +18 -0
- package/package.json +3 -3
- package/dist/chunks/FormBuilderView-CHaAQL5v.cjs +0 -3
- package/dist/chunks/FormBuilderView-CHaAQL5v.cjs.map +0 -1
- package/dist/chunks/FormBuilderView-vQfVc08Z.js.map +0 -1
- package/dist/chunks/FormRendererView-CTLlG13b.js +0 -1106
- package/dist/chunks/FormRendererView-CTLlG13b.js.map +0 -1
- package/dist/chunks/FormRendererView-ChmM_4Yc.cjs +0 -4
- package/dist/chunks/FormRendererView-ChmM_4Yc.cjs.map +0 -1
- package/dist/chunks/approver-filled-form-B4zPg9kz.cjs.map +0 -1
- package/dist/chunks/approver-filled-form-Bgazhbvd.js.map +0 -1
- package/dist/chunks/delegations-BfhCDz5e.js.map +0 -1
- package/dist/chunks/delegations-BmFGcuhA.cjs +0 -2
- package/dist/chunks/delegations-BmFGcuhA.cjs.map +0 -1
- package/dist/chunks/delegations-CcS0SHbf.cjs +0 -2
- package/dist/chunks/delegations-CcS0SHbf.cjs.map +0 -1
- package/dist/chunks/delegations-DBh5TT6G.js.map +0 -1
- package/dist/chunks/designer-Df79YzUn.cjs +0 -65
- package/dist/chunks/designer-Df79YzUn.cjs.map +0 -1
- package/dist/chunks/designer-ubnZbP-A.js.map +0 -1
- package/dist/chunks/detail-BBC9kqXd.cjs +0 -5
- package/dist/chunks/detail-BBC9kqXd.cjs.map +0 -1
- package/dist/chunks/detail-C6XKZjlF.js.map +0 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ExpressionUsagePoint } from '@rytass/bpm-core-shared';
|
|
3
|
+
import { WorkflowExpressionDialect } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
import { GraphQlRequestOptions } from '@rytass/bpm-core-client';
|
|
5
|
+
import { ExpressionCatalogRecord, ExpressionEvaluationRecord, ExpressionIssueRecord, ExpressionPreviewRecord, PreviewExpressionInput } from '@rytass/bpm-core-client/template';
|
|
6
|
+
/**
|
|
7
|
+
* Where the backend check of one expression stands. `UNAVAILABLE`: the check
|
|
8
|
+
* itself failed (network, 403); the field cannot vouch for the expression.
|
|
9
|
+
*/
|
|
10
|
+
export type ExpressionFieldStatus = 'CHECKING' | 'EMPTY' | 'INVALID' | 'UNAVAILABLE' | 'VALID';
|
|
11
|
+
export interface ExpressionFieldLint {
|
|
12
|
+
readonly issues: readonly ExpressionIssueRecord[];
|
|
13
|
+
readonly status: ExpressionFieldStatus;
|
|
14
|
+
}
|
|
15
|
+
/** The backend calls the field makes; injectable for tests and Storybook. */
|
|
16
|
+
export interface ExpressionFieldApi {
|
|
17
|
+
readonly preview: (input: PreviewExpressionInput, options?: GraphQlRequestOptions) => Promise<ExpressionPreviewRecord>;
|
|
18
|
+
readonly readCatalog: (input: Readonly<{
|
|
19
|
+
formDefinitionVersionId?: string | null;
|
|
20
|
+
usagePoint: ExpressionUsagePoint;
|
|
21
|
+
}>, options?: GraphQlRequestOptions) => Promise<ExpressionCatalogRecord>;
|
|
22
|
+
}
|
|
23
|
+
export interface ExpressionFieldProps {
|
|
24
|
+
readonly api?: ExpressionFieldApi;
|
|
25
|
+
/** Lint delay after the last keystroke. */
|
|
26
|
+
readonly debounceMs?: number;
|
|
27
|
+
readonly dialect: WorkflowExpressionDialect;
|
|
28
|
+
readonly disabled?: boolean;
|
|
29
|
+
/** FLOW_CONDITION: the type of the node the edge leaves. */
|
|
30
|
+
readonly edgeSourceNodeType?: string | null;
|
|
31
|
+
/** Offer a sample-data trial run (EVALUATE) under the field. */
|
|
32
|
+
readonly evaluable?: boolean;
|
|
33
|
+
readonly formDefinitionVersionId?: string | null;
|
|
34
|
+
readonly hintText?: string;
|
|
35
|
+
readonly label: string;
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly onChange: (value: string) => void;
|
|
38
|
+
/** Every change of the backend check, so a host can block applying. */
|
|
39
|
+
readonly onLintChange?: (lint: ExpressionFieldLint) => void;
|
|
40
|
+
readonly required?: boolean;
|
|
41
|
+
readonly rows?: number;
|
|
42
|
+
/** SERVICE_FORM_FIELD_VALUE: the field the value is written to. */
|
|
43
|
+
readonly targetFieldKey?: string | null;
|
|
44
|
+
readonly usagePoint: ExpressionUsagePoint;
|
|
45
|
+
readonly value: string;
|
|
46
|
+
}
|
|
47
|
+
interface CatalogOption {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly name: string;
|
|
50
|
+
}
|
|
51
|
+
/** Catalog entries as insertable snippets: field paths, then `name(`. */
|
|
52
|
+
export declare function readExpressionCatalogOptions(catalog: ExpressionCatalogRecord | null): readonly CatalogOption[];
|
|
53
|
+
export interface ExpressionCatalogFunctionNote {
|
|
54
|
+
readonly id: string;
|
|
55
|
+
readonly text: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* What each catalog function does, as plain lines under the picker. The
|
|
59
|
+
* picker's options carry only a name (Mezzanine `DropdownOption` has no
|
|
60
|
+
* secondary text), so a function's `description` was never shown. Functions
|
|
61
|
+
* without one are left out; the text is rendered as text, never as HTML.
|
|
62
|
+
*/
|
|
63
|
+
export declare function readExpressionCatalogFunctionNotes(catalog: ExpressionCatalogRecord | null): readonly ExpressionCatalogFunctionNote[];
|
|
64
|
+
/** Appends a snippet, separated by a space unless the text already ends in one. */
|
|
65
|
+
export declare function appendExpressionSnippet(value: string, snippet: string): string;
|
|
66
|
+
/** The status badge copy; the issues themselves are listed underneath. */
|
|
67
|
+
export declare function readExpressionFieldStatusText(status: ExpressionFieldStatus): string | null;
|
|
68
|
+
/** The parsed trial-run sample, or why it cannot be one. */
|
|
69
|
+
export declare function readExpressionSample(json: string): Readonly<Record<string, unknown>> | string;
|
|
70
|
+
/** One trial-run outcome as plain text (rendered as text, never as HTML). */
|
|
71
|
+
export declare function readExpressionEvaluationText(evaluation: ExpressionEvaluationRecord): string;
|
|
72
|
+
/**
|
|
73
|
+
* A CEL expression input (Phase 23 P4, ADR 22 §3.8): Mezzanine Textarea plus
|
|
74
|
+
* a catalog picker, with the backend's lint findings listed underneath. The
|
|
75
|
+
* browser only sends text; parsing, linting and the optional trial run all
|
|
76
|
+
* happen on the backend (`previewExpression`, designer-only).
|
|
77
|
+
*/
|
|
78
|
+
export declare function ExpressionField({ api, debounceMs, dialect, disabled, edgeSourceNodeType, evaluable, formDefinitionVersionId, hintText, label, name, onChange, onLintChange, required, rows, targetFieldKey, usagePoint, value, }: ExpressionFieldProps): ReactElement;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ExpressionUsagePoint } from '@rytass/bpm-core-shared';
|
|
3
|
+
import { WorkflowExpressionDialect } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
import { GraphQlRequestOptions } from '@rytass/bpm-core-client';
|
|
5
|
+
import { ExpressionCatalogRecord, ExpressionEvaluationRecord, ExpressionIssueRecord, ExpressionPreviewRecord, PreviewExpressionInput } from '@rytass/bpm-core-client/template';
|
|
6
|
+
/**
|
|
7
|
+
* Where the backend check of one expression stands. `UNAVAILABLE`: the check
|
|
8
|
+
* itself failed (network, 403); the field cannot vouch for the expression.
|
|
9
|
+
*/
|
|
10
|
+
export type ExpressionFieldStatus = 'CHECKING' | 'EMPTY' | 'INVALID' | 'UNAVAILABLE' | 'VALID';
|
|
11
|
+
export interface ExpressionFieldLint {
|
|
12
|
+
readonly issues: readonly ExpressionIssueRecord[];
|
|
13
|
+
readonly status: ExpressionFieldStatus;
|
|
14
|
+
}
|
|
15
|
+
/** The backend calls the field makes; injectable for tests and Storybook. */
|
|
16
|
+
export interface ExpressionFieldApi {
|
|
17
|
+
readonly preview: (input: PreviewExpressionInput, options?: GraphQlRequestOptions) => Promise<ExpressionPreviewRecord>;
|
|
18
|
+
readonly readCatalog: (input: Readonly<{
|
|
19
|
+
formDefinitionVersionId?: string | null;
|
|
20
|
+
usagePoint: ExpressionUsagePoint;
|
|
21
|
+
}>, options?: GraphQlRequestOptions) => Promise<ExpressionCatalogRecord>;
|
|
22
|
+
}
|
|
23
|
+
export interface ExpressionFieldProps {
|
|
24
|
+
readonly api?: ExpressionFieldApi;
|
|
25
|
+
/** Lint delay after the last keystroke. */
|
|
26
|
+
readonly debounceMs?: number;
|
|
27
|
+
readonly dialect: WorkflowExpressionDialect;
|
|
28
|
+
readonly disabled?: boolean;
|
|
29
|
+
/** FLOW_CONDITION: the type of the node the edge leaves. */
|
|
30
|
+
readonly edgeSourceNodeType?: string | null;
|
|
31
|
+
/** Offer a sample-data trial run (EVALUATE) under the field. */
|
|
32
|
+
readonly evaluable?: boolean;
|
|
33
|
+
readonly formDefinitionVersionId?: string | null;
|
|
34
|
+
readonly hintText?: string;
|
|
35
|
+
readonly label: string;
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly onChange: (value: string) => void;
|
|
38
|
+
/** Every change of the backend check, so a host can block applying. */
|
|
39
|
+
readonly onLintChange?: (lint: ExpressionFieldLint) => void;
|
|
40
|
+
readonly required?: boolean;
|
|
41
|
+
readonly rows?: number;
|
|
42
|
+
/** SERVICE_FORM_FIELD_VALUE: the field the value is written to. */
|
|
43
|
+
readonly targetFieldKey?: string | null;
|
|
44
|
+
readonly usagePoint: ExpressionUsagePoint;
|
|
45
|
+
readonly value: string;
|
|
46
|
+
}
|
|
47
|
+
interface CatalogOption {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly name: string;
|
|
50
|
+
}
|
|
51
|
+
/** Catalog entries as insertable snippets: field paths, then `name(`. */
|
|
52
|
+
export declare function readExpressionCatalogOptions(catalog: ExpressionCatalogRecord | null): readonly CatalogOption[];
|
|
53
|
+
export interface ExpressionCatalogFunctionNote {
|
|
54
|
+
readonly id: string;
|
|
55
|
+
readonly text: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* What each catalog function does, as plain lines under the picker. The
|
|
59
|
+
* picker's options carry only a name (Mezzanine `DropdownOption` has no
|
|
60
|
+
* secondary text), so a function's `description` was never shown. Functions
|
|
61
|
+
* without one are left out; the text is rendered as text, never as HTML.
|
|
62
|
+
*/
|
|
63
|
+
export declare function readExpressionCatalogFunctionNotes(catalog: ExpressionCatalogRecord | null): readonly ExpressionCatalogFunctionNote[];
|
|
64
|
+
/** Appends a snippet, separated by a space unless the text already ends in one. */
|
|
65
|
+
export declare function appendExpressionSnippet(value: string, snippet: string): string;
|
|
66
|
+
/** The status badge copy; the issues themselves are listed underneath. */
|
|
67
|
+
export declare function readExpressionFieldStatusText(status: ExpressionFieldStatus): string | null;
|
|
68
|
+
/** The parsed trial-run sample, or why it cannot be one. */
|
|
69
|
+
export declare function readExpressionSample(json: string): Readonly<Record<string, unknown>> | string;
|
|
70
|
+
/** One trial-run outcome as plain text (rendered as text, never as HTML). */
|
|
71
|
+
export declare function readExpressionEvaluationText(evaluation: ExpressionEvaluationRecord): string;
|
|
72
|
+
/**
|
|
73
|
+
* A CEL expression input (Phase 23 P4, ADR 22 §3.8): Mezzanine Textarea plus
|
|
74
|
+
* a catalog picker, with the backend's lint findings listed underneath. The
|
|
75
|
+
* browser only sends text; parsing, linting and the optional trial run all
|
|
76
|
+
* happen on the backend (`previewExpression`, designer-only).
|
|
77
|
+
*/
|
|
78
|
+
export declare function ExpressionField({ api, debounceMs, dialect, disabled, edgeSourceNodeType, evaluable, formDefinitionVersionId, hintText, label, name, onChange, onLintChange, required, rows, targetFieldKey, usagePoint, value, }: ExpressionFieldProps): ReactElement;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { WorkflowExpressionsDraft, WorkflowExpressionsRecord } from '@rytass/bpm-core-client/template';
|
|
2
|
+
import { GraphQlRequestOptions } from '@rytass/bpm-core-client';
|
|
3
|
+
export interface WorkflowExpressionReferences {
|
|
4
|
+
readonly analysis: WorkflowExpressionsRecord | null;
|
|
5
|
+
/** Field key → labels of the expressions reading it. */
|
|
6
|
+
readonly references: ReadonlyMap<string, readonly string[]>;
|
|
7
|
+
/**
|
|
8
|
+
* The references of the draft as it is now. Answers from the last analysis
|
|
9
|
+
* when it was made for this very draft, otherwise asks the backend at once.
|
|
10
|
+
* Resolves to `null` when the backend cannot answer, so a caller guarding a
|
|
11
|
+
* destructive edit can refuse it instead of letting it through.
|
|
12
|
+
*/
|
|
13
|
+
readonly resolveCurrentReferences: () => Promise<ReadonlyMap<string, readonly string[]> | null>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The backend's reading of the draft's expressions (Phase 23 P4), refreshed a
|
|
17
|
+
* moment after the draft stops changing. Field references come from the
|
|
18
|
+
* backend's AST, never from parsing CEL in the browser. A failed analysis
|
|
19
|
+
* leaves the last answer in place for display; `resolveCurrentReferences`
|
|
20
|
+
* never answers from a stale or missing analysis.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useWorkflowExpressionReferences(draft: WorkflowExpressionsDraft, enabled: boolean, analyze?: (draft: WorkflowExpressionsDraft, options?: GraphQlRequestOptions) => Promise<WorkflowExpressionsRecord>, debounceMs?: number): WorkflowExpressionReferences;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { WorkflowExpressionsDraft, WorkflowExpressionsRecord } from '@rytass/bpm-core-client/template';
|
|
2
|
+
import { GraphQlRequestOptions } from '@rytass/bpm-core-client';
|
|
3
|
+
export interface WorkflowExpressionReferences {
|
|
4
|
+
readonly analysis: WorkflowExpressionsRecord | null;
|
|
5
|
+
/** Field key → labels of the expressions reading it. */
|
|
6
|
+
readonly references: ReadonlyMap<string, readonly string[]>;
|
|
7
|
+
/**
|
|
8
|
+
* The references of the draft as it is now. Answers from the last analysis
|
|
9
|
+
* when it was made for this very draft, otherwise asks the backend at once.
|
|
10
|
+
* Resolves to `null` when the backend cannot answer, so a caller guarding a
|
|
11
|
+
* destructive edit can refuse it instead of letting it through.
|
|
12
|
+
*/
|
|
13
|
+
readonly resolveCurrentReferences: () => Promise<ReadonlyMap<string, readonly string[]> | null>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The backend's reading of the draft's expressions (Phase 23 P4), refreshed a
|
|
17
|
+
* moment after the draft stops changing. Field references come from the
|
|
18
|
+
* backend's AST, never from parsing CEL in the browser. A failed analysis
|
|
19
|
+
* leaves the last answer in place for display; `resolveCurrentReferences`
|
|
20
|
+
* never answers from a stale or missing analysis.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useWorkflowExpressionReferences(draft: WorkflowExpressionsDraft, enabled: boolean, analyze?: (draft: WorkflowExpressionsDraft, options?: GraphQlRequestOptions) => Promise<WorkflowExpressionsRecord>, debounceMs?: number): WorkflowExpressionReferences;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { WorkflowDefinition, WorkflowEdge, WorkflowNode } from '@rytass/bpm-core-shared/workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Pure designer edits for the free-text expressions the command layer has no
|
|
4
|
+
* primitive for (Phase 23 P4): a node's entry condition and an edge's
|
|
5
|
+
* hand-written CEL condition. The designer applies them through
|
|
6
|
+
* `controller.replaceState`; the assistant cannot reach them (its toolset
|
|
7
|
+
* offers `set_edge_condition`, the structured builder, instead).
|
|
8
|
+
*/
|
|
9
|
+
/** Nodes that may carry `entryCondition`. */
|
|
10
|
+
export declare function hasWorkflowEntryCondition(node: WorkflowNode): node is Extract<WorkflowNode, {
|
|
11
|
+
type: 'serviceTask' | 'userTask';
|
|
12
|
+
}>;
|
|
13
|
+
/** Sets (or, for blank text, removes) a node's entry condition. */
|
|
14
|
+
export declare function setWorkflowNodeEntryCondition(definition: WorkflowDefinition, nodeId: string, condition: string): WorkflowDefinition;
|
|
15
|
+
/**
|
|
16
|
+
* An edge whose condition was written by hand rather than by the structured
|
|
17
|
+
* builder (field + operator + value).
|
|
18
|
+
*/
|
|
19
|
+
export declare function isWorkflowEdgeExpressionCondition(edge: WorkflowEdge): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Writes a hand-written condition on an edge, dropping the builder's
|
|
22
|
+
* field / operator / value and the default flag (a conditional edge is not
|
|
23
|
+
* the else path).
|
|
24
|
+
*/
|
|
25
|
+
export declare function setWorkflowEdgeExpressionCondition(definition: WorkflowDefinition, edgeId: string, condition: string): WorkflowDefinition;
|
|
26
|
+
/** The type of the node an edge leaves, for the `lastDecision` check. */
|
|
27
|
+
export declare function readWorkflowEdgeSourceNodeType(definition: WorkflowDefinition, edgeId: string): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Fields a form edit would rename or delete while expressions still read
|
|
30
|
+
* them (docs/24 §1): keys present before the edit, missing after it, and
|
|
31
|
+
* referenced. Each comes with the labels of the expressions reading it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readRemovedExpressionFields(beforeFieldKeys: readonly string[], afterFieldKeys: readonly string[], references: ReadonlyMap<string, readonly string[]>): readonly {
|
|
34
|
+
readonly fieldKey: string;
|
|
35
|
+
readonly labels: readonly string[];
|
|
36
|
+
}[];
|
|
37
|
+
export type FormEditExpressionCheck = {
|
|
38
|
+
readonly kind: 'allowed';
|
|
39
|
+
} | {
|
|
40
|
+
readonly kind: 'blocked';
|
|
41
|
+
readonly fields: readonly {
|
|
42
|
+
readonly fieldKey: string;
|
|
43
|
+
readonly labels: readonly string[];
|
|
44
|
+
}[];
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: 'unverified';
|
|
47
|
+
readonly fieldKeys: readonly string[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Whether a form edit may be applied (docs/24 §1: renaming or deleting a
|
|
51
|
+
* field an expression reads is refused). An edit that removes no field needs
|
|
52
|
+
* no answer from the backend. One that does is checked against the references
|
|
53
|
+
* of the draft as it is now; when those cannot be had (analysis not run yet,
|
|
54
|
+
* request failed, 403) the edit is refused as `unverified` rather than let
|
|
55
|
+
* through — cel-legacy's publish lint does not check field existence, so this
|
|
56
|
+
* is the only guard such a template has.
|
|
57
|
+
*/
|
|
58
|
+
export declare function checkFormEditExpressionFields(beforeFieldKeys: readonly string[], afterFieldKeys: readonly string[], resolveReferences: () => Promise<ReadonlyMap<string, readonly string[]> | null>): Promise<FormEditExpressionCheck>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { WorkflowDefinition, WorkflowEdge, WorkflowNode } from '@rytass/bpm-core-shared/workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Pure designer edits for the free-text expressions the command layer has no
|
|
4
|
+
* primitive for (Phase 23 P4): a node's entry condition and an edge's
|
|
5
|
+
* hand-written CEL condition. The designer applies them through
|
|
6
|
+
* `controller.replaceState`; the assistant cannot reach them (its toolset
|
|
7
|
+
* offers `set_edge_condition`, the structured builder, instead).
|
|
8
|
+
*/
|
|
9
|
+
/** Nodes that may carry `entryCondition`. */
|
|
10
|
+
export declare function hasWorkflowEntryCondition(node: WorkflowNode): node is Extract<WorkflowNode, {
|
|
11
|
+
type: 'serviceTask' | 'userTask';
|
|
12
|
+
}>;
|
|
13
|
+
/** Sets (or, for blank text, removes) a node's entry condition. */
|
|
14
|
+
export declare function setWorkflowNodeEntryCondition(definition: WorkflowDefinition, nodeId: string, condition: string): WorkflowDefinition;
|
|
15
|
+
/**
|
|
16
|
+
* An edge whose condition was written by hand rather than by the structured
|
|
17
|
+
* builder (field + operator + value).
|
|
18
|
+
*/
|
|
19
|
+
export declare function isWorkflowEdgeExpressionCondition(edge: WorkflowEdge): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Writes a hand-written condition on an edge, dropping the builder's
|
|
22
|
+
* field / operator / value and the default flag (a conditional edge is not
|
|
23
|
+
* the else path).
|
|
24
|
+
*/
|
|
25
|
+
export declare function setWorkflowEdgeExpressionCondition(definition: WorkflowDefinition, edgeId: string, condition: string): WorkflowDefinition;
|
|
26
|
+
/** The type of the node an edge leaves, for the `lastDecision` check. */
|
|
27
|
+
export declare function readWorkflowEdgeSourceNodeType(definition: WorkflowDefinition, edgeId: string): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Fields a form edit would rename or delete while expressions still read
|
|
30
|
+
* them (docs/24 §1): keys present before the edit, missing after it, and
|
|
31
|
+
* referenced. Each comes with the labels of the expressions reading it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readRemovedExpressionFields(beforeFieldKeys: readonly string[], afterFieldKeys: readonly string[], references: ReadonlyMap<string, readonly string[]>): readonly {
|
|
34
|
+
readonly fieldKey: string;
|
|
35
|
+
readonly labels: readonly string[];
|
|
36
|
+
}[];
|
|
37
|
+
export type FormEditExpressionCheck = {
|
|
38
|
+
readonly kind: 'allowed';
|
|
39
|
+
} | {
|
|
40
|
+
readonly kind: 'blocked';
|
|
41
|
+
readonly fields: readonly {
|
|
42
|
+
readonly fieldKey: string;
|
|
43
|
+
readonly labels: readonly string[];
|
|
44
|
+
}[];
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: 'unverified';
|
|
47
|
+
readonly fieldKeys: readonly string[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Whether a form edit may be applied (docs/24 §1: renaming or deleting a
|
|
51
|
+
* field an expression reads is refused). An edit that removes no field needs
|
|
52
|
+
* no answer from the backend. One that does is checked against the references
|
|
53
|
+
* of the draft as it is now; when those cannot be had (analysis not run yet,
|
|
54
|
+
* request failed, 403) the edit is refused as `unverified` rather than let
|
|
55
|
+
* through — cel-legacy's publish lint does not check field existence, so this
|
|
56
|
+
* is the only guard such a template has.
|
|
57
|
+
*/
|
|
58
|
+
export declare function checkFormEditExpressionFields(beforeFieldKeys: readonly string[], afterFieldKeys: readonly string[], resolveReferences: () => Promise<ReadonlyMap<string, readonly string[]> | null>): Promise<FormEditExpressionCheck>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WorkflowDesignerState, WorkflowExpressionTools } from '@rytass/bpm-core-shared';
|
|
2
|
+
import { ExpressionPreviewRecord, PreviewExpressionInput, readExpressionCatalog } from '@rytass/bpm-core-client/template';
|
|
3
|
+
/** The client calls the tools make; injectable for tests. */
|
|
4
|
+
export interface WorkflowExpressionToolsApi {
|
|
5
|
+
readonly preview: (input: PreviewExpressionInput) => Promise<ExpressionPreviewRecord>;
|
|
6
|
+
readonly readCatalog: typeof readExpressionCatalog;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The assistant's expression tools (Phase 23 P4, ADR 22 §3.8), backed by the
|
|
10
|
+
* designer-only GraphQL operations. Every answer comes from the backend; the
|
|
11
|
+
* browser neither parses nor evaluates CEL. Findings are written as designer
|
|
12
|
+
* sentences so the model can relay them to the user.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createWorkflowExpressionTools(state: WorkflowDesignerState, api?: WorkflowExpressionToolsApi): WorkflowExpressionTools;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WorkflowDesignerState, WorkflowExpressionTools } from '@rytass/bpm-core-shared';
|
|
2
|
+
import { ExpressionPreviewRecord, PreviewExpressionInput, readExpressionCatalog } from '@rytass/bpm-core-client/template';
|
|
3
|
+
/** The client calls the tools make; injectable for tests. */
|
|
4
|
+
export interface WorkflowExpressionToolsApi {
|
|
5
|
+
readonly preview: (input: PreviewExpressionInput) => Promise<ExpressionPreviewRecord>;
|
|
6
|
+
readonly readCatalog: typeof readExpressionCatalog;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The assistant's expression tools (Phase 23 P4, ADR 22 §3.8), backed by the
|
|
10
|
+
* designer-only GraphQL operations. Every answer comes from the backend; the
|
|
11
|
+
* browser neither parses nor evaluates CEL. Findings are written as designer
|
|
12
|
+
* sentences so the model can relay them to the user.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createWorkflowExpressionTools(state: WorkflowDesignerState, api?: WorkflowExpressionToolsApi): WorkflowExpressionTools;
|
|
@@ -5,6 +5,12 @@ import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
|
5
5
|
import { BPMLanguage } from '../../../../lib/language-provider.cjs';
|
|
6
6
|
export interface FieldAccessMatrixDrawerProps {
|
|
7
7
|
readonly definition: WorkflowDefinition;
|
|
8
|
+
/**
|
|
9
|
+
* Phase 23 P4: per field key, the labels of the expressions that read it
|
|
10
|
+
* (from `analyzeWorkflowExpressions`). Such a field cannot be renamed or
|
|
11
|
+
* deleted while they do; the matrix marks it.
|
|
12
|
+
*/
|
|
13
|
+
readonly expressionReferences?: ReadonlyMap<string, readonly string[]>;
|
|
8
14
|
readonly formSchema: FormDefinitionSchema | null;
|
|
9
15
|
readonly language: BPMLanguage;
|
|
10
16
|
/**
|
|
@@ -30,4 +36,4 @@ export declare function rebaseFieldAccessDraft(current: readonly FieldAccessMatr
|
|
|
30
36
|
* `setFieldAccessMatrix` on 套用. The checks are recomputed from the draft
|
|
31
37
|
* with the publish lint's own rules, so a conflict shows before applying.
|
|
32
38
|
*/
|
|
33
|
-
export declare function FieldAccessMatrixDrawer({ definition, formSchema, language, onApply, onClose, open, }: FieldAccessMatrixDrawerProps): ReactElement;
|
|
39
|
+
export declare function FieldAccessMatrixDrawer({ definition, expressionReferences, formSchema, language, onApply, onClose, open, }: FieldAccessMatrixDrawerProps): ReactElement;
|
|
@@ -5,6 +5,12 @@ import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
|
5
5
|
import { BPMLanguage } from '../../../../lib/language-provider.js';
|
|
6
6
|
export interface FieldAccessMatrixDrawerProps {
|
|
7
7
|
readonly definition: WorkflowDefinition;
|
|
8
|
+
/**
|
|
9
|
+
* Phase 23 P4: per field key, the labels of the expressions that read it
|
|
10
|
+
* (from `analyzeWorkflowExpressions`). Such a field cannot be renamed or
|
|
11
|
+
* deleted while they do; the matrix marks it.
|
|
12
|
+
*/
|
|
13
|
+
readonly expressionReferences?: ReadonlyMap<string, readonly string[]>;
|
|
8
14
|
readonly formSchema: FormDefinitionSchema | null;
|
|
9
15
|
readonly language: BPMLanguage;
|
|
10
16
|
/**
|
|
@@ -30,4 +36,4 @@ export declare function rebaseFieldAccessDraft(current: readonly FieldAccessMatr
|
|
|
30
36
|
* `setFieldAccessMatrix` on 套用. The checks are recomputed from the draft
|
|
31
37
|
* with the publish lint's own rules, so a conflict shows before applying.
|
|
32
38
|
*/
|
|
33
|
-
export declare function FieldAccessMatrixDrawer({ definition, formSchema, language, onApply, onClose, open, }: FieldAccessMatrixDrawerProps): ReactElement;
|
|
39
|
+
export declare function FieldAccessMatrixDrawer({ definition, expressionReferences, formSchema, language, onApply, onClose, open, }: FieldAccessMatrixDrawerProps): ReactElement;
|
|
@@ -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-CX9bhYJS.cjs");exports.TemplateDesignerView=e.t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as TemplateDesignerView } from "../../../chunks/designer-
|
|
1
|
+
export { t as TemplateDesignerView } from "../../../chunks/designer-CZDlQ9Nf.js";
|
|
@@ -40,6 +40,14 @@ export declare function readNotifyWebhookBindingKinds(type: NotifyWebhookParamet
|
|
|
40
40
|
export declare function readCompatibleFormFields(formFields: readonly FormFieldDefinition[], type: NotifyWebhookParameterType): readonly FormFieldDefinition[];
|
|
41
41
|
/** The value a binding starts with when its source kind is picked. */
|
|
42
42
|
export declare function createNotifyWebhookBindingSource(kind: NotifyWebhookBindingKind, parameter: DesignerParameter, formFields: readonly FormFieldDefinition[]): NotifyWebhookBindingSource;
|
|
43
|
+
/**
|
|
44
|
+
* Whether a parameter can be bound to a cel-v2 expression over `form`
|
|
45
|
+
* (ADR 22 §3.7). An expression yields a scalar, so never a `stringArray`, and
|
|
46
|
+
* it reads the bound form, so not before one is bound. Kept apart from
|
|
47
|
+
* {@link readNotifyWebhookBindingKinds}, which lists the sources that need no
|
|
48
|
+
* backend check.
|
|
49
|
+
*/
|
|
50
|
+
export declare function canBindNotifyWebhookExpression(type: NotifyWebhookParameterType, formFields: readonly FormFieldDefinition[] | null): boolean;
|
|
43
51
|
/**
|
|
44
52
|
* Reads a typed constant from a text input. A number parameter takes plain
|
|
45
53
|
* decimals only (no `0x1f`, no exponent); anything else, including a number
|
|
@@ -40,6 +40,14 @@ export declare function readNotifyWebhookBindingKinds(type: NotifyWebhookParamet
|
|
|
40
40
|
export declare function readCompatibleFormFields(formFields: readonly FormFieldDefinition[], type: NotifyWebhookParameterType): readonly FormFieldDefinition[];
|
|
41
41
|
/** The value a binding starts with when its source kind is picked. */
|
|
42
42
|
export declare function createNotifyWebhookBindingSource(kind: NotifyWebhookBindingKind, parameter: DesignerParameter, formFields: readonly FormFieldDefinition[]): NotifyWebhookBindingSource;
|
|
43
|
+
/**
|
|
44
|
+
* Whether a parameter can be bound to a cel-v2 expression over `form`
|
|
45
|
+
* (ADR 22 §3.7). An expression yields a scalar, so never a `stringArray`, and
|
|
46
|
+
* it reads the bound form, so not before one is bound. Kept apart from
|
|
47
|
+
* {@link readNotifyWebhookBindingKinds}, which lists the sources that need no
|
|
48
|
+
* backend check.
|
|
49
|
+
*/
|
|
50
|
+
export declare function canBindNotifyWebhookExpression(type: NotifyWebhookParameterType, formFields: readonly FormFieldDefinition[] | null): boolean;
|
|
43
51
|
/**
|
|
44
52
|
* Reads a typed constant from a text input. A number parameter takes plain
|
|
45
53
|
* decimals only (no `0x1f`, no exponent); anything else, including a number
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WorkflowCommand, WorkflowCommandResult, WorkflowDesignerState, WorkflowMacroCommand, WorkflowDirectory, WorkflowSnapshot, WorkflowTool, WorkflowToolResult } from '@rytass/bpm-core-shared';
|
|
1
|
+
import { WorkflowCommand, WorkflowCommandResult, WorkflowDesignerState, WorkflowMacroCommand, WorkflowDirectory, WorkflowExpressionTools, WorkflowSnapshot, WorkflowTool, WorkflowToolResult } from '@rytass/bpm-core-shared';
|
|
2
2
|
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
3
3
|
/**
|
|
4
4
|
* Bridges the pure, framework-agnostic workflow command layer
|
|
@@ -20,6 +20,12 @@ export interface UseWorkflowDesignerControllerOptions {
|
|
|
20
20
|
readonly onLayout?: (definition: WorkflowDefinition) => void;
|
|
21
21
|
/** Org directory backing the LLM's member/org lookup query tools. */
|
|
22
22
|
readonly directory?: WorkflowDirectory;
|
|
23
|
+
/**
|
|
24
|
+
* Backend expression lint / preview / catalog for the assistant (Phase 23
|
|
25
|
+
* P4). Read per tool call with the state the call runs against. Without it
|
|
26
|
+
* every tool call that writes an expression is refused.
|
|
27
|
+
*/
|
|
28
|
+
readonly expressionTools?: (state: WorkflowDesignerState) => WorkflowExpressionTools;
|
|
23
29
|
}
|
|
24
30
|
export interface WorkflowDesignerController {
|
|
25
31
|
readonly state: WorkflowDesignerState;
|
|
@@ -38,4 +44,4 @@ export interface WorkflowDesignerController {
|
|
|
38
44
|
/** Imperatively read the latest committed state (avoids stale closures). */
|
|
39
45
|
readonly getState: () => WorkflowDesignerState;
|
|
40
46
|
}
|
|
41
|
-
export declare function useWorkflowDesignerController({ directory, initialState, layout, onLayout, }: UseWorkflowDesignerControllerOptions): WorkflowDesignerController;
|
|
47
|
+
export declare function useWorkflowDesignerController({ directory, expressionTools, initialState, layout, onLayout, }: UseWorkflowDesignerControllerOptions): WorkflowDesignerController;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WorkflowCommand, WorkflowCommandResult, WorkflowDesignerState, WorkflowMacroCommand, WorkflowDirectory, WorkflowSnapshot, WorkflowTool, WorkflowToolResult } from '@rytass/bpm-core-shared';
|
|
1
|
+
import { WorkflowCommand, WorkflowCommandResult, WorkflowDesignerState, WorkflowMacroCommand, WorkflowDirectory, WorkflowExpressionTools, WorkflowSnapshot, WorkflowTool, WorkflowToolResult } from '@rytass/bpm-core-shared';
|
|
2
2
|
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
3
3
|
/**
|
|
4
4
|
* Bridges the pure, framework-agnostic workflow command layer
|
|
@@ -20,6 +20,12 @@ export interface UseWorkflowDesignerControllerOptions {
|
|
|
20
20
|
readonly onLayout?: (definition: WorkflowDefinition) => void;
|
|
21
21
|
/** Org directory backing the LLM's member/org lookup query tools. */
|
|
22
22
|
readonly directory?: WorkflowDirectory;
|
|
23
|
+
/**
|
|
24
|
+
* Backend expression lint / preview / catalog for the assistant (Phase 23
|
|
25
|
+
* P4). Read per tool call with the state the call runs against. Without it
|
|
26
|
+
* every tool call that writes an expression is refused.
|
|
27
|
+
*/
|
|
28
|
+
readonly expressionTools?: (state: WorkflowDesignerState) => WorkflowExpressionTools;
|
|
23
29
|
}
|
|
24
30
|
export interface WorkflowDesignerController {
|
|
25
31
|
readonly state: WorkflowDesignerState;
|
|
@@ -38,4 +44,4 @@ export interface WorkflowDesignerController {
|
|
|
38
44
|
/** Imperatively read the latest committed state (avoids stale closures). */
|
|
39
45
|
readonly getState: () => WorkflowDesignerState;
|
|
40
46
|
}
|
|
41
|
-
export declare function useWorkflowDesignerController({ directory, initialState, layout, onLayout, }: UseWorkflowDesignerControllerOptions): WorkflowDesignerController;
|
|
47
|
+
export declare function useWorkflowDesignerController({ directory, expressionTools, initialState, layout, onLayout, }: UseWorkflowDesignerControllerOptions): WorkflowDesignerController;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expression rules for the designer assistant (Phase 23 P4, ADR 22 §3.8),
|
|
3
|
+
* shared by the online route (`next/workflow-chat-route.ts`) and the offline
|
|
4
|
+
* Chrome model (`chrome-workflow-chat.ts`) so the two cannot drift. Free of
|
|
5
|
+
* any runtime dependency: the route bundles it server-side, the offline path
|
|
6
|
+
* in the browser.
|
|
7
|
+
*
|
|
8
|
+
* The rules restate what the toolset enforces anyway: a tool call that writes
|
|
9
|
+
* an expression is linted by the backend first and refused on an error.
|
|
10
|
+
*/
|
|
11
|
+
export declare const WORKFLOW_CHAT_EXPRESSION_GUIDANCE = "\u904B\u7B97\u5F0F\uFF08CEL\uFF09\u898F\u5247\uFF1A\n- \u904B\u7B97\u5F0F\u53EA\u5728\u5F8C\u7AEF\u6AA2\u67E5\u8207\u57F7\u884C\uFF0C\u4F60\u770B\u4E0D\u5230\u57F7\u884C\u7D50\u679C\uFF0C\u4E5F\u4E0D\u80FD\u5728\u700F\u89BD\u5668\u8A66\u7B97\u3002\u5BEB\u4EFB\u4F55\u904B\u7B97\u5F0F\uFF08\u767C\u8D77\u6B0A\u9650\u3001\u7C3D\u6838\u4EBA\u904B\u7B97\u5F0F\u3001\u7CFB\u7D71\u7BC0\u9EDE\u5BEB\u5165\u6B04\u4F4D\u7684\u503C\u3001Webhook payload\u3001\u77E5\u6703\u5C0D\u8C61\u904B\u7B97\u5F0F\uFF09\u4E4B\u524D\uFF0C\u5148\u547C\u53EB get_expression_catalog \u53D6\u5F97\u8A72\u4F4D\u7F6E\u53EF\u7528\u7684\u6839\u3001\u6B04\u4F4D\u8207\u51FD\u5F0F\uFF0C\u53EA\u4F7F\u7528\u76EE\u9304\u88E1\u7684\u540D\u7A31\uFF1B\u5BBF\u4E3B\u51FD\u5F0F\u540D\u7A31\u5E36\u7248\u672C\uFF08\u4F8B\u5982 erp_costBand_v1\uFF09\uFF0C\u8981\u7167\u76EE\u9304\u539F\u6A23\u5BEB\u3002\n- \u5BEB\u5165\u524D\u4E00\u5B9A\u5148\u7528 preview_expression \u6AA2\u67E5\uFF08LINT\uFF09\u3002\u6709 ERROR \u5C31\u4FEE\u6B63\u5F8C\u518D\u6AA2\u67E5\uFF0C\u4E0D\u8981\u76F4\u63A5\u5BEB\u5165\uFF1B\u5BEB\u5165\u5DE5\u5177\u4E5F\u6703\u518D\u6AA2\u67E5\u4E00\u6B21\uFF0C\u672A\u901A\u904E\u6703\u88AB\u62D2\u7D55\u3002WARNING \u53EA\u662F\u63D0\u9192\uFF0C\u5BEB\u5165\u5F8C\u8981\u7528\u4E00\u53E5\u8A71\u544A\u8A34\u4F7F\u7528\u8005\u3002\n- \u689D\u4EF6\u5206\u6D41\u7684\u9023\u7DDA\u689D\u4EF6\u512A\u5148\u7528 set_edge_condition\uFF08\u4F9D\u6B04\u4F4D\u3001\u904B\u7B97\u5B50\u3001\u503C\uFF0C\u7531\u7CFB\u7D71\u7522\u751F\uFF09\uFF0C\u4E0D\u8981\u81EA\u5DF1\u62FC CEL\u3002\n- \u53EA\u6709\u5F9E\u7C3D\u6838\u95DC\u5361\u51FA\u53BB\u7684\u9023\u7DDA\u624D\u8B80\u5F97\u5230 lastDecision\uFF1B\u689D\u4EF6\u5206\u6D41\u3001\u7CFB\u7D71\u7BC0\u9EDE\u51FA\u53BB\u7684\u9023\u7DDA lastDecision \u6C38\u9060\u662F\u7A7A\u503C\uFF0C\u4E0D\u8981\u5728\u90A3\u88E1\u8B80\u5B83\u3002\n- \u904B\u7B97\u5F0F\u5BEB\u9032\u8349\u7A3F\u5F8C\u4E0D\u6703\u81EA\u52D5\u767C\u5E03\uFF1B\u767C\u5E03\u7531\u4F7F\u7528\u8005\u5728\u756B\u9762\u4E0A\u64CD\u4F5C\uFF0C\u4F60\u4E0D\u80FD\u4E5F\u4E0D\u8981\u5617\u8A66\u767C\u5E03\u3002";
|
|
12
|
+
/**
|
|
13
|
+
* The strict guardrail of the online assistant: it may only design this
|
|
14
|
+
* approval flow, through the tools. Lives here, server-side in the route, so
|
|
15
|
+
* client-supplied messages cannot override it (the route drops any `system`
|
|
16
|
+
* message a client sends).
|
|
17
|
+
*/
|
|
18
|
+
export declare const WORKFLOW_CHAT_SYSTEM_PROMPT = "\u4F60\u662F\u300C\u7C3D\u6838\u6D41\u7A0B\u8A2D\u8A08\u5668\u300D\u9801\u9762\u5167\u5EFA\u7684 AI \u52A9\u7406\uFF0C\u552F\u4E00\u8077\u8CAC\u662F\u5354\u52A9\u4F7F\u7528\u8005\u5728\u9019\u500B\u756B\u5E03\u4E0A\u8A2D\u8A08\uFF0F\u4FEE\u6539\u4E00\u500B\u7C3D\u6838\u5BE9\u6279\u6D41\u7A0B\uFF08workflow\uFF09\u3002\n\n\u4F60\u53EA\u80FD\u900F\u904E\u7CFB\u7D71\u63D0\u4F9B\u7684\u5DE5\u5177\uFF08tools\uFF09\u4F86\u64CD\u4F5C\u6D41\u7A0B\uFF1A\u65B0\u589E/\u91CD\u547D\u540D/\u522A\u9664\u7BC0\u9EDE\u3001\u9023\u7DDA\u3001\u8A2D\u5B9A\u7C3D\u6838\u4EBA\u3001\u8A2D\u5B9A\u689D\u4EF6\u5206\u6D41\u3001\u8A2D\u5B9A\u7CFB\u7D71\u7BC0\u9EDE\u52D5\u4F5C\u3001\u81EA\u52D5\u6392\u7248\u3001\u67E5\u8A62\u73FE\u6CC1\u8207\u9A57\u8B49\u7B49\u3002\u9664\u4E86\u9019\u4E9B\u5DE5\u5177\uFF0C\u4F60\u6C92\u6709\u5176\u4ED6\u80FD\u529B\u3002\n\n\u5DE5\u4F5C\u5B88\u5247\uFF1A\n1. \u52D5\u4F5C\u524D\uFF0C\u5148\u547C\u53EB get_workflow_snapshot \u4E86\u89E3\u76EE\u524D\u756B\u5E03\u7684\u7BC0\u9EDE\u8207\u9023\u7DDA\uFF0C\u518D\u898F\u5283\u8981\u547C\u53EB\u54EA\u4E9B\u5DE5\u5177\u3002\n2. \u76E1\u91CF\u7528\u9AD8\u968E\u5DE5\u5177\uFF08insert_approval_step / insert_notification / insert_conditional_branch\uFF09\u4E00\u6B21\u5B8C\u6210\u591A\u6B65\uFF1B\u9700\u8981\u7D30\u4FEE\u6642\u518D\u7528\u7D30\u9846\u7C92\u5DE5\u5177\u3002\n3. **\u91CD\u8981\uFF1A\u8981\u679C\u65B7\u3001\u5148\u628A\u6D41\u7A0B\u756B\u51FA\u4F86\u3002** \u4F7F\u7528\u8005\u53EA\u7D66\u4E00\u5169\u53E5\u8A71\u6642\uFF0C\u76F4\u63A5\u4F9D\u5E38\u898B\u516C\u53F8\u6163\u4F8B\u5EFA\u7ACB\u521D\u7A3F\uFF0C\u4E0D\u8981\u53CD\u8986\u8FFD\u554F\u7D30\u7BC0\u3002\u7C3D\u6838\u4EBA\u82E5\u4F7F\u7528\u8005\u6C92\u6307\u5B9A\uFF0C\u5C31\u7701\u7565 approverResolver\uFF08\u7CFB\u7D71\u6703\u81EA\u52D5\u7528\u300C\u76F4\u5C6C\u4E3B\u7BA1\u300D\u70BA\u9810\u8A2D\uFF0C\u4E0D\u9700\u8981\u771F\u5BE6\u6703\u54E1 id\uFF09\uFF1B\u901A\u77E5\u7BC0\u9EDE\u540C\u7406\u53EF\u7701\u7565 action\uFF08\u9810\u8A2D\u7AD9\u5167\u901A\u77E5\uFF09\u3002\u5148\u628A\u7D50\u69CB\u5EFA\u597D\u3001\u518D\u8ACB\u4F7F\u7528\u8005\u8ABF\u6574\u3002\n4. \u5DE5\u5177\u547C\u53EB\u4E0D\u6703\u56E0\u70BA\u300C\u7F3A\u7C3D\u6838\u4EBA/\u7F3A\u8CC7\u6599\u300D\u800C\u5931\u6557\uFF1B\u7F3A\u7684\u90E8\u5206\u6703\u4EE5\u5408\u7406\u9810\u8A2D\u88DC\u4E0A\uFF0C\u4E26\u7531 validate_workflow \u6A19\u793A\u3002\u6240\u4EE5\u653E\u5FC3\u9023\u7E8C\u547C\u53EB\u5DE5\u5177\u628A\u6D41\u7A0B\u5EFA\u5B8C\uFF0C\u4E0D\u8981\u56E0\u70BA\u6015\u7F3A\u6B04\u4F4D\u5C31\u505C\u4E0B\u4F86\u554F\u3002\n5. \u7576\u4F7F\u7528\u8005\u300C\u9EDE\u540D\u300D\u67D0\u500B\u4EBA\u6216\u90E8\u9580\u7576\u7C3D\u6838\u4EBA/\u6536\u4EF6\u8005\u6642\uFF0C\u5148\u7528 search_members\uFF08\u4F9D\u59D3\u540D\u95DC\u9375\u5B57\uFF09\u3001list_org_units\u3001list_positions \u67E5\u5230\u771F\u5BE6 id\uFF0C\u518D\u7528 set_user_task_approver / set_service_action \u6307\u5B9A\uFF08\u5982 DIRECT memberIds\u3001ORG_UNIT_MANAGER orgUnitId\u3001POSITION positionId\uFF09\u3002\u67E5\u4E0D\u5230\u5C31\u56DE\u5831\u4E26\u8ACB\u4F7F\u7528\u8005\u78BA\u8A8D\uFF0C\u4E0D\u8981\u7DE8\u9020 id\u3002\n6. \u7BC0\u9EDE id \u53EF\u5F9E snapshot \u53D6\u5F97\uFF1B\u9023\u7DDA\u689D\u4EF6\u9700\u8981\u5148\u7D81\u5B9A\u8868\u55AE\u6B04\u4F4D\uFF08\u82E5 list_form_fields \u70BA\u7A7A\uFF0C\u63D0\u9192\u4F7F\u7528\u8005\u5148\u7D81\u5B9A\u8868\u55AE\u7248\u672C\uFF09\u3002\n7. **\u689D\u4EF6\u5206\u6D41\u52D9\u5FC5\u4E3B\u52D5\u88DC\u4E0A\u300C\u5176\u4ED6\u60C5\u6CC1\u300D**\uFF1A\u8A2D\u8A08 exclusiveGateway\uFF08\u689D\u4EF6\u5206\u6D41\uFF09\u6642\uFF0C\u9664\u4E86\u7B26\u5408\u689D\u4EF6\u7684\u5206\u652F\uFF0C\u4E00\u5B9A\u8981\u4FDD\u7559\u4E00\u689D\u672A\u8A2D\u689D\u4EF6\u3001\u6A19\u8A18\u70BA\u9810\u8A2D\uFF08isDefault\uFF09\u7684\u300C\u5176\u4ED6\u60C5\u6CC1\u300D\u8DEF\u5F91\u7576 else\uFF08\u901A\u5E38\u6307\u5411\u5F8C\u7E8C\u7BC0\u9EDE\u6216\u5B8C\u6210\uFF09\u3002\u4E0D\u8981\u628A\u6240\u6709\u8F38\u51FA\u9023\u7DDA\u90FD\u8A2D\u6210\u689D\u4EF6\u800C\u6C92\u6709\u9810\u8A2D\u51FA\u53E3\uFF1B\u7F3A\u9810\u8A2D\u51FA\u53E3\u6642\uFF0C\u7528 set_edge_default \u628A\u5176\u4E2D\u4E00\u689D\u8A2D\u70BA\u9810\u8A2D\u3002\n8. \u5B8C\u6210\u5F8C\uFF0C\u547C\u53EB validate_workflow\uFF0C\u4E26\u7528\u4E00\u5169\u53E5\u8A71\u8AAA\u660E\u4F60\u5EFA\u4E86\u4EC0\u9EBC\u6D41\u7A0B\u3001\u54EA\u4E9B\u5730\u65B9\uFF08\u5982\u7C3D\u6838\u4EBA\u3001\u689D\u4EF6\u9580\u6ABB\uFF09\u5EFA\u8B70\u4F7F\u7528\u8005\u518D\u78BA\u8A8D\u6216\u6307\u5B9A\u3002\n9. \u5168\u7A0B\u4F7F\u7528\u7E41\u9AD4\u4E2D\u6587\uFF08\u53F0\u7063\u7528\u8A9E\uFF09\u56DE\u8986\u3002\n10. \u6B04\u4F4D\u5728\u5404\u95DC\u7684\u986F\u793A\u8207\u88DC\u586B\u7528 set_field_access_matrix \u8A2D\u5B9A\uFF1AnodeIds \u53EA\u5217\u9019\u6B21\u8981\u6539\u7684\u7C3D\u6838\u7BC0\u9EDE\uFF0C\u5B83\u5011\u7684\u8A2D\u5B9A\u6703\u6574\u500B\u63DB\u6389\uFF0C\u547C\u53EB\u524D\u5148\u5F9E get_workflow_snapshot \u8B80\u51FA\u9019\u4E9B\u7BC0\u9EDE\u65E2\u6709\u7684\u300C\u6B04\u4F4D\u8A2D\u5B9A\u300D\u4E00\u4F75\u50B3\u5165\u3002\u300C\u96B1\u85CF\u300D\u53EA\u5F71\u97FF\u756B\u9762\u3001\u4E0D\u662F\u6B0A\u9650\uFF0C\u4E0D\u80FD\u7528\u4F86\u4FDD\u5BC6\uFF1B\u4F7F\u7528\u8005\u8981\u6C42\u4FDD\u5BC6\u6642\u8981\u8AAA\u660E\u9019\u4E00\u9EDE\u3002\u7BC0\u9EDE\u542B\u820A\u6B04\u4F4D\u6B0A\u9650\u8A2D\u5B9A\u6642\uFF0C\u7528 remove_legacy_field_permissions \u79FB\u9664\uFF08\u4E0D\u6703\u81EA\u52D5\u8F49\u63DB\uFF09\u3002\n\n\u904B\u7B97\u5F0F\uFF08CEL\uFF09\u898F\u5247\uFF1A\n- \u904B\u7B97\u5F0F\u53EA\u5728\u5F8C\u7AEF\u6AA2\u67E5\u8207\u57F7\u884C\uFF0C\u4F60\u770B\u4E0D\u5230\u57F7\u884C\u7D50\u679C\uFF0C\u4E5F\u4E0D\u80FD\u5728\u700F\u89BD\u5668\u8A66\u7B97\u3002\u5BEB\u4EFB\u4F55\u904B\u7B97\u5F0F\uFF08\u767C\u8D77\u6B0A\u9650\u3001\u7C3D\u6838\u4EBA\u904B\u7B97\u5F0F\u3001\u7CFB\u7D71\u7BC0\u9EDE\u5BEB\u5165\u6B04\u4F4D\u7684\u503C\u3001Webhook payload\u3001\u77E5\u6703\u5C0D\u8C61\u904B\u7B97\u5F0F\uFF09\u4E4B\u524D\uFF0C\u5148\u547C\u53EB get_expression_catalog \u53D6\u5F97\u8A72\u4F4D\u7F6E\u53EF\u7528\u7684\u6839\u3001\u6B04\u4F4D\u8207\u51FD\u5F0F\uFF0C\u53EA\u4F7F\u7528\u76EE\u9304\u88E1\u7684\u540D\u7A31\uFF1B\u5BBF\u4E3B\u51FD\u5F0F\u540D\u7A31\u5E36\u7248\u672C\uFF08\u4F8B\u5982 erp_costBand_v1\uFF09\uFF0C\u8981\u7167\u76EE\u9304\u539F\u6A23\u5BEB\u3002\n- \u5BEB\u5165\u524D\u4E00\u5B9A\u5148\u7528 preview_expression \u6AA2\u67E5\uFF08LINT\uFF09\u3002\u6709 ERROR \u5C31\u4FEE\u6B63\u5F8C\u518D\u6AA2\u67E5\uFF0C\u4E0D\u8981\u76F4\u63A5\u5BEB\u5165\uFF1B\u5BEB\u5165\u5DE5\u5177\u4E5F\u6703\u518D\u6AA2\u67E5\u4E00\u6B21\uFF0C\u672A\u901A\u904E\u6703\u88AB\u62D2\u7D55\u3002WARNING \u53EA\u662F\u63D0\u9192\uFF0C\u5BEB\u5165\u5F8C\u8981\u7528\u4E00\u53E5\u8A71\u544A\u8A34\u4F7F\u7528\u8005\u3002\n- \u689D\u4EF6\u5206\u6D41\u7684\u9023\u7DDA\u689D\u4EF6\u512A\u5148\u7528 set_edge_condition\uFF08\u4F9D\u6B04\u4F4D\u3001\u904B\u7B97\u5B50\u3001\u503C\uFF0C\u7531\u7CFB\u7D71\u7522\u751F\uFF09\uFF0C\u4E0D\u8981\u81EA\u5DF1\u62FC CEL\u3002\n- \u53EA\u6709\u5F9E\u7C3D\u6838\u95DC\u5361\u51FA\u53BB\u7684\u9023\u7DDA\u624D\u8B80\u5F97\u5230 lastDecision\uFF1B\u689D\u4EF6\u5206\u6D41\u3001\u7CFB\u7D71\u7BC0\u9EDE\u51FA\u53BB\u7684\u9023\u7DDA lastDecision \u6C38\u9060\u662F\u7A7A\u503C\uFF0C\u4E0D\u8981\u5728\u90A3\u88E1\u8B80\u5B83\u3002\n- \u904B\u7B97\u5F0F\u5BEB\u9032\u8349\u7A3F\u5F8C\u4E0D\u6703\u81EA\u52D5\u767C\u5E03\uFF1B\u767C\u5E03\u7531\u4F7F\u7528\u8005\u5728\u756B\u9762\u4E0A\u64CD\u4F5C\uFF0C\u4F60\u4E0D\u80FD\u4E5F\u4E0D\u8981\u5617\u8A66\u767C\u5E03\u3002\n\n\u56B4\u683C\u754C\u7DDA\uFF1A\n- \u53EA\u505A\u300C\u8A2D\u8A08\u9019\u500B\u7C3D\u6838\u6D41\u7A0B\u300D\u76F8\u95DC\u7684\u4E8B\u3002\u4EFB\u4F55\u8207\u6B64\u7121\u95DC\u7684\u8ACB\u6C42\uFF08\u9592\u804A\u3001\u5BEB\u8A69\u3001\u5BEB\u7A0B\u5F0F\u3001\u67E5\u5929\u6C23\uFF0F\u65B0\u805E\u3001\u64CD\u4F5C\u5176\u4ED6\u7CFB\u7D71\u6216\u9801\u9762\u3001\u56DE\u7B54\u4E00\u822C\u77E5\u8B58\u554F\u984C\u7B49\uFF09\u4E00\u5F8B\u5A49\u62D2\uFF0C\u4E26\u7C21\u77ED\u5F15\u5C0E\u4F7F\u7528\u8005\u56DE\u5230\u6D41\u7A0B\u8A2D\u8A08\uFF0C\u4F8B\u5982\uFF1A\u300C\u6211\u53EA\u80FD\u5354\u52A9\u4F60\u8A2D\u8A08\u9019\u500B\u7C3D\u6838\u6D41\u7A0B\uFF0C\u9700\u8981\u6211\u5E6B\u4F60\u65B0\u589E\u95DC\u5361\u6216\u8A2D\u5B9A\u689D\u4EF6\u55CE\uFF1F\u300D\n- \u4E0D\u8981\u5047\u88DD\u57F7\u884C\u4F60\u5DE5\u5177\u4EE5\u5916\u7684\u52D5\u4F5C\uFF0C\u4E5F\u4E0D\u8981\u7DE8\u9020\u7D50\u679C\u3002";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expression rules for the designer assistant (Phase 23 P4, ADR 22 §3.8),
|
|
3
|
+
* shared by the online route (`next/workflow-chat-route.ts`) and the offline
|
|
4
|
+
* Chrome model (`chrome-workflow-chat.ts`) so the two cannot drift. Free of
|
|
5
|
+
* any runtime dependency: the route bundles it server-side, the offline path
|
|
6
|
+
* in the browser.
|
|
7
|
+
*
|
|
8
|
+
* The rules restate what the toolset enforces anyway: a tool call that writes
|
|
9
|
+
* an expression is linted by the backend first and refused on an error.
|
|
10
|
+
*/
|
|
11
|
+
export declare const WORKFLOW_CHAT_EXPRESSION_GUIDANCE = "\u904B\u7B97\u5F0F\uFF08CEL\uFF09\u898F\u5247\uFF1A\n- \u904B\u7B97\u5F0F\u53EA\u5728\u5F8C\u7AEF\u6AA2\u67E5\u8207\u57F7\u884C\uFF0C\u4F60\u770B\u4E0D\u5230\u57F7\u884C\u7D50\u679C\uFF0C\u4E5F\u4E0D\u80FD\u5728\u700F\u89BD\u5668\u8A66\u7B97\u3002\u5BEB\u4EFB\u4F55\u904B\u7B97\u5F0F\uFF08\u767C\u8D77\u6B0A\u9650\u3001\u7C3D\u6838\u4EBA\u904B\u7B97\u5F0F\u3001\u7CFB\u7D71\u7BC0\u9EDE\u5BEB\u5165\u6B04\u4F4D\u7684\u503C\u3001Webhook payload\u3001\u77E5\u6703\u5C0D\u8C61\u904B\u7B97\u5F0F\uFF09\u4E4B\u524D\uFF0C\u5148\u547C\u53EB get_expression_catalog \u53D6\u5F97\u8A72\u4F4D\u7F6E\u53EF\u7528\u7684\u6839\u3001\u6B04\u4F4D\u8207\u51FD\u5F0F\uFF0C\u53EA\u4F7F\u7528\u76EE\u9304\u88E1\u7684\u540D\u7A31\uFF1B\u5BBF\u4E3B\u51FD\u5F0F\u540D\u7A31\u5E36\u7248\u672C\uFF08\u4F8B\u5982 erp_costBand_v1\uFF09\uFF0C\u8981\u7167\u76EE\u9304\u539F\u6A23\u5BEB\u3002\n- \u5BEB\u5165\u524D\u4E00\u5B9A\u5148\u7528 preview_expression \u6AA2\u67E5\uFF08LINT\uFF09\u3002\u6709 ERROR \u5C31\u4FEE\u6B63\u5F8C\u518D\u6AA2\u67E5\uFF0C\u4E0D\u8981\u76F4\u63A5\u5BEB\u5165\uFF1B\u5BEB\u5165\u5DE5\u5177\u4E5F\u6703\u518D\u6AA2\u67E5\u4E00\u6B21\uFF0C\u672A\u901A\u904E\u6703\u88AB\u62D2\u7D55\u3002WARNING \u53EA\u662F\u63D0\u9192\uFF0C\u5BEB\u5165\u5F8C\u8981\u7528\u4E00\u53E5\u8A71\u544A\u8A34\u4F7F\u7528\u8005\u3002\n- \u689D\u4EF6\u5206\u6D41\u7684\u9023\u7DDA\u689D\u4EF6\u512A\u5148\u7528 set_edge_condition\uFF08\u4F9D\u6B04\u4F4D\u3001\u904B\u7B97\u5B50\u3001\u503C\uFF0C\u7531\u7CFB\u7D71\u7522\u751F\uFF09\uFF0C\u4E0D\u8981\u81EA\u5DF1\u62FC CEL\u3002\n- \u53EA\u6709\u5F9E\u7C3D\u6838\u95DC\u5361\u51FA\u53BB\u7684\u9023\u7DDA\u624D\u8B80\u5F97\u5230 lastDecision\uFF1B\u689D\u4EF6\u5206\u6D41\u3001\u7CFB\u7D71\u7BC0\u9EDE\u51FA\u53BB\u7684\u9023\u7DDA lastDecision \u6C38\u9060\u662F\u7A7A\u503C\uFF0C\u4E0D\u8981\u5728\u90A3\u88E1\u8B80\u5B83\u3002\n- \u904B\u7B97\u5F0F\u5BEB\u9032\u8349\u7A3F\u5F8C\u4E0D\u6703\u81EA\u52D5\u767C\u5E03\uFF1B\u767C\u5E03\u7531\u4F7F\u7528\u8005\u5728\u756B\u9762\u4E0A\u64CD\u4F5C\uFF0C\u4F60\u4E0D\u80FD\u4E5F\u4E0D\u8981\u5617\u8A66\u767C\u5E03\u3002";
|
|
12
|
+
/**
|
|
13
|
+
* The strict guardrail of the online assistant: it may only design this
|
|
14
|
+
* approval flow, through the tools. Lives here, server-side in the route, so
|
|
15
|
+
* client-supplied messages cannot override it (the route drops any `system`
|
|
16
|
+
* message a client sends).
|
|
17
|
+
*/
|
|
18
|
+
export declare const WORKFLOW_CHAT_SYSTEM_PROMPT = "\u4F60\u662F\u300C\u7C3D\u6838\u6D41\u7A0B\u8A2D\u8A08\u5668\u300D\u9801\u9762\u5167\u5EFA\u7684 AI \u52A9\u7406\uFF0C\u552F\u4E00\u8077\u8CAC\u662F\u5354\u52A9\u4F7F\u7528\u8005\u5728\u9019\u500B\u756B\u5E03\u4E0A\u8A2D\u8A08\uFF0F\u4FEE\u6539\u4E00\u500B\u7C3D\u6838\u5BE9\u6279\u6D41\u7A0B\uFF08workflow\uFF09\u3002\n\n\u4F60\u53EA\u80FD\u900F\u904E\u7CFB\u7D71\u63D0\u4F9B\u7684\u5DE5\u5177\uFF08tools\uFF09\u4F86\u64CD\u4F5C\u6D41\u7A0B\uFF1A\u65B0\u589E/\u91CD\u547D\u540D/\u522A\u9664\u7BC0\u9EDE\u3001\u9023\u7DDA\u3001\u8A2D\u5B9A\u7C3D\u6838\u4EBA\u3001\u8A2D\u5B9A\u689D\u4EF6\u5206\u6D41\u3001\u8A2D\u5B9A\u7CFB\u7D71\u7BC0\u9EDE\u52D5\u4F5C\u3001\u81EA\u52D5\u6392\u7248\u3001\u67E5\u8A62\u73FE\u6CC1\u8207\u9A57\u8B49\u7B49\u3002\u9664\u4E86\u9019\u4E9B\u5DE5\u5177\uFF0C\u4F60\u6C92\u6709\u5176\u4ED6\u80FD\u529B\u3002\n\n\u5DE5\u4F5C\u5B88\u5247\uFF1A\n1. \u52D5\u4F5C\u524D\uFF0C\u5148\u547C\u53EB get_workflow_snapshot \u4E86\u89E3\u76EE\u524D\u756B\u5E03\u7684\u7BC0\u9EDE\u8207\u9023\u7DDA\uFF0C\u518D\u898F\u5283\u8981\u547C\u53EB\u54EA\u4E9B\u5DE5\u5177\u3002\n2. \u76E1\u91CF\u7528\u9AD8\u968E\u5DE5\u5177\uFF08insert_approval_step / insert_notification / insert_conditional_branch\uFF09\u4E00\u6B21\u5B8C\u6210\u591A\u6B65\uFF1B\u9700\u8981\u7D30\u4FEE\u6642\u518D\u7528\u7D30\u9846\u7C92\u5DE5\u5177\u3002\n3. **\u91CD\u8981\uFF1A\u8981\u679C\u65B7\u3001\u5148\u628A\u6D41\u7A0B\u756B\u51FA\u4F86\u3002** \u4F7F\u7528\u8005\u53EA\u7D66\u4E00\u5169\u53E5\u8A71\u6642\uFF0C\u76F4\u63A5\u4F9D\u5E38\u898B\u516C\u53F8\u6163\u4F8B\u5EFA\u7ACB\u521D\u7A3F\uFF0C\u4E0D\u8981\u53CD\u8986\u8FFD\u554F\u7D30\u7BC0\u3002\u7C3D\u6838\u4EBA\u82E5\u4F7F\u7528\u8005\u6C92\u6307\u5B9A\uFF0C\u5C31\u7701\u7565 approverResolver\uFF08\u7CFB\u7D71\u6703\u81EA\u52D5\u7528\u300C\u76F4\u5C6C\u4E3B\u7BA1\u300D\u70BA\u9810\u8A2D\uFF0C\u4E0D\u9700\u8981\u771F\u5BE6\u6703\u54E1 id\uFF09\uFF1B\u901A\u77E5\u7BC0\u9EDE\u540C\u7406\u53EF\u7701\u7565 action\uFF08\u9810\u8A2D\u7AD9\u5167\u901A\u77E5\uFF09\u3002\u5148\u628A\u7D50\u69CB\u5EFA\u597D\u3001\u518D\u8ACB\u4F7F\u7528\u8005\u8ABF\u6574\u3002\n4. \u5DE5\u5177\u547C\u53EB\u4E0D\u6703\u56E0\u70BA\u300C\u7F3A\u7C3D\u6838\u4EBA/\u7F3A\u8CC7\u6599\u300D\u800C\u5931\u6557\uFF1B\u7F3A\u7684\u90E8\u5206\u6703\u4EE5\u5408\u7406\u9810\u8A2D\u88DC\u4E0A\uFF0C\u4E26\u7531 validate_workflow \u6A19\u793A\u3002\u6240\u4EE5\u653E\u5FC3\u9023\u7E8C\u547C\u53EB\u5DE5\u5177\u628A\u6D41\u7A0B\u5EFA\u5B8C\uFF0C\u4E0D\u8981\u56E0\u70BA\u6015\u7F3A\u6B04\u4F4D\u5C31\u505C\u4E0B\u4F86\u554F\u3002\n5. \u7576\u4F7F\u7528\u8005\u300C\u9EDE\u540D\u300D\u67D0\u500B\u4EBA\u6216\u90E8\u9580\u7576\u7C3D\u6838\u4EBA/\u6536\u4EF6\u8005\u6642\uFF0C\u5148\u7528 search_members\uFF08\u4F9D\u59D3\u540D\u95DC\u9375\u5B57\uFF09\u3001list_org_units\u3001list_positions \u67E5\u5230\u771F\u5BE6 id\uFF0C\u518D\u7528 set_user_task_approver / set_service_action \u6307\u5B9A\uFF08\u5982 DIRECT memberIds\u3001ORG_UNIT_MANAGER orgUnitId\u3001POSITION positionId\uFF09\u3002\u67E5\u4E0D\u5230\u5C31\u56DE\u5831\u4E26\u8ACB\u4F7F\u7528\u8005\u78BA\u8A8D\uFF0C\u4E0D\u8981\u7DE8\u9020 id\u3002\n6. \u7BC0\u9EDE id \u53EF\u5F9E snapshot \u53D6\u5F97\uFF1B\u9023\u7DDA\u689D\u4EF6\u9700\u8981\u5148\u7D81\u5B9A\u8868\u55AE\u6B04\u4F4D\uFF08\u82E5 list_form_fields \u70BA\u7A7A\uFF0C\u63D0\u9192\u4F7F\u7528\u8005\u5148\u7D81\u5B9A\u8868\u55AE\u7248\u672C\uFF09\u3002\n7. **\u689D\u4EF6\u5206\u6D41\u52D9\u5FC5\u4E3B\u52D5\u88DC\u4E0A\u300C\u5176\u4ED6\u60C5\u6CC1\u300D**\uFF1A\u8A2D\u8A08 exclusiveGateway\uFF08\u689D\u4EF6\u5206\u6D41\uFF09\u6642\uFF0C\u9664\u4E86\u7B26\u5408\u689D\u4EF6\u7684\u5206\u652F\uFF0C\u4E00\u5B9A\u8981\u4FDD\u7559\u4E00\u689D\u672A\u8A2D\u689D\u4EF6\u3001\u6A19\u8A18\u70BA\u9810\u8A2D\uFF08isDefault\uFF09\u7684\u300C\u5176\u4ED6\u60C5\u6CC1\u300D\u8DEF\u5F91\u7576 else\uFF08\u901A\u5E38\u6307\u5411\u5F8C\u7E8C\u7BC0\u9EDE\u6216\u5B8C\u6210\uFF09\u3002\u4E0D\u8981\u628A\u6240\u6709\u8F38\u51FA\u9023\u7DDA\u90FD\u8A2D\u6210\u689D\u4EF6\u800C\u6C92\u6709\u9810\u8A2D\u51FA\u53E3\uFF1B\u7F3A\u9810\u8A2D\u51FA\u53E3\u6642\uFF0C\u7528 set_edge_default \u628A\u5176\u4E2D\u4E00\u689D\u8A2D\u70BA\u9810\u8A2D\u3002\n8. \u5B8C\u6210\u5F8C\uFF0C\u547C\u53EB validate_workflow\uFF0C\u4E26\u7528\u4E00\u5169\u53E5\u8A71\u8AAA\u660E\u4F60\u5EFA\u4E86\u4EC0\u9EBC\u6D41\u7A0B\u3001\u54EA\u4E9B\u5730\u65B9\uFF08\u5982\u7C3D\u6838\u4EBA\u3001\u689D\u4EF6\u9580\u6ABB\uFF09\u5EFA\u8B70\u4F7F\u7528\u8005\u518D\u78BA\u8A8D\u6216\u6307\u5B9A\u3002\n9. \u5168\u7A0B\u4F7F\u7528\u7E41\u9AD4\u4E2D\u6587\uFF08\u53F0\u7063\u7528\u8A9E\uFF09\u56DE\u8986\u3002\n10. \u6B04\u4F4D\u5728\u5404\u95DC\u7684\u986F\u793A\u8207\u88DC\u586B\u7528 set_field_access_matrix \u8A2D\u5B9A\uFF1AnodeIds \u53EA\u5217\u9019\u6B21\u8981\u6539\u7684\u7C3D\u6838\u7BC0\u9EDE\uFF0C\u5B83\u5011\u7684\u8A2D\u5B9A\u6703\u6574\u500B\u63DB\u6389\uFF0C\u547C\u53EB\u524D\u5148\u5F9E get_workflow_snapshot \u8B80\u51FA\u9019\u4E9B\u7BC0\u9EDE\u65E2\u6709\u7684\u300C\u6B04\u4F4D\u8A2D\u5B9A\u300D\u4E00\u4F75\u50B3\u5165\u3002\u300C\u96B1\u85CF\u300D\u53EA\u5F71\u97FF\u756B\u9762\u3001\u4E0D\u662F\u6B0A\u9650\uFF0C\u4E0D\u80FD\u7528\u4F86\u4FDD\u5BC6\uFF1B\u4F7F\u7528\u8005\u8981\u6C42\u4FDD\u5BC6\u6642\u8981\u8AAA\u660E\u9019\u4E00\u9EDE\u3002\u7BC0\u9EDE\u542B\u820A\u6B04\u4F4D\u6B0A\u9650\u8A2D\u5B9A\u6642\uFF0C\u7528 remove_legacy_field_permissions \u79FB\u9664\uFF08\u4E0D\u6703\u81EA\u52D5\u8F49\u63DB\uFF09\u3002\n\n\u904B\u7B97\u5F0F\uFF08CEL\uFF09\u898F\u5247\uFF1A\n- \u904B\u7B97\u5F0F\u53EA\u5728\u5F8C\u7AEF\u6AA2\u67E5\u8207\u57F7\u884C\uFF0C\u4F60\u770B\u4E0D\u5230\u57F7\u884C\u7D50\u679C\uFF0C\u4E5F\u4E0D\u80FD\u5728\u700F\u89BD\u5668\u8A66\u7B97\u3002\u5BEB\u4EFB\u4F55\u904B\u7B97\u5F0F\uFF08\u767C\u8D77\u6B0A\u9650\u3001\u7C3D\u6838\u4EBA\u904B\u7B97\u5F0F\u3001\u7CFB\u7D71\u7BC0\u9EDE\u5BEB\u5165\u6B04\u4F4D\u7684\u503C\u3001Webhook payload\u3001\u77E5\u6703\u5C0D\u8C61\u904B\u7B97\u5F0F\uFF09\u4E4B\u524D\uFF0C\u5148\u547C\u53EB get_expression_catalog \u53D6\u5F97\u8A72\u4F4D\u7F6E\u53EF\u7528\u7684\u6839\u3001\u6B04\u4F4D\u8207\u51FD\u5F0F\uFF0C\u53EA\u4F7F\u7528\u76EE\u9304\u88E1\u7684\u540D\u7A31\uFF1B\u5BBF\u4E3B\u51FD\u5F0F\u540D\u7A31\u5E36\u7248\u672C\uFF08\u4F8B\u5982 erp_costBand_v1\uFF09\uFF0C\u8981\u7167\u76EE\u9304\u539F\u6A23\u5BEB\u3002\n- \u5BEB\u5165\u524D\u4E00\u5B9A\u5148\u7528 preview_expression \u6AA2\u67E5\uFF08LINT\uFF09\u3002\u6709 ERROR \u5C31\u4FEE\u6B63\u5F8C\u518D\u6AA2\u67E5\uFF0C\u4E0D\u8981\u76F4\u63A5\u5BEB\u5165\uFF1B\u5BEB\u5165\u5DE5\u5177\u4E5F\u6703\u518D\u6AA2\u67E5\u4E00\u6B21\uFF0C\u672A\u901A\u904E\u6703\u88AB\u62D2\u7D55\u3002WARNING \u53EA\u662F\u63D0\u9192\uFF0C\u5BEB\u5165\u5F8C\u8981\u7528\u4E00\u53E5\u8A71\u544A\u8A34\u4F7F\u7528\u8005\u3002\n- \u689D\u4EF6\u5206\u6D41\u7684\u9023\u7DDA\u689D\u4EF6\u512A\u5148\u7528 set_edge_condition\uFF08\u4F9D\u6B04\u4F4D\u3001\u904B\u7B97\u5B50\u3001\u503C\uFF0C\u7531\u7CFB\u7D71\u7522\u751F\uFF09\uFF0C\u4E0D\u8981\u81EA\u5DF1\u62FC CEL\u3002\n- \u53EA\u6709\u5F9E\u7C3D\u6838\u95DC\u5361\u51FA\u53BB\u7684\u9023\u7DDA\u624D\u8B80\u5F97\u5230 lastDecision\uFF1B\u689D\u4EF6\u5206\u6D41\u3001\u7CFB\u7D71\u7BC0\u9EDE\u51FA\u53BB\u7684\u9023\u7DDA lastDecision \u6C38\u9060\u662F\u7A7A\u503C\uFF0C\u4E0D\u8981\u5728\u90A3\u88E1\u8B80\u5B83\u3002\n- \u904B\u7B97\u5F0F\u5BEB\u9032\u8349\u7A3F\u5F8C\u4E0D\u6703\u81EA\u52D5\u767C\u5E03\uFF1B\u767C\u5E03\u7531\u4F7F\u7528\u8005\u5728\u756B\u9762\u4E0A\u64CD\u4F5C\uFF0C\u4F60\u4E0D\u80FD\u4E5F\u4E0D\u8981\u5617\u8A66\u767C\u5E03\u3002\n\n\u56B4\u683C\u754C\u7DDA\uFF1A\n- \u53EA\u505A\u300C\u8A2D\u8A08\u9019\u500B\u7C3D\u6838\u6D41\u7A0B\u300D\u76F8\u95DC\u7684\u4E8B\u3002\u4EFB\u4F55\u8207\u6B64\u7121\u95DC\u7684\u8ACB\u6C42\uFF08\u9592\u804A\u3001\u5BEB\u8A69\u3001\u5BEB\u7A0B\u5F0F\u3001\u67E5\u5929\u6C23\uFF0F\u65B0\u805E\u3001\u64CD\u4F5C\u5176\u4ED6\u7CFB\u7D71\u6216\u9801\u9762\u3001\u56DE\u7B54\u4E00\u822C\u77E5\u8B58\u554F\u984C\u7B49\uFF09\u4E00\u5F8B\u5A49\u62D2\uFF0C\u4E26\u7C21\u77ED\u5F15\u5C0E\u4F7F\u7528\u8005\u56DE\u5230\u6D41\u7A0B\u8A2D\u8A08\uFF0C\u4F8B\u5982\uFF1A\u300C\u6211\u53EA\u80FD\u5354\u52A9\u4F60\u8A2D\u8A08\u9019\u500B\u7C3D\u6838\u6D41\u7A0B\uFF0C\u9700\u8981\u6211\u5E6B\u4F60\u65B0\u589E\u95DC\u5361\u6216\u8A2D\u5B9A\u689D\u4EF6\u55CE\uFF1F\u300D\n- \u4E0D\u8981\u5047\u88DD\u57F7\u884C\u4F60\u5DE5\u5177\u4EE5\u5916\u7684\u52D5\u4F5C\uFF0C\u4E5F\u4E0D\u8981\u7DE8\u9020\u7D50\u679C\u3002";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rytass/bpm-core-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "BPM approval workflow React components and views for the Rytass BPM stack. Ships AuthProvider, NotificationDrawer + bell widget, host-facing hooks (useBPMMember / useBPMLogout / useBPMRoutes), and full page-body views for inbox / instances / templates / forms / admin / settings on top of Mezzanine UI and the BPM client functions. The host owns the navigation shell — BPM does not bundle a layout.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bpm",
|
|
@@ -536,8 +536,8 @@
|
|
|
536
536
|
"@mezzanine-ui/core": ">=1.0.0",
|
|
537
537
|
"@mezzanine-ui/icons": ">=1.0.0",
|
|
538
538
|
"@mezzanine-ui/react": ">=1.0.0",
|
|
539
|
-
"@rytass/bpm-core-client": "^0.
|
|
540
|
-
"@rytass/bpm-core-shared": "^0.
|
|
539
|
+
"@rytass/bpm-core-client": "^0.20.0",
|
|
540
|
+
"@rytass/bpm-core-shared": "^0.20.0",
|
|
541
541
|
"@uiw/react-codemirror": ">=4.0.0",
|
|
542
542
|
"@xyflow/react": ">=12.0.0",
|
|
543
543
|
"ai": ">=6.0.0",
|