@sellable/mcp 0.1.686-uat.refill-zero-shot.20260722205242 → 0.1.688-uat.refill-zero-shot.20260722213823

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.
@@ -663,6 +663,15 @@ type WorkspaceExactTarget = {
663
663
  actionTypes: RefillSendsActionType[];
664
664
  actionKey: string | null;
665
665
  };
666
+ type WorkspaceCoordinatorWaitAction = {
667
+ type: string;
668
+ actionKey: string | null;
669
+ activeJobId: string | null;
670
+ campaignId: string | null;
671
+ tableId: string | null;
672
+ senderId: string | null;
673
+ reason: string | null;
674
+ };
666
675
  type RefillSenderSelectorMatch = {
667
676
  selector: string;
668
677
  senderId: string;
@@ -1176,6 +1185,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
1176
1185
  };
1177
1186
  workspaceTargetPlan?: undefined;
1178
1187
  selectedTarget?: undefined;
1188
+ waitAction?: undefined;
1179
1189
  exactTargetPlan?: undefined;
1180
1190
  note?: undefined;
1181
1191
  completedTarget?: undefined;
@@ -1328,6 +1338,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
1328
1338
  workspaceTargetPlan: unknown;
1329
1339
  backgroundJob?: undefined;
1330
1340
  selectedTarget?: undefined;
1341
+ waitAction?: undefined;
1331
1342
  exactTargetPlan?: undefined;
1332
1343
  note?: undefined;
1333
1344
  completedTarget?: undefined;
@@ -1445,6 +1456,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
1445
1456
  selectedTarget: WorkspaceExactTarget;
1446
1457
  backgroundJob?: undefined;
1447
1458
  workspaceTargetPlan?: undefined;
1459
+ waitAction?: undefined;
1448
1460
  exactTargetPlan?: undefined;
1449
1461
  note?: undefined;
1450
1462
  completedTarget?: undefined;
@@ -1564,6 +1576,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
1564
1576
  selectedTarget: WorkspaceExactTarget | null;
1565
1577
  backgroundJob?: undefined;
1566
1578
  workspaceTargetPlan?: undefined;
1579
+ waitAction?: undefined;
1567
1580
  exactTargetPlan?: undefined;
1568
1581
  note?: undefined;
1569
1582
  completedTarget?: undefined;
@@ -1668,6 +1681,167 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
1668
1681
  workspaceId: string | null;
1669
1682
  workspaceResolution: string;
1670
1683
  intent: RefillSendsIntent;
