triflux 3.3.0-dev.8 → 4.0.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/README.ko.md +108 -199
- package/README.md +108 -199
- package/bin/triflux.mjs +2415 -1762
- package/hooks/keyword-rules.json +361 -354
- package/hooks/pipeline-stop.mjs +5 -2
- package/hub/assign-callbacks.mjs +136 -136
- package/hub/bridge.mjs +734 -684
- package/hub/delegator/contracts.mjs +38 -38
- package/hub/delegator/index.mjs +14 -14
- package/hub/delegator/schema/delegator-tools.schema.json +250 -250
- package/hub/delegator/service.mjs +302 -118
- package/hub/delegator/tool-definitions.mjs +35 -35
- package/hub/hitl.mjs +67 -67
- package/hub/paths.mjs +28 -0
- package/hub/pipe.mjs +589 -561
- package/hub/pipeline/state.mjs +23 -0
- package/hub/public/dashboard.html +349 -0
- package/hub/public/tray-icon.ico +0 -0
- package/hub/public/tray-icon.png +0 -0
- package/hub/router.mjs +782 -782
- package/hub/schema.sql +40 -40
- package/hub/server.mjs +810 -637
- package/hub/store.mjs +706 -706
- package/hub/team/cli/commands/attach.mjs +37 -0
- package/hub/team/cli/commands/control.mjs +43 -0
- package/hub/team/cli/commands/debug.mjs +74 -0
- package/hub/team/cli/commands/focus.mjs +53 -0
- package/hub/team/cli/commands/interrupt.mjs +36 -0
- package/hub/team/cli/commands/kill.mjs +37 -0
- package/hub/team/cli/commands/list.mjs +24 -0
- package/hub/team/cli/commands/send.mjs +37 -0
- package/hub/team/cli/commands/start/index.mjs +87 -0
- package/hub/team/cli/commands/start/parse-args.mjs +32 -0
- package/hub/team/cli/commands/start/start-in-process.mjs +40 -0
- package/hub/team/cli/commands/start/start-mux.mjs +73 -0
- package/hub/team/cli/commands/start/start-wt.mjs +69 -0
- package/hub/team/cli/commands/status.mjs +87 -0
- package/hub/team/cli/commands/stop.mjs +31 -0
- package/hub/team/cli/commands/task.mjs +30 -0
- package/hub/team/cli/commands/tasks.mjs +13 -0
- package/hub/team/{cli.mjs → cli/help.mjs} +38 -99
- package/hub/team/cli/index.mjs +39 -0
- package/hub/team/cli/manifest.mjs +28 -0
- package/hub/team/cli/render.mjs +30 -0
- package/hub/team/cli/services/attach-fallback.mjs +54 -0
- package/hub/team/cli/services/hub-client.mjs +171 -0
- package/hub/team/cli/services/member-selector.mjs +30 -0
- package/hub/team/cli/services/native-control.mjs +115 -0
- package/hub/team/cli/services/runtime-mode.mjs +60 -0
- package/hub/team/cli/services/state-store.mjs +34 -0
- package/hub/team/cli/services/task-model.mjs +30 -0
- package/hub/team/native-supervisor.mjs +69 -63
- package/hub/team/native.mjs +367 -367
- package/hub/team/nativeProxy.mjs +217 -173
- package/hub/team/pane.mjs +149 -149
- package/hub/team/psmux.mjs +946 -946
- package/hub/team/session.mjs +608 -608
- package/hub/team/staleState.mjs +369 -299
- package/hub/tools.mjs +107 -107
- package/hub/tray.mjs +332 -0
- package/hub/workers/claude-worker.mjs +446 -446
- package/hub/workers/codex-mcp.mjs +414 -414
- package/hub/workers/delegator-mcp.mjs +1045 -1045
- package/hub/workers/factory.mjs +21 -21
- package/hub/workers/gemini-worker.mjs +349 -349
- package/hub/workers/interface.mjs +41 -41
- package/package.json +61 -60
- package/scripts/__tests__/keyword-detector.test.mjs +234 -234
- package/scripts/hub-ensure.mjs +102 -101
- package/scripts/keyword-detector.mjs +272 -272
- package/scripts/keyword-rules-expander.mjs +521 -521
- package/scripts/lib/keyword-rules.mjs +168 -168
- package/scripts/lib/mcp-filter.mjs +642 -642
- package/scripts/lib/mcp-server-catalog.mjs +118 -118
- package/scripts/mcp-check.mjs +126 -126
- package/scripts/preflight-cache.mjs +19 -0
- package/scripts/run.cjs +62 -62
- package/scripts/setup.mjs +68 -31
- package/scripts/test-tfx-route-no-claude-native.mjs +57 -57
- package/scripts/tfx-route-worker.mjs +161 -161
- package/scripts/tfx-route.sh +1360 -1326
- package/skills/tfx-auto/SKILL.md +196 -196
- package/skills/tfx-auto-codex/SKILL.md +77 -77
- package/skills/tfx-multi/SKILL.md +378 -378
- package/hub/team/cli-team-common.mjs +0 -348
- package/hub/team/cli-team-control.mjs +0 -393
- package/hub/team/cli-team-start.mjs +0 -516
- package/hub/team/cli-team-status.mjs +0 -283
- package/skills/auto-verify/SKILL.md +0 -145
- package/skills/manage-skills/SKILL.md +0 -192
- package/skills/verify-implementation/SKILL.md +0 -138
package/hub/pipe.mjs
CHANGED
|
@@ -1,561 +1,589 @@
|
|
|
1
|
-
// hub/pipe.mjs — Named Pipe/Unix socket 제어 채널
|
|
2
|
-
// NDJSON 프로토콜로 에이전트 실시간 제어/이벤트 푸시를 처리한다.
|
|
3
|
-
|
|
4
|
-
import net from 'node:net';
|
|
5
|
-
import { existsSync, unlinkSync } from 'node:fs';
|
|
6
|
-
import { join } from 'node:path';
|
|
7
|
-
import { randomUUID } from 'node:crypto';
|
|
8
|
-
import {
|
|
9
|
-
teamInfo,
|
|
10
|
-
teamTaskList,
|
|
11
|
-
teamTaskUpdate,
|
|
12
|
-
teamSendMessage,
|
|
13
|
-
} from './team/nativeProxy.mjs';
|
|
14
|
-
import { createPipeline } from './pipeline/index.mjs';
|
|
15
|
-
import {
|
|
16
|
-
ensurePipelineTable,
|
|
17
|
-
initPipelineState,
|
|
18
|
-
listPipelineStates,
|
|
19
|
-
readPipelineState,
|
|
20
|
-
} from './pipeline/state.mjs';
|
|
21
|
-
|
|
22
|
-
const DEFAULT_HEARTBEAT_TTL_MS = 60000;
|
|
23
|
-
|
|
24
|
-
/** 플랫폼별 pipe 경로 계산 */
|
|
25
|
-
export function getPipePath(sessionId = process.pid) {
|
|
26
|
-
if (process.platform === 'win32') {
|
|
27
|
-
return `\\\\.\\pipe\\triflux-${sessionId}`;
|
|
28
|
-
}
|
|
29
|
-
return join('/tmp', `triflux-${sessionId}.sock`);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function safeJsonParse(line) {
|
|
33
|
-
try {
|
|
34
|
-
return JSON.parse(line);
|
|
35
|
-
} catch {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function normalizeTopics(topics) {
|
|
41
|
-
if (!Array.isArray(topics)) return [];
|
|
42
|
-
return topics
|
|
43
|
-
.map((topic) => String(topic || '').trim())
|
|
44
|
-
.filter(Boolean);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Named Pipe 서버 생성
|
|
49
|
-
* @param {object} opts
|
|
50
|
-
* @param {object} opts.router
|
|
51
|
-
* @param {object} [opts.store]
|
|
52
|
-
* @param {string|number} [opts.sessionId]
|
|
53
|
-
* @param {number} [opts.heartbeatTtlMs]
|
|
54
|
-
*/
|
|
55
|
-
export function createPipeServer({
|
|
56
|
-
router,
|
|
57
|
-
store = null,
|
|
58
|
-
sessionId = process.pid,
|
|
59
|
-
heartbeatTtlMs = DEFAULT_HEARTBEAT_TTL_MS,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
client.closed
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
client.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
client.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
if (
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
if (
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
error: { code: '
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
if (client) touchClient(client);
|
|
348
|
-
return
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
1
|
+
// hub/pipe.mjs — Named Pipe/Unix socket 제어 채널
|
|
2
|
+
// NDJSON 프로토콜로 에이전트 실시간 제어/이벤트 푸시를 처리한다.
|
|
3
|
+
|
|
4
|
+
import net from 'node:net';
|
|
5
|
+
import { existsSync, unlinkSync } from 'node:fs';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { randomUUID } from 'node:crypto';
|
|
8
|
+
import {
|
|
9
|
+
teamInfo,
|
|
10
|
+
teamTaskList,
|
|
11
|
+
teamTaskUpdate,
|
|
12
|
+
teamSendMessage,
|
|
13
|
+
} from './team/nativeProxy.mjs';
|
|
14
|
+
import { createPipeline } from './pipeline/index.mjs';
|
|
15
|
+
import {
|
|
16
|
+
ensurePipelineTable,
|
|
17
|
+
initPipelineState,
|
|
18
|
+
listPipelineStates,
|
|
19
|
+
readPipelineState,
|
|
20
|
+
} from './pipeline/state.mjs';
|
|
21
|
+
|
|
22
|
+
const DEFAULT_HEARTBEAT_TTL_MS = 60000;
|
|
23
|
+
|
|
24
|
+
/** 플랫폼별 pipe 경로 계산 */
|
|
25
|
+
export function getPipePath(sessionId = process.pid) {
|
|
26
|
+
if (process.platform === 'win32') {
|
|
27
|
+
return `\\\\.\\pipe\\triflux-${sessionId}`;
|
|
28
|
+
}
|
|
29
|
+
return join('/tmp', `triflux-${sessionId}.sock`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function safeJsonParse(line) {
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(line);
|
|
35
|
+
} catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function normalizeTopics(topics) {
|
|
41
|
+
if (!Array.isArray(topics)) return [];
|
|
42
|
+
return topics
|
|
43
|
+
.map((topic) => String(topic || '').trim())
|
|
44
|
+
.filter(Boolean);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Named Pipe 서버 생성
|
|
49
|
+
* @param {object} opts
|
|
50
|
+
* @param {object} opts.router
|
|
51
|
+
* @param {object} [opts.store]
|
|
52
|
+
* @param {string|number} [opts.sessionId]
|
|
53
|
+
* @param {number} [opts.heartbeatTtlMs]
|
|
54
|
+
*/
|
|
55
|
+
export function createPipeServer({
|
|
56
|
+
router,
|
|
57
|
+
store = null,
|
|
58
|
+
sessionId = process.pid,
|
|
59
|
+
heartbeatTtlMs = DEFAULT_HEARTBEAT_TTL_MS,
|
|
60
|
+
delegatorService = null,
|
|
61
|
+
} = {}) {
|
|
62
|
+
if (!router) {
|
|
63
|
+
throw new Error('router is required');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const pipePath = getPipePath(sessionId);
|
|
67
|
+
const clients = new Map();
|
|
68
|
+
let server = null;
|
|
69
|
+
let heartbeatTimer = null;
|
|
70
|
+
|
|
71
|
+
function sendFrame(client, frame) {
|
|
72
|
+
if (!client || client.closed || !client.socket.writable) return false;
|
|
73
|
+
try {
|
|
74
|
+
client.socket.write(`${JSON.stringify(frame)}\n`);
|
|
75
|
+
return true;
|
|
76
|
+
} catch {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function sendResponse(client, requestId, result) {
|
|
82
|
+
return sendFrame(client, { type: 'response', request_id: requestId, ...result });
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function closeClient(client) {
|
|
86
|
+
if (!client || client.closed) return;
|
|
87
|
+
client.closed = true;
|
|
88
|
+
clients.delete(client.id);
|
|
89
|
+
try { client.socket.destroy(); } catch {}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function touchClient(client) {
|
|
93
|
+
client.lastHeartbeatMs = Date.now();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function resolveAgentId(client, payload) {
|
|
97
|
+
const agentId = payload?.agent_id || client?.agentId;
|
|
98
|
+
if (!agentId) {
|
|
99
|
+
throw new Error('agent_id required');
|
|
100
|
+
}
|
|
101
|
+
return agentId;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function pushEvent(agentId, message) {
|
|
105
|
+
let delivered = false;
|
|
106
|
+
for (const client of clients.values()) {
|
|
107
|
+
if (client.agentId !== agentId) continue;
|
|
108
|
+
if (sendFrame(client, {
|
|
109
|
+
type: 'event',
|
|
110
|
+
event: 'message',
|
|
111
|
+
payload: { agent_id: agentId, message },
|
|
112
|
+
})) {
|
|
113
|
+
delivered = true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return delivered;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function pushPendingMessages(agentId) {
|
|
120
|
+
if (!agentId) return 0;
|
|
121
|
+
const pending = router.getPendingMessages(agentId, { max_messages: 100 });
|
|
122
|
+
let pushed = 0;
|
|
123
|
+
for (const message of pending) {
|
|
124
|
+
if (router.markMessagePushed(agentId, message.id)) {
|
|
125
|
+
pushed += pushEvent(agentId, message) ? 1 : 0;
|
|
126
|
+
} else if (pushEvent(agentId, message)) {
|
|
127
|
+
pushed += 1;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return pushed;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
async function processCommand(client, action, payload = {}) {
|
|
134
|
+
switch (action) {
|
|
135
|
+
case 'register': {
|
|
136
|
+
const result = router.registerAgent(payload);
|
|
137
|
+
if (client) {
|
|
138
|
+
client.agentId = payload.agent_id;
|
|
139
|
+
client.subscriptions = new Set(router.getSubscribedTopics(client.agentId));
|
|
140
|
+
touchClient(client);
|
|
141
|
+
pushPendingMessages(client.agentId);
|
|
142
|
+
}
|
|
143
|
+
return { ok: true, data: { ...result, pipe_path: pipePath } };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
case 'subscribe': {
|
|
147
|
+
const agentId = resolveAgentId(client, payload);
|
|
148
|
+
const topics = normalizeTopics(payload.topics);
|
|
149
|
+
const result = router.subscribeAgent(agentId, topics, {
|
|
150
|
+
replace: Boolean(payload.replace),
|
|
151
|
+
});
|
|
152
|
+
if (client) {
|
|
153
|
+
client.agentId = agentId;
|
|
154
|
+
client.subscriptions = new Set(result.topics);
|
|
155
|
+
touchClient(client);
|
|
156
|
+
}
|
|
157
|
+
const replayed = pushPendingMessages(agentId);
|
|
158
|
+
return {
|
|
159
|
+
ok: true,
|
|
160
|
+
data: { ...result, replayed_messages: replayed },
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
case 'ack': {
|
|
165
|
+
const agentId = resolveAgentId(client, payload);
|
|
166
|
+
const acked = router.ackMessages(payload.message_ids || payload.ack_ids || [], agentId);
|
|
167
|
+
if (client) touchClient(client);
|
|
168
|
+
return { ok: true, data: { agent_id: agentId, acked_count: acked } };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
case 'heartbeat': {
|
|
172
|
+
const agentId = resolveAgentId(client, payload);
|
|
173
|
+
const result = router.refreshAgentLease(agentId, payload.heartbeat_ttl_ms || heartbeatTtlMs);
|
|
174
|
+
if (client) touchClient(client);
|
|
175
|
+
return { ok: true, data: result };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
case 'publish': {
|
|
179
|
+
const result = router.handlePublish(payload);
|
|
180
|
+
if (client) touchClient(client);
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
case 'handoff': {
|
|
185
|
+
const result = router.handleHandoff(payload);
|
|
186
|
+
if (client) touchClient(client);
|
|
187
|
+
return result;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
case 'assign': {
|
|
191
|
+
const result = router.assignAsync(payload);
|
|
192
|
+
if (client) touchClient(client);
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
case 'assign_result': {
|
|
197
|
+
const result = router.reportAssignResult(payload);
|
|
198
|
+
if (client) touchClient(client);
|
|
199
|
+
return result;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
case 'assign_retry': {
|
|
203
|
+
const result = router.retryAssign(payload.job_id, payload);
|
|
204
|
+
if (client) touchClient(client);
|
|
205
|
+
return result;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
case 'result': {
|
|
209
|
+
const result = router.handlePublish({
|
|
210
|
+
from: payload.agent_id,
|
|
211
|
+
to: `topic:${payload.topic || 'task.result'}`,
|
|
212
|
+
topic: payload.topic || 'task.result',
|
|
213
|
+
payload: payload.payload || {},
|
|
214
|
+
priority: 5,
|
|
215
|
+
ttl_ms: 3600000,
|
|
216
|
+
trace_id: payload.trace_id,
|
|
217
|
+
correlation_id: payload.correlation_id,
|
|
218
|
+
});
|
|
219
|
+
if (client) touchClient(client);
|
|
220
|
+
return result;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
case 'control': {
|
|
224
|
+
const result = router.handlePublish({
|
|
225
|
+
from: payload.from_agent || 'lead',
|
|
226
|
+
to: payload.to_agent,
|
|
227
|
+
topic: 'lead.control',
|
|
228
|
+
payload: {
|
|
229
|
+
command: payload.command,
|
|
230
|
+
reason: payload.reason || '',
|
|
231
|
+
...(payload.payload || {}),
|
|
232
|
+
issued_at: Date.now(),
|
|
233
|
+
},
|
|
234
|
+
priority: 8,
|
|
235
|
+
ttl_ms: Math.max(1000, Math.min(Number(payload.ttl_ms) || 3600000, 86400000)),
|
|
236
|
+
trace_id: payload.trace_id,
|
|
237
|
+
correlation_id: payload.correlation_id,
|
|
238
|
+
});
|
|
239
|
+
if (client) touchClient(client);
|
|
240
|
+
return result;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
case 'deregister': {
|
|
244
|
+
const agentId = resolveAgentId(client, payload);
|
|
245
|
+
router.updateAgentStatus(agentId, 'offline');
|
|
246
|
+
if (client) touchClient(client);
|
|
247
|
+
return {
|
|
248
|
+
ok: true,
|
|
249
|
+
data: { agent_id: agentId, status: 'offline' },
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
case 'team_task_update': {
|
|
254
|
+
const result = await teamTaskUpdate(payload);
|
|
255
|
+
if (client) touchClient(client);
|
|
256
|
+
return result;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
case 'team_send_message': {
|
|
260
|
+
const result = await teamSendMessage(payload);
|
|
261
|
+
if (client) touchClient(client);
|
|
262
|
+
return result;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
case 'pipeline_advance': {
|
|
266
|
+
if (client) touchClient(client);
|
|
267
|
+
if (!store?.db) {
|
|
268
|
+
return { ok: false, error: 'hub_db_not_found' };
|
|
269
|
+
}
|
|
270
|
+
ensurePipelineTable(store.db);
|
|
271
|
+
const pipeline = createPipeline(store.db, payload.team_name);
|
|
272
|
+
return pipeline.advance(payload.phase);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
case 'pipeline_init': {
|
|
276
|
+
if (client) touchClient(client);
|
|
277
|
+
if (!store?.db) {
|
|
278
|
+
return { ok: false, error: 'hub_db_not_found' };
|
|
279
|
+
}
|
|
280
|
+
ensurePipelineTable(store.db);
|
|
281
|
+
const state = initPipelineState(store.db, payload.team_name, {
|
|
282
|
+
fix_max: payload.fix_max,
|
|
283
|
+
ralph_max: payload.ralph_max,
|
|
284
|
+
});
|
|
285
|
+
return { ok: true, data: state };
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
case 'delegator_delegate': {
|
|
289
|
+
if (!delegatorService) {
|
|
290
|
+
return { ok: false, error: { code: 'DELEGATOR_NOT_AVAILABLE', message: 'Delegator service가 초기화되지 않았습니다' } };
|
|
291
|
+
}
|
|
292
|
+
if (client) touchClient(client);
|
|
293
|
+
const result = await delegatorService.delegate(payload);
|
|
294
|
+
return { ok: result?.ok !== false, data: result };
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
case 'delegator_reply': {
|
|
298
|
+
if (!delegatorService) {
|
|
299
|
+
return { ok: false, error: { code: 'DELEGATOR_NOT_AVAILABLE', message: 'Delegator service가 초기화되지 않았습니다' } };
|
|
300
|
+
}
|
|
301
|
+
if (client) touchClient(client);
|
|
302
|
+
const result = await delegatorService.reply(payload);
|
|
303
|
+
return { ok: result?.ok !== false, data: result };
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
default:
|
|
307
|
+
return {
|
|
308
|
+
ok: false,
|
|
309
|
+
error: { code: 'UNKNOWN_PIPE_COMMAND', message: `지원하지 않는 command: ${action}` },
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function buildReplayMessages(agentId, payload = {}) {
|
|
315
|
+
const maxMessages = Math.max(1, Math.min(Number(payload.max_messages) || 20, 100));
|
|
316
|
+
const pending = router.getPendingMessages(agentId, {
|
|
317
|
+
max_messages: maxMessages,
|
|
318
|
+
include_topics: payload.topics,
|
|
319
|
+
});
|
|
320
|
+
if (!store?.getAuditMessagesForAgent) {
|
|
321
|
+
return pending.slice(0, maxMessages);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
const audit = store.getAuditMessagesForAgent(agentId, {
|
|
325
|
+
max_messages: maxMessages,
|
|
326
|
+
include_topics: payload.topics,
|
|
327
|
+
});
|
|
328
|
+
const byId = new Map();
|
|
329
|
+
for (const message of [...pending, ...audit]) {
|
|
330
|
+
if (!message?.id || byId.has(message.id)) continue;
|
|
331
|
+
byId.set(message.id, message);
|
|
332
|
+
}
|
|
333
|
+
return Array.from(byId.values())
|
|
334
|
+
.sort((left, right) => right.created_at_ms - left.created_at_ms)
|
|
335
|
+
.slice(0, maxMessages);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
async function processQuery(client, action, payload = {}) {
|
|
339
|
+
switch (action) {
|
|
340
|
+
case 'drain': {
|
|
341
|
+
const agentId = resolveAgentId(client, payload);
|
|
342
|
+
const messages = router.drainAgent(agentId, {
|
|
343
|
+
max_messages: payload.max_messages,
|
|
344
|
+
include_topics: payload.topics,
|
|
345
|
+
auto_ack: payload.auto_ack,
|
|
346
|
+
});
|
|
347
|
+
if (client) touchClient(client);
|
|
348
|
+
return {
|
|
349
|
+
ok: true,
|
|
350
|
+
data: { messages, count: messages.length, server_time_ms: Date.now() },
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
case 'context': {
|
|
355
|
+
const agentId = resolveAgentId(client, payload);
|
|
356
|
+
const messages = buildReplayMessages(agentId, payload);
|
|
357
|
+
if (client) touchClient(client);
|
|
358
|
+
return {
|
|
359
|
+
ok: true,
|
|
360
|
+
data: { messages, count: messages.length, server_time_ms: Date.now() },
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
case 'status': {
|
|
365
|
+
const scope = payload.scope || 'hub';
|
|
366
|
+
if (client) touchClient(client);
|
|
367
|
+
return router.getStatus(scope, payload);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
case 'assign_status': {
|
|
371
|
+
if (client) touchClient(client);
|
|
372
|
+
return router.getAssignStatus(payload);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
case 'team_info': {
|
|
376
|
+
const result = await teamInfo(payload);
|
|
377
|
+
if (client) touchClient(client);
|
|
378
|
+
return result;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
case 'team_task_list': {
|
|
382
|
+
const result = await teamTaskList(payload);
|
|
383
|
+
if (client) touchClient(client);
|
|
384
|
+
return result;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
case 'pipeline_state': {
|
|
388
|
+
if (client) touchClient(client);
|
|
389
|
+
if (!store?.db) {
|
|
390
|
+
return { ok: false, error: 'hub_db_not_found' };
|
|
391
|
+
}
|
|
392
|
+
ensurePipelineTable(store.db);
|
|
393
|
+
const state = readPipelineState(store.db, payload.team_name);
|
|
394
|
+
return state
|
|
395
|
+
? { ok: true, data: state }
|
|
396
|
+
: { ok: false, error: 'pipeline_not_found' };
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
case 'pipeline_list': {
|
|
400
|
+
if (client) touchClient(client);
|
|
401
|
+
if (!store?.db) {
|
|
402
|
+
return { ok: false, error: 'hub_db_not_found' };
|
|
403
|
+
}
|
|
404
|
+
ensurePipelineTable(store.db);
|
|
405
|
+
return { ok: true, data: listPipelineStates(store.db) };
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
case 'delegator_status': {
|
|
409
|
+
if (!delegatorService) {
|
|
410
|
+
return { ok: false, error: { code: 'DELEGATOR_NOT_AVAILABLE', message: 'Delegator service가 초기화되지 않았습니다' } };
|
|
411
|
+
}
|
|
412
|
+
if (client) touchClient(client);
|
|
413
|
+
const result = await delegatorService.status(payload);
|
|
414
|
+
return { ok: result?.ok !== false, data: result };
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
default:
|
|
418
|
+
return {
|
|
419
|
+
ok: false,
|
|
420
|
+
error: { code: 'UNKNOWN_PIPE_QUERY', message: `지원하지 않는 query: ${action}` },
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
function onMessage(agentId, message) {
|
|
426
|
+
if (!agentId || !message) return;
|
|
427
|
+
if (router.markMessagePushed(agentId, message.id)) {
|
|
428
|
+
pushEvent(agentId, message);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
pushEvent(agentId, message);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
async function handleFrame(client, frame) {
|
|
435
|
+
if (!frame || typeof frame !== 'object') {
|
|
436
|
+
return sendResponse(client, null, {
|
|
437
|
+
ok: false,
|
|
438
|
+
error: { code: 'INVALID_FRAME', message: 'JSON object frame required' },
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
if (!frame.type) {
|
|
443
|
+
return sendResponse(client, frame.request_id || null, {
|
|
444
|
+
ok: false,
|
|
445
|
+
error: { code: 'INVALID_FRAME', message: 'type required' },
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
touchClient(client);
|
|
450
|
+
|
|
451
|
+
try {
|
|
452
|
+
if (frame.type === 'command') {
|
|
453
|
+
const action = frame.payload?.action || frame.payload?.command;
|
|
454
|
+
const result = await processCommand(client, action, frame.payload || {});
|
|
455
|
+
return sendResponse(client, frame.payload?.request_id || frame.request_id || null, result);
|
|
456
|
+
}
|
|
457
|
+
if (frame.type === 'query') {
|
|
458
|
+
const action = frame.payload?.action || frame.payload?.query;
|
|
459
|
+
const result = await processQuery(client, action, frame.payload || {});
|
|
460
|
+
return sendResponse(client, frame.payload?.request_id || frame.request_id || null, result);
|
|
461
|
+
}
|
|
462
|
+
return sendResponse(client, frame.request_id || null, {
|
|
463
|
+
ok: false,
|
|
464
|
+
error: { code: 'INVALID_FRAME_TYPE', message: `지원하지 않는 type: ${frame.type}` },
|
|
465
|
+
});
|
|
466
|
+
} catch (error) {
|
|
467
|
+
return sendResponse(client, frame.request_id || null, {
|
|
468
|
+
ok: false,
|
|
469
|
+
error: { code: 'PIPE_REQUEST_FAILED', message: error.message },
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function attachSocket(socket) {
|
|
475
|
+
const client = {
|
|
476
|
+
id: randomUUID(),
|
|
477
|
+
socket,
|
|
478
|
+
buffer: '',
|
|
479
|
+
agentId: null,
|
|
480
|
+
subscriptions: new Set(),
|
|
481
|
+
lastHeartbeatMs: Date.now(),
|
|
482
|
+
closed: false,
|
|
483
|
+
};
|
|
484
|
+
clients.set(client.id, client);
|
|
485
|
+
|
|
486
|
+
socket.setEncoding('utf8');
|
|
487
|
+
socket.on('data', async (chunk) => {
|
|
488
|
+
client.buffer += chunk;
|
|
489
|
+
let newlineIndex = client.buffer.indexOf('\n');
|
|
490
|
+
while (newlineIndex >= 0) {
|
|
491
|
+
const line = client.buffer.slice(0, newlineIndex).trim();
|
|
492
|
+
client.buffer = client.buffer.slice(newlineIndex + 1);
|
|
493
|
+
if (line) {
|
|
494
|
+
const frame = safeJsonParse(line);
|
|
495
|
+
await handleFrame(client, frame);
|
|
496
|
+
}
|
|
497
|
+
newlineIndex = client.buffer.indexOf('\n');
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
socket.on('close', () => closeClient(client));
|
|
502
|
+
socket.on('error', () => closeClient(client));
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
function startHeartbeatMonitor() {
|
|
506
|
+
heartbeatTimer = setInterval(() => {
|
|
507
|
+
const now = Date.now();
|
|
508
|
+
for (const client of clients.values()) {
|
|
509
|
+
if (now - client.lastHeartbeatMs <= heartbeatTtlMs) continue;
|
|
510
|
+
sendFrame(client, {
|
|
511
|
+
type: 'event',
|
|
512
|
+
event: 'disconnect',
|
|
513
|
+
payload: { reason: 'heartbeat_timeout' },
|
|
514
|
+
});
|
|
515
|
+
closeClient(client);
|
|
516
|
+
}
|
|
517
|
+
}, Math.max(1000, Math.floor(heartbeatTtlMs / 2)));
|
|
518
|
+
heartbeatTimer.unref();
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
return {
|
|
522
|
+
path: pipePath,
|
|
523
|
+
|
|
524
|
+
async start() {
|
|
525
|
+
if (server) return { path: pipePath };
|
|
526
|
+
|
|
527
|
+
if (process.platform !== 'win32' && existsSync(pipePath)) {
|
|
528
|
+
try { unlinkSync(pipePath); } catch {}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
server = net.createServer(attachSocket);
|
|
532
|
+
router.deliveryEmitter.on('message', onMessage);
|
|
533
|
+
|
|
534
|
+
await new Promise((resolve, reject) => {
|
|
535
|
+
server.once('error', reject);
|
|
536
|
+
server.listen(pipePath, () => {
|
|
537
|
+
server.off('error', reject);
|
|
538
|
+
resolve();
|
|
539
|
+
});
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
startHeartbeatMonitor();
|
|
543
|
+
return { path: pipePath };
|
|
544
|
+
},
|
|
545
|
+
|
|
546
|
+
async stop() {
|
|
547
|
+
if (heartbeatTimer) {
|
|
548
|
+
clearInterval(heartbeatTimer);
|
|
549
|
+
heartbeatTimer = null;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
router.deliveryEmitter.off('message', onMessage);
|
|
553
|
+
|
|
554
|
+
for (const client of clients.values()) {
|
|
555
|
+
closeClient(client);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
if (server) {
|
|
559
|
+
const current = server;
|
|
560
|
+
server = null;
|
|
561
|
+
await new Promise((resolve) => current.close(resolve));
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
if (process.platform !== 'win32' && existsSync(pipePath)) {
|
|
565
|
+
try { unlinkSync(pipePath); } catch {}
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
|
|
569
|
+
getStatus() {
|
|
570
|
+
return {
|
|
571
|
+
path: pipePath,
|
|
572
|
+
protocol: 'ndjson',
|
|
573
|
+
clients: clients.size,
|
|
574
|
+
pending_messages: Array.from(clients.values()).reduce((sum, client) => {
|
|
575
|
+
if (!client.agentId) return sum;
|
|
576
|
+
return sum + router.getPendingMessages(client.agentId, { max_messages: 1000 }).length;
|
|
577
|
+
}, 0),
|
|
578
|
+
};
|
|
579
|
+
},
|
|
580
|
+
|
|
581
|
+
async executeCommand(action, payload) {
|
|
582
|
+
return await processCommand(null, action, payload);
|
|
583
|
+
},
|
|
584
|
+
|
|
585
|
+
async executeQuery(action, payload) {
|
|
586
|
+
return await processQuery(null, action, payload);
|
|
587
|
+
},
|
|
588
|
+
};
|
|
589
|
+
}
|