@sentry/junior 0.128.0 → 0.129.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-F75ANGBV.js → agent-hooks-ZM4WMZCN.js} +9 -9
- package/dist/api/schema/task.d.ts +152 -0
- package/dist/api/schema.d.ts +2 -0
- package/dist/api/schema.js +13 -3
- package/dist/api/tasks/routes.d.ts +4 -0
- package/dist/api.js +425 -23
- package/dist/app.d.ts +2 -1
- package/dist/app.js +315 -27
- package/dist/{catalog-runtime-ZPSA5QM2.js → catalog-runtime-TN2GPVEI.js} +5 -5
- package/dist/chat/agent-dispatch/context.d.ts +18 -0
- package/dist/chat/event-tasks/store.d.ts +7 -1
- package/dist/chat/event-tasks/tool-support.d.ts +1 -0
- package/dist/chat/resource-events/runtime-catalog.d.ts +3 -0
- package/dist/chat/sandbox/resources.d.ts +12 -1
- package/dist/chat/scheduled-tasks/cadence.d.ts +27 -0
- package/dist/chat/scheduled-tasks/heartbeat.d.ts +6 -0
- package/dist/chat/scheduled-tasks/identity.d.ts +6 -0
- package/dist/chat/scheduled-tasks/personal.d.ts +26 -0
- package/dist/chat/scheduled-tasks/schedule-intent.d.ts +61 -0
- package/dist/chat/scheduled-tasks/store.d.ts +77 -0
- package/dist/chat/scheduled-tasks/tool-support.d.ts +203 -0
- package/dist/chat/scheduled-tasks/tools/create.d.ts +80 -0
- package/dist/chat/scheduled-tasks/tools/delete.d.ts +56 -0
- package/dist/chat/scheduled-tasks/tools/list.d.ts +54 -0
- package/dist/chat/scheduled-tasks/tools/run-now.d.ts +56 -0
- package/dist/chat/scheduled-tasks/tools/update.d.ts +82 -0
- package/dist/chat/scheduled-tasks/tools.d.ts +6 -0
- package/dist/chat/scheduled-tasks/types.d.ts +81 -0
- package/dist/chat/tasks/read.d.ts +9 -0
- package/dist/chat/tools/scheduled-tasks.d.ts +4 -0
- package/dist/{chunk-K5ZB3WWH.js → chunk-2BCQKJTX.js} +2 -2
- package/dist/{chunk-G6XQODHM.js → chunk-3N4MWF3R.js} +1 -1
- package/dist/{chunk-NHWE6Y7G.js → chunk-6CMYU62S.js} +7 -7
- package/dist/{chunk-YY6CVET7.js → chunk-6QQOLIJJ.js} +1308 -804
- package/dist/{chunk-WZ365SQC.js → chunk-A6QQPVSH.js} +1 -1
- package/dist/chunk-BDIEEZK7.js +1470 -0
- package/dist/{chunk-AFJF3RGU.js → chunk-BVKP37NE.js} +61 -13
- package/dist/{chunk-5KKIBIIP.js → chunk-CZJUBH6O.js} +12 -12
- package/dist/{chunk-OLGB5Y7R.js → chunk-CZQ2DSQZ.js} +1 -1
- package/dist/{chunk-3PKF6YNU.js → chunk-E4UCPRYL.js} +1 -1
- package/dist/{chunk-KNRODVH2.js → chunk-ESYXDXNX.js} +6 -6
- package/dist/{chunk-Z4KTQMWW.js → chunk-GPWHBHAG.js} +1 -1
- package/dist/{chunk-JDCPDJ54.js → chunk-GURSWCI4.js} +2 -2
- package/dist/{chunk-RYWMDDWK.js → chunk-K3U5447S.js} +1 -1
- package/dist/{chunk-SHMHHXD5.js → chunk-KB2M27DL.js} +58 -0
- package/dist/{chunk-PBWUUVVG.js → chunk-LV2BQ26V.js} +1 -1
- package/dist/{chunk-KTGJAWRO.js → chunk-NNRV4T2C.js} +1 -2
- package/dist/{chunk-B6E3YA2H.js → chunk-P6I7LFKC.js} +1 -1
- package/dist/{chunk-B7FPRGUJ.js → chunk-PQFNTLZI.js} +3 -3
- package/dist/{chunk-A76LKS5W.js → chunk-QAOA4GUG.js} +5 -5
- package/dist/{chunk-BY43CEXN.js → chunk-R62DRNKB.js} +2 -2
- package/dist/{chunk-HBFQLSGV.js → chunk-U23X4ASF.js} +4 -4
- package/dist/{chunk-2HTHX6XV.js → chunk-XENYUOZG.js} +38 -17
- package/dist/cli/chat.js +24 -24
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +9 -17
- package/dist/db/schema/scheduled-tasks.d.ts +257 -0
- package/dist/db/schema.d.ts +258 -1
- package/dist/{db-FYJYPAKG.js → db-ZI6TBXIS.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-W3PPIHCS.js → oauth-callback-server-TLA4GARF.js} +17 -17
- package/dist/{runner-5NOFUYKR.js → runner-23YFRWQJ.js} +11 -11
- package/dist/{skills-ENIBKF5V.js → skills-QIUG4D6M.js} +6 -6
- package/dist/{validation-BHLBOO6K.js → validation-3KGEBATS.js} +6 -6
- package/dist/version.js +1 -1
- package/migrations/0016_neat_the_anarchist.sql +171 -0
- package/migrations/meta/0016_snapshot.json +1617 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -6
- package/dist/chunk-FJEIX3AH.js +0 -37
|
@@ -589,20 +589,63 @@ var createdPersonalTokenSchema = personalTokenMetadataSchema.extend({ token: z6.
|
|
|
589
589
|
var personalTokenParamsSchema = z6.object({ id: z6.string().uuid() }).strict();
|
|
590
590
|
var revokePersonalTokenResponseSchema = z6.object({ revoked: z6.literal(true) }).strict();
|
|
591
591
|
|
|
592
|
-
// src/api/schema/
|
|
592
|
+
// src/api/schema/task.ts
|
|
593
593
|
import { z as z7 } from "zod";
|
|
594
|
-
var
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
594
|
+
var taskDestinationSchema = z7.object({
|
|
595
|
+
channelId: z7.string().min(1),
|
|
596
|
+
label: z7.string().min(1),
|
|
597
|
+
teamId: z7.string().min(1),
|
|
598
|
+
visibility: z7.enum(["private", "public"])
|
|
599
|
+
}).strict();
|
|
600
|
+
var taskSummaryBaseSchema = z7.object({
|
|
601
|
+
createdAt: z7.string().datetime(),
|
|
602
|
+
createdBy: z7.string().min(1),
|
|
603
|
+
createdByEmail: z7.string().trim().email().optional(),
|
|
604
|
+
destination: taskDestinationSchema,
|
|
605
|
+
id: z7.string().min(1),
|
|
606
|
+
instruction: z7.string().min(1),
|
|
607
|
+
ownedByViewer: z7.boolean()
|
|
608
|
+
});
|
|
609
|
+
var scheduledTaskSummarySchema = taskSummaryBaseSchema.extend({
|
|
610
|
+
kind: z7.literal("scheduled"),
|
|
611
|
+
nextRunAt: z7.string().datetime().optional(),
|
|
612
|
+
schedule: z7.string().min(1),
|
|
613
|
+
status: z7.enum(["active", "paused", "blocked"])
|
|
614
|
+
}).strict();
|
|
615
|
+
var eventTaskSummarySchema = taskSummaryBaseSchema.extend({
|
|
616
|
+
events: z7.array(z7.string().min(1)).min(1),
|
|
617
|
+
kind: z7.literal("event"),
|
|
618
|
+
resource: z7.string().min(1),
|
|
619
|
+
source: z7.string().min(1),
|
|
620
|
+
triggerAvailable: z7.boolean()
|
|
621
|
+
}).strict();
|
|
622
|
+
var taskSummarySchema = z7.discriminatedUnion("kind", [
|
|
623
|
+
scheduledTaskSummarySchema,
|
|
624
|
+
eventTaskSummarySchema
|
|
625
|
+
]);
|
|
626
|
+
var taskListSchema = z7.object({
|
|
627
|
+
tasks: z7.array(taskSummarySchema),
|
|
628
|
+
truncated: z7.boolean()
|
|
629
|
+
}).strict();
|
|
630
|
+
var taskParamsSchema = z7.object({
|
|
631
|
+
id: z7.string().min(1),
|
|
632
|
+
kind: z7.enum(["scheduled", "event"])
|
|
633
|
+
}).strict();
|
|
634
|
+
|
|
635
|
+
// src/api/schema/stats.ts
|
|
636
|
+
import { z as z8 } from "zod";
|
|
637
|
+
var statSchema = z8.object({
|
|
638
|
+
count: z8.number().int().nonnegative(),
|
|
639
|
+
date: z8.string(),
|
|
640
|
+
metric: z8.string().min(1),
|
|
641
|
+
name: z8.string().min(1),
|
|
642
|
+
namespace: z8.string().min(1)
|
|
643
|
+
}).strict();
|
|
644
|
+
var statsReportSchema = z8.object({
|
|
645
|
+
generatedAt: z8.string().datetime(),
|
|
646
|
+
stats: z8.array(statSchema),
|
|
647
|
+
windowEnd: z8.string(),
|
|
648
|
+
windowStart: z8.string()
|
|
606
649
|
}).strict();
|
|
607
650
|
|
|
608
651
|
export {
|
|
@@ -638,6 +681,11 @@ export {
|
|
|
638
681
|
createdPersonalTokenSchema,
|
|
639
682
|
personalTokenParamsSchema,
|
|
640
683
|
revokePersonalTokenResponseSchema,
|
|
684
|
+
scheduledTaskSummarySchema,
|
|
685
|
+
eventTaskSummarySchema,
|
|
686
|
+
taskSummarySchema,
|
|
687
|
+
taskListSchema,
|
|
688
|
+
taskParamsSchema,
|
|
641
689
|
statSchema,
|
|
642
690
|
statsReportSchema
|
|
643
691
|
};
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
persistAuthPauseTurnState,
|
|
14
14
|
requireTurnFailureEventId,
|
|
15
15
|
scheduleSessionCompletedPluginTasks
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ESYXDXNX.js";
|
|
17
17
|
import {
|
|
18
18
|
buildSentryConversationUrl
|
|
19
19
|
} from "./chunk-4CODA7P5.js";
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
resolveBaseUrl,
|
|
41
41
|
resolvePluginOAuthAccount,
|
|
42
42
|
truncateStatusText
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-6CMYU62S.js";
|
|
44
44
|
import {
|
|
45
45
|
JUNIOR_THREAD_STATE_TTL_MS,
|
|
46
46
|
TurnSliceLimitExceededError,
|
|
@@ -73,13 +73,13 @@ import {
|
|
|
73
73
|
recordDeliveredAssistantMessage,
|
|
74
74
|
turnHasReply,
|
|
75
75
|
updateConversationStats
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-U23X4ASF.js";
|
|
77
77
|
import {
|
|
78
78
|
parseSlackThreadId,
|
|
79
79
|
readSlackRawMessageContext,
|
|
80
80
|
resolveSlackChannelIdFromMessage,
|
|
81
81
|
resolveSlackChannelIdFromThreadId
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-LV2BQ26V.js";
|
|
83
83
|
import {
|
|
84
84
|
SlackActionError,
|
|
85
85
|
getDashboardConversationLink,
|
|
@@ -88,19 +88,19 @@ import {
|
|
|
88
88
|
getSlackClient,
|
|
89
89
|
isDmChannel,
|
|
90
90
|
normalizeSlackConversationId
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-QAOA4GUG.js";
|
|
92
92
|
import {
|
|
93
93
|
getConversationEventStore,
|
|
94
94
|
getConversationStore,
|
|
95
95
|
parseDestination,
|
|
96
96
|
requireSlackDestination,
|
|
97
97
|
sameDestination
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-PQFNTLZI.js";
|
|
99
99
|
import {
|
|
100
100
|
acquireActiveLock,
|
|
101
101
|
getDefaultRedisStateAdapterFor,
|
|
102
102
|
getStateAdapter
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-3N4MWF3R.js";
|
|
104
104
|
import {
|
|
105
105
|
FUNCTION_TIMEOUT_BUFFER_SECONDS,
|
|
106
106
|
botConfig,
|
|
@@ -109,18 +109,18 @@ import {
|
|
|
109
109
|
getRuntimeMetadata,
|
|
110
110
|
normalizeSlackEmojiName,
|
|
111
111
|
standardModelId
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-2BCQKJTX.js";
|
|
113
113
|
import {
|
|
114
114
|
discoverSkills
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-R62DRNKB.js";
|
|
116
116
|
import {
|
|
117
117
|
pluginCatalogRuntime
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-A6QQPVSH.js";
|
|
119
119
|
import {
|
|
120
120
|
buildOAuthTokenRequest,
|
|
121
121
|
hasRequiredOAuthScope,
|
|
122
122
|
parseOAuthTokenResponse
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-CZQ2DSQZ.js";
|
|
124
124
|
import {
|
|
125
125
|
createSlackResumeActor,
|
|
126
126
|
isUserActor,
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
toOptionalNumber,
|
|
140
140
|
toOptionalString,
|
|
141
141
|
withLogContext
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-P6I7LFKC.js";
|
|
143
143
|
import {
|
|
144
144
|
homeDir
|
|
145
145
|
} from "./chunk-H4HBKISO.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
persistThreadStateById,
|
|
23
23
|
stripRuntimeTurnContext,
|
|
24
24
|
updateConversationStats
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-U23X4ASF.js";
|
|
26
26
|
import {
|
|
27
27
|
createPluginConversationEvents,
|
|
28
28
|
createPluginEmbedder,
|
|
@@ -30,26 +30,26 @@ import {
|
|
|
30
30
|
createPluginModel,
|
|
31
31
|
createPluginState,
|
|
32
32
|
getPlugins
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-QAOA4GUG.js";
|
|
34
34
|
import {
|
|
35
35
|
getDb,
|
|
36
36
|
sameActorIdentity
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-PQFNTLZI.js";
|
|
38
38
|
import {
|
|
39
39
|
getStateAdapter
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-3N4MWF3R.js";
|
|
41
41
|
import {
|
|
42
42
|
ProviderError,
|
|
43
43
|
findProviderError,
|
|
44
44
|
getProviderErrorAttributes,
|
|
45
45
|
getProviderErrorUserMessage
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-2BCQKJTX.js";
|
|
47
47
|
import {
|
|
48
48
|
parseSlackMessageTs
|
|
49
49
|
} from "./chunk-F3B2YJ76.js";
|
|
50
50
|
import {
|
|
51
51
|
buildTurnFailureResponse
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-P6I7LFKC.js";
|
|
53
53
|
|
|
54
54
|
// src/chat/runtime/delivered-turn-state.ts
|
|
55
55
|
function buildDeliveredTurnStatePatch(args) {
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-UTL3MHPC.js";
|
|
4
4
|
import {
|
|
5
5
|
parseSlackThreadId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LV2BQ26V.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeSlackConversationId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QAOA4GUG.js";
|
|
10
10
|
|
|
11
11
|
// src/handlers/health.ts
|
|
12
12
|
function readHealthReport() {
|
|
@@ -320,6 +320,60 @@ var juniorStats = pgTable8(
|
|
|
320
320
|
]
|
|
321
321
|
);
|
|
322
322
|
|
|
323
|
+
// src/db/schema/scheduled-tasks.ts
|
|
324
|
+
import { sql as sql4 } from "drizzle-orm";
|
|
325
|
+
import { bigint as bigint2, index as index6, jsonb as jsonb6, pgTable as pgTable9, text as text9 } from "drizzle-orm/pg-core";
|
|
326
|
+
var juniorSchedulerTasks = pgTable9(
|
|
327
|
+
"junior_scheduler_tasks",
|
|
328
|
+
{
|
|
329
|
+
id: text9("id").primaryKey(),
|
|
330
|
+
teamId: text9("team_id").notNull(),
|
|
331
|
+
// TODO(v0.128.0): Remove after v0.127.x runtimes no longer write this column.
|
|
332
|
+
creatorSlackUserId: text9("creator_slack_user_id"),
|
|
333
|
+
creatorIdentityId: text9("creator_identity_id"),
|
|
334
|
+
status: text9("status").notNull(),
|
|
335
|
+
nextRunAtMs: bigint2("next_run_at_ms", { mode: "number" }),
|
|
336
|
+
runNowAtMs: bigint2("run_now_at_ms", { mode: "number" }),
|
|
337
|
+
createdAtMs: bigint2("created_at_ms", { mode: "number" }).notNull(),
|
|
338
|
+
record: jsonb6("record").$type().notNull()
|
|
339
|
+
},
|
|
340
|
+
(table) => [
|
|
341
|
+
// TODO(v0.128.0): Remove with creatorSlackUserId.
|
|
342
|
+
index6("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql4`${table.status} <> 'deleted'`),
|
|
343
|
+
index6("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(
|
|
344
|
+
sql4`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`
|
|
345
|
+
),
|
|
346
|
+
index6("junior_scheduler_tasks_team_status_idx").on(table.teamId, table.createdAtMs, table.id).where(sql4`${table.status} <> 'deleted'`),
|
|
347
|
+
index6("junior_scheduler_tasks_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(
|
|
348
|
+
sql4`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`
|
|
349
|
+
),
|
|
350
|
+
index6("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
|
|
351
|
+
sql4`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`
|
|
352
|
+
)
|
|
353
|
+
]
|
|
354
|
+
);
|
|
355
|
+
var juniorSchedulerRuns = pgTable9(
|
|
356
|
+
"junior_scheduler_runs",
|
|
357
|
+
{
|
|
358
|
+
id: text9("id").primaryKey(),
|
|
359
|
+
taskId: text9("task_id").notNull(),
|
|
360
|
+
status: text9("status").notNull(),
|
|
361
|
+
scheduledForMs: bigint2("scheduled_for_ms", { mode: "number" }).notNull(),
|
|
362
|
+
record: jsonb6("record").$type().notNull()
|
|
363
|
+
},
|
|
364
|
+
(table) => [
|
|
365
|
+
index6("junior_scheduler_runs_task_status_idx").on(
|
|
366
|
+
table.taskId,
|
|
367
|
+
table.status,
|
|
368
|
+
table.scheduledForMs
|
|
369
|
+
),
|
|
370
|
+
index6("junior_scheduler_runs_status_idx").on(
|
|
371
|
+
table.status,
|
|
372
|
+
table.scheduledForMs
|
|
373
|
+
)
|
|
374
|
+
]
|
|
375
|
+
);
|
|
376
|
+
|
|
323
377
|
// src/db/schema.ts
|
|
324
378
|
var juniorSqlSchema = {
|
|
325
379
|
juniorConversationAnnotations,
|
|
@@ -330,6 +384,8 @@ var juniorSqlSchema = {
|
|
|
330
384
|
juniorEventTasks,
|
|
331
385
|
juniorIdentities,
|
|
332
386
|
juniorStats,
|
|
387
|
+
juniorSchedulerRuns,
|
|
388
|
+
juniorSchedulerTasks,
|
|
333
389
|
juniorUsers
|
|
334
390
|
};
|
|
335
391
|
|
|
@@ -582,5 +638,7 @@ export {
|
|
|
582
638
|
juniorConversationEvents,
|
|
583
639
|
juniorEventTasks,
|
|
584
640
|
juniorStats,
|
|
641
|
+
juniorSchedulerTasks,
|
|
642
|
+
juniorSchedulerRuns,
|
|
585
643
|
createJuniorSqlExecutor
|
|
586
644
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@sentry/junior",
|
|
4
|
-
version: "0.
|
|
4
|
+
version: "0.129.0",
|
|
5
5
|
private: false,
|
|
6
6
|
publishConfig: {
|
|
7
7
|
access: "public"
|
|
@@ -101,7 +101,6 @@ var package_default = {
|
|
|
101
101
|
"@emnapi/runtime": "^1.10.0",
|
|
102
102
|
"@sentry/junior-github": "workspace:*",
|
|
103
103
|
"@sentry/junior-memory": "workspace:*",
|
|
104
|
-
"@sentry/junior-scheduler": "workspace:*",
|
|
105
104
|
"@sentry/junior-testing": "workspace:*",
|
|
106
105
|
"@types/node": "^25.9.1",
|
|
107
106
|
"@types/pg": "^8.15.6",
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
juniorConversations,
|
|
5
5
|
juniorIdentities,
|
|
6
6
|
juniorUsers
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KB2M27DL.js";
|
|
8
8
|
import {
|
|
9
9
|
TURN_REASONING_LEVELS,
|
|
10
10
|
getChatConfig,
|
|
11
11
|
modelProfileSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2BCQKJTX.js";
|
|
13
13
|
import {
|
|
14
14
|
juniorDestinations
|
|
15
15
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-F3B2YJ76.js";
|
|
20
20
|
import {
|
|
21
21
|
normalizeIdentityEmail
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-P6I7LFKC.js";
|
|
23
23
|
|
|
24
24
|
// src/chat/conversations/sql/store.ts
|
|
25
25
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConversationEventStore,
|
|
3
3
|
getDb
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PQFNTLZI.js";
|
|
5
5
|
import {
|
|
6
6
|
juniorConversationAnnotations,
|
|
7
7
|
juniorConversationEvents,
|
|
8
8
|
juniorIdentities,
|
|
9
9
|
juniorUsers
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KB2M27DL.js";
|
|
11
11
|
import {
|
|
12
12
|
SANDBOX_WORKSPACE_ROOT,
|
|
13
13
|
getStateAdapter,
|
|
14
14
|
sleep
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3N4MWF3R.js";
|
|
16
16
|
import {
|
|
17
17
|
botConfig,
|
|
18
18
|
completeObject,
|
|
19
19
|
embedTexts,
|
|
20
20
|
getSlackBotToken,
|
|
21
21
|
standardModelId
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-2BCQKJTX.js";
|
|
23
23
|
import {
|
|
24
24
|
isActorUserId,
|
|
25
25
|
parseActorUserId
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
setSpanAttributes,
|
|
38
38
|
setSpanStatus,
|
|
39
39
|
withSpan
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-P6I7LFKC.js";
|
|
41
41
|
|
|
42
42
|
// src/chat/plugins/agent-hooks.ts
|
|
43
43
|
import {
|
|
@@ -16,17 +16,17 @@ import {
|
|
|
16
16
|
instructionProvenanceFor,
|
|
17
17
|
sanitizePostgresJson,
|
|
18
18
|
withConversationEventLock
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PQFNTLZI.js";
|
|
20
20
|
import {
|
|
21
21
|
getStateAdapter,
|
|
22
22
|
sleep
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-3N4MWF3R.js";
|
|
24
24
|
import {
|
|
25
25
|
botConfig,
|
|
26
26
|
escapeXml,
|
|
27
27
|
resolveGatewayModel,
|
|
28
28
|
unwrapCurrentInstruction
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-2BCQKJTX.js";
|
|
30
30
|
import {
|
|
31
31
|
toStoredSlackActor
|
|
32
32
|
} from "./chunk-HZF5P5UN.js";
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
setSpanAttributes,
|
|
42
42
|
toOptionalNumber,
|
|
43
43
|
toOptionalString
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-P6I7LFKC.js";
|
|
45
45
|
|
|
46
46
|
// src/chat/turn-context-tag.ts
|
|
47
47
|
var TURN_CONTEXT_TAG = "runtime-turn-context";
|
|
@@ -2,18 +2,50 @@ import {
|
|
|
2
2
|
SANDBOX_WORKSPACE_ROOT,
|
|
3
3
|
getStateAdapter,
|
|
4
4
|
sleep
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3N4MWF3R.js";
|
|
6
6
|
import {
|
|
7
7
|
toOptionalTrimmed
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2BCQKJTX.js";
|
|
9
9
|
import {
|
|
10
10
|
pluginCatalogRuntime
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-A6QQPVSH.js";
|
|
12
12
|
import {
|
|
13
13
|
setSpanAttributes,
|
|
14
14
|
setSpanStatus,
|
|
15
15
|
withSpan
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-P6I7LFKC.js";
|
|
17
|
+
|
|
18
|
+
// src/chat/sandbox/resources.ts
|
|
19
|
+
var configuredResources;
|
|
20
|
+
function resourcesFromEnv() {
|
|
21
|
+
const value = process.env.SANDBOX_VCPUS?.trim();
|
|
22
|
+
if (!value || !/^\d+$/.test(value)) {
|
|
23
|
+
return void 0;
|
|
24
|
+
}
|
|
25
|
+
const vcpus = Number(value);
|
|
26
|
+
if (!Number.isSafeInteger(vcpus) || vcpus <= 0) {
|
|
27
|
+
return void 0;
|
|
28
|
+
}
|
|
29
|
+
return { vcpus };
|
|
30
|
+
}
|
|
31
|
+
function getSandboxResourceConfig() {
|
|
32
|
+
return configuredResources;
|
|
33
|
+
}
|
|
34
|
+
function setSandboxResourceConfig(config) {
|
|
35
|
+
const previous = configuredResources;
|
|
36
|
+
if (config?.vcpus === void 0) {
|
|
37
|
+
configuredResources = void 0;
|
|
38
|
+
return previous;
|
|
39
|
+
}
|
|
40
|
+
if (!Number.isSafeInteger(config.vcpus) || config.vcpus <= 0) {
|
|
41
|
+
throw new Error("sandbox.vcpus must be a positive integer");
|
|
42
|
+
}
|
|
43
|
+
configuredResources = { vcpus: config.vcpus };
|
|
44
|
+
return previous;
|
|
45
|
+
}
|
|
46
|
+
function getSandboxResources() {
|
|
47
|
+
return configuredResources ?? resourcesFromEnv();
|
|
48
|
+
}
|
|
17
49
|
|
|
18
50
|
// src/chat/sandbox/snapshot/profile.ts
|
|
19
51
|
import { createHash } from "crypto";
|
|
@@ -119,19 +151,6 @@ function getVercelSandboxCredentials() {
|
|
|
119
151
|
return void 0;
|
|
120
152
|
}
|
|
121
153
|
|
|
122
|
-
// src/chat/sandbox/resources.ts
|
|
123
|
-
function getSandboxResources() {
|
|
124
|
-
const value = process.env.SANDBOX_VCPUS?.trim();
|
|
125
|
-
if (!value || !/^\d+$/.test(value)) {
|
|
126
|
-
return void 0;
|
|
127
|
-
}
|
|
128
|
-
const vcpus = Number(value);
|
|
129
|
-
if (!Number.isSafeInteger(vcpus) || vcpus <= 0) {
|
|
130
|
-
return void 0;
|
|
131
|
-
}
|
|
132
|
-
return { vcpus };
|
|
133
|
-
}
|
|
134
|
-
|
|
135
154
|
// src/chat/sandbox/noninteractive-command.ts
|
|
136
155
|
var NON_INTERACTIVE_ENV = {
|
|
137
156
|
CI: "1",
|
|
@@ -1031,6 +1050,8 @@ export {
|
|
|
1031
1050
|
getVercelSandboxCredentials,
|
|
1032
1051
|
buildNonInteractiveShellScript,
|
|
1033
1052
|
runNonInteractiveCommand,
|
|
1053
|
+
getSandboxResourceConfig,
|
|
1054
|
+
setSandboxResourceConfig,
|
|
1034
1055
|
getSandboxResources,
|
|
1035
1056
|
create,
|
|
1036
1057
|
hash,
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAgentRunner,
|
|
3
3
|
executeAgentRun
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-6QQOLIJJ.js";
|
|
5
5
|
import "../chunk-DIB4GX3G.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-6CMYU62S.js";
|
|
7
|
+
import "../chunk-U23X4ASF.js";
|
|
8
8
|
import "../chunk-EPBBYMNE.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-XENYUOZG.js";
|
|
10
|
+
import "../chunk-BDIEEZK7.js";
|
|
11
|
+
import "../chunk-LV2BQ26V.js";
|
|
12
12
|
import "../chunk-HX236W2U.js";
|
|
13
13
|
import "../chunk-PDO5BLNM.js";
|
|
14
14
|
import "../chunk-UIE3R5XU.js";
|
|
15
15
|
import {
|
|
16
16
|
loadAppPluginSet
|
|
17
17
|
} from "../chunk-Y2CM7HXH.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-QAOA4GUG.js";
|
|
19
|
+
import "../chunk-PQFNTLZI.js";
|
|
20
|
+
import "../chunk-KB2M27DL.js";
|
|
21
|
+
import "../chunk-3N4MWF3R.js";
|
|
22
|
+
import "../chunk-2BCQKJTX.js";
|
|
23
23
|
import "../chunk-VFUK3X5B.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-GPWHBHAG.js";
|
|
25
|
+
import "../chunk-R62DRNKB.js";
|
|
26
|
+
import "../chunk-A6QQPVSH.js";
|
|
27
|
+
import "../chunk-CZQ2DSQZ.js";
|
|
28
28
|
import "../chunk-77VDLF3Z.js";
|
|
29
29
|
import "../chunk-HZF5P5UN.js";
|
|
30
30
|
import "../chunk-F3B2YJ76.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-P6I7LFKC.js";
|
|
32
32
|
import "../chunk-6GWA276C.js";
|
|
33
33
|
import "../chunk-OOUNJNMR.js";
|
|
34
34
|
import "../chunk-H4HBKISO.js";
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-K3U5447S.js";
|
|
36
|
+
import "../chunk-NNRV4T2C.js";
|
|
37
37
|
import "../chunk-MLKGABMK.js";
|
|
38
38
|
|
|
39
39
|
// src/cli/chat.ts
|
|
@@ -156,10 +156,10 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
156
156
|
databaseModule
|
|
157
157
|
] = await Promise.all([
|
|
158
158
|
import("../plugins-HW4VWW6G.js"),
|
|
159
|
-
import("../agent-hooks-
|
|
160
|
-
import("../catalog-runtime-
|
|
161
|
-
import("../validation-
|
|
162
|
-
import("../db-
|
|
159
|
+
import("../agent-hooks-ZM4WMZCN.js"),
|
|
160
|
+
import("../catalog-runtime-TN2GPVEI.js"),
|
|
161
|
+
import("../validation-3KGEBATS.js"),
|
|
162
|
+
import("../db-ZI6TBXIS.js")
|
|
163
163
|
]);
|
|
164
164
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
165
165
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -223,8 +223,8 @@ function localDevServerUrl() {
|
|
|
223
223
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
224
224
|
defaultStateAdapterForLocalChat();
|
|
225
225
|
await configureLocalChatPlugins(pluginSet);
|
|
226
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
227
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
226
|
+
const { runLocalAgentTurn } = await import("../runner-23YFRWQJ.js");
|
|
227
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-TLA4GARF.js");
|
|
228
228
|
const { createLocalOAuthState } = await import("../oauth-relay-3ZU72UGL.js");
|
|
229
229
|
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-A5HWIQH4.js");
|
|
230
230
|
const agentRunner = createAgentRunner(executeAgentRun);
|