pi-ptc-subagents 0.1.0 → 0.1.2

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 CHANGED
@@ -5,6 +5,67 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.2] - 2026-09-23
9
+
10
+ ### Fixed
11
+
12
+ - **`pi.dispatch` is registered in production again.** The injection check compared the
13
+ binding-name array by reference against `DEFAULT_BINDING_NAMES`; production resolves
14
+ names through a `.filter()` that always returns a fresh array, so the comparison never
15
+ held and shipped sessions had no `pi.dispatch` at all. Injection now keys off a new
16
+ `includeDispatch` option (defaulting to "the caller passed no explicit `names`"), and
17
+ both shipped tools pass it explicitly. ADR-0016.
18
+ - **The dispatch concurrency cap honours `dispatchConcurrency` (default 8) and rejects
19
+ immediately instead of queueing.** The dispatcher used to read `maxParallelSubCalls`
20
+ (default 10) and FIFO-queue the overflow; per ADR-0016 §2 the N+1th concurrent
21
+ `pi.dispatch` now resolves at once with `{ status: "rejected", errorMessage:
22
+ "dispatch concurrency limit reached" }`. The cap applies to `pi.dispatch` only and
23
+ has its own counter; builtin binding fan-out keeps DSH's `maxParallelSubCalls` (10)
24
+ FIFO-queueing semantics (ADR-0004), so in-flight builtin calls never consume
25
+ dispatch slots.
26
+ - **The depth-limit rejection message is verbatim again.** The program receives
27
+ exactly `dispatch depth limit reached`, matching what the child's
28
+ `<pi-ptc-context>` hint promises — the diagnostic suffix is gone.
29
+ - **`maxDispatchDepth` bounds recursion again.** Every run reported depth 0 and
30
+ children never inherited it, so the depth check could never fire. `dispatch()` now
31
+ stamps `PI_PTC_DEPTH` on the child subprocess's environment, the extension
32
+ entrypoint reads it back, and `runPtcProgram()` accepts a `depth` baseline that
33
+ reaches the binding context. ADR-0016 Recursive section.
34
+
35
+ ## [0.1.1] - 2026-09-23
36
+
37
+ PTC runs inside one agent turn no longer pay a cold start each. Nothing changes in
38
+ what a program may call or return; the difference is latency and cancellation
39
+ behaviour.
40
+
41
+ ### Changed
42
+
43
+ - **Per-turn worker pool.** One warm `worker_threads` Worker per surface
44
+ (`run_code`, `workflow`) is kept for the duration of an agent turn and reused
45
+ across its PTC runs — ~0 ms against ~58 ms for a cold spawn (median of 5). The
46
+ pool is created lazily by the first PTC run of the turn, the two surfaces do not
47
+ share one, and the extension's `turn_end` hook retires it. Idle workers are
48
+ `unref()`-ed, so a warm pool never keeps `pi` alive. `runPtcProgram()` gains an
49
+ optional `pool` field; without it the original cold-start path runs unchanged.
50
+ ADR-0017.
51
+ - **The worker entry is a real `dist/worker.js`.** The `data:` URL built from
52
+ `Function.prototype.toString()` is retired, so V8's code cache and Node's module
53
+ cache survive warm reuse. TypeScript the _model_ submits at run time is still
54
+ type-stripped inside the worker — that is `compileProgram`'s path, not the
55
+ bootstrap's.
56
+
57
+ ### Fixed
58
+
59
+ - **Cancellation settles within a bound in every ordering.** A still-armed deadline
60
+ is the ceiling when a cancel arrives first; a worker that never answers a timeout
61
+ settles at `timeoutMs + graceMs`. A superseded run's frames can no longer settle
62
+ its successor, and an idle worker answers a cancel instead of making the host wait
63
+ out its grace window. ADR-0017 §10.
64
+ - **`serializedBytes` no longer bills containers as zero bytes.** `[null × 100k]`
65
+ was counted as nothing, so a frame could slip past `maxMessageBytes`; the helper
66
+ now matches `JSON.stringify` byte-for-byte and sums `ArrayBuffer` / typed-array
67
+ leaves.
68
+
8
69
  ## [0.1.0] - 2026-09-22
