@geenius/ai-workflow 0.4.0 → 0.6.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 +12 -0
- package/README.md +3 -4
- package/convex.js +8 -0
- package/package.json +37 -9
- package/packages/convex/dist/index.d.ts +8 -3
- package/packages/convex/dist/index.js.map +1 -1
- package/packages/react/dist/index.d.ts +49 -1
- package/packages/react/dist/index.js +183 -11464
- package/packages/react/dist/index.js.map +1 -1
- package/packages/react-css/dist/index.d.ts +39 -1
- package/packages/react-css/dist/index.js +181 -11462
- package/packages/react-css/dist/index.js.map +1 -1
- package/packages/shared/dist/index.d.ts +15 -78
- package/packages/shared/dist/index.js +1 -88
- package/packages/shared/dist/index.js.map +1 -1
- package/packages/solidjs/dist/index.d.ts +42 -2
- package/packages/solidjs/dist/index.js +186 -11464
- package/packages/solidjs/dist/index.js.map +1 -1
- package/packages/solidjs-css/dist/index.d.ts +39 -1
- package/packages/solidjs-css/dist/index.js +181 -11462
- package/packages/solidjs-css/dist/index.js.map +1 -1
- package/react-css.js +8 -0
- package/react.js +8 -0
- package/shared.js +8 -0
- package/solidjs-css.js +8 -0
- package/solidjs.js +8 -0
|
@@ -458,6 +458,12 @@ interface WorkflowBuilderState {
|
|
|
458
458
|
*
|
|
459
459
|
* The engine stays framework-agnostic by requiring callers to provide LLM,
|
|
460
460
|
* webhook, approval, and custom-step integrations explicitly.
|
|
461
|
+
*
|
|
462
|
+
* @property callLLM Optional callback used to execute `llm-call` steps.
|
|
463
|
+
* @property callWebhook Optional callback used to execute `webhook` steps.
|
|
464
|
+
* @property onApprovalRequired Optional callback used for `human-approval` steps.
|
|
465
|
+
* @property onStepComplete Optional callback invoked after each step result is captured.
|
|
466
|
+
* @property customHandlers Optional registry of named handlers for `custom` steps.
|
|
461
467
|
*/
|
|
462
468
|
interface WorkflowEngineOptions {
|
|
463
469
|
/** LLM call function for llm-call steps */
|
|
@@ -661,7 +667,7 @@ declare const stepConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
661
667
|
handler: z.ZodString;
|
|
662
668
|
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
663
669
|
outputVar: z.ZodOptional<z.ZodString>;
|
|
664
|
-
}, z.core.$strip>]>;
|
|
670
|
+
}, z.core.$strip>], "type">;
|
|
665
671
|
/**
|
|
666
672
|
* Zod schema for one workflow step definition.
|
|
667
673
|
*/
|
|
@@ -742,7 +748,7 @@ declare const workflowStepDefSchema: z.ZodObject<{
|
|
|
742
748
|
handler: z.ZodString;
|
|
743
749
|
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
744
750
|
outputVar: z.ZodOptional<z.ZodString>;
|
|
745
|
-
}, z.core.$strip>]>;
|
|
751
|
+
}, z.core.$strip>], "type">;
|
|
746
752
|
position: z.ZodOptional<z.ZodObject<{
|
|
747
753
|
x: z.ZodNumber;
|
|
748
754
|
y: z.ZodNumber;
|
|
@@ -869,7 +875,7 @@ declare const workflowDefinitionSchema: z.ZodObject<{
|
|
|
869
875
|
handler: z.ZodString;
|
|
870
876
|
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
871
877
|
outputVar: z.ZodOptional<z.ZodString>;
|
|
872
|
-
}, z.core.$strip>]>;
|
|
878
|
+
}, z.core.$strip>], "type">;
|
|
873
879
|
position: z.ZodOptional<z.ZodObject<{
|
|
874
880
|
x: z.ZodNumber;
|
|
875
881
|
y: z.ZodNumber;
|
|
@@ -1217,12 +1223,17 @@ declare function evaluateExpression(expression: string, context: Record<string,
|
|
|
1217
1223
|
*/
|
|
1218
1224
|
/**
|
|
1219
1225
|
* Minimal graph node shape accepted by DAG helpers.
|
|
1226
|
+
*
|
|
1227
|
+
* @property id Stable node identifier used in graph traversal.
|
|
1220
1228
|
*/
|
|
1221
1229
|
interface DAGNode {
|
|
1222
1230
|
id: string;
|
|
1223
1231
|
}
|
|
1224
1232
|
/**
|
|
1225
1233
|
* Minimal graph edge shape accepted by DAG helpers.
|
|
1234
|
+
*
|
|
1235
|
+
* @property from Source node identifier.
|
|
1236
|
+
* @property to Destination node identifier.
|
|
1226
1237
|
*/
|
|
1227
1238
|
interface DAGEdge {
|
|
1228
1239
|
from: string;
|
|
@@ -1291,78 +1302,4 @@ declare function calculateRunCost(results: StepResult[]): {
|
|
|
1291
1302
|
/** Format cost as a human-readable string */
|
|
1292
1303
|
declare function formatCost(usd: number): string;
|
|
1293
1304
|
|
|
1294
|
-
|
|
1295
|
-
* @module WorkflowConvexSchemaFields
|
|
1296
|
-
* @package @geenius/ai-workflow-shared
|
|
1297
|
-
* @description Typed Convex-style schema manifests for the workflow package.
|
|
1298
|
-
* These structured objects preserve field shape so consumers can persist and
|
|
1299
|
-
* query workflow payloads without losing typed storage metadata.
|
|
1300
|
-
*/
|
|
1301
|
-
type LiteralField<T extends string | number | boolean> = {
|
|
1302
|
-
type: 'literal';
|
|
1303
|
-
value: T;
|
|
1304
|
-
optional?: true;
|
|
1305
|
-
};
|
|
1306
|
-
type StringField = {
|
|
1307
|
-
type: 'string';
|
|
1308
|
-
optional?: true;
|
|
1309
|
-
};
|
|
1310
|
-
type NumberField = {
|
|
1311
|
-
type: 'number';
|
|
1312
|
-
optional?: true;
|
|
1313
|
-
};
|
|
1314
|
-
type BooleanField = {
|
|
1315
|
-
type: 'boolean';
|
|
1316
|
-
optional?: true;
|
|
1317
|
-
};
|
|
1318
|
-
type UnknownField = {
|
|
1319
|
-
type: 'any';
|
|
1320
|
-
optional?: true;
|
|
1321
|
-
};
|
|
1322
|
-
type ArrayField = {
|
|
1323
|
-
type: 'array';
|
|
1324
|
-
items: SchemaField;
|
|
1325
|
-
optional?: true;
|
|
1326
|
-
};
|
|
1327
|
-
type RecordField = {
|
|
1328
|
-
type: 'record';
|
|
1329
|
-
key: SchemaField;
|
|
1330
|
-
value: SchemaField;
|
|
1331
|
-
optional?: true;
|
|
1332
|
-
};
|
|
1333
|
-
type ObjectField = {
|
|
1334
|
-
type: 'object';
|
|
1335
|
-
fields: Record<string, SchemaField>;
|
|
1336
|
-
optional?: true;
|
|
1337
|
-
};
|
|
1338
|
-
type UnionField = {
|
|
1339
|
-
type: 'union';
|
|
1340
|
-
values: SchemaField[];
|
|
1341
|
-
optional?: true;
|
|
1342
|
-
};
|
|
1343
|
-
/**
|
|
1344
|
-
* Typed schema field descriptor used to describe Convex document shapes.
|
|
1345
|
-
*/
|
|
1346
|
-
type SchemaField = LiteralField<string | number | boolean> | StringField | NumberField | BooleanField | UnknownField | ArrayField | RecordField | ObjectField | UnionField;
|
|
1347
|
-
/**
|
|
1348
|
-
* Manifest describing persisted workflow definition documents.
|
|
1349
|
-
*/
|
|
1350
|
-
declare const workflowsTable: ObjectField;
|
|
1351
|
-
/**
|
|
1352
|
-
* Manifest describing persisted workflow execution run documents.
|
|
1353
|
-
*/
|
|
1354
|
-
declare const workflowRunsTable: ObjectField;
|
|
1355
|
-
/**
|
|
1356
|
-
* Manifest describing persisted per-step execution result documents.
|
|
1357
|
-
*/
|
|
1358
|
-
declare const workflowStepResultsTable: ObjectField;
|
|
1359
|
-
/**
|
|
1360
|
-
* Named collection of all workflow table manifests for consumer schema merges.
|
|
1361
|
-
*/
|
|
1362
|
-
declare const workflowTables: {
|
|
1363
|
-
workflows: ObjectField;
|
|
1364
|
-
workflowRuns: ObjectField;
|
|
1365
|
-
workflowStepResults: ObjectField;
|
|
1366
|
-
};
|
|
1367
|
-
|
|
1368
|
-
export { type ConditionConfig, type ConfigureWorkflowOptions, type CustomStepConfig, type DAGEdge, type DAGNode, type DelayConfig, type HumanApprovalConfig, type LLMCallConfig, type LoopConfig, MODEL_RATES, type ParallelConfig, type RunStatus, type StepConfig, type StepConnection, type StepResult, type StepStatus, type StepType, type SubWorkflowConfig, type TransformConfig, WORKFLOW_TEMPLATES, type WebhookConfig, type WorkflowBuilderState, WorkflowConfigurationError, type WorkflowDefinition, WorkflowEngine, type WorkflowEngineOptions, WorkflowError, type WorkflowErrorContext, WorkflowExecutionError, WorkflowExpressionError, WorkflowGraphError, type WorkflowRun, type WorkflowStatus, type WorkflowStepDef, type WorkflowTemplate, type WorkflowVariable, approvalStep, calculateRunCost, conditionStep, configureWorkflow, connect, defaultWorkflowConfig, delayStep, detectCycle, estimateStepCost, estimateStepTokens, estimateTokens, estimateWorkflowCost, evaluateExpression, extractVariables, findEntryNodes, findExitNodes, findMissingVariables, findPaths, formatCost, getTemplate, getTemplatesByCategory, interpolate, linearWorkflow, llmStep, normalizeWorkflowError, stepConfigSchema, stepConnectionSchema, stepResultSchema, topoSort, transformStep, validateConnectionIntegrity, validateRun, validateWorkflow, webhookStep, workflowDefinitionSchema, workflowRunSchema, workflowRunsTable, workflowStepDefSchema, workflowStepResultsTable, workflowTables, workflowVariableSchema, workflowsTable };
|
|
1305
|
+
export { type ConditionConfig, type ConfigureWorkflowOptions, type CustomStepConfig, type DAGEdge, type DAGNode, type DelayConfig, type HumanApprovalConfig, type LLMCallConfig, type LoopConfig, MODEL_RATES, type ParallelConfig, type RunStatus, type StepConfig, type StepConnection, type StepResult, type StepStatus, type StepType, type SubWorkflowConfig, type TransformConfig, WORKFLOW_TEMPLATES, type WebhookConfig, type WorkflowBuilderState, WorkflowConfigurationError, type WorkflowDefinition, WorkflowEngine, type WorkflowEngineOptions, WorkflowError, type WorkflowErrorContext, WorkflowExecutionError, WorkflowExpressionError, WorkflowGraphError, type WorkflowRun, type WorkflowStatus, type WorkflowStepDef, type WorkflowTemplate, type WorkflowVariable, approvalStep, calculateRunCost, conditionStep, configureWorkflow, connect, defaultWorkflowConfig, delayStep, detectCycle, estimateStepCost, estimateStepTokens, estimateTokens, estimateWorkflowCost, evaluateExpression, extractVariables, findEntryNodes, findExitNodes, findMissingVariables, findPaths, formatCost, getTemplate, getTemplatesByCategory, interpolate, linearWorkflow, llmStep, normalizeWorkflowError, stepConfigSchema, stepConnectionSchema, stepResultSchema, topoSort, transformStep, validateConnectionIntegrity, validateRun, validateWorkflow, webhookStep, workflowDefinitionSchema, workflowRunSchema, workflowStepDefSchema, workflowVariableSchema };
|
|
@@ -1589,93 +1589,6 @@ function getTemplatesByCategory(category) {
|
|
|
1589
1589
|
return WORKFLOW_TEMPLATES.filter((t) => t.category === category);
|
|
1590
1590
|
}
|
|
1591
1591
|
|
|
1592
|
-
|
|
1593
|
-
var stringField = (optional = false) => ({ type: "string", ...optional ? { optional: true } : {} });
|
|
1594
|
-
var numberField = (optional = false) => ({ type: "number", ...optional ? { optional: true } : {} });
|
|
1595
|
-
var unknownField = (optional = false) => ({ type: "any", ...optional ? { optional: true } : {} });
|
|
1596
|
-
var literalField = (value, optional = false) => ({ type: "literal", value, ...optional ? { optional: true } : {} });
|
|
1597
|
-
var arrayField = (items, optional = false) => ({ type: "array", items, ...optional ? { optional: true } : {} });
|
|
1598
|
-
var recordField = (key, value, optional = false) => ({ type: "record", key, value, ...optional ? { optional: true } : {} });
|
|
1599
|
-
var objectField = (fields, optional = false) => ({ type: "object", fields, ...optional ? { optional: true } : {} });
|
|
1600
|
-
var unionField = (values, optional = false) => ({ type: "union", values, ...optional ? { optional: true } : {} });
|
|
1601
|
-
var workflowsTable = objectField({
|
|
1602
|
-
name: stringField(),
|
|
1603
|
-
description: stringField(true),
|
|
1604
|
-
version: numberField(),
|
|
1605
|
-
status: unionField([
|
|
1606
|
-
literalField("draft"),
|
|
1607
|
-
literalField("active"),
|
|
1608
|
-
literalField("archived"),
|
|
1609
|
-
literalField("error")
|
|
1610
|
-
]),
|
|
1611
|
-
definition: objectField({
|
|
1612
|
-
id: stringField(),
|
|
1613
|
-
name: stringField(),
|
|
1614
|
-
description: stringField(true),
|
|
1615
|
-
version: numberField(),
|
|
1616
|
-
status: stringField(),
|
|
1617
|
-
steps: arrayField(unknownField()),
|
|
1618
|
-
connections: arrayField(unknownField()),
|
|
1619
|
-
inputSchema: arrayField(unknownField(), true),
|
|
1620
|
-
variables: recordField(stringField(), unknownField(), true),
|
|
1621
|
-
tags: arrayField(stringField(), true),
|
|
1622
|
-
createdBy: stringField(),
|
|
1623
|
-
createdAt: numberField(),
|
|
1624
|
-
updatedAt: numberField()
|
|
1625
|
-
}),
|
|
1626
|
-
createdBy: stringField(),
|
|
1627
|
-
tags: arrayField(stringField(), true),
|
|
1628
|
-
createdAt: numberField(),
|
|
1629
|
-
updatedAt: numberField()
|
|
1630
|
-
});
|
|
1631
|
-
var workflowRunsTable = objectField({
|
|
1632
|
-
workflowId: stringField(),
|
|
1633
|
-
workflowVersion: numberField(),
|
|
1634
|
-
status: unionField([
|
|
1635
|
-
literalField("pending"),
|
|
1636
|
-
literalField("running"),
|
|
1637
|
-
literalField("paused"),
|
|
1638
|
-
literalField("completed"),
|
|
1639
|
-
literalField("failed"),
|
|
1640
|
-
literalField("cancelled")
|
|
1641
|
-
]),
|
|
1642
|
-
input: recordField(stringField(), unknownField(), true),
|
|
1643
|
-
variables: recordField(stringField(), unknownField(), true),
|
|
1644
|
-
currentStepIndex: numberField(),
|
|
1645
|
-
stepResults: arrayField(unknownField(), true),
|
|
1646
|
-
error: stringField(true),
|
|
1647
|
-
triggeredBy: stringField(),
|
|
1648
|
-
startedAt: numberField(),
|
|
1649
|
-
completedAt: numberField(true)
|
|
1650
|
-
});
|
|
1651
|
-
var workflowStepResultsTable = objectField({
|
|
1652
|
-
runId: stringField(),
|
|
1653
|
-
stepId: stringField(),
|
|
1654
|
-
stepName: stringField(),
|
|
1655
|
-
type: stringField(),
|
|
1656
|
-
status: unionField([
|
|
1657
|
-
literalField("pending"),
|
|
1658
|
-
literalField("running"),
|
|
1659
|
-
literalField("completed"),
|
|
1660
|
-
literalField("failed"),
|
|
1661
|
-
literalField("skipped"),
|
|
1662
|
-
literalField("waiting-approval")
|
|
1663
|
-
]),
|
|
1664
|
-
input: recordField(stringField(), unknownField(), true),
|
|
1665
|
-
output: unknownField(true),
|
|
1666
|
-
error: stringField(true),
|
|
1667
|
-
durationMs: numberField(),
|
|
1668
|
-
tokens: numberField(true),
|
|
1669
|
-
costUsd: numberField(true),
|
|
1670
|
-
startedAt: numberField(),
|
|
1671
|
-
completedAt: numberField(true)
|
|
1672
|
-
});
|
|
1673
|
-
var workflowTables = {
|
|
1674
|
-
workflows: workflowsTable,
|
|
1675
|
-
workflowRuns: workflowRunsTable,
|
|
1676
|
-
workflowStepResults: workflowStepResultsTable
|
|
1677
|
-
};
|
|
1678
|
-
|
|
1679
|
-
export { MODEL_RATES, WORKFLOW_TEMPLATES, WorkflowConfigurationError, WorkflowEngine, WorkflowError, WorkflowExecutionError, WorkflowExpressionError, WorkflowGraphError, approvalStep, calculateRunCost, conditionStep, configureWorkflow, connect, defaultWorkflowConfig, delayStep, detectCycle, estimateStepCost, estimateStepTokens, estimateTokens, estimateWorkflowCost, evaluateExpression, extractVariables, findEntryNodes, findExitNodes, findMissingVariables, findPaths, formatCost, getTemplate, getTemplatesByCategory, interpolate, linearWorkflow, llmStep, normalizeWorkflowError, stepConfigSchema, stepConnectionSchema, stepResultSchema, topoSort, transformStep, validateConnectionIntegrity, validateRun, validateWorkflow, webhookStep, workflowDefinitionSchema, workflowRunSchema, workflowRunsTable, workflowStepDefSchema, workflowStepResultsTable, workflowTables, workflowVariableSchema, workflowsTable };
|
|
1592
|
+
export { MODEL_RATES, WORKFLOW_TEMPLATES, WorkflowConfigurationError, WorkflowEngine, WorkflowError, WorkflowExecutionError, WorkflowExpressionError, WorkflowGraphError, approvalStep, calculateRunCost, conditionStep, configureWorkflow, connect, defaultWorkflowConfig, delayStep, detectCycle, estimateStepCost, estimateStepTokens, estimateTokens, estimateWorkflowCost, evaluateExpression, extractVariables, findEntryNodes, findExitNodes, findMissingVariables, findPaths, formatCost, getTemplate, getTemplatesByCategory, interpolate, linearWorkflow, llmStep, normalizeWorkflowError, stepConfigSchema, stepConnectionSchema, stepResultSchema, topoSort, transformStep, validateConnectionIntegrity, validateRun, validateWorkflow, webhookStep, workflowDefinitionSchema, workflowRunSchema, workflowStepDefSchema, workflowVariableSchema };
|
|
1680
1593
|
//# sourceMappingURL=index.js.map
|
|
1681
1594
|
//# sourceMappingURL=index.js.map
|