@octaviaflow/flow-rules 0.1.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/README.md +96 -0
- package/dist/catalog/actions/console-log/config.d.ts +58 -0
- package/dist/catalog/actions/console-log/config.js +70 -0
- package/dist/catalog/actions/console-log/index.d.ts +7 -0
- package/dist/catalog/actions/console-log/index.js +89 -0
- package/dist/catalog/actions/delay/config.d.ts +50 -0
- package/dist/catalog/actions/delay/config.js +79 -0
- package/dist/catalog/actions/delay/index.d.ts +7 -0
- package/dist/catalog/actions/delay/index.js +71 -0
- package/dist/catalog/actions/delay/migrate.d.ts +18 -0
- package/dist/catalog/actions/delay/migrate.js +38 -0
- package/dist/catalog/actions/delay/types.d.ts +58 -0
- package/dist/catalog/actions/delay/types.js +17 -0
- package/dist/catalog/actions/http-request/config.d.ts +114 -0
- package/dist/catalog/actions/http-request/config.js +111 -0
- package/dist/catalog/actions/http-request/index.d.ts +7 -0
- package/dist/catalog/actions/http-request/index.js +223 -0
- package/dist/catalog/ai/ai-agent/index.d.ts +12 -0
- package/dist/catalog/ai/ai-agent/index.js +72 -0
- package/dist/catalog/ai/idp-extract/index.d.ts +18 -0
- package/dist/catalog/ai/idp-extract/index.js +90 -0
- package/dist/catalog/api/graphql-query/config.d.ts +36 -0
- package/dist/catalog/api/graphql-query/config.js +31 -0
- package/dist/catalog/api/graphql-query/index.d.ts +7 -0
- package/dist/catalog/api/graphql-query/index.js +75 -0
- package/dist/catalog/communication/email-send/config.d.ts +80 -0
- package/dist/catalog/communication/email-send/config.js +80 -0
- package/dist/catalog/communication/email-send/index.d.ts +11 -0
- package/dist/catalog/communication/email-send/index.js +152 -0
- package/dist/catalog/communication/google-chat/config.d.ts +45 -0
- package/dist/catalog/communication/google-chat/config.js +28 -0
- package/dist/catalog/communication/google-chat/index.d.ts +5 -0
- package/dist/catalog/communication/google-chat/index.js +36 -0
- package/dist/catalog/communication/slack-message/config.d.ts +47 -0
- package/dist/catalog/communication/slack-message/config.js +36 -0
- package/dist/catalog/communication/slack-message/index.d.ts +5 -0
- package/dist/catalog/communication/slack-message/index.js +37 -0
- package/dist/catalog/communication/teams-message/config.d.ts +48 -0
- package/dist/catalog/communication/teams-message/config.js +29 -0
- package/dist/catalog/communication/teams-message/index.d.ts +5 -0
- package/dist/catalog/communication/teams-message/index.js +39 -0
- package/dist/catalog/communication/webhook-call/config.d.ts +36 -0
- package/dist/catalog/communication/webhook-call/config.js +31 -0
- package/dist/catalog/communication/webhook-call/index.d.ts +5 -0
- package/dist/catalog/communication/webhook-call/index.js +43 -0
- package/dist/catalog/communication/whatsapp-send/config.d.ts +23 -0
- package/dist/catalog/communication/whatsapp-send/config.js +36 -0
- package/dist/catalog/communication/whatsapp-send/index.d.ts +15 -0
- package/dist/catalog/communication/whatsapp-send/index.js +57 -0
- package/dist/catalog/general/query/config.d.ts +36 -0
- package/dist/catalog/general/query/config.js +257 -0
- package/dist/catalog/general/query/index.d.ts +11 -0
- package/dist/catalog/general/query/index.js +271 -0
- package/dist/catalog/general/query/types.d.ts +205 -0
- package/dist/catalog/general/query/types.js +82 -0
- package/dist/catalog/general/transform/config.d.ts +117 -0
- package/dist/catalog/general/transform/config.js +95 -0
- package/dist/catalog/general/transform/index.d.ts +8 -0
- package/dist/catalog/general/transform/index.js +63 -0
- package/dist/catalog/index.d.ts +57 -0
- package/dist/catalog/index.js +168 -0
- package/dist/catalog/logic/condition/config.d.ts +54 -0
- package/dist/catalog/logic/condition/config.js +93 -0
- package/dist/catalog/logic/condition/index.d.ts +7 -0
- package/dist/catalog/logic/condition/index.js +64 -0
- package/dist/catalog/logic/for-each/config.d.ts +100 -0
- package/dist/catalog/logic/for-each/config.js +75 -0
- package/dist/catalog/logic/for-each/index.d.ts +7 -0
- package/dist/catalog/logic/for-each/index.js +92 -0
- package/dist/catalog/logic/for-each/pathOptions.d.ts +62 -0
- package/dist/catalog/logic/for-each/pathOptions.js +151 -0
- package/dist/catalog/logic/group/index.d.ts +15 -0
- package/dist/catalog/logic/group/index.js +46 -0
- package/dist/catalog/policies.d.ts +75 -0
- package/dist/catalog/policies.js +62 -0
- package/dist/catalog/storage/csv-action/index.d.ts +2 -0
- package/dist/catalog/storage/csv-action/index.js +38 -0
- package/dist/catalog/storage/dropbox-action/index.d.ts +2 -0
- package/dist/catalog/storage/dropbox-action/index.js +33 -0
- package/dist/catalog/storage/excel-action/index.d.ts +2 -0
- package/dist/catalog/storage/excel-action/index.js +32 -0
- package/dist/catalog/storage/file-action/index.d.ts +2 -0
- package/dist/catalog/storage/file-action/index.js +119 -0
- package/dist/catalog/storage/file-operation/config.d.ts +48 -0
- package/dist/catalog/storage/file-operation/config.js +45 -0
- package/dist/catalog/storage/file-operation/index.d.ts +8 -0
- package/dist/catalog/storage/file-operation/index.js +111 -0
- package/dist/catalog/storage/ftp-action/index.d.ts +2 -0
- package/dist/catalog/storage/ftp-action/index.js +33 -0
- package/dist/catalog/storage/google-drive-action/index.d.ts +2 -0
- package/dist/catalog/storage/google-drive-action/index.js +38 -0
- package/dist/catalog/storage/json-action/index.d.ts +2 -0
- package/dist/catalog/storage/json-action/index.js +31 -0
- package/dist/catalog/storage/onedrive-action/index.d.ts +2 -0
- package/dist/catalog/storage/onedrive-action/index.js +33 -0
- package/dist/catalog/storage/s3-action/index.d.ts +2 -0
- package/dist/catalog/storage/s3-action/index.js +36 -0
- package/dist/catalog/storage/storage-action/index.d.ts +13 -0
- package/dist/catalog/storage/storage-action/index.js +72 -0
- package/dist/catalog/storage/storageCapabilities.d.ts +57 -0
- package/dist/catalog/storage/storageCapabilities.js +207 -0
- package/dist/catalog/storage/xml-action/index.d.ts +2 -0
- package/dist/catalog/storage/xml-action/index.js +31 -0
- package/dist/catalog/transforms/format/config.d.ts +23 -0
- package/dist/catalog/transforms/format/config.js +19 -0
- package/dist/catalog/transforms/format/index.d.ts +5 -0
- package/dist/catalog/transforms/format/index.js +39 -0
- package/dist/catalog/triggers/connector-trigger/index.d.ts +7 -0
- package/dist/catalog/triggers/connector-trigger/index.js +72 -0
- package/dist/catalog/triggers/manual-trigger/config.d.ts +40 -0
- package/dist/catalog/triggers/manual-trigger/config.js +60 -0
- package/dist/catalog/triggers/manual-trigger/index.d.ts +10 -0
- package/dist/catalog/triggers/manual-trigger/index.js +74 -0
- package/dist/catalog/triggers/schedule-trigger/config.d.ts +42 -0
- package/dist/catalog/triggers/schedule-trigger/config.js +42 -0
- package/dist/catalog/triggers/schedule-trigger/index.d.ts +7 -0
- package/dist/catalog/triggers/schedule-trigger/index.js +102 -0
- package/dist/catalog/triggers/webhook-trigger/config.d.ts +31 -0
- package/dist/catalog/triggers/webhook-trigger/config.js +27 -0
- package/dist/catalog/triggers/webhook-trigger/index.d.ts +7 -0
- package/dist/catalog/triggers/webhook-trigger/index.js +89 -0
- package/dist/catalog/types.d.ts +360 -0
- package/dist/catalog/types.js +135 -0
- package/dist/catalog/utility/debug/config.d.ts +72 -0
- package/dist/catalog/utility/debug/config.js +90 -0
- package/dist/catalog/utility/debug/index.d.ts +11 -0
- package/dist/catalog/utility/debug/index.js +38 -0
- package/dist/catalog/utility/error/config.d.ts +26 -0
- package/dist/catalog/utility/error/config.js +25 -0
- package/dist/catalog/utility/error/index.d.ts +7 -0
- package/dist/catalog/utility/error/index.js +46 -0
- package/dist/catalog/utility/variables/config.d.ts +76 -0
- package/dist/catalog/utility/variables/config.js +70 -0
- package/dist/catalog/utility/variables/index.d.ts +13 -0
- package/dist/catalog/utility/variables/index.js +40 -0
- package/dist/catalog/workflow.d.ts +308 -0
- package/dist/catalog/workflow.js +25 -0
- package/dist/ids.d.ts +31 -0
- package/dist/ids.js +53 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +28 -0
- package/dist/rules/nodeConfigStatus.d.ts +33 -0
- package/dist/rules/nodeConfigStatus.js +217 -0
- package/dist/rules/workflowValidator.d.ts +53 -0
- package/dist/rules/workflowValidator.js +358 -0
- package/package.json +41 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action System Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Complete type definitions for the action system including enums, interfaces, and utilities
|
|
5
|
+
*/
|
|
6
|
+
// ============================================
|
|
7
|
+
// ENUMS
|
|
8
|
+
// ============================================
|
|
9
|
+
export var ActionCategory;
|
|
10
|
+
(function (ActionCategory) {
|
|
11
|
+
// Core workflow
|
|
12
|
+
ActionCategory["Trigger"] = "trigger";
|
|
13
|
+
ActionCategory["Action"] = "action";
|
|
14
|
+
ActionCategory["Logic"] = "logic";
|
|
15
|
+
ActionCategory["Transform"] = "transform";
|
|
16
|
+
// AI-specific
|
|
17
|
+
ActionCategory["AI"] = "ai";
|
|
18
|
+
// Data operations
|
|
19
|
+
ActionCategory["Database"] = "database";
|
|
20
|
+
ActionCategory["API"] = "api";
|
|
21
|
+
ActionCategory["Storage"] = "storage";
|
|
22
|
+
ActionCategory["FileStorage"] = "file_storage";
|
|
23
|
+
// Communication
|
|
24
|
+
ActionCategory["Communication"] = "communication";
|
|
25
|
+
// Integrations
|
|
26
|
+
ActionCategory["CRM"] = "crm";
|
|
27
|
+
ActionCategory["Ecommerce"] = "ecommerce";
|
|
28
|
+
ActionCategory["Marketing"] = "marketing";
|
|
29
|
+
ActionCategory["Analytics"] = "analytics";
|
|
30
|
+
ActionCategory["Productivity"] = "productivity";
|
|
31
|
+
// Advanced
|
|
32
|
+
ActionCategory["Custom"] = "custom";
|
|
33
|
+
ActionCategory["Utility"] = "utility";
|
|
34
|
+
})(ActionCategory || (ActionCategory = {}));
|
|
35
|
+
export var ActionType;
|
|
36
|
+
(function (ActionType) {
|
|
37
|
+
// Triggers
|
|
38
|
+
ActionType["Schedule"] = "schedule";
|
|
39
|
+
ActionType["Webhook"] = "webhook";
|
|
40
|
+
ActionType["Manual"] = "manual";
|
|
41
|
+
ActionType["DataChange"] = "data_change";
|
|
42
|
+
ActionType["Event"] = "event";
|
|
43
|
+
// Data Actions
|
|
44
|
+
ActionType["Read"] = "read";
|
|
45
|
+
ActionType["Write"] = "write";
|
|
46
|
+
ActionType["Update"] = "update";
|
|
47
|
+
ActionType["Delete"] = "delete";
|
|
48
|
+
ActionType["Query"] = "query";
|
|
49
|
+
// API Actions
|
|
50
|
+
ActionType["HTTPRequest"] = "http_request";
|
|
51
|
+
ActionType["GraphQLQuery"] = "graphql_query";
|
|
52
|
+
// Logic Actions
|
|
53
|
+
ActionType["Condition"] = "condition";
|
|
54
|
+
ActionType["ForEach"] = "for_each";
|
|
55
|
+
ActionType["Group"] = "group";
|
|
56
|
+
// Transform Actions
|
|
57
|
+
ActionType["Format"] = "format";
|
|
58
|
+
// AI Actions
|
|
59
|
+
ActionType["AIAgent"] = "ai_agent";
|
|
60
|
+
ActionType["Embedding"] = "embedding";
|
|
61
|
+
ActionType["VectorSearch"] = "vector_search";
|
|
62
|
+
ActionType["ImageGeneration"] = "image_generation";
|
|
63
|
+
ActionType["ImageAnalysis"] = "image_analysis";
|
|
64
|
+
ActionType["SpeechToText"] = "speech_to_text";
|
|
65
|
+
ActionType["TextToSpeech"] = "text_to_speech";
|
|
66
|
+
// General Actions
|
|
67
|
+
ActionType["Transform"] = "transform";
|
|
68
|
+
// Storage Actions
|
|
69
|
+
ActionType["FileOperation"] = "file_operation";
|
|
70
|
+
ActionType["FileAction"] = "file_action";
|
|
71
|
+
ActionType["CsvAction"] = "csv_action";
|
|
72
|
+
ActionType["JsonAction"] = "json_action";
|
|
73
|
+
ActionType["XmlAction"] = "xml_action";
|
|
74
|
+
ActionType["ExcelAction"] = "excel_action";
|
|
75
|
+
ActionType["S3Action"] = "s3_action";
|
|
76
|
+
ActionType["FtpAction"] = "ftp_action";
|
|
77
|
+
ActionType["GoogleDriveAction"] = "google_drive_action";
|
|
78
|
+
ActionType["DropboxAction"] = "dropbox_action";
|
|
79
|
+
ActionType["OneDriveAction"] = "onedrive_action";
|
|
80
|
+
ActionType["StorageAction"] = "storage_action";
|
|
81
|
+
// Communication Actions
|
|
82
|
+
ActionType["EmailSend"] = "email_send";
|
|
83
|
+
ActionType["SlackMessage"] = "slack_message";
|
|
84
|
+
ActionType["WhatsappSend"] = "whatsapp_send";
|
|
85
|
+
ActionType["TeamsMessage"] = "teams_message";
|
|
86
|
+
ActionType["GoogleChat"] = "google_chat";
|
|
87
|
+
ActionType["WebhookCall"] = "webhook_call";
|
|
88
|
+
// Utility Actions
|
|
89
|
+
ActionType["Delay"] = "delay";
|
|
90
|
+
ActionType["Wait"] = "wait";
|
|
91
|
+
ActionType["Console"] = "console";
|
|
92
|
+
ActionType["Debug"] = "debug";
|
|
93
|
+
ActionType["Error"] = "error";
|
|
94
|
+
// Custom
|
|
95
|
+
ActionType["CustomCode"] = "custom_code";
|
|
96
|
+
ActionType["CustomAction"] = "custom_action";
|
|
97
|
+
// IDP — engine-driven sync extraction. Replaces the legacy
|
|
98
|
+
// idp_wait_for_job poll loop; the engine resolves the LLM connector at
|
|
99
|
+
// execution time and extracts once per source file.
|
|
100
|
+
ActionType["IdpExtract"] = "idp_extract";
|
|
101
|
+
})(ActionType || (ActionType = {}));
|
|
102
|
+
export var ActionStatus;
|
|
103
|
+
(function (ActionStatus) {
|
|
104
|
+
ActionStatus["Stable"] = "stable";
|
|
105
|
+
ActionStatus["Beta"] = "beta";
|
|
106
|
+
ActionStatus["Alpha"] = "alpha";
|
|
107
|
+
ActionStatus["Experimental"] = "experimental";
|
|
108
|
+
ActionStatus["Deprecated"] = "deprecated";
|
|
109
|
+
})(ActionStatus || (ActionStatus = {}));
|
|
110
|
+
export var FieldType;
|
|
111
|
+
(function (FieldType) {
|
|
112
|
+
FieldType["String"] = "string";
|
|
113
|
+
FieldType["Number"] = "number";
|
|
114
|
+
FieldType["Boolean"] = "boolean";
|
|
115
|
+
FieldType["Date"] = "date";
|
|
116
|
+
FieldType["DateTime"] = "datetime";
|
|
117
|
+
FieldType["Array"] = "array";
|
|
118
|
+
FieldType["Object"] = "object";
|
|
119
|
+
FieldType["JSON"] = "json";
|
|
120
|
+
FieldType["File"] = "file";
|
|
121
|
+
FieldType["Image"] = "image";
|
|
122
|
+
FieldType["Select"] = "select";
|
|
123
|
+
FieldType["MultiSelect"] = "multi_select";
|
|
124
|
+
FieldType["Code"] = "code";
|
|
125
|
+
FieldType["Expression"] = "expression";
|
|
126
|
+
FieldType["Mapping"] = "mapping";
|
|
127
|
+
FieldType["Connection"] = "connection";
|
|
128
|
+
FieldType["Secret"] = "secret";
|
|
129
|
+
FieldType["Color"] = "color";
|
|
130
|
+
FieldType["URL"] = "url";
|
|
131
|
+
FieldType["Email"] = "email";
|
|
132
|
+
FieldType["Phone"] = "phone";
|
|
133
|
+
FieldType["RichText"] = "rich_text";
|
|
134
|
+
FieldType["Markdown"] = "markdown";
|
|
135
|
+
})(FieldType || (FieldType = {}));
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug Action — Config Types
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the engine's `DebugConfig` shape so UI and engine agree on
|
|
5
|
+
* serialization with no translation layer. See:
|
|
6
|
+
* Octaviaflow-Engine/src/services/debugExecutor.ts
|
|
7
|
+
*/
|
|
8
|
+
export type DebugMode = 'log' | 'snapshot' | 'watch' | 'assert' | 'profile';
|
|
9
|
+
export type DebugSamplingStrategy = 'head' | 'tail' | 'every-nth' | 'random';
|
|
10
|
+
export interface DebugSampling {
|
|
11
|
+
strategy: DebugSamplingStrategy;
|
|
12
|
+
n: number;
|
|
13
|
+
threshold?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface LogModeConfig {
|
|
16
|
+
level: 'debug' | 'info' | 'warning' | 'error';
|
|
17
|
+
message: string;
|
|
18
|
+
includeInputData?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface SnapshotModeConfig {
|
|
21
|
+
paths?: string[];
|
|
22
|
+
schemaDiff?: boolean;
|
|
23
|
+
redactPaths?: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface WatchExpression {
|
|
26
|
+
label: string;
|
|
27
|
+
expression: string;
|
|
28
|
+
}
|
|
29
|
+
export interface WatchModeConfig {
|
|
30
|
+
expressions: WatchExpression[];
|
|
31
|
+
}
|
|
32
|
+
export interface AssertModeConfig {
|
|
33
|
+
predicate: string;
|
|
34
|
+
failureMessage: string;
|
|
35
|
+
failureCode?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ProfileModeConfig {
|
|
38
|
+
scope: 'step' | 'since-last-debug';
|
|
39
|
+
memory?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface DebugConfigType {
|
|
42
|
+
mode: DebugMode;
|
|
43
|
+
label: string;
|
|
44
|
+
pinned?: boolean;
|
|
45
|
+
condition?: string;
|
|
46
|
+
sampling?: DebugSampling;
|
|
47
|
+
log?: LogModeConfig;
|
|
48
|
+
snapshot?: SnapshotModeConfig;
|
|
49
|
+
watch?: WatchModeConfig;
|
|
50
|
+
assert?: AssertModeConfig;
|
|
51
|
+
profile?: ProfileModeConfig;
|
|
52
|
+
}
|
|
53
|
+
export declare const DebugConfig: {
|
|
54
|
+
defaults: DebugConfigType;
|
|
55
|
+
/**
|
|
56
|
+
* Pre-flight validation. Surfaces mode-specific missing-field errors.
|
|
57
|
+
*/
|
|
58
|
+
validate(config: Partial<DebugConfigType>): {
|
|
59
|
+
valid: boolean;
|
|
60
|
+
errors: string[];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* One-time migration of the legacy `{ label, value }` stub config to
|
|
64
|
+
* the new `{ mode: 'log', label, log: {...} }` shape. Returns the
|
|
65
|
+
* config unchanged when it's already in the new shape.
|
|
66
|
+
*/
|
|
67
|
+
migrateLegacyStub(config: Partial<DebugConfigType> & {
|
|
68
|
+
value?: unknown;
|
|
69
|
+
}): DebugConfigType;
|
|
70
|
+
merge(userConfig: Partial<DebugConfigType>): DebugConfigType;
|
|
71
|
+
getLabel(config: DebugConfigType): string;
|
|
72
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug Action — Config Types
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the engine's `DebugConfig` shape so UI and engine agree on
|
|
5
|
+
* serialization with no translation layer. See:
|
|
6
|
+
* Octaviaflow-Engine/src/services/debugExecutor.ts
|
|
7
|
+
*/
|
|
8
|
+
export const DebugConfig = {
|
|
9
|
+
defaults: {
|
|
10
|
+
mode: 'log',
|
|
11
|
+
label: '',
|
|
12
|
+
log: { level: 'info', message: '' },
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* Pre-flight validation. Surfaces mode-specific missing-field errors.
|
|
16
|
+
*/
|
|
17
|
+
validate(config) {
|
|
18
|
+
const errors = [];
|
|
19
|
+
if (!config.mode)
|
|
20
|
+
errors.push('Mode is required.');
|
|
21
|
+
if (!config.label?.trim())
|
|
22
|
+
errors.push('Label is required.');
|
|
23
|
+
switch (config.mode) {
|
|
24
|
+
case 'log':
|
|
25
|
+
if (!config.log?.message?.trim())
|
|
26
|
+
errors.push('Log mode: message is required.');
|
|
27
|
+
if (!config.log?.level)
|
|
28
|
+
errors.push('Log mode: level is required.');
|
|
29
|
+
break;
|
|
30
|
+
case 'snapshot':
|
|
31
|
+
// No required fields — paths is optional, schemaDiff is optional.
|
|
32
|
+
break;
|
|
33
|
+
case 'watch':
|
|
34
|
+
if (!config.watch?.expressions?.length) {
|
|
35
|
+
errors.push('Watch mode: add at least one expression.');
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
for (const e of config.watch.expressions) {
|
|
39
|
+
if (!e.label?.trim())
|
|
40
|
+
errors.push('Watch mode: each expression needs a label.');
|
|
41
|
+
if (!e.expression?.trim())
|
|
42
|
+
errors.push('Watch mode: each expression needs an expression string.');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
case 'assert':
|
|
47
|
+
if (!config.assert?.predicate?.trim())
|
|
48
|
+
errors.push('Assert mode: predicate is required.');
|
|
49
|
+
if (!config.assert?.failureMessage?.trim())
|
|
50
|
+
errors.push('Assert mode: failure message is required.');
|
|
51
|
+
break;
|
|
52
|
+
case 'profile':
|
|
53
|
+
if (!config.profile?.scope)
|
|
54
|
+
errors.push('Profile mode: scope is required.');
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
return { valid: errors.length === 0, errors };
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* One-time migration of the legacy `{ label, value }` stub config to
|
|
61
|
+
* the new `{ mode: 'log', label, log: {...} }` shape. Returns the
|
|
62
|
+
* config unchanged when it's already in the new shape.
|
|
63
|
+
*/
|
|
64
|
+
migrateLegacyStub(config) {
|
|
65
|
+
if (config.mode) {
|
|
66
|
+
// Already migrated — strip stub-only `value` field if it lingers.
|
|
67
|
+
const { value: _stub, ...rest } = config;
|
|
68
|
+
return { ...DebugConfig.defaults, ...rest };
|
|
69
|
+
}
|
|
70
|
+
// Stub shape: { label, value }. Convert to log mode with the label
|
|
71
|
+
// doubled as the message (the most useful default given no other
|
|
72
|
+
// signal). The unused `value` is dropped — its content was always
|
|
73
|
+
// the upstream input which `includeInputData: true` now captures.
|
|
74
|
+
return {
|
|
75
|
+
mode: 'log',
|
|
76
|
+
label: config.label ?? 'Debug',
|
|
77
|
+
log: {
|
|
78
|
+
level: 'info',
|
|
79
|
+
message: config.label ?? 'Debug',
|
|
80
|
+
includeInputData: true,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
merge(userConfig) {
|
|
85
|
+
return { ...DebugConfig.defaults, ...userConfig };
|
|
86
|
+
},
|
|
87
|
+
getLabel(config) {
|
|
88
|
+
return `Debug [${config.mode}]: ${config.label}`;
|
|
89
|
+
},
|
|
90
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug Action
|
|
3
|
+
*
|
|
4
|
+
* Multi-mode workflow-author observability primitive: log / snapshot /
|
|
5
|
+
* watch / assert / profile. Plus condition gating, sampling, schema-
|
|
6
|
+
* diff classification, and a deploy-mode flag.
|
|
7
|
+
*
|
|
8
|
+
* See:
|
|
9
|
+
*/
|
|
10
|
+
import { ActionDefinition } from '../../types';
|
|
11
|
+
export declare const debugDefinition: ActionDefinition;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug Action
|
|
3
|
+
*
|
|
4
|
+
* Multi-mode workflow-author observability primitive: log / snapshot /
|
|
5
|
+
* watch / assert / profile. Plus condition gating, sampling, schema-
|
|
6
|
+
* diff classification, and a deploy-mode flag.
|
|
7
|
+
*
|
|
8
|
+
* See:
|
|
9
|
+
*/
|
|
10
|
+
import { ActionCategory, ActionType, ActionStatus } from '../../types';
|
|
11
|
+
export const debugDefinition = {
|
|
12
|
+
id: 'debug',
|
|
13
|
+
name: 'Debug',
|
|
14
|
+
description: 'Inspect, assert, watch, profile, or log workflow data at any point. Supports condition gating, sampling, and schema-drift detection.',
|
|
15
|
+
category: ActionCategory.Utility,
|
|
16
|
+
type: ActionType.Debug,
|
|
17
|
+
tags: ['utility', 'debug', 'observability', 'assert', 'snapshot', 'profile', 'built-in'],
|
|
18
|
+
status: ActionStatus.Stable,
|
|
19
|
+
icon: 'Debug',
|
|
20
|
+
color: '#6929C4',
|
|
21
|
+
// Custom panel handles all input — no generic field list.
|
|
22
|
+
inputSchema: { fields: [] },
|
|
23
|
+
// Output is intentionally minimal — Debug is observation, not data
|
|
24
|
+
// production. Captures live in the per-execution debug record.
|
|
25
|
+
outputSchema: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: [],
|
|
28
|
+
sampleOutput: { debugged: true, mode: 'log' },
|
|
29
|
+
},
|
|
30
|
+
// Bumping major version triggers the workflow migration that converts
|
|
31
|
+
// the legacy `{ label, value }` stub config to `{ mode: 'log', ... }`.
|
|
32
|
+
version: '2.0.0',
|
|
33
|
+
createdAt: '2025-01-01T00:00:00Z',
|
|
34
|
+
updatedAt: '2026-05-02T00:00:00Z',
|
|
35
|
+
createdBy: 'system',
|
|
36
|
+
isOfficial: true,
|
|
37
|
+
testable: false,
|
|
38
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Configuration
|
|
3
|
+
*/
|
|
4
|
+
export interface ErrorConfigType {
|
|
5
|
+
message: string;
|
|
6
|
+
code?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ErrorConfig: {
|
|
9
|
+
defaults: ErrorConfigType;
|
|
10
|
+
schema: {
|
|
11
|
+
message: {
|
|
12
|
+
type: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
};
|
|
15
|
+
code: {
|
|
16
|
+
type: string;
|
|
17
|
+
required: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
validate: (config: Partial<ErrorConfigType>) => {
|
|
21
|
+
valid: boolean;
|
|
22
|
+
errors: string[];
|
|
23
|
+
};
|
|
24
|
+
merge: (userConfig: Partial<ErrorConfigType>) => ErrorConfigType;
|
|
25
|
+
getLabel: (config: ErrorConfigType) => string;
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Configuration
|
|
3
|
+
*/
|
|
4
|
+
export const ErrorConfig = {
|
|
5
|
+
defaults: {
|
|
6
|
+
message: '',
|
|
7
|
+
code: undefined,
|
|
8
|
+
},
|
|
9
|
+
schema: {
|
|
10
|
+
message: { type: 'string', required: true },
|
|
11
|
+
code: { type: 'string', required: false },
|
|
12
|
+
},
|
|
13
|
+
validate: (config) => {
|
|
14
|
+
const errors = [];
|
|
15
|
+
if (!config.message)
|
|
16
|
+
errors.push('Error message is required');
|
|
17
|
+
return { valid: errors.length === 0, errors };
|
|
18
|
+
},
|
|
19
|
+
merge: (userConfig) => {
|
|
20
|
+
return { ...ErrorConfig.defaults, ...userConfig };
|
|
21
|
+
},
|
|
22
|
+
getLabel: (config) => {
|
|
23
|
+
return `Error: ${config.message}`;
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Action
|
|
3
|
+
*
|
|
4
|
+
* Throw an error to stop workflow execution
|
|
5
|
+
*/
|
|
6
|
+
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
7
|
+
export const errorDefinition = {
|
|
8
|
+
id: 'error',
|
|
9
|
+
name: 'Error',
|
|
10
|
+
description: 'Throw an error to stop workflow execution',
|
|
11
|
+
category: ActionCategory.Utility,
|
|
12
|
+
type: ActionType.Error,
|
|
13
|
+
tags: ['utility', 'error', 'control', 'built-in'],
|
|
14
|
+
status: ActionStatus.Stable,
|
|
15
|
+
icon: 'ErrorFilled',
|
|
16
|
+
color: '#da3742',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
fields: [
|
|
19
|
+
{
|
|
20
|
+
key: 'message',
|
|
21
|
+
label: 'Error Message',
|
|
22
|
+
type: FieldType.String,
|
|
23
|
+
description: 'Error message to throw',
|
|
24
|
+
validation: { required: true },
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: 'code',
|
|
28
|
+
label: 'Error Code',
|
|
29
|
+
type: FieldType.String,
|
|
30
|
+
description: 'Error code',
|
|
31
|
+
validation: { required: false },
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
outputSchema: {
|
|
36
|
+
type: 'void',
|
|
37
|
+
properties: [],
|
|
38
|
+
sampleOutput: null,
|
|
39
|
+
},
|
|
40
|
+
version: '1.0.0',
|
|
41
|
+
createdAt: '2025-01-01T00:00:00Z',
|
|
42
|
+
updatedAt: '2025-12-15T00:00:00Z',
|
|
43
|
+
createdBy: 'system',
|
|
44
|
+
isOfficial: true,
|
|
45
|
+
testable: true,
|
|
46
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variables Action — Config Types
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the engine's `VariableField` shape so the UI and engine
|
|
5
|
+
* agree on serialization with no translation layer.
|
|
6
|
+
*/
|
|
7
|
+
export type VariableType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'date';
|
|
8
|
+
export type VariableSourceKind = 'literal' | 'expression' | 'prompt' | 'secret' | 'env';
|
|
9
|
+
export type VariableSource = {
|
|
10
|
+
kind: 'literal';
|
|
11
|
+
value: unknown;
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'expression';
|
|
14
|
+
raw: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'prompt';
|
|
17
|
+
promptKey: string;
|
|
18
|
+
defaultValue?: unknown;
|
|
19
|
+
} | {
|
|
20
|
+
kind: 'secret';
|
|
21
|
+
secretRef: string;
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'env';
|
|
24
|
+
envKey: string;
|
|
25
|
+
};
|
|
26
|
+
export interface VariableField {
|
|
27
|
+
/** Output key — must match `/^[a-zA-Z_][a-zA-Z0-9_]*$/` and be unique within the step. */
|
|
28
|
+
key: string;
|
|
29
|
+
/** Display label for the row in the config panel. Defaults to `key`. */
|
|
30
|
+
label?: string;
|
|
31
|
+
type: VariableType;
|
|
32
|
+
source: VariableSource;
|
|
33
|
+
/** When true, re-evaluate on every step entry (e.g. inside ForEach).
|
|
34
|
+
* When false (default), evaluate once and cache for the run. */
|
|
35
|
+
reactive?: boolean;
|
|
36
|
+
/** When true, raise `required_missing` if the resolved value is null /
|
|
37
|
+
* undefined / empty string. */
|
|
38
|
+
required?: boolean;
|
|
39
|
+
validation?: {
|
|
40
|
+
pattern?: string;
|
|
41
|
+
min?: number;
|
|
42
|
+
max?: number;
|
|
43
|
+
enum?: unknown[];
|
|
44
|
+
};
|
|
45
|
+
description?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface VariablesConfigType {
|
|
48
|
+
fields: VariableField[];
|
|
49
|
+
/** Computed at save time by the panel; used by downstream Field
|
|
50
|
+
* Mappers / ForEach pickers without needing to re-run the workflow. */
|
|
51
|
+
_outputSchema?: {
|
|
52
|
+
type: 'object';
|
|
53
|
+
properties: Record<string, unknown>;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export declare const VariablesConfig: {
|
|
57
|
+
defaults: VariablesConfigType;
|
|
58
|
+
/**
|
|
59
|
+
* Pre-flight validation — runs at config save in the panel. Returns
|
|
60
|
+
* `valid: true` when every row passes; otherwise an array of human-
|
|
61
|
+
* readable error strings tagged with the offending key.
|
|
62
|
+
*/
|
|
63
|
+
validate(config: Partial<VariablesConfigType>): {
|
|
64
|
+
valid: boolean;
|
|
65
|
+
errors: string[];
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Compute the action's `_outputSchema` from a field list. Maps each
|
|
69
|
+
* field's declared type to a JSONSchema node so downstream Field
|
|
70
|
+
* Mappers see real fields without a preview run.
|
|
71
|
+
*/
|
|
72
|
+
computeOutputSchema(fields: VariableField[]): {
|
|
73
|
+
type: "object";
|
|
74
|
+
properties: Record<string, unknown>;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variables Action — Config Types
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the engine's `VariableField` shape so the UI and engine
|
|
5
|
+
* agree on serialization with no translation layer.
|
|
6
|
+
*/
|
|
7
|
+
const RESERVED_KEYS = new Set(['_lineage', '_meta', '_redacted', '_error']);
|
|
8
|
+
const KEY_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
9
|
+
export const VariablesConfig = {
|
|
10
|
+
defaults: {
|
|
11
|
+
fields: [],
|
|
12
|
+
},
|
|
13
|
+
/**
|
|
14
|
+
* Pre-flight validation — runs at config save in the panel. Returns
|
|
15
|
+
* `valid: true` when every row passes; otherwise an array of human-
|
|
16
|
+
* readable error strings tagged with the offending key.
|
|
17
|
+
*/
|
|
18
|
+
validate(config) {
|
|
19
|
+
const errors = [];
|
|
20
|
+
const fields = config.fields ?? [];
|
|
21
|
+
const seen = new Set();
|
|
22
|
+
for (const f of fields) {
|
|
23
|
+
if (!f.key) {
|
|
24
|
+
errors.push('Each field needs a key.');
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (RESERVED_KEYS.has(f.key)) {
|
|
28
|
+
errors.push(`"${f.key}" is reserved — pick another key.`);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (!KEY_PATTERN.test(f.key)) {
|
|
32
|
+
errors.push(`"${f.key}" is not a valid identifier (letters, digits, underscore; must not start with a digit).`);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (seen.has(f.key)) {
|
|
36
|
+
errors.push(`Duplicate key "${f.key}".`);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
seen.add(f.key);
|
|
40
|
+
if (!f.type)
|
|
41
|
+
errors.push(`"${f.key}" is missing a type.`);
|
|
42
|
+
if (!f.source)
|
|
43
|
+
errors.push(`"${f.key}" is missing a source.`);
|
|
44
|
+
}
|
|
45
|
+
return { valid: errors.length === 0, errors };
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Compute the action's `_outputSchema` from a field list. Maps each
|
|
49
|
+
* field's declared type to a JSONSchema node so downstream Field
|
|
50
|
+
* Mappers see real fields without a preview run.
|
|
51
|
+
*/
|
|
52
|
+
computeOutputSchema(fields) {
|
|
53
|
+
const properties = {};
|
|
54
|
+
for (const f of fields) {
|
|
55
|
+
properties[f.key] = fieldToJsonSchema(f);
|
|
56
|
+
}
|
|
57
|
+
return { type: 'object', properties };
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
function fieldToJsonSchema(f) {
|
|
61
|
+
const node = { type: f.type };
|
|
62
|
+
if (f.description)
|
|
63
|
+
node.description = f.description;
|
|
64
|
+
if (f.validation?.enum)
|
|
65
|
+
node.enum = f.validation.enum;
|
|
66
|
+
// For arrays we don't know the item shape from the row alone (the
|
|
67
|
+
// user picks `array` but the source value may be string, number, or
|
|
68
|
+
// object). Leave items unset — Field Mapper synthesis can handle.
|
|
69
|
+
return node;
|
|
70
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variables Action
|
|
3
|
+
*
|
|
4
|
+
* Emit one or more typed user-defined values as a step output. Five
|
|
5
|
+
* source kinds — literal, expression, prompt, secret, env — each
|
|
6
|
+
* captured via a row in the config panel. Replaces the legacy
|
|
7
|
+
* USER_INPUT pattern with first-class typed step output.
|
|
8
|
+
*
|
|
9
|
+
* See:
|
|
10
|
+
* (design notes live in the platform's own documentation)
|
|
11
|
+
*/
|
|
12
|
+
import { ActionDefinition } from '../../types';
|
|
13
|
+
export declare const variablesDefinition: ActionDefinition;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variables Action
|
|
3
|
+
*
|
|
4
|
+
* Emit one or more typed user-defined values as a step output. Five
|
|
5
|
+
* source kinds — literal, expression, prompt, secret, env — each
|
|
6
|
+
* captured via a row in the config panel. Replaces the legacy
|
|
7
|
+
* USER_INPUT pattern with first-class typed step output.
|
|
8
|
+
*
|
|
9
|
+
* See:
|
|
10
|
+
* (design notes live in the platform's own documentation)
|
|
11
|
+
*/
|
|
12
|
+
import { ActionCategory, ActionType, ActionStatus } from '../../types';
|
|
13
|
+
export const variablesDefinition = {
|
|
14
|
+
id: 'variables',
|
|
15
|
+
name: 'Variables',
|
|
16
|
+
description: 'Emit one or more typed user-defined values as a step output. Sources: literal, expression, prompt, secret, env.',
|
|
17
|
+
category: ActionCategory.Utility,
|
|
18
|
+
type: ActionType.Write,
|
|
19
|
+
tags: ['utility', 'variables', 'value', 'expression', 'built-in'],
|
|
20
|
+
status: ActionStatus.Stable,
|
|
21
|
+
icon: 'Parameter',
|
|
22
|
+
color: '#0F62FE',
|
|
23
|
+
// Custom panel handles all input editing — no generic field list.
|
|
24
|
+
inputSchema: { fields: [] },
|
|
25
|
+
// Output schema is computed at config-save time from the field rows
|
|
26
|
+
// (the panel emits `_outputSchema` into config). The static fallback
|
|
27
|
+
// here is just a placeholder so the picker shows *something* before
|
|
28
|
+
// the user defines fields.
|
|
29
|
+
outputSchema: {
|
|
30
|
+
type: 'object',
|
|
31
|
+
properties: [],
|
|
32
|
+
sampleOutput: {},
|
|
33
|
+
},
|
|
34
|
+
version: '1.0.0',
|
|
35
|
+
createdAt: '2026-05-02T00:00:00Z',
|
|
36
|
+
updatedAt: '2026-05-02T00:00:00Z',
|
|
37
|
+
createdBy: 'system',
|
|
38
|
+
isOfficial: true,
|
|
39
|
+
testable: false,
|
|
40
|
+
};
|