@bastani/atomic 0.9.76 → 0.9.77
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/CHANGELOG.md +46 -0
- package/dist/builtin/intercom/CHANGELOG.md +26 -0
- package/dist/builtin/intercom/broker/broker.ts +153 -6
- package/dist/builtin/intercom/broker/client.ts +85 -3
- package/dist/builtin/intercom/broker/departed-children.ts +471 -0
- package/dist/builtin/intercom/broker/recipient-gone-errors.ts +280 -0
- package/dist/builtin/intercom/broker/restoring-recipients.ts +108 -7
- package/dist/builtin/intercom/broker/send-handler.ts +42 -0
- package/dist/builtin/intercom/broker/workflow-stage-aliases.ts +69 -0
- package/dist/builtin/intercom/index.bundle.mjs +374 -129
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/types.ts +30 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +30 -0
- package/dist/builtin/subagents/README.md +1 -1
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/skills/agent-browser/SKILL.md +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +64 -4
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +28 -0
- package/dist/builtin/workflows/README.md +1 -1
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/impeccable/SKILL.md +3 -3
- package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/engine-checksums.txt +5 -5
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +71 -56
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +315 -112
- package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +168 -9
- package/dist/builtin/workflows/src/index.js +168 -9
- package/dist/builtin/workflows/src/local-worker-entry.mjs +168 -9
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +2 -1
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +2 -0
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +1 -0
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +7 -2
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-tasks.d.ts +6 -0
- package/dist/core/agent-session-tasks.d.ts.map +1 -1
- package/dist/core/agent-session-tasks.js +13 -25
- package/dist/core/agent-session-tasks.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +2 -0
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +2 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/loader-rollback.d.ts.map +1 -1
- package/dist/core/extensions/loader-rollback.js +1 -0
- package/dist/core/extensions/loader-rollback.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +3 -3
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +2 -1
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +9 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +16 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/sdk-types.d.ts +5 -0
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +8 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/system-prompt.d.ts +6 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +26 -18
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/agent-adapter.js +2 -2
- package/dist/core/tasks/agent-adapter.js.map +1 -1
- package/dist/core/tasks/cancel-reason.d.ts +20 -0
- package/dist/core/tasks/cancel-reason.d.ts.map +1 -0
- package/dist/core/tasks/cancel-reason.js +47 -0
- package/dist/core/tasks/cancel-reason.js.map +1 -0
- package/dist/core/tasks/child-command-owner.d.ts +1 -1
- package/dist/core/tasks/child-command-owner.d.ts.map +1 -1
- package/dist/core/tasks/child-command-owner.js +22 -0
- package/dist/core/tasks/child-command-owner.js.map +1 -1
- package/dist/core/tasks/completion-message.d.ts +11 -0
- package/dist/core/tasks/completion-message.d.ts.map +1 -0
- package/dist/core/tasks/completion-message.js +30 -0
- package/dist/core/tasks/completion-message.js.map +1 -0
- package/dist/core/tasks/completion.d.ts +2 -0
- package/dist/core/tasks/completion.d.ts.map +1 -1
- package/dist/core/tasks/completion.js +30 -14
- package/dist/core/tasks/completion.js.map +1 -1
- package/dist/core/tasks/contracts.d.ts +4 -0
- package/dist/core/tasks/contracts.d.ts.map +1 -1
- package/dist/core/tasks/contracts.js.map +1 -1
- package/dist/core/tasks/supervisor.d.ts +29 -3
- package/dist/core/tasks/supervisor.d.ts.map +1 -1
- package/dist/core/tasks/supervisor.js +48 -25
- package/dist/core/tasks/supervisor.js.map +1 -1
- package/dist/core/tasks/task-view-source.d.ts +6 -0
- package/dist/core/tasks/task-view-source.d.ts.map +1 -1
- package/dist/core/tasks/task-view-source.js +49 -0
- package/dist/core/tasks/task-view-source.js.map +1 -1
- package/dist/core/tools/bash-pty-native.d.ts +6 -1
- package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
- package/dist/core/tools/bash-pty-native.js +5 -1
- package/dist/core/tools/bash-pty-native.js.map +1 -1
- package/dist/core/tools/bash.d.ts +5 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +14 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/history-protocol.d.ts +15 -1
- package/dist/core/tools/history-protocol.d.ts.map +1 -1
- package/dist/core/tools/history-protocol.js +9 -7
- package/dist/core/tools/history-protocol.js.map +1 -1
- package/dist/core/tools/shell-task-status.d.ts.map +1 -1
- package/dist/core/tools/shell-task-status.js +3 -13
- package/dist/core/tools/shell-task-status.js.map +1 -1
- package/dist/core/workflow-stage-admission.d.ts +2 -0
- package/dist/core/workflow-stage-admission.d.ts.map +1 -1
- package/dist/core/workflow-stage-admission.js +36 -6
- package/dist/core/workflow-stage-admission.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js +12 -8
- package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts +2 -0
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js +2 -0
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.d.ts +6 -0
- package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +5 -2
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +8 -5
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +5 -2
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/input-label.d.ts +29 -0
- package/dist/modes/interactive/components/input-label.d.ts.map +1 -0
- package/dist/modes/interactive/components/input-label.js +75 -0
- package/dist/modes/interactive/components/input-label.js.map +1 -0
- package/dist/modes/interactive/components/task-inspector.d.ts +4 -1
- package/dist/modes/interactive/components/task-inspector.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-inspector.js +6 -2
- package/dist/modes/interactive/components/task-inspector.js.map +1 -1
- package/dist/modes/interactive/components/task-transcript-page.d.ts +12 -1
- package/dist/modes/interactive/components/task-transcript-page.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-transcript-page.js +63 -6
- package/dist/modes/interactive/components/task-transcript-page.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +1 -0
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +1 -0
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive-engine/engine-session-stats.d.ts +1 -1
- package/dist/modes/interactive-engine/engine-session-stats.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-session-stats.js.map +1 -1
- package/dist/modes/rpc/task-ui-bridge.d.ts +2 -2
- package/dist/modes/rpc/task-ui-bridge.d.ts.map +1 -1
- package/dist/modes/rpc/task-ui-bridge.js +2 -0
- package/dist/modes/rpc/task-ui-bridge.js.map +1 -1
- package/docs/background-tasks.md +14 -1
- package/docs/getting-started/first-session.md +1 -1
- package/docs/intercom/operations.md +4 -2
- package/docs/intercom/reference.md +18 -1
- package/docs/llama-cpp.md +1 -1
- package/docs/sessions.md +1 -1
- package/docs/subagents.md +5 -1
- package/docs/tools.md +1 -1
- package/docs/usage.md +1 -12
- package/docs/workflows/operations.md +3 -1
- package/docs/workflows/verification.md +1 -8
- package/npm-shrinkwrap.json +83 -98
- package/package.json +6 -6
|
@@ -73142,6 +73142,140 @@ var init_released_children = __esm(() => {
|
|
|
73142
73142
|
SESSION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
73143
73143
|
});
|
|
73144
73144
|
|
|
73145
|
+
// dist/builtin/intercom/broker/recipient-gone-errors.ts
|
|
73146
|
+
function isIntercomRecipientGoneErrorCode(value2) {
|
|
73147
|
+
return CODES5.has(value2);
|
|
73148
|
+
}
|
|
73149
|
+
function hintFor3(code, childId) {
|
|
73150
|
+
if (code === "recipient_cancelled")
|
|
73151
|
+
return "It cannot be resumed; launch a fresh subagent if its work is still needed.";
|
|
73152
|
+
if (code === "recipient_disconnected")
|
|
73153
|
+
return 'Its launching session has not said why; check subagent({ action: "status" }) there, or try again shortly.';
|
|
73154
|
+
if (code === "recipient_owner_suspended")
|
|
73155
|
+
return "Try again once its launching session is back; to reach that session now, send to its workflow stage target (workflow:<rootRunId>/<stage>), which queues the message until the stage reopens.";
|
|
73156
|
+
return `Its launching session can continue it with subagent({ action: "resume", id: ${JSON.stringify(childId ?? "<child-id>")}, message: "<your message>" }).`;
|
|
73157
|
+
}
|
|
73158
|
+
function rehydrateIntercomRecipientGoneError(serialized) {
|
|
73159
|
+
const options = serialized.cause === undefined ? undefined : { cause: rehydrateCause3(serialized.cause, 1) };
|
|
73160
|
+
const { code, fields } = serialized;
|
|
73161
|
+
if (serialized.name === ENDED_NAME && code !== "recipient_disconnected" && code !== "recipient_owner_suspended")
|
|
73162
|
+
return new SubagentRecipientEndedError(code, fields, options);
|
|
73163
|
+
if (serialized.name === DISCONNECTED_NAME && code === "recipient_disconnected")
|
|
73164
|
+
return new SubagentRecipientDisconnectedError(fields, options);
|
|
73165
|
+
if (serialized.name === OWNER_SUSPENDED_NAME && code === "recipient_owner_suspended")
|
|
73166
|
+
return new SubagentRecipientOwnerSuspendedError(fields, options);
|
|
73167
|
+
const error = new IntercomRecipientGoneError(code, fields, options);
|
|
73168
|
+
Object.defineProperty(error, "name", { value: serialized.name });
|
|
73169
|
+
return error;
|
|
73170
|
+
}
|
|
73171
|
+
function readCause2(value2, depth) {
|
|
73172
|
+
if (value2 === undefined)
|
|
73173
|
+
return;
|
|
73174
|
+
if (!isWireObject2(value2) || typeof value2.name !== "string" || typeof value2.message !== "string")
|
|
73175
|
+
return false;
|
|
73176
|
+
const next = depth < MAX_CAUSE_DEPTH11 ? readCause2(value2.cause, depth + 1) : undefined;
|
|
73177
|
+
if (next === false)
|
|
73178
|
+
return false;
|
|
73179
|
+
return { name: value2.name, message: value2.message, ...next === undefined ? {} : { cause: next } };
|
|
73180
|
+
}
|
|
73181
|
+
function readSerializedIntercomRecipientGoneError(value2) {
|
|
73182
|
+
if (!isWireObject2(value2))
|
|
73183
|
+
return;
|
|
73184
|
+
const { name, code, message, hint, retryable, fields } = value2;
|
|
73185
|
+
if (typeof name !== "string" || !isIntercomRecipientGoneErrorCode(code))
|
|
73186
|
+
return;
|
|
73187
|
+
if (typeof message !== "string" || typeof hint !== "string" || typeof retryable !== "boolean")
|
|
73188
|
+
return;
|
|
73189
|
+
if (!isWireObject2(fields))
|
|
73190
|
+
return;
|
|
73191
|
+
const { target, childName, childId } = fields;
|
|
73192
|
+
if (typeof target !== "string" || typeof childName !== "string")
|
|
73193
|
+
return;
|
|
73194
|
+
if (childId !== undefined && typeof childId !== "string")
|
|
73195
|
+
return;
|
|
73196
|
+
const cause = readCause2(value2.cause, 1);
|
|
73197
|
+
if (cause === false)
|
|
73198
|
+
return;
|
|
73199
|
+
return {
|
|
73200
|
+
name,
|
|
73201
|
+
code,
|
|
73202
|
+
message,
|
|
73203
|
+
hint,
|
|
73204
|
+
retryable,
|
|
73205
|
+
fields: { target, childName, ...childId === undefined ? {} : { childId } },
|
|
73206
|
+
...cause === undefined ? {} : { cause }
|
|
73207
|
+
};
|
|
73208
|
+
}
|
|
73209
|
+
var INTERCOM_RECIPIENT_GONE_ERROR_CODES, CODES5, WHAT, BASE_NAME3 = "IntercomRecipientGoneError", ENDED_NAME = "SubagentRecipientEndedError", DISCONNECTED_NAME = "SubagentRecipientDisconnectedError", OWNER_SUSPENDED_NAME = "SubagentRecipientOwnerSuspendedError", IntercomRecipientGoneError, SubagentRecipientEndedError, SubagentRecipientDisconnectedError, SubagentRecipientOwnerSuspendedError, NAMES4, ENDED_NAMES, DISCONNECTED_NAMES, OWNER_SUSPENDED_NAMES, MAX_CAUSE_DEPTH11 = 4, isWireObject2 = (value2) => typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
73210
|
+
var init_recipient_gone_errors = __esm(() => {
|
|
73211
|
+
init_released_child_errors();
|
|
73212
|
+
INTERCOM_RECIPIENT_GONE_ERROR_CODES = [
|
|
73213
|
+
"recipient_completed",
|
|
73214
|
+
"recipient_failed",
|
|
73215
|
+
"recipient_stopped",
|
|
73216
|
+
"recipient_cancelled",
|
|
73217
|
+
"recipient_disconnected",
|
|
73218
|
+
"recipient_owner_suspended"
|
|
73219
|
+
];
|
|
73220
|
+
CODES5 = new Set(INTERCOM_RECIPIENT_GONE_ERROR_CODES);
|
|
73221
|
+
WHAT = {
|
|
73222
|
+
recipient_completed: "completed and has no live session",
|
|
73223
|
+
recipient_failed: "failed and has no live session",
|
|
73224
|
+
recipient_stopped: "was stopped (paused or quit) and has no live session",
|
|
73225
|
+
recipient_cancelled: "was cancelled for good and has no live session",
|
|
73226
|
+
recipient_disconnected: "disconnected and has not reconnected",
|
|
73227
|
+
recipient_owner_suspended: "is released and the session that launched it is suspended or disconnected, so nothing can wake it now"
|
|
73228
|
+
};
|
|
73229
|
+
IntercomRecipientGoneError = class IntercomRecipientGoneError extends Error {
|
|
73230
|
+
name = BASE_NAME3;
|
|
73231
|
+
code;
|
|
73232
|
+
hint;
|
|
73233
|
+
retryable;
|
|
73234
|
+
target;
|
|
73235
|
+
childName;
|
|
73236
|
+
childId;
|
|
73237
|
+
constructor(code, fields, options) {
|
|
73238
|
+
const hint = hintFor3(code, fields.childId);
|
|
73239
|
+
super(`Subagent ${JSON.stringify(fields.childName)} ${WHAT[code]} (${code}). ${hint}`, options);
|
|
73240
|
+
this.code = code;
|
|
73241
|
+
this.hint = hint;
|
|
73242
|
+
this.retryable = code === "recipient_disconnected" || code === "recipient_owner_suspended";
|
|
73243
|
+
this.target = fields.target;
|
|
73244
|
+
this.childName = fields.childName;
|
|
73245
|
+
this.childId = fields.childId;
|
|
73246
|
+
}
|
|
73247
|
+
get fields() {
|
|
73248
|
+
return {
|
|
73249
|
+
target: this.target,
|
|
73250
|
+
childName: this.childName,
|
|
73251
|
+
...this.childId === undefined ? {} : { childId: this.childId }
|
|
73252
|
+
};
|
|
73253
|
+
}
|
|
73254
|
+
};
|
|
73255
|
+
SubagentRecipientEndedError = class SubagentRecipientEndedError extends IntercomRecipientGoneError {
|
|
73256
|
+
name = ENDED_NAME;
|
|
73257
|
+
constructor(code, fields, options) {
|
|
73258
|
+
super(code, fields, options);
|
|
73259
|
+
}
|
|
73260
|
+
};
|
|
73261
|
+
SubagentRecipientDisconnectedError = class SubagentRecipientDisconnectedError extends IntercomRecipientGoneError {
|
|
73262
|
+
name = DISCONNECTED_NAME;
|
|
73263
|
+
constructor(fields, options) {
|
|
73264
|
+
super("recipient_disconnected", fields, options);
|
|
73265
|
+
}
|
|
73266
|
+
};
|
|
73267
|
+
SubagentRecipientOwnerSuspendedError = class SubagentRecipientOwnerSuspendedError extends IntercomRecipientGoneError {
|
|
73268
|
+
name = OWNER_SUSPENDED_NAME;
|
|
73269
|
+
constructor(fields, options) {
|
|
73270
|
+
super("recipient_owner_suspended", fields, options);
|
|
73271
|
+
}
|
|
73272
|
+
};
|
|
73273
|
+
NAMES4 = new Set([BASE_NAME3, ENDED_NAME, DISCONNECTED_NAME, OWNER_SUSPENDED_NAME]);
|
|
73274
|
+
ENDED_NAMES = new Set([ENDED_NAME]);
|
|
73275
|
+
DISCONNECTED_NAMES = new Set([DISCONNECTED_NAME]);
|
|
73276
|
+
OWNER_SUSPENDED_NAMES = new Set([OWNER_SUSPENDED_NAME]);
|
|
73277
|
+
});
|
|
73278
|
+
|
|
73145
73279
|
// dist/builtin/intercom/group.ts
|
|
73146
73280
|
function normalizeGroup2(value2) {
|
|
73147
73281
|
if (typeof value2 !== "string")
|
|
@@ -73212,7 +73346,7 @@ var init_live_route_refusal = __esm(() => {
|
|
|
73212
73346
|
// dist/builtin/intercom/recoverable-disconnect.ts
|
|
73213
73347
|
function isIntercomBrokerRetiring(error) {
|
|
73214
73348
|
let current = error;
|
|
73215
|
-
for (let depth = 0;depth <=
|
|
73349
|
+
for (let depth = 0;depth <= MAX_CAUSE_DEPTH12; depth += 1) {
|
|
73216
73350
|
if (!(current instanceof Error))
|
|
73217
73351
|
return false;
|
|
73218
73352
|
if (current instanceof IntercomBrokerRetiringError)
|
|
@@ -73221,7 +73355,7 @@ function isIntercomBrokerRetiring(error) {
|
|
|
73221
73355
|
}
|
|
73222
73356
|
return false;
|
|
73223
73357
|
}
|
|
73224
|
-
var RECOVERABLE_DISCONNECT_MESSAGE = "Client disconnected",
|
|
73358
|
+
var RECOVERABLE_DISCONNECT_MESSAGE = "Client disconnected", MAX_CAUSE_DEPTH12 = 8, IntercomClientDisconnectedError, IntercomBrokerTimeoutError, BROKER_RETIRING_CODE = "broker_retiring", BROKER_RETIRING_REASON = "Intercom broker is retiring; connect to its replacement", BROKER_ROUTING_CHANGED_CODE = "broker_routing_changed", IntercomBrokerRetiringError;
|
|
73225
73359
|
var init_recoverable_disconnect = __esm(() => {
|
|
73226
73360
|
init_live_route_refusal();
|
|
73227
73361
|
IntercomClientDisconnectedError = class IntercomClientDisconnectedError extends Error {
|
|
@@ -73408,6 +73542,7 @@ var init_client = __esm(() => {
|
|
|
73408
73542
|
init_released_child_errors();
|
|
73409
73543
|
init_released_reply_errors();
|
|
73410
73544
|
init_released_children();
|
|
73545
|
+
init_recipient_gone_errors();
|
|
73411
73546
|
init_group();
|
|
73412
73547
|
init_recoverable_disconnect();
|
|
73413
73548
|
init_pending_stage_route_timeout_error();
|
|
@@ -73417,6 +73552,7 @@ var init_client = __esm(() => {
|
|
|
73417
73552
|
init_retry_policy();
|
|
73418
73553
|
init_workflow_prediction_fields();
|
|
73419
73554
|
init_released_child_errors();
|
|
73555
|
+
init_recipient_gone_errors();
|
|
73420
73556
|
init_released_reply_errors();
|
|
73421
73557
|
ConnectionClosedBeforeRegistrationError = class ConnectionClosedBeforeRegistrationError extends Error {
|
|
73422
73558
|
constructor() {
|
|
@@ -73455,6 +73591,7 @@ var init_client = __esm(() => {
|
|
|
73455
73591
|
brokerClaimsWorkflowInvocations = false;
|
|
73456
73592
|
connectAttempt;
|
|
73457
73593
|
brokerExtendsSaves = false;
|
|
73594
|
+
brokerMarksEndedChildren = false;
|
|
73458
73595
|
socket = null;
|
|
73459
73596
|
_sessionId = null;
|
|
73460
73597
|
_supervisorSessionId = null;
|
|
@@ -73683,6 +73820,7 @@ var init_client = __esm(() => {
|
|
|
73683
73820
|
this._brokerProtocol = LEGACY_BROKER_PROTOCOL;
|
|
73684
73821
|
this.brokerClaimsWorkflowInvocations = false;
|
|
73685
73822
|
this.brokerExtendsSaves = false;
|
|
73823
|
+
this.brokerMarksEndedChildren = false;
|
|
73686
73824
|
this._messageSource = undefined;
|
|
73687
73825
|
this.disconnectError = null;
|
|
73688
73826
|
if (connectionEstablished && !wasDisconnecting) {
|
|
@@ -73772,7 +73910,7 @@ var init_client = __esm(() => {
|
|
|
73772
73910
|
}
|
|
73773
73911
|
switch (brokerMessage.type) {
|
|
73774
73912
|
case "registered": {
|
|
73775
|
-
if (typeof brokerMessage.sessionId !== "string" || brokerMessage.supervisorSessionId !== undefined && typeof brokerMessage.supervisorSessionId !== "string" || brokerMessage.acknowledgesReceipt !== undefined && brokerMessage.acknowledgesReceipt !== true || brokerMessage.acknowledgesPendingStageRoutes !== undefined && brokerMessage.acknowledgesPendingStageRoutes !== true || brokerMessage.refusesPendingStageRoutesInPlace !== undefined && brokerMessage.refusesPendingStageRoutesInPlace !== true || brokerMessage.brokerStatus !== undefined && brokerMessage.brokerStatus !== true || brokerMessage.claimsWorkflowInvocations !== undefined && brokerMessage.claimsWorkflowInvocations !== true || brokerMessage.multiNodeRouting !== undefined && brokerMessage.multiNodeRouting !== "off" && brokerMessage.multiNodeRouting !== "starting" && brokerMessage.multiNodeRouting !== "on" && brokerMessage.multiNodeRouting !== "unavailable" || brokerMessage.extendsSaves !== undefined && brokerMessage.extendsSaves !== true || brokerMessage.protocol !== undefined && !isBrokerProtocolRange(brokerMessage.protocol)) {
|
|
73913
|
+
if (typeof brokerMessage.sessionId !== "string" || brokerMessage.supervisorSessionId !== undefined && typeof brokerMessage.supervisorSessionId !== "string" || brokerMessage.acknowledgesReceipt !== undefined && brokerMessage.acknowledgesReceipt !== true || brokerMessage.acknowledgesPendingStageRoutes !== undefined && brokerMessage.acknowledgesPendingStageRoutes !== true || brokerMessage.refusesPendingStageRoutesInPlace !== undefined && brokerMessage.refusesPendingStageRoutesInPlace !== true || brokerMessage.brokerStatus !== undefined && brokerMessage.brokerStatus !== true || brokerMessage.claimsWorkflowInvocations !== undefined && brokerMessage.claimsWorkflowInvocations !== true || brokerMessage.multiNodeRouting !== undefined && brokerMessage.multiNodeRouting !== "off" && brokerMessage.multiNodeRouting !== "starting" && brokerMessage.multiNodeRouting !== "on" && brokerMessage.multiNodeRouting !== "unavailable" || brokerMessage.extendsSaves !== undefined && brokerMessage.extendsSaves !== true || brokerMessage.marksEndedChildren !== undefined && brokerMessage.marksEndedChildren !== true || brokerMessage.protocol !== undefined && !isBrokerProtocolRange(brokerMessage.protocol)) {
|
|
73776
73914
|
throw new Error("Invalid registered message");
|
|
73777
73915
|
}
|
|
73778
73916
|
if (this._sessionId !== null) {
|
|
@@ -73792,6 +73930,7 @@ var init_client = __esm(() => {
|
|
|
73792
73930
|
this._multiNodeRouting = brokerMessage.multiNodeRouting;
|
|
73793
73931
|
this.brokerClaimsWorkflowInvocations = brokerMessage.claimsWorkflowInvocations === true;
|
|
73794
73932
|
this.brokerExtendsSaves = this.brokerAcknowledgesReceipt && brokerMessage.extendsSaves === true;
|
|
73933
|
+
this.brokerMarksEndedChildren = brokerMessage.marksEndedChildren === true;
|
|
73795
73934
|
this._brokerProtocol = protocolRangeOf(brokerMessage.protocol);
|
|
73796
73935
|
this.emit("_registered", { type: "registered", sessionId: brokerMessage.sessionId });
|
|
73797
73936
|
break;
|
|
@@ -74075,7 +74214,9 @@ var init_client = __esm(() => {
|
|
|
74075
74214
|
const { messageId, attemptId, reason, reasonCode } = brokerMessage;
|
|
74076
74215
|
const wireError = brokerMessage.error;
|
|
74077
74216
|
const error = readSerializedIntercomReleasedReplyError(wireError);
|
|
74078
|
-
|
|
74217
|
+
const wireRecipientError = brokerMessage.recipientError;
|
|
74218
|
+
const recipientError = readSerializedIntercomRecipientGoneError(wireRecipientError);
|
|
74219
|
+
if (typeof messageId !== "string" || attemptId !== undefined && typeof attemptId !== "string" || typeof reason !== "string" || reasonCode !== undefined && (typeof reasonCode !== "string" || !isDeliveryFailureReasonCode(reasonCode)) || wireError !== undefined && (error === undefined || error.code !== reasonCode) || wireRecipientError !== undefined && (recipientError === undefined || reasonCode !== undefined)) {
|
|
74079
74220
|
throw new Error("Invalid delivery_failed message");
|
|
74080
74221
|
}
|
|
74081
74222
|
const result = {
|
|
@@ -74083,7 +74224,8 @@ var init_client = __esm(() => {
|
|
|
74083
74224
|
delivered: false,
|
|
74084
74225
|
reason,
|
|
74085
74226
|
...reasonCode === undefined ? {} : { reasonCode },
|
|
74086
|
-
...error === undefined ? {} : { error: rehydrateIntercomReleasedReplyError(error) }
|
|
74227
|
+
...error === undefined ? {} : { error: rehydrateIntercomReleasedReplyError(error) },
|
|
74228
|
+
...recipientError === undefined ? {} : { reasonCode: recipientError.code, error: rehydrateIntercomRecipientGoneError(recipientError) }
|
|
74087
74229
|
};
|
|
74088
74230
|
if (attemptId === undefined)
|
|
74089
74231
|
this.pendingSends.resolveLegacy(messageId, result);
|
|
@@ -74455,6 +74597,23 @@ var init_client = __esm(() => {
|
|
|
74455
74597
|
});
|
|
74456
74598
|
}
|
|
74457
74599
|
}
|
|
74600
|
+
async markEndedChildren(children) {
|
|
74601
|
+
if (!this.brokerMarksEndedChildren)
|
|
74602
|
+
return;
|
|
74603
|
+
const wireChildren = children.map((child) => ({
|
|
74604
|
+
childName: child.childName,
|
|
74605
|
+
group: child.group,
|
|
74606
|
+
aliases: child.aliases,
|
|
74607
|
+
outcome: child.outcome,
|
|
74608
|
+
childId: child.childId
|
|
74609
|
+
}));
|
|
74610
|
+
for (let start = 0;start < wireChildren.length; start += RELEASED_CHILD_FRAME_MAX) {
|
|
74611
|
+
await this.restoringRecipientRequest({
|
|
74612
|
+
type: "mark_ended_children",
|
|
74613
|
+
children: wireChildren.slice(start, start + RELEASED_CHILD_FRAME_MAX)
|
|
74614
|
+
});
|
|
74615
|
+
}
|
|
74616
|
+
}
|
|
74458
74617
|
acknowledgeReleasedChildWake(childName) {
|
|
74459
74618
|
try {
|
|
74460
74619
|
this.requireBrokerProtocol("acknowledge_released_child_wake");
|
|
@@ -90406,7 +90565,7 @@ function describeErrorWithCauses(error) {
|
|
|
90406
90565
|
const messages = [];
|
|
90407
90566
|
const visited = new Set;
|
|
90408
90567
|
let current = error;
|
|
90409
|
-
for (let depth = 0;current !== undefined && depth <
|
|
90568
|
+
for (let depth = 0;current !== undefined && depth < MAX_CAUSE_DEPTH13 && !visited.has(current); depth++) {
|
|
90410
90569
|
visited.add(current);
|
|
90411
90570
|
const message = current instanceof Error ? current.message : String(current);
|
|
90412
90571
|
if (!messages.includes(message))
|
|
@@ -90415,7 +90574,7 @@ function describeErrorWithCauses(error) {
|
|
|
90415
90574
|
}
|
|
90416
90575
|
return messages.join(": ");
|
|
90417
90576
|
}
|
|
90418
|
-
var
|
|
90577
|
+
var MAX_CAUSE_DEPTH13 = 5;
|
|
90419
90578
|
|
|
90420
90579
|
// dist/builtin/workflows/src/shared/returned-run-status.ts
|
|
90421
90580
|
function normalizeReturnedWorkflowStatus(status) {
|
|
@@ -93184,7 +93343,7 @@ function recordedOwners(boundary, reason) {
|
|
|
93184
93343
|
const pending = [{ value: reason, depth: 0 }];
|
|
93185
93344
|
while (pending.length > 0) {
|
|
93186
93345
|
const { value: value2, depth } = pending.pop();
|
|
93187
|
-
if (depth >
|
|
93346
|
+
if (depth > MAX_CAUSE_DEPTH14)
|
|
93188
93347
|
continue;
|
|
93189
93348
|
if (isPrimitive(value2)) {
|
|
93190
93349
|
if (depth === 0 || value2 !== undefined && value2 !== null) {
|
|
@@ -93517,7 +93676,7 @@ function containUiRejections(ui, scope) {
|
|
|
93517
93676
|
custom: (factory, options) => scope.watch(ui.custom(factory, options))
|
|
93518
93677
|
};
|
|
93519
93678
|
}
|
|
93520
|
-
var EVENT = "unhandledRejection", BOUNDARY_KEY, FLAG = "--unhandled-rejections",
|
|
93679
|
+
var EVENT = "unhandledRejection", BOUNDARY_KEY, FLAG = "--unhandled-rejections", MAX_CAUSE_DEPTH14 = 8, MAX_PRIMITIVES_PER_RUN = 64, MAX_STOP_STRINGS = 64, ENDED_RUN_GRACE_MS = 30000, NATIVE_REPORTING_MODES, WATCHED_STAGE_METHODS;
|
|
93521
93680
|
var init_run_rejection_boundary = __esm(() => {
|
|
93522
93681
|
init_prompt_callsite();
|
|
93523
93682
|
init_workflow_source();
|
|
@@ -73294,6 +73294,140 @@ var init_released_children = __esm(() => {
|
|
|
73294
73294
|
SESSION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
73295
73295
|
});
|
|
73296
73296
|
|
|
73297
|
+
// dist/builtin/intercom/broker/recipient-gone-errors.ts
|
|
73298
|
+
function isIntercomRecipientGoneErrorCode(value2) {
|
|
73299
|
+
return CODES5.has(value2);
|
|
73300
|
+
}
|
|
73301
|
+
function hintFor3(code, childId) {
|
|
73302
|
+
if (code === "recipient_cancelled")
|
|
73303
|
+
return "It cannot be resumed; launch a fresh subagent if its work is still needed.";
|
|
73304
|
+
if (code === "recipient_disconnected")
|
|
73305
|
+
return 'Its launching session has not said why; check subagent({ action: "status" }) there, or try again shortly.';
|
|
73306
|
+
if (code === "recipient_owner_suspended")
|
|
73307
|
+
return "Try again once its launching session is back; to reach that session now, send to its workflow stage target (workflow:<rootRunId>/<stage>), which queues the message until the stage reopens.";
|
|
73308
|
+
return `Its launching session can continue it with subagent({ action: "resume", id: ${JSON.stringify(childId ?? "<child-id>")}, message: "<your message>" }).`;
|
|
73309
|
+
}
|
|
73310
|
+
function rehydrateIntercomRecipientGoneError(serialized) {
|
|
73311
|
+
const options = serialized.cause === undefined ? undefined : { cause: rehydrateCause3(serialized.cause, 1) };
|
|
73312
|
+
const { code, fields } = serialized;
|
|
73313
|
+
if (serialized.name === ENDED_NAME && code !== "recipient_disconnected" && code !== "recipient_owner_suspended")
|
|
73314
|
+
return new SubagentRecipientEndedError(code, fields, options);
|
|
73315
|
+
if (serialized.name === DISCONNECTED_NAME && code === "recipient_disconnected")
|
|
73316
|
+
return new SubagentRecipientDisconnectedError(fields, options);
|
|
73317
|
+
if (serialized.name === OWNER_SUSPENDED_NAME && code === "recipient_owner_suspended")
|
|
73318
|
+
return new SubagentRecipientOwnerSuspendedError(fields, options);
|
|
73319
|
+
const error = new IntercomRecipientGoneError(code, fields, options);
|
|
73320
|
+
Object.defineProperty(error, "name", { value: serialized.name });
|
|
73321
|
+
return error;
|
|
73322
|
+
}
|
|
73323
|
+
function readCause2(value2, depth) {
|
|
73324
|
+
if (value2 === undefined)
|
|
73325
|
+
return;
|
|
73326
|
+
if (!isWireObject2(value2) || typeof value2.name !== "string" || typeof value2.message !== "string")
|
|
73327
|
+
return false;
|
|
73328
|
+
const next = depth < MAX_CAUSE_DEPTH11 ? readCause2(value2.cause, depth + 1) : undefined;
|
|
73329
|
+
if (next === false)
|
|
73330
|
+
return false;
|
|
73331
|
+
return { name: value2.name, message: value2.message, ...next === undefined ? {} : { cause: next } };
|
|
73332
|
+
}
|
|
73333
|
+
function readSerializedIntercomRecipientGoneError(value2) {
|
|
73334
|
+
if (!isWireObject2(value2))
|
|
73335
|
+
return;
|
|
73336
|
+
const { name, code, message, hint, retryable, fields } = value2;
|
|
73337
|
+
if (typeof name !== "string" || !isIntercomRecipientGoneErrorCode(code))
|
|
73338
|
+
return;
|
|
73339
|
+
if (typeof message !== "string" || typeof hint !== "string" || typeof retryable !== "boolean")
|
|
73340
|
+
return;
|
|
73341
|
+
if (!isWireObject2(fields))
|
|
73342
|
+
return;
|
|
73343
|
+
const { target, childName, childId } = fields;
|
|
73344
|
+
if (typeof target !== "string" || typeof childName !== "string")
|
|
73345
|
+
return;
|
|
73346
|
+
if (childId !== undefined && typeof childId !== "string")
|
|
73347
|
+
return;
|
|
73348
|
+
const cause = readCause2(value2.cause, 1);
|
|
73349
|
+
if (cause === false)
|
|
73350
|
+
return;
|
|
73351
|
+
return {
|
|
73352
|
+
name,
|
|
73353
|
+
code,
|
|
73354
|
+
message,
|
|
73355
|
+
hint,
|
|
73356
|
+
retryable,
|
|
73357
|
+
fields: { target, childName, ...childId === undefined ? {} : { childId } },
|
|
73358
|
+
...cause === undefined ? {} : { cause }
|
|
73359
|
+
};
|
|
73360
|
+
}
|
|
73361
|
+
var INTERCOM_RECIPIENT_GONE_ERROR_CODES, CODES5, WHAT, BASE_NAME3 = "IntercomRecipientGoneError", ENDED_NAME = "SubagentRecipientEndedError", DISCONNECTED_NAME = "SubagentRecipientDisconnectedError", OWNER_SUSPENDED_NAME = "SubagentRecipientOwnerSuspendedError", IntercomRecipientGoneError, SubagentRecipientEndedError, SubagentRecipientDisconnectedError, SubagentRecipientOwnerSuspendedError, NAMES4, ENDED_NAMES, DISCONNECTED_NAMES, OWNER_SUSPENDED_NAMES, MAX_CAUSE_DEPTH11 = 4, isWireObject2 = (value2) => typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
73362
|
+
var init_recipient_gone_errors = __esm(() => {
|
|
73363
|
+
init_released_child_errors();
|
|
73364
|
+
INTERCOM_RECIPIENT_GONE_ERROR_CODES = [
|
|
73365
|
+
"recipient_completed",
|
|
73366
|
+
"recipient_failed",
|
|
73367
|
+
"recipient_stopped",
|
|
73368
|
+
"recipient_cancelled",
|
|
73369
|
+
"recipient_disconnected",
|
|
73370
|
+
"recipient_owner_suspended"
|
|
73371
|
+
];
|
|
73372
|
+
CODES5 = new Set(INTERCOM_RECIPIENT_GONE_ERROR_CODES);
|
|
73373
|
+
WHAT = {
|
|
73374
|
+
recipient_completed: "completed and has no live session",
|
|
73375
|
+
recipient_failed: "failed and has no live session",
|
|
73376
|
+
recipient_stopped: "was stopped (paused or quit) and has no live session",
|
|
73377
|
+
recipient_cancelled: "was cancelled for good and has no live session",
|
|
73378
|
+
recipient_disconnected: "disconnected and has not reconnected",
|
|
73379
|
+
recipient_owner_suspended: "is released and the session that launched it is suspended or disconnected, so nothing can wake it now"
|
|
73380
|
+
};
|
|
73381
|
+
IntercomRecipientGoneError = class IntercomRecipientGoneError extends Error {
|
|
73382
|
+
name = BASE_NAME3;
|
|
73383
|
+
code;
|
|
73384
|
+
hint;
|
|
73385
|
+
retryable;
|
|
73386
|
+
target;
|
|
73387
|
+
childName;
|
|
73388
|
+
childId;
|
|
73389
|
+
constructor(code, fields, options) {
|
|
73390
|
+
const hint = hintFor3(code, fields.childId);
|
|
73391
|
+
super(`Subagent ${JSON.stringify(fields.childName)} ${WHAT[code]} (${code}). ${hint}`, options);
|
|
73392
|
+
this.code = code;
|
|
73393
|
+
this.hint = hint;
|
|
73394
|
+
this.retryable = code === "recipient_disconnected" || code === "recipient_owner_suspended";
|
|
73395
|
+
this.target = fields.target;
|
|
73396
|
+
this.childName = fields.childName;
|
|
73397
|
+
this.childId = fields.childId;
|
|
73398
|
+
}
|
|
73399
|
+
get fields() {
|
|
73400
|
+
return {
|
|
73401
|
+
target: this.target,
|
|
73402
|
+
childName: this.childName,
|
|
73403
|
+
...this.childId === undefined ? {} : { childId: this.childId }
|
|
73404
|
+
};
|
|
73405
|
+
}
|
|
73406
|
+
};
|
|
73407
|
+
SubagentRecipientEndedError = class SubagentRecipientEndedError extends IntercomRecipientGoneError {
|
|
73408
|
+
name = ENDED_NAME;
|
|
73409
|
+
constructor(code, fields, options) {
|
|
73410
|
+
super(code, fields, options);
|
|
73411
|
+
}
|
|
73412
|
+
};
|
|
73413
|
+
SubagentRecipientDisconnectedError = class SubagentRecipientDisconnectedError extends IntercomRecipientGoneError {
|
|
73414
|
+
name = DISCONNECTED_NAME;
|
|
73415
|
+
constructor(fields, options) {
|
|
73416
|
+
super("recipient_disconnected", fields, options);
|
|
73417
|
+
}
|
|
73418
|
+
};
|
|
73419
|
+
SubagentRecipientOwnerSuspendedError = class SubagentRecipientOwnerSuspendedError extends IntercomRecipientGoneError {
|
|
73420
|
+
name = OWNER_SUSPENDED_NAME;
|
|
73421
|
+
constructor(fields, options) {
|
|
73422
|
+
super("recipient_owner_suspended", fields, options);
|
|
73423
|
+
}
|
|
73424
|
+
};
|
|
73425
|
+
NAMES4 = new Set([BASE_NAME3, ENDED_NAME, DISCONNECTED_NAME, OWNER_SUSPENDED_NAME]);
|
|
73426
|
+
ENDED_NAMES = new Set([ENDED_NAME]);
|
|
73427
|
+
DISCONNECTED_NAMES = new Set([DISCONNECTED_NAME]);
|
|
73428
|
+
OWNER_SUSPENDED_NAMES = new Set([OWNER_SUSPENDED_NAME]);
|
|
73429
|
+
});
|
|
73430
|
+
|
|
73297
73431
|
// dist/builtin/intercom/group.ts
|
|
73298
73432
|
function normalizeGroup2(value2) {
|
|
73299
73433
|
if (typeof value2 !== "string")
|
|
@@ -73364,7 +73498,7 @@ var init_live_route_refusal = __esm(() => {
|
|
|
73364
73498
|
// dist/builtin/intercom/recoverable-disconnect.ts
|
|
73365
73499
|
function isIntercomBrokerRetiring(error) {
|
|
73366
73500
|
let current = error;
|
|
73367
|
-
for (let depth = 0;depth <=
|
|
73501
|
+
for (let depth = 0;depth <= MAX_CAUSE_DEPTH12; depth += 1) {
|
|
73368
73502
|
if (!(current instanceof Error))
|
|
73369
73503
|
return false;
|
|
73370
73504
|
if (current instanceof IntercomBrokerRetiringError)
|
|
@@ -73373,7 +73507,7 @@ function isIntercomBrokerRetiring(error) {
|
|
|
73373
73507
|
}
|
|
73374
73508
|
return false;
|
|
73375
73509
|
}
|
|
73376
|
-
var RECOVERABLE_DISCONNECT_MESSAGE = "Client disconnected",
|
|
73510
|
+
var RECOVERABLE_DISCONNECT_MESSAGE = "Client disconnected", MAX_CAUSE_DEPTH12 = 8, IntercomClientDisconnectedError, IntercomBrokerTimeoutError, BROKER_RETIRING_CODE = "broker_retiring", BROKER_RETIRING_REASON = "Intercom broker is retiring; connect to its replacement", BROKER_ROUTING_CHANGED_CODE = "broker_routing_changed", IntercomBrokerRetiringError;
|
|
73377
73511
|
var init_recoverable_disconnect = __esm(() => {
|
|
73378
73512
|
init_live_route_refusal();
|
|
73379
73513
|
IntercomClientDisconnectedError = class IntercomClientDisconnectedError extends Error {
|
|
@@ -73560,6 +73694,7 @@ var init_client = __esm(() => {
|
|
|
73560
73694
|
init_released_child_errors();
|
|
73561
73695
|
init_released_reply_errors();
|
|
73562
73696
|
init_released_children();
|
|
73697
|
+
init_recipient_gone_errors();
|
|
73563
73698
|
init_group();
|
|
73564
73699
|
init_recoverable_disconnect();
|
|
73565
73700
|
init_pending_stage_route_timeout_error();
|
|
@@ -73569,6 +73704,7 @@ var init_client = __esm(() => {
|
|
|
73569
73704
|
init_retry_policy();
|
|
73570
73705
|
init_workflow_prediction_fields();
|
|
73571
73706
|
init_released_child_errors();
|
|
73707
|
+
init_recipient_gone_errors();
|
|
73572
73708
|
init_released_reply_errors();
|
|
73573
73709
|
ConnectionClosedBeforeRegistrationError = class ConnectionClosedBeforeRegistrationError extends Error {
|
|
73574
73710
|
constructor() {
|
|
@@ -73607,6 +73743,7 @@ var init_client = __esm(() => {
|
|
|
73607
73743
|
brokerClaimsWorkflowInvocations = false;
|
|
73608
73744
|
connectAttempt;
|
|
73609
73745
|
brokerExtendsSaves = false;
|
|
73746
|
+
brokerMarksEndedChildren = false;
|
|
73610
73747
|
socket = null;
|
|
73611
73748
|
_sessionId = null;
|
|
73612
73749
|
_supervisorSessionId = null;
|
|
@@ -73835,6 +73972,7 @@ var init_client = __esm(() => {
|
|
|
73835
73972
|
this._brokerProtocol = LEGACY_BROKER_PROTOCOL;
|
|
73836
73973
|
this.brokerClaimsWorkflowInvocations = false;
|
|
73837
73974
|
this.brokerExtendsSaves = false;
|
|
73975
|
+
this.brokerMarksEndedChildren = false;
|
|
73838
73976
|
this._messageSource = undefined;
|
|
73839
73977
|
this.disconnectError = null;
|
|
73840
73978
|
if (connectionEstablished && !wasDisconnecting) {
|
|
@@ -73924,7 +74062,7 @@ var init_client = __esm(() => {
|
|
|
73924
74062
|
}
|
|
73925
74063
|
switch (brokerMessage.type) {
|
|
73926
74064
|
case "registered": {
|
|
73927
|
-
if (typeof brokerMessage.sessionId !== "string" || brokerMessage.supervisorSessionId !== undefined && typeof brokerMessage.supervisorSessionId !== "string" || brokerMessage.acknowledgesReceipt !== undefined && brokerMessage.acknowledgesReceipt !== true || brokerMessage.acknowledgesPendingStageRoutes !== undefined && brokerMessage.acknowledgesPendingStageRoutes !== true || brokerMessage.refusesPendingStageRoutesInPlace !== undefined && brokerMessage.refusesPendingStageRoutesInPlace !== true || brokerMessage.brokerStatus !== undefined && brokerMessage.brokerStatus !== true || brokerMessage.claimsWorkflowInvocations !== undefined && brokerMessage.claimsWorkflowInvocations !== true || brokerMessage.multiNodeRouting !== undefined && brokerMessage.multiNodeRouting !== "off" && brokerMessage.multiNodeRouting !== "starting" && brokerMessage.multiNodeRouting !== "on" && brokerMessage.multiNodeRouting !== "unavailable" || brokerMessage.extendsSaves !== undefined && brokerMessage.extendsSaves !== true || brokerMessage.protocol !== undefined && !isBrokerProtocolRange(brokerMessage.protocol)) {
|
|
74065
|
+
if (typeof brokerMessage.sessionId !== "string" || brokerMessage.supervisorSessionId !== undefined && typeof brokerMessage.supervisorSessionId !== "string" || brokerMessage.acknowledgesReceipt !== undefined && brokerMessage.acknowledgesReceipt !== true || brokerMessage.acknowledgesPendingStageRoutes !== undefined && brokerMessage.acknowledgesPendingStageRoutes !== true || brokerMessage.refusesPendingStageRoutesInPlace !== undefined && brokerMessage.refusesPendingStageRoutesInPlace !== true || brokerMessage.brokerStatus !== undefined && brokerMessage.brokerStatus !== true || brokerMessage.claimsWorkflowInvocations !== undefined && brokerMessage.claimsWorkflowInvocations !== true || brokerMessage.multiNodeRouting !== undefined && brokerMessage.multiNodeRouting !== "off" && brokerMessage.multiNodeRouting !== "starting" && brokerMessage.multiNodeRouting !== "on" && brokerMessage.multiNodeRouting !== "unavailable" || brokerMessage.extendsSaves !== undefined && brokerMessage.extendsSaves !== true || brokerMessage.marksEndedChildren !== undefined && brokerMessage.marksEndedChildren !== true || brokerMessage.protocol !== undefined && !isBrokerProtocolRange(brokerMessage.protocol)) {
|
|
73928
74066
|
throw new Error("Invalid registered message");
|
|
73929
74067
|
}
|
|
73930
74068
|
if (this._sessionId !== null) {
|
|
@@ -73944,6 +74082,7 @@ var init_client = __esm(() => {
|
|
|
73944
74082
|
this._multiNodeRouting = brokerMessage.multiNodeRouting;
|
|
73945
74083
|
this.brokerClaimsWorkflowInvocations = brokerMessage.claimsWorkflowInvocations === true;
|
|
73946
74084
|
this.brokerExtendsSaves = this.brokerAcknowledgesReceipt && brokerMessage.extendsSaves === true;
|
|
74085
|
+
this.brokerMarksEndedChildren = brokerMessage.marksEndedChildren === true;
|
|
73947
74086
|
this._brokerProtocol = protocolRangeOf(brokerMessage.protocol);
|
|
73948
74087
|
this.emit("_registered", { type: "registered", sessionId: brokerMessage.sessionId });
|
|
73949
74088
|
break;
|
|
@@ -74227,7 +74366,9 @@ var init_client = __esm(() => {
|
|
|
74227
74366
|
const { messageId, attemptId, reason, reasonCode } = brokerMessage;
|
|
74228
74367
|
const wireError = brokerMessage.error;
|
|
74229
74368
|
const error = readSerializedIntercomReleasedReplyError(wireError);
|
|
74230
|
-
|
|
74369
|
+
const wireRecipientError = brokerMessage.recipientError;
|
|
74370
|
+
const recipientError = readSerializedIntercomRecipientGoneError(wireRecipientError);
|
|
74371
|
+
if (typeof messageId !== "string" || attemptId !== undefined && typeof attemptId !== "string" || typeof reason !== "string" || reasonCode !== undefined && (typeof reasonCode !== "string" || !isDeliveryFailureReasonCode(reasonCode)) || wireError !== undefined && (error === undefined || error.code !== reasonCode) || wireRecipientError !== undefined && (recipientError === undefined || reasonCode !== undefined)) {
|
|
74231
74372
|
throw new Error("Invalid delivery_failed message");
|
|
74232
74373
|
}
|
|
74233
74374
|
const result = {
|
|
@@ -74235,7 +74376,8 @@ var init_client = __esm(() => {
|
|
|
74235
74376
|
delivered: false,
|
|
74236
74377
|
reason,
|
|
74237
74378
|
...reasonCode === undefined ? {} : { reasonCode },
|
|
74238
|
-
...error === undefined ? {} : { error: rehydrateIntercomReleasedReplyError(error) }
|
|
74379
|
+
...error === undefined ? {} : { error: rehydrateIntercomReleasedReplyError(error) },
|
|
74380
|
+
...recipientError === undefined ? {} : { reasonCode: recipientError.code, error: rehydrateIntercomRecipientGoneError(recipientError) }
|
|
74239
74381
|
};
|
|
74240
74382
|
if (attemptId === undefined)
|
|
74241
74383
|
this.pendingSends.resolveLegacy(messageId, result);
|
|
@@ -74607,6 +74749,23 @@ var init_client = __esm(() => {
|
|
|
74607
74749
|
});
|
|
74608
74750
|
}
|
|
74609
74751
|
}
|
|
74752
|
+
async markEndedChildren(children) {
|
|
74753
|
+
if (!this.brokerMarksEndedChildren)
|
|
74754
|
+
return;
|
|
74755
|
+
const wireChildren = children.map((child) => ({
|
|
74756
|
+
childName: child.childName,
|
|
74757
|
+
group: child.group,
|
|
74758
|
+
aliases: child.aliases,
|
|
74759
|
+
outcome: child.outcome,
|
|
74760
|
+
childId: child.childId
|
|
74761
|
+
}));
|
|
74762
|
+
for (let start = 0;start < wireChildren.length; start += RELEASED_CHILD_FRAME_MAX) {
|
|
74763
|
+
await this.restoringRecipientRequest({
|
|
74764
|
+
type: "mark_ended_children",
|
|
74765
|
+
children: wireChildren.slice(start, start + RELEASED_CHILD_FRAME_MAX)
|
|
74766
|
+
});
|
|
74767
|
+
}
|
|
74768
|
+
}
|
|
74610
74769
|
acknowledgeReleasedChildWake(childName) {
|
|
74611
74770
|
try {
|
|
74612
74771
|
this.requireBrokerProtocol("acknowledge_released_child_wake");
|
|
@@ -90471,7 +90630,7 @@ function describeErrorWithCauses(error) {
|
|
|
90471
90630
|
const messages = [];
|
|
90472
90631
|
const visited = new Set;
|
|
90473
90632
|
let current = error;
|
|
90474
|
-
for (let depth = 0;current !== undefined && depth <
|
|
90633
|
+
for (let depth = 0;current !== undefined && depth < MAX_CAUSE_DEPTH13 && !visited.has(current); depth++) {
|
|
90475
90634
|
visited.add(current);
|
|
90476
90635
|
const message = current instanceof Error ? current.message : String(current);
|
|
90477
90636
|
if (!messages.includes(message))
|
|
@@ -90480,7 +90639,7 @@ function describeErrorWithCauses(error) {
|
|
|
90480
90639
|
}
|
|
90481
90640
|
return messages.join(": ");
|
|
90482
90641
|
}
|
|
90483
|
-
var
|
|
90642
|
+
var MAX_CAUSE_DEPTH13 = 5;
|
|
90484
90643
|
|
|
90485
90644
|
// dist/builtin/workflows/src/shared/returned-run-status.ts
|
|
90486
90645
|
function normalizeReturnedWorkflowStatus(status) {
|
|
@@ -93249,7 +93408,7 @@ function recordedOwners(boundary, reason) {
|
|
|
93249
93408
|
const pending = [{ value: reason, depth: 0 }];
|
|
93250
93409
|
while (pending.length > 0) {
|
|
93251
93410
|
const { value: value2, depth } = pending.pop();
|
|
93252
|
-
if (depth >
|
|
93411
|
+
if (depth > MAX_CAUSE_DEPTH14)
|
|
93253
93412
|
continue;
|
|
93254
93413
|
if (isPrimitive(value2)) {
|
|
93255
93414
|
if (depth === 0 || value2 !== undefined && value2 !== null) {
|
|
@@ -93582,7 +93741,7 @@ function containUiRejections(ui, scope) {
|
|
|
93582
93741
|
custom: (factory, options) => scope.watch(ui.custom(factory, options))
|
|
93583
93742
|
};
|
|
93584
93743
|
}
|
|
93585
|
-
var EVENT = "unhandledRejection", BOUNDARY_KEY, FLAG = "--unhandled-rejections",
|
|
93744
|
+
var EVENT = "unhandledRejection", BOUNDARY_KEY, FLAG = "--unhandled-rejections", MAX_CAUSE_DEPTH14 = 8, MAX_PRIMITIVES_PER_RUN = 64, MAX_STOP_STRINGS = 64, ENDED_RUN_GRACE_MS = 30000, NATIVE_REPORTING_MODES, WATCHED_STAGE_METHODS;
|
|
93586
93745
|
var init_run_rejection_boundary = __esm(() => {
|
|
93587
93746
|
init_prompt_callsite();
|
|
93588
93747
|
init_workflow_source();
|