@tom2012/cc-web 2026.5.13-a → 2026.5.14-b

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.
Files changed (34) hide show
  1. package/backend/dist/flows/runner.d.ts +4 -11
  2. package/backend/dist/flows/runner.d.ts.map +1 -1
  3. package/backend/dist/flows/runner.js +190 -381
  4. package/backend/dist/flows/runner.js.map +1 -1
  5. package/backend/dist/flows/store.d.ts +22 -18
  6. package/backend/dist/flows/store.d.ts.map +1 -1
  7. package/backend/dist/flows/store.js +68 -60
  8. package/backend/dist/flows/store.js.map +1 -1
  9. package/backend/dist/flows/types.d.ts +103 -75
  10. package/backend/dist/flows/types.d.ts.map +1 -1
  11. package/backend/dist/flows/types.js +20 -8
  12. package/backend/dist/flows/types.js.map +1 -1
  13. package/backend/dist/routes/flows.d.ts.map +1 -1
  14. package/backend/dist/routes/flows.js +184 -146
  15. package/backend/dist/routes/flows.js.map +1 -1
  16. package/frontend/dist/assets/{ChatOverlay-DeV9Kxv1.js → ChatOverlay-B4bHclb4.js} +1 -1
  17. package/frontend/dist/assets/{GraphPreview-DKBe95dN.js → GraphPreview-CBR4uFHb.js} +1 -1
  18. package/frontend/dist/assets/{MobilePage-l30eYbBv.js → MobilePage-B7u9HJ1Y.js} +3 -3
  19. package/frontend/dist/assets/{OfficePreview-CZZ5h3xg.js → OfficePreview-V-X3ON2u.js} +2 -2
  20. package/frontend/dist/assets/{PdfPreview-Db1BlGXF.js → PdfPreview-NktKOUdL.js} +1 -1
  21. package/frontend/dist/assets/{ProjectPage-BSuP0OrL.js → ProjectPage-DAU6cEkl.js} +5 -5
  22. package/frontend/dist/assets/{SettingsPage-B9iJQRJi.js → SettingsPage-CtBCvofK.js} +1 -1
  23. package/frontend/dist/assets/{SkillHubPage-CDdKniVk.js → SkillHubPage-CHvWwI8j.js} +1 -1
  24. package/frontend/dist/assets/{chevron-down-CO9XV3WE.js → chevron-down-COdWD3xd.js} +1 -1
  25. package/frontend/dist/assets/index-BkQ6KI1l.css +1 -0
  26. package/frontend/dist/assets/{index-CwqaFIAN.js → index-CRhUXLfj.js} +1 -1
  27. package/frontend/dist/assets/{index-CHWSKceq.js → index-CZ4PAGPA.js} +2 -2
  28. package/frontend/dist/assets/{index-sRc5noTy.js → index-CaO8S0F7.js} +1 -1
  29. package/frontend/dist/assets/{jszip.min-DQDZjRrf.js → jszip.min-CP_BBUld.js} +1 -1
  30. package/frontend/dist/assets/{select-D1f26o6o.js → select-Cf6Q2O8Z.js} +1 -1
  31. package/frontend/dist/assets/{user-CCZuBByN.js → user-B4YUPhU8.js} +1 -1
  32. package/frontend/dist/index.html +2 -2
  33. package/package.json +1 -1
  34. package/frontend/dist/assets/index-RmHssrlH.css +0 -1
@@ -1,52 +1,43 @@
1
1
  /**
2
- * Task-flow data model. Three persisted JSON files:
3
- * - <project>/.ccweb/flows/<name>.json — flow definition (design-time)
4
- * - <project>/.ccweb/task_todo.json — co-maintained progress (system + LLM)
5
- * - <project>/.ccweb/flow_state.json — runtime status (system-only)
2
+ * Task-flow data model (schemaVersion 2).
3
+ *
4
+ * All persistent data lives in a single file under each project:
5
+ * <project>/.ccweb/workflow_data.json
6
+ *
7
+ * It holds three sections:
8
+ * - constants: immutable values declared in FlowDef.constants (initialized
9
+ * once at flow start; never written by user-input/LLM)
10
+ * - variables: mutable values written by user-input nodes and/or LLM nodes
11
+ * (read by any node, branched on by system-logic)
12
+ * - task_progress: append-only progress log; the LLM signals node completion
13
+ * by flipping `task_progress[N].finish = true` via Edit/Write
14
+ *
15
+ * The runner's transient bookkeeping (currentNodeId, history, loopCounters,
16
+ * pauseReason, etc.) lives separately in <project>/.ccweb/flow_state.json so
17
+ * the data file stays user-readable and version-controllable.
6
18
  */