1684
+ } | {
1685
+ readOnly: boolean;
1686
+ status: "in_progress";
1687
+ targetPlan: unknown;
1688
+ coordinator: {
1689
+ scope: string;
1690
+ status: string;
1691
+ waitAction: WorkspaceCoordinatorWaitAction;
1692
+ workspaceTargetPlan: unknown;
1693
+ backgroundJob?: undefined;
1694
+ selectedTarget?: undefined;
1695
+ exactTargetPlan?: undefined;
1696
+ note?: undefined;
1697
+ completedTarget?: undefined;
1698
+ exactRunResult?: undefined;
1699
+ };
1700
+ continuation: {
1701
+ required: boolean;
1702
+ kind: string;
1703
+ owner: string;
1704
+ userActionRequired: boolean;
1705
+ tool: string;
1706
+ arguments: {
1707
+ yolo: boolean;
1708
+ executionMode: "yolo";
1709
+ requireWorkspace: boolean;
1710
+ workspaceId: string;
1711
+ workspaceCoordinator: boolean;
1712
+ senders?: string[];
1713
+ senderIds?: string[];
1714
+ senderNames?: string[];
1715
+ horizonSendDays?: number;
1716
+ untilDate?: string;
1717
+ targetDate?: string;
1718
+ campaignId?: string;
1719
+ tableId?: string;
1720
+ intent?: RefillSendsIntent;
1721
+ approvalMode?: RefillSendsApprovalMode;
1722
+ actionTypes?: RefillSendsActionType[];
1723
+ expectedTargetShapeRevision?: string;
1724
+ expectedActionKey?: string;
1725
+ runId?: string;
1726
+ fence?: number;
1727
+ runHandle?: RefillRunHandleV1;
1728
+ targetConfig?: RefillTargetConfigV1;
1729
+ reportingContext?: RefillReportingContextV2;
1730
+ messageTemplateRevision?: MessageTemplateRevisionV1;
1731
+ agentKeywords?: string[];
1732
+ /**
1733
+ * Internal background-wait fast-path handle minted by a waiting_background
1734
+ * continuation. When present, the coordinator probes the named preparation
1735
+ * job's compact status (~2s) first and skips the full workspace replan while
1736
+ * the job is still actively working inside the bounded deadline — a
1737
+ * read-only optimization; every settled transition still passes through a
1738
+ * complete authoritative replan before any next primitive.
1739
+ */
1740
+ backgroundWait?: {
1741
+ jobId: string;
1742
+ campaignId?: string | null;
1743
+ tableId?: string | null;
1744
+ deadlineAt?: string | null;
1745
+ } | null;
1746
+ /**
1747
+ * Internal immutable sender waterfall chosen by the first workspace plan.
1748
+ * Packaged continuations echo it so later exact runs cannot re-rank campaigns
1749
+ * from side effects produced earlier in the same refill command.
1750
+ */
1751
+ workspaceRunState?: Record<string, unknown>;
1752
+ };
1753
+ stopCondition: string;
1754
+ renderBeforeInvoke?: undefined;
1755
+ retryAfterMs?: undefined;
1756
+ };
1757
+ targetDate: string | null;
1758
+ untilDate: string | null;
1759
+ horizonSendDays: number | null;
1760
+ fillWindow: {
1761
+ mode: string;
1762
+ targetDate: string;
1763
+ description: string;
1764
+ untilDate?: undefined;
1765
+ horizonSendDays?: undefined;
1766
+ horizonHours?: undefined;
1767
+ } | {
1768
+ mode: string;
1769
+ untilDate: string;
1770
+ description: string;
1771
+ targetDate?: undefined;
1772
+ horizonSendDays?: undefined;
1773
+ horizonHours?: undefined;
1774
+ } | {
1775
+ mode: string;
1776
+ horizonSendDays: number | null;
1777
+ horizonHours: number | null;
1778
+ description: string;
1779
+ targetDate?: undefined;
1780
+ untilDate?: undefined;
1781
+ };
1782
+ approvalMode: RefillSendsApprovalMode;
1783
+ campaignId: string | null;
1784
+ tableId: string | null;
1785
+ targetConfig: RefillTargetConfigV1 | null;
1786
+ runHandle: RefillRunHandleV1 | null;
1787
+ reportingContext: RefillReportingContextV2 | null;
1788
+ messageTemplateRevision: MessageTemplateRevisionV1 | null;
1789
+ senderScope: string;
1790
+ senderSelectors: {
1791
+ senders: string[];
1792
+ senderIds: string[];
1793
+ senderNames: string[];
1794
+ };
1795
+ firstOperationalSteps: string[];
1796
+ approvalContract: string;
1797
+ forbiddenActions: string[];
1798
+ hostExamples: {
1799
+ claude: string[];
1800
+ codex: string[];
1801
+ mcpTool: {
1802
+ name: string;
1803
+ arguments: {
1804
+ workspaceRunState?: Record<string, unknown> | undefined;
1805
+ workspaceCoordinator?: boolean | undefined;
1806
+ messageTemplateRevision?: MessageTemplateRevisionV1 | undefined;
1807
+ reportingContext?: RefillReportingContextV2 | undefined;
1808
+ targetConfig?: RefillTargetConfigV1 | undefined;
1809
+ runHandle?: RefillRunHandleV1 | undefined;
1810
+ fence?: number | undefined;
1811
+ runId?: string | undefined;
1812
+ expectedActionKey?: string | undefined;
1813
+ expectedTargetShapeRevision?: string | undefined;
1814
+ targetDate: string | null;
1815
+ untilDate: string | null;
1816
+ horizonSendDays: number | null;
1817
+ campaignId: string | undefined;
1818
+ tableId: string | undefined;
1819
+ intent: RefillSendsIntent;
1820
+ approvalMode: RefillSendsApprovalMode;
1821
+ workspaceId: string | null;
1822
+ actionTypes?: ("send_invite" | "send_inmail_closed")[] | undefined;
1823
+ yolo: boolean;
1824
+ senders: string[];
1825
+ senderIds: string[];
1826
+ senderNames: string[];
1827
+ };
1828
+ };
1829
+ };
1830
+ actionTypes?: ("send_invite" | "send_inmail_closed")[] | undefined;
1831
+ command: string;
1832
+ tool: string;
1833
+ promptName: string;
1834
+ workflowPromptName: string;
1835
+ workflowAsset: {
1836
+ subskillName: string;
1837
+ assetPath: string;
1838
+ expectedVersion: string;
1839
+ };
1840
+ yolo: boolean;
1841
+ executionMode: RefillSendsExecutionMode;
1842
+ workspaceId: string | null;
1843
+ workspaceResolution: string;
1844
+ intent: RefillSendsIntent;
1671
1845
  } | {
1672
1846
  readOnly: boolean;
1673
1847
  ok: boolean;
@@ -1796,6 +1970,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
1796
1970
  workspaceTargetPlan: unknown;
1797
1971
  exactTargetPlan: unknown;
1798
1972
  backgroundJob?: undefined;
1973
+ waitAction?: undefined;
1799
1974
  note?: undefined;
1800
1975
  completedTarget?: undefined;
1801
1976
  exactRunResult?: undefined;
@@ -1956,6 +2131,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
1956
2131
  workspaceTargetPlan: unknown;
1957
2132
  backgroundJob?: undefined;
1958
2133
  selectedTarget?: undefined;
2134
+ waitAction?: undefined;
1959
2135
  exactTargetPlan?: undefined;
1960
2136
  note?: undefined;
1961
2137
  completedTarget?: undefined;
@@ -1965,12 +2141,146 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
1965
2141
  required: boolean;
1966
2142
  userActionRequired: boolean;
1967
2143
  renderBeforeInvoke?: undefined;
1968
- kind?: undefined;
1969
- tool?: undefined;
1970
- arguments?: undefined;
1971
- owner?: undefined;
2144
+ kind?: undefined;
2145
+ tool?: undefined;
2146
+ arguments?: undefined;
2147
+ owner?: undefined;
2148
+ retryAfterMs?: undefined;
2149
+ stopCondition?: undefined;
2150
+ };
2151
+ targetDate: string | null;
2152
+ untilDate: string | null;
2153
+ horizonSendDays: number | null;
2154
+ fillWindow: {
2155
+ mode: string;
2156
+ targetDate: string;
2157
+ description: string;
2158
+ untilDate?: undefined;
2159
+ horizonSendDays?: undefined;
2160
+ horizonHours?: undefined;
2161
+ } | {
2162
+ mode: string;
2163
+ untilDate: string;
2164
+ description: string;
2165
+ targetDate?: undefined;
2166
+ horizonSendDays?: undefined;
2167
+ horizonHours?: undefined;
2168
+ } | {
2169
+ mode: string;
2170
+ horizonSendDays: number | null;
2171
+ horizonHours: number | null;
2172
+ description: string;
2173
+ targetDate?: undefined;
2174
+ untilDate?: undefined;
2175
+ };
2176
+ approvalMode: RefillSendsApprovalMode;
2177
+ campaignId: string | null;
2178
+ tableId: string | null;
2179
+ targetConfig: RefillTargetConfigV1 | null;
2180
+ runHandle: RefillRunHandleV1 | null;
2181
+ reportingContext: RefillReportingContextV2 | null;
2182
+ messageTemplateRevision: MessageTemplateRevisionV1 | null;
2183
+ senderScope: string;
2184
+ senderSelectors: {
2185
+ senders: string[];
2186
+ senderIds: string[];
2187
+ senderNames: string[];
2188
+ };
2189
+ firstOperationalSteps: string[];
2190
+ approvalContract: string;
2191
+ forbiddenActions: string[];
2192
+ hostExamples: {
2193
+ claude: string[];
2194
+ codex: string[];
2195
+ mcpTool: {
2196
+ name: string;
2197
+ arguments: {
2198
+ workspaceRunState?: Record<string, unknown> | undefined;
2199
+ workspaceCoordinator?: boolean | undefined;
2200
+ messageTemplateRevision?: MessageTemplateRevisionV1 | undefined;
2201
+ reportingContext?: RefillReportingContextV2 | undefined;
2202
+ targetConfig?: RefillTargetConfigV1 | undefined;
2203
+ runHandle?: RefillRunHandleV1 | undefined;
2204
+ fence?: number | undefined;
2205
+ runId?: string | undefined;
2206
+ expectedActionKey?: string | undefined;
2207
+ expectedTargetShapeRevision?: string | undefined;
2208
+ targetDate: string | null;
2209
+ untilDate: string | null;
2210
+ horizonSendDays: number | null;
2211
+ campaignId: string | undefined;
2212
+ tableId: string | undefined;
2213
+ intent: RefillSendsIntent;
2214
+ approvalMode: RefillSendsApprovalMode;
2215
+ workspaceId: string | null;
2216
+ actionTypes?: ("send_invite" | "send_inmail_closed")[] | undefined;
2217
+ yolo: boolean;
2218
+ senders: string[];
2219
+ senderIds: string[];
2220
+ senderNames: string[];
2221
+ };
2222
+ };
2223
+ };
2224
+ actionTypes?: ("send_invite" | "send_inmail_closed")[] | undefined;
2225
+ command: string;
2226
+ tool: string;
2227
+ promptName: string;
2228
+ workflowPromptName: string;
2229
+ workflowAsset: {
2230
+ subskillName: string;
2231
+ assetPath: string;
2232
+ expectedVersion: string;
2233
+ };
2234
+ yolo: boolean;
2235
+ executionMode: RefillSendsExecutionMode;
2236
+ workspaceId: string | null;
2237
+ workspaceResolution: string;
2238
+ intent: RefillSendsIntent;
2239
+ } | {
2240
+ status: "in_progress";
2241
+ targetPlan: unknown;
2242
+ orchestration: {
2243
+ mode: string;
2244
+ scope: string;
2245
+ checkpointedFields: string[];
2246
+ transportBudgetMs: number;
2247
+ phase?: undefined;
2248
+ };
2249
+ coordinator: {
2250
+ scope: string;
2251
+ status: string;
2252
+ waitAction: WorkspaceCoordinatorWaitAction;
2253
+ workspaceTargetPlan: unknown;
2254
+ backgroundJob?: undefined;
2255
+ selectedTarget?: undefined;
2256
+ exactTargetPlan?: undefined;
2257
+ note?: undefined;
2258
+ completedTarget?: undefined;
2259
+ exactRunResult?: undefined;
2260
+ };
2261
+ continuation: {
2262
+ required: boolean;
2263
+ kind: string;
2264
+ owner: string;
2265
+ userActionRequired: boolean;
2266
+ tool: string;
2267
+ arguments: {
2268
+ approvalMode: RefillSendsApprovalMode;
2269
+ workspaceCoordinator: boolean;
2270
+ horizonSendDays?: number | undefined;
2271
+ untilDate?: string | undefined;
2272
+ targetDate?: string | undefined;
2273
+ actionTypes?: ("send_invite" | "send_inmail_closed")[] | undefined;
2274
+ yolo: boolean;
2275
+ executionMode: "yolo";
2276
+ requireWorkspace: boolean;
2277
+ workspaceId: string;
2278
+ intent: RefillSendsIntent;
2279
+ senderIds: string[];
2280
+ };
2281
+ stopCondition: string;
2282
+ renderBeforeInvoke?: undefined;
1972
2283
  retryAfterMs?: undefined;
1973
- stopCondition?: undefined;
1974
2284
  };
1975
2285
  targetDate: string | null;
1976
2286
  untilDate: string | null;
@@ -2081,6 +2391,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
2081
2391
  exactTargetPlan: unknown;
2082
2392
  note: string;
2083
2393
  backgroundJob?: undefined;
2394
+ waitAction?: undefined;
2084
2395
  completedTarget?: undefined;
2085
2396
  exactRunResult?: undefined;
2086
2397
  };