9
70
 
10
71
  First npm release. Ports DSH PTC mode — Programmable Tool Calling, formerly
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ExtensionAPI, Skill } from "@earendil-works/pi-coding-agent";
2
- import { MessagePort } from "node:worker_threads";
2
+ import { MessagePort, Worker } from "node:worker_threads";
3
3
  //#region src/mode/ptc-mode.d.ts
4
4
  /** The two surfaces this package exposes. `/ptc on` needs at least one of them active. */
5
5
  export declare const PTC_MODE_TOOL_NAMES: readonly string[];
@@ -188,7 +188,7 @@ export declare function buildPtcSkillsSection(skills: readonly Skill[], format?:
188
188
  * realm (no VM) and ship no `agent()` (G1 #13 → B), so there is nothing to cap.
189
189
  * - `sandbox-unavailable` is not an error kind either: ADR-0007 ships no OS sandbox.
190
190
  */
191
- /** The two worker surfaces. Each run gets a fresh worker with exactly one of them. */
191
+ /** The two worker surfaces. A worker is spawned with exactly one of them and keeps it. */
192
192
  type PtcSurface = "run_code" | "workflow";
193
193
  interface PtcConfig {
194
194
  /** Default elapsed deadline for a run, including nested binding waits (R1 §1). */
@@ -201,16 +201,24 @@ interface PtcConfig {
201
201
  maxMessageBytes: number;
202
202
  /** Admission control for simultaneously in-flight worker→host binding calls (ADR-0004). */
203
203
  maxPendingCalls: number;
204
- /** Concurrent binding dispatches; DSH's `maxParallelSubCalls` (ADR-0004 consequence).
205
- * Renamed in spirit by ADR-0016 section 2: the cap that really matters for
206
- * resource safety is the per-run `dispatchConcurrency` below. This field
207
- * is kept for backward compatibility (and for the in-process builtin
208
- * binding fan-out) but is no longer the authoritative limit on the
209
- * parallel binding `pi.dispatch`. */
204
+ /**
205
+ * Concurrent builtin binding dispatches; DSH's `maxParallelSubCalls`
206
+ * (ADR-0004 consequence), mirrored verbatim (10). The overflow
207
+ * FIFO-queues for a slot instead of failing. This is the authoritative
208
+ * cap for the builtin fan-out path — independent of
209
+ * `dispatchConcurrency`, with its own counter: neither cap throttles
210
+ * the other.
211
+ */
210
212
  maxParallelSubCalls: number;
211
- /** Per-run hard cap on concurrently in-flight `pi.dispatch(...)` calls.
212
- * Default 8, matches pi's `subagent` extension `MAX_PARALLEL_TASKS`.
213
- * ADR-0016 section 2. */
213
+ /**
214
+ * Per-run hard cap on concurrently in-flight `pi.dispatch(...)` calls,
215
+ * enforced by the dispatcher: the next concurrent call resolves
216
+ * immediately with `{ status: "rejected", errorMessage: "dispatch
217
+ * concurrency limit reached" }` — never queued, never spawned.
218
+ * Default 8, matches pi's `subagent` extension `MAX_PARALLEL_TASKS`.
219
+ * ADR-0016 section 2. Independent of `maxParallelSubCalls`: builtin
220
+ * calls never consume a dispatch slot and vice versa.
221
+ */
214
222
  dispatchConcurrency: number;
215
223
  /** Maximum recursion depth for `pi.dispatch`. The child PTC run spawned by
216
224
  * the (depth+1)-th dispatch is allowed only when childDepth <= maxDispatchDepth.
@@ -226,6 +234,29 @@ interface PtcConfig {
226
234
  maxOldGenerationSizeMb: number;
227
235
  /** V8 young-generation cap handed to `new Worker({ resourceLimits })` (F2). */
228
236
  maxYoungGenerationSizeMb: number;
237
+ /**
238
+ * Per-turn worker pool capacity (ADR-0017 §3). Decoupled from
239
+ * `dispatchConcurrency` because pool capacity is "resident workers" while
240
+ * `dispatchConcurrency` is "in-flight calls" — two different ceilings.
241
+ * Default 4.
242
+ */
243
+ poolSize: number;
244
+ /**
245
+ * How long `runPtcProgram({ pool })` will wait for an available worker before
246
+ * failing the run with `kind: workerExit`. Decoupled from `timeoutMs` because
247
+ * acquire-wait is bounded by the pool's responsiveness, not the run's overall
248
+ * deadline. Default 30 000 ms.
249
+ */
250
+ poolAcquireTimeoutMs: number;
251
+ /**
252
+ * Ceiling on how long a pool's `drain()` waits for in-flight workers to release
253
+ * themselves before terminating them outright: a worker whose `release()` never
254
+ * arrives (a stuck dispatcher promise, an unobserved crash) must bound the turn-end
255
+ * hook rather than hang it. Not `graceMs` above, which is a *run's* cooperative-cancel
256
+ * window; this one is the *pool's* window at retirement, and drain resolves either way.
257
+ * Default 5 000 ms.
258
+ */
259
+ drainGraceMs: number;
229
260
  }
230
261
  export declare const DEFAULT_CONFIG: Readonly<PtcConfig>;
231
262
  /**
@@ -339,6 +370,15 @@ export declare function renderModelValue(value: PtcJsonValue): string;
339
370
  /** pi's built-in tools that can be exposed as bindings, in native order. */
340
371
  export declare const BUILTIN_BINDING_NAMES: readonly ["read", "bash", "edit", "write", "grep", "find", "ls"];
341
372
  type BuiltinBindingName = (typeof BUILTIN_BINDING_NAMES)[number];
373
+ /**
374
+ * Bindings exposed when the caller does not pass an explicit name list.
375
+ *
376
+ * `bash` is included on purpose: DSH's PTC preset still mounts `tool-bash`/`tool-pwsh`
377
+ * (R1 §2 — PTC mode hides the tools from the wire list and re-exposes the same registry
378
+ * as bindings), so a PTC program written against DSH may run shell commands. Leaving it
379
+ * out would silently shrink the surface relative to DSH. Callers that want a read-only
380
+ * PTC surface pass an explicit subset.
381
+ */
342
382
  export declare const DEFAULT_BINDING_NAMES: readonly BuiltinBindingName[];
343
383
  interface BindingContext {
344
384
  /** Aborted when the run is cancelled, times out, or settles. */
@@ -360,6 +400,16 @@ interface CreateBuiltinBindingsOptions {
360
400
  cwd: string;
361
401
  /** Subset of {@link BUILTIN_BINDING_NAMES}; defaults to all of them (bash included). */
362
402
  names?: readonly string[];
403
+ /**
404
+ * Whether the parallel binding `pi.dispatch` (ADR-0016) joins the table. Defaults to
405
+ * "did the caller curate the surface": `true` when `names` is omitted, `false` when an
406
+ * explicit list is passed (R3's read-only PTC surface pattern). Deciding on whether
407
+ * `names` was provided — not on array identity with {@link DEFAULT_BINDING_NAMES} —
408
+ * matters because production callers resolve names through a `.filter()` that always
409
+ * returns a fresh array. The two shipped tools pass `true` explicitly: the dispatch
410
+ * binding is part of every production surface.
411
+ */
412
+ includeDispatch?: boolean;
363
413
  }
364
414
  /**
365
415
  * Build the binding table for one run.
@@ -370,6 +420,80 @@ interface CreateBuiltinBindingsOptions {
370
420
  */
371
421
  export declare function createBuiltinBindings(options: CreateBuiltinBindingsOptions): BindingTable;
372
422
  //#endregion
423
+ //#region src/runtime/worker-pool.d.ts
424
+ /** Options the dispatcher hands to `new Worker(...)`. */
425
+ type WorkerPoolWorkerOptions = ConstructorParameters<typeof Worker>[1];
426
+ interface WorkerPoolOptions {
427
+ /**
428
+ * Build a fresh worker URL for each spawn. The pool calls this only when it actually
429
+ * needs to grow the resident count, so a heavy `buildWorkerUrl` is amortised across
430
+ * warm reuses.
431
+ */
432
+ buildWorkerUrl: () => URL;
433
+ /** Maximum resident workers; acquire when full queues the caller. Default 4. */
434
+ size?: number;
435
+ /** Acquire-wait bound; default 30 000 ms. */
436
+ acquireTimeoutMs?: number;
437
+ /**
438
+ * Bound on how long `drain()` waits for in-flight workers to be released before it
439
+ * terminates them anyway. Default 5 000 ms. Drain resolves either way — expiry is not
440
+ * an error, it just means a worker was retired without a clean release.
441
+ */
442
+ drainGraceMs?: number;
443
+ /** Options passed verbatim to `new Worker(url, options)` when spawning. */
444
+ workerOptions: WorkerPoolWorkerOptions;
445
+ }
446
+ interface WorkerPoolStats {
447
+ resident: number;
448
+ inFlight: number;
449
+ waiters: number;
450
+ totalAcquires: number;
451
+ poolExhaustions: number;
452
+ }
453
+ /**
454
+ * A fixed-capacity FIFO-served worker pool. Not safe for concurrent `acquire()` calls
455
+ * beyond Node's microtask interleaving guarantees — callers (`runPtcProgram`) await
456
+ * `acquire` before scheduling anything that touches the pool, so the only concurrent
457
+ * surface is `release()` against an in-flight worker.
458
+ */
459
+ export declare class WorkerPool {
460
+ #private;
461
+ constructor(options: WorkerPoolOptions);
462
+ /**
463
+ * Acquire an idle worker, spawn a new one if below capacity, or queue until capacity
464
+ * opens up. Throws `Error("pool acquire timed out after ${acquireTimeoutMs} ms")` on
465
+ * timeout; the dispatcher wraps that message with a `pool acquire failed: ` prefix (ADR-0017 §4).
466
+ */
467
+ acquire(): Promise<Worker>;
468
+ /**
469
+ * Hand a worker back to the pool. If a waiter is queued, hand the worker directly to
470
+ * them (no idle round-trip). Otherwise park the worker in `idle` — unless it has
471
+ * already exited, in which case retire it.
472
+ */
473
+ release(worker: Worker): void;
474
+ /**
475
+ * Last time `release()` was called for `worker`. The dispatcher reads this to
476
+ * publish `ptc:worker:reset-time` on a warm `ready` frame: `now - lastSettledAt`
477
+ * is the worker's per-run reset cost (ADR-0017 Addendum). `undefined` for a worker
478
+ * the pool never released (cold-start).
479
+ */
480
+ lastSettledAt(worker: Worker): number | undefined;
481
+ /**
482
+ * Wait for every in-flight worker to be released — bounded by `drainGraceMs` — then
483
+ * terminate every resident worker and reject every queued waiter. After `drain()`
484
+ * returns the pool is unusable.
485
+ *
486
+ * The bound matters: `drain()` is awaited from the pi `turn_end` hook, so a worker
487
+ * whose `release()` never arrives (a stuck dispatcher promise, an unobserved crash)
488
+ * must not hold the turn open. Workers still in flight when the grace expires are
489
+ * terminated with the idle ones, and `drain()` resolves normally — a single bad worker
490
+ * is not a reason to fail the turn boundary.
491
+ */
492
+ drain(): Promise<void>;
493
+ /** Read-only snapshot of the pool's counters; useful for tests and diagnostics. */
494
+ stats(): WorkerPoolStats;
495
+ }
496
+ //#endregion
373
497
  //#region src/runtime/dispatcher.d.ts
374
498
  interface RunPtcProgramOptions {
375
499
  /** Program body: an async function body (`return`/`await` at the top level). */
@@ -387,14 +511,36 @@ interface RunPtcProgramOptions {
387
511
  config?: Partial<PtcConfig>;
388
512
  /** Cancels the run; the worker gets a cooperative cancel window before termination. */
389
513
  signal?: AbortSignal;
514
+ /**
515
+ * Depth of this run in the `pi.dispatch` recursion chain (ADR-0016 Recursive section):
516
+ * 0 for the parent turn's run, 1+ for a run inside a child spawned by `pi.dispatch`.
517
+ * Handed to the binding context so the dispatch binding can bound recursion. The
518
+ * extension entrypoint derives it from `PI_PTC_DEPTH`; direct library use defaults
519
+ * to 0.
520
+ */
521
+ depth?: number;
390
522
  /** Identifier carried to the worker; generated when omitted. */
391
523
  runId?: string;
524
+ /**
525
+ * Optional worker pool (ADR-0017). Absent = spawn a fresh worker and terminate it
526
+ * at run end (the original cold-start path). Present = the dispatcher acquires a
527
+ * worker from the pool at run start and releases it back at run end. Acquire waits
528
+ * are bounded by `config.poolAcquireTimeoutMs`; on timeout the run fails with
529
+ * `kind: workerExit`.
530
+ */
531
+ pool?: WorkerPool;
392
532
  }
393
533
  /**
394
- * One image hoisted out of a successful binding result (DSH parity — see ADR-0014).
534
+ * One image hoisted out of a successful binding result (DSH parity — see ADR-0014,
535
+ * ADR-0017 §8).
395
536
  *
396
- * `data` is base64 exactly as pi's own `read` tool returns it, so the tool layer can forward it as
397
- * an `ImageContent` block without re-encoding.
537
+ * `data` is base64 exactly as pi's own `read` tool returns it, so the tool layer can
538
+ * forward it as an `ImageContent` block without re-encoding. The host↔worker wire carries
539
+ * base64 too: the worker's channel is lossless JSON (a program may return part of a
540
+ * binding result), and a `MessagePort` transferList of raw bytes could not survive that
541
+ * contract — a transferred `ArrayBuffer` would be unusable as a program's return value.
542
+ * Keeping one representation end to end means zero conversions between the binding and
543
+ * pi's image adapter.
398
544
  */
399
545
  interface PtcImage {
400
546
  data: string;
@@ -413,9 +559,11 @@ interface PtcRunOutcome {
413
559
  * Images hoisted out of successful binding results, in call order.
414
560
  *
415
561
  * Every image a program's tool calls produced, with no cap and no dedupe: how many images a run
416
- * attaches is the program's business, exactly as it is in DSH. Present only when at least one was
417
- * hoisted — a failed or cancelled run attaches nothing, because the tool layer throws for it
418
- * (`codeRunFailedError`) and its image would never reach the model.
562
+ * attaches is the program's business, exactly as it is in DSH. Each entry carries base64 `data`,
563
+ * the representation pi's image adapter consumes, so the tool layer forwards it untouched.
564
+ * Present only when at least one was hoisted — a failed or cancelled run attaches nothing
565
+ * (ADR-0014 §2), because the tool layer throws for it (`codeRunFailedError`) and its image would
566
+ * never reach the model.
419
567
  */
420
568
  images?: PtcImage[];
421
569
  /** Failure details; absent on success. */
@@ -430,8 +578,29 @@ interface PtcRunOutcome {
430
578
  */
431
579
  export declare function runPtcProgram(options: RunPtcProgramOptions): Promise<PtcRunOutcome>;
432
580
  //#endregion
581
+ //#region src/runtime/turn-pools.d.ts
582
+ interface TurnPoolsOptions {
583
+ /** Per-turn limit overrides on top of `DEFAULT_CONFIG` (pool size, acquire bound, V8 caps). */
584
+ config?: Partial<PtcConfig>;
585
+ }
586
+ export declare class TurnPools {
587
+ #private;
588
+ constructor(options?: TurnPoolsOptions);
589
+ /**
590
+ * The pool for one surface, created on first request. Warm workers from an earlier
591
+ * run in this turn are served by the same pool (that is the point); a fresh
592
+ * `TurnPools` is how a turn gets a fresh set.
593
+ */
594
+ get(surface: PtcSurface): WorkerPool;
595
+ /**
596
+ * Terminate every pool this holder created. Idempotent, and safe to call from a turn
597
+ * boundary hook: a second call finds nothing to drain.
598
+ */
599
+ drain(): Promise<void>;
600
+ }
601
+ //#endregion
433
602
  //#region src/index.d.ts
434
603
  export default function ptcSubagents(pi: ExtensionAPI): void;
435
604
  //#endregion
436
- export type { Binding, BindingContext, BindingTable, CreateBuiltinBindingsOptions, DefaultModeConfig, ModeBlockReason, ModeEntryDecision, ModeEntryInput, ModeHideStrategy, PersistedModeState, PtcConfig, PtcErrorKind, PtcErrorShape, PtcJsonValue, PtcModeState, PtcRunOutcome, PtcSurface, RunPtcProgramOptions };
605
+ export type { Binding, BindingContext, BindingTable, CreateBuiltinBindingsOptions, DefaultModeConfig, ModeBlockReason, ModeEntryDecision, ModeEntryInput, ModeHideStrategy, PersistedModeState, PtcConfig, PtcErrorKind, PtcErrorShape, PtcImage, PtcJsonValue, PtcModeState, PtcRunOutcome, PtcSurface, RunPtcProgramOptions, TurnPoolsOptions, WorkerPoolOptions, WorkerPoolStats, WorkerPoolWorkerOptions };
437
606
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/mode/ptc-mode.ts","../src/mode/skills-section.ts","../src/runtime/limits.ts","../src/runtime/protocol.ts","../src/tools/text.ts","../src/runtime/bindings.ts","../src/runtime/dispatcher.ts","../src/index.ts"],"mappings":";;;;qBA2Ca;;;;;;;;;;qBAWA;;qBAGA;;qBAGA;;qBAGA;;KAGD;;;;;;;;;;;;;qBAcC,uBAAuB;;UAGnB;EACf;;EAEA;;EAEA;;;wBAIc,oBAAoB;;;;;UAQnB;EACf;EACA;;;UAQe;EACf;EACA;EACA;;;;;;;;;wBAUc,sBAAsB,mBAAmB;;KAwC7C;;KAGA;EAC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AEA;;EAEA;;UAGe;WACN;EACT,QAAQ,eAAe,SAAS,iBAAiB;;KAGvC,eAAe,oBAAoB;UAkC9B;;EAEf;;EAEA;;;;;;;;;wBAUc,sBAAsB,SAAS,+BAA+B;;;UCnF7D;;EAEf;EACA,SAAS;;EAET;;EAEA,UAAU;;EAEV;;EAEA;;EAEA,SAAS,QAAQ;;EAEjB,SAAS;;EAET;;;;;;;;UASe;EACf;EACA;;UAGe;;EAEf;;EAEA;;EAEA;;EAEA,QAAQ;;;;;;;;;EASR,SAAS;;EAET,QAAQ;;;;;;;;;wBAwBY,cAAc,SAAS,uBAAuB,QAAQ;;;wBCUpD,aAAa,IAAI"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/mode/ptc-mode.ts","../src/mode/skills-section.ts","../src/runtime/limits.ts","../src/runtime/protocol.ts","../src/tools/text.ts","../src/runtime/bindings.ts","../src/runtime/worker-pool.ts","../src/runtime/dispatcher.ts","../src/runtime/turn-pools.ts","../src/index.ts"],"mappings":";;;;qBA2Ca;;;;;;;;;;qBAWA;;qBAGA;;qBAGA;;qBAGA;;KAGD;;;;;;;;;;;;;qBAcC,uBAAuB;;UAGnB;EACf;;EAEA;;EAEA;;;wBAIc,oBAAoB;;;;;UAQnB;EACf;EACA;;;UAQe;EACf;EACA;EACA;;;;;;;;;wBAUc,sBAAsB,mBAAmB;;KAwC7C;;KAGA;EACN;EAAa;EAAyB;;EACtC;EAAc,QAAQ;;;UAGX;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA,OAAO;;;wBASO,YAAY,sBAAsB;;;;;;;;wBAclC,YAAY,2BAA2B,MAAM;;;;;;;;;;;;;;;wBAqB7C,gBAAgB,OAAO,iBAAiB;;;;;;;wBA4BxC,cAAc,OAAO,cAAc;;;;;wBAQnC,4BACd,OAAO,cACP;;;;;;;;;;;wBAgBc,mBACd,WAAW,gCACX;EACG;EAAyB;;;;;;;;;wBAoBd,qBAAqB,6BAA6B,MAAM;;;;qBCvR3D;;qB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