@wrongstack/tools 0.282.2 → 0.283.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtin.js +105 -5
- package/dist/builtin.js.map +1 -1
- package/dist/index.d.ts +20 -2
- package/dist/index.js +119 -7
- package/dist/index.js.map +1 -1
- package/dist/mode.d.ts +3 -0
- package/dist/mode.js +14 -2
- package/dist/mode.js.map +1 -1
- package/dist/pack.js +105 -5
- package/dist/pack.js.map +1 -1
- package/package.json +2 -2
package/dist/mode.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface ModeInput {
|
|
|
4
4
|
action: 'get' | 'list' | 'set' | 'clear';
|
|
5
5
|
mode?: string | undefined;
|
|
6
6
|
}
|
|
7
|
+
type ModeFamily = 'lite' | 'deep' | 'balanced' | 'custom';
|
|
7
8
|
interface ModeOutput {
|
|
8
9
|
action: string;
|
|
9
10
|
currentMode?: string | undefined;
|
|
@@ -11,6 +12,8 @@ interface ModeOutput {
|
|
|
11
12
|
id: string | undefined;
|
|
12
13
|
name: string;
|
|
13
14
|
description: string;
|
|
15
|
+
family: ModeFamily;
|
|
16
|
+
tags: string[];
|
|
14
17
|
}[];
|
|
15
18
|
success: boolean;
|
|
16
19
|
message: string;
|
package/dist/mode.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
// src/mode.ts
|
|
2
|
+
function modeFamily(mode) {
|
|
3
|
+
if (mode.tags?.includes("lite")) return "lite";
|
|
4
|
+
if (mode.tags?.includes("deep")) return "deep";
|
|
5
|
+
if (mode.tags?.includes("balanced") || mode.id === "default") return "balanced";
|
|
6
|
+
return "custom";
|
|
7
|
+
}
|
|
2
8
|
function createModeTool(modeStore) {
|
|
3
9
|
return {
|
|
4
10
|
name: "mode",
|
|
@@ -38,10 +44,16 @@ function createModeTool(modeStore) {
|
|
|
38
44
|
}
|
|
39
45
|
case "list": {
|
|
40
46
|
const modes = await modeStore.listModes();
|
|
41
|
-
const lines = modes.map((m) => ` ${m.id.padEnd(20)} ${m.name} \u2014 ${m.description}`).join("\n");
|
|
47
|
+
const lines = modes.map((m) => ` ${m.id.padEnd(20)} [${modeFamily(m)}] ${m.name} \u2014 ${m.description}`).join("\n");
|
|
42
48
|
return {
|
|
43
49
|
action: "list",
|
|
44
|
-
modes: modes.map((m) => ({
|
|
50
|
+
modes: modes.map((m) => ({
|
|
51
|
+
id: m.id,
|
|
52
|
+
name: m.name,
|
|
53
|
+
description: m.description,
|
|
54
|
+
family: modeFamily(m),
|
|
55
|
+
tags: m.tags ?? []
|
|
56
|
+
})),
|
|
45
57
|
success: true,
|
|
46
58
|
message: lines
|
|
47
59
|
};
|
package/dist/mode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mode.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../src/mode.ts"],"names":[],"mappings":";AAuBA,SAAS,WAAW,IAAA,EAA4E;AAC9F,EAAA,IAAI,IAAA,CAAK,IAAA,EAAM,QAAA,CAAS,MAAM,GAAG,OAAO,MAAA;AACxC,EAAA,IAAI,IAAA,CAAK,IAAA,EAAM,QAAA,CAAS,MAAM,GAAG,OAAO,MAAA;AACxC,EAAA,IAAI,IAAA,CAAK,MAAM,QAAA,CAAS,UAAU,KAAK,IAAA,CAAK,EAAA,KAAO,WAAW,OAAO,UAAA;AACrE,EAAA,OAAO,QAAA;AACT;AAEO,SAAS,eAAe,SAAA,EAAmD;AAChF,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,MAAA;AAAA,IACN,QAAA,EAAU,SAAA;AAAA,IACV,WAAA,EACE,mKAAA;AAAA,IACF,SAAA,EACE,yWAAA;AAAA,IAMF,UAAA,EAAY,SAAA;AAAA,IACZ,QAAA,EAAU,IAAA;AAAA,IACV,SAAA,EAAW,GAAA;AAAA,IACX,YAAA,EAAc,CAAC,cAAc,CAAA;AAAA,IAC7B,IAAA,EAAM,UAAA;AAAA,IACN,WAA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AAA,QACF;AAAA,QACA;AACE,UAAA,OAAO;AAAA,YACL,QAAQ,KAAA,CAAM,MAAA;AAAA,YACd,OAAA,EAAS,KAAA;AAAA,YACT,OAAA,EAAS,CAAA,gBAAA,EAAmB,KAAA,CAAM,MAAM,CAAA,CAAA;AAAA,WAC1C;AAAA;AACJ,IACF;AAAA,GACF;AACF","file":"mode.js","sourcesContent":["import type { ModeStore, Tool } from '@wrongstack/core';\n\ninterface ModeInput {\n action: 'get' | 'list' | 'set' | 'clear';\n mode?: string | undefined;\n}\n\ntype ModeFamily = 'lite' | 'deep' | 'balanced' | 'custom';\n\ninterface ModeOutput {\n action: string;\n currentMode?: string | undefined;\n modes?: {\n id: string | undefined;\n name: string;\n description: string;\n family: ModeFamily;\n tags: string[];\n }[];\n success: boolean;\n message: string;\n}\n\nfunction modeFamily(mode: { id?: string | undefined; tags?: string[] | undefined }): ModeFamily {\n if (mode.tags?.includes('lite')) return 'lite';\n if (mode.tags?.includes('deep')) return 'deep';\n if (mode.tags?.includes('balanced') || mode.id === 'default') return 'balanced';\n return 'custom';\n}\n\nexport function createModeTool(modeStore: ModeStore): Tool<ModeInput, ModeOutput> {\n return {\n name: 'mode',\n category: 'Session',\n description:\n 'Manage agent operating modes. Modes change the agent\\'s behavior, personality, and system prompt for different workflows (e.g. coding, security review, planning).',\n usageHint:\n 'POWERFUL BEHAVIOR CONTROL TOOL:\\n\\n' +\n '- Use `list` to see available modes.\\n' +\n '- Use `set <modeId>` to switch the agent into a specific role/mode.\\n' +\n '- Use `get` to check current mode.\\n' +\n '- Use `clear` to return to default behavior.\\n' +\n 'Switching modes is very effective for specialized tasks. The mode change affects how the agent reasons and which guidelines it follows.',\n permission: 'confirm',\n mutating: true,\n timeoutMs: 5_000,\n capabilities: ['session.mode'],\n icon: 'settings',\n inputSchema: {\n type: 'object',\n properties: {\n action: {\n type: 'string',\n enum: ['get', 'list', 'set', 'clear'],\n description: 'The mode operation to perform.',\n },\n mode: {\n type: 'string',\n description: 'The mode identifier to activate (only required when action=set).',\n },\n },\n required: ['action'],\n },\n async execute(input) {\n switch (input.action) {\n case 'get': {\n const mode = await modeStore.getActiveMode();\n return {\n action: 'get',\n currentMode: mode?.id,\n success: true,\n message: mode\n ? `Current mode: ${mode.name} — ${mode.description}`\n : 'No mode set (using default)',\n };\n }\n case 'list': {\n const modes = await modeStore.listModes();\n const lines = modes\n .map((m) => ` ${m.id.padEnd(20)} [${modeFamily(m)}] ${m.name} — ${m.description}`)\n .join('\\n');\n return {\n action: 'list',\n modes: modes.map((m) => ({\n id: m.id,\n name: m.name,\n description: m.description,\n family: modeFamily(m),\n tags: m.tags ?? [],\n })),\n success: true,\n message: lines,\n };\n }\n case 'set': {\n if (!input.mode) {\n return { action: 'set', success: false, message: 'mode is required for action=set' };\n }\n const mode = await modeStore.getMode(input.mode);\n if (!mode) {\n return { action: 'set', success: false, message: `Mode \"${input.mode}\" not found` };\n }\n await modeStore.setActiveMode(input.mode);\n return {\n action: 'set',\n currentMode: mode.id,\n success: true,\n message: `Switched to mode: ${mode.name}\\n\\n${mode.description}`,\n };\n }\n case 'clear': {\n await modeStore.setActiveMode(null);\n return {\n action: 'clear',\n success: true,\n message: 'Mode cleared — using default mode',\n };\n }\n default:\n return {\n action: input.action,\n success: false,\n message: `Unknown action \"${input.action}\"`,\n };\n }\n },\n };\n}\n"]}
|
package/dist/pack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn, execFileSync } from 'node:child_process';
|
|
2
2
|
import * as Core from '@wrongstack/core';
|
|
3
|
-
import { buildChildEnv, getDesignKitLoader, isDesignStack, loadActiveKit, applyTokenOverrides, setActiveKit, recordKitChoice, recordOverrides, setDesignOverrides, materializeTokens, runDesignVerify, ToolValidationError, detectNewlineStyle, normalizeToLf, toStyle, atomicWrite, unifiedDiff, ToolError, FetchError, isPrivateIPv4, isPrivateIPv6, assessCommitSafety, compileGlob, expectDefined, recordPackageAction, detectPackageEcosystem, deepMerge, addLinkToTask, addNoteToTask, updateCheckOnTask, addCheckToTask, updateGoalMetricOnTask, addGoalMetricToTask, addDependency, updateTaskAssignment, assignTask, releaseTaskClaim, claimReadyTask, getTaskChain, setTaskChain, removeTask, moveTask, updateTask, getTask, transferTaskToBoard, copyTaskToBoard, mergeTasks, splitTask, addTask, removeColumn, updateColumn, addColumn, getKanbanOrchestrationSnapshot, listReadyTasks, searchKanban, deserializeTaskGraph, syncBoardFromTaskGraph, exportBoardToTaskGraph, serializeTaskGraph, exportBoardAsMarkdown, generateBoardFromDescription, createBoard, parseLinesIntoTasks, getBoard, removeBoard, duplicateBoard, updateBoard, listBoards, mutatePlan, clearPlan, getPlanTemplate, addPlanItem, deriveTodosFromPlanItem, removePlanItem, setPlanItemStatus, mutateTasks, formatTaskList, formatPlan, FsError, toErrorMessage as toErrorMessage$2, computeTaskItemProgress, loadPlan, savePlan, loadTasks, saveTasks, wstackGlobalRoot, resolveWstackPaths, truncate } from '@wrongstack/core';
|
|
3
|
+
import { buildChildEnv, getDesignKitLoader, isDesignStack, loadActiveKit, applyTokenOverrides, setActiveKit, recordKitChoice, recordOverrides, setDesignOverrides, materializeTokens, runDesignVerify, ToolValidationError, detectNewlineStyle, normalizeToLf, toStyle, atomicWrite, unifiedDiff, ToolError, FetchError, isPrivateIPv4, isPrivateIPv6, assessCommitSafety, compileGlob, expectDefined, recordPackageAction, detectPackageEcosystem, deepMerge, addLinkToTask, addNoteToTask, updateCheckOnTask, addCheckToTask, updateGoalMetricOnTask, addGoalMetricToTask, addDependency, getKanbanQueueHealth, listKanbanEvents, recoverStaleTaskAssignments, heartbeatTaskAssignment, updateTaskAssignment, assignTask, releaseTaskClaim, claimReadyTask, getTaskChain, setTaskChain, removeTask, moveTask, updateTask, getTask, transferTaskToBoard, copyTaskToBoard, mergeTasks, splitTask, addTask, removeColumn, updateColumn, addColumn, getKanbanOrchestrationSnapshot, listReadyTasks, searchKanban, deserializeTaskGraph, syncBoardFromTaskGraph, exportBoardToTaskGraph, serializeTaskGraph, exportBoardAsMarkdown, generateBoardFromDescription, createBoard, parseLinesIntoTasks, getBoard, removeBoard, duplicateBoard, updateBoard, listBoards, mutatePlan, clearPlan, getPlanTemplate, addPlanItem, deriveTodosFromPlanItem, removePlanItem, setPlanItemStatus, mutateTasks, formatTaskList, formatPlan, FsError, toErrorMessage as toErrorMessage$2, computeTaskItemProgress, loadPlan, savePlan, loadTasks, saveTasks, wstackGlobalRoot, resolveWstackPaths, truncate } from '@wrongstack/core';
|
|
4
4
|
import * as fs from 'node:fs';
|
|
5
5
|
import { statSync, mkdirSync, createWriteStream } from 'node:fs';
|
|
6
6
|
import * as fs2 from 'node:fs/promises';
|
|
@@ -9330,6 +9330,10 @@ var kanbanTool = {
|
|
|
9330
9330
|
"release_task",
|
|
9331
9331
|
"assign_task",
|
|
9332
9332
|
"mark_assignment",
|
|
9333
|
+
"heartbeat_assignment",
|
|
9334
|
+
"recover_stale",
|
|
9335
|
+
"events",
|
|
9336
|
+
"queue_health",
|
|
9333
9337
|
"add_dependency",
|
|
9334
9338
|
"add_goal_metric",
|
|
9335
9339
|
"update_goal_metric",
|
|
@@ -9376,6 +9380,12 @@ var kanbanTool = {
|
|
|
9376
9380
|
fallbackModels: { type: "array", items: { type: "string" } },
|
|
9377
9381
|
tools: { type: "array", items: { type: "string" } },
|
|
9378
9382
|
allowedCapabilities: { type: "array", items: { type: "string" } },
|
|
9383
|
+
leaseId: { type: "string" },
|
|
9384
|
+
claimedAt: { type: "string" },
|
|
9385
|
+
heartbeatAt: { type: "string" },
|
|
9386
|
+
leaseExpiresAt: { type: "string" },
|
|
9387
|
+
attempt: { type: "number" },
|
|
9388
|
+
maxAttempts: { type: "number" },
|
|
9379
9389
|
subagentId: { type: "string" },
|
|
9380
9390
|
runTaskId: { type: "string" },
|
|
9381
9391
|
lastResult: { type: "string" },
|
|
@@ -9387,6 +9397,8 @@ var kanbanTool = {
|
|
|
9387
9397
|
releaseStatus: { type: "string", enum: ["pending", "ready", "blocked"] },
|
|
9388
9398
|
releaseReason: { type: "string" },
|
|
9389
9399
|
clearAssignee: { type: "boolean" },
|
|
9400
|
+
recoveryMode: { type: "string", enum: ["release", "retry", "fail"] },
|
|
9401
|
+
recoveryNow: { type: "string" },
|
|
9390
9402
|
taskGraph: { type: "object" },
|
|
9391
9403
|
graphId: { type: "string" },
|
|
9392
9404
|
specId: { type: "string" },
|
|
@@ -9802,10 +9814,80 @@ var kanbanTool = {
|
|
|
9802
9814
|
...input.runTaskId !== void 0 ? { runTaskId: input.runTaskId } : {},
|
|
9803
9815
|
...input.lastResult !== void 0 ? { lastResult: input.lastResult } : {},
|
|
9804
9816
|
...input.error !== void 0 ? { error: input.error } : {},
|
|
9805
|
-
...input.agentId !== void 0 ? { agentId: input.agentId } : {}
|
|
9817
|
+
...input.agentId !== void 0 ? { agentId: input.agentId } : {},
|
|
9818
|
+
...input.leaseId !== void 0 ? { leaseId: input.leaseId } : {},
|
|
9819
|
+
...input.claimedAt !== void 0 ? { claimedAt: input.claimedAt } : {},
|
|
9820
|
+
...input.heartbeatAt !== void 0 ? { heartbeatAt: input.heartbeatAt } : {},
|
|
9821
|
+
...input.leaseExpiresAt !== void 0 ? { leaseExpiresAt: input.leaseExpiresAt } : {},
|
|
9822
|
+
...input.attempt !== void 0 ? { attempt: input.attempt } : {},
|
|
9823
|
+
...input.maxAttempts !== void 0 ? { maxAttempts: input.maxAttempts } : {}
|
|
9806
9824
|
});
|
|
9807
9825
|
return board ? okBoard(board, "Assignment updated.") : fail("Task not found.");
|
|
9808
9826
|
}
|
|
9827
|
+
case "heartbeat_assignment": {
|
|
9828
|
+
if (!input.boardId || !input.taskId) {
|
|
9829
|
+
return fail("heartbeat_assignment requires boardId and taskId.");
|
|
9830
|
+
}
|
|
9831
|
+
const board = await heartbeatTaskAssignment(projectRoot, input.boardId, input.taskId, {
|
|
9832
|
+
...input.heartbeatAt !== void 0 ? { heartbeatAt: input.heartbeatAt } : {},
|
|
9833
|
+
...input.leaseExpiresAt !== void 0 ? { leaseExpiresAt: input.leaseExpiresAt } : {}
|
|
9834
|
+
});
|
|
9835
|
+
return board ? okBoard(board, "Assignment heartbeat updated.") : fail("Task assignment not found.");
|
|
9836
|
+
}
|
|
9837
|
+
case "recover_stale": {
|
|
9838
|
+
if (!input.boardId) return fail("recover_stale requires boardId.");
|
|
9839
|
+
const policyFields = [
|
|
9840
|
+
input.recoveryPolicyFailOnCostCeiling !== void 0,
|
|
9841
|
+
input.recoveryPolicyReleaseOnFailureKinds !== void 0,
|
|
9842
|
+
input.recoveryPolicyReleaseOnHeartbeatDue !== void 0,
|
|
9843
|
+
input.recoveryPolicyRetryPolicyOverride !== void 0
|
|
9844
|
+
].some(Boolean);
|
|
9845
|
+
const result = await recoverStaleTaskAssignments(projectRoot, input.boardId, {
|
|
9846
|
+
...input.recoveryMode !== void 0 ? { mode: input.recoveryMode } : {},
|
|
9847
|
+
...input.recoveryNow !== void 0 ? { now: input.recoveryNow } : {},
|
|
9848
|
+
...input.releaseReason !== void 0 ? { reason: input.releaseReason } : {},
|
|
9849
|
+
...input.clearAssignee !== void 0 ? { clearAssignee: input.clearAssignee } : {},
|
|
9850
|
+
...policyFields ? {
|
|
9851
|
+
policy: {
|
|
9852
|
+
...input.recoveryPolicyFailOnCostCeiling !== void 0 ? { failWhenCostCeilingSet: input.recoveryPolicyFailOnCostCeiling } : {},
|
|
9853
|
+
...input.recoveryPolicyReleaseOnFailureKinds !== void 0 ? {
|
|
9854
|
+
releaseOnFailureKinds: input.recoveryPolicyReleaseOnFailureKinds
|
|
9855
|
+
} : {},
|
|
9856
|
+
...input.recoveryPolicyReleaseOnHeartbeatDue !== void 0 ? {
|
|
9857
|
+
releaseOnHeartbeatDue: input.recoveryPolicyReleaseOnHeartbeatDue
|
|
9858
|
+
} : {},
|
|
9859
|
+
...input.recoveryPolicyRetryPolicyOverride !== void 0 ? {
|
|
9860
|
+
retryPolicyOverride: input.recoveryPolicyRetryPolicyOverride
|
|
9861
|
+
} : {}
|
|
9862
|
+
}
|
|
9863
|
+
} : {}
|
|
9864
|
+
});
|
|
9865
|
+
return result ? {
|
|
9866
|
+
ok: true,
|
|
9867
|
+
message: `Recovered ${result.tasks.length} stale assignment(s).`,
|
|
9868
|
+
board: result.board,
|
|
9869
|
+
recoveredTasks: result.tasks
|
|
9870
|
+
} : { ok: true, message: "No stale assignment matched.", recoveredTasks: [] };
|
|
9871
|
+
}
|
|
9872
|
+
case "events": {
|
|
9873
|
+
if (!input.boardId) return fail("events requires boardId.");
|
|
9874
|
+
const eventList = await listKanbanEvents(projectRoot, input.boardId);
|
|
9875
|
+
return {
|
|
9876
|
+
ok: true,
|
|
9877
|
+
message: `${eventList.length} event(s).`,
|
|
9878
|
+
events: eventList
|
|
9879
|
+
};
|
|
9880
|
+
}
|
|
9881
|
+
case "queue_health": {
|
|
9882
|
+
const health = await getKanbanQueueHealth(projectRoot, {
|
|
9883
|
+
...input.boardId !== void 0 ? { boardId: input.boardId } : {}
|
|
9884
|
+
});
|
|
9885
|
+
return {
|
|
9886
|
+
ok: true,
|
|
9887
|
+
message: `Counts: ready=${health.counts.ready}, running=${health.counts.running}, stale=${health.staleAssignments.count}.`,
|
|
9888
|
+
queueHealth: health
|
|
9889
|
+
};
|
|
9890
|
+
}
|
|
9809
9891
|
case "add_dependency": {
|
|
9810
9892
|
if (!input.boardId || !input.taskId || !input.dependencyTaskId) {
|
|
9811
9893
|
return fail("add_dependency requires boardId, taskId, and dependencyTaskId.");
|
|
@@ -9957,11 +10039,20 @@ function assignmentInput(input) {
|
|
|
9957
10039
|
fallbackModels: input.fallbackModels,
|
|
9958
10040
|
tools: input.tools,
|
|
9959
10041
|
allowedCapabilities: input.allowedCapabilities,
|
|
9960
|
-
assignee: input.assignee
|
|
10042
|
+
assignee: input.assignee,
|
|
10043
|
+
leaseId: input.leaseId,
|
|
10044
|
+
claimedAt: input.claimedAt,
|
|
10045
|
+
heartbeatAt: input.heartbeatAt,
|
|
10046
|
+
leaseExpiresAt: input.leaseExpiresAt,
|
|
10047
|
+
attempt: input.attempt,
|
|
10048
|
+
maxAttempts: input.maxAttempts,
|
|
10049
|
+
costCeilingUsd: input.costCeilingUsd,
|
|
10050
|
+
retryPolicy: input.retryPolicy,
|
|
10051
|
+
lastFailureKind: input.lastFailureKind
|
|
9961
10052
|
};
|
|
9962
10053
|
}
|
|
9963
10054
|
function hasAssignmentInput(input) {
|
|
9964
|
-
return input.agentId !== void 0 || input.name !== void 0 || input.role !== void 0 || input.provider !== void 0 || input.model !== void 0 || input.fallbackProfile !== void 0 || input.fallbackModels !== void 0 || input.tools !== void 0 || input.allowedCapabilities !== void 0 || input.assignee !== void 0 || input.assignmentStatus !== void 0;
|
|
10055
|
+
return input.agentId !== void 0 || input.name !== void 0 || input.role !== void 0 || input.provider !== void 0 || input.model !== void 0 || input.fallbackProfile !== void 0 || input.fallbackModels !== void 0 || input.tools !== void 0 || input.allowedCapabilities !== void 0 || input.assignee !== void 0 || input.leaseId !== void 0 || input.claimedAt !== void 0 || input.heartbeatAt !== void 0 || input.leaseExpiresAt !== void 0 || input.attempt !== void 0 || input.maxAttempts !== void 0 || input.costCeilingUsd !== void 0 || input.retryPolicy !== void 0 || input.lastFailureKind !== void 0 || input.assignmentStatus !== void 0;
|
|
9965
10056
|
}
|
|
9966
10057
|
function assignmentForTaskCreate(input) {
|
|
9967
10058
|
return {
|
|
@@ -9974,7 +10065,16 @@ function assignmentForTaskCreate(input) {
|
|
|
9974
10065
|
...input.fallbackProfile !== void 0 ? { fallbackProfile: input.fallbackProfile } : {},
|
|
9975
10066
|
...input.fallbackModels !== void 0 ? { fallbackModels: input.fallbackModels } : {},
|
|
9976
10067
|
...input.tools !== void 0 ? { tools: input.tools } : {},
|
|
9977
|
-
...input.allowedCapabilities !== void 0 ? { allowedCapabilities: input.allowedCapabilities } : {}
|
|
10068
|
+
...input.allowedCapabilities !== void 0 ? { allowedCapabilities: input.allowedCapabilities } : {},
|
|
10069
|
+
...input.leaseId !== void 0 ? { leaseId: input.leaseId } : {},
|
|
10070
|
+
...input.claimedAt !== void 0 ? { claimedAt: input.claimedAt } : {},
|
|
10071
|
+
...input.heartbeatAt !== void 0 ? { heartbeatAt: input.heartbeatAt } : {},
|
|
10072
|
+
...input.leaseExpiresAt !== void 0 ? { leaseExpiresAt: input.leaseExpiresAt } : {},
|
|
10073
|
+
...input.attempt !== void 0 ? { attempt: input.attempt } : {},
|
|
10074
|
+
...input.maxAttempts !== void 0 ? { maxAttempts: input.maxAttempts } : {},
|
|
10075
|
+
...input.costCeilingUsd !== void 0 ? { costCeilingUsd: input.costCeilingUsd } : {},
|
|
10076
|
+
...input.retryPolicy !== void 0 ? { retryPolicy: input.retryPolicy } : {},
|
|
10077
|
+
...input.lastFailureKind !== void 0 ? { lastFailureKind: input.lastFailureKind } : {}
|
|
9978
10078
|
};
|
|
9979
10079
|
}
|
|
9980
10080
|
|