@@ -2203,6 +2514,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
2203
2514
  exactTargetPlan: unknown;
2204
2515
  note: string;
2205
2516
  backgroundJob?: undefined;
2517
+ waitAction?: undefined;
2206
2518
  completedTarget?: undefined;
2207
2519
  exactRunResult?: undefined;
2208
2520
  };
@@ -2352,6 +2664,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
2352
2664
  selectedTarget: WorkspaceExactTarget | null;
2353
2665
  backgroundJob?: undefined;
2354
2666
  workspaceTargetPlan?: undefined;
2667
+ waitAction?: undefined;
2355
2668
  exactTargetPlan?: undefined;
2356
2669
  note?: undefined;
2357
2670
  completedTarget?: undefined;
@@ -2667,6 +2980,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
2667
2980
  };
2668
2981
  backgroundJob?: undefined;
2669
2982
  selectedTarget?: undefined;
2983
+ waitAction?: undefined;
2670
2984
  exactTargetPlan?: undefined;
2671
2985
  note?: undefined;
2672
2986
  };
@@ -2893,6 +3207,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
2893
3207
  };
2894
3208
  backgroundJob?: undefined;
2895
3209
  selectedTarget?: undefined;
3210
+ waitAction?: undefined;
2896
3211
  exactTargetPlan?: undefined;
2897
3212
  note?: undefined;
2898
3213
  };
@@ -3123,6 +3438,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
3123
3438
  };
3124
3439
  backgroundJob?: undefined;
3125
3440
  selectedTarget?: undefined;
3441
+ waitAction?: undefined;
3126
3442
  exactTargetPlan?: undefined;
3127
3443
  note?: undefined;
3128
3444
  };
@@ -3353,6 +3669,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
3353
3669
  };
3354
3670
  backgroundJob?: undefined;
3355
3671
  selectedTarget?: undefined;
3672
+ waitAction?: undefined;
3356
3673
  exactTargetPlan?: undefined;
3357
3674
  note?: undefined;
3358
3675
  };
@@ -3581,6 +3898,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
3581
3898
  };
3582
3899
  backgroundJob?: undefined;
3583
3900
  selectedTarget?: undefined;
3901
+ waitAction?: undefined;
3584
3902
  exactTargetPlan?: undefined;
3585
3903
  note?: undefined;
3586
3904
  };
@@ -3812,6 +4130,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
3812
4130
  };
3813
4131
  backgroundJob?: undefined;
3814
4132
  selectedTarget?: undefined;
4133
+ waitAction?: undefined;
3815
4134
  exactTargetPlan?: undefined;
3816
4135
  note?: undefined;
3817
4136
  };
@@ -4045,6 +4364,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
4045
4364
  };
4046
4365
  backgroundJob?: undefined;
4047
4366
  selectedTarget?: undefined;
4367
+ waitAction?: undefined;
4048
4368
  exactTargetPlan?: undefined;
4049
4369
  note?: undefined;
