crewx 0.8.8-rc.28 → 0.8.8-rc.29

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.
@@ -77,6 +77,28 @@ function escapeCardAttr(value) {
77
77
  function buildWorkflowCardTag({ runId, workflowId, mode, proof, }) {
78
78
  return `<crewx_card type="workflow" version="1" run_id="${escapeCardAttr(runId)}" workflow_id="${escapeCardAttr(workflowId)}" mode="${mode}" proof="${escapeCardAttr(proof)}" />`;
79
79
  }
80
+ function formatWorkflowStateValue(value) {
81
+ if (value === undefined || value === null)
82
+ return '';
83
+ if (typeof value === 'string')
84
+ return value;
85
+ if (typeof value === 'number' || typeof value === 'boolean')
86
+ return String(value);
87
+ return JSON.stringify(value);
88
+ }
89
+ function getWorkflowStateValue(state, path) {
90
+ const parts = path.split('.').map((part) => part.trim()).filter(Boolean);
91
+ let value = state;
92
+ for (const part of parts) {
93
+ if (!value || typeof value !== 'object' || !(part in value))
94
+ return undefined;
95
+ value = value[part];
96
+ }
97
+ return value;
98
+ }
99
+ function interpolateWorkflowStateTemplate(template, state) {
100
+ return template.replace(/\{\{\s*([a-zA-Z0-9_.-]+)\s*\}\}/g, (_match, key) => formatWorkflowStateValue(getWorkflowStateValue(state, key)));
101
+ }
80
102
  // ─── Service ────────────────────────────────────────────────────────────────
81
103
  let WorkflowService = WorkflowService_1 = class WorkflowService {
82
104
  threadRepo;
@@ -150,7 +172,10 @@ let WorkflowService = WorkflowService_1 = class WorkflowService {
150
172
  buildNodeSummaries(nodes) {
151
173
  return Object.entries(nodes).map(([nodeId, node]) => {
152
174
  let description;
153
- if (node.input) {
175
+ if (node.description) {
176
+ description = node.description.trim();
177
+ }
178
+ else if (node.input) {
154
179
  const firstLine = node.input.trim().split('\n')[0];
155
180
  description = firstLine.length > 50 ? firstLine.slice(0, 50) : firstLine;
156
181
  }
@@ -227,6 +252,17 @@ let WorkflowService = WorkflowService_1 = class WorkflowService {
227
252
  else if (currentNodeSpec?.type === 'parallel') {
228
253
  phase = 'paused';
229
254
  }
255
+ const approval = currentNodeSpec?.type === 'approval'
256
+ ? {
257
+ question: interpolateWorkflowStateTemplate(currentNodeSpec.description?.trim() || '승인하면 다음 노드가 실행됩니다.', run.state),
258
+ approveNode: currentNodeSpec.on_approve && nodes[currentNodeSpec.on_approve]
259
+ ? this.buildNodeSummaries({ [currentNodeSpec.on_approve]: nodes[currentNodeSpec.on_approve] })[0] ?? null
260
+ : null,
261
+ rejectNode: currentNodeSpec.on_reject && nodes[currentNodeSpec.on_reject]
262
+ ? this.buildNodeSummaries({ [currentNodeSpec.on_reject]: nodes[currentNodeSpec.on_reject] })[0] ?? null
263
+ : null,
264
+ }
265
+ : null;
230
266
  return {
231
267
  id: run.id,
232
268
  workflowId: run.workflow_id,
@@ -241,6 +277,7 @@ let WorkflowService = WorkflowService_1 = class WorkflowService {
241
277
  totalNodes: Object.keys(nodes).length,
242
278
  state: run.state,
243
279
  audit: run.audit ?? [],
280
+ approval,
244
281
  canApprove: currentNodeSpec?.type === 'approval' && typeof currentNodeSpec.on_approve === 'string',
245
282
  canReject: currentNodeSpec?.type === 'approval' && typeof currentNodeSpec.on_reject === 'string',
246
283
  canCancel: run.status !== 'completed' && run.status !== 'failed' && run.status !== 'cancelled',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crewx",
3
- "version": "0.8.8-rc.28",
3
+ "version": "0.8.8-rc.29",
4
4
  "description": "CrewX — AI agent team dashboard with Electron UI and CLI (Web + Electron + Global CLI)",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -76,18 +76,18 @@
76
76
  "wink-nlp-utils": "2.1.0",
77
77
  "yargs": "17.7.0",
78
78
  "zod": "3.25.76",
79
- "@crewx/cli": "0.8.8-rc.28",
80
- "@crewx/cron": "0.1.10-rc.26",
79
+ "@crewx/cli": "0.8.8-rc.29",
81
80
  "@crewx/doc": "0.1.8",
82
- "@crewx/dreaming": "0.1.0-rc.10",
81
+ "@crewx/cron": "0.1.10-rc.27",
82
+ "@crewx/dreaming": "0.1.0-rc.11",
83
83
  "@crewx/knowledge-core": "0.1.17",
84
- "@crewx/memory": "0.1.23-rc.8",
85
- "@crewx/sdk": "0.8.8-rc.28",
86
- "@crewx/search": "0.1.9",
84
+ "@crewx/memory": "0.1.23-rc.9",
87
85
  "@crewx/shared": "0.0.5",
88
- "@crewx/wbs": "0.1.10-rc.21",
89
- "@crewx/workflow": "0.3.22-rc.8",
90
- "@crewx/skill": "0.1.20"
86
+ "@crewx/search": "0.1.9",
87
+ "@crewx/skill": "0.1.20",
88
+ "@crewx/workflow": "0.3.22-rc.9",
89
+ "@crewx/wbs": "0.1.10-rc.22",
90
+ "@crewx/sdk": "0.8.8-rc.29"
91
91
  },
92
92
  "devDependencies": {
93
93
  "@ccusage/codex": "0.0.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewx/cli",
3
- "version": "0.8.8-rc.28",
3
+ "version": "0.8.8-rc.29",
4
4
  "license": "UNLICENSED",
5
5
  "engines": {
6
6
  "node": ">=20.19.0"