@geenius/ai-workflow 0.1.0 → 0.4.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 +7 -0
- package/README.md +69 -1
- package/package.json +60 -27
- package/packages/convex/dist/index.d.ts +363 -0
- package/packages/convex/dist/index.js +200 -0
- package/packages/convex/dist/index.js.map +1 -0
- package/packages/react/dist/index.d.ts +466 -0
- package/packages/react/dist/index.js +13914 -0
- package/packages/react/dist/index.js.map +1 -0
- package/packages/react-css/{src/styles.css → dist/index.css} +107 -253
- package/packages/react-css/dist/index.css.map +1 -0
- package/packages/react-css/dist/index.d.ts +495 -0
- package/packages/react-css/dist/index.js +13901 -0
- package/packages/react-css/dist/index.js.map +1 -0
- package/packages/shared/dist/index.d.ts +1368 -0
- package/packages/shared/dist/index.js +1681 -0
- package/packages/shared/dist/index.js.map +1 -0
- package/packages/solidjs/dist/index.d.ts +452 -0
- package/packages/solidjs/dist/index.js +13830 -0
- package/packages/solidjs/dist/index.js.map +1 -0
- package/packages/solidjs-css/{src/styles.css → dist/index.css} +107 -253
- package/packages/solidjs-css/dist/index.css.map +1 -0
- package/packages/solidjs-css/dist/index.d.ts +471 -0
- package/packages/solidjs-css/dist/index.js +13774 -0
- package/packages/solidjs-css/dist/index.js.map +1 -0
- package/.changeset/config.json +0 -11
- package/.github/CODEOWNERS +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -16
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -11
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -10
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/ci.yml +0 -23
- package/.github/workflows/release.yml +0 -29
- package/.nvmrc +0 -1
- package/.project/ACCOUNT.yaml +0 -4
- package/.project/IDEAS.yaml +0 -7
- package/.project/PROJECT.yaml +0 -11
- package/.project/ROADMAP.yaml +0 -15
- package/CODE_OF_CONDUCT.md +0 -16
- package/CONTRIBUTING.md +0 -26
- package/SECURITY.md +0 -15
- package/SUPPORT.md +0 -8
- package/packages/convex/README.md +0 -1
- package/packages/convex/package.json +0 -12
- package/packages/convex/src/convex.config.ts +0 -3
- package/packages/convex/src/index.ts +0 -3
- package/packages/convex/src/mutations.ts +0 -36
- package/packages/convex/src/queries.ts +0 -19
- package/packages/convex/src/schema.ts +0 -24
- package/packages/convex/tsconfig.json +0 -25
- package/packages/react/README.md +0 -1
- package/packages/react/package.json +0 -46
- package/packages/react/src/components/ApprovalModal.tsx +0 -47
- package/packages/react/src/components/StepConfigPanel.tsx +0 -67
- package/packages/react/src/components/StepConnector.tsx +0 -47
- package/packages/react/src/components/StepNode.tsx +0 -38
- package/packages/react/src/components/StepPalette.tsx +0 -48
- package/packages/react/src/components/WorkflowCanvas.tsx +0 -42
- package/packages/react/src/components/WorkflowRunPanel.tsx +0 -64
- package/packages/react/src/components/WorkflowToolbar.tsx +0 -43
- package/packages/react/src/components/index.ts +0 -9
- package/packages/react/src/hooks/index.ts +0 -10
- package/packages/react/src/hooks/useApprovalGate.ts +0 -59
- package/packages/react/src/hooks/useWorkflow.ts +0 -39
- package/packages/react/src/hooks/useWorkflowBuilder.ts +0 -121
- package/packages/react/src/hooks/useWorkflowRun.ts +0 -75
- package/packages/react/src/hooks/useWorkflowStep.ts +0 -52
- package/packages/react/src/hooks/useWorkflowTemplates.ts +0 -54
- package/packages/react/src/index.ts +0 -16
- package/packages/react/src/pages/WorkflowBuilderPage.tsx +0 -81
- package/packages/react/src/pages/WorkflowRunsPage.tsx +0 -59
- package/packages/react/src/pages/index.ts +0 -3
- package/packages/react/tsconfig.json +0 -1
- package/packages/react/tsup.config.ts +0 -7
- package/packages/react-css/README.md +0 -1
- package/packages/react-css/package.json +0 -44
- package/packages/react-css/src/components/ApprovalModal.tsx +0 -6
- package/packages/react-css/src/components/StepConfigPanel.tsx +0 -7
- package/packages/react-css/src/components/StepConnector.tsx +0 -6
- package/packages/react-css/src/components/StepNode.tsx +0 -7
- package/packages/react-css/src/components/StepPalette.tsx +0 -6
- package/packages/react-css/src/components/WorkflowCanvas.tsx +0 -6
- package/packages/react-css/src/components/WorkflowRunPanel.tsx +0 -9
- package/packages/react-css/src/components/WorkflowToolbar.tsx +0 -4
- package/packages/react-css/src/components/index.ts +0 -9
- package/packages/react-css/src/hooks/index.ts +0 -3
- package/packages/react-css/src/hooks/useWorkflow.ts +0 -39
- package/packages/react-css/src/hooks/useWorkflowBuilder.ts +0 -121
- package/packages/react-css/src/index.ts +0 -7
- package/packages/react-css/src/pages/WorkflowBuilderPage.tsx +0 -16
- package/packages/react-css/src/pages/WorkflowRunsPage.tsx +0 -6
- package/packages/react-css/src/pages/index.ts +0 -3
- package/packages/react-css/tsconfig.json +0 -26
- package/packages/react-css/tsup.config.ts +0 -2
- package/packages/shared/README.md +0 -1
- package/packages/shared/package.json +0 -56
- package/packages/shared/src/__tests__/ai-workflow.test.ts +0 -217
- package/packages/shared/src/config.ts +0 -49
- package/packages/shared/src/convex/index.ts +0 -2
- package/packages/shared/src/convex/schemas.ts +0 -42
- package/packages/shared/src/engine.test.ts +0 -1
- package/packages/shared/src/engine.ts +0 -295
- package/packages/shared/src/index.ts +0 -43
- package/packages/shared/src/steps.ts +0 -68
- package/packages/shared/src/templates.ts +0 -172
- package/packages/shared/src/types.ts +0 -237
- package/packages/shared/src/utils/cost.ts +0 -79
- package/packages/shared/src/utils/dag.ts +0 -133
- package/packages/shared/src/utils/index.ts +0 -5
- package/packages/shared/src/utils/interpolation.ts +0 -53
- package/packages/shared/src/validators.ts +0 -215
- package/packages/shared/tsconfig.json +0 -1
- package/packages/shared/tsup.config.ts +0 -5
- package/packages/shared/vitest.config.ts +0 -4
- package/packages/solidjs/README.md +0 -1
- package/packages/solidjs/package.json +0 -45
- package/packages/solidjs/src/components/ApprovalModal.tsx +0 -18
- package/packages/solidjs/src/components/StepConfigPanel.tsx +0 -14
- package/packages/solidjs/src/components/StepConnector.tsx +0 -11
- package/packages/solidjs/src/components/StepNode.tsx +0 -12
- package/packages/solidjs/src/components/StepPalette.tsx +0 -22
- package/packages/solidjs/src/components/WorkflowCanvas.tsx +0 -23
- package/packages/solidjs/src/components/WorkflowRunPanel.tsx +0 -18
- package/packages/solidjs/src/components/WorkflowToolbar.tsx +0 -13
- package/packages/solidjs/src/components/index.ts +0 -9
- package/packages/solidjs/src/index.ts +0 -7
- package/packages/solidjs/src/pages/WorkflowBuilderPage.tsx +0 -37
- package/packages/solidjs/src/pages/WorkflowRunsPage.tsx +0 -20
- package/packages/solidjs/src/pages/index.ts +0 -3
- package/packages/solidjs/src/primitives/createApprovalGate.ts +0 -29
- package/packages/solidjs/src/primitives/createWorkflow.ts +0 -28
- package/packages/solidjs/src/primitives/createWorkflowBuilder.ts +0 -56
- package/packages/solidjs/src/primitives/createWorkflowRun.ts +0 -32
- package/packages/solidjs/src/primitives/createWorkflowStep.ts +0 -23
- package/packages/solidjs/src/primitives/createWorkflowTemplates.ts +0 -28
- package/packages/solidjs/src/primitives/index.ts +0 -8
- package/packages/solidjs/tsconfig.json +0 -1
- package/packages/solidjs/tsup.config.ts +0 -7
- package/packages/solidjs-css/README.md +0 -1
- package/packages/solidjs-css/package.json +0 -43
- package/packages/solidjs-css/src/components/ApprovalModal.tsx +0 -6
- package/packages/solidjs-css/src/components/StepConfigPanel.tsx +0 -7
- package/packages/solidjs-css/src/components/StepConnector.tsx +0 -6
- package/packages/solidjs-css/src/components/StepNode.tsx +0 -7
- package/packages/solidjs-css/src/components/StepPalette.tsx +0 -7
- package/packages/solidjs-css/src/components/WorkflowCanvas.tsx +0 -7
- package/packages/solidjs-css/src/components/WorkflowRunPanel.tsx +0 -8
- package/packages/solidjs-css/src/components/WorkflowToolbar.tsx +0 -5
- package/packages/solidjs-css/src/components/index.ts +0 -9
- package/packages/solidjs-css/src/index.ts +0 -7
- package/packages/solidjs-css/src/pages/WorkflowBuilderPage.tsx +0 -2
- package/packages/solidjs-css/src/pages/WorkflowRunsPage.tsx +0 -7
- package/packages/solidjs-css/src/pages/index.ts +0 -3
- package/packages/solidjs-css/src/primitives/createWorkflow.ts +0 -28
- package/packages/solidjs-css/src/primitives/createWorkflowBuilder.ts +0 -56
- package/packages/solidjs-css/src/primitives/index.ts +0 -1
- package/packages/solidjs-css/tsconfig.json +0 -27
- package/packages/solidjs-css/tsup.config.ts +0 -2
- package/pnpm-workspace.yaml +0 -2
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react — pages/WorkflowBuilderPage.tsx
|
|
2
|
-
import { useCallback } from 'react'
|
|
3
|
-
import type { StepType, WorkflowStepDef } from '@geenius-ai-workflow/shared'
|
|
4
|
-
import { WorkflowEngine } from '@geenius-ai-workflow/shared'
|
|
5
|
-
import type { WorkflowEngineOptions } from '@geenius-ai-workflow/shared'
|
|
6
|
-
import { useWorkflowBuilder } from '../hooks/useWorkflowBuilder'
|
|
7
|
-
import { useWorkflowRun } from '../hooks/useWorkflowRun'
|
|
8
|
-
import { WorkflowCanvas } from '../components/WorkflowCanvas'
|
|
9
|
-
import { WorkflowToolbar } from '../components/WorkflowToolbar'
|
|
10
|
-
import { StepPalette } from '../components/StepPalette'
|
|
11
|
-
import { StepConfigPanel } from '../components/StepConfigPanel'
|
|
12
|
-
import { WorkflowRunPanel } from '../components/WorkflowRunPanel'
|
|
13
|
-
|
|
14
|
-
export interface WorkflowBuilderPageProps {
|
|
15
|
-
engineOptions: WorkflowEngineOptions
|
|
16
|
-
onSave?: (def: any) => void
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function WorkflowBuilderPage({ engineOptions, onSave }: WorkflowBuilderPageProps) {
|
|
20
|
-
const builder = useWorkflowBuilder()
|
|
21
|
-
const runTracker = useWorkflowRun()
|
|
22
|
-
|
|
23
|
-
const handleAddStep = useCallback((type: StepType) => {
|
|
24
|
-
const id = `step_${Date.now()}_${Math.random().toString(36).slice(2, 6)}`
|
|
25
|
-
const step: WorkflowStepDef = {
|
|
26
|
-
id,
|
|
27
|
-
name: `New ${type} step`,
|
|
28
|
-
type,
|
|
29
|
-
config: { type } as any,
|
|
30
|
-
position: { x: 100 + builder.definition.steps.length * 250, y: 200 },
|
|
31
|
-
}
|
|
32
|
-
builder.addStep(step)
|
|
33
|
-
}, [builder])
|
|
34
|
-
|
|
35
|
-
const handleRun = useCallback(async () => {
|
|
36
|
-
const engine = new WorkflowEngine({
|
|
37
|
-
...engineOptions,
|
|
38
|
-
onStepComplete: (result) => { runTracker.updateStep(result) },
|
|
39
|
-
})
|
|
40
|
-
const result = await engine.execute(builder.definition)
|
|
41
|
-
runTracker.trackRun(result)
|
|
42
|
-
}, [builder.definition, engineOptions, runTracker])
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<div data-workflow="builder-page">
|
|
46
|
-
<WorkflowToolbar
|
|
47
|
-
workflowName={builder.definition.name}
|
|
48
|
-
isDirty={builder.isDirty}
|
|
49
|
-
isRunning={runTracker.isRunning}
|
|
50
|
-
canUndo={builder.canUndo}
|
|
51
|
-
canRedo={builder.canRedo}
|
|
52
|
-
onSave={() => onSave?.(builder.definition)}
|
|
53
|
-
onRun={handleRun}
|
|
54
|
-
onUndo={builder.undo}
|
|
55
|
-
onRedo={builder.redo}
|
|
56
|
-
/>
|
|
57
|
-
<div data-workflow="builder-layout">
|
|
58
|
-
<StepPalette onAddStep={handleAddStep} />
|
|
59
|
-
<WorkflowCanvas
|
|
60
|
-
definition={builder.definition}
|
|
61
|
-
selectedStepId={builder.selectedStepId}
|
|
62
|
-
onSelectStep={builder.selectStep}
|
|
63
|
-
/>
|
|
64
|
-
{builder.selectedStepId && (() => {
|
|
65
|
-
const step = builder.definition.steps.find(s => s.id === builder.selectedStepId)
|
|
66
|
-
return step ? (
|
|
67
|
-
<StepConfigPanel
|
|
68
|
-
step={step}
|
|
69
|
-
onUpdate={builder.updateStep}
|
|
70
|
-
onDelete={builder.removeStep}
|
|
71
|
-
onClose={() => builder.selectStep(null)}
|
|
72
|
-
/>
|
|
73
|
-
) : null
|
|
74
|
-
})()}
|
|
75
|
-
{runTracker.run && (
|
|
76
|
-
<WorkflowRunPanel run={runTracker.run} isRunning={runTracker.isRunning} />
|
|
77
|
-
)}
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react — pages/WorkflowRunsPage.tsx
|
|
2
|
-
import type { WorkflowRun } from '@geenius-ai-workflow/shared'
|
|
3
|
-
|
|
4
|
-
export interface WorkflowRunsPageProps {
|
|
5
|
-
runs: WorkflowRun[]
|
|
6
|
-
onSelectRun?: (runId: string) => void
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const STATUS_ICONS: Record<string, string> = {
|
|
10
|
-
pending: '⏳', running: '🔄', completed: '✅', failed: '❌', cancelled: '⛔', paused: '⏸️',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function WorkflowRunsPage({ runs, onSelectRun }: WorkflowRunsPageProps) {
|
|
14
|
-
return (
|
|
15
|
-
<div data-workflow="runs-page">
|
|
16
|
-
<div data-workflow="runs-header">
|
|
17
|
-
<h1 data-workflow="runs-title">Workflow Runs</h1>
|
|
18
|
-
<span data-workflow="runs-count">{runs.length} runs</span>
|
|
19
|
-
</div>
|
|
20
|
-
{runs.length === 0 ? (
|
|
21
|
-
<div data-workflow="runs-empty">
|
|
22
|
-
<p>No workflow runs yet. Execute a workflow to see results here.</p>
|
|
23
|
-
</div>
|
|
24
|
-
) : (
|
|
25
|
-
<div data-workflow="runs-list" role="list">
|
|
26
|
-
{runs.map(run => {
|
|
27
|
-
const completedSteps = run.stepResults.filter(s => s.status === 'completed').length
|
|
28
|
-
const totalSteps = run.stepResults.length
|
|
29
|
-
const duration = (run.completedAt ?? Date.now()) - run.startedAt
|
|
30
|
-
return (
|
|
31
|
-
<div
|
|
32
|
-
key={run.id}
|
|
33
|
-
data-workflow="run-card"
|
|
34
|
-
data-status={run.status}
|
|
35
|
-
role="listitem"
|
|
36
|
-
onClick={() => onSelectRun?.(run.id)}
|
|
37
|
-
tabIndex={0}
|
|
38
|
-
onKeyDown={(e) => { if (e.key === 'Enter') onSelectRun?.(run.id) }}
|
|
39
|
-
>
|
|
40
|
-
<div data-workflow="run-card-header">
|
|
41
|
-
<span data-workflow="run-card-status">
|
|
42
|
-
{STATUS_ICONS[run.status]} {run.status}
|
|
43
|
-
</span>
|
|
44
|
-
<span data-workflow="run-card-id">{run.id.slice(0, 8)}…</span>
|
|
45
|
-
</div>
|
|
46
|
-
<div data-workflow="run-card-meta">
|
|
47
|
-
<span data-workflow="run-card-steps">{completedSteps}/{totalSteps} steps</span>
|
|
48
|
-
<span data-workflow="run-card-duration">{(duration / 1000).toFixed(1)}s</span>
|
|
49
|
-
<span data-workflow="run-card-date">{new Date(run.startedAt).toLocaleString()}</span>
|
|
50
|
-
</div>
|
|
51
|
-
{run.error && <p data-workflow="run-card-error">{run.error}</p>}
|
|
52
|
-
</div>
|
|
53
|
-
)
|
|
54
|
-
})}
|
|
55
|
-
</div>
|
|
56
|
-
)}
|
|
57
|
-
</div>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"compilerOptions":{"target":"ES2022","module":"ESNext","moduleResolution":"bundler","jsx":"react-jsx","declaration":true,"declarationMap":true,"sourceMap":true,"outDir":"./dist","rootDir":"./src","strict":true,"esModuleInterop":true,"skipLibCheck":true,"forceConsistentCasingInFileNames":true,"resolveJsonModule":true,"isolatedModules":true},"include":["src"],"exclude":["node_modules","dist"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
2
|
-
export default defineConfig({
|
|
3
|
-
entry: { index: 'src/index.ts' },
|
|
4
|
-
format: ['esm'], dts: true, clean: true, sourcemap: true,
|
|
5
|
-
external: ['react', '@geenius-ai-workflow/shared'],
|
|
6
|
-
esbuildOptions(options) { options.jsx = 'automatic' },
|
|
7
|
-
})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# ✦ @geenius-ai-workflow/react-css\n\n> Geenius AI Workflow — React hooks (vanilla CSS variant)\n\n---\n\n## Overview\nBuilt with Steve Jobs-level minimalism and Jony Ive-level craftsmanship, this package is designed to deliver unparalleled developer experience (DX) and rock-solid performance.\n\n## Installation\n\n```bash\npnpm add @geenius-ai-workflow/react-css\n```\n\n## Usage\n\n```typescript\nimport { init } from '@geenius-ai-workflow/react-css';\n\n// Initialize the module with absolute precision\ninit({\n mode: 'premium',\n});\n```\n\n## Architecture\n- **Zero-config**: It just works.\n- **Strictly Typed**: Fully written in TypeScript for flawless IntelliSense.\n- **Framework Agnostic**: seamlessly integrates into the Geenius ecosystem.\n\n---\n\n*Designed by Antigravity HQ*\n
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@geenius-ai-workflow/react-css",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "Geenius AI Workflow — React hooks (vanilla CSS variant)",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"module": "./dist/index.mjs",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./dist/index.mjs",
|
|
12
|
-
"require": "./dist/index.js",
|
|
13
|
-
"types": "./dist/index.d.ts"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "tsup",
|
|
18
|
-
"lint": "tsc --noEmit",
|
|
19
|
-
"clean": "rm -rf dist"
|
|
20
|
-
},
|
|
21
|
-
"files": [
|
|
22
|
-
"dist"
|
|
23
|
-
],
|
|
24
|
-
"publishConfig": {
|
|
25
|
-
"access": "public"
|
|
26
|
-
},
|
|
27
|
-
"peerDependencies": {
|
|
28
|
-
"react": ">=18.0.0"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@geenius-ai-workflow/shared": "workspace:*"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@types/react": "^19.0.0",
|
|
35
|
-
"react": "^19.2.4",
|
|
36
|
-
"tsup": "^8.5.1",
|
|
37
|
-
"typescript": "~5.9.3"
|
|
38
|
-
},
|
|
39
|
-
"author": "Antigravity HQ",
|
|
40
|
-
"license": "MIT",
|
|
41
|
-
"engines": {
|
|
42
|
-
"node": ">=20.0.0"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — components/ApprovalModal.tsx
|
|
2
|
-
import type { ApprovalRequest } from '../hooks'
|
|
3
|
-
export function ApprovalModal(props: { request: ApprovalRequest | null; onApprove: (id: string) => void; onReject: (id: string) => void }) {
|
|
4
|
-
if (!props.request) return null
|
|
5
|
-
return (<div role="dialog" aria-modal="true"><div className="ai-workflow__approval-overlay" /><div className="ai-workflow__approval-dialog"><div className="ai-workflow__approval-header"><span className="ai-workflow__approval-icon">👤</span><h3 className="ai-workflow__approval-title">Approval Required</h3></div><div><p className="ai-workflow__approval-message">{props.request.message}</p>{props.request.approvers && props.request.approvers.length > 0 && <div>{props.request.approvers.map((a, i) => <span key={i} className="ai-workflow__approval-approver-badge">{a}</span>)}</div>}</div><div className="ai-workflow__approval-actions"><button className="ai-workflow__approval-reject" onClick={() => props.onReject(props.request!.id)}>✕ Reject</button><button className="ai-workflow__approval-approve" onClick={() => props.onApprove(props.request!.id)}>✓ Approve</button></div></div></div>)
|
|
6
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — components/StepConfigPanel.tsx
|
|
2
|
-
import { useState } from 'react'
|
|
3
|
-
import type { WorkflowStepDef } from '@geenius-ai-workflow/shared'
|
|
4
|
-
export function StepConfigPanel(props: { step: WorkflowStepDef; onUpdate: (id: string, u: Partial<WorkflowStepDef>) => void; onDelete: (id: string) => void; onClose: () => void }) {
|
|
5
|
-
const [name, setName] = useState(props.step.name)
|
|
6
|
-
return (<div className="ai-workflow__config-panel" role="complementary"><div className="ai-workflow__config-header"><h3 className="ai-workflow__config-title">Configure Step</h3><button className="ai-workflow__config-close" onClick={props.onClose}>✕</button></div><div className="ai-workflow__config-body"><label className="ai-workflow__config-label">Step Name<input className="ai-workflow__config-input" value={name} onChange={(e) => setName(e.target.value)} onBlur={() => { if (name.trim() && name !== props.step.name) props.onUpdate(props.step.id, { name: name.trim() }) }} /></label><div className="ai-workflow__config-field"><span className="ai-workflow__config-field-label">Type</span><span className="ai-workflow__config-field-value">{props.step.type}</span></div><pre className="ai-workflow__config-json-view">{JSON.stringify(props.step.config, null, 2)}</pre></div><div><button className="ai-workflow__config-delete" onClick={() => { props.onDelete(props.step.id); props.onClose() }}>🗑 Delete Step</button></div></div>)
|
|
7
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — components/StepConnector.tsx
|
|
2
|
-
const W = 200, H = 80
|
|
3
|
-
export function StepConnector(props: { from: { x: number; y: number }; to: { x: number; y: number }; label?: string; isActive?: boolean }) {
|
|
4
|
-
const x1 = props.from.x + W, y1 = props.from.y + H / 2, x2 = props.to.x, y2 = props.to.y + H / 2, mx = (x1 + x2) / 2
|
|
5
|
-
return (<g className="ai-workflow__connector"><path d={`M ${x1} ${y1} C ${mx} ${y1}, ${mx} ${y2}, ${x2} ${y2}`} fill="none" stroke={props.isActive ? 'oklch(0.7 0.2 145)' : 'oklch(0.5 0.02 260)'} strokeWidth={props.isActive ? 3 : 2} />{props.label && <text x={mx} y={(y1 + y2) / 2 - 8} textAnchor="middle" fill="oklch(0.7 0.02 260)" fontSize="12">{props.label}</text>}</g>)
|
|
6
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — components/StepNode.tsx
|
|
2
|
-
import type { WorkflowStepDef, StepType } from '@geenius-ai-workflow/shared'
|
|
3
|
-
const ICONS: Record<StepType, string> = { 'llm-call': '🤖', transform: '⚙️', condition: '🔀', 'human-approval': '👤', webhook: '🌐', delay: '⏱️', parallel: '⚡', loop: '🔄', 'sub-workflow': '📋', custom: '🔧' }
|
|
4
|
-
export function StepNode(props: { step: WorkflowStepDef; isSelected?: boolean; status?: string; onClick?: () => void }) {
|
|
5
|
-
const cls = ['ai-workflow__step-node', props.isSelected && 'ai-workflow__step-node--selected', props.status && `ai-workflow__step-node--${props.status}`].filter(Boolean).join(' ')
|
|
6
|
-
return (<div className={cls} role="button" tabIndex={0} onClick={props.onClick} onKeyDown={(e) => { if (e.key === 'Enter') props.onClick?.() }} style={props.step.position ? { position: 'absolute', left: props.step.position.x, top: props.step.position.y } : undefined}><div className="ai-workflow__step-header"><span className="ai-workflow__step-icon">{ICONS[props.step.type]}</span><span className="ai-workflow__step-name">{props.step.name}</span></div><div className="ai-workflow__step-type-badge">{props.step.type}</div></div>)
|
|
7
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — components/StepPalette.tsx
|
|
2
|
-
import type { StepType } from '@geenius-ai-workflow/shared'
|
|
3
|
-
const ITEMS: Array<{ type: StepType; label: string; icon: string; desc: string }> = [{ type: 'llm-call', label: 'LLM Call', icon: '🤖', desc: 'Call an AI model' },{ type: 'transform', label: 'Transform', icon: '⚙️', desc: 'Transform data' },{ type: 'condition', label: 'Condition', icon: '🔀', desc: 'If/else branching' },{ type: 'human-approval', label: 'Approval', icon: '👤', desc: 'Human approval gate' },{ type: 'webhook', label: 'Webhook', icon: '🌐', desc: 'HTTP request' },{ type: 'delay', label: 'Delay', icon: '⏱️', desc: 'Wait for duration' },{ type: 'parallel', label: 'Parallel', icon: '⚡', desc: 'Run in parallel' },{ type: 'loop', label: 'Loop', icon: '🔄', desc: 'Iterate items' },{ type: 'sub-workflow', label: 'Sub-workflow', icon: '📋', desc: 'Run another workflow' },{ type: 'custom', label: 'Custom', icon: '🔧', desc: 'Custom handler' }]
|
|
4
|
-
export function StepPalette(props: { onAddStep: (t: StepType) => void }) {
|
|
5
|
-
return (<div className="ai-workflow__step-palette" role="list"><h3 className="ai-workflow__palette-title">Steps</h3>{ITEMS.map(item => <button key={item.type} className="ai-workflow__palette-item" onClick={() => props.onAddStep(item.type)}><span className="ai-workflow__palette-icon">{item.icon}</span><div className="ai-workflow__palette-info"><span className="ai-workflow__palette-label">{item.label}</span><span className="ai-workflow__palette-desc">{item.desc}</span></div></button>)}</div>)
|
|
6
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — components/WorkflowCanvas.tsx
|
|
2
|
-
import type { WorkflowDefinition } from '@geenius-ai-workflow/shared'
|
|
3
|
-
import { StepNode } from './StepNode'; import { StepConnector } from './StepConnector'
|
|
4
|
-
export function WorkflowCanvas(props: { definition: WorkflowDefinition; selectedStepId: string | null; onSelectStep: (id: string | null) => void }) {
|
|
5
|
-
return (<div className="ai-workflow__canvas" role="application" aria-label="Workflow canvas"><svg style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>{props.definition.connections.map((conn, i) => { const f = props.definition.steps.find(s => s.id === conn.fromStepId); const t = props.definition.steps.find(s => s.id === conn.toStepId); return f?.position && t?.position ? <StepConnector key={i} from={f.position} to={t.position} label={conn.label} /> : null })}</svg><div>{props.definition.steps.map(step => <StepNode key={step.id} step={step} isSelected={props.selectedStepId === step.id} onClick={() => props.onSelectStep(step.id === props.selectedStepId ? null : step.id)} />)}</div>{props.definition.steps.length === 0 && <div className="ai-workflow__canvas-empty"><p>No steps yet</p></div>}</div>)
|
|
6
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — components/WorkflowRunPanel.tsx
|
|
2
|
-
import type { WorkflowRun } from '@geenius-ai-workflow/shared'
|
|
3
|
-
import { formatCost } from '@geenius-ai-workflow/shared'
|
|
4
|
-
const SI: Record<string, string> = { pending: '⏳', running: '🔄', completed: '✅', failed: '❌', skipped: '⏭️', 'waiting-approval': '👤' }
|
|
5
|
-
export function WorkflowRunPanel(props: { run: WorkflowRun | null; isRunning: boolean; onCancel?: () => void }) {
|
|
6
|
-
if (!props.run) return <div className="ai-workflow__run-panel"><div className="ai-workflow__run-empty"><p>No active run.</p></div></div>
|
|
7
|
-
const r = props.run; const done = r.stepResults.filter(s => s.status === 'completed').length; const total = r.stepResults.length; const pct = total > 0 ? Math.round((done / total) * 100) : 0; const cost = r.stepResults.reduce((s, x) => s + (x.costUsd ?? 0), 0)
|
|
8
|
-
return (<div className="ai-workflow__run-panel"><div className="ai-workflow__run-header"><h3 className="ai-workflow__run-title">{SI[r.status]} Run {r.status}</h3>{props.isRunning && props.onCancel && <button className="ai-workflow__run-cancel" onClick={props.onCancel}>⏹ Cancel</button>}</div><div className="ai-workflow__run-progress"><div className="ai-workflow__run-progress-bar"><div className="ai-workflow__run-progress-fill" style={{ width: `${pct}%` }} /></div><span className="ai-workflow__run-progress-text">{done}/{total} ({pct}%)</span></div>{cost > 0 && <span className="ai-workflow__run-stat">💰 {formatCost(cost)}</span>}{r.error && <div className="ai-workflow__run-error">{r.error}</div>}<ul className="ai-workflow__run-steps">{r.stepResults.map(sr => <li key={sr.stepId} className="ai-workflow__run-step-item" data-status={sr.status}><span>{SI[sr.status]}</span><span>{sr.stepName}</span><span>{sr.durationMs}ms</span></li>)}</ul></div>)
|
|
9
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — components/WorkflowToolbar.tsx
|
|
2
|
-
export function WorkflowToolbar(props: { workflowName: string; isDirty: boolean; isRunning: boolean; canUndo: boolean; canRedo: boolean; onSave: () => void; onRun: () => void; onCancel?: () => void; onUndo: () => void; onRedo: () => void }) {
|
|
3
|
-
return (<div className="ai-workflow__toolbar" role="toolbar"><div className="ai-workflow__toolbar-left"><h2 className="ai-workflow__toolbar-title">{props.workflowName}</h2>{props.isDirty && <span className="ai-workflow__toolbar-dirty">●</span>}</div><div className="ai-workflow__toolbar-center"><button className="ai-workflow__toolbar-btn" onClick={props.onUndo} disabled={!props.canUndo}>↶</button><button className="ai-workflow__toolbar-btn" onClick={props.onRedo} disabled={!props.canRedo}>↷</button></div><div className="ai-workflow__toolbar-right"><button className="ai-workflow__toolbar-btn-secondary" onClick={props.onSave} disabled={!props.isDirty}>💾 Save</button>{props.isRunning ? <button className="ai-workflow__toolbar-btn-danger" onClick={props.onCancel}>⏹ Stop</button> : <button className="ai-workflow__toolbar-btn-primary" onClick={props.onRun}>▶ Run</button>}</div></div>)
|
|
4
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — components/index.ts
|
|
2
|
-
export { WorkflowCanvas } from './WorkflowCanvas'
|
|
3
|
-
export { StepNode } from './StepNode'
|
|
4
|
-
export { StepConnector } from './StepConnector'
|
|
5
|
-
export { StepConfigPanel } from './StepConfigPanel'
|
|
6
|
-
export { WorkflowRunPanel } from './WorkflowRunPanel'
|
|
7
|
-
export { ApprovalModal } from './ApprovalModal'
|
|
8
|
-
export { WorkflowToolbar } from './WorkflowToolbar'
|
|
9
|
-
export { StepPalette } from './StepPalette'
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — hooks re-export
|
|
2
|
-
export { useWorkflow, useWorkflowBuilder, useWorkflowRun, useWorkflowStep, useApprovalGate, useWorkflowTemplates } from '@geenius-ai-workflow/react'
|
|
3
|
-
export type { UseWorkflowOptions, UseWorkflowRunOptions, ApprovalRequest } from '@geenius-ai-workflow/react'
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react — src/hooks/useWorkflow.ts
|
|
2
|
-
import { useState, useCallback } from 'react'
|
|
3
|
-
import type { WorkflowDefinition, WorkflowRun, StepResult } from '@geenius-ai-workflow/shared'
|
|
4
|
-
import { WorkflowEngine } from '@geenius-ai-workflow/shared'
|
|
5
|
-
import type { WorkflowEngineOptions } from '@geenius-ai-workflow/shared'
|
|
6
|
-
|
|
7
|
-
export interface UseWorkflowOptions extends WorkflowEngineOptions { }
|
|
8
|
-
|
|
9
|
-
export function useWorkflow(options: UseWorkflowOptions) {
|
|
10
|
-
const [run, setRun] = useState<WorkflowRun | null>(null)
|
|
11
|
-
const [isRunning, setIsRunning] = useState(false)
|
|
12
|
-
const [error, setError] = useState<Error | null>(null)
|
|
13
|
-
const [stepResults, setStepResults] = useState<StepResult[]>([])
|
|
14
|
-
|
|
15
|
-
const engine = new WorkflowEngine({
|
|
16
|
-
...options,
|
|
17
|
-
onStepComplete: (result) => {
|
|
18
|
-
setStepResults(prev => [...prev, result])
|
|
19
|
-
options.onStepComplete?.(result)
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
const execute = useCallback(async (definition: WorkflowDefinition, input?: Record<string, unknown>) => {
|
|
24
|
-
setIsRunning(true); setError(null); setStepResults([])
|
|
25
|
-
try {
|
|
26
|
-
const result = await engine.execute(definition, input)
|
|
27
|
-
setRun(result)
|
|
28
|
-
return result
|
|
29
|
-
} catch (err) {
|
|
30
|
-
const e = err instanceof Error ? err : new Error(String(err))
|
|
31
|
-
setError(e); throw e
|
|
32
|
-
} finally { setIsRunning(false) }
|
|
33
|
-
}, [])
|
|
34
|
-
|
|
35
|
-
const cancel = useCallback(() => engine.cancel(), [])
|
|
36
|
-
const reset = useCallback(() => { setRun(null); setError(null); setStepResults([]) }, [])
|
|
37
|
-
|
|
38
|
-
return { execute, cancel, run, isRunning, error, stepResults, reset }
|
|
39
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react — src/hooks/useWorkflowBuilder.ts
|
|
2
|
-
import { useState, useCallback } from 'react'
|
|
3
|
-
import type { WorkflowDefinition, WorkflowStepDef, StepConnection, WorkflowBuilderState } from '@geenius-ai-workflow/shared'
|
|
4
|
-
|
|
5
|
-
const emptyDef = (): WorkflowDefinition => ({
|
|
6
|
-
id: crypto.randomUUID?.() ?? String(Date.now()),
|
|
7
|
-
name: 'New Workflow',
|
|
8
|
-
version: 1,
|
|
9
|
-
status: 'draft',
|
|
10
|
-
steps: [],
|
|
11
|
-
connections: [],
|
|
12
|
-
createdBy: '',
|
|
13
|
-
createdAt: Date.now(),
|
|
14
|
-
updatedAt: Date.now(),
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
export function useWorkflowBuilder(initial?: Partial<WorkflowDefinition>) {
|
|
18
|
-
const [state, setState] = useState<WorkflowBuilderState>({
|
|
19
|
-
definition: { ...emptyDef(), ...initial },
|
|
20
|
-
selectedStepId: null,
|
|
21
|
-
isDirty: false,
|
|
22
|
-
undoStack: [],
|
|
23
|
-
redoStack: [],
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
const pushUndo = useCallback(() => {
|
|
27
|
-
setState(prev => ({ ...prev, undoStack: [...prev.undoStack.slice(-20), prev.definition], redoStack: [] }))
|
|
28
|
-
}, [])
|
|
29
|
-
|
|
30
|
-
const addStep = useCallback((step: WorkflowStepDef) => {
|
|
31
|
-
pushUndo()
|
|
32
|
-
setState(prev => ({
|
|
33
|
-
...prev,
|
|
34
|
-
isDirty: true,
|
|
35
|
-
definition: { ...prev.definition, steps: [...prev.definition.steps, step], updatedAt: Date.now() },
|
|
36
|
-
}))
|
|
37
|
-
}, [pushUndo])
|
|
38
|
-
|
|
39
|
-
const removeStep = useCallback((stepId: string) => {
|
|
40
|
-
pushUndo()
|
|
41
|
-
setState(prev => ({
|
|
42
|
-
...prev,
|
|
43
|
-
isDirty: true,
|
|
44
|
-
definition: {
|
|
45
|
-
...prev.definition,
|
|
46
|
-
steps: prev.definition.steps.filter(s => s.id !== stepId),
|
|
47
|
-
connections: prev.definition.connections.filter(c => c.fromStepId !== stepId && c.toStepId !== stepId),
|
|
48
|
-
updatedAt: Date.now(),
|
|
49
|
-
},
|
|
50
|
-
selectedStepId: prev.selectedStepId === stepId ? null : prev.selectedStepId,
|
|
51
|
-
}))
|
|
52
|
-
}, [pushUndo])
|
|
53
|
-
|
|
54
|
-
const updateStep = useCallback((stepId: string, updates: Partial<WorkflowStepDef>) => {
|
|
55
|
-
pushUndo()
|
|
56
|
-
setState(prev => ({
|
|
57
|
-
...prev,
|
|
58
|
-
isDirty: true,
|
|
59
|
-
definition: {
|
|
60
|
-
...prev.definition,
|
|
61
|
-
steps: prev.definition.steps.map(s => s.id === stepId ? { ...s, ...updates } : s),
|
|
62
|
-
updatedAt: Date.now(),
|
|
63
|
-
},
|
|
64
|
-
}))
|
|
65
|
-
}, [pushUndo])
|
|
66
|
-
|
|
67
|
-
const addConnection = useCallback((conn: StepConnection) => {
|
|
68
|
-
pushUndo()
|
|
69
|
-
setState(prev => ({
|
|
70
|
-
...prev,
|
|
71
|
-
isDirty: true,
|
|
72
|
-
definition: { ...prev.definition, connections: [...prev.definition.connections, conn], updatedAt: Date.now() },
|
|
73
|
-
}))
|
|
74
|
-
}, [pushUndo])
|
|
75
|
-
|
|
76
|
-
const removeConnection = useCallback((fromStepId: string, toStepId: string) => {
|
|
77
|
-
pushUndo()
|
|
78
|
-
setState(prev => ({
|
|
79
|
-
...prev,
|
|
80
|
-
isDirty: true,
|
|
81
|
-
definition: {
|
|
82
|
-
...prev.definition,
|
|
83
|
-
connections: prev.definition.connections.filter(c => !(c.fromStepId === fromStepId && c.toStepId === toStepId)),
|
|
84
|
-
updatedAt: Date.now(),
|
|
85
|
-
},
|
|
86
|
-
}))
|
|
87
|
-
}, [pushUndo])
|
|
88
|
-
|
|
89
|
-
const selectStep = useCallback((stepId: string | null) => setState(prev => ({ ...prev, selectedStepId: stepId })), [])
|
|
90
|
-
|
|
91
|
-
const undo = useCallback(() => {
|
|
92
|
-
setState(prev => {
|
|
93
|
-
if (prev.undoStack.length === 0) return prev
|
|
94
|
-
const previous = prev.undoStack[prev.undoStack.length - 1]
|
|
95
|
-
return { ...prev, definition: previous, undoStack: prev.undoStack.slice(0, -1), redoStack: [prev.definition, ...prev.redoStack] }
|
|
96
|
-
})
|
|
97
|
-
}, [])
|
|
98
|
-
|
|
99
|
-
const redo = useCallback(() => {
|
|
100
|
-
setState(prev => {
|
|
101
|
-
if (prev.redoStack.length === 0) return prev
|
|
102
|
-
const next = prev.redoStack[0]
|
|
103
|
-
return { ...prev, definition: next, undoStack: [...prev.undoStack, prev.definition], redoStack: prev.redoStack.slice(1) }
|
|
104
|
-
})
|
|
105
|
-
}, [])
|
|
106
|
-
|
|
107
|
-
const setDefinition = useCallback((def: WorkflowDefinition) => {
|
|
108
|
-
setState(prev => ({ ...prev, definition: def, isDirty: false, undoStack: [], redoStack: [] }))
|
|
109
|
-
}, [])
|
|
110
|
-
|
|
111
|
-
return {
|
|
112
|
-
definition: state.definition,
|
|
113
|
-
selectedStepId: state.selectedStepId,
|
|
114
|
-
isDirty: state.isDirty,
|
|
115
|
-
canUndo: state.undoStack.length > 0,
|
|
116
|
-
canRedo: state.redoStack.length > 0,
|
|
117
|
-
addStep, removeStep, updateStep,
|
|
118
|
-
addConnection, removeConnection,
|
|
119
|
-
selectStep, undo, redo, setDefinition,
|
|
120
|
-
}
|
|
121
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — src/index.ts
|
|
2
|
-
import './styles.css'
|
|
3
|
-
export type { WorkflowDefinition, WorkflowStepDef, WorkflowRun, StepResult } from '@geenius-ai-workflow/shared'
|
|
4
|
-
export { WorkflowEngine, WORKFLOW_TEMPLATES } from '@geenius-ai-workflow/shared'
|
|
5
|
-
export * from './hooks'
|
|
6
|
-
export * from './components'
|
|
7
|
-
export * from './pages'
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — pages/WorkflowBuilderPage.tsx
|
|
2
|
-
import { useCallback } from 'react'
|
|
3
|
-
import type { StepType, WorkflowStepDef } from '@geenius-ai-workflow/shared'
|
|
4
|
-
import { WorkflowEngine } from '@geenius-ai-workflow/shared'
|
|
5
|
-
import type { WorkflowEngineOptions } from '@geenius-ai-workflow/shared'
|
|
6
|
-
import { useWorkflowBuilder, useWorkflowRun } from '../hooks'
|
|
7
|
-
import { WorkflowCanvas } from '../components/WorkflowCanvas'; import { WorkflowToolbar } from '../components/WorkflowToolbar'
|
|
8
|
-
import { StepPalette } from '../components/StepPalette'; import { StepConfigPanel } from '../components/StepConfigPanel'
|
|
9
|
-
import { WorkflowRunPanel } from '../components/WorkflowRunPanel'
|
|
10
|
-
export function WorkflowBuilderPage(props: { engineOptions: WorkflowEngineOptions; onSave?: (def: any) => void }) {
|
|
11
|
-
const builder = useWorkflowBuilder(); const runTracker = useWorkflowRun()
|
|
12
|
-
const handleAddStep = useCallback((type: StepType) => { builder.addStep({ id: `step_${Date.now()}`, name: `New ${type}`, type, config: { type } as any, position: { x: 100 + builder.definition.steps.length * 250, y: 200 } }) }, [builder])
|
|
13
|
-
const handleRun = useCallback(async () => { const e = new WorkflowEngine({ ...props.engineOptions, onStepComplete: (r) => runTracker.updateStep(r) }); const res = await e.execute(builder.definition); runTracker.trackRun(res) }, [builder.definition, props.engineOptions])
|
|
14
|
-
const sel = builder.selectedStepId ? builder.definition.steps.find(s => s.id === builder.selectedStepId) : null
|
|
15
|
-
return (<div className="ai-workflow__builder-page"><WorkflowToolbar workflowName={builder.definition.name} isDirty={builder.isDirty} isRunning={runTracker.isRunning} canUndo={builder.canUndo} canRedo={builder.canRedo} onSave={() => props.onSave?.(builder.definition)} onRun={handleRun} onUndo={builder.undo} onRedo={builder.redo} /><div className="ai-workflow__builder-layout"><StepPalette onAddStep={handleAddStep} /><WorkflowCanvas definition={builder.definition} selectedStepId={builder.selectedStepId} onSelectStep={builder.selectStep} />{sel && <StepConfigPanel step={sel} onUpdate={builder.updateStep} onDelete={builder.removeStep} onClose={() => builder.selectStep(null)} />}{runTracker.run && <WorkflowRunPanel run={runTracker.run} isRunning={runTracker.isRunning} />}</div></div>)
|
|
16
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @geenius-ai-workflow/react-css — pages/WorkflowRunsPage.tsx
|
|
2
|
-
import type { WorkflowRun } from '@geenius-ai-workflow/shared'
|
|
3
|
-
const SI: Record<string, string> = { pending: '⏳', running: '🔄', completed: '✅', failed: '❌', cancelled: '⛔', paused: '⏸️' }
|
|
4
|
-
export function WorkflowRunsPage(props: { runs: WorkflowRun[]; onSelectRun?: (id: string) => void }) {
|
|
5
|
-
return (<div><div className="ai-workflow__runs-header"><h1 className="ai-workflow__runs-title">Workflow Runs</h1><span className="ai-workflow__runs-count">{props.runs.length} runs</span></div>{props.runs.length === 0 ? <div className="ai-workflow__runs-empty"><p>No runs yet.</p></div> : <div role="list">{props.runs.map(run => <div key={run.id} className="ai-workflow__run-card" role="listitem" onClick={() => props.onSelectRun?.(run.id)}><div className="ai-workflow__run-card-header"><span className="ai-workflow__run-card-status">{SI[run.status]} {run.status}</span><span className="ai-workflow__run-card-id">{run.id.slice(0, 8)}…</span></div><div className="ai-workflow__run-card-meta"><span>{run.stepResults.filter(s => s.status === 'completed').length}/{run.stepResults.length} steps</span><span>{new Date(run.startedAt).toLocaleString()}</span></div>{run.error && <p className="ai-workflow__run-card-error">{run.error}</p>}</div>)}</div>}</div>)
|
|
6
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"sourceMap": true,
|
|
9
|
-
"outDir": "./dist",
|
|
10
|
-
"rootDir": "./src",
|
|
11
|
-
"strict": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"skipLibCheck": true,
|
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
"isolatedModules": true,
|
|
17
|
-
"jsx": "react-jsx"
|
|
18
|
-
},
|
|
19
|
-
"include": [
|
|
20
|
-
"src"
|
|
21
|
-
],
|
|
22
|
-
"exclude": [
|
|
23
|
-
"node_modules",
|
|
24
|
-
"dist"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# ✦ @geenius-ai-workflow/shared\n\n> Geenius AI Workflow — Shared types, engine & Convex schema\n\n---\n\n## Overview\nBuilt with Steve Jobs-level minimalism and Jony Ive-level craftsmanship, this package is designed to deliver unparalleled developer experience (DX) and rock-solid performance.\n\n## Installation\n\n```bash\npnpm add @geenius-ai-workflow/shared\n```\n\n## Usage\n\n```typescript\nimport { init } from '@geenius-ai-workflow/shared';\n\n// Initialize the module with absolute precision\ninit({\n mode: 'premium',\n});\n```\n\n## Architecture\n- **Zero-config**: It just works.\n- **Strictly Typed**: Fully written in TypeScript for flawless IntelliSense.\n- **Framework Agnostic**: seamlessly integrates into the Geenius ecosystem.\n\n---\n\n*Designed by Antigravity HQ*\n
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@geenius-ai-workflow/shared",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": false,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"description": "Geenius AI Workflow \u2014 Shared types, engine & Convex schema",
|
|
7
|
-
"author": "Antigravity HQ",
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"main": "./dist/index.js",
|
|
10
|
-
"module": "./dist/index.js",
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
15
|
-
"import": "./dist/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./engine": {
|
|
18
|
-
"types": "./dist/engine.d.ts",
|
|
19
|
-
"import": "./dist/engine.js"
|
|
20
|
-
},
|
|
21
|
-
"./steps": {
|
|
22
|
-
"types": "./dist/steps.d.ts",
|
|
23
|
-
"import": "./dist/steps.js"
|
|
24
|
-
},
|
|
25
|
-
"./convex": {
|
|
26
|
-
"types": "./dist/convex/index.d.ts",
|
|
27
|
-
"import": "./dist/convex/index.js"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"files": [
|
|
31
|
-
"dist",
|
|
32
|
-
"src"
|
|
33
|
-
],
|
|
34
|
-
"scripts": {
|
|
35
|
-
"build": "tsup",
|
|
36
|
-
"clean": "rm -rf dist",
|
|
37
|
-
"type-check": "tsc --noEmit",
|
|
38
|
-
"prepublishOnly": "pnpm clean && pnpm build",
|
|
39
|
-
"test": "vitest run",
|
|
40
|
-
"test:watch": "vitest"
|
|
41
|
-
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"zod": "^3.23.0"
|
|
44
|
-
},
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"tsup": "^8.5.1",
|
|
47
|
-
"typescript": "~6.0.2",
|
|
48
|
-
"vitest": "^4.0.0"
|
|
49
|
-
},
|
|
50
|
-
"engines": {
|
|
51
|
-
"node": ">=20.0.0"
|
|
52
|
-
},
|
|
53
|
-
"publishConfig": {
|
|
54
|
-
"access": "public"
|
|
55
|
-
}
|
|
56
|
-
}
|