4050
4370
  };
@@ -4159,6 +4479,243 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
4159
4479
  workspaceId: string | null;
4160
4480
  workspaceResolution: string;
4161
4481
  intent: RefillSendsIntent;
4482
+ } | {
4483
+ status: "in_progress";
4484
+ targetPlan: unknown;
4485
+ orchestration: {
4486
+ mode: string;
4487
+ scope: string;
4488
+ checkpointedFields: string[];
4489
+ transportBudgetMs: number;
4490
+ phase?: undefined;
4491
+ };
4492
+ coordinator: {
4493
+ scope: string;
4494
+ status: string;
4495
+ completedTarget: WorkspaceExactTarget | null;
4496
+ waitAction: WorkspaceCoordinatorWaitAction;
4497
+ workspaceTargetPlan: unknown;
4498
+ exactRunResult: {
4499
+ status: "blocked";
4500
+ blocker: string;
4501
+ guidance: string;
4502
+ conflicts: string[];
4503
+ runId: string | undefined;
4504
+ readOnly: boolean;
4505
+ forbiddenActions: string[];
4506
+ boundedAuthority: string;
4507
+ } | {
4508
+ readOnly: boolean;
4509
+ mode: string;
4510
+ forbiddenActions: string[];
4511
+ boundedAuthority: string;
4512
+ blocker: string;
4513
+ workspaceId: string;
4514
+ guidance: string;
4515
+ warnings: string[];
4516
+ journalPath: string | null;
4517
+ text: string;
4518
+ workspaceResolution: string;
4519
+ status?: undefined;
4520
+ conflicts?: undefined;
4521
+ runId?: undefined;
4522
+ } | {
4523
+ readOnly: boolean;
4524
+ mode: string;
4525
+ forbiddenActions: string[];
4526
+ boundedAuthority: string;
4527
+ warnings: any[];
4528
+ journalPath: string | null;
4529
+ text: string;
4530
+ workspaceId: string;
4531
+ workspaceResolution: string;
4532
+ blocker?: undefined;
4533
+ guidance?: undefined;
4534
+ status?: undefined;
4535
+ conflicts?: undefined;
4536
+ runId?: undefined;
4537
+ } | {
4538
+ runSnapshot: unknown;
4539
+ readOnly: boolean;
4540
+ forbiddenActions: string[];
4541
+ boundedAuthority: string;
4542
+ status: "dry_run";
4543
+ plan: Record<string, unknown>;
4544
+ blocker?: undefined;
4545
+ guidance?: undefined;
4546
+ conflicts?: undefined;
4547
+ runId?: undefined;
4548
+ } | {
4549
+ runSnapshot: unknown;
4550
+ readOnly: boolean;
4551
+ forbiddenActions: string[];
4552
+ boundedAuthority: string;
4553
+ status: "in_progress";
4554
+ runId: string;
4555
+ fence: number;
4556
+ gate: import("../refill-run-loop.js").RefillLoopGate;
4557
+ guidance: string;
4558
+ journalPath?: string | null;
4559
+ targetConfig?: RefillTargetConfigV1;
4560
+ runHandle?: RefillRunHandleV1;
4561
+ refillReporting?: Record<string, unknown>;
4562
+ blocker?: undefined;
4563
+ conflicts?: undefined;
4564
+ } | {
4565
+ runSnapshot: unknown;
4566
+ readOnly: boolean;
4567
+ forbiddenActions: string[];
4568
+ boundedAuthority: string;
4569
+ status: "blocked";
4570
+ blocker: string;
4571
+ runId?: string;
4572
+ fence?: number;
4573
+ gate?: import("../refill-run-loop.js").RefillLoopGate;
4574
+ guidance: string;
4575
+ holderRunId?: string;
4576
+ report?: Record<string, unknown>;
4577
+ journalPath?: string | null;
4578
+ targetConfig?: RefillTargetConfigV1;
4579
+ runHandle?: RefillRunHandleV1;
4580
+ refillReporting?: Record<string, unknown>;
4581
+ conflicts?: undefined;
4582
+ } | {
4583
+ runSnapshot: unknown;
4584
+ readOnly: boolean;
4585
+ forbiddenActions: string[];
4586
+ boundedAuthority: string;
4587
+ status: "terminal";
4588
+ doneReason: string;
4589
+ report: Record<string, unknown>;
4590
+ runId: string;
4591
+ guidance?: string;
4592
+ journalPath?: string | null;
4593
+ targetConfig?: RefillTargetConfigV1;
4594
+ runHandle?: RefillRunHandleV1;
4595
+ refillReporting?: Record<string, unknown>;
4596
+ blocker?: undefined;
4597
+ conflicts?: undefined;
4598
+ };
4599
+ backgroundJob?: undefined;
4600
+ selectedTarget?: undefined;
4601
+ exactTargetPlan?: undefined;
4602
+ note?: undefined;
4603
+ };
4604
+ continuation: {
4605
+ required: boolean;
4606
+ kind: string;
4607
+ owner: string;
4608
+ userActionRequired: boolean;
4609
+ tool: string;
4610
+ arguments: {
4611
+ workspaceRunState?: Record<string, unknown> | {
4612
+ coordinatorBlockedExactTargets: (Record<string, unknown> | null)[];
4613
+ } | undefined;
4614
+ workspaceCoordinator?: boolean | undefined;
4615
+ approvalMode: RefillSendsApprovalMode;
4616
+ horizonSendDays?: number | undefined;
4617
+ untilDate?: string | undefined;
4618
+ targetDate?: string | undefined;
4619
+ actionTypes?: ("send_invite" | "send_inmail_closed")[] | undefined;
4620
+ yolo: boolean;
4621
+ executionMode: "yolo";
4622
+ requireWorkspace: boolean;
4623
+ workspaceId: string;
4624
+ intent: RefillSendsIntent;
4625
+ senderIds: string[];
4626
+ };
4627
+ stopCondition: string;
4628
+ renderBeforeInvoke?: undefined;
4629
+ retryAfterMs?: undefined;
4630
+ };
4631
+ targetDate: string | null;
4632
+ untilDate: string | null;
4633
+ horizonSendDays: number | null;
4634
+ fillWindow: {
4635
+ mode: string;
4636
+ targetDate: string;
4637
+ description: string;
4638
+ untilDate?: undefined;
4639
+ horizonSendDays?: undefined;
4640
+ horizonHours?: undefined;
4641
+ } | {
4642
+ mode: string;
4643
+ untilDate: string;
4644
+ description: string;
4645
+ targetDate?: undefined;
4646
+ horizonSendDays?: undefined;
4647
+ horizonHours?: undefined;
4648
+ } | {
4649
+ mode: string;
4650
+ horizonSendDays: number | null;
4651
+ horizonHours: number | null;
4652
+ description: string;
4653
+ targetDate?: undefined;
4654
+ untilDate?: undefined;
4655
+ };
4656
+ approvalMode: RefillSendsApprovalMode;
4657
+ campaignId: string | null;
4658
+ tableId: string | null;
4659
+ targetConfig: RefillTargetConfigV1 | null;
4660
+ runHandle: RefillRunHandleV1 | null;
4661
+ reportingContext: RefillReportingContextV2 | null;
4662
+ messageTemplateRevision: MessageTemplateRevisionV1 | null;
4663
+ senderScope: string;
4664
+ senderSelectors: {
4665
+ senders: string[];
4666
+ senderIds: string[];
4667
+ senderNames: string[];
4668
+ };
4669
+ firstOperationalSteps: string[];
4670
+ approvalContract: string;
4671
+ forbiddenActions: string[];
4672
+ hostExamples: {
4673
+ claude: string[];
4674
+ codex: string[];
4675
+ mcpTool: {
4676
+ name: string;
4677
+ arguments: {
4678
+ workspaceRunState?: Record<string, unknown> | undefined;
4679
+ workspaceCoordinator?: boolean | undefined;
4680
+ messageTemplateRevision?: MessageTemplateRevisionV1 | undefined;
4681
+ reportingContext?: RefillReportingContextV2 | undefined;
4682
+ targetConfig?: RefillTargetConfigV1 | undefined;
4683
+ runHandle?: RefillRunHandleV1 | undefined;
4684
+ fence?: number | undefined;
4685
+ runId?: string | undefined;
4686
+ expectedActionKey?: string | undefined;
4687
+ expectedTargetShapeRevision?: string | undefined;
4688
+ targetDate: string | null;
4689
+ untilDate: string | null;
4690
+ horizonSendDays: number | null;
4691
+ campaignId: string | undefined;
4692
+ tableId: string | undefined;
4693
+ intent: RefillSendsIntent;
4694
+ approvalMode: RefillSendsApprovalMode;
4695
+ workspaceId: string | null;
4696
+ actionTypes?: ("send_invite" | "send_inmail_closed")[] | undefined;
4697
+ yolo: boolean;
4698
+ senders: string[];
4699
+ senderIds: string[];
4700
+ senderNames: string[];
4701
+ };
4702
+ };
4703
+ };
4704
+ actionTypes?: ("send_invite" | "send_inmail_closed")[] | undefined;
4705
+ command: string;
4706
+ tool: string;
4707
+ promptName: string;
4708
+ workflowPromptName: string;
4709
+ workflowAsset: {
4710
+ subskillName: string;
4711
+ assetPath: string;
4712
+ expectedVersion: string;
4713
+ };
4714
+ yolo: boolean;
4715
+ executionMode: RefillSendsExecutionMode;
4716
+ workspaceId: string | null;
4717
+ workspaceResolution: string;
4718
+ intent: RefillSendsIntent;
4162
4719
  } | {
4163
4720
  status: "terminal";
4164
4721
  doneReason: "loaded_awaiting_scheduler";
@@ -4282,6 +4839,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
4282
4839
  };
