@promptbook/remote-server 0.112.0-70 → 0.112.0-72
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/esm/index.es.js +237 -121
- package/esm/index.es.js.map +1 -1
- package/esm/src/book-3.0/Book.d.ts +6 -0
- package/esm/src/book-components/Chat/utils/getToolCallChipletInfo.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +12 -2
- package/esm/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +1 -0
- package/esm/src/cli/cli-commands/run/prepareRunCommandResources.d.ts +20 -0
- package/esm/src/cli/cli-commands/run/resolveRunInputParameters.d.ts +12 -0
- package/esm/src/cli/cli-commands/run/runCommandAction.d.ts +21 -0
- package/esm/src/cli/cli-commands/run/runPipelineExecution.d.ts +14 -0
- package/esm/src/cli/cli-commands/run.d.ts +1 -1
- package/esm/src/conversion/parsePipeline/applyPipelineHead.d.ts +8 -0
- package/esm/src/conversion/parsePipeline/createInitialPipelineJson.d.ts +8 -0
- package/esm/src/conversion/parsePipeline/createUniqueSectionNameResolver.d.ts +14 -0
- package/esm/src/conversion/parsePipeline/defineParameter.d.ts +8 -0
- package/esm/src/conversion/parsePipeline/extractPipelineDescription.d.ts +6 -0
- package/esm/src/conversion/parsePipeline/finalizeParsedPipeline.d.ts +8 -0
- package/esm/src/conversion/parsePipeline/getPipelineIdentification.d.ts +7 -0
- package/esm/src/conversion/parsePipeline/parsePreparedPipelineSections.d.ts +18 -0
- package/esm/src/conversion/parsePipeline/preparePipelineString.d.ts +8 -0
- package/esm/src/conversion/parsePipeline/processPipelineSection.d.ts +9 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +237 -121
- package/umd/index.umd.js.map +1 -1
- package/umd/src/book-3.0/Book.d.ts +6 -0
- package/umd/src/book-components/Chat/utils/getToolCallChipletInfo.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +12 -2
- package/umd/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +1 -0
- package/umd/src/cli/cli-commands/run/prepareRunCommandResources.d.ts +20 -0
- package/umd/src/cli/cli-commands/run/resolveRunInputParameters.d.ts +12 -0
- package/umd/src/cli/cli-commands/run/runCommandAction.d.ts +21 -0
- package/umd/src/cli/cli-commands/run/runPipelineExecution.d.ts +14 -0
- package/umd/src/cli/cli-commands/run.d.ts +1 -1
- package/umd/src/conversion/parsePipeline/applyPipelineHead.d.ts +8 -0
- package/umd/src/conversion/parsePipeline/createInitialPipelineJson.d.ts +8 -0
- package/umd/src/conversion/parsePipeline/createUniqueSectionNameResolver.d.ts +14 -0
- package/umd/src/conversion/parsePipeline/defineParameter.d.ts +8 -0
- package/umd/src/conversion/parsePipeline/extractPipelineDescription.d.ts +6 -0
- package/umd/src/conversion/parsePipeline/finalizeParsedPipeline.d.ts +8 -0
- package/umd/src/conversion/parsePipeline/getPipelineIdentification.d.ts +7 -0
- package/umd/src/conversion/parsePipeline/parsePreparedPipelineSections.d.ts +18 -0
- package/umd/src/conversion/parsePipeline/preparePipelineString.d.ts +8 -0
- package/umd/src/conversion/parsePipeline/processPipelineSection.d.ts +9 -0
- package/umd/src/version.d.ts +1 -1
package/esm/index.es.js
CHANGED
|
@@ -40,7 +40,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
40
40
|
* @generated
|
|
41
41
|
* @see https://github.com/webgptorg/promptbook
|
|
42
42
|
*/
|
|
43
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
43
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-72';
|
|
44
44
|
/**
|
|
45
45
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
46
46
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -14945,7 +14945,9 @@ const octopus3dAvatarVisual = {
|
|
|
14945
14945
|
};
|
|
14946
14946
|
const mantleRadiusX = size * morphologyProfile.body.bodyRadiusRatio * morphologyProfile.body.horizontalStretch;
|
|
14947
14947
|
const mantleRadiusY = size * morphologyProfile.body.bodyRadiusRatio * morphologyProfile.body.verticalStretch * 1.1;
|
|
14948
|
-
const mantleRadiusZ = size *
|
|
14948
|
+
const mantleRadiusZ = size *
|
|
14949
|
+
morphologyProfile.body.bodyRadiusRatio *
|
|
14950
|
+
(0.9 + (morphologyProfile.body.horizontalStretch - 1) * 0.3);
|
|
14949
14951
|
const underbodyRadiusX = mantleRadiusX * (0.9 + (morphologyProfile.tentacles.rootSpreadScale - 1) * 0.08);
|
|
14950
14952
|
const underbodyRadiusY = mantleRadiusY * (0.44 + morphologyProfile.body.lowerDropRatio * 3.1);
|
|
14951
14953
|
const underbodyRadiusZ = mantleRadiusZ * 0.78;
|
|
@@ -15031,7 +15033,11 @@ const octopus3dAvatarVisual = {
|
|
|
15031
15033
|
z: resolveEllipsoidSurfaceDepth(mantleRadiusX, mantleRadiusY, mantleRadiusZ, faceEyeSpacing, faceEyeYOffset),
|
|
15032
15034
|
}, faceEyeRadiusX, faceEyeRadiusY, mantleCenter, headPitch, headYaw, sceneCenterX, sceneCenterY, size, palette, timeMs, animationPhase + 0.7 + eyeRandom() * 0.6, interaction, morphologyProfile.face.eyeStyle);
|
|
15033
15035
|
drawProjectedMouth(context, [
|
|
15034
|
-
{
|
|
15036
|
+
{
|
|
15037
|
+
x: -mouthHalfWidth,
|
|
15038
|
+
y: mouthY,
|
|
15039
|
+
z: resolveEllipsoidSurfaceDepth(mantleRadiusX, mantleRadiusY, mantleRadiusZ, -mouthHalfWidth, mouthY),
|
|
15040
|
+
},
|
|
15035
15041
|
{
|
|
15036
15042
|
x: size * morphologyProfile.face.mouthCenterOffsetRatio,
|
|
15037
15043
|
y: mouthY +
|
|
@@ -15040,7 +15046,11 @@ const octopus3dAvatarVisual = {
|
|
|
15040
15046
|
interaction.gazeY * size * 0.01,
|
|
15041
15047
|
z: resolveEllipsoidSurfaceDepth(mantleRadiusX, mantleRadiusY, mantleRadiusZ, size * morphologyProfile.face.mouthCenterOffsetRatio, mouthY),
|
|
15042
15048
|
},
|
|
15043
|
-
{
|
|
15049
|
+
{
|
|
15050
|
+
x: mouthHalfWidth,
|
|
15051
|
+
y: mouthY,
|
|
15052
|
+
z: resolveEllipsoidSurfaceDepth(mantleRadiusX, mantleRadiusY, mantleRadiusZ, mouthHalfWidth, mouthY),
|
|
15053
|
+
},
|
|
15044
15054
|
], mantleCenter, headPitch, headYaw, sceneCenterX, sceneCenterY, palette, size);
|
|
15045
15055
|
},
|
|
15046
15056
|
};
|
|
@@ -15201,7 +15211,8 @@ function createOctopusTentacleStrokes(options) {
|
|
|
15201
15211
|
z: anchorPoint.z + Math.cos(orbitAngle) * depthReach * 0.3 + sway * size * 0.012,
|
|
15202
15212
|
};
|
|
15203
15213
|
const controlPointTwo = {
|
|
15204
|
-
x: anchorPoint.x +
|
|
15214
|
+
x: anchorPoint.x +
|
|
15215
|
+
Math.sin(orbitAngle) * lateralReach * (0.82 + morphologyProfile.tentacles.swayScale * 0.12),
|
|
15205
15216
|
y: anchorPoint.y + flowLength * 0.66,
|
|
15206
15217
|
z: anchorPoint.z + Math.cos(orbitAngle) * depthReach * 0.72 + sway * size * 0.02,
|
|
15207
15218
|
};
|
|
@@ -15266,8 +15277,7 @@ function drawTentacleStroke(context, tentacleStroke, palette) {
|
|
|
15266
15277
|
context.beginPath();
|
|
15267
15278
|
context.moveTo(startPoint.x, startPoint.y);
|
|
15268
15279
|
context.lineTo(endPoint.x, endPoint.y);
|
|
15269
|
-
context.strokeStyle =
|
|
15270
|
-
tentacleStroke.colorBias > 0.6 ? `${palette.secondary}f0` : `${palette.primary}f0`;
|
|
15280
|
+
context.strokeStyle = tentacleStroke.colorBias > 0.6 ? `${palette.secondary}f0` : `${palette.primary}f0`;
|
|
15271
15281
|
context.lineWidth = width;
|
|
15272
15282
|
context.lineCap = 'round';
|
|
15273
15283
|
context.stroke();
|
|
@@ -23462,6 +23472,212 @@ const DEFAULT_LIST_TIMEOUTS_LIMIT = 20;
|
|
|
23462
23472
|
* @private internal USE TIMEOUT constant
|
|
23463
23473
|
*/
|
|
23464
23474
|
const MAX_LIST_TIMEOUTS_LIMIT = 100;
|
|
23475
|
+
/**
|
|
23476
|
+
* Creates one formatted timeout-argument validation error.
|
|
23477
|
+
*
|
|
23478
|
+
* @private internal utility of USE TIMEOUT
|
|
23479
|
+
*/
|
|
23480
|
+
function createTimeoutToolArgsError(message) {
|
|
23481
|
+
return new PipelineExecutionError(spaceTrim$1(`
|
|
23482
|
+
${message}
|
|
23483
|
+
`));
|
|
23484
|
+
}
|
|
23485
|
+
/**
|
|
23486
|
+
* Normalizes one optional timeout id string.
|
|
23487
|
+
*
|
|
23488
|
+
* @private internal utility of USE TIMEOUT
|
|
23489
|
+
*/
|
|
23490
|
+
function normalizeOptionalTimeoutId(value) {
|
|
23491
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
23492
|
+
}
|
|
23493
|
+
/**
|
|
23494
|
+
* Parses timeout target selection for tools that accept either `timeoutId` or `allActive: true`.
|
|
23495
|
+
*
|
|
23496
|
+
* @private internal utility of USE TIMEOUT
|
|
23497
|
+
*/
|
|
23498
|
+
function parseTimeoutTargetSelection(args, options) {
|
|
23499
|
+
const timeoutId = normalizeOptionalTimeoutId(args.timeoutId);
|
|
23500
|
+
const allActive = args.allActive === true;
|
|
23501
|
+
if (timeoutId && allActive) {
|
|
23502
|
+
throw createTimeoutToolArgsError(options.bothMessage);
|
|
23503
|
+
}
|
|
23504
|
+
if (allActive) {
|
|
23505
|
+
return { allActive: true };
|
|
23506
|
+
}
|
|
23507
|
+
if (!timeoutId) {
|
|
23508
|
+
throw createTimeoutToolArgsError(options.missingMessage);
|
|
23509
|
+
}
|
|
23510
|
+
return {
|
|
23511
|
+
timeoutId,
|
|
23512
|
+
allActive: false,
|
|
23513
|
+
};
|
|
23514
|
+
}
|
|
23515
|
+
/**
|
|
23516
|
+
* Parses one explicit `dueAt` update value.
|
|
23517
|
+
*
|
|
23518
|
+
* @private internal utility of USE TIMEOUT
|
|
23519
|
+
*/
|
|
23520
|
+
function parseOptionalTimeoutDueAt(value) {
|
|
23521
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
23522
|
+
return undefined;
|
|
23523
|
+
}
|
|
23524
|
+
const normalizedDueAt = value.trim();
|
|
23525
|
+
const dueAtTimestamp = Date.parse(normalizedDueAt);
|
|
23526
|
+
if (!Number.isFinite(dueAtTimestamp)) {
|
|
23527
|
+
throw createTimeoutToolArgsError('Timeout `dueAt` must be one valid ISO timestamp.');
|
|
23528
|
+
}
|
|
23529
|
+
return new Date(dueAtTimestamp).toISOString();
|
|
23530
|
+
}
|
|
23531
|
+
/**
|
|
23532
|
+
* Parses one explicit `extendByMs` update value.
|
|
23533
|
+
*
|
|
23534
|
+
* @private internal utility of USE TIMEOUT
|
|
23535
|
+
*/
|
|
23536
|
+
function parseOptionalTimeoutExtendByMs(value) {
|
|
23537
|
+
if (typeof value !== 'number') {
|
|
23538
|
+
return undefined;
|
|
23539
|
+
}
|
|
23540
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
23541
|
+
throw createTimeoutToolArgsError('Timeout `extendByMs` must be a positive number of milliseconds.');
|
|
23542
|
+
}
|
|
23543
|
+
return Math.floor(value);
|
|
23544
|
+
}
|
|
23545
|
+
/**
|
|
23546
|
+
* Parses one explicit `recurrenceIntervalMs` update value.
|
|
23547
|
+
*
|
|
23548
|
+
* @private internal utility of USE TIMEOUT
|
|
23549
|
+
*/
|
|
23550
|
+
function parseOptionalTimeoutRecurrenceInterval(value) {
|
|
23551
|
+
if (value === null) {
|
|
23552
|
+
return null;
|
|
23553
|
+
}
|
|
23554
|
+
if (typeof value !== 'number') {
|
|
23555
|
+
return undefined;
|
|
23556
|
+
}
|
|
23557
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
23558
|
+
throw createTimeoutToolArgsError('Timeout `recurrenceIntervalMs` must be a positive number of milliseconds or `null`.');
|
|
23559
|
+
}
|
|
23560
|
+
return Math.floor(value);
|
|
23561
|
+
}
|
|
23562
|
+
/**
|
|
23563
|
+
* Parses one explicit `message` update value.
|
|
23564
|
+
*
|
|
23565
|
+
* @private internal utility of USE TIMEOUT
|
|
23566
|
+
*/
|
|
23567
|
+
function parseOptionalTimeoutMessage(value) {
|
|
23568
|
+
if (value === null) {
|
|
23569
|
+
return null;
|
|
23570
|
+
}
|
|
23571
|
+
if (typeof value !== 'string') {
|
|
23572
|
+
return undefined;
|
|
23573
|
+
}
|
|
23574
|
+
const normalizedMessage = value.trim();
|
|
23575
|
+
return normalizedMessage.length > 0 ? normalizedMessage : null;
|
|
23576
|
+
}
|
|
23577
|
+
/**
|
|
23578
|
+
* Parses one explicit `parameters` update value.
|
|
23579
|
+
*
|
|
23580
|
+
* @private internal utility of USE TIMEOUT
|
|
23581
|
+
*/
|
|
23582
|
+
function parseOptionalTimeoutParameters(value) {
|
|
23583
|
+
if (value === undefined) {
|
|
23584
|
+
return undefined;
|
|
23585
|
+
}
|
|
23586
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
23587
|
+
throw createTimeoutToolArgsError('Timeout `parameters` must be one JSON object.');
|
|
23588
|
+
}
|
|
23589
|
+
return value;
|
|
23590
|
+
}
|
|
23591
|
+
/**
|
|
23592
|
+
* Parses one explicit `paused` update value.
|
|
23593
|
+
*
|
|
23594
|
+
* @private internal utility of USE TIMEOUT
|
|
23595
|
+
*/
|
|
23596
|
+
function parseOptionalTimeoutPaused(value) {
|
|
23597
|
+
return typeof value === 'boolean' ? value : undefined;
|
|
23598
|
+
}
|
|
23599
|
+
/**
|
|
23600
|
+
* Parses patch fields for `update_timeout`.
|
|
23601
|
+
*
|
|
23602
|
+
* @private internal utility of USE TIMEOUT
|
|
23603
|
+
*/
|
|
23604
|
+
function parseTimeoutUpdatePatch(args) {
|
|
23605
|
+
const patch = {};
|
|
23606
|
+
const dueAt = parseOptionalTimeoutDueAt(args.dueAt);
|
|
23607
|
+
const extendByMs = parseOptionalTimeoutExtendByMs(args.extendByMs);
|
|
23608
|
+
const recurrenceIntervalMs = parseOptionalTimeoutRecurrenceInterval(args.recurrenceIntervalMs);
|
|
23609
|
+
const message = parseOptionalTimeoutMessage(args.message);
|
|
23610
|
+
const parameters = parseOptionalTimeoutParameters(args.parameters);
|
|
23611
|
+
const paused = parseOptionalTimeoutPaused(args.paused);
|
|
23612
|
+
if (dueAt !== undefined) {
|
|
23613
|
+
patch.dueAt = dueAt;
|
|
23614
|
+
}
|
|
23615
|
+
if (extendByMs !== undefined) {
|
|
23616
|
+
patch.extendByMs = extendByMs;
|
|
23617
|
+
}
|
|
23618
|
+
if (patch.dueAt !== undefined && patch.extendByMs !== undefined) {
|
|
23619
|
+
throw createTimeoutToolArgsError('Timeout update cannot include both `dueAt` and `extendByMs`.');
|
|
23620
|
+
}
|
|
23621
|
+
if (recurrenceIntervalMs !== undefined) {
|
|
23622
|
+
patch.recurrenceIntervalMs = recurrenceIntervalMs;
|
|
23623
|
+
}
|
|
23624
|
+
if (message !== undefined) {
|
|
23625
|
+
patch.message = message;
|
|
23626
|
+
}
|
|
23627
|
+
if (parameters !== undefined) {
|
|
23628
|
+
patch.parameters = parameters;
|
|
23629
|
+
}
|
|
23630
|
+
if (paused !== undefined) {
|
|
23631
|
+
patch.paused = paused;
|
|
23632
|
+
}
|
|
23633
|
+
return patch;
|
|
23634
|
+
}
|
|
23635
|
+
/**
|
|
23636
|
+
* Determines whether the patch contains fields that are only supported for single-timeout updates.
|
|
23637
|
+
*
|
|
23638
|
+
* @private internal utility of USE TIMEOUT
|
|
23639
|
+
*/
|
|
23640
|
+
function hasSingleTimeoutOnlyPatchFields(patch) {
|
|
23641
|
+
return (patch.dueAt !== undefined ||
|
|
23642
|
+
patch.extendByMs !== undefined ||
|
|
23643
|
+
patch.recurrenceIntervalMs !== undefined ||
|
|
23644
|
+
patch.message !== undefined ||
|
|
23645
|
+
patch.parameters !== undefined);
|
|
23646
|
+
}
|
|
23647
|
+
/**
|
|
23648
|
+
* Parses bulk timeout update arguments.
|
|
23649
|
+
*
|
|
23650
|
+
* @private internal utility of USE TIMEOUT
|
|
23651
|
+
*/
|
|
23652
|
+
function parseBulkTimeoutUpdateArgs(patch) {
|
|
23653
|
+
if (patch.paused === undefined) {
|
|
23654
|
+
throw createTimeoutToolArgsError('Bulk timeout update with `allActive: true` requires `paused` to be explicitly set.');
|
|
23655
|
+
}
|
|
23656
|
+
if (hasSingleTimeoutOnlyPatchFields(patch)) {
|
|
23657
|
+
throw createTimeoutToolArgsError('Bulk timeout update only supports the `paused` field.');
|
|
23658
|
+
}
|
|
23659
|
+
return {
|
|
23660
|
+
allActive: true,
|
|
23661
|
+
paused: patch.paused,
|
|
23662
|
+
};
|
|
23663
|
+
}
|
|
23664
|
+
/**
|
|
23665
|
+
* Parses single-timeout update arguments.
|
|
23666
|
+
*
|
|
23667
|
+
* @private internal utility of USE TIMEOUT
|
|
23668
|
+
*/
|
|
23669
|
+
function parseSingleTimeoutUpdateArgs(timeoutId, patch) {
|
|
23670
|
+
if (!timeoutId) {
|
|
23671
|
+
throw createTimeoutToolArgsError('Timeout `timeoutId` is required for single-timeout updates.');
|
|
23672
|
+
}
|
|
23673
|
+
if (Object.keys(patch).length === 0) {
|
|
23674
|
+
throw createTimeoutToolArgsError('Timeout update must include at least one editable field.');
|
|
23675
|
+
}
|
|
23676
|
+
return {
|
|
23677
|
+
timeoutId,
|
|
23678
|
+
patch,
|
|
23679
|
+
};
|
|
23680
|
+
}
|
|
23465
23681
|
/**
|
|
23466
23682
|
* Parses and validates `USE TIMEOUT` tool arguments.
|
|
23467
23683
|
*
|
|
@@ -23488,22 +23704,14 @@ const parseTimeoutToolArgs = {
|
|
|
23488
23704
|
* Parses `cancel_timeout` input.
|
|
23489
23705
|
*/
|
|
23490
23706
|
cancel(args) {
|
|
23491
|
-
const
|
|
23492
|
-
|
|
23493
|
-
|
|
23494
|
-
|
|
23495
|
-
|
|
23496
|
-
`));
|
|
23497
|
-
}
|
|
23498
|
-
if (allActive) {
|
|
23707
|
+
const target = parseTimeoutTargetSelection(args, {
|
|
23708
|
+
bothMessage: 'Timeout cancellation must target either one `timeoutId` or `allActive: true`, not both.',
|
|
23709
|
+
missingMessage: 'Timeout `timeoutId` is required unless you pass `allActive: true`.',
|
|
23710
|
+
});
|
|
23711
|
+
if (target.allActive) {
|
|
23499
23712
|
return { allActive: true };
|
|
23500
23713
|
}
|
|
23501
|
-
|
|
23502
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23503
|
-
Timeout \`timeoutId\` is required unless you pass \`allActive: true\`.
|
|
23504
|
-
`));
|
|
23505
|
-
}
|
|
23506
|
-
return { timeoutId };
|
|
23714
|
+
return { timeoutId: target.timeoutId };
|
|
23507
23715
|
},
|
|
23508
23716
|
/**
|
|
23509
23717
|
* Parses `list_timeouts` input.
|
|
@@ -23534,106 +23742,14 @@ const parseTimeoutToolArgs = {
|
|
|
23534
23742
|
* Parses `update_timeout` input.
|
|
23535
23743
|
*/
|
|
23536
23744
|
update(args) {
|
|
23537
|
-
const
|
|
23538
|
-
|
|
23539
|
-
|
|
23540
|
-
|
|
23541
|
-
|
|
23542
|
-
|
|
23543
|
-
|
|
23544
|
-
|
|
23545
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23546
|
-
Timeout update requires one \`timeoutId\` or \`allActive: true\`.
|
|
23547
|
-
`));
|
|
23548
|
-
}
|
|
23549
|
-
const patch = {};
|
|
23550
|
-
if (typeof args.dueAt === 'string' && args.dueAt.trim().length > 0) {
|
|
23551
|
-
const normalizedDueAt = args.dueAt.trim();
|
|
23552
|
-
const dueAtTimestamp = Date.parse(normalizedDueAt);
|
|
23553
|
-
if (!Number.isFinite(dueAtTimestamp)) {
|
|
23554
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23555
|
-
Timeout \`dueAt\` must be one valid ISO timestamp.
|
|
23556
|
-
`));
|
|
23557
|
-
}
|
|
23558
|
-
patch.dueAt = new Date(dueAtTimestamp).toISOString();
|
|
23559
|
-
}
|
|
23560
|
-
if (typeof args.extendByMs === 'number') {
|
|
23561
|
-
if (!Number.isFinite(args.extendByMs) || args.extendByMs <= 0) {
|
|
23562
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23563
|
-
Timeout \`extendByMs\` must be a positive number of milliseconds.
|
|
23564
|
-
`));
|
|
23565
|
-
}
|
|
23566
|
-
patch.extendByMs = Math.floor(args.extendByMs);
|
|
23567
|
-
}
|
|
23568
|
-
if (patch.dueAt !== undefined && patch.extendByMs !== undefined) {
|
|
23569
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23570
|
-
Timeout update cannot include both \`dueAt\` and \`extendByMs\`.
|
|
23571
|
-
`));
|
|
23572
|
-
}
|
|
23573
|
-
if (args.recurrenceIntervalMs === null) {
|
|
23574
|
-
patch.recurrenceIntervalMs = null;
|
|
23575
|
-
}
|
|
23576
|
-
else if (typeof args.recurrenceIntervalMs === 'number') {
|
|
23577
|
-
if (!Number.isFinite(args.recurrenceIntervalMs) || args.recurrenceIntervalMs <= 0) {
|
|
23578
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23579
|
-
Timeout \`recurrenceIntervalMs\` must be a positive number of milliseconds or \`null\`.
|
|
23580
|
-
`));
|
|
23581
|
-
}
|
|
23582
|
-
patch.recurrenceIntervalMs = Math.floor(args.recurrenceIntervalMs);
|
|
23583
|
-
}
|
|
23584
|
-
if (args.message === null) {
|
|
23585
|
-
patch.message = null;
|
|
23586
|
-
}
|
|
23587
|
-
else if (typeof args.message === 'string') {
|
|
23588
|
-
const normalizedMessage = args.message.trim();
|
|
23589
|
-
patch.message = normalizedMessage.length > 0 ? normalizedMessage : null;
|
|
23590
|
-
}
|
|
23591
|
-
if (args.parameters !== undefined) {
|
|
23592
|
-
if (!args.parameters || typeof args.parameters !== 'object' || Array.isArray(args.parameters)) {
|
|
23593
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23594
|
-
Timeout \`parameters\` must be one JSON object.
|
|
23595
|
-
`));
|
|
23596
|
-
}
|
|
23597
|
-
patch.parameters = args.parameters;
|
|
23598
|
-
}
|
|
23599
|
-
if (typeof args.paused === 'boolean') {
|
|
23600
|
-
patch.paused = args.paused;
|
|
23601
|
-
}
|
|
23602
|
-
if (allActive) {
|
|
23603
|
-
if (patch.paused === undefined) {
|
|
23604
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23605
|
-
Bulk timeout update with \`allActive: true\` requires \`paused\` to be explicitly set.
|
|
23606
|
-
`));
|
|
23607
|
-
}
|
|
23608
|
-
const hasSingleOnlyPatch = patch.dueAt !== undefined ||
|
|
23609
|
-
patch.extendByMs !== undefined ||
|
|
23610
|
-
patch.recurrenceIntervalMs !== undefined ||
|
|
23611
|
-
patch.message !== undefined ||
|
|
23612
|
-
patch.parameters !== undefined;
|
|
23613
|
-
if (hasSingleOnlyPatch) {
|
|
23614
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23615
|
-
Bulk timeout update only supports the \`paused\` field.
|
|
23616
|
-
`));
|
|
23617
|
-
}
|
|
23618
|
-
return {
|
|
23619
|
-
allActive: true,
|
|
23620
|
-
paused: patch.paused,
|
|
23621
|
-
};
|
|
23622
|
-
}
|
|
23623
|
-
if (!timeoutId) {
|
|
23624
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23625
|
-
Timeout \`timeoutId\` is required for single-timeout updates.
|
|
23626
|
-
`));
|
|
23627
|
-
}
|
|
23628
|
-
if (Object.keys(patch).length === 0) {
|
|
23629
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
23630
|
-
Timeout update must include at least one editable field.
|
|
23631
|
-
`));
|
|
23632
|
-
}
|
|
23633
|
-
return {
|
|
23634
|
-
timeoutId,
|
|
23635
|
-
patch,
|
|
23636
|
-
};
|
|
23745
|
+
const target = parseTimeoutTargetSelection(args, {
|
|
23746
|
+
bothMessage: 'Timeout update must target either one `timeoutId` or `allActive: true`, not both.',
|
|
23747
|
+
missingMessage: 'Timeout update requires one `timeoutId` or `allActive: true`.',
|
|
23748
|
+
});
|
|
23749
|
+
const patch = parseTimeoutUpdatePatch(args);
|
|
23750
|
+
return target.allActive
|
|
23751
|
+
? parseBulkTimeoutUpdateArgs(patch)
|
|
23752
|
+
: parseSingleTimeoutUpdateArgs(target.timeoutId, patch);
|
|
23637
23753
|
},
|
|
23638
23754
|
};
|
|
23639
23755
|
|