7
- export type FileProvider = 'user' | 'llm' | 'system';
8
- /** Default destination for variables whose `file` is left blank in the
9
- * editor. Lives under `.ccweb/` so it doesn't clutter the project root. */
10
- export declare const DEFAULT_VAR_FILE = ".ccweb/task_var.json";
11
- /** Flow-level shared variables. Defined at edit time; LLM nodes can mark a
12
- * subset as "initialize here" (prompt augmentation), and system-logic
13
- * branches can reference them by name (auto-resolve to file+field). */
19
+ export declare const SCHEMA_VERSION: 2;
20
+ /** Default location of the unified workflow data file. */
21
+ export declare const WORKFLOW_DATA_PATH = ".ccweb/workflow_data.json";
22
+ /** Immutable value declared at flow-definition time. Written into
23
+ * workflow_data.constants[name] once at flow start; nodes can read it but
24
+ * cannot overwrite it (validator forbids constants in writeVariables, etc.). */
25
+ export interface FlowConstant {
26
+ /** Unique within the flow; shares a namespace with FlowVariable.name —
27
+ * variables and constants must not collide. */
28
+ name: string;
29
+ /** Any JSON-serializable value: string / number / boolean / array / object. */
30
+ value: unknown;
31
+ description?: string;
32
+ }
33
+ /** Mutable value written at runtime by user-input or LLM nodes. */
14
34
  export interface FlowVariable {
15
- /** Unique within a flow. Used as the JSON top-level field name in `file`. */
35
+ /** Unique within the flow (with constants). */
16
36
  name: string;
17
- /** Relative path; UI defaults to DEFAULT_VAR_FILE when blank. */
18
- file: string;
19
- /** Human-readable meaning — injected into LLM prompt at init nodes so the
20
- * agent knows what value to derive. */
21
37
  description: string;
22
- }
23
- export interface UserInputField {
24
- key: string;
25
- label: string;
26
- /** Phase-1 supports `text` (single line) and `textarea` (multi-line). */
27
- type: 'text' | 'textarea';
28
- /** When set, the submitted value is merged into the named flow variable's
29
- * file (top-level JSON field = variable name). Mutually exclusive with
30
- * `bindVariable`. */
31
- outputToVariable?: string;
32
- /** When set, the field renders the variable's current value read-only —
33
- * used to surface upstream context to the user. Mutually exclusive with
34
- * `outputToVariable`. */
35
- bindVariable?: string;
36
- }
37
- export interface FileRef {
38
- path: string;
39
- provider: FileProvider;
40
- }
41
- export interface BranchRule {
42
- /** Variable-mode (preferred): reference a flow variable by name; runner
43
- * resolves to its file + uses `name` as the JSON top-level field. */
44
- variable?: string;
45
- /** Field-mode (legacy): explicit JSON field on the node's first input
46
- * file. Kept for backward compat with pre-variable flow defs. */
47
- field?: string;
48
- equals: unknown;
49
- goto: number;
38
+ /** Optional initial value written into workflow_data.variables[name] at
39
+ * flow start. Without it, the variable starts as `undefined` (missing key). */
40
+ initialValue?: unknown;
50
41
  }
51
42
  export type NodeKind = 'user-input' | 'llm' | 'system-logic';
