@akagilnc/pi-workflow-roles 0.1.4800 → 0.1.4870

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 (143) hide show
  1. package/dist/acp-host/production-host.js +19434 -18218
  2. package/dist/analyst-book-key.js +63 -0
  3. package/dist/analyst-cohort.js +167 -0
  4. package/dist/analyst-entry.js +320 -0
  5. package/dist/analyst-index.js +247 -0
  6. package/dist/analyst-ledger.js +561 -0
  7. package/dist/analyst-median.js +16 -0
  8. package/dist/analyst-metric-families/acceptance-success-rework.js +249 -0
  9. package/dist/analyst-metric-families/b2-frame-buckets-actions.js +189 -0
  10. package/dist/analyst-metric-families/gate-cycles.js +77 -0
  11. package/dist/analyst-metric-families/leg-wall-clock.js +56 -0
  12. package/dist/analyst-metric-families/round-timeline.js +126 -0
  13. package/dist/analyst-metric-families.js +23 -0
  14. package/dist/analyst-metric-family.js +11 -0
  15. package/dist/analyst-model-groups.js +135 -0
  16. package/dist/analyst-page.js +182 -0
  17. package/dist/atomic-write.js +23 -0
  18. package/dist/auditor-soul.js +1 -1
  19. package/dist/countersign-contracts.js +0 -2
  20. package/dist/diarist-contracts.js +0 -1
  21. package/dist/doctor-contracts.js +2 -2
  22. package/dist/gatekeeper-role.js +15 -16
  23. package/dist/gleaner-left-contracts.js +0 -2
  24. package/dist/headless-host/production-host.js +16967 -15749
  25. package/dist/host-contracts.js +0 -4
  26. package/dist/inspector-contracts.js +0 -2
  27. package/dist/institutional-resolution.js +4 -2
  28. package/dist/merger-contracts.js +0 -2
  29. package/dist/migrate-book-topology.js +3908 -3089
  30. package/dist/navigator-public-session.js +4 -3
  31. package/dist/notary-contracts.js +0 -2
  32. package/dist/package-contracts/auditor-output.js +0 -1
  33. package/dist/package-contracts/collector-output.js +0 -2
  34. package/dist/package-contracts/fixer-output.js +0 -2
  35. package/dist/package-contracts/gatekeeper-output.js +0 -2
  36. package/dist/package-contracts/judge-output.js +0 -2
  37. package/dist/package-contracts/navigator-output.js +0 -2
  38. package/dist/package-contracts/reviewer-output.js +0 -2
  39. package/dist/package-contracts/terminating-tools.js +32 -92
  40. package/dist/package-contracts/worker-output.js +0 -4
  41. package/dist/packaged-role-registry.js +518 -36
  42. package/dist/pi/role-turn-host.js +2 -1
  43. package/dist/public-cli/analyst-run.js +185 -0
  44. package/dist/public-cli/cli.js +885 -0
  45. package/dist/public-cli/config.js +12 -9
  46. package/dist/public-cli/countersign-run.js +4 -311
  47. package/dist/public-cli/instruction-seat-run.js +628 -158
  48. package/dist/public-cli/invocation.js +806 -1550
  49. package/dist/public-cli/main.js +6962 -9882
  50. package/dist/public-cli/option-definitions.js +51 -99
  51. package/dist/public-cli/post-admission.js +30 -2
  52. package/dist/public-cli/run-lifecycle.js +234 -353
  53. package/dist/public-cli/seat-ticket-binding.js +6 -0
  54. package/dist/public-cli/settlement.js +261 -675
  55. package/dist/public-cli/turn-request.js +76 -0
  56. package/dist/public-role-summons.js +38 -112
  57. package/dist/role-activation-flags.js +23 -45
  58. package/dist/secretariat-contracts.js +0 -2
  59. package/dist/session-identity.js +17 -8
  60. package/dist/session-opening-materials.js +3 -2
  61. package/extensions/role-runtime.ts +6 -80
  62. package/package.json +1 -1
  63. package/souls/coder.md +1 -2
  64. package/src/acp-host/role-turn-host.ts +4 -1
  65. package/src/analyst-metric-families/acceptance-success-rework.ts +3 -2
  66. package/src/auditor-role.ts +1 -2
  67. package/src/auditor-soul.ts +1 -1
  68. package/src/collector-role.ts +2 -2
  69. package/src/countersign-contracts.ts +0 -1
  70. package/src/countersign-role.ts +1 -1
  71. package/src/diarist-contracts.ts +0 -1
  72. package/src/diarist-role.ts +0 -1
  73. package/src/doctor-auditor.ts +1 -2
  74. package/src/doctor-contracts.ts +1 -1
  75. package/src/doctor-role.ts +3 -2
  76. package/src/external-host-turn-loop.ts +1 -1
  77. package/src/factory-board.ts +10 -7
  78. package/src/gatekeeper-role.ts +16 -10
  79. package/src/gleaner-left-contracts.ts +0 -1
  80. package/src/gleaner-left-role.ts +0 -1
  81. package/src/headless-host/role-turn-host.ts +7 -1
  82. package/src/host-contracts.ts +10 -6
  83. package/src/inspector-contracts.ts +0 -1
  84. package/src/inspector-role.ts +0 -2
  85. package/src/institutional-resolution.ts +6 -4
  86. package/src/judge-role.ts +3 -3
  87. package/src/merger-contracts.ts +0 -1
  88. package/src/merger-role.ts +2 -2
  89. package/src/navigator-public-session.ts +7 -6
  90. package/src/navigator-work-context.ts +6 -8
  91. package/src/notary-contracts.ts +0 -1
  92. package/src/notary-role.ts +2 -3
  93. package/src/package-contracts/auditor-output.ts +0 -1
  94. package/src/package-contracts/collector-output.ts +0 -1
  95. package/src/package-contracts/fixer-output.ts +0 -1
  96. package/src/package-contracts/gatekeeper-output.ts +0 -1
  97. package/src/package-contracts/judge-output.ts +0 -1
  98. package/src/package-contracts/navigator-output.ts +0 -1
  99. package/src/package-contracts/reviewer-output.ts +0 -1
  100. package/src/package-contracts/terminating-tools.ts +27 -99
  101. package/src/package-contracts/worker-output.ts +0 -2
  102. package/src/packaged-role-registry.ts +604 -35
  103. package/src/pi/role-turn-host.ts +2 -1
  104. package/src/public-cli/cli.ts +64 -259
  105. package/src/public-cli/config.ts +18 -10
  106. package/src/public-cli/countersign-run.ts +14 -449
  107. package/src/public-cli/instruction-seat-run.ts +758 -277
  108. package/src/public-cli/invocation.ts +1097 -2051
  109. package/src/public-cli/option-definitions.ts +62 -127
  110. package/src/public-cli/post-admission.ts +47 -2
  111. package/src/public-cli/run-lifecycle.ts +303 -613
  112. package/src/public-cli/seat-ticket-binding.ts +6 -0
  113. package/src/public-cli/settlement.ts +399 -1185
  114. package/src/public-cli/turn-request.ts +92 -1
  115. package/src/public-role-summons.ts +44 -128
  116. package/src/reviewer-role.ts +3 -2
  117. package/src/role-activation-flags.ts +20 -41
  118. package/src/role-runtime-dependencies.ts +25 -26
  119. package/src/role-runtime.ts +121 -232
  120. package/src/secretariat-contracts.ts +0 -1
  121. package/src/secretariat-role.ts +0 -2
  122. package/src/session-identity.ts +23 -8
  123. package/src/session-opening-materials.ts +2 -1
  124. package/src/worker-role.ts +3 -4
  125. package/dist/doctor-auditor.js +0 -25
  126. package/dist/public-cli/diarist-run.js +0 -130
  127. package/dist/public-cli/doctor-run.js +0 -87
  128. package/dist/public-cli/inspector-run.js +0 -151
  129. package/dist/public-cli/judge-run.js +0 -114
  130. package/dist/public-cli/notary-run.js +0 -174
  131. package/dist/public-cli/reviewer-run.js +0 -339
  132. package/src/public-cli/coder-run.ts +0 -255
  133. package/src/public-cli/collector-run.ts +0 -189
  134. package/src/public-cli/diarist-run.ts +0 -233
  135. package/src/public-cli/doctor-run.ts +0 -167
  136. package/src/public-cli/fixer-run.ts +0 -265
  137. package/src/public-cli/gleaner-left-run.ts +0 -167
  138. package/src/public-cli/inspector-run.ts +0 -261
  139. package/src/public-cli/judge-run.ts +0 -196
  140. package/src/public-cli/merger-run.ts +0 -294
  141. package/src/public-cli/notary-run.ts +0 -279
  142. package/src/public-cli/reviewer-run.ts +0 -480
  143. package/src/public-cli/secretariat-run.ts +0 -265
