@sentry/junior 0.150.0 → 0.151.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-SEOGOGKX.js → agent-hooks-EYUAEBMA.js} +10 -10
- package/dist/api/schema/conversation.d.ts +24 -4
- package/dist/api/schema.js +1 -1
- package/dist/api.js +63 -35
- package/dist/app.js +123 -200
- package/dist/{catalog-runtime-HA7RIWYT.js → catalog-runtime-2LCLLOBI.js} +5 -5
- package/dist/chat/agent/skills.d.ts +5 -4
- package/dist/chat/agent/tools.d.ts +5 -5
- package/dist/chat/conversations/history.d.ts +12 -3
- package/dist/chat/conversations/projection.d.ts +7 -3
- package/dist/chat/mcp/tool-manager.d.ts +0 -4
- package/dist/chat/runtime/agent-run-outcome.d.ts +4 -0
- package/dist/chat/tools/search-conversation-events.d.ts +1 -1
- package/dist/chat/tools/skill/call-mcp-tool.d.ts +0 -1
- package/dist/chat/tools/skill/load-skill.d.ts +2 -5
- package/dist/chat/tools/types.d.ts +1 -2
- package/dist/{chunk-ZUQT35YC.js → chunk-2MGJ64SL.js} +1 -1
- package/dist/{chunk-TZLYAO2J.js → chunk-3WOK4ZLX.js} +72 -218
- package/dist/{chunk-7D4GNUV2.js → chunk-4ABTAQYC.js} +3 -3
- package/dist/{chunk-F5NMSEBL.js → chunk-5N3XLYBW.js} +1 -1
- package/dist/{chunk-M5OZSVJI.js → chunk-6A46QL4O.js} +4 -4
- package/dist/{chunk-7NLW2NF5.js → chunk-6DLWRSGV.js} +1 -1
- package/dist/{chunk-3GL327SC.js → chunk-6PGJPCN2.js} +1 -1
- package/dist/{chunk-P43QM7JY.js → chunk-6WNWM5JD.js} +5 -5
- package/dist/{chunk-64K7GKRW.js → chunk-AGSUPAD5.js} +2 -2
- package/dist/{chunk-NCGVQXX5.js → chunk-B7KWBJAR.js} +6 -6
- package/dist/{chunk-Y2VZ54CQ.js → chunk-C7D2ONB5.js} +1 -1
- package/dist/{chunk-SH6ZKJFZ.js → chunk-CL5DT6D2.js} +4 -4
- package/dist/{chunk-3ZMKDHCT.js → chunk-D22FO4LW.js} +2 -2
- package/dist/{chunk-IZRSLANA.js → chunk-DJAOSWB6.js} +1 -1
- package/dist/{chunk-FEFEIA3Z.js → chunk-EMB4VY7H.js} +5 -5
- package/dist/{chunk-4KAYAIBV.js → chunk-H7ZMEHAN.js} +1 -1
- package/dist/{chunk-UIMBNY6O.js → chunk-J5LAA2LI.js} +9 -9
- package/dist/{chunk-IPGNWXA3.js → chunk-JIJOPRD4.js} +16 -10
- package/dist/{chunk-ZBOGYZ53.js → chunk-JSKTDBSS.js} +4 -4
- package/dist/{chunk-ILYL6YFD.js → chunk-K3QXMZDU.js} +11 -4
- package/dist/{chunk-QPIPYVGE.js → chunk-KPQBQRNM.js} +5 -5
- package/dist/{chunk-DWETNV66.js → chunk-M6KRPBXC.js} +6 -6
- package/dist/{chunk-JQXJ2E53.js → chunk-OAPPJ3TM.js} +1 -1
- package/dist/{chunk-MCNP7A7T.js → chunk-OFRJXFTH.js} +8 -8
- package/dist/{chunk-7GOP6VFJ.js → chunk-OYRFUQOV.js} +106 -16
- package/dist/{chunk-NNOCRVQO.js → chunk-PQUV3NA5.js} +2 -2
- package/dist/{chunk-SHDREBGC.js → chunk-PWMVR2MD.js} +1 -1
- package/dist/{chunk-UOFQEVR5.js → chunk-QVQBWWXQ.js} +6 -6
- package/dist/{chunk-H2RLIJ7G.js → chunk-UDDCHQN2.js} +1 -1
- package/dist/{chunk-7QB2CKCW.js → chunk-WVXFEQXE.js} +1 -1
- package/dist/{chunk-3JVUWLR7.js → chunk-XN3QKNQX.js} +8 -1
- package/dist/{chunk-6PFDWAK2.js → chunk-YN4W5SRJ.js} +1 -1
- package/dist/{chunk-4VH7KLGC.js → chunk-ZGSL5ARH.js} +50 -22
- package/dist/cli/chat.js +30 -30
- 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-HUW75QG7.js → db-ALCBI4JZ.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-DP7NIZPQ.js → oauth-callback-server-3RRMG62B.js} +23 -23
- package/dist/{runner-AINV7K3M.js → runner-V6C3EELU.js} +14 -14
- package/dist/{skills-PKS37E6B.js → skills-43PFYZIZ.js} +6 -6
- package/dist/spawn-UZNNTNFU.js +38 -0
- package/dist/{validation-PDC3MVMM.js → validation-4MNN6QKE.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-KJLJRPXS.js → work-YZO6XTEB.js} +17 -17
- package/dist/{worker-TYQ7YVIR.js → worker-42AR7323.js} +11 -11
- package/migrations/0025_mcp_credential_subject.sql +8 -0
- package/migrations/meta/0025_snapshot.json +2275 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
- package/dist/chat/pi/derived-state.d.ts +0 -5
- package/dist/spawn-NJCDEPPL.js +0 -38
package/dist/app.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
processConversationWork
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CL5DT6D2.js";
|
|
4
4
|
import {
|
|
5
5
|
bindSpawnAgent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-C7D2ONB5.js";
|
|
7
7
|
import {
|
|
8
8
|
createAgentInvocationWorker,
|
|
9
9
|
enqueueAgentInvocation,
|
|
10
10
|
listPendingAgentInvocationMailboxAppends,
|
|
11
11
|
routeAgentInvocationWork
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-B7KWBJAR.js";
|
|
13
13
|
import {
|
|
14
14
|
GET as GET2,
|
|
15
15
|
GET2 as GET3,
|
|
@@ -36,24 +36,25 @@ import {
|
|
|
36
36
|
startSlackProcessingReaction,
|
|
37
37
|
stripLeadingBotMention,
|
|
38
38
|
wakePausedTurn
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-ZGSL5ARH.js";
|
|
40
40
|
import "./chunk-FA6POGLH.js";
|
|
41
41
|
import {
|
|
42
42
|
getTurnRequestDeadline,
|
|
43
43
|
runWithTurnRequestDeadline
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-H7ZMEHAN.js";
|
|
45
45
|
import {
|
|
46
46
|
completeAuthPauseTurn,
|
|
47
47
|
persistAuthPauseTurnState
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-4ABTAQYC.js";
|
|
49
49
|
import {
|
|
50
50
|
GET,
|
|
51
51
|
conversationVisibilityFromSlackChannelType,
|
|
52
52
|
createApiTurnWorker,
|
|
53
|
+
lookupSlackUser,
|
|
53
54
|
resolveSlackChannelTypeFromMessage,
|
|
54
55
|
resolveSlackConversationContext,
|
|
55
56
|
routeApiTurnWork
|
|
56
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-OYRFUQOV.js";
|
|
57
58
|
import "./chunk-4CODA7P5.js";
|
|
58
59
|
import {
|
|
59
60
|
CONVERSATION_WORK_STALE_ENQUEUE_MS,
|
|
@@ -65,7 +66,7 @@ import {
|
|
|
65
66
|
isInvalidConversationRecordError,
|
|
66
67
|
listActiveConversationIds,
|
|
67
68
|
removeActiveConversation
|
|
68
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-6A46QL4O.js";
|
|
69
70
|
import {
|
|
70
71
|
buildDeliveredTurnStatePatch,
|
|
71
72
|
claimDispatchMailboxAppend,
|
|
@@ -94,7 +95,7 @@ import {
|
|
|
94
95
|
requireTurnFailureEventId,
|
|
95
96
|
resolveTurnSessionRouting,
|
|
96
97
|
scheduleSessionCompletedPluginTasks
|
|
97
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-J5LAA2LI.js";
|
|
98
99
|
import {
|
|
99
100
|
ConversationTurnLifecycleService,
|
|
100
101
|
coerceThreadConversationState,
|
|
@@ -104,7 +105,7 @@ import {
|
|
|
104
105
|
persistThreadRuntimeState,
|
|
105
106
|
persistThreadState,
|
|
106
107
|
persistThreadStateById
|
|
107
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-EMB4VY7H.js";
|
|
108
109
|
import "./chunk-UTL3MHPC.js";
|
|
109
110
|
import {
|
|
110
111
|
getVercelConversationWorkQueue,
|
|
@@ -123,7 +124,7 @@ import {
|
|
|
123
124
|
import {
|
|
124
125
|
validatePluginEgressCredentialHooks,
|
|
125
126
|
validatePluginRegistrations
|
|
126
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-6PGJPCN2.js";
|
|
127
128
|
import {
|
|
128
129
|
defineJuniorPlugins,
|
|
129
130
|
pluginCatalogConfigFromEnv,
|
|
@@ -156,18 +157,18 @@ import {
|
|
|
156
157
|
setConfigDefaults,
|
|
157
158
|
shouldEmitDevAgentTrace,
|
|
158
159
|
shouldPropagateSandboxEgressTrace
|
|
159
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-3WOK4ZLX.js";
|
|
160
161
|
import {
|
|
161
162
|
AuthorizationFlowDisabledError,
|
|
162
163
|
PluginCredentialFailureError
|
|
163
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-KPQBQRNM.js";
|
|
164
165
|
import "./chunk-DIB4GX3G.js";
|
|
165
166
|
import {
|
|
166
167
|
createUserTokenStore,
|
|
167
168
|
deleteMcpAuthSessionsForUserProvider,
|
|
168
169
|
deleteMcpServerSessionId,
|
|
169
170
|
deleteMcpStoredOAuthCredentials
|
|
170
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-OFRJXFTH.js";
|
|
171
172
|
import {
|
|
172
173
|
RetryableDeliveryError
|
|
173
174
|
} from "./chunk-RF6J3DIO.js";
|
|
@@ -175,7 +176,7 @@ import {
|
|
|
175
176
|
formatProviderLabel,
|
|
176
177
|
postSlackMessage,
|
|
177
178
|
startOAuthFlow
|
|
178
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-M6KRPBXC.js";
|
|
179
180
|
import "./chunk-HUO3UTAQ.js";
|
|
180
181
|
import {
|
|
181
182
|
getExperimentalFeatures,
|
|
@@ -184,16 +185,16 @@ import {
|
|
|
184
185
|
import {
|
|
185
186
|
getSandboxResourceConfig,
|
|
186
187
|
setSandboxResourceConfig
|
|
187
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-JSKTDBSS.js";
|
|
188
189
|
import {
|
|
189
190
|
createSchedulerSqlStore,
|
|
190
191
|
findMatchingEventTasks,
|
|
191
192
|
logScheduledTaskRunSkipped,
|
|
192
193
|
scheduledTaskRunAttributes
|
|
193
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-6WNWM5JD.js";
|
|
194
195
|
import {
|
|
195
196
|
parseSlackThreadId
|
|
196
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-UDDCHQN2.js";
|
|
197
198
|
import {
|
|
198
199
|
ConversationTurnBoundaryError,
|
|
199
200
|
CooperativeTurnYieldError,
|
|
@@ -243,7 +244,7 @@ import {
|
|
|
243
244
|
trimTrailingAssistantMessages,
|
|
244
245
|
turnHasReply,
|
|
245
246
|
upsertConversationMessage
|
|
246
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-JIJOPRD4.js";
|
|
247
248
|
import "./chunk-3Y47VMHV.js";
|
|
248
249
|
import "./chunk-PDO5BLNM.js";
|
|
249
250
|
import "./chunk-UIE3R5XU.js";
|
|
@@ -263,7 +264,7 @@ import {
|
|
|
263
264
|
verifyEventTaskCredentialSubject,
|
|
264
265
|
verifyScheduledTaskCredentialSubject,
|
|
265
266
|
verifySlackDirectCredentialSubject
|
|
266
|
-
} from "./chunk-
|
|
267
|
+
} from "./chunk-QVQBWWXQ.js";
|
|
267
268
|
import {
|
|
268
269
|
SlackActionError,
|
|
269
270
|
downloadPrivateSlackFile,
|
|
@@ -273,7 +274,7 @@ import {
|
|
|
273
274
|
normalizeSlackConversationId,
|
|
274
275
|
runWithSlackInstallationToken,
|
|
275
276
|
runWithWorkspaceTeamId
|
|
276
|
-
} from "./chunk-
|
|
277
|
+
} from "./chunk-AGSUPAD5.js";
|
|
277
278
|
import {
|
|
278
279
|
contextProvenance,
|
|
279
280
|
createSlackDestination,
|
|
@@ -286,19 +287,19 @@ import {
|
|
|
286
287
|
requireSlackDestination,
|
|
287
288
|
withConversationEventLock,
|
|
288
289
|
withConversationMutationLock
|
|
289
|
-
} from "./chunk-
|
|
290
|
+
} from "./chunk-K3QXMZDU.js";
|
|
290
291
|
import {
|
|
291
292
|
juniorAgentBindings,
|
|
292
293
|
juniorAgentInvocations,
|
|
293
294
|
juniorConversationEvents,
|
|
294
295
|
juniorConversations
|
|
295
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-5N3XLYBW.js";
|
|
296
297
|
import "./chunk-EM225ITJ.js";
|
|
297
298
|
import {
|
|
298
299
|
acquireActiveLock,
|
|
299
300
|
getStateAdapter,
|
|
300
301
|
withActiveLock
|
|
301
|
-
} from "./chunk-
|
|
302
|
+
} from "./chunk-YN4W5SRJ.js";
|
|
302
303
|
import {
|
|
303
304
|
STANDARD_MODEL_PROFILE,
|
|
304
305
|
botConfig,
|
|
@@ -316,16 +317,16 @@ import {
|
|
|
316
317
|
modelIdForProfile,
|
|
317
318
|
setSlackReactionConfig,
|
|
318
319
|
standardModelId
|
|
319
|
-
} from "./chunk-
|
|
320
|
+
} from "./chunk-D22FO4LW.js";
|
|
320
321
|
import {
|
|
321
322
|
juniorDestinations
|
|
322
323
|
} from "./chunk-VFUK3X5B.js";
|
|
323
|
-
import "./chunk-
|
|
324
|
-
import "./chunk-
|
|
324
|
+
import "./chunk-PWMVR2MD.js";
|
|
325
|
+
import "./chunk-PQUV3NA5.js";
|
|
325
326
|
import {
|
|
326
327
|
pluginCatalogRuntime
|
|
327
|
-
} from "./chunk-
|
|
328
|
-
import "./chunk-
|
|
328
|
+
} from "./chunk-6DLWRSGV.js";
|
|
329
|
+
import "./chunk-2MGJ64SL.js";
|
|
329
330
|
import {
|
|
330
331
|
credentialContextForActor
|
|
331
332
|
} from "./chunk-RUIXF3YQ.js";
|
|
@@ -359,7 +360,7 @@ import {
|
|
|
359
360
|
withContext,
|
|
360
361
|
withLogContext,
|
|
361
362
|
withSpan
|
|
362
|
-
} from "./chunk-
|
|
363
|
+
} from "./chunk-OAPPJ3TM.js";
|
|
363
364
|
import {
|
|
364
365
|
continueTrace
|
|
365
366
|
} from "./chunk-6GWA276C.js";
|
|
@@ -367,10 +368,10 @@ import "./chunk-OOUNJNMR.js";
|
|
|
367
368
|
import "./chunk-H4HBKISO.js";
|
|
368
369
|
import {
|
|
369
370
|
JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
|
|
370
|
-
} from "./chunk-
|
|
371
|
+
} from "./chunk-DJAOSWB6.js";
|
|
371
372
|
import {
|
|
372
373
|
JUNIOR_VERSION
|
|
373
|
-
} from "./chunk-
|
|
374
|
+
} from "./chunk-WVXFEQXE.js";
|
|
374
375
|
import "./chunk-MLKGABMK.js";
|
|
375
376
|
|
|
376
377
|
// src/app.ts
|
|
@@ -2414,7 +2415,7 @@ import {
|
|
|
2414
2415
|
Message,
|
|
2415
2416
|
ThreadImpl
|
|
2416
2417
|
} from "chat";
|
|
2417
|
-
import { z as
|
|
2418
|
+
import { z as z3 } from "zod";
|
|
2418
2419
|
|
|
2419
2420
|
// src/chat/ingress/message-router.ts
|
|
2420
2421
|
function normalizeIncomingSlackThreadId(threadId, message) {
|
|
@@ -2584,91 +2585,6 @@ async function ensureSlackMessageActorIdentity(message, teamId, lookupSlackUser2
|
|
|
2584
2585
|
return actor;
|
|
2585
2586
|
}
|
|
2586
2587
|
|
|
2587
|
-
// src/chat/slack/user.ts
|
|
2588
|
-
import { z as z3 } from "zod";
|
|
2589
|
-
var slackUserInfoSchema = z3.object({
|
|
2590
|
-
ok: z3.literal(true),
|
|
2591
|
-
user: z3.object({
|
|
2592
|
-
name: z3.string().nullish(),
|
|
2593
|
-
profile: z3.object({
|
|
2594
|
-
email: z3.string().nullish(),
|
|
2595
|
-
real_name: z3.string().nullish()
|
|
2596
|
-
}).optional()
|
|
2597
|
-
})
|
|
2598
|
-
});
|
|
2599
|
-
var USER_CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
2600
|
-
var userCache = /* @__PURE__ */ new Map();
|
|
2601
|
-
function userCacheKey(teamId, userId) {
|
|
2602
|
-
return `${teamId}:${userId}`;
|
|
2603
|
-
}
|
|
2604
|
-
function readFromCache(teamId, userId) {
|
|
2605
|
-
const hit = userCache.get(userCacheKey(teamId, userId));
|
|
2606
|
-
if (!hit) return null;
|
|
2607
|
-
if (hit.expiresAt < Date.now()) {
|
|
2608
|
-
userCache.delete(userCacheKey(teamId, userId));
|
|
2609
|
-
return null;
|
|
2610
|
-
}
|
|
2611
|
-
return hit.value;
|
|
2612
|
-
}
|
|
2613
|
-
function writeToCache(teamId, userId, value) {
|
|
2614
|
-
userCache.set(userCacheKey(teamId, userId), {
|
|
2615
|
-
value,
|
|
2616
|
-
expiresAt: Date.now() + USER_CACHE_TTL_MS
|
|
2617
|
-
});
|
|
2618
|
-
}
|
|
2619
|
-
async function lookupSlackUser(teamId, userId) {
|
|
2620
|
-
if (!teamId || !userId) {
|
|
2621
|
-
return null;
|
|
2622
|
-
}
|
|
2623
|
-
const cached = readFromCache(teamId, userId);
|
|
2624
|
-
if (cached) {
|
|
2625
|
-
return cached;
|
|
2626
|
-
}
|
|
2627
|
-
const token = getSlackBotToken();
|
|
2628
|
-
if (!token) {
|
|
2629
|
-
return null;
|
|
2630
|
-
}
|
|
2631
|
-
try {
|
|
2632
|
-
const response = await fetch(
|
|
2633
|
-
`https://slack.com/api/users.info?user=${encodeURIComponent(userId)}`,
|
|
2634
|
-
{
|
|
2635
|
-
headers: {
|
|
2636
|
-
authorization: `Bearer ${token}`
|
|
2637
|
-
}
|
|
2638
|
-
}
|
|
2639
|
-
);
|
|
2640
|
-
if (!response.ok) {
|
|
2641
|
-
logWarn("slack.user.lookup.failed", {
|
|
2642
|
-
"enduser.id": userId,
|
|
2643
|
-
"app.slack.team_id": teamId,
|
|
2644
|
-
"http.response.status_code": response.status
|
|
2645
|
-
});
|
|
2646
|
-
return null;
|
|
2647
|
-
}
|
|
2648
|
-
const parsed = slackUserInfoSchema.safeParse(await response.json());
|
|
2649
|
-
if (!parsed.success) {
|
|
2650
|
-
return null;
|
|
2651
|
-
}
|
|
2652
|
-
const payload = parsed.data;
|
|
2653
|
-
const userName = payload.user.name?.trim() || void 0;
|
|
2654
|
-
const fullName = payload.user.profile?.real_name?.trim() || void 0;
|
|
2655
|
-
const result = {
|
|
2656
|
-
userName,
|
|
2657
|
-
fullName,
|
|
2658
|
-
email: payload.user.profile?.email?.trim() || void 0
|
|
2659
|
-
};
|
|
2660
|
-
writeToCache(teamId, userId, result);
|
|
2661
|
-
return result;
|
|
2662
|
-
} catch (error) {
|
|
2663
|
-
logWarn("slack.user.lookup.failed", {
|
|
2664
|
-
"enduser.id": userId,
|
|
2665
|
-
"app.slack.team_id": teamId,
|
|
2666
|
-
"exception.message": error instanceof Error ? error.message : String(error)
|
|
2667
|
-
});
|
|
2668
|
-
return null;
|
|
2669
|
-
}
|
|
2670
|
-
}
|
|
2671
|
-
|
|
2672
2588
|
// src/chat/resource-events/actor.ts
|
|
2673
2589
|
var RESOURCE_EVENT_SLACK_AUTHOR_ID = "UJRNEVENT";
|
|
2674
2590
|
var RESOURCE_EVENT_SYSTEM_ACTOR = {
|
|
@@ -2690,17 +2606,17 @@ function stripLeadingSteeringOverride(text) {
|
|
|
2690
2606
|
}
|
|
2691
2607
|
|
|
2692
2608
|
// src/chat/task-execution/slack-work.ts
|
|
2693
|
-
var slackConversationRouteSchema =
|
|
2609
|
+
var slackConversationRouteSchema = z3.enum(["mention", "subscribed"]);
|
|
2694
2610
|
function hasSteeringOverride(text) {
|
|
2695
2611
|
return stripLeadingSteeringOverride(text) !== text;
|
|
2696
2612
|
}
|
|
2697
|
-
var serializedDateSchema =
|
|
2698
|
-
var mdastPointSchema =
|
|
2699
|
-
column:
|
|
2700
|
-
line:
|
|
2701
|
-
offset:
|
|
2613
|
+
var serializedDateSchema = z3.iso.datetime();
|
|
2614
|
+
var mdastPointSchema = z3.object({
|
|
2615
|
+
column: z3.number().int().positive(),
|
|
2616
|
+
line: z3.number().int().positive(),
|
|
2617
|
+
offset: z3.number().int().nonnegative().optional()
|
|
2702
2618
|
}).strict();
|
|
2703
|
-
var mdastPositionSchema =
|
|
2619
|
+
var mdastPositionSchema = z3.object({
|
|
2704
2620
|
end: mdastPointSchema,
|
|
2705
2621
|
start: mdastPointSchema
|
|
2706
2622
|
}).strict();
|
|
@@ -2812,7 +2728,7 @@ function isFormattedContentNode(value) {
|
|
|
2812
2728
|
return false;
|
|
2813
2729
|
}
|
|
2814
2730
|
}
|
|
2815
|
-
var formattedContentSchema =
|
|
2731
|
+
var formattedContentSchema = z3.custom(
|
|
2816
2732
|
(value) => {
|
|
2817
2733
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
2818
2734
|
return false;
|
|
@@ -2822,79 +2738,79 @@ var formattedContentSchema = z4.custom(
|
|
|
2822
2738
|
},
|
|
2823
2739
|
"must be a valid formatted-content root"
|
|
2824
2740
|
);
|
|
2825
|
-
var serializedMessageSchema =
|
|
2826
|
-
_type:
|
|
2827
|
-
attachments:
|
|
2828
|
-
|
|
2829
|
-
type:
|
|
2830
|
-
url:
|
|
2831
|
-
name:
|
|
2832
|
-
mimeType:
|
|
2833
|
-
size:
|
|
2834
|
-
width:
|
|
2835
|
-
height:
|
|
2836
|
-
fetchMetadata:
|
|
2741
|
+
var serializedMessageSchema = z3.object({
|
|
2742
|
+
_type: z3.literal("chat:Message"),
|
|
2743
|
+
attachments: z3.array(
|
|
2744
|
+
z3.object({
|
|
2745
|
+
type: z3.enum(["image", "file", "video", "audio"]),
|
|
2746
|
+
url: z3.string().optional(),
|
|
2747
|
+
name: z3.string().optional(),
|
|
2748
|
+
mimeType: z3.string().optional(),
|
|
2749
|
+
size: z3.number().finite().optional(),
|
|
2750
|
+
width: z3.number().finite().optional(),
|
|
2751
|
+
height: z3.number().finite().optional(),
|
|
2752
|
+
fetchMetadata: z3.record(z3.string(), z3.string()).optional()
|
|
2837
2753
|
}).strict()
|
|
2838
2754
|
),
|
|
2839
|
-
author:
|
|
2840
|
-
userId:
|
|
2841
|
-
userName:
|
|
2842
|
-
fullName:
|
|
2843
|
-
isBot:
|
|
2844
|
-
isMe:
|
|
2755
|
+
author: z3.object({
|
|
2756
|
+
userId: z3.string(),
|
|
2757
|
+
userName: z3.string(),
|
|
2758
|
+
fullName: z3.string(),
|
|
2759
|
+
isBot: z3.union([z3.boolean(), z3.literal("unknown")]),
|
|
2760
|
+
isMe: z3.boolean()
|
|
2845
2761
|
}).strict(),
|
|
2846
2762
|
formatted: formattedContentSchema,
|
|
2847
|
-
id:
|
|
2848
|
-
isMention:
|
|
2849
|
-
links:
|
|
2850
|
-
|
|
2851
|
-
url:
|
|
2852
|
-
title:
|
|
2853
|
-
description:
|
|
2854
|
-
imageUrl:
|
|
2855
|
-
siteName:
|
|
2763
|
+
id: z3.string().min(1),
|
|
2764
|
+
isMention: z3.boolean().optional(),
|
|
2765
|
+
links: z3.array(
|
|
2766
|
+
z3.object({
|
|
2767
|
+
url: z3.string(),
|
|
2768
|
+
title: z3.string().optional(),
|
|
2769
|
+
description: z3.string().optional(),
|
|
2770
|
+
imageUrl: z3.string().optional(),
|
|
2771
|
+
siteName: z3.string().optional()
|
|
2856
2772
|
}).strict()
|
|
2857
2773
|
).optional(),
|
|
2858
|
-
metadata:
|
|
2774
|
+
metadata: z3.object({
|
|
2859
2775
|
dateSent: serializedDateSchema,
|
|
2860
|
-
edited:
|
|
2776
|
+
edited: z3.boolean(),
|
|
2861
2777
|
editedAt: serializedDateSchema.optional()
|
|
2862
2778
|
}).strict(),
|
|
2863
|
-
raw:
|
|
2864
|
-
text:
|
|
2865
|
-
threadId:
|
|
2779
|
+
raw: z3.unknown(),
|
|
2780
|
+
text: z3.string(),
|
|
2781
|
+
threadId: z3.string().min(1)
|
|
2866
2782
|
}).strict();
|
|
2867
|
-
var serializedThreadSchema =
|
|
2868
|
-
_type:
|
|
2869
|
-
adapterName:
|
|
2870
|
-
channelId:
|
|
2871
|
-
channelVisibility:
|
|
2783
|
+
var serializedThreadSchema = z3.object({
|
|
2784
|
+
_type: z3.literal("chat:Thread"),
|
|
2785
|
+
adapterName: z3.literal("slack"),
|
|
2786
|
+
channelId: z3.string().min(1),
|
|
2787
|
+
channelVisibility: z3.enum(["private", "workspace", "external", "unknown"]).optional(),
|
|
2872
2788
|
currentMessage: serializedMessageSchema.optional(),
|
|
2873
|
-
id:
|
|
2874
|
-
isDM:
|
|
2789
|
+
id: z3.string().min(1),
|
|
2790
|
+
isDM: z3.boolean()
|
|
2875
2791
|
}).strict();
|
|
2876
|
-
var slackInstallationSchema =
|
|
2877
|
-
enterpriseId:
|
|
2878
|
-
isEnterpriseInstall:
|
|
2879
|
-
teamId:
|
|
2792
|
+
var slackInstallationSchema = z3.object({
|
|
2793
|
+
enterpriseId: z3.string().optional(),
|
|
2794
|
+
isEnterpriseInstall: z3.boolean().optional(),
|
|
2795
|
+
teamId: z3.string().optional()
|
|
2880
2796
|
}).strict();
|
|
2881
|
-
var slackConversationMessageMetadataBaseSchema =
|
|
2797
|
+
var slackConversationMessageMetadataBaseSchema = z3.object({
|
|
2882
2798
|
installation: slackInstallationSchema.optional(),
|
|
2883
2799
|
message: serializedMessageSchema,
|
|
2884
|
-
platform:
|
|
2800
|
+
platform: z3.literal("slack"),
|
|
2885
2801
|
route: slackConversationRouteSchema,
|
|
2886
2802
|
thread: serializedThreadSchema
|
|
2887
2803
|
});
|
|
2888
|
-
var slackConversationMessageMetadataSchema =
|
|
2804
|
+
var slackConversationMessageMetadataSchema = z3.union([
|
|
2889
2805
|
slackConversationMessageMetadataBaseSchema.strict(),
|
|
2890
2806
|
slackConversationMessageMetadataBaseSchema.extend({
|
|
2891
|
-
kind:
|
|
2892
|
-
resourceEvent:
|
|
2893
|
-
eventKey:
|
|
2894
|
-
eventType:
|
|
2895
|
-
namespace:
|
|
2896
|
-
identifier:
|
|
2897
|
-
subscriptionId:
|
|
2807
|
+
kind: z3.literal("resource_event"),
|
|
2808
|
+
resourceEvent: z3.object({
|
|
2809
|
+
eventKey: z3.string(),
|
|
2810
|
+
eventType: z3.string(),
|
|
2811
|
+
namespace: z3.string(),
|
|
2812
|
+
identifier: z3.string(),
|
|
2813
|
+
subscriptionId: z3.string()
|
|
2898
2814
|
}).strict()
|
|
2899
2815
|
}).strict()
|
|
2900
2816
|
]);
|
|
@@ -3116,16 +3032,23 @@ function createSlackConversationWorker(options) {
|
|
|
3116
3032
|
context.destination,
|
|
3117
3033
|
"Slack paused-turn recovery"
|
|
3118
3034
|
);
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3035
|
+
try {
|
|
3036
|
+
await runWithSlackInstallation({
|
|
3037
|
+
adapter,
|
|
3038
|
+
installation: { teamId: destination.teamId },
|
|
3039
|
+
state,
|
|
3040
|
+
task: async () => {
|
|
3041
|
+
await options.runNextPausedTurn(context.conversationId, {
|
|
3042
|
+
shouldYield: context.shouldYield
|
|
3043
|
+
});
|
|
3044
|
+
}
|
|
3045
|
+
});
|
|
3046
|
+
} catch (error) {
|
|
3047
|
+
if (isCooperativeTurnYieldError(error)) {
|
|
3048
|
+
return { status: "yielded" };
|
|
3127
3049
|
}
|
|
3128
|
-
|
|
3050
|
+
throw error;
|
|
3051
|
+
}
|
|
3129
3052
|
return { status: "completed" };
|
|
3130
3053
|
}
|
|
3131
3054
|
const latestRecord = records[records.length - 1];
|
|
@@ -4290,7 +4213,7 @@ function registerVercelPluginTaskDevConsumer() {
|
|
|
4290
4213
|
}
|
|
4291
4214
|
|
|
4292
4215
|
// src/chat/services/subscribed-decision.ts
|
|
4293
|
-
import { z as
|
|
4216
|
+
import { z as z4 } from "zod";
|
|
4294
4217
|
|
|
4295
4218
|
// src/chat/services/subscribed-reply-router-policy.ts
|
|
4296
4219
|
function buildSubscribedReplyRouterPolicy(assistantName) {
|
|
@@ -4335,13 +4258,13 @@ Assess conversation floor ownership and whether the latest message continues wor
|
|
|
4335
4258
|
}
|
|
4336
4259
|
|
|
4337
4260
|
// src/chat/services/subscribed-decision.ts
|
|
4338
|
-
var replyDecisionSchema =
|
|
4339
|
-
should_reply:
|
|
4340
|
-
should_unsubscribe:
|
|
4261
|
+
var replyDecisionSchema = z4.object({
|
|
4262
|
+
should_reply: z4.boolean().describe("Whether Junior should respond to this thread message."),
|
|
4263
|
+
should_unsubscribe: z4.boolean().describe(
|
|
4341
4264
|
"Whether Junior should unsubscribe from this thread because the user clearly asked it to stop participating."
|
|
4342
4265
|
),
|
|
4343
|
-
confidence:
|
|
4344
|
-
reason:
|
|
4266
|
+
confidence: z4.number().min(0).max(1).describe("Classifier confidence from 0 to 1."),
|
|
4267
|
+
reason: z4.string().describe("Short reason for the decision; use an empty string if none.")
|
|
4345
4268
|
}).strict();
|
|
4346
4269
|
var ROUTER_CONFIDENCE_THRESHOLD = 0.7;
|
|
4347
4270
|
var ROUTER_CLASSIFIER_MAX_TOKENS = 400;
|
|
@@ -6047,11 +5970,11 @@ function getMessageTimestamp(message) {
|
|
|
6047
5970
|
}
|
|
6048
5971
|
|
|
6049
5972
|
// src/chat/slack/action-token.ts
|
|
6050
|
-
import { z as
|
|
6051
|
-
var slackActionTokenSchema =
|
|
6052
|
-
var slackMessageEnvelopeSchema =
|
|
6053
|
-
raw:
|
|
6054
|
-
action_token:
|
|
5973
|
+
import { z as z5 } from "zod";
|
|
5974
|
+
var slackActionTokenSchema = z5.string().trim().min(1).brand();
|
|
5975
|
+
var slackMessageEnvelopeSchema = z5.object({
|
|
5976
|
+
raw: z5.object({
|
|
5977
|
+
action_token: z5.unknown().optional()
|
|
6055
5978
|
}).optional()
|
|
6056
5979
|
});
|
|
6057
5980
|
function readSlackActionToken(message) {
|
|
@@ -7074,7 +6997,7 @@ function createReplyToThread(deps) {
|
|
|
7074
6997
|
}
|
|
7075
6998
|
if (outcome.status === "suspended") {
|
|
7076
6999
|
options.onTurnOutcome?.({ outcome: "awaiting_resume" });
|
|
7077
|
-
if (options.shouldYield
|
|
7000
|
+
if (options.shouldYield && (options.shouldYield() || outcome.reason === "timeout")) {
|
|
7078
7001
|
shouldPersistFailureState = false;
|
|
7079
7002
|
throw new CooperativeTurnYieldError();
|
|
7080
7003
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-6DLWRSGV.js";
|
|
4
|
+
import "./chunk-2MGJ64SL.js";
|
|
5
5
|
import "./chunk-RUIXF3YQ.js";
|
|
6
6
|
import "./chunk-HZF5P5UN.js";
|
|
7
7
|
import "./chunk-F3B2YJ76.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-OAPPJ3TM.js";
|
|
9
9
|
import "./chunk-6GWA276C.js";
|
|
10
10
|
import "./chunk-OOUNJNMR.js";
|
|
11
11
|
import "./chunk-H4HBKISO.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-DJAOSWB6.js";
|
|
13
|
+
import "./chunk-WVXFEQXE.js";
|
|
14
14
|
import "./chunk-MLKGABMK.js";
|
|
15
15
|
export {
|
|
16
16
|
pluginCatalogRuntime
|
|
@@ -7,10 +7,11 @@ export declare function upsertActiveSkill(activeSkills: Skill[], next: Skill): v
|
|
|
7
7
|
export declare function discoverRunSkills(args: {
|
|
8
8
|
skillDirs?: string[];
|
|
9
9
|
}): Promise<SkillMetadata[]>;
|
|
10
|
-
/**
|
|
11
|
-
export declare function
|
|
10
|
+
/** Load the explicit skill, or recover the last skill loaded in a resumed turn. */
|
|
11
|
+
export declare function loadRunSkill(args: {
|
|
12
12
|
activeSkills: Skill[];
|
|
13
|
+
currentTurnMessages: readonly PiMessage[];
|
|
13
14
|
invokedSkill: SkillMetadata | null;
|
|
14
|
-
|
|
15
|
+
resumed: boolean;
|
|
15
16
|
skillSandbox: SkillSandbox;
|
|
16
|
-
}): Promise<
|
|
17
|
+
}): Promise<Skill | null>;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Run tool wiring.
|
|
3
3
|
*
|
|
4
4
|
* Builds everything the agent can act through for one run slice: the sandbox
|
|
5
|
-
* access, MCP and plugin auth orchestration, MCP
|
|
6
|
-
* provider
|
|
7
|
-
* (main-agent tools plus runtime
|
|
8
|
-
*
|
|
5
|
+
* access, MCP and plugin auth orchestration, credential-subject-owned MCP
|
|
6
|
+
* provider
|
|
7
|
+
* restoration, and the Pi-facing tool surfaces (main-agent tools plus runtime
|
|
8
|
+
* control tools). Auth pauses raised while restoring providers are thrown
|
|
9
|
+
* here so the run parks before prompting.
|
|
9
10
|
*/
|
|
10
11
|
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
11
12
|
import type { FileUpload } from "chat";
|
|
@@ -51,7 +52,6 @@ interface ToolWiringArgs {
|
|
|
51
52
|
onFatalToolError(error: Error): void;
|
|
52
53
|
onSandboxRefChanged: (sandboxRef: SandboxRef) => void;
|
|
53
54
|
preAgentPromptMessages: () => PiMessage[];
|
|
54
|
-
priorPiMessages: PiMessage[] | undefined;
|
|
55
55
|
recordConnectedMcpProvider: (provider: string) => Promise<void>;
|
|
56
56
|
requestHandoff?: ToolRuntimeContext["handoff"];
|
|
57
57
|
resume: ResumeState;
|