@promptbook/browser 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
|
@@ -29,7 +29,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
29
29
|
* @generated
|
|
30
30
|
* @see https://github.com/webgptorg/promptbook
|
|
31
31
|
*/
|
|
32
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
32
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-72';
|
|
33
33
|
/**
|
|
34
34
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
35
35
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -7908,7 +7908,9 @@ const octopus3dAvatarVisual = {
|
|
|
7908
7908
|
};
|
|
7909
7909
|
const mantleRadiusX = size * morphologyProfile.body.bodyRadiusRatio * morphologyProfile.body.horizontalStretch;
|
|
7910
7910
|
const mantleRadiusY = size * morphologyProfile.body.bodyRadiusRatio * morphologyProfile.body.verticalStretch * 1.1;
|
|
7911
|
-
const mantleRadiusZ = size *
|
|
7911
|
+
const mantleRadiusZ = size *
|
|
7912
|
+
morphologyProfile.body.bodyRadiusRatio *
|
|
7913
|
+
(0.9 + (morphologyProfile.body.horizontalStretch - 1) * 0.3);
|
|
7912
7914
|
const underbodyRadiusX = mantleRadiusX * (0.9 + (morphologyProfile.tentacles.rootSpreadScale - 1) * 0.08);
|
|
7913
7915
|
const underbodyRadiusY = mantleRadiusY * (0.44 + morphologyProfile.body.lowerDropRatio * 3.1);
|
|
7914
7916
|
const underbodyRadiusZ = mantleRadiusZ * 0.78;
|
|
@@ -7994,7 +7996,11 @@ const octopus3dAvatarVisual = {
|
|
|
7994
7996
|
z: resolveEllipsoidSurfaceDepth(mantleRadiusX, mantleRadiusY, mantleRadiusZ, faceEyeSpacing, faceEyeYOffset),
|
|
7995
7997
|
}, faceEyeRadiusX, faceEyeRadiusY, mantleCenter, headPitch, headYaw, sceneCenterX, sceneCenterY, size, palette, timeMs, animationPhase + 0.7 + eyeRandom() * 0.6, interaction, morphologyProfile.face.eyeStyle);
|
|
7996
7998
|
drawProjectedMouth(context, [
|
|
7997
|
-
{
|
|
7999
|
+
{
|
|
8000
|
+
x: -mouthHalfWidth,
|
|
8001
|
+
y: mouthY,
|
|
8002
|
+
z: resolveEllipsoidSurfaceDepth(mantleRadiusX, mantleRadiusY, mantleRadiusZ, -mouthHalfWidth, mouthY),
|
|
8003
|
+
},
|
|
7998
8004
|
{
|
|
7999
8005
|
x: size * morphologyProfile.face.mouthCenterOffsetRatio,
|
|
8000
8006
|
y: mouthY +
|
|
@@ -8003,7 +8009,11 @@ const octopus3dAvatarVisual = {
|
|
|
8003
8009
|
interaction.gazeY * size * 0.01,
|
|
8004
8010
|
z: resolveEllipsoidSurfaceDepth(mantleRadiusX, mantleRadiusY, mantleRadiusZ, size * morphologyProfile.face.mouthCenterOffsetRatio, mouthY),
|
|
8005
8011
|
},
|
|
8006
|
-
{
|
|
8012
|
+
{
|
|
8013
|
+
x: mouthHalfWidth,
|
|
8014
|
+
y: mouthY,
|
|
8015
|
+
z: resolveEllipsoidSurfaceDepth(mantleRadiusX, mantleRadiusY, mantleRadiusZ, mouthHalfWidth, mouthY),
|
|
8016
|
+
},
|
|
8007
8017
|
], mantleCenter, headPitch, headYaw, sceneCenterX, sceneCenterY, palette, size);
|
|
8008
8018
|
},
|
|
8009
8019
|
};
|
|
@@ -8164,7 +8174,8 @@ function createOctopusTentacleStrokes(options) {
|
|
|
8164
8174
|
z: anchorPoint.z + Math.cos(orbitAngle) * depthReach * 0.3 + sway * size * 0.012,
|
|
8165
8175
|
};
|
|
8166
8176
|
const controlPointTwo = {
|
|
8167
|
-
x: anchorPoint.x +
|
|
8177
|
+
x: anchorPoint.x +
|
|
8178
|
+
Math.sin(orbitAngle) * lateralReach * (0.82 + morphologyProfile.tentacles.swayScale * 0.12),
|
|
8168
8179
|
y: anchorPoint.y + flowLength * 0.66,
|
|
8169
8180
|
z: anchorPoint.z + Math.cos(orbitAngle) * depthReach * 0.72 + sway * size * 0.02,
|
|
8170
8181
|
};
|
|
@@ -8229,8 +8240,7 @@ function drawTentacleStroke(context, tentacleStroke, palette) {
|
|
|
8229
8240
|
context.beginPath();
|
|
8230
8241
|
context.moveTo(startPoint.x, startPoint.y);
|
|
8231
8242
|
context.lineTo(endPoint.x, endPoint.y);
|
|
8232
|
-
context.strokeStyle =
|
|
8233
|
-
tentacleStroke.colorBias > 0.6 ? `${palette.secondary}f0` : `${palette.primary}f0`;
|
|
8243
|
+
context.strokeStyle = tentacleStroke.colorBias > 0.6 ? `${palette.secondary}f0` : `${palette.primary}f0`;
|
|
8234
8244
|
context.lineWidth = width;
|
|
8235
8245
|
context.lineCap = 'round';
|
|
8236
8246
|
context.stroke();
|
|
@@ -16593,6 +16603,212 @@ const DEFAULT_LIST_TIMEOUTS_LIMIT = 20;
|
|
|
16593
16603
|
* @private internal USE TIMEOUT constant
|
|
16594
16604
|
*/
|
|
16595
16605
|
const MAX_LIST_TIMEOUTS_LIMIT = 100;
|
|
16606
|
+
/**
|
|
16607
|
+
* Creates one formatted timeout-argument validation error.
|
|
16608
|
+
*
|
|
16609
|
+
* @private internal utility of USE TIMEOUT
|
|
16610
|
+
*/
|
|
16611
|
+
function createTimeoutToolArgsError(message) {
|
|
16612
|
+
return new PipelineExecutionError(spaceTrim$1(`
|
|
16613
|
+
${message}
|
|
16614
|
+
`));
|
|
16615
|
+
}
|
|
16616
|
+
/**
|
|
16617
|
+
* Normalizes one optional timeout id string.
|
|
16618
|
+
*
|
|
16619
|
+
* @private internal utility of USE TIMEOUT
|
|
16620
|
+
*/
|
|
16621
|
+
function normalizeOptionalTimeoutId(value) {
|
|
16622
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
16623
|
+
}
|
|
16624
|
+
/**
|
|
16625
|
+
* Parses timeout target selection for tools that accept either `timeoutId` or `allActive: true`.
|
|
16626
|
+
*
|
|
16627
|
+
* @private internal utility of USE TIMEOUT
|
|
16628
|
+
*/
|
|
16629
|
+
function parseTimeoutTargetSelection(args, options) {
|
|
16630
|
+
const timeoutId = normalizeOptionalTimeoutId(args.timeoutId);
|
|
16631
|
+
const allActive = args.allActive === true;
|
|
16632
|
+
if (timeoutId && allActive) {
|
|
16633
|
+
throw createTimeoutToolArgsError(options.bothMessage);
|
|
16634
|
+
}
|
|
16635
|
+
if (allActive) {
|
|
16636
|
+
return { allActive: true };
|
|
16637
|
+
}
|
|
16638
|
+
if (!timeoutId) {
|
|
16639
|
+
throw createTimeoutToolArgsError(options.missingMessage);
|
|
16640
|
+
}
|
|
16641
|
+
return {
|
|
16642
|
+
timeoutId,
|
|
16643
|
+
allActive: false,
|
|
16644
|
+
};
|
|
16645
|
+
}
|
|
16646
|
+
/**
|
|
16647
|
+
* Parses one explicit `dueAt` update value.
|
|
16648
|
+
*
|
|
16649
|
+
* @private internal utility of USE TIMEOUT
|
|
16650
|
+
*/
|
|
16651
|
+
function parseOptionalTimeoutDueAt(value) {
|
|
16652
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
16653
|
+
return undefined;
|
|
16654
|
+
}
|
|
16655
|
+
const normalizedDueAt = value.trim();
|
|
16656
|
+
const dueAtTimestamp = Date.parse(normalizedDueAt);
|
|
16657
|
+
if (!Number.isFinite(dueAtTimestamp)) {
|
|
16658
|
+
throw createTimeoutToolArgsError('Timeout `dueAt` must be one valid ISO timestamp.');
|
|
16659
|
+
}
|
|
16660
|
+
return new Date(dueAtTimestamp).toISOString();
|
|
16661
|
+
}
|
|
16662
|
+
/**
|
|
16663
|
+
* Parses one explicit `extendByMs` update value.
|
|
16664
|
+
*
|
|
16665
|
+
* @private internal utility of USE TIMEOUT
|
|
16666
|
+
*/
|
|
16667
|
+
function parseOptionalTimeoutExtendByMs(value) {
|
|
16668
|
+
if (typeof value !== 'number') {
|
|
16669
|
+
return undefined;
|
|
16670
|
+
}
|
|
16671
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
16672
|
+
throw createTimeoutToolArgsError('Timeout `extendByMs` must be a positive number of milliseconds.');
|
|
16673
|
+
}
|
|
16674
|
+
return Math.floor(value);
|
|
16675
|
+
}
|
|
16676
|
+
/**
|
|
16677
|
+
* Parses one explicit `recurrenceIntervalMs` update value.
|
|
16678
|
+
*
|
|
16679
|
+
* @private internal utility of USE TIMEOUT
|
|
16680
|
+
*/
|
|
16681
|
+
function parseOptionalTimeoutRecurrenceInterval(value) {
|
|
16682
|
+
if (value === null) {
|
|
16683
|
+
return null;
|
|
16684
|
+
}
|
|
16685
|
+
if (typeof value !== 'number') {
|
|
16686
|
+
return undefined;
|
|
16687
|
+
}
|
|
16688
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
16689
|
+
throw createTimeoutToolArgsError('Timeout `recurrenceIntervalMs` must be a positive number of milliseconds or `null`.');
|
|
16690
|
+
}
|
|
16691
|
+
return Math.floor(value);
|
|
16692
|
+
}
|
|
16693
|
+
/**
|
|
16694
|
+
* Parses one explicit `message` update value.
|
|
16695
|
+
*
|
|
16696
|
+
* @private internal utility of USE TIMEOUT
|
|
16697
|
+
*/
|
|
16698
|
+
function parseOptionalTimeoutMessage(value) {
|
|
16699
|
+
if (value === null) {
|
|
16700
|
+
return null;
|
|
16701
|
+
}
|
|
16702
|
+
if (typeof value !== 'string') {
|
|
16703
|
+
return undefined;
|
|
16704
|
+
}
|
|
16705
|
+
const normalizedMessage = value.trim();
|
|
16706
|
+
return normalizedMessage.length > 0 ? normalizedMessage : null;
|
|
16707
|
+
}
|
|
16708
|
+
/**
|
|
16709
|
+
* Parses one explicit `parameters` update value.
|
|
16710
|
+
*
|
|
16711
|
+
* @private internal utility of USE TIMEOUT
|
|
16712
|
+
*/
|
|
16713
|
+
function parseOptionalTimeoutParameters(value) {
|
|
16714
|
+
if (value === undefined) {
|
|
16715
|
+
return undefined;
|
|
16716
|
+
}
|
|
16717
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
16718
|
+
throw createTimeoutToolArgsError('Timeout `parameters` must be one JSON object.');
|
|
16719
|
+
}
|
|
16720
|
+
return value;
|
|
16721
|
+
}
|
|
16722
|
+
/**
|
|
16723
|
+
* Parses one explicit `paused` update value.
|
|
16724
|
+
*
|
|
16725
|
+
* @private internal utility of USE TIMEOUT
|
|
16726
|
+
*/
|
|
16727
|
+
function parseOptionalTimeoutPaused(value) {
|
|
16728
|
+
return typeof value === 'boolean' ? value : undefined;
|
|
16729
|
+
}
|
|
16730
|
+
/**
|
|
16731
|
+
* Parses patch fields for `update_timeout`.
|
|
16732
|
+
*
|
|
16733
|
+
* @private internal utility of USE TIMEOUT
|
|
16734
|
+
*/
|
|
16735
|
+
function parseTimeoutUpdatePatch(args) {
|
|
16736
|
+
const patch = {};
|
|
16737
|
+
const dueAt = parseOptionalTimeoutDueAt(args.dueAt);
|
|
16738
|
+
const extendByMs = parseOptionalTimeoutExtendByMs(args.extendByMs);
|
|
16739
|
+
const recurrenceIntervalMs = parseOptionalTimeoutRecurrenceInterval(args.recurrenceIntervalMs);
|
|
16740
|
+
const message = parseOptionalTimeoutMessage(args.message);
|
|
16741
|
+
const parameters = parseOptionalTimeoutParameters(args.parameters);
|
|
16742
|
+
const paused = parseOptionalTimeoutPaused(args.paused);
|
|
16743
|
+
if (dueAt !== undefined) {
|
|
16744
|
+
patch.dueAt = dueAt;
|
|
16745
|
+
}
|
|
16746
|
+
if (extendByMs !== undefined) {
|
|
16747
|
+
patch.extendByMs = extendByMs;
|
|
16748
|
+
}
|
|
16749
|
+
if (patch.dueAt !== undefined && patch.extendByMs !== undefined) {
|
|
16750
|
+
throw createTimeoutToolArgsError('Timeout update cannot include both `dueAt` and `extendByMs`.');
|
|
16751
|
+
}
|
|
16752
|
+
if (recurrenceIntervalMs !== undefined) {
|
|
16753
|
+
patch.recurrenceIntervalMs = recurrenceIntervalMs;
|
|
16754
|
+
}
|
|
16755
|
+
if (message !== undefined) {
|
|
16756
|
+
patch.message = message;
|
|
16757
|
+
}
|
|
16758
|
+
if (parameters !== undefined) {
|
|
16759
|
+
patch.parameters = parameters;
|
|
16760
|
+
}
|
|
16761
|
+
if (paused !== undefined) {
|
|
16762
|
+
patch.paused = paused;
|
|
16763
|
+
}
|
|
16764
|
+
return patch;
|
|
16765
|
+
}
|
|
16766
|
+
/**
|
|
16767
|
+
* Determines whether the patch contains fields that are only supported for single-timeout updates.
|
|
16768
|
+
*
|
|
16769
|
+
* @private internal utility of USE TIMEOUT
|
|
16770
|
+
*/
|
|
16771
|
+
function hasSingleTimeoutOnlyPatchFields(patch) {
|
|
16772
|
+
return (patch.dueAt !== undefined ||
|
|
16773
|
+
patch.extendByMs !== undefined ||
|
|
16774
|
+
patch.recurrenceIntervalMs !== undefined ||
|
|
16775
|
+
patch.message !== undefined ||
|
|
16776
|
+
patch.parameters !== undefined);
|
|
16777
|
+
}
|
|
16778
|
+
/**
|
|
16779
|
+
* Parses bulk timeout update arguments.
|
|
16780
|
+
*
|
|
16781
|
+
* @private internal utility of USE TIMEOUT
|
|
16782
|
+
*/
|
|
16783
|
+
function parseBulkTimeoutUpdateArgs(patch) {
|
|
16784
|
+
if (patch.paused === undefined) {
|
|
16785
|
+
throw createTimeoutToolArgsError('Bulk timeout update with `allActive: true` requires `paused` to be explicitly set.');
|
|
16786
|
+
}
|
|
16787
|
+
if (hasSingleTimeoutOnlyPatchFields(patch)) {
|
|
16788
|
+
throw createTimeoutToolArgsError('Bulk timeout update only supports the `paused` field.');
|
|
16789
|
+
}
|
|
16790
|
+
return {
|
|
16791
|
+
allActive: true,
|
|
16792
|
+
paused: patch.paused,
|
|
16793
|
+
};
|
|
16794
|
+
}
|
|
16795
|
+
/**
|
|
16796
|
+
* Parses single-timeout update arguments.
|
|
16797
|
+
*
|
|
16798
|
+
* @private internal utility of USE TIMEOUT
|
|
16799
|
+
*/
|
|
16800
|
+
function parseSingleTimeoutUpdateArgs(timeoutId, patch) {
|
|
16801
|
+
if (!timeoutId) {
|
|
16802
|
+
throw createTimeoutToolArgsError('Timeout `timeoutId` is required for single-timeout updates.');
|
|
16803
|
+
}
|
|
16804
|
+
if (Object.keys(patch).length === 0) {
|
|
16805
|
+
throw createTimeoutToolArgsError('Timeout update must include at least one editable field.');
|
|
16806
|
+
}
|
|
16807
|
+
return {
|
|
16808
|
+
timeoutId,
|
|
16809
|
+
patch,
|
|
16810
|
+
};
|
|
16811
|
+
}
|
|
16596
16812
|
/**
|
|
16597
16813
|
* Parses and validates `USE TIMEOUT` tool arguments.
|
|
16598
16814
|
*
|
|
@@ -16619,22 +16835,14 @@ const parseTimeoutToolArgs = {
|
|
|
16619
16835
|
* Parses `cancel_timeout` input.
|
|
16620
16836
|
*/
|
|
16621
16837
|
cancel(args) {
|
|
16622
|
-
const
|
|
16623
|
-
|
|
16624
|
-
|
|
16625
|
-
|
|
16626
|
-
|
|
16627
|
-
`));
|
|
16628
|
-
}
|
|
16629
|
-
if (allActive) {
|
|
16838
|
+
const target = parseTimeoutTargetSelection(args, {
|
|
16839
|
+
bothMessage: 'Timeout cancellation must target either one `timeoutId` or `allActive: true`, not both.',
|
|
16840
|
+
missingMessage: 'Timeout `timeoutId` is required unless you pass `allActive: true`.',
|
|
16841
|
+
});
|
|
16842
|
+
if (target.allActive) {
|
|
16630
16843
|
return { allActive: true };
|
|
16631
16844
|
}
|
|
16632
|
-
|
|
16633
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16634
|
-
Timeout \`timeoutId\` is required unless you pass \`allActive: true\`.
|
|
16635
|
-
`));
|
|
16636
|
-
}
|
|
16637
|
-
return { timeoutId };
|
|
16845
|
+
return { timeoutId: target.timeoutId };
|
|
16638
16846
|
},
|
|
16639
16847
|
/**
|
|
16640
16848
|
* Parses `list_timeouts` input.
|
|
@@ -16665,106 +16873,14 @@ const parseTimeoutToolArgs = {
|
|
|
16665
16873
|
* Parses `update_timeout` input.
|
|
16666
16874
|
*/
|
|
16667
16875
|
update(args) {
|
|
16668
|
-
const
|
|
16669
|
-
|
|
16670
|
-
|
|
16671
|
-
|
|
16672
|
-
|
|
16673
|
-
|
|
16674
|
-
|
|
16675
|
-
|
|
16676
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16677
|
-
Timeout update requires one \`timeoutId\` or \`allActive: true\`.
|
|
16678
|
-
`));
|
|
16679
|
-
}
|
|
16680
|
-
const patch = {};
|
|
16681
|
-
if (typeof args.dueAt === 'string' && args.dueAt.trim().length > 0) {
|
|
16682
|
-
const normalizedDueAt = args.dueAt.trim();
|
|
16683
|
-
const dueAtTimestamp = Date.parse(normalizedDueAt);
|
|
16684
|
-
if (!Number.isFinite(dueAtTimestamp)) {
|
|
16685
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16686
|
-
Timeout \`dueAt\` must be one valid ISO timestamp.
|
|
16687
|
-
`));
|
|
16688
|
-
}
|
|
16689
|
-
patch.dueAt = new Date(dueAtTimestamp).toISOString();
|
|
16690
|
-
}
|
|
16691
|
-
if (typeof args.extendByMs === 'number') {
|
|
16692
|
-
if (!Number.isFinite(args.extendByMs) || args.extendByMs <= 0) {
|
|
16693
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16694
|
-
Timeout \`extendByMs\` must be a positive number of milliseconds.
|
|
16695
|
-
`));
|
|
16696
|
-
}
|
|
16697
|
-
patch.extendByMs = Math.floor(args.extendByMs);
|
|
16698
|
-
}
|
|
16699
|
-
if (patch.dueAt !== undefined && patch.extendByMs !== undefined) {
|
|
16700
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16701
|
-
Timeout update cannot include both \`dueAt\` and \`extendByMs\`.
|
|
16702
|
-
`));
|
|
16703
|
-
}
|
|
16704
|
-
if (args.recurrenceIntervalMs === null) {
|
|
16705
|
-
patch.recurrenceIntervalMs = null;
|
|
16706
|
-
}
|
|
16707
|
-
else if (typeof args.recurrenceIntervalMs === 'number') {
|
|
16708
|
-
if (!Number.isFinite(args.recurrenceIntervalMs) || args.recurrenceIntervalMs <= 0) {
|
|
16709
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16710
|
-
Timeout \`recurrenceIntervalMs\` must be a positive number of milliseconds or \`null\`.
|
|
16711
|
-
`));
|
|
16712
|
-
}
|
|
16713
|
-
patch.recurrenceIntervalMs = Math.floor(args.recurrenceIntervalMs);
|
|
16714
|
-
}
|
|
16715
|
-
if (args.message === null) {
|
|
16716
|
-
patch.message = null;
|
|
16717
|
-
}
|
|
16718
|
-
else if (typeof args.message === 'string') {
|
|
16719
|
-
const normalizedMessage = args.message.trim();
|
|
16720
|
-
patch.message = normalizedMessage.length > 0 ? normalizedMessage : null;
|
|
16721
|
-
}
|
|
16722
|
-
if (args.parameters !== undefined) {
|
|
16723
|
-
if (!args.parameters || typeof args.parameters !== 'object' || Array.isArray(args.parameters)) {
|
|
16724
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16725
|
-
Timeout \`parameters\` must be one JSON object.
|
|
16726
|
-
`));
|
|
16727
|
-
}
|
|
16728
|
-
patch.parameters = args.parameters;
|
|
16729
|
-
}
|
|
16730
|
-
if (typeof args.paused === 'boolean') {
|
|
16731
|
-
patch.paused = args.paused;
|
|
16732
|
-
}
|
|
16733
|
-
if (allActive) {
|
|
16734
|
-
if (patch.paused === undefined) {
|
|
16735
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16736
|
-
Bulk timeout update with \`allActive: true\` requires \`paused\` to be explicitly set.
|
|
16737
|
-
`));
|
|
16738
|
-
}
|
|
16739
|
-
const hasSingleOnlyPatch = patch.dueAt !== undefined ||
|
|
16740
|
-
patch.extendByMs !== undefined ||
|
|
16741
|
-
patch.recurrenceIntervalMs !== undefined ||
|
|
16742
|
-
patch.message !== undefined ||
|
|
16743
|
-
patch.parameters !== undefined;
|
|
16744
|
-
if (hasSingleOnlyPatch) {
|
|
16745
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16746
|
-
Bulk timeout update only supports the \`paused\` field.
|
|
16747
|
-
`));
|
|
16748
|
-
}
|
|
16749
|
-
return {
|
|
16750
|
-
allActive: true,
|
|
16751
|
-
paused: patch.paused,
|
|
16752
|
-
};
|
|
16753
|
-
}
|
|
16754
|
-
if (!timeoutId) {
|
|
16755
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16756
|
-
Timeout \`timeoutId\` is required for single-timeout updates.
|
|
16757
|
-
`));
|
|
16758
|
-
}
|
|
16759
|
-
if (Object.keys(patch).length === 0) {
|
|
16760
|
-
throw new PipelineExecutionError(spaceTrim$1(`
|
|
16761
|
-
Timeout update must include at least one editable field.
|
|
16762
|
-
`));
|
|
16763
|
-
}
|
|
16764
|
-
return {
|
|
16765
|
-
timeoutId,
|
|
16766
|
-
patch,
|
|
16767
|
-
};
|
|
16876
|
+
const target = parseTimeoutTargetSelection(args, {
|
|
16877
|
+
bothMessage: 'Timeout update must target either one `timeoutId` or `allActive: true`, not both.',
|
|
16878
|
+
missingMessage: 'Timeout update requires one `timeoutId` or `allActive: true`.',
|
|
16879
|
+
});
|
|
16880
|
+
const patch = parseTimeoutUpdatePatch(args);
|
|
16881
|
+
return target.allActive
|
|
16882
|
+
? parseBulkTimeoutUpdateArgs(patch)
|
|
16883
|
+
: parseSingleTimeoutUpdateArgs(target.timeoutId, patch);
|
|
16768
16884
|
},
|
|
16769
16885
|
};
|
|
16770
16886
|
|