@sentry/junior 0.141.0 → 0.143.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-HIRVKUQJ.js → agent-hooks-2EP3QS47.js} +10 -10
- package/dist/api/schema/task.d.ts +8 -0
- package/dist/api/schema.js +1 -1
- package/dist/api.js +34 -22
- package/dist/app.js +62 -91
- package/dist/{catalog-runtime-XVLED5UH.js → catalog-runtime-IAVW4W3B.js} +5 -5
- package/dist/chat/event-tasks/types.d.ts +7 -1
- package/dist/chat/runtime/turn.d.ts +0 -4
- package/dist/chat/scheduled-tasks/tools/create.d.ts +1 -0
- package/dist/chat/scheduled-tasks/types.d.ts +5 -0
- package/dist/chat/services/conversation-memory.d.ts +2 -1
- package/dist/chat/services/short-title.d.ts +25 -0
- package/dist/chat/state/conversation.d.ts +6 -17
- package/dist/chat/tools/create-event-task.d.ts +1 -0
- package/dist/{chunk-3H42HMA2.js → chunk-2KLMGRRQ.js} +5 -1
- package/dist/{chunk-HN4UZTG7.js → chunk-2T5CHXRZ.js} +2 -2
- package/dist/{chunk-PGJUJCOQ.js → chunk-5YJBS4I5.js} +1 -1
- package/dist/{chunk-BBLO66XT.js → chunk-7GVX5SOG.js} +2 -2
- package/dist/{chunk-2DOVDDZJ.js → chunk-A3XPSABC.js} +3 -3
- package/dist/{chunk-FZFJZZR3.js → chunk-AEFJN7OK.js} +4 -4
- package/dist/{chunk-DK3GQWJK.js → chunk-ANG7IWAI.js} +6 -6
- package/dist/{chunk-LMGKSDO4.js → chunk-BJ6ISBOA.js} +1 -1
- package/dist/{chunk-H4WNQFBH.js → chunk-F6RWNJBK.js} +5 -5
- package/dist/{chunk-UFEU4UX6.js → chunk-GZRWULXF.js} +1 -1
- package/dist/{chunk-DVIJ6DP6.js → chunk-I25V3XRN.js} +2 -2
- package/dist/{chunk-A2O7SGK5.js → chunk-I4NQNZVW.js} +6 -6
- package/dist/{chunk-DKH4WGZU.js → chunk-I5PIM72M.js} +341 -16
- package/dist/{chunk-FWXSPJRN.js → chunk-LSBQHDI2.js} +1 -1
- package/dist/{chunk-6U44QGXL.js → chunk-M2T7MHQJ.js} +1 -1
- package/dist/{chunk-5MFCEKR6.js → chunk-NAINBOZQ.js} +3 -3
- package/dist/{chunk-EYD523BV.js → chunk-NVFVM67W.js} +1 -1
- package/dist/{chunk-43OPSFUY.js → chunk-OB7ZJK7Y.js} +1 -1
- package/dist/{chunk-HQAFIN6O.js → chunk-OG5JQHKR.js} +1 -1
- package/dist/{chunk-YWM6MJT4.js → chunk-OGQGJAD7.js} +2 -0
- package/dist/{chunk-PIQKV7IR.js → chunk-PBV7VXUA.js} +10 -451
- package/dist/{chunk-LIVSCWI5.js → chunk-QFWXGUAH.js} +23 -26
- package/dist/{chunk-UONUDOJP.js → chunk-RABHACKG.js} +7 -7
- package/dist/{chunk-7ULXCNOZ.js → chunk-SNBTWIQO.js} +6 -6
- package/dist/chunk-STX5WIH6.js +75 -0
- package/dist/{chunk-44NWPKY3.js → chunk-TPJK6AVJ.js} +1 -1
- package/dist/{chunk-6FRAWWGR.js → chunk-U5ATCOHE.js} +2 -2
- package/dist/{chunk-5LPWHC7Q.js → chunk-UFCA4EZB.js} +80 -46
- package/dist/chunk-WJHWOAVZ.js +67 -0
- package/dist/{chunk-NFL4FRIU.js → chunk-WM4PRM7W.js} +4 -4
- package/dist/{chunk-OFQBDHVG.js → chunk-WSWVWP2V.js} +1 -1
- package/dist/{chunk-DBKS7JR2.js → chunk-X5SC2UGE.js} +3 -3
- package/dist/{chunk-OHO46E7F.js → chunk-XYJNNZYR.js} +88 -36
- package/dist/cli/chat.js +32 -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/schema/event-tasks.d.ts +20 -52
- package/dist/db/schema/scheduled-tasks.d.ts +17 -0
- package/dist/db/schema.d.ts +36 -52
- package/dist/{db-PSMQZR4P.js → db-RBXBVEVO.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-XZUK2AT6.js → oauth-callback-server-LRB6BX6C.js} +23 -21
- package/dist/{runner-5EKJCQWP.js → runner-WK5VUOW6.js} +24 -25
- package/dist/{skills-2PRM42SE.js → skills-MJWRME3A.js} +6 -6
- package/dist/{spawn-UGTLRTFP.js → spawn-ZCW6UOAA.js} +17 -17
- package/dist/{validation-XLXAIRTR.js → validation-556WSWVU.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-CNTNEQ2Q.js → work-W6IXSPY3.js} +16 -16
- package/dist/{worker-BGW7CKZ7.js → worker-5KM346HH.js} +10 -10
- package/migrations/0023_task_title_columns.sql +2 -0
- package/migrations/meta/0023_snapshot.json +2198 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
botConfig,
|
|
3
|
+
resolveGatewayModel
|
|
4
|
+
} from "./chunk-7GVX5SOG.js";
|
|
5
|
+
|
|
6
|
+
// src/chat/services/context-budget.ts
|
|
7
|
+
var COMPACTION_TRIGGER_RATIO = 0.9;
|
|
8
|
+
var CONTEXT_INPUT_LIMIT_RATIO = 0.95;
|
|
9
|
+
var COMPACTION_TARGET_RATIO = 0.8;
|
|
10
|
+
var FALLBACK_CONTEXT_WINDOW_TOKENS = 4e5;
|
|
11
|
+
function positiveInteger(value, fallback) {
|
|
12
|
+
return Number.isFinite(value) && value > 0 ? Math.floor(value) : fallback;
|
|
13
|
+
}
|
|
14
|
+
function estimateTextTokens(text) {
|
|
15
|
+
return Math.ceil(text.length / 4);
|
|
16
|
+
}
|
|
17
|
+
function calculateContextCompactionTriggerTokens(model) {
|
|
18
|
+
const contextWindow = positiveInteger(
|
|
19
|
+
model.contextWindow,
|
|
20
|
+
FALLBACK_CONTEXT_WINDOW_TOKENS
|
|
21
|
+
);
|
|
22
|
+
return Math.max(1, Math.floor(contextWindow * COMPACTION_TRIGGER_RATIO));
|
|
23
|
+
}
|
|
24
|
+
function calculateContextInputLimitTokens(model) {
|
|
25
|
+
const contextWindow = positiveInteger(
|
|
26
|
+
model.contextWindow,
|
|
27
|
+
FALLBACK_CONTEXT_WINDOW_TOKENS
|
|
28
|
+
);
|
|
29
|
+
return Math.max(1, Math.floor(contextWindow * CONTEXT_INPUT_LIMIT_RATIO));
|
|
30
|
+
}
|
|
31
|
+
function calculateContextCompactionTargetTokens(triggerTokens) {
|
|
32
|
+
return Math.max(1, Math.floor(triggerTokens * COMPACTION_TARGET_RATIO));
|
|
33
|
+
}
|
|
34
|
+
function getModelContextBudget(modelId) {
|
|
35
|
+
const model = resolveGatewayModel(modelId);
|
|
36
|
+
const advertisedContextWindow = positiveInteger(
|
|
37
|
+
model.contextWindow,
|
|
38
|
+
FALLBACK_CONTEXT_WINDOW_TOKENS
|
|
39
|
+
);
|
|
40
|
+
return {
|
|
41
|
+
contextWindow: Math.min(
|
|
42
|
+
botConfig.contextWindowTokens,
|
|
43
|
+
advertisedContextWindow
|
|
44
|
+
)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function getAgentContextCompactionTriggerTokens(modelId) {
|
|
48
|
+
return calculateContextCompactionTriggerTokens(
|
|
49
|
+
getModelContextBudget(modelId)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function getAgentContextInputLimitTokens(modelId) {
|
|
53
|
+
return calculateContextInputLimitTokens(getModelContextBudget(modelId));
|
|
54
|
+
}
|
|
55
|
+
function getConversationContextCompactionTriggerTokens() {
|
|
56
|
+
return calculateContextCompactionTriggerTokens(
|
|
57
|
+
getModelContextBudget(botConfig.fastModelId)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
estimateTextTokens,
|
|
63
|
+
calculateContextCompactionTargetTokens,
|
|
64
|
+
getAgentContextCompactionTriggerTokens,
|
|
65
|
+
getAgentContextInputLimitTokens,
|
|
66
|
+
getConversationContextCompactionTriggerTokens
|
|
67
|
+
};
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
getConversationStore,
|
|
6
6
|
parseDestination,
|
|
7
7
|
sameDestination
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NAINBOZQ.js";
|
|
9
9
|
import {
|
|
10
10
|
getDefaultRedisStateAdapterFor,
|
|
11
11
|
getStateAdapter
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M2T7MHQJ.js";
|
|
13
13
|
import {
|
|
14
14
|
getChatConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7GVX5SOG.js";
|
|
16
16
|
import {
|
|
17
17
|
parseStoredSlackActor
|
|
18
18
|
} from "./chunk-HZF5P5UN.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
isRecord,
|
|
21
21
|
toOptionalNumber,
|
|
22
22
|
toOptionalString
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GZRWULXF.js";
|
|
24
24
|
|
|
25
25
|
// src/chat/task-execution/state.ts
|
|
26
26
|
import { randomUUID } from "crypto";
|
|
@@ -18,20 +18,20 @@ import {
|
|
|
18
18
|
releaseConversationWork,
|
|
19
19
|
requestConversationContinuation,
|
|
20
20
|
startConversationWork
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-WM4PRM7W.js";
|
|
22
22
|
import {
|
|
23
23
|
ConversationQueueMessageRejectedError
|
|
24
24
|
} from "./chunk-IUFM5JWV.js";
|
|
25
25
|
import {
|
|
26
26
|
getChatConfig,
|
|
27
27
|
isProviderRetryError
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-7GVX5SOG.js";
|
|
29
29
|
import {
|
|
30
30
|
logException,
|
|
31
31
|
logInfo,
|
|
32
32
|
logWarn,
|
|
33
33
|
withLogContext
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-GZRWULXF.js";
|
|
35
35
|
|
|
36
36
|
// src/chat/task-execution/worker.ts
|
|
37
37
|
var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PluginCredentialFailureError,
|
|
8
8
|
agentNameSchema,
|
|
9
9
|
createPluginAuthOrchestration
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-F6RWNJBK.js";
|
|
11
11
|
import {
|
|
12
12
|
authorizationId
|
|
13
13
|
} from "./chunk-DIB4GX3G.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
patchMcpAuthSession,
|
|
29
29
|
selectPluginGrant,
|
|
30
30
|
toMcpProviderError
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-RABHACKG.js";
|
|
32
32
|
import {
|
|
33
33
|
RetryableDeliveryError,
|
|
34
34
|
actorFromRouting,
|
|
@@ -44,7 +44,12 @@ import {
|
|
|
44
44
|
getSlackMessagePermalink,
|
|
45
45
|
resolveBaseUrl,
|
|
46
46
|
uploadFilesToConversation
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-ANG7IWAI.js";
|
|
48
|
+
import {
|
|
49
|
+
estimateTextTokens,
|
|
50
|
+
getAgentContextCompactionTriggerTokens,
|
|
51
|
+
getAgentContextInputLimitTokens
|
|
52
|
+
} from "./chunk-WJHWOAVZ.js";
|
|
48
53
|
import {
|
|
49
54
|
AGENTS_REMOVAL_NOTICE,
|
|
50
55
|
AGENTS_REPLACEMENT_NOTICE,
|
|
@@ -62,12 +67,9 @@ import {
|
|
|
62
67
|
collectFiles,
|
|
63
68
|
containsNoReplyMarker,
|
|
64
69
|
decideReply,
|
|
65
|
-
estimateTextTokens,
|
|
66
70
|
extractAssistantText,
|
|
67
71
|
findSingleRepositoryDirectory,
|
|
68
72
|
findVisibleAgentsInstructions,
|
|
69
|
-
getAgentContextCompactionTriggerTokens,
|
|
70
|
-
getAgentContextInputLimitTokens,
|
|
71
73
|
getAssistantReplyText,
|
|
72
74
|
getPiMessageRole,
|
|
73
75
|
getRipgrepSearchLocation,
|
|
@@ -110,9 +112,8 @@ import {
|
|
|
110
112
|
sanitizeAssistantText,
|
|
111
113
|
stripRuntimeTurnContext,
|
|
112
114
|
trimTrailingAssistantMessages,
|
|
113
|
-
truncateText
|
|
114
|
-
|
|
115
|
-
} from "./chunk-PIQKV7IR.js";
|
|
115
|
+
truncateText
|
|
116
|
+
} from "./chunk-PBV7VXUA.js";
|
|
116
117
|
import {
|
|
117
118
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
118
119
|
} from "./chunk-3Y47VMHV.js";
|
|
@@ -144,7 +145,7 @@ import {
|
|
|
144
145
|
runNonInteractiveCommand,
|
|
145
146
|
throwSandboxOperationError,
|
|
146
147
|
wrapSandboxSetupError
|
|
147
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-AEFJN7OK.js";
|
|
148
149
|
import {
|
|
149
150
|
SCHEDULED_TASK_SYSTEM_ACTOR,
|
|
150
151
|
compactEventTask,
|
|
@@ -176,10 +177,15 @@ import {
|
|
|
176
177
|
saveEventTask,
|
|
177
178
|
scheduledTaskAttributes,
|
|
178
179
|
writableEventTask
|
|
179
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-UFCA4EZB.js";
|
|
180
181
|
import {
|
|
181
182
|
parseSlackThreadId
|
|
182
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-OG5JQHKR.js";
|
|
184
|
+
import {
|
|
185
|
+
SHORT_TITLE_MAX_LENGTH,
|
|
186
|
+
generateShortTitle,
|
|
187
|
+
resolveTaskTitle
|
|
188
|
+
} from "./chunk-STX5WIH6.js";
|
|
183
189
|
import {
|
|
184
190
|
ToolInputError,
|
|
185
191
|
addAgentTurnUsage,
|
|
@@ -197,7 +203,7 @@ import {
|
|
|
197
203
|
getSlackToolContext,
|
|
198
204
|
readActorIdentity,
|
|
199
205
|
resolveChannelCapabilities
|
|
200
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-SNBTWIQO.js";
|
|
201
207
|
import {
|
|
202
208
|
SlackActionError,
|
|
203
209
|
downloadPrivateSlackFile,
|
|
@@ -206,7 +212,7 @@ import {
|
|
|
206
212
|
isConversationScopedChannel,
|
|
207
213
|
normalizeSlackConversationId,
|
|
208
214
|
withSlackRetries
|
|
209
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-I25V3XRN.js";
|
|
210
216
|
import {
|
|
211
217
|
KNOWN_CONVERSATION_EVENT_TYPES,
|
|
212
218
|
contextProvenance,
|
|
@@ -217,7 +223,7 @@ import {
|
|
|
217
223
|
instructionActors,
|
|
218
224
|
instructionProvenanceFor,
|
|
219
225
|
sameActorIdentity
|
|
220
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-NAINBOZQ.js";
|
|
221
227
|
import {
|
|
222
228
|
SANDBOX_DATA_ROOT,
|
|
223
229
|
SANDBOX_SKILLS_ROOT,
|
|
@@ -229,7 +235,7 @@ import {
|
|
|
229
235
|
} from "./chunk-EM225ITJ.js";
|
|
230
236
|
import {
|
|
231
237
|
getStateAdapter
|
|
232
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-M2T7MHQJ.js";
|
|
233
239
|
import {
|
|
234
240
|
ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX,
|
|
235
241
|
COMPACTION_SUMMARY_PREFIX,
|
|
@@ -263,7 +269,7 @@ import {
|
|
|
263
269
|
resolveGatewayCredential,
|
|
264
270
|
resolveGatewayModel,
|
|
265
271
|
unwrapCurrentInstruction
|
|
266
|
-
} from "./chunk-
|
|
272
|
+
} from "./chunk-7GVX5SOG.js";
|
|
267
273
|
import {
|
|
268
274
|
canExposeConversationPayload,
|
|
269
275
|
resolveConversationPrivacy,
|
|
@@ -273,16 +279,16 @@ import {
|
|
|
273
279
|
toGenAiMessagesTraceAttributes,
|
|
274
280
|
toGenAiPayloadMetadata,
|
|
275
281
|
toGenAiPayloadTraceAttributes
|
|
276
|
-
} from "./chunk-
|
|
282
|
+
} from "./chunk-5YJBS4I5.js";
|
|
277
283
|
import {
|
|
278
284
|
discoverSkills,
|
|
279
285
|
findSkillByName,
|
|
280
286
|
loadSkillsByName,
|
|
281
287
|
parseSkillInvocation
|
|
282
|
-
} from "./chunk-
|
|
288
|
+
} from "./chunk-U5ATCOHE.js";
|
|
283
289
|
import {
|
|
284
290
|
pluginCatalogRuntime
|
|
285
|
-
} from "./chunk-
|
|
291
|
+
} from "./chunk-NVFVM67W.js";
|
|
286
292
|
import {
|
|
287
293
|
CredentialUnavailableError,
|
|
288
294
|
OAuthProviderError,
|
|
@@ -290,7 +296,7 @@ import {
|
|
|
290
296
|
getOAuthProviderErrorAttributes,
|
|
291
297
|
resolveAuthTokenPlaceholder,
|
|
292
298
|
resolvePluginCommandEnv
|
|
293
|
-
} from "./chunk-
|
|
299
|
+
} from "./chunk-BJ6ISBOA.js";
|
|
294
300
|
import {
|
|
295
301
|
credentialUserSubjectId
|
|
296
302
|
} from "./chunk-RUIXF3YQ.js";
|
|
@@ -319,7 +325,7 @@ import {
|
|
|
319
325
|
summarizeMessageText,
|
|
320
326
|
withLogContext,
|
|
321
327
|
withSpan
|
|
322
|
-
} from "./chunk-
|
|
328
|
+
} from "./chunk-GZRWULXF.js";
|
|
323
329
|
import {
|
|
324
330
|
startInactiveSpan,
|
|
325
331
|
withActiveSpan
|
|
@@ -8416,6 +8422,9 @@ function createEventTaskTool(context, catalog) {
|
|
|
8416
8422
|
description: "Create a durable event task that executes the supplied instruction for every matching resource event. Use for whenever-this-happens-do-X automation; ordinary watch, notify, or tell-me-when requests use watchResourceEvents instead. The task remains configured for this Slack channel or DM until deleted and may use the creator's connected credentials. Prefer a subscribable tool result when available.",
|
|
8417
8423
|
inputSchema: z23.object({
|
|
8418
8424
|
task: z23.string().trim().min(1).max(4e3),
|
|
8425
|
+
title: z23.string().trim().min(1).max(SHORT_TITLE_MAX_LENGTH).nullable().describe(
|
|
8426
|
+
"Optional short display title. Omit or use null to generate one from the task instruction."
|
|
8427
|
+
).optional(),
|
|
8419
8428
|
trigger,
|
|
8420
8429
|
credentialMode: z23.enum(["creator", "system"]).nullable().describe(
|
|
8421
8430
|
"Use creator to make the task creator's connected credentials available, or system when the creator says not to use them. Omit or use null for the creator default."
|
|
@@ -8423,11 +8432,13 @@ function createEventTaskTool(context, catalog) {
|
|
|
8423
8432
|
}).strict(),
|
|
8424
8433
|
prepareArguments(args) {
|
|
8425
8434
|
const input = args;
|
|
8426
|
-
if (input?.credentialMode !== "creator" && input?.credentialMode !== null) {
|
|
8427
|
-
return input;
|
|
8428
|
-
}
|
|
8429
8435
|
const prepared = { ...input };
|
|
8430
|
-
|
|
8436
|
+
if (prepared.title == null) {
|
|
8437
|
+
delete prepared.title;
|
|
8438
|
+
}
|
|
8439
|
+
if (prepared.credentialMode === "creator" || prepared.credentialMode === null) {
|
|
8440
|
+
delete prepared.credentialMode;
|
|
8441
|
+
}
|
|
8431
8442
|
return prepared;
|
|
8432
8443
|
},
|
|
8433
8444
|
outputSchema: eventTaskToolResultSchema,
|
|
@@ -8448,6 +8459,11 @@ function createEventTaskTool(context, catalog) {
|
|
|
8448
8459
|
}
|
|
8449
8460
|
return eventTaskSuccess(existing, catalog);
|
|
8450
8461
|
}
|
|
8462
|
+
const title = await resolveTaskTitle({
|
|
8463
|
+
completeText,
|
|
8464
|
+
instruction: input.task,
|
|
8465
|
+
title: input.title
|
|
8466
|
+
});
|
|
8451
8467
|
const task = {
|
|
8452
8468
|
id,
|
|
8453
8469
|
destinationVisibility: source.visibility,
|
|
@@ -8460,6 +8476,7 @@ function createEventTaskTool(context, catalog) {
|
|
|
8460
8476
|
credentialMode: input.credentialMode ?? "creator",
|
|
8461
8477
|
destination,
|
|
8462
8478
|
task: { text: input.task },
|
|
8479
|
+
...title ? { title } : {},
|
|
8463
8480
|
trigger: {
|
|
8464
8481
|
namespace: input.trigger.namespace,
|
|
8465
8482
|
identifier: normalizeEventIdentifier(
|
|
@@ -8594,13 +8611,24 @@ function createUpdateEventTaskTool(context, catalog) {
|
|
|
8594
8611
|
label: input.trigger.label,
|
|
8595
8612
|
events: [...new Set(input.trigger.events)]
|
|
8596
8613
|
} : current.trigger;
|
|
8597
|
-
const
|
|
8614
|
+
const nextInstruction = input.task != null ? input.task : current.task.text;
|
|
8615
|
+
const instructionChanged = nextInstruction !== current.task.text;
|
|
8616
|
+
const changesExecution = instructionChanged || changesEventTaskTrigger(current.trigger, nextTrigger);
|
|
8598
8617
|
const next = {
|
|
8599
8618
|
...current,
|
|
8600
8619
|
credentialMode: changesExecution && !isCreator ? "system" : input.credentialMode ?? current.credentialMode,
|
|
8601
|
-
task:
|
|
8620
|
+
task: { text: nextInstruction },
|
|
8602
8621
|
trigger: nextTrigger
|
|
8603
8622
|
};
|
|
8623
|
+
if (instructionChanged) {
|
|
8624
|
+
const title = await generateShortTitle({
|
|
8625
|
+
completeText,
|
|
8626
|
+
kind: "task",
|
|
8627
|
+
sourceText: nextInstruction
|
|
8628
|
+
});
|
|
8629
|
+
if (title) next.title = title;
|
|
8630
|
+
else delete next.title;
|
|
8631
|
+
}
|
|
8604
8632
|
const saved = await saveEventTask(getDb(), next);
|
|
8605
8633
|
if (!saved) {
|
|
8606
8634
|
throw new ToolInputError(
|
|
@@ -9107,6 +9135,9 @@ function createSlackScheduleCreateTaskTool(context) {
|
|
|
9107
9135
|
executionMode: "sequential",
|
|
9108
9136
|
inputSchema: z29.object({
|
|
9109
9137
|
task: z29.string().min(1).max(4e3),
|
|
9138
|
+
title: z29.string().trim().min(1).max(SHORT_TITLE_MAX_LENGTH).nullable().describe(
|
|
9139
|
+
"Optional short display title. Omit or use null to generate one from the task instruction."
|
|
9140
|
+
).optional(),
|
|
9110
9141
|
schedule: scheduleIntentSchema.describe(
|
|
9111
9142
|
"When the task runs. The scheduler computes the exact next run from this intent and the server clock."
|
|
9112
9143
|
),
|
|
@@ -9116,11 +9147,13 @@ function createSlackScheduleCreateTaskTool(context) {
|
|
|
9116
9147
|
}).strict(),
|
|
9117
9148
|
prepareArguments(args) {
|
|
9118
9149
|
const input = args;
|
|
9119
|
-
if (input?.credential_mode !== "creator" && input?.credential_mode !== null) {
|
|
9120
|
-
return input;
|
|
9121
|
-
}
|
|
9122
9150
|
const prepared = { ...input };
|
|
9123
|
-
|
|
9151
|
+
if (prepared.title == null) {
|
|
9152
|
+
delete prepared.title;
|
|
9153
|
+
}
|
|
9154
|
+
if (prepared.credential_mode === "creator" || prepared.credential_mode === null) {
|
|
9155
|
+
delete prepared.credential_mode;
|
|
9156
|
+
}
|
|
9124
9157
|
return prepared;
|
|
9125
9158
|
},
|
|
9126
9159
|
outputSchema: scheduleTaskToolResultSchema,
|
|
@@ -9166,6 +9199,11 @@ function createSlackScheduleCreateTaskTool(context) {
|
|
|
9166
9199
|
destination,
|
|
9167
9200
|
context.source
|
|
9168
9201
|
);
|
|
9202
|
+
const title = await resolveTaskTitle({
|
|
9203
|
+
completeText,
|
|
9204
|
+
instruction: input.task,
|
|
9205
|
+
title: input.title
|
|
9206
|
+
});
|
|
9169
9207
|
const task = {
|
|
9170
9208
|
id,
|
|
9171
9209
|
createdAtMs: nowMs,
|
|
@@ -9182,7 +9220,8 @@ function createSlackScheduleCreateTaskTool(context) {
|
|
|
9182
9220
|
status: "active",
|
|
9183
9221
|
task: {
|
|
9184
9222
|
text: input.task
|
|
9185
|
-
}
|
|
9223
|
+
},
|
|
9224
|
+
...title ? { title } : {}
|
|
9186
9225
|
};
|
|
9187
9226
|
const committed = await store.createTask(task);
|
|
9188
9227
|
if (!sameDestination(committed, destination) || committed.createdBy.slackUserId !== actor.slackUserId) {
|
|
@@ -9204,6 +9243,7 @@ function createSlackScheduleCreateTaskTool(context) {
|
|
|
9204
9243
|
import { z as z30 } from "zod";
|
|
9205
9244
|
function createSlackScheduleDeleteTaskTool(context) {
|
|
9206
9245
|
return zodTool({
|
|
9246
|
+
approvalMode: "review",
|
|
9207
9247
|
annotations: {
|
|
9208
9248
|
destructiveHint: true,
|
|
9209
9249
|
idempotentHint: true,
|
|
@@ -9271,6 +9311,7 @@ function createSlackScheduleListTasksTool(context) {
|
|
|
9271
9311
|
import { z as z32 } from "zod";
|
|
9272
9312
|
function createSlackScheduleRunTaskNowTool(context) {
|
|
9273
9313
|
return zodTool({
|
|
9314
|
+
approvalMode: "review",
|
|
9274
9315
|
annotations: {
|
|
9275
9316
|
destructiveHint: false,
|
|
9276
9317
|
idempotentHint: false,
|
|
@@ -9381,6 +9422,8 @@ function createSlackScheduleUpdateTaskTool(context) {
|
|
|
9381
9422
|
}
|
|
9382
9423
|
const nextStatus = status ?? lookup.status;
|
|
9383
9424
|
const credentialMode = input.task !== void 0 && input.task !== lookup.task.text && !isCreator ? "system" : input.credential_mode ?? lookup.credentialMode;
|
|
9425
|
+
const nextInstruction = input.task !== void 0 ? input.task : lookup.task.text;
|
|
9426
|
+
const instructionChanged = nextInstruction !== lookup.task.text;
|
|
9384
9427
|
const next = {
|
|
9385
9428
|
...lookup,
|
|
9386
9429
|
credentialMode,
|
|
@@ -9390,8 +9433,17 @@ function createSlackScheduleUpdateTaskTool(context) {
|
|
|
9390
9433
|
status: nextStatus,
|
|
9391
9434
|
statusReason: nextStatus === "blocked" ? lookup.statusReason : void 0,
|
|
9392
9435
|
schedule: compiled?.schedule ?? lookup.schedule,
|
|
9393
|
-
task:
|
|
9436
|
+
task: { text: nextInstruction }
|
|
9394
9437
|
};
|
|
9438
|
+
if (instructionChanged) {
|
|
9439
|
+
const title = await generateShortTitle({
|
|
9440
|
+
completeText,
|
|
9441
|
+
kind: "task",
|
|
9442
|
+
sourceText: nextInstruction
|
|
9443
|
+
});
|
|
9444
|
+
if (title) next.title = title;
|
|
9445
|
+
else delete next.title;
|
|
9446
|
+
}
|
|
9395
9447
|
await schedulerStore(context).saveTask(next);
|
|
9396
9448
|
return scheduleTaskToolResult(
|
|
9397
9449
|
"slackScheduleUpdateTask",
|
|
@@ -9868,13 +9920,14 @@ function createOperationKey(toolName, input) {
|
|
|
9868
9920
|
// src/chat/slack/tools/message-add-reaction.ts
|
|
9869
9921
|
function createSlackMessageAddReactionTool(context, state) {
|
|
9870
9922
|
return zodTool({
|
|
9923
|
+
approvalMode: "approve",
|
|
9871
9924
|
annotations: {
|
|
9872
9925
|
destructiveHint: false,
|
|
9873
9926
|
idempotentHint: true,
|
|
9874
9927
|
openWorldHint: true,
|
|
9875
9928
|
readOnlyHint: false
|
|
9876
9929
|
},
|
|
9877
|
-
description: "Add an emoji reaction to the current inbound Slack message. Use
|
|
9930
|
+
description: "Add an emoji reaction to the current inbound Slack message. Use for explicit reaction requests and for non-text acknowledgements on the current message when no thread reply is needed. Provide a Slack emoji alias name (for example `thumbsup`, `white_check_mark`, or `thumbsup::skin-tone-6`), not a unicode emoji glyph. The target message is injected by runtime context; do not use this for arbitrary historical messages.",
|
|
9878
9931
|
inputSchema: z38.object({
|
|
9879
9932
|
emoji: z38.string().min(1).max(64).describe(
|
|
9880
9933
|
"Slack emoji alias name to react with (for example `thumbsup`, `white_check_mark`, or `thumbsup::skin-tone-6`). Optional surrounding colons are allowed."
|
|
@@ -16003,7 +16056,6 @@ ${summary}`)
|
|
|
16003
16056
|
})
|
|
16004
16057
|
}
|
|
16005
16058
|
});
|
|
16006
|
-
updateConversationStats(args.conversation);
|
|
16007
16059
|
setSpanAttributes({
|
|
16008
16060
|
"app.compaction.input_messages": sourceMessages.length,
|
|
16009
16061
|
"app.compaction.retained_messages": replacement.length - 1,
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAgentRunner,
|
|
3
3
|
executeAgentRun
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-XYJNNZYR.js";
|
|
5
|
+
import "../chunk-F6RWNJBK.js";
|
|
6
6
|
import "../chunk-DIB4GX3G.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-RABHACKG.js";
|
|
8
8
|
import "../chunk-R776HKPK.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-ANG7IWAI.js";
|
|
10
|
+
import "../chunk-WJHWOAVZ.js";
|
|
11
|
+
import "../chunk-PBV7VXUA.js";
|
|
11
12
|
import "../chunk-3Y47VMHV.js";
|
|
12
13
|
import "../chunk-HUO3UTAQ.js";
|
|
13
14
|
import "../chunk-5IDFPCON.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-AEFJN7OK.js";
|
|
16
|
+
import "../chunk-UFCA4EZB.js";
|
|
17
|
+
import "../chunk-OG5JQHKR.js";
|
|
18
|
+
import "../chunk-STX5WIH6.js";
|
|
17
19
|
import "../chunk-HLXXQI5Q.js";
|
|
18
20
|
import "../chunk-PDO5BLNM.js";
|
|
19
21
|
import "../chunk-UIE3R5XU.js";
|
|
20
22
|
import {
|
|
21
23
|
loadAppPluginSet
|
|
22
24
|
} from "../chunk-Y2CM7HXH.js";
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-SNBTWIQO.js";
|
|
26
|
+
import "../chunk-I25V3XRN.js";
|
|
27
|
+
import "../chunk-NAINBOZQ.js";
|
|
28
|
+
import "../chunk-2KLMGRRQ.js";
|
|
27
29
|
import "../chunk-EM225ITJ.js";
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-M2T7MHQJ.js";
|
|
31
|
+
import "../chunk-7GVX5SOG.js";
|
|
30
32
|
import "../chunk-VFUK3X5B.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-5YJBS4I5.js";
|
|
34
|
+
import "../chunk-U5ATCOHE.js";
|
|
35
|
+
import "../chunk-NVFVM67W.js";
|
|
36
|
+
import "../chunk-BJ6ISBOA.js";
|
|
35
37
|
import "../chunk-RUIXF3YQ.js";
|
|
36
38
|
import "../chunk-HZF5P5UN.js";
|
|
37
39
|
import "../chunk-F3B2YJ76.js";
|
|
38
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-GZRWULXF.js";
|
|
39
41
|
import "../chunk-6GWA276C.js";
|
|
40
42
|
import "../chunk-OOUNJNMR.js";
|
|
41
43
|
import "../chunk-H4HBKISO.js";
|
|
42
|
-
import "../chunk-
|
|
43
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-WSWVWP2V.js";
|
|
45
|
+
import "../chunk-OB7ZJK7Y.js";
|
|
44
46
|
import "../chunk-MLKGABMK.js";
|
|
45
47
|
|
|
46
48
|
// src/cli/chat.ts
|
|
@@ -163,10 +165,10 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
163
165
|
databaseModule
|
|
164
166
|
] = await Promise.all([
|
|
165
167
|
import("../plugins-HW4VWW6G.js"),
|
|
166
|
-
import("../agent-hooks-
|
|
167
|
-
import("../catalog-runtime-
|
|
168
|
-
import("../validation-
|
|
169
|
-
import("../db-
|
|
168
|
+
import("../agent-hooks-2EP3QS47.js"),
|
|
169
|
+
import("../catalog-runtime-IAVW4W3B.js"),
|
|
170
|
+
import("../validation-556WSWVU.js"),
|
|
171
|
+
import("../db-RBXBVEVO.js")
|
|
170
172
|
]);
|
|
171
173
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
172
174
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -232,14 +234,14 @@ async function prepareLocalChatRun(io, pluginSet) {
|
|
|
232
234
|
await configureLocalChatPlugins(pluginSet);
|
|
233
235
|
const { setExperimentalFeatures } = await import("../experimental-HH6OM6UH.js");
|
|
234
236
|
setExperimentalFeatures({ subagents: true });
|
|
235
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
236
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
237
|
+
const { runLocalAgentTurn } = await import("../runner-WK5VUOW6.js");
|
|
238
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-LRB6BX6C.js");
|
|
237
239
|
const { createLocalOAuthState } = await import("../oauth-relay-3ZU72UGL.js");
|
|
238
240
|
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-EKPAVWQL.js");
|
|
239
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
240
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
241
|
+
const { bindSpawnAgent } = await import("../spawn-ZCW6UOAA.js");
|
|
242
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-W6IXSPY3.js");
|
|
241
243
|
const { createLocalConversationWork } = await import("../conversation-work-KATFHLG3.js");
|
|
242
|
-
const { processConversationWork } = await import("../worker-
|
|
244
|
+
const { processConversationWork } = await import("../worker-5KM346HH.js");
|
|
243
245
|
let agentRunner;
|
|
244
246
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
245
247
|
if (!agentRunner) {
|
package/dist/cli/check.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSkillFile
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-U5ATCOHE.js";
|
|
4
|
+
import "../chunk-NVFVM67W.js";
|
|
5
5
|
import {
|
|
6
6
|
parseInlinePluginManifest,
|
|
7
7
|
parsePluginManifest
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-BJ6ISBOA.js";
|
|
9
9
|
import "../chunk-RUIXF3YQ.js";
|
|
10
10
|
import "../chunk-HZF5P5UN.js";
|
|
11
11
|
import "../chunk-F3B2YJ76.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-GZRWULXF.js";
|
|
13
13
|
import "../chunk-6GWA276C.js";
|
|
14
14
|
import "../chunk-OOUNJNMR.js";
|
|
15
15
|
import "../chunk-H4HBKISO.js";
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
|
|
18
18
|
JUNIOR_HEARTBEAT_ROUTE,
|
|
19
19
|
LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-WSWVWP2V.js";
|
|
21
|
+
import "../chunk-OB7ZJK7Y.js";
|
|
22
22
|
import "../chunk-MLKGABMK.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/check.ts
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validatePluginEgressCredentialHooks,
|
|
3
3
|
validatePluginRegistrations
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-TPJK6AVJ.js";
|
|
5
5
|
import {
|
|
6
6
|
pluginCatalogConfigFromPluginSet,
|
|
7
7
|
pluginCliRegistrationsFromPluginSet,
|
|
@@ -14,30 +14,30 @@ import {
|
|
|
14
14
|
createPluginLogger,
|
|
15
15
|
setPlugins,
|
|
16
16
|
validatePlugins
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import "../chunk-
|
|
17
|
+
} from "../chunk-SNBTWIQO.js";
|
|
18
|
+
import "../chunk-I25V3XRN.js";
|
|
19
19
|
import {
|
|
20
20
|
getDb
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-NAINBOZQ.js";
|
|
22
|
+
import "../chunk-2KLMGRRQ.js";
|
|
23
23
|
import "../chunk-EM225ITJ.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-M2T7MHQJ.js";
|
|
25
|
+
import "../chunk-7GVX5SOG.js";
|
|
26
26
|
import "../chunk-VFUK3X5B.js";
|
|
27
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-5YJBS4I5.js";
|
|
28
28
|
import {
|
|
29
29
|
pluginCatalogRuntime
|
|
30
|
-
} from "../chunk-
|
|
31
|
-
import "../chunk-
|
|
30
|
+
} from "../chunk-NVFVM67W.js";
|
|
31
|
+
import "../chunk-BJ6ISBOA.js";
|
|
32
32
|
import "../chunk-RUIXF3YQ.js";
|
|
33
33
|
import "../chunk-HZF5P5UN.js";
|
|
34
34
|
import "../chunk-F3B2YJ76.js";
|
|
35
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-GZRWULXF.js";
|
|
36
36
|
import "../chunk-6GWA276C.js";
|
|
37
37
|
import "../chunk-OOUNJNMR.js";
|
|
38
38
|
import "../chunk-H4HBKISO.js";
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
39
|
+
import "../chunk-WSWVWP2V.js";
|
|
40
|
+
import "../chunk-OB7ZJK7Y.js";
|
|
41
41
|
import "../chunk-MLKGABMK.js";
|
|
42
42
|
|
|
43
43
|
// src/cli/plugins.ts
|