4283
4840
  note: string;
4284
4841
  backgroundJob?: undefined;
4842
+ waitAction?: undefined;
4285
4843
  };
4286
4844
  continuation: {
4287
4845
  required: boolean;
@@ -4511,6 +5069,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
4511
5069
  };
4512
5070
  note: string;
4513
5071
  backgroundJob?: undefined;
5072
+ waitAction?: undefined;
4514
5073
  };
4515
5074
  continuation: {
4516
5075
  required: boolean;
@@ -4744,6 +5303,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
4744
5303
  };
4745
5304
  note: string;
4746
5305
  backgroundJob?: undefined;
5306
+ waitAction?: undefined;
4747
5307
  };
4748
5308
  continuation: {
4749
5309
  required: boolean;
@@ -4977,6 +5537,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
4977
5537
  };
4978
5538
  note: string;
4979
5539
  backgroundJob?: undefined;
5540
+ waitAction?: undefined;
4980
5541
  };
4981
5542
  continuation: {
4982
5543
  required: boolean;
@@ -5208,6 +5769,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
5208
5769
  };
5209
5770
  note: string;
5210
5771
  backgroundJob?: undefined;
5772
+ waitAction?: undefined;
5211
5773
  };
5212
5774
  continuation: {
5213
5775
  required: boolean;
@@ -5442,6 +6004,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
5442
6004
  };
5443
6005
  note: string;
5444
6006
  backgroundJob?: undefined;
6007
+ waitAction?: undefined;
5445
6008
  };
5446
6009
  continuation: {
5447
6010
  required: boolean;
@@ -5678,6 +6241,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
5678
6241
  };
5679
6242
  note: string;
5680
6243
  backgroundJob?: undefined;
6244
+ waitAction?: undefined;
5681
6245
  };
5682
6246
  continuation: {
5683
6247
  required: boolean;
@@ -5911,6 +6475,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
5911
6475
  };
5912
6476
  note: string;
5913
6477
  backgroundJob?: undefined;
6478
+ waitAction?: undefined;
5914
6479
  };
5915
6480
  continuation: {
5916
6481
  required: boolean;
@@ -6140,6 +6705,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
6140
6705
  };
6141
6706
  note: string;
6142
6707
  backgroundJob?: undefined;
6708
+ waitAction?: undefined;
6143
6709
  };
6144
6710
  continuation: {
6145
6711
  required: boolean;
@@ -6373,6 +6939,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
6373
6939
  };
6374
6940
  note: string;
6375
6941
  backgroundJob?: undefined;
6942
+ waitAction?: undefined;
6376
6943
  };
6377
6944
  continuation: {
6378
6945
  required: boolean;
@@ -6606,6 +7173,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
6606
7173
  };
6607
7174
  note: string;
6608
7175
  backgroundJob?: undefined;
7176
+ waitAction?: undefined;
6609
7177
  };
6610
7178
  continuation: {
6611
7179
  required: boolean;
@@ -6837,6 +7405,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
6837
7405
  };
6838
7406
  note: string;
6839
7407
  backgroundJob?: undefined;
