@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
|
@@ -4,30 +4,30 @@ import {
|
|
|
4
4
|
isConversationScopedChannel,
|
|
5
5
|
isDmChannel,
|
|
6
6
|
normalizeSlackConversationId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-V2FXMOEA.js";
|
|
8
8
|
import {
|
|
9
9
|
getConversationEventStore,
|
|
10
10
|
getDb
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VRHTNBA6.js";
|
|
12
12
|
import {
|
|
13
13
|
juniorConversationAnnotations,
|
|
14
14
|
juniorConversationEvents,
|
|
15
15
|
juniorIdentities,
|
|
16
16
|
juniorUsers
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-D3WPMGEX.js";
|
|
18
18
|
import {
|
|
19
19
|
SANDBOX_WORKSPACE_ROOT
|
|
20
20
|
} from "./chunk-EM225ITJ.js";
|
|
21
21
|
import {
|
|
22
22
|
getStateAdapter
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2B3PT3V2.js";
|
|
24
24
|
import {
|
|
25
25
|
botConfig,
|
|
26
26
|
completeObject,
|
|
27
27
|
embedTexts,
|
|
28
28
|
getSlackBotToken,
|
|
29
29
|
standardModelId
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-4GXJUYJV.js";
|
|
31
31
|
import {
|
|
32
32
|
isActorUserId,
|
|
33
33
|
parseActorUserId
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
logInfo,
|
|
43
43
|
logWarn,
|
|
44
44
|
normalizeIdentityEmail
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-EAI67NTM.js";
|
|
46
46
|
|
|
47
47
|
// src/chat/plugins/agent-hooks.ts
|
|
48
48
|
import {
|
|
@@ -280,6 +280,7 @@ function createPluginModel(pluginName, options = {}, runtime = {}) {
|
|
|
280
280
|
...input.system !== void 0 ? { system: input.system } : {},
|
|
281
281
|
...input.maxTokens !== void 0 ? { maxTokens: input.maxTokens } : {},
|
|
282
282
|
signal: runtime.signal,
|
|
283
|
+
promptName: `${pluginName}.structured_completion`,
|
|
283
284
|
metadata: {
|
|
284
285
|
pluginName,
|
|
285
286
|
pluginModelRole: "structured"
|
|
@@ -459,7 +460,7 @@ function createResourceEventTeamIdResolver() {
|
|
|
459
460
|
};
|
|
460
461
|
}
|
|
461
462
|
|
|
462
|
-
// src/chat/slack/
|
|
463
|
+
// src/chat/slack/tool-support/context.ts
|
|
463
464
|
function getSlackToolContext(context) {
|
|
464
465
|
if (context.source.platform !== "slack") {
|
|
465
466
|
return void 0;
|
|
@@ -739,7 +740,7 @@ function verifyEventTaskCredentialSubject(input) {
|
|
|
739
740
|
return timingSafeMatch(expected, binding.signature);
|
|
740
741
|
}
|
|
741
742
|
|
|
742
|
-
// src/chat/slack/
|
|
743
|
+
// src/chat/slack/tool-support/channel-capabilities.ts
|
|
743
744
|
function resolveChannelCapabilities(channelId) {
|
|
744
745
|
return {
|
|
745
746
|
canCreateCanvas: isConversationScopedChannel(channelId),
|
|
@@ -804,6 +805,40 @@ function systemPromptPluginContext(plugin) {
|
|
|
804
805
|
...basePluginContext(plugin)
|
|
805
806
|
};
|
|
806
807
|
}
|
|
808
|
+
function pluginInvocationContext(context) {
|
|
809
|
+
const common = { conversationId: context.conversationId };
|
|
810
|
+
switch (context.source.platform) {
|
|
811
|
+
case "slack": {
|
|
812
|
+
if (context.destination.platform !== "slack") {
|
|
813
|
+
throw new TypeError("Slack plugin context requires Slack destination");
|
|
814
|
+
}
|
|
815
|
+
return {
|
|
816
|
+
...common,
|
|
817
|
+
actor: context.actor?.platform === "slack" ? context.actor : void 0,
|
|
818
|
+
destination: context.destination,
|
|
819
|
+
source: context.source
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
case "local": {
|
|
823
|
+
if (context.destination.platform !== "local") {
|
|
824
|
+
throw new TypeError("Local plugin context requires local destination");
|
|
825
|
+
}
|
|
826
|
+
return {
|
|
827
|
+
...common,
|
|
828
|
+
actor: context.actor?.platform === "local" ? context.actor : void 0,
|
|
829
|
+
destination: context.destination,
|
|
830
|
+
source: context.source
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
case "web":
|
|
834
|
+
return {
|
|
835
|
+
...common,
|
|
836
|
+
actor: context.actor?.platform === "web" ? context.actor : void 0,
|
|
837
|
+
destination: context.destination,
|
|
838
|
+
source: context.source
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
}
|
|
807
842
|
function invocationPluginContext(plugin, context, turnId) {
|
|
808
843
|
const base = basePluginContext(plugin);
|
|
809
844
|
const common = {
|
|
@@ -823,27 +858,9 @@ function invocationPluginContext(plugin, context, turnId) {
|
|
|
823
858
|
text: context.userText ?? "",
|
|
824
859
|
state: createPluginState(plugin.manifest.name)
|
|
825
860
|
};
|
|
826
|
-
if (context.source.platform === "slack") {
|
|
827
|
-
if (context.destination.platform !== "slack") {
|
|
828
|
-
throw new TypeError(
|
|
829
|
-
"Slack plugin prompt context requires Slack destination"
|
|
830
|
-
);
|
|
831
|
-
}
|
|
832
|
-
return {
|
|
833
|
-
...common,
|
|
834
|
-
destination: context.destination,
|
|
835
|
-
actor: context.actor?.platform === "slack" ? context.actor : void 0
|
|
836
|
-
};
|
|
837
|
-
}
|
|
838
|
-
if (context.destination.platform !== "local") {
|
|
839
|
-
throw new TypeError(
|
|
840
|
-
"Local plugin prompt context requires local destination"
|
|
841
|
-
);
|
|
842
|
-
}
|
|
843
861
|
return {
|
|
844
862
|
...common,
|
|
845
|
-
|
|
846
|
-
actor: context.actor?.platform === "local" ? context.actor : void 0
|
|
863
|
+
...pluginInvocationContext(context)
|
|
847
864
|
};
|
|
848
865
|
}
|
|
849
866
|
function pluginMcpContext(plugin, context) {
|
|
@@ -989,7 +1006,8 @@ async function getPluginSystemPromptContributions(source) {
|
|
|
989
1006
|
try {
|
|
990
1007
|
const pluginContributions = await hook({
|
|
991
1008
|
...systemPromptPluginContext(plugin),
|
|
992
|
-
|
|
1009
|
+
// Plugin system prompts only distinguish Slack vs non-Slack surfaces.
|
|
1010
|
+
platform: source.platform === "slack" ? "slack" : "local"
|
|
993
1011
|
});
|
|
994
1012
|
const result = systemPromptMessageArraySchema.safeParse(pluginContributions);
|
|
995
1013
|
if (!result.success) {
|
|
@@ -1126,54 +1144,53 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
|
|
|
1126
1144
|
canSubscribe: context.source.platform === "slack" && canRouteResourceEvents()
|
|
1127
1145
|
};
|
|
1128
1146
|
const resolveActor = context.resolveActorIdentity ?? (async () => void 0);
|
|
1147
|
+
const common = {
|
|
1148
|
+
...basePluginContext(plugin),
|
|
1149
|
+
...annotations ? { annotations } : {},
|
|
1150
|
+
conversationId: context.conversationId,
|
|
1151
|
+
userText: context.userText,
|
|
1152
|
+
embedder: createPluginEmbedder(pluginName),
|
|
1153
|
+
egress: context.egress,
|
|
1154
|
+
...mcp ? { mcp } : {},
|
|
1155
|
+
model: createPluginModel(pluginName, plugin.model),
|
|
1156
|
+
resourceEvents,
|
|
1157
|
+
sandbox,
|
|
1158
|
+
state: createPluginState(pluginName),
|
|
1159
|
+
users: { resolveActor }
|
|
1160
|
+
};
|
|
1129
1161
|
let pluginContext;
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
"Slack plugin
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
"
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
actor: context.actor?.platform === "local" ? context.actor : void 0,
|
|
1163
|
-
conversationId: context.conversationId,
|
|
1164
|
-
...annotations ? { annotations } : {},
|
|
1165
|
-
destination: context.destination,
|
|
1166
|
-
source: context.source,
|
|
1167
|
-
userText: context.userText,
|
|
1168
|
-
embedder: createPluginEmbedder(pluginName),
|
|
1169
|
-
egress: context.egress,
|
|
1170
|
-
...mcp ? { mcp } : {},
|
|
1171
|
-
model: createPluginModel(pluginName, plugin.model),
|
|
1172
|
-
resourceEvents,
|
|
1173
|
-
sandbox,
|
|
1174
|
-
state: createPluginState(pluginName),
|
|
1175
|
-
users: { resolveActor }
|
|
1176
|
-
};
|
|
1162
|
+
switch (context.source.platform) {
|
|
1163
|
+
case "slack":
|
|
1164
|
+
if (context.destination.platform !== "slack") {
|
|
1165
|
+
throw new TypeError("Slack plugin context requires Slack destination");
|
|
1166
|
+
}
|
|
1167
|
+
pluginContext = {
|
|
1168
|
+
...common,
|
|
1169
|
+
actor: context.actor?.platform === "slack" ? context.actor : void 0,
|
|
1170
|
+
destination: context.destination,
|
|
1171
|
+
slack: slackContext,
|
|
1172
|
+
source: context.source
|
|
1173
|
+
};
|
|
1174
|
+
break;
|
|
1175
|
+
case "local":
|
|
1176
|
+
if (context.destination.platform !== "local") {
|
|
1177
|
+
throw new TypeError("Local plugin context requires local destination");
|
|
1178
|
+
}
|
|
1179
|
+
pluginContext = {
|
|
1180
|
+
...common,
|
|
1181
|
+
actor: context.actor?.platform === "local" ? context.actor : void 0,
|
|
1182
|
+
destination: context.destination,
|
|
1183
|
+
source: context.source
|
|
1184
|
+
};
|
|
1185
|
+
break;
|
|
1186
|
+
case "web":
|
|
1187
|
+
pluginContext = {
|
|
1188
|
+
...common,
|
|
1189
|
+
actor: context.actor?.platform === "web" ? context.actor : void 0,
|
|
1190
|
+
destination: context.destination,
|
|
1191
|
+
source: context.source
|
|
1192
|
+
};
|
|
1193
|
+
break;
|
|
1177
1194
|
}
|
|
1178
1195
|
const pluginTools = hook(pluginContext);
|
|
1179
1196
|
const namespace = pluginToolNamespace(pluginName);
|