@sellable/mcp 0.1.749 → 0.1.750
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.
|
@@ -689,6 +689,13 @@ type WorkspaceCoordinatorWaitAction = {
|
|
|
689
689
|
reason: string | null;
|
|
690
690
|
};
|
|
691
691
|
declare function clearCompleteDefersForCampaign(runState: Record<string, unknown> | undefined, campaignId: string | null, preserveActionKey?: string | null): Record<string, unknown> | undefined;
|
|
692
|
+
declare function deferWorkspaceExactTarget(params: {
|
|
693
|
+
runState: unknown;
|
|
694
|
+
target: WorkspaceExactTarget;
|
|
695
|
+
blocker: string;
|
|
696
|
+
}): {
|
|
697
|
+
coordinatorBlockedExactTargets: (Record<string, unknown> | null)[];
|
|
698
|
+
};
|
|
692
699
|
export declare function approvedPacketComparison(input: RefillSendsCommandInput, targetPlan: unknown): {
|
|
693
700
|
changed: boolean;
|
|
694
701
|
expectedTargetShapeRevision: string | null;
|
|
@@ -732,6 +739,9 @@ type RefillSenderSelectorMiss = {
|
|
|
732
739
|
export declare const refillSendsDeferInternals: {
|
|
733
740
|
clearCompleteDefersForCampaign: typeof clearCompleteDefersForCampaign;
|
|
734
741
|
SUPPLY_INVALIDATED_DEFER_BLOCKERS: Set<string>;
|
|
742
|
+
deferWorkspaceExactTarget: typeof deferWorkspaceExactTarget;
|
|
743
|
+
EXACT_ACTION_COMPLETE_BLOCKER: string;
|
|
744
|
+
EXACT_ACTION_COMPLETE_CONFIRMED_BLOCKER: string;
|
|
735
745
|
};
|
|
736
746
|
export declare function executeRefillSendsCommand(input?: RefillSendsCommandInput): Promise<import("./workspace-context.js").WorkspaceRequiredResult | {
|
|
737
747
|
ok: boolean;
|
|
@@ -933,10 +933,17 @@ const WORKSPACE_SUPPLY_ACTION_FAMILIES = new Set([
|
|
|
933
933
|
// stale proof, not by absent supply.
|
|
934
934
|
//
|
|
935
935
|
// Same shape as 112c: a bounded ATTEMPT must not harden into a standing claim.
|
|
936
|
+
const EXACT_ACTION_COMPLETE_BLOCKER = "exact_action_complete";
|
|
937
|
+
// fix(112as-b): a completeness claim RE-CONFIRMED by a second identical receipt.
|
|
938
|
+
// The 112as release deliberately never waives this, which is what stops the
|
|
939
|
+
// release from looping forever across continuations.
|
|
940
|
+
const EXACT_ACTION_COMPLETE_CONFIRMED_BLOCKER = "exact_action_complete_confirmed";
|
|
936
941
|
const SUPPLY_INVALIDATED_DEFER_BLOCKERS = new Set([
|
|
937
942
|
"complete",
|
|
938
943
|
"capped_by_scheduler",
|
|
939
944
|
"exact_action_complete",
|
|
945
|
+
// new supply genuinely invalidates even a re-confirmed claim
|
|
946
|
+
"exact_action_complete_confirmed",
|
|
940
947
|
]);
|
|
941
948
|
function clearCompleteDefersForCampaign(runState, campaignId,
|
|
942
949
|
// fix(112ar): the action that JUST landed keeps its own defer. Clearing it
|
|
@@ -1204,20 +1211,42 @@ function deferWorkspaceExactTarget(params) {
|
|
|
1204
1211
|
const existing = Array.isArray(current.coordinatorBlockedExactTargets)
|
|
1205
1212
|
? current.coordinatorBlockedExactTargets.map(recordValue).filter(Boolean)
|
|
1206
1213
|
: [];
|
|
1214
|
+
const matchesTarget = (entry) => {
|
|
1215
|
+
const candidate = coordinatorBlockedExactTargets({
|
|
1216
|
+
version: 1,
|
|
1217
|
+
coordinatorBlockedExactTargets: [entry],
|
|
1218
|
+
})[0];
|
|
1219
|
+
return Boolean(candidate &&
|
|
1220
|
+
coordinatorBlockedExactTargetMatches(candidate, params.target));
|
|
1221
|
+
};
|
|
1222
|
+
// fix(112as-b): 112as bounds its release with `waiveCompleteClaims`, which is
|
|
1223
|
+
// per SELECTION CALL. Every next_exact_target continuation starts a fresh
|
|
1224
|
+
// selection, so the same completed edge was released over and over and the
|
|
1225
|
+
// coordinator ping-ponged between two already-complete edges without
|
|
1226
|
+
// executing either (Dotwork: alternating prepare_messages:e5fc49c5 and
|
|
1227
|
+
// approve_messages:4bf8c1e1). That traded the invariant breach for a
|
|
1228
|
+
// livelock.
|
|
1229
|
+
//
|
|
1230
|
+
// Bound the release PER EDGE instead: the first exact_action_complete is a
|
|
1231
|
+
// bounded attempt and stays releasable, but if the SAME edge comes back
|
|
1232
|
+
// complete a second time, the claim is CONFIRMED by its own re-receipt and is
|
|
1233
|
+
// never waived again. Self-limiting, and it needs no new ledger — the entry
|
|
1234
|
+
// already survives continuations inside workspaceRunState.
|
|
1235
|
+
const alreadyCompleteClaim = params.blocker === EXACT_ACTION_COMPLETE_BLOCKER &&
|
|
1236
|
+
existing.some((entry) => matchesTarget(entry) &&
|
|
1237
|
+
(stringValue(recordValue(entry)?.blocker) ===
|
|
1238
|
+
EXACT_ACTION_COMPLETE_BLOCKER ||
|
|
1239
|
+
stringValue(recordValue(entry)?.blocker) ===
|
|
1240
|
+
EXACT_ACTION_COMPLETE_CONFIRMED_BLOCKER));
|
|
1207
1241
|
return {
|
|
1208
1242
|
...current,
|
|
1209
1243
|
coordinatorBlockedExactTargets: [
|
|
1210
|
-
...existing.filter((entry) =>
|
|
1211
|
-
const candidate = coordinatorBlockedExactTargets({
|
|
1212
|
-
version: 1,
|
|
1213
|
-
coordinatorBlockedExactTargets: [entry],
|
|
1214
|
-
})[0];
|
|
1215
|
-
return (!candidate ||
|
|
1216
|
-
!coordinatorBlockedExactTargetMatches(candidate, params.target));
|
|
1217
|
-
}),
|
|
1244
|
+
...existing.filter((entry) => !matchesTarget(entry)),
|
|
1218
1245
|
{
|
|
1219
1246
|
...params.target,
|
|
1220
|
-
blocker:
|
|
1247
|
+
blocker: alreadyCompleteClaim
|
|
1248
|
+
? EXACT_ACTION_COMPLETE_CONFIRMED_BLOCKER
|
|
1249
|
+
: params.blocker,
|
|
1221
1250
|
decidedAt: new Date().toISOString(),
|
|
1222
1251
|
},
|
|
1223
1252
|
],
|
|
@@ -3115,6 +3144,9 @@ async function resolveRefillSenderSelectors(params) {
|
|
|
3115
3144
|
export const refillSendsDeferInternals = {
|
|
3116
3145
|
clearCompleteDefersForCampaign,
|
|
3117
3146
|
SUPPLY_INVALIDATED_DEFER_BLOCKERS,
|
|
3147
|
+
deferWorkspaceExactTarget,
|
|
3148
|
+
EXACT_ACTION_COMPLETE_BLOCKER,
|
|
3149
|
+
EXACT_ACTION_COMPLETE_CONFIRMED_BLOCKER,
|
|
3118
3150
|
};
|
|
3119
3151
|
export async function executeRefillSendsCommand(input = {}) {
|
|
3120
3152
|
const normalizedInput = normalizeRefillSendsInput(input);
|