@reopt-ai/opt-workflow 0.0.0-stage → 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/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +213 -2
- package/dist/ai-stream-APc3uCiQ.js +389 -0
- package/dist/ai-stream-B_lk9_Rf.cjs +628 -0
- package/dist/branch-resolver-BDi6Wu6m.js +589 -0
- package/dist/branch-resolver-D_wM183Q.cjs +714 -0
- package/dist/core-CtqBb-6v.d.cts +919 -0
- package/dist/core-z3nXmUBj.d.ts +919 -0
- package/dist/core.cjs +301 -0
- package/dist/core.d.cts +5 -0
- package/dist/core.d.ts +5 -0
- package/dist/core.js +184 -0
- package/dist/define-template-Bmn96lF_.cjs +74 -0
- package/dist/define-template-BvGNB5Tv.js +69 -0
- package/dist/end-node-ids-D6WBaCLm.cjs +109 -0
- package/dist/end-node-ids-p85jFEcP.js +86 -0
- package/dist/execution-context-DVeybULC.d.cts +258 -0
- package/dist/execution-context-YFTRCj0y.d.ts +258 -0
- package/dist/grid-workflow-dto-C86EArJP.d.cts +300 -0
- package/dist/grid-workflow-dto-C86EArJP.d.ts +300 -0
- package/dist/index.cjs +11873 -0
- package/dist/index.d.cts +794 -0
- package/dist/index.d.ts +794 -0
- package/dist/index.js +11828 -0
- package/dist/mock.cjs +7295 -0
- package/dist/mock.d.cts +88 -0
- package/dist/mock.d.ts +88 -0
- package/dist/mock.js +7287 -0
- package/dist/node-definitions-C-GMfjMm.js +797 -0
- package/dist/node-definitions-pS1Zp1dK.cjs +940 -0
- package/dist/nodes-D_a8ZkRp.d.cts +50 -0
- package/dist/nodes-myp8R2zo.d.ts +50 -0
- package/dist/nodes.cjs +36 -0
- package/dist/nodes.d.cts +3 -0
- package/dist/nodes.d.ts +3 -0
- package/dist/nodes.js +4 -0
- package/dist/shadcn-bridge.css +72 -0
- package/dist/simulate.cjs +6 -0
- package/dist/simulate.d.cts +111 -0
- package/dist/simulate.d.ts +111 -0
- package/dist/simulate.js +1 -0
- package/dist/step-type-for-node-Blf5DKrp.js +228 -0
- package/dist/step-type-for-node-D9sdHfWA.cjs +281 -0
- package/dist/styles.css +4 -0
- package/dist/test-executor-C2AvI73G.cjs +342 -0
- package/dist/test-executor-DpT3qXIT.js +313 -0
- package/dist/types-Bj0VWFny.d.cts +126 -0
- package/dist/types-C5744w6f.d.cts +184 -0
- package/dist/types-DQcmIuAl.d.ts +126 -0
- package/dist/types-dVHX2CyI.d.ts +184 -0
- package/dist/workflow-preview-B0kul6f-.js +1742 -0
- package/dist/workflow-preview-CZzXKXqK.cjs +2065 -0
- package/package.json +119 -4
package/dist/mock.d.cts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { t as ExtendedWorkflowTemplate } from "./types-Bj0VWFny.cjs";
|
|
2
|
+
import { Q as NodeContract, Y as NodeOutputField, y as GridWorkflowDefinition } from "./grid-workflow-dto-C86EArJP.cjs";
|
|
3
|
+
import { c as WorkflowHost, l as WorkflowRunDetail } from "./types-C5744w6f.cjs";
|
|
4
|
+
import "./nodes-D_a8ZkRp.cjs";
|
|
5
|
+
/**
|
|
6
|
+
* 메모리 호스트 — 서버 없이 에디터의 모든 능력을 돌린다(문서·테스트·플레이그라운드용).
|
|
7
|
+
*
|
|
8
|
+
* 저장은 메모리에, 실행은 시뮬레이션 실행기(`./simulate`)가 계산한 경로를 시간차 이벤트로
|
|
9
|
+
* 흘려 보낸다. **정상 경로만 도는 대역은 편집 상태의 절반을 못 보여 준다** — 그래서
|
|
10
|
+
* `configure`로 지연·저장 실패·스텝 실패·재시도·연결 실패를 일부러 만들 수 있다.
|
|
11
|
+
*/
|
|
12
|
+
export type MockWorkflowHostConfig = {
|
|
13
|
+
/** 저장·조회 응답까지의 지연(ms). */
|
|
14
|
+
latencyMs: number;
|
|
15
|
+
/** 스텝 하나가 도는 시간(ms). */
|
|
16
|
+
stepMs: number;
|
|
17
|
+
/** 다음 저장을 실패시킨다(한 번 쓰고 꺼진다). `"always"`면 계속 실패한다. */
|
|
18
|
+
failNextSave: boolean | "always";
|
|
19
|
+
/** 스텝 id → 오류 문구. 그 스텝은 실패한다. */
|
|
20
|
+
failSteps: Record<string, string>;
|
|
21
|
+
/** 스텝 id → 재시도 횟수. 그만큼 `step-retry`를 낸 뒤 성공한다. */
|
|
22
|
+
retrySteps: Record<string, number>;
|
|
23
|
+
/** 스텝 id → 모의 출력. 뒤 스텝의 `{{id.output.…}}`가 이 값을 읽는다. */
|
|
24
|
+
mockOutputs: Record<string, unknown>;
|
|
25
|
+
/** 스텝 id → 실행 중 카드에 흘릴 글(AI 부분 출력). */
|
|
26
|
+
streamText: Record<string, string>;
|
|
27
|
+
/** 이벤트 스트림이 준비 신호 전에 끊긴다(연결 실패 재현). */
|
|
28
|
+
failConnect: boolean;
|
|
29
|
+
/** 런 조회가 실패한다 — 지표는 "0회"가 아니라 "모름"이 돼야 한다. */
|
|
30
|
+
failRunQueries: boolean;
|
|
31
|
+
};
|
|
32
|
+
export type MockWorkflowHostOptions = {
|
|
33
|
+
/** 이미 저장된 문서로 시작한다. 없으면 "저장 전" 상태다(실행은 먼저 저장 안내). */
|
|
34
|
+
workflowId?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
definition?: GridWorkflowDefinition;
|
|
37
|
+
templates?: readonly ExtendedWorkflowTemplate[];
|
|
38
|
+
config?: Partial<MockWorkflowHostConfig>;
|
|
39
|
+
/** 일어난 일을 받는다 — 플레이그라운드의 로그. */
|
|
40
|
+
onOperation?: (operation: MockOperation) => void;
|
|
41
|
+
};
|
|
42
|
+
export type MockOperation = {
|
|
43
|
+
at: number;
|
|
44
|
+
kind: "save" | "save-failed" | "run-start" | "run-event" | "run-end" | "resume" | "query";
|
|
45
|
+
detail: string;
|
|
46
|
+
};
|
|
47
|
+
export type MockWorkflowHost = {
|
|
48
|
+
/** 에디터에 넘길 호스트. `workflowId`는 첫 저장 뒤에 생긴다 — `subscribe`로 따라간다. */
|
|
49
|
+
getHost: () => WorkflowHost;
|
|
50
|
+
/** 에디터의 `onSave`. */
|
|
51
|
+
save: (name: string, definition: GridWorkflowDefinition, context: unknown) => Promise<boolean>;
|
|
52
|
+
configure: (config: Partial<MockWorkflowHostConfig>) => void;
|
|
53
|
+
getConfig: () => MockWorkflowHostConfig;
|
|
54
|
+
getSaved: () => {
|
|
55
|
+
workflowId: string | undefined;
|
|
56
|
+
name: string;
|
|
57
|
+
definition: GridWorkflowDefinition | undefined;
|
|
58
|
+
context: unknown;
|
|
59
|
+
version: number;
|
|
60
|
+
};
|
|
61
|
+
listRuns: () => WorkflowRunDetail[];
|
|
62
|
+
/** 지난 런을 미리 채운다(누적 지표·재생 시연). */
|
|
63
|
+
seedRuns: (count: number, params?: Record<string, unknown>) => Promise<void>;
|
|
64
|
+
clearRuns: () => void;
|
|
65
|
+
subscribe: (listener: () => void) => () => void;
|
|
66
|
+
};
|
|
67
|
+
export declare function createMockWorkflowHost(options?: MockWorkflowHostOptions): MockWorkflowHost;
|
|
68
|
+
/**
|
|
69
|
+
* 내장 범용 노드만으로 짠 예시 — 웹훅으로 주문을 받아 금액에 따라 갈라 처리한다.
|
|
70
|
+
* 분기·대기·HTTP·데이터 변환·종료가 다 들어 있어 에디터의 거의 모든 화면을 연다.
|
|
71
|
+
*/
|
|
72
|
+
export declare const sampleOrderWorkflow: ExtendedWorkflowTemplate;
|
|
73
|
+
/** 가장 짧은 예시 — 수동 실행 → 대기 → 완료. */
|
|
74
|
+
export declare const sampleMinimalWorkflow: ExtendedWorkflowTemplate;
|
|
75
|
+
export declare const sampleWorkflowTemplates: readonly ExtendedWorkflowTemplate[];
|
|
76
|
+
/** 예시 주문 흐름에 넣어 볼 웹훅 본문. */
|
|
77
|
+
export declare const sampleOrderTestParams: Record<string, unknown>;
|
|
78
|
+
export declare const sampleOrderDefinition: GridWorkflowDefinition;
|
|
79
|
+
/** 에디터의 `nodes` prop에 그대로 준다. 참조가 고정돼 있어 다시 등록되지 않는다. */
|
|
80
|
+
export declare const sampleProductNodes: {
|
|
81
|
+
mode: "replace";
|
|
82
|
+
triggers: NodeContract[];
|
|
83
|
+
actions: NodeContract[];
|
|
84
|
+
outputs: Record<string, NodeOutputField[]>;
|
|
85
|
+
triggerPayloads: Record<string, NodeOutputField[]>;
|
|
86
|
+
};
|
|
87
|
+
/** `host.templates`에 준다. 빈 문서 항목은 고르는 화면이 스스로 갖고 있어 뺀다. */
|
|
88
|
+
export declare const sampleProductTemplates: readonly ExtendedWorkflowTemplate[];
|
package/dist/mock.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { t as ExtendedWorkflowTemplate } from "./types-DQcmIuAl.js";
|
|
2
|
+
import { Q as NodeContract, Y as NodeOutputField, y as GridWorkflowDefinition } from "./grid-workflow-dto-C86EArJP.js";
|
|
3
|
+
import { c as WorkflowHost, l as WorkflowRunDetail } from "./types-dVHX2CyI.js";
|
|
4
|
+
import "./nodes-myp8R2zo.js";
|
|
5
|
+
/**
|
|
6
|
+
* 메모리 호스트 — 서버 없이 에디터의 모든 능력을 돌린다(문서·테스트·플레이그라운드용).
|
|
7
|
+
*
|
|
8
|
+
* 저장은 메모리에, 실행은 시뮬레이션 실행기(`./simulate`)가 계산한 경로를 시간차 이벤트로
|
|
9
|
+
* 흘려 보낸다. **정상 경로만 도는 대역은 편집 상태의 절반을 못 보여 준다** — 그래서
|
|
10
|
+
* `configure`로 지연·저장 실패·스텝 실패·재시도·연결 실패를 일부러 만들 수 있다.
|
|
11
|
+
*/
|
|
12
|
+
export type MockWorkflowHostConfig = {
|
|
13
|
+
/** 저장·조회 응답까지의 지연(ms). */
|
|
14
|
+
latencyMs: number;
|
|
15
|
+
/** 스텝 하나가 도는 시간(ms). */
|
|
16
|
+
stepMs: number;
|
|
17
|
+
/** 다음 저장을 실패시킨다(한 번 쓰고 꺼진다). `"always"`면 계속 실패한다. */
|
|
18
|
+
failNextSave: boolean | "always";
|
|
19
|
+
/** 스텝 id → 오류 문구. 그 스텝은 실패한다. */
|
|
20
|
+
failSteps: Record<string, string>;
|
|
21
|
+
/** 스텝 id → 재시도 횟수. 그만큼 `step-retry`를 낸 뒤 성공한다. */
|
|
22
|
+
retrySteps: Record<string, number>;
|
|
23
|
+
/** 스텝 id → 모의 출력. 뒤 스텝의 `{{id.output.…}}`가 이 값을 읽는다. */
|
|
24
|
+
mockOutputs: Record<string, unknown>;
|
|
25
|
+
/** 스텝 id → 실행 중 카드에 흘릴 글(AI 부분 출력). */
|
|
26
|
+
streamText: Record<string, string>;
|
|
27
|
+
/** 이벤트 스트림이 준비 신호 전에 끊긴다(연결 실패 재현). */
|
|
28
|
+
failConnect: boolean;
|
|
29
|
+
/** 런 조회가 실패한다 — 지표는 "0회"가 아니라 "모름"이 돼야 한다. */
|
|
30
|
+
failRunQueries: boolean;
|
|
31
|
+
};
|
|
32
|
+
export type MockWorkflowHostOptions = {
|
|
33
|
+
/** 이미 저장된 문서로 시작한다. 없으면 "저장 전" 상태다(실행은 먼저 저장 안내). */
|
|
34
|
+
workflowId?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
definition?: GridWorkflowDefinition;
|
|
37
|
+
templates?: readonly ExtendedWorkflowTemplate[];
|
|
38
|
+
config?: Partial<MockWorkflowHostConfig>;
|
|
39
|
+
/** 일어난 일을 받는다 — 플레이그라운드의 로그. */
|
|
40
|
+
onOperation?: (operation: MockOperation) => void;
|
|
41
|
+
};
|
|
42
|
+
export type MockOperation = {
|
|
43
|
+
at: number;
|
|
44
|
+
kind: "save" | "save-failed" | "run-start" | "run-event" | "run-end" | "resume" | "query";
|
|
45
|
+
detail: string;
|
|
46
|
+
};
|
|
47
|
+
export type MockWorkflowHost = {
|
|
48
|
+
/** 에디터에 넘길 호스트. `workflowId`는 첫 저장 뒤에 생긴다 — `subscribe`로 따라간다. */
|
|
49
|
+
getHost: () => WorkflowHost;
|
|
50
|
+
/** 에디터의 `onSave`. */
|
|
51
|
+
save: (name: string, definition: GridWorkflowDefinition, context: unknown) => Promise<boolean>;
|
|
52
|
+
configure: (config: Partial<MockWorkflowHostConfig>) => void;
|
|
53
|
+
getConfig: () => MockWorkflowHostConfig;
|
|
54
|
+
getSaved: () => {
|
|
55
|
+
workflowId: string | undefined;
|
|
56
|
+
name: string;
|
|
57
|
+
definition: GridWorkflowDefinition | undefined;
|
|
58
|
+
context: unknown;
|
|
59
|
+
version: number;
|
|
60
|
+
};
|
|
61
|
+
listRuns: () => WorkflowRunDetail[];
|
|
62
|
+
/** 지난 런을 미리 채운다(누적 지표·재생 시연). */
|
|
63
|
+
seedRuns: (count: number, params?: Record<string, unknown>) => Promise<void>;
|
|
64
|
+
clearRuns: () => void;
|
|
65
|
+
subscribe: (listener: () => void) => () => void;
|
|
66
|
+
};
|
|
67
|
+
export declare function createMockWorkflowHost(options?: MockWorkflowHostOptions): MockWorkflowHost;
|
|
68
|
+
/**
|
|
69
|
+
* 내장 범용 노드만으로 짠 예시 — 웹훅으로 주문을 받아 금액에 따라 갈라 처리한다.
|
|
70
|
+
* 분기·대기·HTTP·데이터 변환·종료가 다 들어 있어 에디터의 거의 모든 화면을 연다.
|
|
71
|
+
*/
|
|
72
|
+
export declare const sampleOrderWorkflow: ExtendedWorkflowTemplate;
|
|
73
|
+
/** 가장 짧은 예시 — 수동 실행 → 대기 → 완료. */
|
|
74
|
+
export declare const sampleMinimalWorkflow: ExtendedWorkflowTemplate;
|
|
75
|
+
export declare const sampleWorkflowTemplates: readonly ExtendedWorkflowTemplate[];
|
|
76
|
+
/** 예시 주문 흐름에 넣어 볼 웹훅 본문. */
|
|
77
|
+
export declare const sampleOrderTestParams: Record<string, unknown>;
|
|
78
|
+
export declare const sampleOrderDefinition: GridWorkflowDefinition;
|
|
79
|
+
/** 에디터의 `nodes` prop에 그대로 준다. 참조가 고정돼 있어 다시 등록되지 않는다. */
|
|
80
|
+
export declare const sampleProductNodes: {
|
|
81
|
+
mode: "replace";
|
|
82
|
+
triggers: NodeContract[];
|
|
83
|
+
actions: NodeContract[];
|
|
84
|
+
outputs: Record<string, NodeOutputField[]>;
|
|
85
|
+
triggerPayloads: Record<string, NodeOutputField[]>;
|
|
86
|
+
};
|
|
87
|
+
/** `host.templates`에 준다. 빈 문서 항목은 고르는 화면이 스스로 갖고 있어 뺀다. */
|
|
88
|
+
export declare const sampleProductTemplates: readonly ExtendedWorkflowTemplate[];
|