7408
+ waitAction?: undefined;
6840
7409
  };
6841
7410
  continuation: {
6842
7411
  required: boolean;
@@ -7071,6 +7640,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
7071
7640
  };
7072
7641
  note: string;
7073
7642
  backgroundJob?: undefined;
7643
+ waitAction?: undefined;
7074
7644
  };
7075
7645
  continuation: {
7076
7646
  required: boolean;
@@ -7307,6 +7877,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
7307
7877
  };
7308
7878
  note: string;
7309
7879
  backgroundJob?: undefined;
7880
+ waitAction?: undefined;
7310
7881
  };
7311
7882
  continuation: {
7312
7883
  required: boolean;
@@ -7535,6 +8106,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
7535
8106
  };
7536
8107
  backgroundJob?: undefined;
7537
8108
  workspaceTargetPlan?: undefined;
8109
+ waitAction?: undefined;
7538
8110
  exactTargetPlan?: undefined;
7539
8111
  note?: undefined;
7540
8112
  };
@@ -7758,6 +8330,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
7758
8330
  };
7759
8331
  backgroundJob?: undefined;
7760
8332
  workspaceTargetPlan?: undefined;
8333
+ waitAction?: undefined;
7761
8334
  exactTargetPlan?: undefined;
7762
8335
  note?: undefined;
7763
8336
  };
@@ -7931,6 +8504,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
7931
8504
  status: string | undefined;
7932
8505
  selectedTarget: WorkspaceExactTarget | null;
7933
8506
  backgroundJob?: undefined;
8507
+ waitAction?: undefined;
7934
8508
  note?: undefined;
7935
8509
  completedTarget?: undefined;
7936
8510
  exactRunResult?: undefined;
@@ -8091,6 +8665,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
8091
8665
  status: string | undefined;
8092
8666
  selectedTarget: WorkspaceExactTarget | null;
8093
8667
  backgroundJob?: undefined;
8668
+ waitAction?: undefined;
8094
8669
  note?: undefined;
8095
8670
  completedTarget?: undefined;
8096
8671
  exactRunResult?: undefined;
@@ -8255,6 +8830,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
8255
8830
  status: string | undefined;
8256
8831
  selectedTarget: WorkspaceExactTarget | null;
8257
8832
  backgroundJob?: undefined;
8833
+ waitAction?: undefined;
8258
8834
  note?: undefined;
8259
8835
  completedTarget?: undefined;
8260
8836
  exactRunResult?: undefined;
@@ -8419,6 +8995,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
8419
8995
  status: string | undefined;
8420
8996
  selectedTarget: WorkspaceExactTarget | null;
8421
8997
  backgroundJob?: undefined;
8998
+ waitAction?: undefined;
8422
8999
  note?: undefined;
8423
9000
  completedTarget?: undefined;
8424
9001
  exactRunResult?: undefined;
@@ -8581,6 +9158,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
8581
9158
  status: string | undefined;
8582
9159
  selectedTarget: WorkspaceExactTarget | null;
8583
9160
  backgroundJob?: undefined;
9161
+ waitAction?: undefined;
8584
9162
  note?: undefined;
8585
9163
  completedTarget?: undefined;
8586
9164
  exactRunResult?: undefined;
@@ -8746,6 +9324,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
8746
9324
  status: string | undefined;
8747
9325
  selectedTarget: WorkspaceExactTarget | null;
8748
9326
  backgroundJob?: undefined;
9327
+ waitAction?: undefined;
8749
9328
  note?: undefined;
8750
9329
  completedTarget?: undefined;
8751
9330
  exactRunResult?: undefined;
@@ -8913,6 +9492,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
8913
9492
  status: string | undefined;
8914
9493
  selectedTarget: WorkspaceExactTarget | null;
8915
9494
  backgroundJob?: undefined;
9495
+ waitAction?: undefined;
8916
9496
  note?: undefined;
8917
9497
  completedTarget?: undefined;
8918
9498
  exactRunResult?: undefined;
