@sentry/junior 0.306.0 → 0.307.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-context-CnY-i32r.js → adapter-context-B69WPn6b.js} +2 -2
- package/dist/{admin-BLLdLnXh.js → admin-nCJXMgkp.js} +2 -2
- package/dist/{agent-runner-BaLjEjPR.js → agent-runner-DdFcxAxG.js} +226 -137
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +4 -4
- package/dist/api.d.ts +1 -1
- package/dist/api.js +328 -298
- package/dist/{app-DvYbM9UD.d.ts → app-EZur8cVC.d.ts} +12 -3
- package/dist/app.d.ts +2 -2
- package/dist/app.js +84 -44
- package/dist/background-compaction-queue-BhEe4UfU.js +231 -0
- package/dist/{briefs-DvyzXfrF.js → briefs-Dl9lxi7J.js} +2 -2
- package/dist/{catalog-runtime-B1R-nHd3.js → catalog-runtime-OXrv2Ewn.js} +1 -1
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +17 -16
- package/dist/cli/check.js +58 -48
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.d.ts +1 -1
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +2 -2
- package/dist/cli/upgrade.js +3 -8
- package/dist/{config-DUD-zMvp.js → config-362yMSIz.js} +74 -38
- package/dist/{connections-CDhsqPcC.js → connections-BJv3EjmB.js} +10 -8
- package/dist/{continue-in-slack-BXQizz9o.js → continue-in-slack-CFEevC7z.js} +5 -5
- package/dist/{conversation-privacy-YE54gMN8.js → conversation-privacy-Tjj5P2W6.js} +1 -1
- package/dist/{conversation-turn-BzdmrHb0.js → conversation-turn-DU0_WDAr.js} +19 -47
- package/dist/{credential-sync-Cdm-e1vJ.js → credential-sync-D6aFARKE.js} +28 -28
- package/dist/{db-DV2ZUb1Y.js → db-Bcbd9zQc.js} +140 -11
- package/dist/{db-pH357Dkt.d.ts → db-C41UgdBj.d.ts} +1 -1
- package/dist/{executor-CjNhwwnj.js → executor-DBMBrpNV.js} +93 -32
- package/dist/{install-DbD7C5td.js → install-CgoAbzfF.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{lineage-BFdIPb3o.js → lineage-CsZDmz3e.js} +2 -2
- package/dist/{logging-oYpJYr-S.js → logging-CHCuQ5iz.js} +1 -1
- package/dist/{message-BBPcMKJY.js → message-B8vCbZZB.js} +8 -8
- package/dist/{model-input-DYYF3a8B.js → model-input-Xluiy-1W.js} +3 -3
- package/dist/nitro.d.ts +2 -2
- package/dist/nitro.js +3 -4
- package/dist/{oauth-callback-server-C7Q987su.js → oauth-callback-server-BUuNvfvu.js} +2 -2
- package/dist/{oauth-relay-DAmfVmJu.js → oauth-relay-DGAZzg9m.js} +1 -1
- package/dist/{plugins-B_0Cr0MO.d.ts → plugins-fBrz8PCV.d.ts} +2 -0
- package/dist/{projection-CWXDE0f6.js → projection-xPpvqexa.js} +1112 -693
- package/dist/{prompt-P3eRqO8C.js → prompt-D8u4jFs_.js} +3 -3
- package/dist/{registry-1pzXmplY.js → registry-D20hG3r6.js} +19 -9
- package/dist/{resolve-n87oXY-d.js → resolve-BhCySRCW.js} +3 -3
- package/dist/{result-BmF9v9bv.js → result-DddO63S9.js} +13 -11
- package/dist/{runner-4j7ZsxP5.js → runner-DQR9vYce.js} +9 -9
- package/dist/{sandbox-egress-signals-BRQI8HvT.js → sandbox-egress-signals-DFlNUOnK.js} +1 -1
- package/dist/{schedule-CHPWQn-x.js → schedule-BG1tEbRF.js} +34 -4
- package/dist/{schema-CVbIjrF3.d.ts → schema-CRXcj4fj.d.ts} +350 -143
- package/dist/{schema-D7iIEh6t.js → schema-D4jdesIu.js} +12 -4
- package/dist/{service-account-DzQiOmqa.js → service-account-Bv5QwrEq.js} +8 -6
- package/dist/{service-account-BDQ9xzta.js → service-account-CNfycv0z.js} +3 -3
- package/dist/{session-stop-BQxgHR4X.js → session-stop-BDdwyZaa.js} +36 -23
- package/dist/{skills-CPf4vNuC.js → skills-63i1Bcv1.js} +32 -28
- package/dist/{slack-conversation-unfurl-B1KEptUg.js → slack-conversation-unfurl-DtpBUlUu.js} +10 -10
- package/dist/{spawn-CjGddiAU.js → spawn-mwimEY9_.js} +6 -6
- package/dist/{state-9wfj6aSD.js → state-BBn9L6gC.js} +4 -4
- package/dist/{stop-CsQGuN5n.js → stop-Da-Ug7tg.js} +146 -158
- package/dist/{store-Dz3YZ7gQ.js → store-CdWg2r2L.js} +5 -5
- package/dist/{background-compaction-queue-D2wzxtGU.js → task-queue-BcjAYWyB.js} +164 -180
- package/dist/{task-runner-frzlUvFD.js → task-runner-CoXmMlsW.js} +11 -8
- package/dist/{thread-context-C4QuZlM8.js → thread-context-ZPGqOjW7.js} +6 -6
- package/dist/{turn-session-routing-BXaubz2w.js → turn-session-routing-DFYak28Q.js} +24 -5
- package/dist/{turn-user-message-DNC0eRZ7.js → turn-user-message-B1S8nOnG.js} +3 -3
- package/dist/{users-XCCKn3xW.js → users-DDbENg-I.js} +1 -1
- package/dist/{validation-L5fdjmFX.js → validation-fl21ps-k.js} +1 -1
- package/dist/{version-BFmuwgxP.js → version-DCdMMx_0.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-DKOeHpv3.js → viewer-DN_xzVKj.js} +3 -3
- package/dist/{warmup-mTMIatCV.js → warmup-CxhEhm71.js} +596 -281
- package/dist/{web-message-id-CUaSiGme.js → web-message-id-BT8Mg8LL.js} +1 -1
- package/dist/{worker-Bz4KNxjI.js → worker-Btb1SB5h.js} +8 -7
- package/migrations/0115_automation_creator_slack_index.sql +1 -0
- package/migrations/0116_conversation_event_search.sql +25 -0
- package/migrations/0117_automation_last_run.sql +46 -0
- package/migrations/0118_automation_last_run_index.sql +1 -0
- package/migrations/0119_money_micro_usd.sql +29 -0
- package/migrations/0120_conversation_cost_micro_usd.sql +8 -0
- package/migrations/meta/0115_snapshot.json +5225 -0
- package/migrations/meta/0116_snapshot.json +5388 -0
- package/migrations/meta/0117_snapshot.json +5413 -0
- package/migrations/meta/0118_snapshot.json +5428 -0
- package/migrations/meta/0119_snapshot.json +5441 -0
- package/migrations/meta/0120_snapshot.json +5441 -0
- package/migrations/meta/_journal.json +42 -0
- package/package.json +10 -9
- package/dist/queue-7FSijgqG.js +0 -115
- package/dist/secrets-DHaJ5TTn.js +0 -18
- package/dist/task-queue-CFlrJguF.js +0 -89
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as sumUtcHoursIntoSixHours, M as fillUtcHours, d as userInputRequestSchema, i as AGENT_INVOCATION_STATUSES, j as fillUtcDays, y as PLAN_ITEM_STATUSES } from "./web-message-id-
|
|
1
|
+
import { F as sumUtcHoursIntoSixHours, M as fillUtcHours, d as userInputRequestSchema, i as AGENT_INVOCATION_STATUSES, j as fillUtcDays, y as PLAN_ITEM_STATUSES } from "./web-message-id-BT8Mg8LL.js";
|
|
2
2
|
import { $ as inputFileSchema, D as conversationChildAgentTotalsSchema, E as idempotencyKeySchema, c as conversationAuxiliaryCostsSchema, i as actorIdentitySchema, m as conversationParamsSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation--f85g4zL.js";
|
|
3
3
|
import "./conversation-feed-BNs9KiqC.js";
|
|
4
4
|
import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
|
|
5
|
-
import { r as notificationScheduleSchema } from "./schedule-
|
|
5
|
+
import { r as notificationScheduleSchema } from "./schedule-BG1tEbRF.js";
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
import { codeChangeStateSchema, eventMatchSchema, objectTypeSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
|
|
8
8
|
// src/api/schema/conversation-attachment-upload.ts
|
|
@@ -88,8 +88,8 @@ const conversationAutoArchiveSchema = z.object({ autoArchive: z.boolean() }).str
|
|
|
88
88
|
const archiveDoneConversationsResponseSchema = z.object({ archived: z.number().int().nonnegative() }).strict();
|
|
89
89
|
// src/api/schema/conversation-outline.ts
|
|
90
90
|
/**
|
|
91
|
-
* Longest outline item text. The outline previews each message,
|
|
92
|
-
* server cuts the text and does not send whole messages.
|
|
91
|
+
* Longest outline item text and reply. The outline previews each message,
|
|
92
|
+
* so the server cuts the text and does not send whole messages.
|
|
93
93
|
*/
|
|
94
94
|
const CONVERSATION_OUTLINE_TEXT_LENGTH = 200;
|
|
95
95
|
/**
|
|
@@ -99,7 +99,15 @@ const CONVERSATION_OUTLINE_TEXT_LENGTH = 200;
|
|
|
99
99
|
*/
|
|
100
100
|
const conversationOutlineSchema = z.object({ items: z.array(z.object({
|
|
101
101
|
seq: z.number().int().nonnegative(),
|
|
102
|
+
createdAt: z.string().datetime(),
|
|
103
|
+
/** Identity id of the author. Detail `authors` maps it to the person. */
|
|
104
|
+
actorIdentityId: z.string().min(1).optional(),
|
|
105
|
+
/** Agent invocation whose input this is. An agent wrote it. */
|
|
106
|
+
agentInvocationId: z.string().min(1).optional(),
|
|
102
107
|
text: z.string().min(1),
|
|
108
|
+
/** The last Junior text before the next item. */
|
|
109
|
+
reply: z.string().min(1).optional(),
|
|
110
|
+
/** People that the text or the reply mention. */
|
|
103
111
|
mentions: z.array(actorIdentitySchema).optional()
|
|
104
112
|
}).strict()) }).strict();
|
|
105
113
|
// src/api/schema/conversation-stats.ts
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { K as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-
|
|
2
|
-
import {
|
|
3
|
-
import { $ as getStateAdapter,
|
|
4
|
-
import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-
|
|
5
|
-
import { n as botConfig } from "./config-
|
|
1
|
+
import { K as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-CHCuQ5iz.js";
|
|
2
|
+
import { i as resolvePluginHeaderEnvRefs, l as fetchWithBoundedOAuthErrorBodies } from "./registry-D20hG3r6.js";
|
|
3
|
+
import { $ as getStateAdapter, Dt as parseDestination, at as withLock, it as fenceLock, nt as MUTATION_LOCK_TTL_MS } from "./db-Bcbd9zQc.js";
|
|
4
|
+
import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-BBn9L6gC.js";
|
|
5
|
+
import { n as botConfig } from "./config-362yMSIz.js";
|
|
6
|
+
import pLimit from "p-limit";
|
|
6
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
8
|
import { randomUUID } from "node:crypto";
|
|
8
9
|
import { sourceSchema } from "@sentry/junior-plugin-api";
|
|
@@ -234,7 +235,8 @@ async function deleteMcpAuthSessionsForUserProvider(userId, provider) {
|
|
|
234
235
|
const stateAdapter = await getConnectedStateAdapter();
|
|
235
236
|
const indexKey = sessionIndexKey(userId, provider);
|
|
236
237
|
const authSessionIds = parseSessionIndex(await stateAdapter.get(indexKey));
|
|
237
|
-
|
|
238
|
+
const limit = pLimit(8);
|
|
239
|
+
await Promise.all(authSessionIds.map((authSessionId) => limit(() => stateAdapter.delete(sessionKey(authSessionId)))));
|
|
238
240
|
await stateAdapter.delete(indexKey);
|
|
239
241
|
}
|
|
240
242
|
async function getMcpStoredOAuthCredentials(userId, provider) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
3
|
-
import { Z as disconnectStateAdapter } from "./db-
|
|
1
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-Bv5QwrEq.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-OXrv2Ewn.js";
|
|
3
|
+
import { Z as disconnectStateAdapter } from "./db-Bcbd9zQc.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,18 +1,19 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import { $ as getStateAdapter, B as findLinkedSlackUser, I as resolveActorIdentityId, P as SYSTEM_IDENTITY_ID, T as isPersonInput,
|
|
4
|
-
import { G as escapeTagText, H as escapeXmlText, Q as tagJson, R as isCompactionSummaryText, U as authorAttrs, V as escapeXml, W as escapeClosingTags, X as renderTag$1, Y as renderChildTag, n as botConfig, o as getSlackBotToken, z as renderCurrentInstruction } from "./config-
|
|
2
|
+
import { A as normalizeConversationText, An as getPluginSystemPromptContributions, Bs as slackMention, Cc as CORE_EVENT_NAMESPACE, Dc as eventGuidance, Ec as eventCatalogEntry, Fa as SANDBOX_WORKSPACE_ROOT, Gc as ToolInputError, Ia as sandboxSkillDir, Is as escapeSlackMrkdwnText, La as sandboxSkillFile, Lo as findActorTimezone, Ls as formatSlackLink, Ma as SANDBOX_REPOS_ROOT, Mn as getPluginUserPromptContributions, Nn as getPlugins, Pr as getReviewItem, Ra as sandboxSkillPathResolution, Ri as listWorkspaces, Rs as normalizeSlackReplyMarkdown, _s as fitsSlackMetadataLimit, at as getTurnRecord, co as buildSentryConversationUrl, dr as stripRuntimeTurnContext, ec as getDashboardConversationLink, fs as postSlackMessage, gn as REPORT_BLOCKED_TOOL_NAME, gr as TURN_CONTEXT_TAG, hr as SESSION_CONTEXT_SECTION_TAG, it as getStoredTurnFields, ja as SANDBOX_DATA_ROOT, ji as verifyTimerWatchCredentialSubject, kn as getPluginSlackConversationLink, mr as REQUEST_CONTEXT_SECTION_TAG, nc as getDashboardObjectIconLink, nn as REPLY_TOOL_NAME, ot as listTurnSummaries, pi as cancelSubscriptions, pr as CAPABILITY_SECTION_TAG, sl as JUNIOR_THREAD_STATE_TTL_MS, tr as hasRuntimeTurnContext, un as NO_REPLY_TOOL_NAME, ur as retainRuntimeTurnContext, ws as getSlackClient, x as toStoredConversationMessage, ys as slackExternalRefIdSchema } from "./projection-xPpvqexa.js";
|
|
3
|
+
import { $ as getStateAdapter, B as findLinkedSlackUser, I as resolveActorIdentityId, P as SYSTEM_IDENTITY_ID, T as isPersonInput, Tt as touchConversationDetail, V as findSlackUserByPrimaryEmail, X as createCache, a as getConversationStore, o as getDb, r as getConversationEventStore, s as getSqlExecutor, wt as nextDetailVersion } from "./db-Bcbd9zQc.js";
|
|
4
|
+
import { G as escapeTagText, H as escapeXmlText, Q as tagJson, R as isCompactionSummaryText, U as authorAttrs, V as escapeXml, W as escapeClosingTags, X as renderTag$1, Y as renderChildTag, n as botConfig, o as getSlackBotToken, z as renderCurrentInstruction } from "./config-362yMSIz.js";
|
|
5
5
|
import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-x4AvVhMj.js";
|
|
6
|
-
import { G as normalizeIdentityEmail, W as isNativeIdentityProvider, h as logWarn, m as logInfo, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
7
|
-
import { _ as JUNIOR_NATIVE_EVENT_NAMESPACE, a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as eventBotAuthorId, r as EVENT_AUTHOR_ID, s as isEventConversationMessage, x as conversationNoteEvent } from "./prompt-
|
|
8
|
-
import { b as SELF_PLAN_ASSIGNEE, c as formatUserInputAnswer, h as isVisionImageMediaType, v as userCustomizationTextSchema, x as isOpenPlanItemStatus } from "./web-message-id-
|
|
9
|
-
import {
|
|
10
|
-
import { i as parseSkillFile } from "./skills-
|
|
11
|
-
import { a as toCanonicalInputMessage } from "./conversation-privacy-
|
|
6
|
+
import { G as normalizeIdentityEmail, W as isNativeIdentityProvider, h as logWarn, m as logInfo, p as logException, v as serializeGenAiAttribute } from "./logging-CHCuQ5iz.js";
|
|
7
|
+
import { _ as JUNIOR_NATIVE_EVENT_NAMESPACE, a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as eventBotAuthorId, r as EVENT_AUTHOR_ID, s as isEventConversationMessage, x as conversationNoteEvent } from "./prompt-D8u4jFs_.js";
|
|
8
|
+
import { b as SELF_PLAN_ASSIGNEE, c as formatUserInputAnswer, h as isVisionImageMediaType, v as userCustomizationTextSchema, x as isOpenPlanItemStatus } from "./web-message-id-BT8Mg8LL.js";
|
|
9
|
+
import { B as juniorUsers, R as juniorConversations, c as juniorPlanItems, s as juniorPlanItemVersionSeq, v as juniorAgentBindings, z as juniorIdentities } from "./executor-DBMBrpNV.js";
|
|
10
|
+
import { i as parseSkillFile } from "./skills-63i1Bcv1.js";
|
|
11
|
+
import { a as toCanonicalInputMessage } from "./conversation-privacy-Tjj5P2W6.js";
|
|
12
12
|
import { o as isUserActor, p as parseSlackUserId, t as createActor } from "./actor-D2iXzvlN.js";
|
|
13
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
14
|
-
import { i as lookupSlackUserProfile, t as lookupActiveSlackWorkspaceMember } from "./users-
|
|
15
|
-
import {
|
|
13
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-CdWg2r2L.js";
|
|
14
|
+
import { i as lookupSlackUserProfile, t as lookupActiveSlackWorkspaceMember } from "./users-DDbENg-I.js";
|
|
15
|
+
import { g as credentialSubjectSchema } from "./registry-D20hG3r6.js";
|
|
16
|
+
import pLimit from "p-limit";
|
|
16
17
|
import * as z from "zod";
|
|
17
18
|
import { getCurrentSystemMessage, getSystemMessageText } from "@earendil-works/pi-ai/compat";
|
|
18
19
|
import path from "node:path";
|
|
@@ -23,7 +24,6 @@ import { and, asc, eq, inArray, isNull, lt, lte, or, sql } from "drizzle-orm";
|
|
|
23
24
|
import { agentEventKeys, createEventSource, createLocalSource, createWebSource, eventMatchFieldsSchema, objectFactFields, objectPresentation, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
24
25
|
import { alias } from "drizzle-orm/pg-core";
|
|
25
26
|
import fs from "node:fs";
|
|
26
|
-
import pLimit from "p-limit";
|
|
27
27
|
// src/chat/pi/agent-history.ts
|
|
28
28
|
function isSystemMessage(message) {
|
|
29
29
|
return message?.role === "system";
|
|
@@ -2226,9 +2226,19 @@ async function sendSlackReply(args) {
|
|
|
2226
2226
|
text,
|
|
2227
2227
|
cards: []
|
|
2228
2228
|
}));
|
|
2229
|
-
const
|
|
2230
|
-
for (
|
|
2231
|
-
const
|
|
2229
|
+
const groups = [];
|
|
2230
|
+
for (const card of args.cards ?? []) {
|
|
2231
|
+
const rendered = renderSlackCard(card, args.conversationId);
|
|
2232
|
+
const slackCard = rendered.entity && !fitsSlackMetadataLimit([rendered.entity]) ? {
|
|
2233
|
+
entity: null,
|
|
2234
|
+
text: rendered.text
|
|
2235
|
+
} : rendered;
|
|
2236
|
+
const group = groups.at(-1);
|
|
2237
|
+
const entities = [...group ?? [], slackCard].flatMap((item) => item.entity ? [item.entity] : []);
|
|
2238
|
+
if (group && group.length < 5 && fitsSlackMetadataLimit(entities)) group.push(slackCard);
|
|
2239
|
+
else groups.push([slackCard]);
|
|
2240
|
+
}
|
|
2241
|
+
for (const [index, group] of groups.entries()) {
|
|
2232
2242
|
const lastPost = posts.at(-1);
|
|
2233
2243
|
if (index === 0 && lastPost) lastPost.cards = group;
|
|
2234
2244
|
else posts.push({
|
|
@@ -3177,7 +3187,6 @@ const legacyWebMailboxMetadataSchema = z.object({
|
|
|
3177
3187
|
messageId: z.string().min(1)
|
|
3178
3188
|
}).strict();
|
|
3179
3189
|
// src/chat/task-execution/mailbox-turn.ts
|
|
3180
|
-
const MAILBOX_TURN_READ_CONCURRENCY = 8;
|
|
3181
3190
|
/**
|
|
3182
3191
|
* Restore Turn input facts, with saved Message fallback for legacy cursors.
|
|
3183
3192
|
*
|
|
@@ -3229,7 +3238,7 @@ async function listActiveMailboxTurns(conversationId) {
|
|
|
3229
3238
|
* `listActiveMailboxTurns` it keeps a Turn whose history was deleted.
|
|
3230
3239
|
*/
|
|
3231
3240
|
async function listActiveMailboxTurnSources(conversationIds) {
|
|
3232
|
-
const limit = pLimit(
|
|
3241
|
+
const limit = pLimit(8);
|
|
3233
3242
|
const summaries = (await Promise.all(conversationIds.map((conversationId) => limit(() => listTurnSummaries(conversationId))))).flatMap((list) => list.filter(isOpenTurnSummary));
|
|
3234
3243
|
const stored = await getStoredTurnFields(summaries);
|
|
3235
3244
|
const sources = new Map(conversationIds.map((conversationId) => [conversationId, []]));
|
|
@@ -4095,7 +4104,8 @@ async function savedInputInstruction(args) {
|
|
|
4095
4104
|
* the input is the same as on web.
|
|
4096
4105
|
*/
|
|
4097
4106
|
async function eventReviewItemInputs(messages) {
|
|
4098
|
-
const
|
|
4107
|
+
const limit = pLimit(8);
|
|
4108
|
+
const rendered = await Promise.all(messages.map((message) => limit(async () => [message.inboundMessageId, await loadReviewItemInput(message.input.reviewItemChange)])));
|
|
4099
4109
|
return new Map(rendered.flatMap(([id, text]) => text ? [[id, text]] : []));
|
|
4100
4110
|
}
|
|
4101
4111
|
// src/chat/conversations/session-stop.ts
|
|
@@ -4111,10 +4121,13 @@ const STOPPED_CONVERSATION_SKIP_REASON = "stopped conversation";
|
|
|
4111
4121
|
*/
|
|
4112
4122
|
async function markConversationsStopped(conversationIds, options) {
|
|
4113
4123
|
if (conversationIds.length === 0) return;
|
|
4114
|
-
if (options.cancelWatches)
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4124
|
+
if (options.cancelWatches) {
|
|
4125
|
+
const limit = pLimit(8);
|
|
4126
|
+
await Promise.all(conversationIds.map((conversationId) => limit(() => cancelSubscriptions({
|
|
4127
|
+
conversationId,
|
|
4128
|
+
state: options.state
|
|
4129
|
+
}))));
|
|
4130
|
+
}
|
|
4118
4131
|
const stoppedAt = new Date(options.nowMs ?? Date.now());
|
|
4119
4132
|
await getSqlExecutor().db().update(juniorConversations).set({
|
|
4120
4133
|
stoppedAt,
|
|
@@ -1,11 +1,38 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
2
|
import { s as skillRoots } from "./package-discovery-x4AvVhMj.js";
|
|
3
|
-
import { h as logWarn } from "./logging-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
3
|
+
import { h as logWarn } from "./logging-CHCuQ5iz.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-OXrv2Ewn.js";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
8
8
|
import { parse } from "yaml";
|
|
9
|
+
// src/chat/skill-references.ts
|
|
10
|
+
function isCommonEnvironmentVariable(name) {
|
|
11
|
+
return [
|
|
12
|
+
"HOME",
|
|
13
|
+
"LANG",
|
|
14
|
+
"PATH",
|
|
15
|
+
"PWD",
|
|
16
|
+
"SHELL",
|
|
17
|
+
"TEMP",
|
|
18
|
+
"TERM",
|
|
19
|
+
"TMP",
|
|
20
|
+
"TMPDIR",
|
|
21
|
+
"USER",
|
|
22
|
+
"XDG_CONFIG_HOME"
|
|
23
|
+
].includes(name.toUpperCase());
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Return the skills that `text` references explicitly, in order: each
|
|
27
|
+
* `$name`, then each `/name`. Only these two forms reference a skill.
|
|
28
|
+
*/
|
|
29
|
+
function skillReferences(text, availableSkills) {
|
|
30
|
+
const isSkill = (name) => availableSkills.some((skill) => skill.name === name);
|
|
31
|
+
const dollarPattern = /(?<![\w$])\$([a-z0-9]+(?:-[a-z0-9]+)*)/gi;
|
|
32
|
+
const slashPattern = /(?:^|\s)\/([a-z0-9]+(?:-[a-z0-9]+)*)(?![a-z0-9/-])/gi;
|
|
33
|
+
const names = (pattern) => [...text.matchAll(pattern)].flatMap((match) => match[1] ? [match[1].toLowerCase()] : []);
|
|
34
|
+
return [...names(dollarPattern).filter((name) => !isCommonEnvironmentVariable(name)), ...names(slashPattern)].filter(isSkill);
|
|
35
|
+
}
|
|
9
36
|
// src/chat/skills.ts
|
|
10
37
|
var skills_exports = /* @__PURE__ */ __exportAll({
|
|
11
38
|
discoverSkills: () => discoverSkills,
|
|
@@ -240,21 +267,6 @@ async function discoverSkills(options) {
|
|
|
240
267
|
};
|
|
241
268
|
return sorted;
|
|
242
269
|
}
|
|
243
|
-
function isCommonEnvironmentVariable(name) {
|
|
244
|
-
return [
|
|
245
|
-
"HOME",
|
|
246
|
-
"LANG",
|
|
247
|
-
"PATH",
|
|
248
|
-
"PWD",
|
|
249
|
-
"SHELL",
|
|
250
|
-
"TEMP",
|
|
251
|
-
"TERM",
|
|
252
|
-
"TMP",
|
|
253
|
-
"TMPDIR",
|
|
254
|
-
"USER",
|
|
255
|
-
"XDG_CONFIG_HOME"
|
|
256
|
-
].includes(name.toUpperCase());
|
|
257
|
-
}
|
|
258
270
|
/**
|
|
259
271
|
* Extract an explicit skill invocation from a user message. `$name` is the
|
|
260
272
|
* canonical form; `/name` still works for older messages and automations.
|
|
@@ -262,16 +274,8 @@ function isCommonEnvironmentVariable(name) {
|
|
|
262
274
|
function parseSkillInvocation(messageText, availableSkills) {
|
|
263
275
|
const trimmed = messageText.trim();
|
|
264
276
|
const escapePattern = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
if (!skillName) continue;
|
|
268
|
-
if (isCommonEnvironmentVariable(skillName)) continue;
|
|
269
|
-
if (availableSkills.some((skill) => skill.name === skillName)) return { skillName };
|
|
270
|
-
}
|
|
271
|
-
for (const match of trimmed.matchAll(/(?:^|\s)\/([a-z0-9]+(?:-[a-z0-9]+)*)(?![a-z0-9/-])/gi)) {
|
|
272
|
-
const skillName = match[1]?.toLowerCase();
|
|
273
|
-
if (skillName && availableSkills.some((skill) => skill.name === skillName)) return { skillName };
|
|
274
|
-
}
|
|
277
|
+
const [referencedSkill] = skillReferences(trimmed, availableSkills);
|
|
278
|
+
if (referencedSkill) return { skillName: referencedSkill };
|
|
275
279
|
const namedSkill = availableSkills.find((skill) => {
|
|
276
280
|
if (skill.disableModelInvocation !== true) return false;
|
|
277
281
|
const skillPattern = escapePattern(skill.name);
|
|
@@ -311,4 +315,4 @@ async function loadSkillsByName(skillNames, available) {
|
|
|
311
315
|
}
|
|
312
316
|
return skills;
|
|
313
317
|
}
|
|
314
|
-
export { parseSkillInvocation as a, parseSkillFile as i, findSkillByName as n, skills_exports as o, loadSkillsByName as r, discoverSkills as t };
|
|
318
|
+
export { parseSkillInvocation as a, parseSkillFile as i, findSkillByName as n, skills_exports as o, loadSkillsByName as r, skillReferences as s, discoverSkills as t };
|
package/dist/{slack-conversation-unfurl-B1KEptUg.js → slack-conversation-unfurl-DtpBUlUu.js}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { Ct as deferConversationMove,
|
|
2
|
+
import { Ct as deferConversationMove, Is as escapeSlackMrkdwnText, Ls as formatSlackLink, Ns as getWorkspaceTeamId, cc as parseDashboardConversationLink, ds as postSlackEphemeralMessage, ms as unfurlSlackLinks, no as readLatestConversationBrief, qa as readConversationAccessFromSql } from "./projection-xPpvqexa.js";
|
|
3
3
|
import { _ as slackUserIdSchema, b as slackMessageTsSchema, f as parseSlackTeamId, g as slackTeamIdSchema, h as slackChannelIdSchema, m as slackBotIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-D2iXzvlN.js";
|
|
4
|
-
import { X as createCache, a as getConversationStore, o as getDb, s as getSqlExecutor, st as getConversationIdByProviderConversation } from "./db-
|
|
5
|
-
import { i as lookupSlackUserProfile, n as lookupSlackBot } from "./users-
|
|
6
|
-
import { E as withSpan } from "./logging-
|
|
7
|
-
import { i as readActorIdentity } from "./viewer-
|
|
8
|
-
import { t as runWithSlackInstallation } from "./adapter-context-
|
|
9
|
-
import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-
|
|
10
|
-
import {
|
|
11
|
-
import "./store-
|
|
12
|
-
import { n as botConfig } from "./config-
|
|
4
|
+
import { X as createCache, a as getConversationStore, o as getDb, s as getSqlExecutor, st as getConversationIdByProviderConversation } from "./db-Bcbd9zQc.js";
|
|
5
|
+
import { i as lookupSlackUserProfile, n as lookupSlackBot } from "./users-DDbENg-I.js";
|
|
6
|
+
import { E as withSpan } from "./logging-CHCuQ5iz.js";
|
|
7
|
+
import { i as readActorIdentity } from "./viewer-DN_xzVKj.js";
|
|
8
|
+
import { t as runWithSlackInstallation } from "./adapter-context-B69WPn6b.js";
|
|
9
|
+
import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-CFEevC7z.js";
|
|
10
|
+
import { fr as checkSlackChannelReadAccess } from "./warmup-CxhEhm71.js";
|
|
11
|
+
import "./store-CdWg2r2L.js";
|
|
12
|
+
import { n as botConfig } from "./config-362yMSIz.js";
|
|
13
13
|
import * as z from "zod";
|
|
14
14
|
// src/chat/ingress/workspace-membership.ts
|
|
15
15
|
const MEMBER_TTL_MS = 3e5;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { t as readConversationLineage } from "./lineage-
|
|
5
|
-
import { _ as getConversationWorkState } from "./store-
|
|
6
|
-
import { Vt as getAgentInvocation, bn as AgentDepthLimitError, sn as createAndEnqueueAgentInvocation, wn as getAgentBinding } from "./warmup-
|
|
7
|
-
import { I as getUnnamedAgentConversationId, T as getAgentInvocationId, k as getAgentInvocationMessageId } from "./turn-user-message-
|
|
2
|
+
import { F as actorFromRun, I as toolInvocationDestination } from "./agent-runner-DdFcxAxG.js";
|
|
3
|
+
import { n as botConfig } from "./config-362yMSIz.js";
|
|
4
|
+
import { t as readConversationLineage } from "./lineage-CsZDmz3e.js";
|
|
5
|
+
import { _ as getConversationWorkState } from "./store-CdWg2r2L.js";
|
|
6
|
+
import { Vt as getAgentInvocation, bn as AgentDepthLimitError, sn as createAndEnqueueAgentInvocation, wn as getAgentBinding } from "./warmup-CxhEhm71.js";
|
|
7
|
+
import { I as getUnnamedAgentConversationId, T as getAgentInvocationId, k as getAgentInvocationMessageId } from "./turn-user-message-B1S8nOnG.js";
|
|
8
8
|
// src/chat/agent-invocations/spawn.ts
|
|
9
9
|
var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
|
|
10
10
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { h as logWarn } from "./logging-
|
|
3
|
-
import { o as getDb } from "./db-
|
|
4
|
-
import {
|
|
1
|
+
import { i as getChatConfig } from "./config-362yMSIz.js";
|
|
2
|
+
import { h as logWarn } from "./logging-CHCuQ5iz.js";
|
|
3
|
+
import { o as getDb } from "./db-Bcbd9zQc.js";
|
|
4
|
+
import { B as juniorUsers } from "./executor-DBMBrpNV.js";
|
|
5
5
|
import { createCipheriv, createDecipheriv, createHash, randomBytes } from "node:crypto";
|
|
6
6
|
import { eq } from "drizzle-orm";
|
|
7
7
|
// src/chat/conversations/legacy-web-actor-id.ts
|