@@ -12,6 +12,7 @@
12
12
  */
13
13
 
14
14
  import { CliUsageError } from "./cli-errors.ts";
15
+ import { PUBLIC_CALLABLE_ROLES, type PublicCallableRole } from "./registry.ts";
15
16
 
16
17
  /** Analyst public query faces (#336/#337/#338/#399). model-groups CLI face disabled (library kernel retained). */
17
18
  export type AnalystMode = "issue" | "sweep" | "cohort";
@@ -19,25 +20,8 @@ export type AnalystMode = "issue" | "sweep" | "cohort";
19
20
  /** Coder/Fixer public phase tokens. */
20
21
  export type RolePhase = "plan" | "apply";
21
22
 
22
- export type OptionOwner =
23
- | "global"
24
- | "judge"
25
- | "countersign"
26
- | "coder"
27
- | "fixer"
28
- | "reviewer"
29
- | "collector"
30
- | "doctor"
31
- | "merger"
32
- | "notary"
33
- | "gleaner-left"
34
- | "inspector"
35
- | "gatekeeper"
36
- | "navigator"
37
- | "auditor"
38
- | "diarist"
39
- | "secretariat"
40
- | "analyst";
23
+ /** global, every composition-root role, and the deterministic analyst command. */
24
+ export type OptionOwner = "global" | PublicCallableRole | "analyst";
41
25
 