52
43
  interface NodeBase {
@@ -54,56 +45,82 @@ interface NodeBase {
54
45
  name: string;
55
46
  kind: NodeKind;
56
47
  }
48
+ /** User-input form field. A field may be in exactly one of three modes —
49
+ * read-write input, read-only variable display, or read-only constant display.
50
+ * Validator enforces XOR. */
51
+ export interface UserInputField {
52
+ key: string;
53
+ label: string;
54
+ type: 'text' | 'textarea';
55
+ /** Mode A: submitted value is merged into variables[name]. */
56
+ outputVariable?: string;
57
+ /** Mode B: render variables[name]'s current value, read-only. */
58
+ bindVariable?: string;
59
+ /** Mode C: render constants[name]'s value, read-only. */
60
+ bindConstant?: string;
61
+ }
57
62
  export interface UserInputNode extends NodeBase {
58
63
  kind: 'user-input';
59
64
  userInputSchema: {
60
65
  fields: UserInputField[];
61
66
  };
62
- outputs: FileRef[];
63
67
  next: number | null;
64
68
  }
65
69
  export interface LlmNode extends NodeBase {
66
70
  kind: 'llm';
67
- inputs: FileRef[];
68
- /** Template supports {{file:relpath}} substitution. */
71
+ /** Supports {{var:name}} and {{const:name}} interpolation. */
69
72
  promptTemplate: string;
70
- outputs: FileRef[];
73
+ /** Variable names whose current values are prepended to the prompt as a
74
+ * read-only "current values" context block. */
75
+ readVariables?: string[];
76
+ /** Constant names whose values are prepended to the prompt as a context
77
+ * block. */
78
+ readConstants?: string[];
79
+ /** Variable names this node is asked to produce. A per-variable write
80
+ * instruction is appended at the end of the prompt (description + target
81
+ * path workflow_data.variables[name]). */
82
+ writeVariables?: string[];
83
+ /** Seconds to wait for `task_progress[N].finish = true` before pausing. */
71
84
  timeoutSec: number;
72
85
  next: number | null;
73
- /** Names of flow variables this node should produce and write to disk.
74
- * Runner injects a per-variable init instruction at the end of the prompt
75
- * using the variable's description + file. */
76
- initVariables?: string[];
77
- /** Names of flow variables whose current value should be prepended to the
78
- * prompt as a context block (variable description + value). Distinct from
79
- * initVariables: reference is read-only context, init asks the LLM to
80
- * write the variable. The two sets may overlap (informational + asked-to-
81
- * refine) but typically don't. */
82
- referenceVariables?: string[];
86
+ }
87
+ /** Branch rule for system-logic nodes. Either `variable` or `constant`
88
+ * must be set (XOR) — the runner reads workflow_data accordingly and
89
+ * matches via loose equality. */
90
+ export interface BranchRule {
91
+ variable?: string;
92
+ constant?: string;
93
+ equals: unknown;
94
+ goto: number;
83
95
  }
84
96
  export interface SystemLogicNode extends NodeBase {
85
97
  kind: 'system-logic';
86
- inputs: FileRef[];
87
98
  branches: BranchRule[];
88
- /** Loop-cap for backward goto edges. If exceeded → pause flow. */
99
+ /** Loop-cap for backward goto edges. */
89
100
  maxRetries: number;
90
101
  /** Where to go if no branch matches. null = terminal, otherwise nodeId. */
91
102
  defaultGoto?: number | null;
92
103
  }
93
104
  export type FlowNode = UserInputNode | LlmNode | SystemLogicNode;
94
105
  export interface FlowDef {
106
+ /** Schema version. Hard-break from v1; loader rejects anything but 2. */
107
+ schemaVersion: typeof SCHEMA_VERSION;
95
108
  id: string;
96
109
  name: string;
97
110
  description?: string;
98
111
  /** Node id of the first node to execute. */
99
112
  entryNodeId: number;
100
113
  nodes: FlowNode[];
101
- /** Flow-level shared variables. Optional for backward compat with pre-
102
- * variables flow defs (treated as []). Names must be unique. */
114
+ /** Immutable values, initialized into workflow_data once. Optional []. */
115
+ constants?: FlowConstant[];
116
+ /** Mutable values. Optional → []. */
103
117
  variables?: FlowVariable[];
104
118
  }
105
119
  export type RunStatus = 'running' | 'paused' | 'completed' | 'failed' | 'aborted';
106
- export type PauseReason = 'awaiting-user-input' | 'user-file-read-error' | 'llm-file-read-error' | 'timeout' | 'max-retries-exceeded' | 'user-paused' | null;
120
+ /** Reduced pause reasons (vs v1): file-read-error variants are gone v2
121
+ * doesn't read user-supplied filesystem paths, so file-read failures are
122
+ * impossible by construction. */
123
+ export type PauseReason = 'awaiting-user-input' | 'timeout' | 'max-retries-exceeded' | 'user-paused' | null;
107
124
  export interface NodeHistoryEntry {
108
125
  nodeId: number;
109
126
  startedAt: number;
@@ -113,36 +130,47 @@ export interface NodeHistoryEntry {
113
130
  }
114
131
  export interface FlowState {
115
132
  flowId: string;
116
- /** Disk filename of the flow def (under `.ccweb/flows/`). Persisted so the
117
- * frontend can re-fetch the FlowDef on page reload without an extra
118
- * list-then-match round-trip. */
119
133
  flowFilename: string;
120
134
  runId: string;
121
135
  startedAt: number;
122
136
  status: RunStatus;
123
137
  currentNodeId: number | null;
124
- /** nodeId → number of times that backward edge was taken in this run. */
125
138
  loopCounters: Record<number, number>;
126
139
  history: NodeHistoryEntry[];
127
140
  pauseReason: PauseReason;
128
141
  pauseDetail?: string;
129
142
  /** When status='paused' and reason='awaiting-user-input', the schema to
130
- * show; cleared on submit. `variableValues` carries current values for
131
- * fields with `bindVariable` so the frontend can display them read-only
132
- * without an extra fetch round-trip. */
143
+ * show. `contextValues` carries pre-read snapshot of bindVariable and
144
+ * bindConstant referenced by the form so the frontend can render them
145
+ * read-only without an extra fetch. */
133
146
  pendingUserInput?: {
134
147
  nodeId: number;
135
148
  fields: UserInputField[];
136
- variableValues?: Record<string, string>;
149
+ contextValues?: {
150
+ variables?: Record<string, unknown>;
151
+ constants?: Record<string, unknown>;
152
+ };
137
153
  };
138
154
  }
139
- export interface TaskTodoEntry {
140
- id: number;
155
+ export interface TaskProgressEntry {
156
+ /** Node id. Same id may repeat on loop re-entries — entries are append-only. */
157
+ nodeId: number;
141
158
  name: string;
142
159
  finish: boolean;
160
+ startedAt: number;
161
+ finishedAt?: number;
143
162
  }
144
- export interface TaskTodo {
145
- tasks: TaskTodoEntry[];
163
+ export interface WorkflowData {
164
+ /** Snapshot of FlowDef.constants. The runner writes this once at start and
165
+ * never mutates it again. */
166
+ constants: Record<string, unknown>;
167
+ /** Mutable variables. Top-level key = variable name. Values are arbitrary
168
+ * JSON. Missing keys = undefined (variable was never written). */
169
+ variables: Record<string, unknown>;
170
+ /** Append-only progress log. The runner appends an entry when an llm node
171
+ * starts; the LLM flips `finish = true` to signal completion. The runner
172
+ * watches this file (50ms debounce) for the current entry's finish. */
173
+ task_progress: TaskProgressEntry[];
146
174
  }
147
175
  export {};
148
176
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/flows/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAErD;4EAC4E;AAC5E,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD;;wEAEwE;AACxE,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb;4CACwC;IACxC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAC1B;;0BAEsB;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;8BAE0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB;0EACsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;sEACkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,KAAK,GAAG,cAAc,CAAC;AAE7D,UAAU,Q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;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B;kCAC8B;IAC9B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;uEACmE;IACnE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;4EAEwE;IACxE,aAAa,EAAE,iBAAiB,EAAE,CAAC;CACpC"}
@@ -1,13 +1,25 @@
1
1
  "use strict";
2
2
  /**
3
- * Task-flow data model. Three persisted JSON files:
4
- * - <project>/.ccweb/flows/<name>.json — flow definition (design-time)
5
- * - <project>/.ccweb/task_todo.json — co-maintained progress (system + LLM)
6
- * - <project>/.ccweb/flow_state.json — runtime status (system-only)
3
+ * Task-flow data model (schemaVersion 2).
4
+ *
5
+ * All persistent data lives in a single file under each project:
6
+ * <project>/.ccweb/workflow_data.json
7
+ *
8
+ * It holds three sections:
9
+ * - constants: immutable values declared in FlowDef.constants (initialized
10
+ * once at flow start; never written by user-input/LLM)
11
+ * - variables: mutable values written by user-input nodes and/or LLM nodes
12
+ * (read by any node, branched on by system-logic)
13
+ * - task_progress: append-only progress log; the LLM signals node completion
14
+ * by flipping `task_progress[N].finish = true` via Edit/Write
15
+ *
16
+ * The runner's transient bookkeeping (currentNodeId, history, loopCounters,
17
+ * pauseReason, etc.) lives separately in <project>/.ccweb/flow_state.json so
18
+ * the data file stays user-readable and version-controllable.
7
19
  */
8
20
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.DEFAULT_VAR_FILE = void 0;
10
- /** Default destination for variables whose `file` is left blank in the
11
- * editor. Lives under `.ccweb/` so it doesn't clutter the project root. */
12
- exports.DEFAULT_VAR_FILE = '.ccweb/task_var.json';
21
+ exports.WORKFLOW_DATA_PATH = exports.SCHEMA_VERSION = void 0;
22
+ exports.SCHEMA_VERSION = 2;
23
+ /** Default location of the unified workflow data file. */
24
+ exports.WORKFLOW_DATA_PATH = '.ccweb/workflow_data.json';
13
25
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/flows/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAIH;4EAC4E;AAC/D,QAAA,gBAAgB,GAAG,sBAAsB,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/flows/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEU,QAAA,cAAc,GAAG,CAAU,CAAC;AAEzC,0DAA0D;AAC7C,QAAA,kBAAkB,GAAG,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/routes/flows.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAK9C,QAAA,MAAM,MAAM,4CAAW,CAAC;AAexB,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,OAAO,CA2K5D;AAoND,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/routes/flows.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAM9C,QAAA,MAAM,MAAM,4CAAW,CAAC;AAqBxB,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,OAAO,CA6M5D;AAyJD,eAAe,MAAM,CAAC"}