@sentry/junior 0.146.0 → 0.148.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-hooks-SLJADYE5.js → agent-hooks-VAUYT6PD.js} +10 -10
- package/dist/api/conversations/access.d.ts +2 -1
- package/dist/api/conversations/archive.d.ts +3 -5
- package/dist/api/conversations/create.d.ts +6 -0
- package/dist/api/conversations/detail.d.ts +2 -295
- package/dist/api/conversations/event-list.d.ts +2 -192
- package/dist/api/conversations/list.d.ts +4 -66
- package/dist/api/conversations/routes.d.ts +1 -1
- package/dist/api/conversations/stats.d.ts +0 -54
- package/dist/api/http.d.ts +2 -6
- package/dist/api/locations/detail.d.ts +3 -111
- package/dist/api/locations/list.d.ts +0 -45
- package/dist/api/locations/query.d.ts +2 -1
- package/dist/api/locations/routes.d.ts +1 -1
- package/dist/api/people/list.d.ts +0 -29
- package/dist/api/people/profile.d.ts +2 -106
- package/dist/api/people/profile.query.d.ts +2 -1
- package/dist/api/people/routes.d.ts +1 -1
- package/dist/api/people/shared.d.ts +1 -1
- package/dist/api/people/spend.d.ts +3 -4
- package/dist/api/personal-tokens/routes.d.ts +2 -2
- package/dist/api/route.d.ts +8 -14
- package/dist/api/schema/conversation.d.ts +64 -29
- package/dist/api/schema/location.d.ts +4 -0
- package/dist/api/schema/person.d.ts +7 -3
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +7 -1
- package/dist/api/stats.d.ts +0 -13
- package/dist/api/validation.d.ts +7 -0
- package/dist/api/viewer.d.ts +3 -0
- package/dist/api.d.ts +2 -1
- package/dist/api.js +630 -564
- package/dist/app.js +369 -309
- package/dist/{catalog-runtime-RQIMSDPR.js → catalog-runtime-WADOZVTB.js} +5 -5
- package/dist/chat/actor.d.ts +4 -1
- package/dist/chat/agent/prompt.d.ts +0 -2
- package/dist/chat/agent/request.d.ts +4 -5
- package/dist/chat/agent/resume.d.ts +1 -0
- package/dist/chat/agent/sandbox.d.ts +2 -2
- package/dist/chat/agent/tools.d.ts +0 -2
- package/dist/chat/agent-dispatch/context.d.ts +2 -2
- package/dist/chat/agent-dispatch/types.d.ts +2 -2
- package/dist/chat/agent-invocations/types.d.ts +52 -0
- package/dist/chat/api-turns/work.d.ts +103 -0
- package/dist/chat/capabilities/jr-rpc-command.d.ts +2 -2
- package/dist/chat/configuration/service.d.ts +5 -2
- package/dist/chat/configuration/sql.d.ts +9 -0
- package/dist/chat/configuration/types.d.ts +17 -13
- package/dist/chat/conversations/history.d.ts +63 -0
- package/dist/chat/conversations/projection.d.ts +10 -0
- package/dist/chat/conversations/provenance.d.ts +6 -0
- package/dist/chat/conversations/sql/actor-identity.d.ts +19 -0
- package/dist/chat/conversations/store.d.ts +1 -1
- package/dist/chat/credentials/unlink-provider.d.ts +2 -1
- package/dist/chat/credentials/user-token-store.d.ts +2 -0
- package/dist/chat/event-tasks/tool-support.d.ts +2 -0
- package/dist/chat/identities/sql.d.ts +8 -0
- package/dist/chat/logging.d.ts +2 -0
- package/dist/chat/mcp/auth-store.d.ts +0 -2
- package/dist/chat/mcp/oauth.d.ts +0 -2
- package/dist/chat/oauth-flow.d.ts +3 -1
- package/dist/chat/pi/client.d.ts +2 -0
- package/dist/chat/plugins/credential-hooks.d.ts +2 -0
- package/dist/chat/prompt.d.ts +0 -2
- package/dist/chat/resource-events/notification.d.ts +2 -1
- package/dist/chat/resource-events/store.d.ts +1 -1
- package/dist/chat/runtime/delivered-turn-state.d.ts +1 -4
- package/dist/chat/runtime/reply-executor.d.ts +1 -1
- package/dist/chat/runtime/slack-runtime.d.ts +2 -1
- package/dist/chat/runtime/thread-state.d.ts +8 -11
- package/dist/chat/runtime/turn-input.d.ts +4 -2
- package/dist/chat/runtime/turn-preparation.d.ts +11 -4
- package/dist/chat/sandbox/command-result.d.ts +2 -0
- package/dist/chat/sandbox/egress/schemas.d.ts +6 -0
- package/dist/chat/scheduled-tasks/tool-support.d.ts +7 -5
- package/dist/chat/scheduled-tasks/tools/create.d.ts +4 -2
- package/dist/chat/scheduled-tasks/tools/delete.d.ts +4 -2
- package/dist/chat/scheduled-tasks/tools/list.d.ts +4 -2
- package/dist/chat/scheduled-tasks/tools/run-now.d.ts +4 -2
- package/dist/chat/scheduled-tasks/tools/update.d.ts +4 -2
- package/dist/chat/services/mcp-auth-orchestration.d.ts +0 -3
- package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -1
- package/dist/chat/services/provider-default-config.d.ts +2 -2
- package/dist/chat/services/subscribed-decision.d.ts +3 -0
- package/dist/chat/services/subscribed-reply-policy.d.ts +1 -0
- package/dist/chat/services/turn-result.d.ts +0 -3
- package/dist/chat/services/turn-router.d.ts +3 -0
- package/dist/chat/slack/assistant-thread/lifecycle.d.ts +0 -1
- package/dist/chat/slack/assistant-thread/title.d.ts +0 -3
- package/dist/chat/slack/channel.d.ts +26 -0
- package/dist/chat/slack/dispatch-turn.d.ts +2 -1
- package/dist/chat/slack/timestamp-param.d.ts +0 -2
- package/dist/chat/slack/{tools → tool-support}/canvas/api.d.ts +1 -1
- package/dist/chat/slack/tool-support/canvas/context.d.ts +11 -0
- package/dist/chat/slack/tool-support/channel-access.d.ts +42 -0
- package/dist/chat/slack/tool-support/channel-target.d.ts +27 -0
- package/dist/chat/slack/{tools → tool-support}/list/api.d.ts +8 -1
- package/dist/chat/slack/tool-support/list/params.d.ts +5 -0
- package/dist/chat/slack/tools/canvas/create.d.ts +3 -1
- package/dist/chat/slack/tools/canvas/edit.d.ts +2 -0
- package/dist/chat/slack/tools/canvas/read.d.ts +2 -0
- package/dist/chat/slack/tools/canvas/write.d.ts +2 -0
- package/dist/chat/slack/tools/{user-lookup.d.ts → channel-join.d.ts} +6 -5
- package/dist/chat/slack/tools/channel-list-messages.d.ts +5 -2
- package/dist/chat/slack/tools/conversation-message-search.d.ts +4 -8
- package/dist/chat/slack/tools/list/add-items.d.ts +4 -1
- package/dist/chat/slack/tools/list/create.d.ts +2 -0
- package/dist/chat/slack/tools/list/get-items.d.ts +5 -3
- package/dist/chat/slack/tools/list/update-item.d.ts +5 -1
- package/dist/chat/slack/tools/message-add-reaction.d.ts +3 -1
- package/dist/chat/slack/tools/public-search.d.ts +65 -2
- package/dist/chat/slack/tools/send-files.d.ts +3 -1
- package/dist/chat/slack/tools/thread-read.d.ts +4 -5
- package/dist/chat/slack/vision-cache.d.ts +5 -0
- package/dist/chat/source.d.ts +2 -0
- package/dist/chat/state/conversation.d.ts +4 -5
- package/dist/chat/task-execution/checkpoint.d.ts +1 -0
- package/dist/chat/task-execution/state.d.ts +9 -4
- package/dist/chat/task-execution/store.d.ts +3 -2
- package/dist/chat/task-execution/turn-cursor.d.ts +2 -0
- package/dist/chat/task-execution/worker.d.ts +2 -0
- package/dist/chat/tasks/read.d.ts +1 -1
- package/dist/chat/tool-support/structured-result.d.ts +1 -0
- package/dist/chat/tool-support/timed-out-tool-result.d.ts +11 -0
- package/dist/chat/tools/create-event-task.d.ts +2 -0
- package/dist/chat/tools/delete-event-task.d.ts +2 -0
- package/dist/chat/tools/handoff/tool.d.ts +2 -0
- package/dist/chat/tools/list-event-tasks.d.ts +2 -0
- package/dist/chat/tools/list-resource-event-subscriptions.d.ts +2 -0
- package/dist/chat/tools/runtime/report-progress.d.ts +2 -0
- package/dist/chat/tools/runtime/spawn-agent.d.ts +2 -0
- package/dist/chat/tools/search-conversation-events.d.ts +3 -1
- package/dist/chat/tools/search-resource-event-types.d.ts +2 -0
- package/dist/chat/tools/search-tools.d.ts +2 -0
- package/dist/chat/tools/skill/load-skill.d.ts +2 -0
- package/dist/chat/tools/skill/search-mcp-tools.d.ts +2 -0
- package/dist/chat/tools/stop-watching-resources.d.ts +2 -0
- package/dist/chat/tools/system-time.d.ts +2 -0
- package/dist/chat/tools/types.d.ts +11 -10
- package/dist/chat/tools/update-event-task.d.ts +2 -0
- package/dist/chat/tools/user-lookup.d.ts +29 -0
- package/dist/chat/tools/watch-resource-events.d.ts +4 -2
- package/dist/chat/tools/web/fetch-tool.d.ts +2 -0
- package/dist/chat/tools/web/image-generate.d.ts +2 -0
- package/dist/chat/tools/web/search.d.ts +2 -0
- package/dist/{chunk-GYEKOX7N.js → chunk-2B3PT3V2.js} +1 -1
- package/dist/{chunk-JLMVCNXL.js → chunk-45LOR4PU.js} +22 -4
- package/dist/{chunk-FGHADGIC.js → chunk-4AQZYNHM.js} +2 -2
- package/dist/{chunk-W65V465O.js → chunk-4EA2SFK2.js} +66 -4
- package/dist/{chunk-MKRIZ4VG.js → chunk-4GXJUYJV.js} +4 -2
- package/dist/{chunk-F7REGDKO.js → chunk-55F4QU2V.js} +2 -1
- package/dist/{chunk-M6ZWP4RI.js → chunk-7OEIXFC3.js} +2 -2
- package/dist/{chunk-MCFIXAV5.js → chunk-D3WPMGEX.js} +55 -37
- package/dist/{chunk-AISNSNDV.js → chunk-D6YX4NNN.js} +22 -10
- package/dist/chunk-DUY5CDAM.js +36 -0
- package/dist/{chunk-B63BF443.js → chunk-EAI67NTM.js} +9 -1
- package/dist/{chunk-FEKQHPVA.js → chunk-EINWQFXI.js} +9 -8
- package/dist/chunk-GDFF3BQG.js +136 -0
- package/dist/{chunk-X22KCSCO.js → chunk-GXYDVZKM.js} +7 -5
- package/dist/{chunk-X2WMBTS3.js → chunk-HLPLT3NY.js} +8 -5
- package/dist/{chunk-PB222GIA.js → chunk-HWQGBIH7.js} +1 -1
- package/dist/chunk-IL4EDBMV.js +566 -0
- package/dist/{chunk-HQE6EJS5.js → chunk-LAZGHEYU.js} +1 -1
- package/dist/{chunk-QG7OOKIN.js → chunk-LE5H7LMT.js} +1 -1
- package/dist/chunk-LNVEIJ2L.js +48 -0
- package/dist/{chunk-JUA6VU2Z.js → chunk-OJCP3C3J.js} +12 -23
- package/dist/{chunk-37JJDS4H.js → chunk-POSZWRGL.js} +1 -1
- package/dist/{chunk-TCEJ7XXM.js → chunk-QOWHHM3F.js} +1 -1
- package/dist/{chunk-H6U2U3EP.js → chunk-RRJV5UR5.js} +304 -65
- package/dist/{chunk-OFPYOC3M.js → chunk-ULAU5ZGU.js} +127 -120
- package/dist/{chunk-V6SRLKUB.js → chunk-V2FXMOEA.js} +2 -2
- package/dist/{chunk-GDQEU4I7.js → chunk-VCYSOXON.js} +296 -526
- package/dist/{chunk-BLETMLRX.js → chunk-VMNRXKAH.js} +1374 -989
- package/dist/{chunk-37EVZP66.js → chunk-VRHTNBA6.js} +167 -92
- package/dist/{chunk-FXDDDSPL.js → chunk-VY6W3T43.js} +4 -4
- package/dist/{chunk-ZDGHGY74.js → chunk-WCN4YSH7.js} +13 -6
- package/dist/{chunk-PH4Q3A6W.js → chunk-WOONT5ZP.js} +1 -1
- package/dist/{chunk-47OSH2ZO.js → chunk-XJ42NBP5.js} +395 -206
- package/dist/{chunk-SCGVWUZX.js → chunk-ZCHIC2GM.js} +92 -75
- package/dist/chunk-ZPL2RR7F.js +798 -0
- package/dist/cli/chat.js +33 -35
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +13 -13
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +7 -7
- package/dist/db/schema/agent-invocations.d.ts +20 -0
- package/dist/db/schema/conversation-annotations.d.ts +2 -2
- package/dist/db/schema/location-configurations.d.ts +127 -0
- package/dist/db/schema.d.ts +150 -3
- package/dist/{db-WWOMXWTT.js → db-XUKZRFFK.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-A6ZZX74U.js → oauth-callback-server-LPZMMGFI.js} +25 -26
- package/dist/{runner-KSGB2UAV.js → runner-DGKUTMPX.js} +22 -41
- package/dist/{skills-26QPWKVS.js → skills-P7YUFSXM.js} +6 -6
- package/dist/spawn-DSK3ZEVD.js +38 -0
- package/dist/{validation-OPSRGFGH.js → validation-S7U5M5NR.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-VMSW7STJ.js → work-GAA7TVAD.js} +18 -19
- package/dist/{worker-2JNFB7C7.js → worker-JXPJH3QB.js} +11 -10
- package/migrations/0024_misty_typhoid_mary.sql +12 -0
- package/migrations/meta/0024_snapshot.json +2275 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +6 -5
- package/dist/api/health.d.ts +0 -7
- package/dist/api/personal-tokens/create.d.ts +0 -11
- package/dist/api/personal-tokens/list.d.ts +0 -12
- package/dist/api/personal-tokens/revoke.d.ts +0 -5
- package/dist/api/plugin-reports.d.ts +0 -63
- package/dist/api/plugins.d.ts +0 -8
- package/dist/api/runtime.d.ts +0 -24
- package/dist/api/skills.d.ts +0 -6
- package/dist/chat/slack/tools/canvas/context.d.ts +0 -18
- package/dist/chat/slack/tools/channel-access.d.ts +0 -30
- package/dist/chat/state/artifacts.d.ts +0 -30
- package/dist/chat/tool-support/turn-deadline-result.d.ts +0 -3
- package/dist/chunk-HLXXQI5Q.js +0 -238
- package/dist/chunk-LVW7BLLT.js +0 -115
- package/dist/chunk-Q6QZTTLS.js +0 -55
- package/dist/chunk-QSXZ42KX.js +0 -285
- package/dist/chunk-R776HKPK.js +0 -81
- package/dist/chunk-T5GXFFLA.js +0 -67
- package/dist/spawn-5LAJXZ2P.js +0 -39
- /package/dist/chat/slack/{tools → tool-support}/canvas/markdown.d.ts +0 -0
- /package/dist/chat/slack/{tools → tool-support}/channel-capabilities.d.ts +0 -0
- /package/dist/chat/slack/{tools → tool-support}/context.d.ts +0 -0
- /package/dist/chat/slack/{tools → tool-support}/slack-message-url.d.ts +0 -0
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-6GWA276C.js";
|
|
10
10
|
import {
|
|
11
11
|
getDeploymentTelemetryAttributes
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LAZGHEYU.js";
|
|
13
13
|
|
|
14
14
|
// src/chat/logging.ts
|
|
15
15
|
import path from "path";
|
|
@@ -1184,6 +1184,13 @@ function logException(error, eventName, attributes = {}) {
|
|
|
1184
1184
|
const normalizedError = error instanceof Error ? error : new Error(String(error));
|
|
1185
1185
|
return log.exception(eventName, normalizedError, attributes);
|
|
1186
1186
|
}
|
|
1187
|
+
async function runBestEffort(operation, eventName, attributes = {}) {
|
|
1188
|
+
try {
|
|
1189
|
+
await operation();
|
|
1190
|
+
} catch (error) {
|
|
1191
|
+
logException(error, eventName, attributes);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1187
1194
|
function setTags(context = {}) {
|
|
1188
1195
|
updateLogContext(context, contextToAttributes(context));
|
|
1189
1196
|
setSentryTagsFromContext(context);
|
|
@@ -1476,6 +1483,7 @@ export {
|
|
|
1476
1483
|
logWarn,
|
|
1477
1484
|
logError,
|
|
1478
1485
|
logException,
|
|
1486
|
+
runBestEffort,
|
|
1479
1487
|
setTags,
|
|
1480
1488
|
createRequestContext,
|
|
1481
1489
|
withContext,
|
|
@@ -4,24 +4,24 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
formatProviderLabel,
|
|
6
6
|
startOAuthFlow
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WCN4YSH7.js";
|
|
8
|
+
import {
|
|
9
|
+
parseSandboxEgressAuthRequiredSignal
|
|
10
|
+
} from "./chunk-HUO3UTAQ.js";
|
|
8
11
|
import {
|
|
9
12
|
abandonReplacedPendingAuth,
|
|
10
13
|
canReusePendingAuthLink,
|
|
11
14
|
recordAuthorizationRequested
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
parseSandboxEgressAuthRequiredSignal
|
|
15
|
-
} from "./chunk-HUO3UTAQ.js";
|
|
15
|
+
} from "./chunk-VCYSOXON.js";
|
|
16
16
|
import {
|
|
17
17
|
AGENT_INVOCATION_MAILBOX_STATUSES
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-D3WPMGEX.js";
|
|
19
19
|
import {
|
|
20
20
|
TURN_REASONING_LEVELS
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-4GXJUYJV.js";
|
|
22
22
|
import {
|
|
23
23
|
pluginCatalogRuntime
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-HWQGBIH7.js";
|
|
25
25
|
import {
|
|
26
26
|
credentialContextSchema
|
|
27
27
|
} from "./chunk-RUIXF3YQ.js";
|
|
@@ -128,6 +128,7 @@ function createPluginAuthOrchestration(input) {
|
|
|
128
128
|
if (!reusingPendingLink) {
|
|
129
129
|
const oauthResult = await startOAuthFlow(provider, {
|
|
130
130
|
actorId: input.actorId,
|
|
131
|
+
...input.actor ? { actor: input.actor } : {},
|
|
131
132
|
channelId: input.channelId,
|
|
132
133
|
destination: input.destination,
|
|
133
134
|
source: input.source,
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// src/chat/agent/request.ts
|
|
2
|
+
function isAgentRunFeatureDisabled(policy, feature) {
|
|
3
|
+
return policy?.disabledFeatures?.includes(feature) ?? false;
|
|
4
|
+
}
|
|
5
|
+
var RetryableDeliveryError = class extends Error {
|
|
6
|
+
constructor(cause) {
|
|
7
|
+
super("Assistant delivery was transient or ambiguous", { cause });
|
|
8
|
+
this.name = "RetryableDeliveryError";
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
function actorFromRouting(routing) {
|
|
12
|
+
if (routing.dispatch?.actor) {
|
|
13
|
+
return routing.dispatch.actor;
|
|
14
|
+
}
|
|
15
|
+
if (routing.actor) {
|
|
16
|
+
return routing.actor;
|
|
17
|
+
}
|
|
18
|
+
if (routing.credentialContext && !("type" in routing.credentialContext.actor)) {
|
|
19
|
+
return routing.credentialContext.actor;
|
|
20
|
+
}
|
|
21
|
+
return void 0;
|
|
22
|
+
}
|
|
23
|
+
function assertRunRoutingConsistency(request) {
|
|
24
|
+
const { destination, source } = request.routing;
|
|
25
|
+
switch (source.platform) {
|
|
26
|
+
case "slack": {
|
|
27
|
+
if (destination.platform !== "slack") {
|
|
28
|
+
throw new TypeError("Run source and destination platforms do not match");
|
|
29
|
+
}
|
|
30
|
+
if (source.teamId !== destination.teamId) {
|
|
31
|
+
throw new TypeError("Slack source and destination teams do not match");
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case "local": {
|
|
36
|
+
if (destination.platform !== "local") {
|
|
37
|
+
throw new TypeError("Run source and destination platforms do not match");
|
|
38
|
+
}
|
|
39
|
+
if (source.conversationId !== destination.conversationId) {
|
|
40
|
+
throw new TypeError(
|
|
41
|
+
"Source and destination conversation IDs do not match"
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
if (request.routing.surface !== "internal" && destination.conversationId !== request.conversationId) {
|
|
45
|
+
throw new TypeError(
|
|
46
|
+
"Source, destination, and run conversation IDs do not match"
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
case "web": {
|
|
52
|
+
if (request.routing.surface !== "internal" && source.conversationId !== request.conversationId) {
|
|
53
|
+
throw new TypeError(
|
|
54
|
+
"Web source and run conversation IDs do not match"
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
switch (destination.platform) {
|
|
58
|
+
case "local": {
|
|
59
|
+
if (source.conversationId !== destination.conversationId) {
|
|
60
|
+
throw new TypeError(
|
|
61
|
+
"Source and destination conversation IDs do not match"
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
if (request.routing.surface !== "internal" && destination.conversationId !== request.conversationId) {
|
|
65
|
+
throw new TypeError(
|
|
66
|
+
"Source, destination, and run conversation IDs do not match"
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case "slack": {
|
|
72
|
+
if (request.routing.publishExternally) {
|
|
73
|
+
throw new TypeError(
|
|
74
|
+
"Web turns on Slack destinations must not publish externally"
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const actor = request.routing.dispatch?.actor ?? request.routing.actor;
|
|
84
|
+
if (!actor || actor.platform === "system") {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const actorMatchesDestination = (() => {
|
|
88
|
+
switch (actor.platform) {
|
|
89
|
+
case "slack":
|
|
90
|
+
return destination.platform === "slack";
|
|
91
|
+
case "local":
|
|
92
|
+
return destination.platform === "local";
|
|
93
|
+
case "web":
|
|
94
|
+
return destination.platform === "local" || destination.platform === "slack" && request.routing.publishExternally !== true;
|
|
95
|
+
}
|
|
96
|
+
})();
|
|
97
|
+
if (!actorMatchesDestination) {
|
|
98
|
+
throw new TypeError(
|
|
99
|
+
`Actor platform "${actor.platform}" does not match destination platform "${destination.platform}"`
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
if (actor.platform === "slack" && destination.platform === "slack" && actor.teamId !== destination.teamId) {
|
|
103
|
+
throw new TypeError("Slack actor team does not match destination team");
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function toolInvocationDestination(routing) {
|
|
107
|
+
if (routing.destination.platform !== "slack" || !routing.toolChannelId) {
|
|
108
|
+
return routing.destination;
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
platform: "slack",
|
|
112
|
+
teamId: routing.destination.teamId,
|
|
113
|
+
channelId: routing.toolChannelId
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function surfaceFromRouting(routing) {
|
|
117
|
+
if (routing.surface) {
|
|
118
|
+
return routing.surface;
|
|
119
|
+
}
|
|
120
|
+
if (routing.source.platform === "slack") {
|
|
121
|
+
return "slack";
|
|
122
|
+
}
|
|
123
|
+
if (routing.source.platform === "web") {
|
|
124
|
+
return "api";
|
|
125
|
+
}
|
|
126
|
+
return "internal";
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export {
|
|
130
|
+
isAgentRunFeatureDisabled,
|
|
131
|
+
RetryableDeliveryError,
|
|
132
|
+
actorFromRouting,
|
|
133
|
+
assertRunRoutingConsistency,
|
|
134
|
+
toolInvocationDestination,
|
|
135
|
+
surfaceFromRouting
|
|
136
|
+
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ToolInputError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VCYSOXON.js";
|
|
4
4
|
import {
|
|
5
5
|
canRouteResourceEvents,
|
|
6
6
|
getPlugins
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZCHIC2GM.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VRHTNBA6.js";
|
|
11
11
|
import {
|
|
12
12
|
juniorEventTasks,
|
|
13
13
|
juniorSchedulerRuns,
|
|
14
14
|
juniorSchedulerTasks,
|
|
15
15
|
juniorStats
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-D3WPMGEX.js";
|
|
17
17
|
import {
|
|
18
18
|
juniorDestinations
|
|
19
19
|
} from "./chunk-VFUK3X5B.js";
|
|
20
20
|
import {
|
|
21
21
|
logInfo
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-EAI67NTM.js";
|
|
23
23
|
|
|
24
24
|
// src/chat/event-tasks/store.ts
|
|
25
25
|
import { and, asc, desc, eq, inArray, or, sql } from "drizzle-orm";
|
|
@@ -197,6 +197,8 @@ var juniorToolBoundContinuationSchema = juniorToolContinuationSchema.extend({
|
|
|
197
197
|
var juniorToolOutputSchema = z2.object({
|
|
198
198
|
target: z2.string().min(1).optional(),
|
|
199
199
|
truncated: z2.boolean().optional(),
|
|
200
|
+
/** True when this attempt did not finish before its time budget. */
|
|
201
|
+
timed_out: z2.boolean().optional(),
|
|
200
202
|
continuation: juniorToolContinuationSchema.optional()
|
|
201
203
|
}).passthrough();
|
|
202
204
|
function sortJsonValue(value) {
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
getConversationStore,
|
|
9
9
|
parseDestination,
|
|
10
10
|
sameDestination
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VRHTNBA6.js";
|
|
12
12
|
import {
|
|
13
13
|
getDefaultRedisStateAdapterFor,
|
|
14
14
|
getStateAdapter
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2B3PT3V2.js";
|
|
16
16
|
import {
|
|
17
17
|
getChatConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4GXJUYJV.js";
|
|
19
19
|
import {
|
|
20
20
|
parseStoredSlackActor
|
|
21
21
|
} from "./chunk-HZF5P5UN.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
isRecord,
|
|
24
24
|
toOptionalNumber,
|
|
25
25
|
toOptionalString
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EAI67NTM.js";
|
|
27
27
|
|
|
28
28
|
// src/chat/task-execution/state.ts
|
|
29
29
|
import { randomUUID } from "crypto";
|
|
@@ -69,7 +69,8 @@ var inboundMessageSourceSchema = z.enum([
|
|
|
69
69
|
"plugin",
|
|
70
70
|
"resource_event",
|
|
71
71
|
"scheduler",
|
|
72
|
-
"slack"
|
|
72
|
+
"slack",
|
|
73
|
+
"web"
|
|
73
74
|
]);
|
|
74
75
|
var agentInputSchema = z.object({
|
|
75
76
|
attachments: z.array(z.unknown()).optional(),
|
|
@@ -80,6 +81,7 @@ var agentInputSchema = z.object({
|
|
|
80
81
|
message: "agent input requires text or attachments"
|
|
81
82
|
});
|
|
82
83
|
var inboundMessageDeliverySchema = z.enum(["defer", "interrupt"]);
|
|
84
|
+
var publishExternallySchema = z.boolean();
|
|
83
85
|
var inboundMessageSchema = z.object({
|
|
84
86
|
attemptCount: z.number().finite().optional(),
|
|
85
87
|
conversationId: z.string().refine((value) => value.trim().length > 0),
|
|
@@ -90,6 +92,7 @@ var inboundMessageSchema = z.object({
|
|
|
90
92
|
injectedAtMs: z.number().finite().optional(),
|
|
91
93
|
input: agentInputSchema,
|
|
92
94
|
receivedAtMs: z.number().finite(),
|
|
95
|
+
publishExternally: publishExternallySchema,
|
|
93
96
|
source: inboundMessageSourceSchema
|
|
94
97
|
}).strict();
|
|
95
98
|
function conversationKey(conversationId) {
|