@@ -442,7 +442,7 @@ function buildRefillSendsCommand(input) {
442
442
  : `, horizonSendDays: ${horizonSendDays}`}, approvalMode: "${approvalMode}" }) before any import, prep, approval, start, or schedule-affecting action.`,
443
443
  "Render target.eligibleSenderLedger and target.senderRefillPlans before mutation. Preserve the coverage labels Need to prepare, Goal, Already sent, Scheduled, Ready and waiting to be scheduled, Still need to schedule, and Still need to prepare. Never render an unlabeled Still need value.",
444
444
  "Use target.globalActionQueue as the only cross-sender yolo queue: execute only target.globalActionQueue[0], rerun get_refill_target_plan, and continue inside the same --yolo invocation until scheduler-projected coverage fills or a concrete blocker appears.",
445
- "The public --yolo command is transport-bounded. If refill_sends returns status:in_progress, immediately invoke its exact continuation.arguments. kind:active_exact_run preserves targetConfig plus runId/fence for the active fence; kind:next_exact_target preserves the workspace envelope plus the next preflighted targetConfig and intentionally has no prior runId/fence. A terminal loaded_awaiting_scheduler result with coordinator.status loaded_awaiting_scheduler is valid only after all remaining exact targets are complete or scheduler-owned and workspace remainingReadyOrProjectedGap is zero; it has no continuation. Continue automatically inside this one user command; never ask the user to type continue and never start a second run while a fence is active.",
445
+ "The public --yolo command is transport-bounded. If refill_sends returns status:in_progress, immediately invoke its exact continuation.arguments. kind:active_exact_run preserves targetConfig plus runId/fence for the active fence; kind:next_exact_target preserves the workspace envelope plus the next preflighted targetConfig and intentionally has no prior runId/fence; kind:workspace_wait preserves the workspace envelope while coordinator.waitAction names in-flight preparation/import work — honor the wait cadence (about 30 seconds, or the receipt's wait.deadlineAt) and then re-invoke the same arguments. A terminal loaded_awaiting_scheduler result with coordinator.status loaded_awaiting_scheduler is valid only after all remaining exact targets are complete or scheduler-owned and workspace remainingReadyOrProjectedGap is zero; it has no continuation. Continue automatically inside this one user command; never ask the user to type continue and never start a second run while a fence is active.",
446
446
  "When expectedTargetShapeRevision or expectedActionKey is supplied from an already rendered packet, compare both against the first fresh target plan before paid-credit refresh or any primitive. Return approval_scope_changed with the fresh packet on mismatch.",
447
447
  "Read target.senderRefillPlans[].refillReceipt as the public ladder receipt: it carries the selected campaign/sender/lane summary, skippedRungs, existingRowFrontier, and any absolute wait.deadlineAt. Do not choose source/copy/fallback work until that receipt proves the earlier ready/prep/approval rungs are exhausted.",
448
448
  "If get_refill_target_plan returns status complete, report eligible sender ledger, target.senderRefillPlans, gross target, selected days, sent count, scheduled count, projected count, campaign ids, targetShapeRevision, and no-op proof without asking for approval.",
@@ -931,6 +931,34 @@ function coordinatorDeferredBlocker(runState) {
931
931
  ? "loaded_awaiting_scheduler"
932
932
  : null;
933
933
  }
934
+ // Active-work waits only. wait_for_scheduler stays scheduler-owned and may
935
+ // still terminalize as loaded_awaiting_scheduler; in-flight preparation or
936
+ // source-import work must instead keep the workspace loop alive because the
937
+ // plan will change when that work settles.
938
+ const WORKSPACE_ACTIVE_WORK_WAIT_TYPE_SET = new Set([
939
+ "wait_for_active_work",
940
+ "wait_for_source_import",
941
+ ]);
942
+ function workspaceActiveWorkWaitAction(actions) {
943
+ for (const action of actions) {
944
+ const type = stringValue(action.type);
945
+ if (!type || !WORKSPACE_ACTIVE_WORK_WAIT_TYPE_SET.has(type))
946
+ continue;
947
+ const ids = recordValue(action.ids);
948
+ return {
949
+ type,
950
+ actionKey: stringValue(action.actionKey) ?? null,
951
+ activeJobId: stringValue(ids?.activeJobId) ??
952
+ stringValue(action.activeJobId) ??
953
+ null,
954
+ campaignId: stringValue(ids?.campaignId) ?? stringValue(action.campaignId) ?? null,
955
+ tableId: stringValue(ids?.tableId) ?? stringValue(action.tableId) ?? null,
956
+ senderId: stringValue(ids?.senderId) ?? stringValue(action.senderId) ?? null,
957
+ reason: stringValue(action.reason) ?? null,
958
+ };
959
+ }
960
+ return null;
961
+ }
934
962
  async function selectWorkspaceExactTarget(input, workspacePlanOverride, options = {}) {
935
963
  let workspaceInput = workspaceCoordinatorInput(input);
936
964
  let workspacePlan = workspacePlanOverride ??
@@ -982,7 +1010,12 @@ async function selectWorkspaceExactTarget(input, workspacePlanOverride, options
982
1010
  workspacePlan,
983
1011
  };
984
1012
  }
985
- if (queueHead && workspaceExactTargetsFromAction(queueHead).length === 0) {
1013
+ // Planner wait actions for in-flight work legitimately carry no
1014
+ // exactTargets contract; they must bind as a workspace wait instead of
1015
+ // failing the head-contract check or the exhausted-target fallthrough.
1016
+ if (queueHead &&
1017
+ !workspaceActiveWorkWaitAction([queueHead]) &&
1018
+ workspaceExactTargetsFromAction(queueHead).length === 0) {
986
1019
  return {
987
1020
  status: "blocked",
988
1021
  code: "workspace_exact_target_contract_missing",
@@ -1011,6 +1044,14 @@ async function selectWorkspaceExactTarget(input, workspacePlanOverride, options
1011
1044
  !prefilterBlockedTargets.some((blocked) => coordinatorBlockedExactTargetMatches(blocked, candidate)));
1012
1045
  });
1013
1046
  if (targetCandidates.length === 0) {
1047
+ const pendingWaitAction = workspaceActiveWorkWaitAction(workspaceActions);
1048
+ if (pendingWaitAction) {
1049
+ return {
1050
+ status: "waiting",
1051
+ waitAction: pendingWaitAction,
1052
+ workspacePlan,
1053
+ };
1054
+ }
1014
1055
  if (newCampaignCandidate) {
1015
1056
  return {
1016
1057
  status: "blocked",
@@ -1167,6 +1208,14 @@ async function selectWorkspaceExactTarget(input, workspacePlanOverride, options
1167
1208
  note: "Every currently exposed exact target is already owned by durable background work. No mutation fence was opened; wait briefly and replan the workspace read-only.",
1168
1209
  };
1169
1210
  }
1211
+ const pendingWaitAction = workspaceActiveWorkWaitAction(workspaceActions);
1212
+ if (pendingWaitAction) {
1213
+ return {
1214
+ status: "waiting",
1215
+ waitAction: pendingWaitAction,
1216
+ workspacePlan,
1217
+ };
1218
+ }
1170
1219
  const workspaceCoverage = yoloCoverage(workspacePlan);
1171
1220
  // The workspace-level gap is lane-scoped and cannot see pooled cascade
1172
1221
  // coverage: a cascade's ready rows route to Open InMail, paid InMail, or the
@@ -1201,7 +1250,7 @@ async function selectWorkspaceExactTarget(input, workspacePlanOverride, options
1201
1250
  code: "workspace_exact_target_unavailable",
1202
1251
  note: workspaceCoverage.remainingReadyOrProjectedGap !== 0
1203
1252
  ? `The fresh workspace plan still has ${workspaceCoverage.remainingReadyOrProjectedGap ?? "an unknown number of"} rows to prepare, but its executable exact-target candidates were all complete or scheduler-loaded. Refusing a false loaded_awaiting_scheduler terminal; the planner must expose the remaining actionable lane or a concrete blocker.`
1204
- : `The fresh workspace queue remained incomplete, but all ${completedExactTargetCount} exposed exact targets were already complete. No identical refill fence was reopened.`,
1253
+ : `The fresh workspace queue remained incomplete, but all ${completedExactTargetCount} exposed exact targets were already complete and no active preparation or import work was pending. No identical refill fence was reopened.`,
1205
1254
  workspacePlan,
1206
1255
  };
1207
1256
  }
@@ -2150,6 +2199,36 @@ export async function executeRefillSendsCommand(input = {}) {
2150
2199
  continuation: { required: false, userActionRequired: false },
2151
2200
  };
2152
2201
  }
2202
+ if (preview.status === "waiting") {
2203
+ return {
2204
+ ...command,
2205
+ readOnly: true,
2206
+ status: "in_progress",
2207
+ targetPlan: preview.workspacePlan,
2208
+ coordinator: {
2209
+ scope: "workspace",
2210
+ status: "waiting_on_active_work",
2211
+ waitAction: preview.waitAction,
2212
+ workspaceTargetPlan: preview.workspacePlan,
2213
+ },
2214
+ continuation: {
2215
+ required: true,
2216
+ kind: "workspace_wait",
2217
+ owner: "packaged_workflow",
2218
+ userActionRequired: false,
2219
+ tool: "refill_sends",
2220
+ arguments: {
2221
+ ...workspaceCoordinatorInput(scopedInput),
2222
+ yolo: true,
2223
+ executionMode: "yolo",
2224
+ requireWorkspace: true,
2225
+ workspaceId,
2226
+ workspaceCoordinator: true,
2227
+ },
2228
+ stopCondition: "Named preparation or import work is still in flight for this workspace. Honor the pending wait (about a 30-second reread cadence, or the receipt's wait.deadlineAt when present), then re-invoke this workspace command until projected coverage is terminal or a concrete blocker appears.",
2229
+ },
2230
+ };
2231
+ }
2153
2232
  const planRoot = recordValue(preview.workspacePlan);
2154
2233
  const planAction = recordValue(firstGlobalAction(preview.workspacePlan));
2155
2234
  const expectedTargetShapeRevision = stringValue(planRoot?.targetShapeRevision);
@@ -2273,6 +2352,62 @@ export async function executeRefillSendsCommand(input = {}) {
2273
2352
  },
2274
2353
  };
2275
2354
  }
2355
+ if (coordinatorSelection.status === "waiting") {
2356
+ return {
2357
+ ...command,
2358
+ status: "in_progress",
2359
+ targetPlan: coordinatorSelection.workspacePlan,
2360
+ orchestration: {
2361
+ mode: "fenced_bounded_yolo",
2362
+ scope: "workspace_exact_target_coordinator",
2363
+ checkpointedFields: [
2364
+ "runId",
2365
+ "fence",
2366
+ "runState",
2367
+ "actionKey",
2368
+ "requestId",
2369
+ "effectId",
2370
+ ],
2371
+ transportBudgetMs: 40_000,
2372
+ },
2373
+ coordinator: {
2374
+ scope: "workspace",
2375
+ status: "waiting_on_active_work",
2376
+ waitAction: coordinatorSelection.waitAction,
2377
+ workspaceTargetPlan: coordinatorSelection.workspacePlan,
2378
+ },
2379
+ continuation: {
2380
+ required: true,
2381
+ kind: "workspace_wait",
2382
+ owner: "packaged_workflow",
2383
+ userActionRequired: false,
2384
+ tool: "refill_sends",
2385
+ arguments: {
2386
+ yolo: true,
2387
+ executionMode: "yolo",
2388
+ requireWorkspace: true,
2389
+ workspaceId,
2390
+ intent: scopedInput.intent ?? "auto",
2391
+ senderIds: normalizeStrings(scopedInput.senderIds),
2392
+ ...(scopedInput.actionTypes
2393
+ ? { actionTypes: scopedInput.actionTypes }
2394
+ : {}),
2395
+ ...(scopedInput.targetDate
2396
+ ? { targetDate: scopedInput.targetDate }
2397
+ : {}),
2398
+ ...(scopedInput.untilDate
2399
+ ? { untilDate: scopedInput.untilDate }
2400
+ : {}),
2401
+ ...(typeof scopedInput.horizonSendDays === "number"
2402
+ ? { horizonSendDays: scopedInput.horizonSendDays }
2403
+ : {}),
2404
+ approvalMode: scopedInput.approvalMode ?? "approve",
2405
+ workspaceCoordinator: true,
2406
+ },
2407
+ stopCondition: "Named preparation or import work is still in flight for this workspace. Honor the pending wait (about a 30-second reread cadence, or the receipt's wait.deadlineAt when present), then re-invoke this workspace command until projected coverage is terminal or a concrete blocker appears.",
2408
+ },
2409
+ };
2410
+ }
2276
2411
  if (coordinatorSelection.status === "awaiting_scheduler") {
2277
2412
  return {
2278
2413
  ...command,
@@ -2638,6 +2773,45 @@ export async function executeRefillSendsCommand(input = {}) {
2638
2773
  },
2639
2774
  };
2640
2775
  }
2776
+ if (nextSelection.status === "waiting") {
2777
+ return {
2778
+ ...command,
2779
+ status: "in_progress",
2780
+ targetPlan: nextSelection.workspacePlan,
2781
+ orchestration: {
2782
+ mode: "fenced_bounded_yolo",
2783
+ scope: "workspace_exact_target_coordinator",
2784
+ checkpointedFields: [
2785
+ "runId",
2786
+ "fence",
2787
+ "runState",
2788
+ "actionKey",
2789
+ "requestId",
2790
+ "effectId",
2791
+ ],
2792
+ transportBudgetMs: 40_000,
2793
+ },
2794
+ coordinator: {
2795
+ scope: "workspace",
2796
+ status: "waiting_on_active_work",
2797
+ completedTarget: selectedCoordinatorTarget,
2798
+ waitAction: nextSelection.waitAction,
2799
+ workspaceTargetPlan: nextSelection.workspacePlan,
2800
+ exactRunResult: result,
2801
+ },
2802
+ continuation: {
2803
+ required: true,
2804
+ kind: "workspace_wait",
2805
+ owner: "packaged_workflow",
2806
+ userActionRequired: false,
2807
+ tool: "refill_sends",
2808
+ arguments: {
2809
+ ...workspaceContinuationArguments,
2810
+ },
2811
+ stopCondition: "Named preparation or import work is still in flight for this workspace. Honor the pending wait (about a 30-second reread cadence, or the receipt's wait.deadlineAt when present), then re-invoke this workspace command until projected coverage is terminal or a concrete blocker appears.",
2812
+ },
2813
+ };
2814
+ }
2641
2815
  if (nextSelection.status === "awaiting_scheduler") {
2642
2816
  return {
2643
2817
  ...command,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.686-uat.refill-zero-shot.20260722205242",
3
+ "version": "0.1.688-uat.refill-zero-shot.20260722213823",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code, Codex, and Hermes campaign workflows",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,9 @@
1
+ {
2
+ "parallelMode": "wide",
3
+ "agentCount": 6,
4
+ "maxToolCallsPerAgent": 2,
5
+ "senderMaxAgents": 2,
6
+ "senderMaxToolCallsPerAgent": 3,
7
+ "progressMode": true,
8
+ "debugMode": true
9
+ }