@loka1/pi-orchestra 0.0.0-stage → 0.5.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.
@@ -0,0 +1,591 @@
1
+ /**
2
+ * Durable orchestration state.
3
+ *
4
+ * One JSON document per project under `.pi/orchestra/state.json`, written
5
+ * atomically (tmp + rename). The coordinator session is the only writer; worker
6
+ * processes never touch this file, they only exchange mail (see `mail.ts`).
7
+ */
8
+
9
+ import {
10
+ existsSync,
11
+ mkdirSync,
12
+ readFileSync,
13
+ readdirSync,
14
+ renameSync,
15
+ rmSync,
16
+ statSync,
17
+ writeFileSync,
18
+ } from "node:fs";
19
+ import { join } from "node:path";
20
+ import { randomUUID } from "node:crypto";
21
+ import {
22
+ type Dispatch,
23
+ type DispatchStatus,
24
+ type OrchestraState,
25
+ type Run,
26
+ type Task,
27
+ emptyState,
28
+ emptyUsage,
29
+ } from "./types.ts";
30
+
31
+ export interface StorePaths {
32
+ root: string;
33
+ stateFile: string;
34
+ logsDir: string;
35
+ mailDir: string;
36
+ promptsDir: string;
37
+ archiveDir: string;
38
+ exportsDir: string;
39
+ }
40
+
41
+ export function storePaths(root: string): StorePaths {
42
+ return {
43
+ root,
44
+ stateFile: join(root, "state.json"),
45
+ logsDir: join(root, "logs"),
46
+ mailDir: join(root, "mail"),
47
+ promptsDir: join(root, "prompts"),
48
+ archiveDir: join(root, "archive"),
49
+ exportsDir: join(root, "exports"),
50
+ };
51
+ }
52
+
53
+ export function ensureStore(root: string): StorePaths {
54
+ const paths = storePaths(root);
55
+ mkdirSync(paths.root, { recursive: true });
56
+ mkdirSync(paths.logsDir, { recursive: true });
57
+ mkdirSync(paths.mailDir, { recursive: true });
58
+ const ignore = join(paths.root, ".gitignore");
59
+ if (!existsSync(ignore)) {
60
+ // Keep run artifacts out of the user's git index without asking them to edit .gitignore.
61
+ writeFileSync(ignore, "*\n", "utf8");
62
+ }
63
+ return paths;
64
+ }
65
+
66
+ export function loadState(root: string): OrchestraState {
67
+ const { stateFile } = storePaths(root);
68
+ if (!existsSync(stateFile)) return emptyState();
69
+ try {
70
+ const parsed = JSON.parse(readFileSync(stateFile, "utf8")) as OrchestraState;
71
+ if (!parsed || parsed.version !== 1) return emptyState();
72
+ parsed.runs ??= {};
73
+ parsed.tasks ??= {};
74
+ parsed.dispatches ??= {};
75
+ parsed.gates ??= {};
76
+ parsed.seq ??= 0;
77
+ return parsed;
78
+ } catch {
79
+ return emptyState();
80
+ }
81
+ }
82
+
83
+ export function saveState(root: string, state: OrchestraState): void {
84
+ const { stateFile } = storePaths(root);
85
+ mkdirSync(root, { recursive: true });
86
+ const tmp = `${stateFile}.${process.pid}.tmp`;
87
+ writeFileSync(tmp, `${JSON.stringify(state, null, 2)}\n`, { encoding: "utf8", mode: 0o600 });
88
+ renameSync(tmp, stateFile);
89
+ }
90
+
91
+ export function newId(prefix: string): string {
92
+ return `${prefix}_${randomUUID().replace(/-/g, "").slice(0, 10)}`;
93
+ }
94
+
95
+ export function nowIso(): string {
96
+ return new Date().toISOString();
97
+ }
98
+
99
+ export function activeRun(state: OrchestraState): Run | undefined {
100
+ if (state.activeRunId && state.runs[state.activeRunId]) return state.runs[state.activeRunId];
101
+ const runs = Object.values(state.runs).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
102
+ return runs.length > 0 ? runs[runs.length - 1] : undefined;
103
+ }
104
+
105
+ export function runOf(state: OrchestraState): Run {
106
+ const run = activeRun(state);
107
+ if (!run) {
108
+ const created = createRun(state, { name: "main" });
109
+ state.activeRunId = created.id;
110
+ return created;
111
+ }
112
+ return run;
113
+ }
114
+
115
+ export function createRun(
116
+ state: OrchestraState,
117
+ input: { name?: string; goal?: string; budgetUsd?: number; template?: string },
118
+ ): Run {
119
+ const now = nowIso();
120
+ const seq = ++state.seq;
121
+ const run: Run = {
122
+ id: newId("run"),
123
+ name: input.name?.trim() || `run-${seq}`,
124
+ goal: input.goal,
125
+ budgetUsd: input.budgetUsd,
126
+ template: input.template,
127
+ status: "active",
128
+ createdAt: now,
129
+ updatedAt: now,
130
+ };
131
+ state.runs[run.id] = run;
132
+ state.activeRunId = run.id;
133
+ return run;
134
+ }
135
+
136
+ /**
137
+ * Follow `deps` from one task and return the path back to it when they loop.
138
+ * Returns undefined when the graph under `taskId` is acyclic.
139
+ */
140
+ export function findDependencyCycle(state: OrchestraState, taskId: string): string[] | undefined {
141
+ const path: string[] = [];
142
+ const seen = new Set<string>();
143
+ const walk = (id: string): string[] | undefined => {
144
+ if (seen.has(id)) return undefined;
145
+ seen.add(id);
146
+ path.push(id);
147
+ for (const dep of state.tasks[id]?.deps ?? []) {
148
+ if (dep === taskId) return [...path, taskId];
149
+ const found = walk(dep);
150
+ if (found) return found;
151
+ }
152
+ path.pop();
153
+ return undefined;
154
+ };
155
+ return walk(taskId);
156
+ }
157
+
158
+ /** Throw when setting `deps` on `taskId` would create a dependency loop. */
159
+ export function assertNoCycle(state: OrchestraState, taskId: string, deps: string[]): void {
160
+ const clone: OrchestraState = { ...state, tasks: { ...state.tasks } };
161
+ if (clone.tasks[taskId]) clone.tasks[taskId] = { ...(clone.tasks[taskId] as Task), deps };
162
+ for (const dep of deps) {
163
+ if (dep === taskId) throw new Error(`Task ${taskId} cannot depend on itself.`);
164
+ if (!clone.tasks[dep]) throw new Error(`Unknown dependency ${dep}.`);
165
+ }
166
+ const cycle = findDependencyCycle(clone, taskId);
167
+ if (cycle) {
168
+ const titles = cycle.map((id) => clone.tasks[id]?.title ?? id);
169
+ throw new Error(`Dependency cycle: ${titles.join(" -> ")}.`);
170
+ }
171
+ }
172
+
173
+ /** Tasks that are part of a loop, mapped to their path, for load-time repair. */
174
+ export function cyclicTasks(state: OrchestraState): Map<string, string[]> {
175
+ const found = new Map<string, string[]>();
176
+ for (const task of Object.values(state.tasks)) {
177
+ if (task.deps.length === 0) continue;
178
+ const cycle = findDependencyCycle(state, task.id);
179
+ if (cycle) found.set(task.id, cycle);
180
+ }
181
+ return found;
182
+ }
183
+
184
+ export function setTaskDeps(state: OrchestraState, taskId: string, deps: string[]): Task {
185
+ const task = state.tasks[taskId];
186
+ if (!task) throw new Error(`Unknown task ${taskId}.`);
187
+ assertNoCycle(state, taskId, deps);
188
+ task.deps = [...new Set(deps)];
189
+ task.updatedAt = nowIso();
190
+ refreshTaskReadiness(state);
191
+ return task;
192
+ }
193
+
194
+ export function createTask(
195
+ state: OrchestraState,
196
+ input: { runId: string; title: string; description?: string; agent?: string; deps?: string[] },
197
+ ): Task {
198
+ const now = nowIso();
199
+ const task: Task = {
200
+ id: newId("task"),
201
+ runId: input.runId,
202
+ title: input.title.trim(),
203
+ description: input.description,
204
+ agent: input.agent,
205
+ status: "pending",
206
+ deps: input.deps ?? [],
207
+ createdAt: now,
208
+ updatedAt: now,
209
+ };
210
+ for (const dep of task.deps) {
211
+ if (!state.tasks[dep]) throw new Error(`Unknown dependency ${dep}.`);
212
+ if (dep === task.id) throw new Error("A task cannot depend on itself.");
213
+ }
214
+ state.tasks[task.id] = task;
215
+ refreshTaskReadiness(state);
216
+ return task;
217
+ }
218
+
219
+ export function createDispatch(
220
+ state: OrchestraState,
221
+ input: {
222
+ runId: string;
223
+ taskId?: string;
224
+ agent: string;
225
+ spec: string;
226
+ model?: string;
227
+ provider?: string;
228
+ modelNote?: string;
229
+ thinking?: string;
230
+ tools?: string[];
231
+ budgetUsd?: number;
232
+ budgetMs?: number;
233
+ timeoutMs?: number;
234
+ timeoutMode?: "total" | "idle";
235
+ sessionId?: string;
236
+ resumedFrom?: string;
237
+ retryOf?: string;
238
+ baseCommit?: string;
239
+ attempt?: number;
240
+ retries?: number;
241
+ keepOpen: boolean;
242
+ },
243
+ ): Dispatch {
244
+ const dispatch: Dispatch = {
245
+ id: newId("dispatch"),
246
+ runId: input.runId,
247
+ taskId: input.taskId,
248
+ agent: input.agent,
249
+ spec: input.spec,
250
+ status: "starting",
251
+ model: input.model,
252
+ provider: input.provider,
253
+ modelNote: input.modelNote,
254
+ budgetUsd: input.budgetUsd,
255
+ budgetMs: input.budgetMs,
256
+ timeoutMs: input.timeoutMs,
257
+ timeoutMode: input.timeoutMode,
258
+ sessionId: input.sessionId,
259
+ resumedFrom: input.resumedFrom,
260
+ retryOf: input.retryOf,
261
+ baseCommit: input.baseCommit,
262
+ attempt: input.attempt ?? 1,
263
+ retries: input.retries,
264
+ lastEventAt: nowIso(),
265
+ thinking: input.thinking,
266
+ tools: input.tools,
267
+ keepOpen: input.keepOpen,
268
+ startedAt: nowIso(),
269
+ usage: emptyUsage(),
270
+ };
271
+ state.dispatches[dispatch.id] = dispatch;
272
+ if (input.taskId && state.tasks[input.taskId]) {
273
+ const task = state.tasks[input.taskId];
274
+ task.status = "running";
275
+ task.dispatchId = dispatch.id;
276
+ task.updatedAt = nowIso();
277
+ }
278
+ return dispatch;
279
+ }
280
+
281
+ export function listTasks(state: OrchestraState, runId?: string): Task[] {
282
+ const run = runId ?? activeRun(state)?.id;
283
+ return Object.values(state.tasks)
284
+ .filter((task) => !run || task.runId === run)
285
+ .sort((a, b) => a.createdAt.localeCompare(b.createdAt));
286
+ }
287
+
288
+ export function listDispatches(state: OrchestraState, runId?: string): Dispatch[] {
289
+ const run = runId ?? activeRun(state)?.id;
290
+ return Object.values(state.dispatches)
291
+ .filter((dispatch) => !run || dispatch.runId === run)
292
+ .sort((a, b) => a.startedAt.localeCompare(b.startedAt));
293
+ }
294
+
295
+ export function refreshTaskReadiness(state: OrchestraState): void {
296
+ const cycles = cyclicTasks(state);
297
+ for (const [taskId, cycle] of cycles) {
298
+ const task = state.tasks[taskId];
299
+ if (!task || task.status === "running" || task.status === "done") continue;
300
+ const note = `dependency cycle: ${cycle.map((id) => state.tasks[id]?.title ?? id).join(" -> ")}`;
301
+ if (task.status !== "blocked" || task.error !== note) {
302
+ task.status = "blocked";
303
+ task.error = note;
304
+ task.updatedAt = nowIso();
305
+ }
306
+ }
307
+ for (const task of Object.values(state.tasks)) {
308
+ if (task.status !== "pending" && task.status !== "ready" && task.status !== "blocked") continue;
309
+ if (cycles.has(task.id)) continue;
310
+ const deps = task.deps.map((dep) => state.tasks[dep]).filter(Boolean);
311
+ if (deps.some((dep) => dep.status === "failed")) {
312
+ if (task.status !== "blocked") {
313
+ task.status = "blocked";
314
+ task.updatedAt = nowIso();
315
+ }
316
+ continue;
317
+ }
318
+ const ready = deps.every((dep) => dep.status === "done");
319
+ const next = ready ? "ready" : "pending";
320
+ if (task.status !== next) {
321
+ task.status = next;
322
+ task.updatedAt = nowIso();
323
+ }
324
+ }
325
+ }
326
+
327
+ export function totalUsage(state: OrchestraState, runId?: string) {
328
+ const totals = emptyUsage();
329
+ for (const dispatch of listDispatches(state, runId)) {
330
+ totals.turns += dispatch.usage.turns;
331
+ totals.input += dispatch.usage.input;
332
+ totals.output += dispatch.usage.output;
333
+ totals.cacheRead += dispatch.usage.cacheRead;
334
+ totals.cacheWrite += dispatch.usage.cacheWrite;
335
+ totals.cost += dispatch.usage.cost;
336
+ totals.toolCalls += dispatch.usage.toolCalls;
337
+ }
338
+ return totals;
339
+ }
340
+
341
+ export function isTerminalStatus(status: DispatchStatus): boolean {
342
+ return status !== "starting" && status !== "running" && status !== "question" && status !== "orphaned";
343
+ }
344
+
345
+ /** True when the pid belongs to a live process we can still signal. */
346
+ export function pidAlive(pid: number | undefined): boolean {
347
+ if (!pid || pid <= 0) return false;
348
+ try {
349
+ process.kill(pid, 0);
350
+ return true;
351
+ } catch (error) {
352
+ // EPERM means the process exists but belongs to someone else.
353
+ return (error as NodeJS.ErrnoException).code === "EPERM";
354
+ }
355
+ }
356
+
357
+ /**
358
+ * Classify dispatches that a previous coordinator left non-terminal: a live pid
359
+ * becomes `orphaned` (stoppable, resumable), a dead one `lost`.
360
+ */
361
+ export function reconcileOrphans(
362
+ state: OrchestraState,
363
+ options: { isAlive?: (pid: number | undefined) => boolean } = {},
364
+ ): { orphaned: string[]; lost: string[] } {
365
+ const alive = options.isAlive ?? pidAlive;
366
+ const result: { orphaned: string[]; lost: string[] } = { orphaned: [], lost: [] };
367
+ for (const dispatch of Object.values(state.dispatches)) {
368
+ if (isTerminalStatus(dispatch.status)) continue;
369
+ if (alive(dispatch.pid)) {
370
+ dispatch.status = "orphaned";
371
+ dispatch.error = `Process ${dispatch.pid} is still running, but it belongs to a previous coordinator session. Stop it with worker_stop (SIGTERM) or resume the work with worker_resume.`;
372
+ dispatch.stalledAt = undefined;
373
+ dispatch.lastEventAt = dispatch.lastEventAt ?? dispatch.startedAt;
374
+ result.orphaned.push(dispatch.id);
375
+ } else {
376
+ dispatch.status = "lost";
377
+ dispatch.endedAt = nowIso();
378
+ dispatch.error = "Coordinator restarted; the worker process is gone.";
379
+ result.lost.push(dispatch.id);
380
+ }
381
+ }
382
+ return result;
383
+ }
384
+
385
+ /** Signal a pid, politely first. Returns true when a signal was delivered. */
386
+ export function killPid(pid: number | undefined, signal: NodeJS.Signals = "SIGTERM"): boolean {
387
+ if (!pid || pid <= 0) return false;
388
+ try {
389
+ process.kill(pid, signal);
390
+ return true;
391
+ } catch {
392
+ return false;
393
+ }
394
+ }
395
+
396
+
397
+ // ---------------------------------------------------------------------------
398
+ // retention: delete data that archiving only moved aside
399
+ // ---------------------------------------------------------------------------
400
+
401
+ export interface PruneOptions {
402
+ /** Delete things older than this many days (default 30). */
403
+ days?: number;
404
+ /** Report what would go without deleting anything. */
405
+ dryRun?: boolean;
406
+ /** Reference time, for tests. */
407
+ now?: number;
408
+ }
409
+
410
+ export interface PruneResult {
411
+ files: string[];
412
+ bytes: number;
413
+ /** Directories removed (archived runs). */
414
+ runs: string[];
415
+ dryRun: boolean;
416
+ days: number;
417
+ }
418
+
419
+ function directorySize(dir: string): number {
420
+ let total = 0;
421
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
422
+ const full = join(dir, entry.name);
423
+ if (entry.isDirectory()) total += directorySize(full);
424
+ else if (entry.isFile()) {
425
+ try {
426
+ total += statSync(full).size;
427
+ } catch {
428
+ // vanished while we walked; ignore
429
+ }
430
+ }
431
+ }
432
+ return total;
433
+ }
434
+
435
+ /**
436
+ * Newest content mtime under a path. A directory is judged by the newest thing
437
+ * inside it (not by its own mtime, which changes when anything is written), so
438
+ * an archived run expires N days after its last file was touched.
439
+ */
440
+ function newestMtime(target: string): number {
441
+ let stats;
442
+ try {
443
+ stats = statSync(target);
444
+ } catch {
445
+ return 0;
446
+ }
447
+ if (!stats.isDirectory()) return stats.mtimeMs;
448
+ let newest = 0;
449
+ let entries = 0;
450
+ for (const entry of readdirSync(target, { withFileTypes: true })) {
451
+ entries += 1;
452
+ newest = Math.max(newest, newestMtime(join(target, entry.name)));
453
+ }
454
+ return entries === 0 ? stats.mtimeMs : newest;
455
+ }
456
+
457
+ /**
458
+ * Remove archived runs and orphaned files older than a window. Live state is
459
+ * never touched: archived runs are already out of `state.json`, and an orphan is
460
+ * a log/prompt/mail/export whose dispatch no longer exists.
461
+ */
462
+ export function pruneStore(root: string, state: OrchestraState, options: PruneOptions = {}): PruneResult {
463
+ const paths = storePaths(root);
464
+ const days = options.days && options.days > 0 ? options.days : 30;
465
+ const now = options.now ?? Date.now();
466
+ const cutoff = now - days * 86_400_000;
467
+ const result: PruneResult = { files: [], bytes: 0, runs: [], dryRun: Boolean(options.dryRun), days };
468
+
469
+ const old = (file: string): boolean => {
470
+ const mtime = newestMtime(file);
471
+ return mtime > 0 && mtime < cutoff;
472
+ };
473
+
474
+ // Archived runs: whole directories, judged by their newest file.
475
+ if (existsSync(paths.archiveDir)) {
476
+ for (const entry of readdirSync(paths.archiveDir, { withFileTypes: true })) {
477
+ if (!entry.isDirectory()) continue;
478
+ const dir = join(paths.archiveDir, entry.name);
479
+ if (!old(dir)) continue;
480
+ result.runs.push(entry.name);
481
+ result.files.push(dir);
482
+ result.bytes += directorySize(dir);
483
+ if (!options.dryRun) rmSync(dir, { recursive: true, force: true });
484
+ }
485
+ }
486
+
487
+ // Orphans: data whose dispatch or run no longer exists in the live state.
488
+ const knownDispatches = new Set(Object.keys(state.dispatches));
489
+ const knownRuns = new Set(Object.keys(state.runs));
490
+ const sweep = (dir: string, keep: (name: string) => boolean) => {
491
+ if (!existsSync(dir)) return;
492
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
493
+ const name = entry.name;
494
+ if (keep(name)) continue;
495
+ const full = join(dir, name);
496
+ if (!old(full)) continue;
497
+ result.files.push(full);
498
+ result.bytes += entry.isDirectory() ? directorySize(full) : statSync(full).size;
499
+ if (!options.dryRun) rmSync(full, { recursive: true, force: true });
500
+ }
501
+ };
502
+
503
+ sweep(paths.logsDir, (name) => knownDispatches.has(name.replace(/\.jsonl$/, "")));
504
+ sweep(paths.promptsDir, (name) => knownDispatches.has(name.replace(/\.md$/, "")));
505
+ sweep(paths.mailDir, (name) => knownDispatches.has(name));
506
+ sweep(paths.exportsDir, (name) => knownRuns.has(name.replace(/\.(jsonl|json|md)$/, "")));
507
+
508
+ return result;
509
+ }
510
+
511
+ // ---------------------------------------------------------------------------
512
+ // archiving: keep state.json small without losing history
513
+ // ---------------------------------------------------------------------------
514
+
515
+ export interface ArchiveResult {
516
+ /** Runs moved out of the live state. */
517
+ archived: string[];
518
+ /** Where each run was written, keyed by run id. */
519
+ dirs: Record<string, string>;
520
+ /** Runs still live afterwards. */
521
+ kept: string[];
522
+ }
523
+
524
+ export interface ArchiveOptions {
525
+ /** Keep this many of the most recent runs; everything older is archived. */
526
+ keep?: number;
527
+ /** Archive exactly these runs, whatever `keep` says. */
528
+ runIds?: string[];
529
+ }
530
+
531
+ /**
532
+ * Move whole runs (tasks, dispatches, gates, logs, prompts, mail) into
533
+ * `archive/<runId>/`. The live `state.json` keeps only what is still useful.
534
+ */
535
+ export function archiveRuns(root: string, state: OrchestraState, options: ArchiveOptions = {}): ArchiveResult {
536
+ const paths = storePaths(root);
537
+ const runs = Object.values(state.runs).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
538
+ const keep = Math.max(0, options.keep ?? 5);
539
+ const explicit = options.runIds?.length ? options.runIds : undefined;
540
+
541
+ const targets = explicit
542
+ ? runs.filter((run) => explicit.includes(run.id))
543
+ : runs.filter((run, index) => index >= keep && run.id !== state.activeRunId);
544
+
545
+ const result: ArchiveResult = { archived: [], dirs: {}, kept: [] };
546
+ if (targets.length === 0) {
547
+ result.kept = runs.map((run) => run.id);
548
+ return result;
549
+ }
550
+
551
+ mkdirSync(paths.archiveDir, { recursive: true });
552
+ for (const run of targets) {
553
+ const dir = join(paths.archiveDir, run.id);
554
+ mkdirSync(join(dir, "logs"), { recursive: true });
555
+ mkdirSync(join(dir, "prompts"), { recursive: true });
556
+ mkdirSync(join(dir, "mail"), { recursive: true });
557
+
558
+ const tasks = listTasks(state, run.id);
559
+ const dispatches = listDispatches(state, run.id);
560
+ const gates = Object.values(state.gates).filter((gate) => gate.runId === run.id);
561
+
562
+ for (const dispatch of dispatches) {
563
+ const logFile = join(paths.logsDir, `${dispatch.id}.jsonl`);
564
+ if (existsSync(logFile)) renameSync(logFile, join(dir, "logs", `${dispatch.id}.jsonl`));
565
+ const promptFile = join(paths.promptsDir, `${dispatch.id}.md`);
566
+ if (existsSync(promptFile)) renameSync(promptFile, join(dir, "prompts", `${dispatch.id}.md`));
567
+ const mail = join(paths.mailDir, dispatch.id);
568
+ if (existsSync(mail)) renameSync(mail, join(dir, "mail", dispatch.id));
569
+ delete state.dispatches[dispatch.id];
570
+ }
571
+
572
+ writeFileSync(
573
+ join(dir, "run.json"),
574
+ `${JSON.stringify({ run, tasks, dispatches, gates, archivedAt: nowIso() }, null, 2)}\n`,
575
+ "utf8",
576
+ );
577
+
578
+ for (const task of tasks) delete state.tasks[task.id];
579
+ for (const gate of gates) delete state.gates[gate.id];
580
+ delete state.runs[run.id];
581
+ result.archived.push(run.id);
582
+ result.dirs[run.id] = dir;
583
+ }
584
+
585
+ if (state.activeRunId && !state.runs[state.activeRunId]) {
586
+ const next = Object.values(state.runs).sort((a, b) => b.createdAt.localeCompare(a.createdAt))[0];
587
+ state.activeRunId = next?.id;
588
+ }
589
+ result.kept = Object.keys(state.runs);
590
+ return result;
591
+ }