42
26
  /**
43
27
  * One public option (or positional mode/phase token) identity.
@@ -386,10 +370,29 @@ function bindOwner(
386
370
  return { ...semantics, owner };
387
371
  }
388
372
 
389
- const JUDGE_OPTIONS = [
390
- bindOwner("judge", SHARED_PROJECT_SEMANTICS),
391
- bindOwner("judge", SHARED_ATTACH_SEMANTICS),
392
- ] as const satisfies readonly PublicOptionDefinition[];
373
+ /** Seats whose public face is only project + attach. Unique rows stay explicit. */
374
+ function projectAndAttach(owner: OptionOwner): readonly PublicOptionDefinition[] {
375
+ return [
376
+ bindOwner(owner, SHARED_PROJECT_SEMANTICS),
377
+ bindOwner(owner, SHARED_ATTACH_SEMANTICS),
378
+ ];
379
+ }
380
+
381
+ const SHARED_PHASE_SEMANTICS = {
382
+ id: "phase",
383
+ canonical: "plan|apply",
384
+ aliases: ["plan", "apply"],
385
+ valueMetavar: null,
386
+ required: false,
387
+ repeatable: false,
388
+ defaultValue: "apply",
389
+ form: "positional",
390
+ phases: ["plan", "apply"],
391
+ description: {
392
+ en: "Optional phase token before the instruction; defaults to apply.",
393
+ zh: "指令前可选 phase 词元;默认 apply。",
394
+ },
395
+ } as const satisfies Omit<PublicOptionDefinition, "owner">;
393
396
 
394
397
  const GLEANER_LEFT_OPTIONS = [
395
398
  bindOwner("gleaner-left", SHARED_PROJECT_SEMANTICS),
@@ -410,24 +413,8 @@ const GLEANER_LEFT_OPTIONS = [
410
413
  },
411
414
  ] as const satisfies readonly PublicOptionDefinition[];
412
415
 
