@sentry/junior 0.271.0 → 0.273.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/{adapter-Bqbtr1RV.js → adapter-umap1cth.js} +1 -1
- package/dist/{admin-CWBjzyN0.js → admin-0o6E_3lo.js} +1 -1
- package/dist/{agent-runner-BiHsH8O_.js → agent-runner-D7Qz-lGO.js} +899 -631
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +1 -1
- package/dist/api.js +62 -537
- package/dist/{app-C81xfpNa.d.ts → app-BcyhJq8x.d.ts} +4 -9
- package/dist/app.d.ts +1 -1
- package/dist/app.js +673 -134
- package/dist/{assistant-reply-DgtX9DaJ.js → assistant-reply-wZ7i4OFa.js} +1 -1
- package/dist/{automation-Dwh_xcqM.js → automation-yffXcZt9.js} +1 -1
- package/dist/{briefs-0FeSJHQ3.js → briefs-CgMnlpIp.js} +4 -4
- package/dist/{catalog-runtime-Bw9kjGVu.js → catalog-runtime-TygDsPOU.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +1 -1
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-B0jlQSgO.js → client-DhqbV0Fe.js} +63 -5
- package/dist/{reporting-schema-CZREhYc-.js → common-Eu6sx09c.js} +4 -1
- package/dist/{config-DrAeD8sr.js → config-C6FTd7PX.js} +7 -15
- package/dist/{connections-BzN2K0G9.js → connections-Dq72KajR.js} +11 -11
- package/dist/{conversation-AhOVzN_k.js → conversation-T4oabbBi.js} +22 -1
- package/dist/{conversation-privacy-D1NhUxyo.js → conversation-privacy-BeRgrsph.js} +1 -1
- package/dist/{credential-sync-DpNWl4yy.js → credential-sync-BmCbHAp4.js} +15 -16
- package/dist/{db-DSabI7jJ.d.ts → db-DOzBGLn5.d.ts} +11 -1
- package/dist/{executor-C2cRw0hZ.js → executor-BafgvQcc.js} +25 -7
- package/dist/instrumentation.js +114 -3
- package/dist/{job-queue-CEeLYkSj.js → job-queue-C4lphW9Y.js} +3 -3
- package/dist/{logging-DuwXUuIY.js → logging-CNs1e04n.js} +6 -1
- package/dist/message-CETC5lsl.js +186 -0
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-oM5TJt34.js → oauth-callback-server-DcQZsKMm.js} +2 -2
- package/dist/{credentialed-mh7HBqey.js → projection-BOpi891B.js} +4576 -49
- package/dist/{prompt-BPSdXYXV.js → prompt-B1ySjUyf.js} +1 -1
- package/dist/{registry-BPtbAVFo.js → registry-B-yUrv3h.js} +2 -2
- package/dist/{resolve-D44G1jJm.js → resolve-DqVtd4Q9.js} +3 -3
- package/dist/{result-CvP8c5bb.js → result-DQwTiLTw.js} +16 -12
- package/dist/{runner-FIGIKvk2.js → runner-Dco5qMq6.js} +11 -11
- package/dist/{sandbox-egress-signals-C_JzucwP.js → sandbox-egress-signals-DFc_9Mcv.js} +1 -1
- package/dist/{schema-DKZgO-xf.js → schema-5xHDGlBW.js} +10 -9
- package/dist/{schema-DPCvePop.d.ts → schema-9OGdsaxF.d.ts} +28 -3
- package/dist/{service-account-1mJGRAvx.js → service-account-CWfk9Cs-.js} +3 -3
- package/dist/{service-account-CHO3YXpt.js → service-account-smdPFWNy.js} +3 -3
- package/dist/{session-stop-DuUB1rwQ.js → session-stop-DaT_7tYa.js} +50 -24
- package/dist/{skills-DHK7L9Eo.js → skills-BbtJSF2-.js} +2 -2
- package/dist/{spawn-CKl_ySIq.js → spawn-Ceikdjkp.js} +2 -2
- package/dist/{list-DjJJ5K0x.js → stop-dKUc-x2K.js} +1017 -469
- package/dist/{store-Di0E4EvU.js → store-C1xuZcLd.js} +48 -31
- package/dist/{store-BF2XEeQz.js → store-DaxUuOmD.js} +3 -3
- package/dist/{task-queue-CC7IFtbT.js → task-queue-ymAh_-P1.js} +4 -4
- package/dist/{task-runner-DKZtMFwa.js → task-runner-vlH6pEm3.js} +6 -6
- package/dist/{thread-state-BQ1T3eeF.js → thread-state-BkUpE9Ae.js} +4 -5
- package/dist/{turn-failure-response-B5eSFoHn.js → turn-failure-response-DIsD7ip_.js} +7 -8
- package/dist/{turn-lifecycle-CTLEIEOn.js → turn-lifecycle-BdPKdPS8.js} +1 -1
- package/dist/turn-session-routing-BdCTDq9m.js +1625 -0
- package/dist/{validation-Cjo-3yt3.js → validation-BQjCfh84.js} +1 -1
- package/dist/{version-D30MBLLw.js → version-BpiFGZZW.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-D3jhuP66.js → viewer-C6Y1aXjZ.js} +49 -21
- package/dist/{work-CL9QwQcl.js → work-ChPh_YEh.js} +27 -39
- package/dist/{worker-S2P7IJDI.js → worker-Be_sK_ou.js} +6 -6
- package/migrations/0072_conversation_read_positions.sql +10 -0
- package/migrations/meta/0072_snapshot.json +4064 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +4 -4
- package/dist/message-CRe3WBKc.js +0 -59
- package/dist/turn-session-routing-BFVp8TbU.js +0 -6072
- package/migrations/AGENTS.md +0 -8
- package/dist/{oauth-relay-CTygMkNx.js → oauth-relay-C6ZAyJgf.js} +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as
|
|
1
|
+
import { J as briefOutcomeStatusSchema, X as parseBriefInput, Y as conversationBriefSchema } from "./conversation-T4oabbBi.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
// src/chat/briefs/generate.ts
|
|
4
4
|
const MAX_INPUT_CHARS = 6e4;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-
|
|
1
|
+
import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-CNs1e04n.js";
|
|
2
2
|
import { o as isUserActor, s as parseActorUserId } from "./actor-B4DYygOB.js";
|
|
3
3
|
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-DJBompdd.js";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { z } from "zod";
|
|
6
5
|
import { randomUUID } from "node:crypto";
|
|
6
|
+
import { z } from "zod";
|
|
7
7
|
import { parse } from "yaml";
|
|
8
8
|
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
9
9
|
// src/chat/plugins/inline-manifest-source.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { r as getStateAdapter } from "./adapter-
|
|
1
|
+
import { Er as getSandboxProvider, Sr as create, Zi as sleep, da as SANDBOX_COMMAND_PATH, ga as SANDBOX_WORKSPACE_ROOT, ua as runNonInteractiveCommand, wr as isStale } from "./projection-BOpi891B.js";
|
|
2
|
+
import { E as withSpan, b as setSpanAttributes } from "./logging-CNs1e04n.js";
|
|
3
|
+
import { r as getStateAdapter } from "./adapter-umap1cth.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
// src/chat/sandbox/resources.ts
|
|
6
6
|
let configuredResources;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import {
|
|
2
|
+
import { at as listTurnSummaries, it as getTurnRecord } from "./projection-BOpi891B.js";
|
|
3
3
|
import { t as createActor } from "./actor-B4DYygOB.js";
|
|
4
|
-
import {
|
|
5
|
-
import { f as credentialContextForActor } from "./registry-
|
|
6
|
-
import {
|
|
7
|
-
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-
|
|
8
|
-
import { C as markAgentInvocationParentMailboxAppended,
|
|
9
|
-
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-
|
|
10
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
11
|
-
import { i as resolveAgentInvocationId, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-
|
|
4
|
+
import { M as SYSTEM_IDENTITY_ID } from "./viewer-C6Y1aXjZ.js";
|
|
5
|
+
import { f as credentialContextForActor } from "./registry-B-yUrv3h.js";
|
|
6
|
+
import { St as listUnreportedSiblingAgents } from "./agent-runner-D7Qz-lGO.js";
|
|
7
|
+
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-B1ySjUyf.js";
|
|
8
|
+
import { C as markAgentInvocationParentMailboxAppended, a as createAgentInvocationFromLatest, c as getAgentInvocationIdForEvents, f as getAgentInvocationResultMessageId, g as getLatestAgentInvocationForConversation, l as getAgentInvocationIdForMessage, s as getAgentInvocation, u as getAgentInvocationIdForResult, v as isTerminalAgentInvocation } from "./store-C1xuZcLd.js";
|
|
9
|
+
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-DaT_7tYa.js";
|
|
10
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-DaxUuOmD.js";
|
|
11
|
+
import { i as resolveAgentInvocationId, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-ChPh_YEh.js";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import { createEventSource, createLocalSource, createWebSource } from "@sentry/junior-plugin-api";
|
|
14
14
|
// src/chat/conversations/web-mailbox.ts
|
|
@@ -62,10 +62,14 @@ async function getActiveConversationTurnId(conversationId) {
|
|
|
62
62
|
const record = await getTurnRecord(conversationId, turnId);
|
|
63
63
|
return record && (record.source?.kind === "web" || !record.source && record.surface === "api") && !record.dispatchId && (record.state === "paused" || record.state === "running") ? turnId : void 0;
|
|
64
64
|
}
|
|
65
|
+
/** Return the web and event mailbox Turns that are paused or running. */
|
|
66
|
+
async function listActiveMailboxTurns(conversationId) {
|
|
67
|
+
const summaries = await listTurnSummaries(conversationId);
|
|
68
|
+
return (await Promise.all(summaries.filter((summary) => !summary.dispatchId && (summary.state === "paused" || summary.state === "running")).map((summary) => getTurnRecord(conversationId, summary.turnId)))).filter((record) => record !== void 0 && !record.dispatchId && (record.source?.kind === "web" || record.source?.kind === "event" || !record.source && (record.surface === "api" || hasEventActor(record.actors))) && (record.state === "paused" || record.state === "running"));
|
|
69
|
+
}
|
|
65
70
|
/** Return the active web or event mailbox Turn. */
|
|
66
71
|
async function getActiveMailboxTurnId(conversationId) {
|
|
67
|
-
const
|
|
68
|
-
const active = (await Promise.all(summaries.filter((summary) => !summary.dispatchId && (summary.state === "paused" || summary.state === "running")).map((summary) => getTurnRecord(conversationId, summary.turnId)))).filter((record) => record && !record.dispatchId && (record.source?.kind === "web" || record.source?.kind === "event" || !record.source && (record.surface === "api" || hasEventActor(record.actors))) && (record.state === "paused" || record.state === "running"));
|
|
72
|
+
const active = await listActiveMailboxTurns(conversationId);
|
|
69
73
|
if (active.length > 1) throw new Error(`Conversation ${conversationId} has multiple active mailbox Turns`);
|
|
70
74
|
return active[0]?.turnId;
|
|
71
75
|
}
|
|
@@ -476,4 +480,4 @@ async function withAgentInvocationResultActors(work) {
|
|
|
476
480
|
}))
|
|
477
481
|
};
|
|
478
482
|
}
|
|
479
|
-
export { withAgentInvocationResultActors as a,
|
|
483
|
+
export { withAgentInvocationResultActors as a, listActiveMailboxTurns as c, turnInputFactsFromConversationMessage as d, legacyWebMailboxMetadataSchema as f, result_exports as i, resolveMailboxTurnWork as l, enqueueAgentInvocationResult as n, getAuthPausedConversationTurnId as o, enqueueAgentMessageToParent as r, getEventBatchDelayMs as s, createChildConversationWorker as t, sourceFromTurnInput as u };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as setTags, T as withLogContext, p as logException } from "./logging-
|
|
3
|
-
import {
|
|
4
|
-
import { f as credentialContextForActor } from "./registry-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
8
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
9
|
-
import { a as persistThreadStateById, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
10
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
11
|
-
import { i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response-
|
|
1
|
+
import { A as buildConversationContext, F as markConversationMessage, I as normalizeConversationText, Kt as persistWithRetry, L as recordDeliveredAssistantMessage, S as persistConversationMessages, U as authorizationId, et as saveTurnCheckpoint, o as loadProjection, p as recordAuthorizationCompleted, t as commitAcceptedReply, x as hydrateConversationMessages, z as upsertConversationMessage } from "./projection-BOpi891B.js";
|
|
2
|
+
import { S as setTags, T as withLogContext, p as logException } from "./logging-CNs1e04n.js";
|
|
3
|
+
import { M as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-C6Y1aXjZ.js";
|
|
4
|
+
import { f as credentialContextForActor } from "./registry-B-yUrv3h.js";
|
|
5
|
+
import { z as messageCardText } from "./conversation-T4oabbBi.js";
|
|
6
|
+
import { $ as startActiveTurn, Q as markTurnFailed } from "./store-C1xuZcLd.js";
|
|
7
|
+
import { n as getAssistantReplyText } from "./assistant-reply-wZ7i4OFa.js";
|
|
8
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-BdPKdPS8.js";
|
|
9
|
+
import { a as persistThreadStateById, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BkUpE9Ae.js";
|
|
10
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-vlH6pEm3.js";
|
|
11
|
+
import { i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response-DIsD7ip_.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
14
14
|
// src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { di as sandboxEgressSignalsResponseSchema } from "./projection-BOpi891B.js";
|
|
2
2
|
// src/chat/local/sandbox-egress-signals.ts
|
|
3
3
|
const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
|
|
4
4
|
const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { r as AGENT_INVOCATION_STATUSES, u as juniorDestinationKindSchema } from "./agent-invocations-C1RNOCs8.js";
|
|
2
|
-
import { E as conversationSummaryReportSchema, F as conversationChildAgentTotalsSchema, O as conversationUsageSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema } from "./conversation-
|
|
2
|
+
import { E as conversationSummaryReportSchema, F as conversationChildAgentTotalsSchema, O as conversationUsageSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema } from "./conversation-T4oabbBi.js";
|
|
3
3
|
import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours, y as userInputRequestSchema } from "./reporting-window-DgHgwQB3.js";
|
|
4
|
-
import "./automation-
|
|
5
|
-
import "./
|
|
4
|
+
import "./automation-yffXcZt9.js";
|
|
5
|
+
import "./common-Eu6sx09c.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { codeChangeStateSchema, eventMatchSchema } from "@sentry/junior-plugin-api";
|
|
8
|
-
// src/api/schema/common.ts
|
|
9
|
-
/** Stable error body returned by Junior-owned REST endpoints. */
|
|
10
|
-
const apiErrorSchema = z.object({ error: z.string().min(1) }).strict();
|
|
11
8
|
// src/api/schema/conversation-stats.ts
|
|
12
9
|
const conversationStatsItemSchema = z.object({
|
|
13
10
|
active: z.number(),
|
|
@@ -491,7 +488,7 @@ const reviewItemSchema = z.object({
|
|
|
491
488
|
assignees: z.array(personSchema),
|
|
492
489
|
automationId: z.string().min(1).optional(),
|
|
493
490
|
body: z.string(),
|
|
494
|
-
/** True when the viewer can take, submit,
|
|
491
|
+
/** True when the viewer can take, submit, or dismiss it. */
|
|
495
492
|
canAct: z.boolean(),
|
|
496
493
|
/** True when the viewer can act and is not already the only assignee. */
|
|
497
494
|
canTake: z.boolean(),
|
|
@@ -527,6 +524,11 @@ const reviewItemListQuerySchema = z.object({
|
|
|
527
524
|
conversationId: z.string().min(1).optional(),
|
|
528
525
|
/** `nextCursor` of the page before. */
|
|
529
526
|
cursor: z.string().min(1).max(1e3).optional(),
|
|
527
|
+
/**
|
|
528
|
+
* `viewer` drops the items that are assigned only to other people. The
|
|
529
|
+
* list keeps items assigned to the viewer, to Everyone, or to no one.
|
|
530
|
+
*/
|
|
531
|
+
for: z.enum(["viewer"]).optional(),
|
|
530
532
|
/** The number of open items on one page. */
|
|
531
533
|
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
532
534
|
/** Also list the newest done and dismissed items, with the first page. */
|
|
@@ -558,7 +560,6 @@ const reviewItemParamsSchema = z.object({ id: z.string().min(1) }).strict();
|
|
|
558
560
|
/** One person action on a Review item. */
|
|
559
561
|
const reviewItemActionSchema = z.discriminatedUnion("action", [
|
|
560
562
|
z.object({ action: z.literal("take") }).strict(),
|
|
561
|
-
z.object({ action: z.literal("complete") }).strict(),
|
|
562
563
|
z.object({ action: z.literal("dismiss") }).strict(),
|
|
563
564
|
z.object({
|
|
564
565
|
action: z.literal("submit"),
|
|
@@ -624,4 +625,4 @@ const statsReportSchema = z.object({
|
|
|
624
625
|
windowEnd: z.string(),
|
|
625
626
|
windowStart: z.string()
|
|
626
627
|
}).strict();
|
|
627
|
-
export { codeRepositorySummarySchema as $, avatarParamsSchema as A, dailyConversationActivitySchema as B, createdPersonalTokenSchema as C, revokePersonalTokenResponseSchema as D, personalTokenParamsSchema as E, locationDirectoryReportSchema as F, startConnectionResponseSchema as G, connectionParamsSchema as H, locationParamsSchema as I, codeChangeSummarySchema as J, codeActivityDaySchema as K, activityDays as L, personalSpendReportSchema as M, locationActivityDayReportSchema as N, actorDirectoryReportSchema as O, locationDetailReportSchema as P, codeRepositoryReportSchema as Q, activityHours as R, createPersonalTokenBodySchema as S, personalTokenMetadataSchema as T, connectionSchema as U, connectionListSchema as V, disconnectConnectionResponseSchema as W, codePersonReportSchema as X, codeOverviewReportSchema as Y, codeRepositoryParamsSchema as Z, disconnectServiceAccountResponseSchema as _, workspaceBodySchema as a, conversationStatsReportSchema as at, serviceAccountSchema as b, workspaceRepoSchema as c, reviewItemCountSchema as d, conversationWatchSchema as et, reviewItemListQuerySchema as f, reviewItemWaitingConversationsSchema as g, reviewItemSchema as h, deleteWorkspaceResponseSchema as i, stopConversationTurnResponseSchema as it, personParamsSchema as j, actorProfileReportSchema as k, workspaceSchema as l, reviewItemParamsSchema as m, statsReportSchema as n, conversationChildAgentSchema as nt, workspaceListSchema as o,
|
|
628
|
+
export { codeRepositorySummarySchema as $, avatarParamsSchema as A, dailyConversationActivitySchema as B, createdPersonalTokenSchema as C, revokePersonalTokenResponseSchema as D, personalTokenParamsSchema as E, locationDirectoryReportSchema as F, startConnectionResponseSchema as G, connectionParamsSchema as H, locationParamsSchema as I, codeChangeSummarySchema as J, codeActivityDaySchema as K, activityDays as L, personalSpendReportSchema as M, locationActivityDayReportSchema as N, actorDirectoryReportSchema as O, locationDetailReportSchema as P, codeRepositoryReportSchema as Q, activityHours as R, createPersonalTokenBodySchema as S, personalTokenMetadataSchema as T, connectionSchema as U, connectionListSchema as V, disconnectConnectionResponseSchema as W, codePersonReportSchema as X, codeOverviewReportSchema as Y, codeRepositoryParamsSchema as Z, disconnectServiceAccountResponseSchema as _, workspaceBodySchema as a, conversationStatsReportSchema as at, serviceAccountSchema as b, workspaceRepoSchema as c, reviewItemCountSchema as d, conversationWatchSchema as et, reviewItemListQuerySchema as f, reviewItemWaitingConversationsSchema as g, reviewItemSchema as h, deleteWorkspaceResponseSchema as i, stopConversationTurnResponseSchema as it, personParamsSchema as j, actorProfileReportSchema as k, workspaceSchema as l, reviewItemParamsSchema as m, statsReportSchema as n, conversationChildAgentSchema as nt, workspaceListSchema as o, reviewItemListSchema as p, codeChangeSummaryReportSchema as q, baselineSnapshotSchema as r, conversationChildAgentsReportSchema as rt, workspaceParamsSchema as s, statSchema as t, conversationWatchesReportSchema as tt, reviewItemActionSchema as u, serviceAccountListSchema as v, personalTokenListSchema as w, startServiceAccountSignInResponseSchema as x, serviceAccountParamsSchema as y, activitySixHours as z };
|
|
@@ -555,6 +555,7 @@ declare const conversationPendingMessageSchema: z.ZodObject<{
|
|
|
555
555
|
slackUserId: z.ZodOptional<z.ZodString>;
|
|
556
556
|
slackUserName: z.ZodOptional<z.ZodString>;
|
|
557
557
|
}, z.core.$strict>>;
|
|
558
|
+
actorIdentityId: z.ZodOptional<z.ZodString>;
|
|
558
559
|
createdAt: z.ZodString;
|
|
559
560
|
delivery: z.ZodEnum<{
|
|
560
561
|
defer: "defer";
|
|
@@ -607,6 +608,7 @@ declare const conversationPendingMessagesReportSchema: z.ZodObject<{
|
|
|
607
608
|
slackUserId: z.ZodOptional<z.ZodString>;
|
|
608
609
|
slackUserName: z.ZodOptional<z.ZodString>;
|
|
609
610
|
}, z.core.$strict>>;
|
|
611
|
+
actorIdentityId: z.ZodOptional<z.ZodString>;
|
|
610
612
|
createdAt: z.ZodString;
|
|
611
613
|
delivery: z.ZodEnum<{
|
|
612
614
|
defer: "defer";
|
|
@@ -947,6 +949,7 @@ declare const conversationReportEventDataSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
947
949
|
slackUserId: z.ZodOptional<z.ZodString>;
|
|
948
950
|
slackUserName: z.ZodOptional<z.ZodString>;
|
|
949
951
|
}, z.core.$strict>>;
|
|
952
|
+
actorIdentityId: z.ZodOptional<z.ZodString>;
|
|
950
953
|
agentInvocationId: z.ZodOptional<z.ZodString>;
|
|
951
954
|
eventType: z.ZodOptional<z.ZodString>;
|
|
952
955
|
eventObjectType: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1203,6 +1206,7 @@ declare const conversationReportEventSchema: z.ZodObject<{
|
|
|
1203
1206
|
slackUserId: z.ZodOptional<z.ZodString>;
|
|
1204
1207
|
slackUserName: z.ZodOptional<z.ZodString>;
|
|
1205
1208
|
}, z.core.$strict>>;
|
|
1209
|
+
actorIdentityId: z.ZodOptional<z.ZodString>;
|
|
1206
1210
|
agentInvocationId: z.ZodOptional<z.ZodString>;
|
|
1207
1211
|
eventType: z.ZodOptional<z.ZodString>;
|
|
1208
1212
|
eventObjectType: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1729,6 +1733,9 @@ declare const conversationDetailReportSchema: z.ZodObject<{
|
|
|
1729
1733
|
label: z.ZodString;
|
|
1730
1734
|
}, z.core.$strict>>>;
|
|
1731
1735
|
canFork: z.ZodOptional<z.ZodBoolean>;
|
|
1736
|
+
readPosition: z.ZodOptional<z.ZodObject<{
|
|
1737
|
+
lastReadSeq: z.ZodNumber;
|
|
1738
|
+
}, z.core.$strict>>;
|
|
1732
1739
|
forkedFromConversationId: z.ZodOptional<z.ZodString>;
|
|
1733
1740
|
forkedFromTitle: z.ZodOptional<z.ZodString>;
|
|
1734
1741
|
forks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1834,6 +1841,13 @@ declare const conversationDetailReportSchema: z.ZodObject<{
|
|
|
1834
1841
|
}, z.core.$strict>>;
|
|
1835
1842
|
}, z.core.$strict>;
|
|
1836
1843
|
}, z.core.$strict>>>;
|
|
1844
|
+
authors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1845
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
1846
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1847
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1848
|
+
slackUserId: z.ZodOptional<z.ZodString>;
|
|
1849
|
+
slackUserName: z.ZodOptional<z.ZodString>;
|
|
1850
|
+
}, z.core.$strict>>>;
|
|
1837
1851
|
events: z.ZodArray<z.ZodObject<{
|
|
1838
1852
|
seq: z.ZodNumber;
|
|
1839
1853
|
createdAt: z.ZodString;
|
|
@@ -1856,6 +1870,7 @@ declare const conversationDetailReportSchema: z.ZodObject<{
|
|
|
1856
1870
|
slackUserId: z.ZodOptional<z.ZodString>;
|
|
1857
1871
|
slackUserName: z.ZodOptional<z.ZodString>;
|
|
1858
1872
|
}, z.core.$strict>>;
|
|
1873
|
+
actorIdentityId: z.ZodOptional<z.ZodString>;
|
|
1859
1874
|
agentInvocationId: z.ZodOptional<z.ZodString>;
|
|
1860
1875
|
eventType: z.ZodOptional<z.ZodString>;
|
|
1861
1876
|
eventObjectType: z.ZodOptional<z.ZodEnum<{
|
|
@@ -2174,6 +2189,7 @@ declare const conversationEventPageSchema: z.ZodObject<{
|
|
|
2174
2189
|
slackUserId: z.ZodOptional<z.ZodString>;
|
|
2175
2190
|
slackUserName: z.ZodOptional<z.ZodString>;
|
|
2176
2191
|
}, z.core.$strict>>;
|
|
2192
|
+
actorIdentityId: z.ZodOptional<z.ZodString>;
|
|
2177
2193
|
agentInvocationId: z.ZodOptional<z.ZodString>;
|
|
2178
2194
|
eventType: z.ZodOptional<z.ZodString>;
|
|
2179
2195
|
eventObjectType: z.ZodOptional<z.ZodEnum<{
|
|
@@ -2880,6 +2896,17 @@ declare const stopConversationTurnResponseSchema: z.ZodObject<{
|
|
|
2880
2896
|
}, z.core.$strict>>;
|
|
2881
2897
|
}, z.core.$strict>;
|
|
2882
2898
|
type StopConversationTurnResponse = z.infer<typeof stopConversationTurnResponseSchema>;
|
|
2899
|
+
/**
|
|
2900
|
+
* How far the signed-in viewer has read a Conversation transcript.
|
|
2901
|
+
*
|
|
2902
|
+
* `lastReadSeq` is the event sequence of the last transcript row the viewer
|
|
2903
|
+
* saw. The server keeps the highest value it receives, so it only moves
|
|
2904
|
+
* forward.
|
|
2905
|
+
*/
|
|
2906
|
+
declare const conversationReadPositionSchema: z.ZodObject<{
|
|
2907
|
+
lastReadSeq: z.ZodNumber;
|
|
2908
|
+
}, z.core.$strict>;
|
|
2909
|
+
type ConversationReadPosition = z.infer<typeof conversationReadPositionSchema>;
|
|
2883
2910
|
/**
|
|
2884
2911
|
* One direct child agent of a Conversation, from agent invocation records.
|
|
2885
2912
|
*
|
|
@@ -5946,8 +5973,6 @@ declare const reviewItemWaitingConversationsSchema: z.ZodObject<{
|
|
|
5946
5973
|
/** One person action on a Review item. */
|
|
5947
5974
|
declare const reviewItemActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5948
5975
|
action: z.ZodLiteral<"take">;
|
|
5949
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
5950
|
-
action: z.ZodLiteral<"complete">;
|
|
5951
5976
|
}, z.core.$strict>, z.ZodObject<{
|
|
5952
5977
|
action: z.ZodLiteral<"dismiss">;
|
|
5953
5978
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -5958,4 +5983,4 @@ declare const reviewItemActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
5958
5983
|
}, z.core.$strict>;
|
|
5959
5984
|
}, z.core.$strict>], "action">;
|
|
5960
5985
|
type ReviewItemActionBody = z.output<typeof reviewItemActionSchema>;
|
|
5961
|
-
export { automationExecutionStatusDaySchema as $,
|
|
5986
|
+
export { automationExecutionStatusDaySchema as $, ConversationPendingMessageDelivery as $n, codeChangeSummarySchema as $r, LocationSummaryReport as $t, StatsReport as A, ConversationMetricDay as An, conversationPendingAuthorizationSchema as Ar, createPersonalTokenBodySchema as At, AutomationRun as B, CancelConversationPendingMessagesBody as Bn, forkConversationResponseSchema as Br, startServiceAccountSignInResponseSchema as Bt, pluginPackageContentReportSchema as C, MAX_INPUT_IMAGE_BYTES as Ci, ConversationChildAgentsReport as Cn, conversationDetailReportSchema as Cr, workspaceListSchema as Ct, skillReportSchema as D, conversationReadPositionSchema as Dn, conversationFeedQuerySchema as Dr, USER_CUSTOMIZATION_MAX_CHARS as Dt, runtimeInfoReportSchema as E, ConversationReadPosition as En, conversationEventsQuerySchema as Er, workspaceSchema as Et, AutomationExecutionDay as F, conversationStatsReportSchema as Fn, conversationReportEventSchema as Fr, revokePersonalTokenResponseSchema as Ft, AutomationUpdate as G, ConversationCost as Gn, CodeActivityDay as Gr, startConnectionResponseSchema as Gt, AutomationRunWindows as H, ConversationActivityPreview as Hn, steerConversationPendingMessagesResponseSchema as Hr, connectionParamsSchema as Ht, AutomationExecutionList as I, AcceptedConversationMessage as In, conversationSummaryReportSchema as Ir, disconnectServiceAccountResponseSchema as It, automationEditErrorSchema as J, ConversationEventPage as Jn, CodePersonReport as Jr, LocationActivityDayReport as Jt, AutomationVersionList as K, ConversationDetailReport as Kn, CodeChangeSummaryReport as Kr, ApiError as Kt, AutomationExecutionStatusDay as L, ActorIdentity as Ln, createConversationBodySchema as Lr, serviceAccountListSchema as Lt, statsReportSchema as M, ConversationStatsReport as Mn, conversationPendingMessageSchema as Mr, personalTokenListSchema as Mt, AutomationEdit as N, GuardianMetricDay as Nn, conversationPendingMessagesReportSchema as Nr, personalTokenMetadataSchema as Nt, skillReportsSchema as O, StopConversationTurnResponse as On, conversationFeedSchema as Or, userCustomizationSchema as Ot, AutomationExecution as P, GuardianStats as Pn, conversationReportEventDataSchema as Pr, personalTokenParamsSchema as Pt, automationExecutionSchema as Q, ConversationPendingMessage as Qn, codeChangeSummaryReportSchema as Qr, LocationParams as Qt, AutomationList as R, ArchiveConversationBody as Rn, createConversationMessageBodySchema as Rr, serviceAccountParamsSchema as Rt, pluginPackageContentItemReportSchema as S, MAX_INPUT_IMAGES as Si, ConversationChildAgent as Sn, conversationDetailQuerySchema as Sr, workspaceBodySchema as St, pluginsSchema as T, INPUT_IMAGE_TYPES as Ti, conversationChildAgentsReportSchema as Tn, conversationEventPageSchema as Tr, workspaceRepoSchema as Tt, AutomationScheduleIntent as U, ConversationAgentTreeNode as Un, conversationTurnFailureCodeSchema as Ur, connectionSchema as Ut, AutomationRunList as V, CancelConversationPendingMessagesResponse as Vn, steerConversationPendingMessagesBodySchema as Vr, connectionListSchema as Vt, AutomationSummary as W, ConversationAuxiliaryCosts as Wn, conversationTurnFailureReasonSchema as Wr, disconnectConnectionResponseSchema as Wt, automationEventCatalogSchema as X, ConversationModelUsage as Xn, CodeRepositorySummary as Xr, LocationDetailReport as Xt, automationEditSchema as Y, ConversationFeed as Yn, CodeRepositoryReport as Yr, LocationActorSummaryReport as Yt, automationExecutionListSchema as Z, ConversationParams as Zn, codeActivityDaySchema as Zr, LocationDirectoryReport as Zt, SkillReport as _, buttonUserInputField as _i, personalSpendReportSchema as _n, archiveConversationResponseSchema as _r, BaselineSnapshotReport as _t, reviewItemCountSchema as a, ConversationChildAgentTotals as ai, ActorDirectoryReport as an, ConversationSourceTask as ar, automationRunSchema as at, pluginOperationalReportFeedSchema as b, webMessageId as bi, conversationWatchSchema as bn, conversationActivityPreviewSchema as br, baselineSnapshotSchema as bt, reviewItemWaitingConversationsSchema as c, dailyConversationActivitySchema as ci, ActorSummaryReport as cn, ConversationTurnFailureCode as cr, automationSchedulePreviewSchema as ct, PluginOperationalReport as d, resolveMessageCards as di, PeopleActivityDayReport as dn, CreateConversationBody as dr, automationVersionActivateSchema as dt, codeOverviewReportSchema as ei, locationActivityDayReportSchema as en, ConversationPendingMessagesReport as er, automationExecutionStatusSchema as et, PluginOperationalReportFeed as f, AutomationCard as fi, PersonParams as fn, CreateConversationMessageBody as fr, automationVersionListSchema as ft, RuntimeInfoReport as g, UserInputRequest as gi, personParamsSchema as gn, archiveConversationBodySchema as gr, scheduledAutomationSummarySchema as gt, Plugins as h, UserInputField as hi, actorProfileReportSchema as hn, acceptedConversationMessageSchema as hr, eventAutomationSummarySchema as ht, reviewItemActionSchema as i, codeRepositorySummarySchema as ii, ActorActivityDayReport as in, ConversationReportStatus as ir, automationRunListSchema as it, statSchema as j, ConversationStatsItem as jn, conversationPendingMessageDeliverySchema as jr, createdPersonalTokenSchema as jt, StatReport as k, stopConversationTurnResponseSchema as kn, conversationParamsSchema as kr, PersonalTokenMetadata as kt, HealthReport as l, MessageCard as li, ActorTotalsReport as ln, ConversationTurnFailureReason as lr, automationSummarySchema as lt, PluginPackageContentReport as m, UserInputAnswer as mi, actorDirectoryReportSchema as mn, SteerConversationPendingMessagesResponse as mr, automationVersionSchema as mt, ReviewItemActionBody as n, codeRepositoryParamsSchema as ni, locationDirectoryReportSchema as nn, ConversationReportEventData as nr, automationListSchema as nt, reviewItemListSchema as o, conversationChildAgentTotalsSchema as oi, ActorDirectoryWindows as on, ConversationSummaryReport as or, automationRunWindowsSchema as ot, PluginPackageContentItemReport as p, USER_INPUT_NOTE as pi, PersonalSpendReport as pn, SteerConversationPendingMessagesBody as pr, automationVersionParamsSchema as pt, ListedAutomationVersion as q, ConversationEventHistory as qn, CodeOverviewReport as qr, apiErrorSchema as qt, ReviewItemPayload as r, codeRepositoryReportSchema as ri, locationParamsSchema as rn, ConversationReportMessageEvent as rr, automationParamsSchema as rt, reviewItemSchema as s, DailyConversationActivity as si, ActorProfileReport as sn, ConversationSurface as sr, automationScheduleIntentSchema as st, OwnedObjectAnnotation$1 as t, codePersonReportSchema as ti, locationDetailReportSchema as tn, ConversationReportEvent as tr, automationListQuerySchema as tt, Plugin as u, messageCardText as ui, ActorWindowMetrics as un, ConversationUsage as ur, automationUpdateSchema as ut, SkillReports as v, isEmptyUserInputAnswer as vi, ConversationWatch as vn, cancelConversationPendingMessagesBodySchema as vr, WorkspaceListReport as vt, pluginSchema as w, MessageAttachment as wi, conversationChildAgentSchema as wn, conversationEventHistorySchema as wr, workspaceParamsSchema as wt, pluginOperationalReportSchema as x, InputImage as xi, conversationWatchesReportSchema as xn, conversationAuxiliaryCostsSchema as xr, deleteWorkspaceResponseSchema as xt, healthReportSchema as y, normalizeUserInputAnswer as yi, ConversationWatchesReport as yn, cancelConversationPendingMessagesResponseSchema as yr, WorkspaceReport as yt, AutomationListQuery as z, ArchiveConversationResponse as zn, forkConversationBodySchema as zr, serviceAccountSchema as zt };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
-
import { t as disconnectStateAdapter } from "./adapter-
|
|
3
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-TygDsPOU.js";
|
|
2
|
+
import { t as disconnectStateAdapter } from "./adapter-umap1cth.js";
|
|
3
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-smdPFWNy.js";
|
|
4
4
|
import { CLI_USAGE } from "./cli/run.js";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
// src/cli/service-account.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-
|
|
2
|
-
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-
|
|
1
|
+
import { B as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-CNs1e04n.js";
|
|
2
|
+
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-B-yUrv3h.js";
|
|
3
3
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
4
|
-
import { r as getStateAdapter } from "./adapter-
|
|
4
|
+
import { r as getStateAdapter } from "./adapter-umap1cth.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
import { UnauthorizedError, auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { h as logWarn, m as logInfo, p as logException } from "./logging-
|
|
5
|
-
import { C as getSqlExecutor,
|
|
2
|
+
import { $t as isAssistantMessage, Bi as verifyTimerWatchCredentialSubject, Fr as formatSlackLink, Ia as buildSentryConversationUrl, Ir as normalizeSlackReplyMarkdown, Kr as postSlackMessage, Nn as getPlugins, Pr as escapeSlackMrkdwnText, ea as JUNIOR_THREAD_STATE_TTL_MS, kn as getPluginSlackConversationLink, na as getDashboardObjectIconLink, nn as isToolResultMessage, oa as ToolInputError, rn as normalizeToolNameFromResult, ta as getDashboardConversationLink, tn as isToolResultError } from "./projection-BOpi891B.js";
|
|
3
|
+
import { n as botConfig } from "./config-C6FTd7PX.js";
|
|
4
|
+
import { h as logWarn, m as logInfo, p as logException } from "./logging-CNs1e04n.js";
|
|
5
|
+
import { C as getSqlExecutor, M as SYSTEM_IDENTITY_ID, x as getConversationStore } from "./viewer-C6Y1aXjZ.js";
|
|
6
6
|
import { s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
7
|
-
import "./executor-
|
|
8
|
-
import { h as credentialSubjectSchema } from "./registry-
|
|
9
|
-
import {
|
|
10
|
-
import { r as
|
|
11
|
-
import { r as
|
|
12
|
-
import { r as
|
|
13
|
-
import {
|
|
7
|
+
import "./executor-BafgvQcc.js";
|
|
8
|
+
import { h as credentialSubjectSchema } from "./registry-B-yUrv3h.js";
|
|
9
|
+
import { r as getStateAdapter } from "./adapter-umap1cth.js";
|
|
10
|
+
import { r as EVENT_AUTHOR_ID } from "./prompt-B1ySjUyf.js";
|
|
11
|
+
import { r as sanitizeAssistantText } from "./assistant-reply-wZ7i4OFa.js";
|
|
12
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-DaxUuOmD.js";
|
|
13
|
+
import { dt as CORE_EVENT_NAMESPACE, ht as eventGuidance, mt as eventCatalogEntry } from "./turn-session-routing-BdCTDq9m.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
import { eq, inArray } from "drizzle-orm";
|
|
16
16
|
import { eventMatchFieldsSchema, objectFactFields, objectPresentation, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
@@ -903,10 +903,17 @@ const SLACK_CURRENT_CHANNEL_IDENTIFIER = "current_channel";
|
|
|
903
903
|
const CHANNEL_RESOURCE_TYPE = "channel";
|
|
904
904
|
const MESSAGE_POSTED_EVENT = "message.posted";
|
|
905
905
|
const CHANNEL_ID_PATTERN = /^[CG][A-Z0-9]{2,}$/;
|
|
906
|
-
const CHANNEL_MESSAGE_MATCH_FIELDS = eventMatchFieldsSchema.parse({
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
906
|
+
const CHANNEL_MESSAGE_MATCH_FIELDS = eventMatchFieldsSchema.parse({
|
|
907
|
+
channelId: {
|
|
908
|
+
kind: "string",
|
|
909
|
+
description: "Slack channel ID of the message. It is always the channel where the automation posts.",
|
|
910
|
+
events: [MESSAGE_POSTED_EVENT]
|
|
911
|
+
},
|
|
912
|
+
userId: {
|
|
913
|
+
kind: "string",
|
|
914
|
+
description: "Slack user ID of the message author. Required to run on bot posts, such as alert bots."
|
|
915
|
+
}
|
|
916
|
+
});
|
|
910
917
|
/**
|
|
911
918
|
* Event registration for new top-level Slack channel messages. Only event
|
|
912
919
|
* automations can use it, so watchEvents rejects it.
|
|
@@ -924,7 +931,7 @@ function slackChannelMessageEvents() {
|
|
|
924
931
|
matchFields: CHANNEL_MESSAGE_MATCH_FIELDS
|
|
925
932
|
}],
|
|
926
933
|
events: { [MESSAGE_POSTED_EVENT]: {
|
|
927
|
-
reach: "
|
|
934
|
+
reach: { anyOf: ["channelId"] },
|
|
928
935
|
guidance: "A person or bot posted a new top-level message in this channel. A bot post runs the automation only when match names the bot in userId. A reply goes in that message's thread. If the instructions do not apply to this message, end with no action."
|
|
929
936
|
} },
|
|
930
937
|
limits: { [CHANNEL_RESOURCE_TYPE]: {
|
|
@@ -934,23 +941,42 @@ function slackChannelMessageEvents() {
|
|
|
934
941
|
};
|
|
935
942
|
}
|
|
936
943
|
/**
|
|
944
|
+
* Set the `channelId` filter of a Slack channel-message trigger to the
|
|
945
|
+
* channel where the automation posts. A trigger that names another channel,
|
|
946
|
+
* or a saved trigger with an identifier, stays as it is for
|
|
947
|
+
* `requireSlackChannelMessageScope` to check.
|
|
948
|
+
*/
|
|
949
|
+
function slackChannelMessageTrigger(trigger, channelId) {
|
|
950
|
+
if (trigger.namespace !== "slack") return trigger;
|
|
951
|
+
if (trigger.identifier != null || trigger.match?.channelId !== void 0) return trigger;
|
|
952
|
+
return {
|
|
953
|
+
...trigger,
|
|
954
|
+
match: {
|
|
955
|
+
...trigger.match,
|
|
956
|
+
channelId
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
937
961
|
* Bind a Slack channel-message automation to its own channel.
|
|
938
962
|
*
|
|
939
|
-
*
|
|
940
|
-
*
|
|
963
|
+
* The trigger names the channel with a `channelId` filter. A saved trigger
|
|
964
|
+
* can name it with an identifier instead, where `current_channel` means the
|
|
965
|
+
* destination channel. Reject other channels, so private channel text cannot
|
|
966
|
+
* reach another channel.
|
|
941
967
|
*/
|
|
942
968
|
function requireSlackChannelMessageScope(automation) {
|
|
943
969
|
if (automation.trigger.namespace !== "slack") return automation;
|
|
944
970
|
const channelId = automation.destination.channelId;
|
|
945
971
|
if (!CHANNEL_ID_PATTERN.test(channelId)) throw new ToolInputError("A Slack channel-message automation works only in a channel, not in a DM.");
|
|
946
|
-
const
|
|
947
|
-
if (identifier !== channelId) throw new ToolInputError(
|
|
972
|
+
const { identifier, match } = automation.trigger;
|
|
973
|
+
if ((identifier === void 0 ? match?.channelId : identifier === "current_channel" ? channelId : identifier) !== channelId) throw new ToolInputError("A Slack channel-message automation can watch only the channel where it posts. Leave out the channelId filter, or create the automation in the channel to watch.");
|
|
948
974
|
return {
|
|
949
975
|
...automation,
|
|
950
976
|
credentialMode: "system",
|
|
951
977
|
trigger: {
|
|
952
978
|
...automation.trigger,
|
|
953
|
-
identifier
|
|
979
|
+
...identifier === void 0 ? void 0 : { identifier: channelId }
|
|
954
980
|
}
|
|
955
981
|
};
|
|
956
982
|
}
|
|
@@ -984,8 +1010,8 @@ function slackChannelMessageEvent(input) {
|
|
|
984
1010
|
* Decide whether a channel-message Event may run one automation.
|
|
985
1011
|
*
|
|
986
1012
|
* A message runs only automations that post in its own channel, so private
|
|
987
|
-
* channel text cannot reach another channel. The trigger
|
|
988
|
-
*
|
|
1013
|
+
* channel text cannot reach another channel. The trigger already names that
|
|
1014
|
+
* channel, and this check keeps the rule when it does not.
|
|
989
1015
|
* A bot post runs only automations whose match names its author in `userId`.
|
|
990
1016
|
* Bots can post often and would use up the run limit of every other
|
|
991
1017
|
* automation in the channel.
|
|
@@ -1299,4 +1325,4 @@ async function skipInputBeforeConversationStop(context) {
|
|
|
1299
1325
|
await context.attempt.ack();
|
|
1300
1326
|
return { status: "completed" };
|
|
1301
1327
|
}
|
|
1302
|
-
export {
|
|
1328
|
+
export { recordFinishedTurnForAutomatedLimit as A, renderTaskInput as C, sendSlackReply as D, resolveSlackReplyTarget as E, finishedRunReply as F, postsRunNotices as I, readAutomationResult as L, FINISH_AUTOMATION_RUN_TOOL_NAME as M, automationResultSchema as N, renderSlackObjectCard as O, deliversFinalText as P, remindMissingAutomationResult as R, joinMailboxText as S, postAutomatedTurnLimitNoticeForConversation as T, slackChannelMessageTrigger as _, EVENT_WAIT_MS as a, workspaceSnapshotFinishedEvent as b, isEventMailboxMetadata as c, getEventCatalog as d, SLACK_EVENT_NAMESPACE as f, slackChannelMessageRunsAutomation as g, slackChannelMessageReplyThreadTs as h, skipInputBeforeConversationStop as i, resetAutomatedTurnLimit as j, admitAutomatedTurn as k, renderEventBatchText as l, slackChannelMessageEvent as m, markConversationsStopped as n, enqueueEventNotification as o, requireSlackChannelMessageScope as p, session_stop_exports as r, eventBatchMessageEvents as s, getConversationStoppedAtMs as t, timerWatchCredentialSubject as u, WORKSPACE_SNAPSHOT_FAILED_EVENT as v, maybePostAutomatedTurnLimitNotice as w, workspaceSnapshotWatch as x, WORKSPACE_SNAPSHOT_READY_EVENT as y, runDispatchOutcome as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { h as logWarn } from "./logging-
|
|
2
|
+
import { h as logWarn } from "./logging-CNs1e04n.js";
|
|
3
3
|
import { s as skillRoots } from "./package-discovery-DJBompdd.js";
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-TygDsPOU.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { Mt as
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { Mt as actorFromRun, Nt as toolInvocationDestination } from "./agent-runner-D7Qz-lGO.js";
|
|
3
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-ChPh_YEh.js";
|
|
4
4
|
// src/chat/agent-invocations/spawn.ts
|
|
5
5
|
var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
|
|
6
6
|
/** Bind a Run's Actor and credentials to new Agent invocations. */
|