413
- const INSPECTOR_OPTIONS = [
414
- bindOwner("inspector", SHARED_PROJECT_SEMANTICS),
415
- bindOwner("inspector", SHARED_ATTACH_SEMANTICS),
416
- ] as const satisfies readonly PublicOptionDefinition[];
417
-
418
- const GATEKEEPER_OPTIONS = [
419
- bindOwner("gatekeeper", SHARED_PROJECT_SEMANTICS),
420
- bindOwner("gatekeeper", SHARED_ATTACH_SEMANTICS),
421
- ] as const satisfies readonly PublicOptionDefinition[];
422
-
423
- const NAVIGATOR_OPTIONS = [
424
- bindOwner("navigator", SHARED_PROJECT_SEMANTICS),
425
- bindOwner("navigator", SHARED_ATTACH_SEMANTICS),
426
- ] as const satisfies readonly PublicOptionDefinition[];
427
-
428
416
  const AUDITOR_OPTIONS = [
429
- bindOwner("auditor", SHARED_PROJECT_SEMANTICS),
430
- bindOwner("auditor", SHARED_ATTACH_SEMANTICS),
417
+ ...projectAndAttach("auditor"),
431
418
  {
432
419
  id: "subject",
433
420
  owner: "auditor",
@@ -458,61 +445,14 @@ const AUDITOR_OPTIONS = [
458
445
  },
459
446
  ] as const satisfies readonly PublicOptionDefinition[];
460
447
 
461
- const COUNTERSIGN_OPTIONS = [
462
- bindOwner("countersign", SHARED_PROJECT_SEMANTICS),
463
- bindOwner("countersign", SHARED_ATTACH_SEMANTICS),
464
- ] as const satisfies readonly PublicOptionDefinition[];
465
-
466
- const DIARIST_OPTIONS = [
467
- bindOwner("diarist", SHARED_PROJECT_SEMANTICS),
468
- bindOwner("diarist", SHARED_ATTACH_SEMANTICS),
469
- ] as const satisfies readonly PublicOptionDefinition[];
470
-
471
- const SECRETARIAT_OPTIONS = [
472
- bindOwner("secretariat", SHARED_PROJECT_SEMANTICS),
473
- bindOwner("secretariat", SHARED_ATTACH_SEMANTICS),
474
- ] as const satisfies readonly PublicOptionDefinition[];
475
-
476
448
  const CODER_OPTIONS = [
477
- {
478
- id: "phase",
479
- owner: "coder",
480
- canonical: "plan|apply",
481
- aliases: ["plan", "apply"],
482
- valueMetavar: null,
483
- required: false,
484
- repeatable: false,
485
- defaultValue: "apply",
486
- form: "positional",
487
- phases: ["plan", "apply"],
488
- description: {
489
- en: "Optional phase token before the instruction; defaults to apply.",
490
- zh: "指令前可选 phase 词元;默认 apply。",
491
- },
492
- },
493
- bindOwner("coder", SHARED_PROJECT_SEMANTICS),
494
- bindOwner("coder", SHARED_ATTACH_SEMANTICS),
449
+ bindOwner("coder", SHARED_PHASE_SEMANTICS),
450
+ ...projectAndAttach("coder"),
495
451
  ] as const satisfies readonly PublicOptionDefinition[];
496
452
 
497
453
  const FIXER_OPTIONS = [
498
- {
499
- id: "phase",
500
- owner: "fixer",
501
- canonical: "plan|apply",
502
- aliases: ["plan", "apply"],
503
- valueMetavar: null,
504
- required: false,
505
- repeatable: false,
506
- defaultValue: "apply",
507
- form: "positional",
508
- phases: ["plan", "apply"],
509
- description: {
510
- en: "Optional phase token before the instruction; defaults to apply.",
511
- zh: "指令前可选 phase 词元;默认 apply。",
512
- },
513
- },
514
- bindOwner("fixer", SHARED_PROJECT_SEMANTICS),
515
- bindOwner("fixer", SHARED_ATTACH_SEMANTICS),
454
+ bindOwner("fixer", SHARED_PHASE_SEMANTICS),
455
+ ...projectAndAttach("fixer"),
516
456
  {
517
457
  id: "prerequisites",
518
458
  owner: "fixer",
@@ -577,8 +517,7 @@ const REVIEWER_OPTIONS = [
577
517
  ] as const satisfies readonly PublicOptionDefinition[];
578
518
 
579
519
  const COLLECTOR_OPTIONS = [
580
- bindOwner("collector", SHARED_PROJECT_SEMANTICS),
581
- bindOwner("collector", SHARED_ATTACH_SEMANTICS),
520
+ ...projectAndAttach("collector"),
582
521
  {
583
522
  id: "pr",
584
523
  owner: "collector",
@@ -639,8 +578,7 @@ const COLLECTOR_OPTIONS = [
639
578
  ] as const satisfies readonly PublicOptionDefinition[];
640
579
 
641
580
  const DOCTOR_OPTIONS = [
642
- bindOwner("doctor", SHARED_PROJECT_SEMANTICS),
643
- bindOwner("doctor", SHARED_ATTACH_SEMANTICS),
581
+ ...projectAndAttach("doctor"),
644
582
  {
645
583
  id: "issue",
646
584
  owner: "doctor",
@@ -841,13 +779,12 @@ const ANALYST_OPTIONS = [
841
779
  ] as const satisfies readonly PublicOptionDefinition[];
842
780
 
843
781
  /**
844
- * Sole production option tables keyed by PUBLIC_ROLE_ARGV / global owner.
845
- * Rows are readonly definition lists — parsers look up spellings here.
782
+ * Seats whose public rows are not the shared project+attach face.
783
+ * A new project+attach seat needs no entry here.
846
784
  */
847
- export const PUBLIC_OPTION_TABLE = {
848
- global: GLOBAL_OPTIONS,
849
- judge: JUDGE_OPTIONS,
850
- countersign: COUNTERSIGN_OPTIONS,
785
+ const SEAT_OPTION_ROWS: Partial<
786
+ Record<PublicCallableRole, readonly PublicOptionDefinition[]>
787
+ > = {
851
788
  "gleaner-left": GLEANER_LEFT_OPTIONS,
852
789
  coder: CODER_OPTIONS,
853
790
  fixer: FIXER_OPTIONS,
@@ -856,37 +793,35 @@ export const PUBLIC_OPTION_TABLE = {
856
793
  doctor: DOCTOR_OPTIONS,
857
794
  merger: MERGER_OPTIONS,
858
795
  notary: NOTARY_OPTIONS,
859
- inspector: INSPECTOR_OPTIONS,
860
- gatekeeper: GATEKEEPER_OPTIONS,
861
- navigator: NAVIGATOR_OPTIONS,
862
796
  auditor: AUDITOR_OPTIONS,
863
- diarist: DIARIST_OPTIONS,
864
- secretariat: SECRETARIAT_OPTIONS,
865
- analyst: ANALYST_OPTIONS,
866
- } as const satisfies Record<OptionOwner, readonly PublicOptionDefinition[]>;
797
+ };
798
+
799
+ function seatOptionRows(role: PublicCallableRole): readonly PublicOptionDefinition[] {
800
+ return SEAT_OPTION_ROWS[role] ?? projectAndAttach(role);
801
+ }
802
+
803
+ /**
804
+ * Sole production option tables keyed by PUBLIC_ROLE_ARGV / global owner.
805
+ * Rows are readonly definition lists — parsers look up spellings here.
806
+ * Callable seats come from the composition root; only a different face is listed above.
807
+ */
808
+ function publicOptionTable(): Record<OptionOwner, readonly PublicOptionDefinition[]> {
809
+ const roles = {} as Record<PublicCallableRole, readonly PublicOptionDefinition[]>;
810
+ for (const role of PUBLIC_CALLABLE_ROLES) {
811
+ roles[role] = seatOptionRows(role);
812
+ }
813
+ return { global: GLOBAL_OPTIONS, ...roles, analyst: ANALYST_OPTIONS };
814
+ }
815
+
816
+ export const PUBLIC_OPTION_TABLE = publicOptionTable();
867
817
 
868
818
  export type PublicRoleOptionOwner = Exclude<OptionOwner, "global">;
869
819
 
870
- /** Role/deterministic owners that appear on PUBLIC_ROLE_ARGV. */
871
- export const PUBLIC_ROLE_OPTION_OWNERS = [
872
- "judge",
873
- "countersign",
874
- "gleaner-left",
875
- "coder",
876
- "fixer",
877
- "reviewer",
878
- "collector",
879
- "doctor",
880
- "merger",
881
- "notary",
882
- "inspector",
883
- "gatekeeper",
884
- "navigator",
885
- "auditor",
886
- "diarist",
887
- "secretariat",
820
+ /** Role/deterministic owners that appear on PUBLIC_ROLE_ARGV. Roles follow the composition root; analyst is the deterministic command. */
821
+ export const PUBLIC_ROLE_OPTION_OWNERS: readonly PublicRoleOptionOwner[] = [
822
+ ...PUBLIC_CALLABLE_ROLES,
888
823
  "analyst",
889
- ] as const satisfies readonly PublicRoleOptionOwner[];
824
+ ];
890
825
 
891
826
  export function optionsForOwner(
892
827
  owner: OptionOwner,
@@ -26,7 +26,7 @@ import {
26
26
  import { readRecordedSubmissionRows } from "../submission-ledger.ts";
27
27
  import { pathContainedIn } from "../activation-ledger-topology.ts";
28
28
  import { pickEngineAxis } from "../package-resources/engine-material.ts";
29
- import { resolveHostAwareSessionAvailability } from "../session-identity.ts";
29
+ import { readStoredHostSessionId, resolveHostAwareSessionAvailability } from "../session-identity.ts";
30
30
  import { rewriteRunDirectoryPathValue } from "../role-run-relocation.ts";
31
31
 
32
32
  import type {
@@ -39,7 +39,7 @@ import type {
39
39
  RoleTurnResult,
40
40
  SessionCustomEntryAppender,
41
41
  } from "../host-contracts.ts";
42
- import { isOfficerReviewSeat } from "../host-contracts.ts";
42
+ import { isOfficerReviewSeat } from "../packaged-role-registry.ts";
43
43
  import { deliverCaseDossierAsAttachment } from "./case-dossier-delivery.ts";
44
44
 
45
45
  /** Original error bytes, never relabeled — a secondary fact riding beside a classified cause. */
@@ -323,6 +323,11 @@ export type PostAdmissionEnv = {
323
323
  * and mint a new run. Absent on ordinary role commands and on `ak-role resume`.
324
324
  */
325
325
  freshSummons?: true;
326
+ /**
327
+ * Typed ticket already carried into this summons (parent board / 起居录).
328
+ * Admission places the run under it. Not a public CLI flag.
329
+ */
330
+ boundTicketNumber?: number;
326
331
  /** Station child role run (#840): omit automatic navigator attendance. */
327
332
  stationChild?: boolean;
328
333
  /**
@@ -1380,6 +1385,30 @@ export function resumeTurnRequestProjectionOptions(
1380
1385
  };
1381
1386
  }
1382
1387
 
1388
+ /** Shared new-turn and in-call auto-resume projection. Seat code supplies prompt and activation. */
1389
+ export function roleTurnOptions(
1390
+ env: PostAdmissionEnv,
1391
+ admitted: { readonly correlationId?: string },
1392
+ continuation: RoleTurnRequest["continuation"],
1393
+ extra?: { readonly cwd?: string },
1394
+ ): RoleTurnRequestProjectionOptions {
1395
+ const correlationId = admitted.correlationId ?? env.correlationId;
1396
+ return {
1397
+ packageRoot: env.packageRoot,
1398
+ home: env.home,
1399
+ agentDir: env.agentDir,
1400
+ ...(env.model === undefined ? {} : { model: env.model }),
1401
+ ...pickEngineAxis(env),
1402
+ ...(env.timeoutMs === undefined ? {} : { timeoutMs: env.timeoutMs }),
1403
+ ...(correlationId === undefined || correlationId.trim() === ""
1404
+ ? {}
1405
+ : { correlationId }),
1406
+ continuation,
1407
+ ...(extra?.cwd === undefined ? {} : { cwd: extra.cwd }),
1408
+ ...(env.stationChild === undefined ? {} : { stationChild: env.stationChild }),
1409
+ };
1410
+ }
1411
+
1383
1412
  /**
1384
1413
  * Build the turn request, then hand off to dispatch. When a writer lease is
1385
1414
  * held, release it if build throws before handoff — dispatch's finally only
@@ -1568,6 +1597,22 @@ export async function runPostAdmissionSeatResume<
1568
1597
  }
1569
1598
 
1570
1599
  let turnRequest = await input.buildTurnRequest(admittedForBuild, request);
1600
+ if (
1601
+ turnRequest.continuation.kind === "resume"
1602
+ && turnRequest.continuation.hostSessionId === undefined
1603
+ ) {
1604
+ const hostSessionId = await readStoredHostSessionId(
1605
+ env.host,
1606
+ env.principalAuthority,
1607
+ admittedForBuild.principal,
1608
+ );
1609
+ if (hostSessionId !== undefined) {
1610
+ turnRequest = {
1611
+ ...turnRequest,
1612
+ continuation: { ...turnRequest.continuation, hostSessionId },
1613
+ };
1614
+ }
1615
+ }
1571
1616
 
1572
1617
  // Open court continue, or new court for summons / message re-review
1573
1618
  // (clause 0 新庭可再交卷; #833). Bare resume without open court omits id.