@sentry/junior 0.133.0 → 0.135.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-5BUIXVIX.js → agent-hooks-EMXDAD2K.js} +9 -9
- package/dist/api/schema/task.d.ts +36 -0
- package/dist/api/schema.d.ts +1 -1
- package/dist/api/schema.js +1 -1
- package/dist/api.js +39 -20
- package/dist/app.js +46 -24
- package/dist/{catalog-runtime-VGB3DWXZ.js → catalog-runtime-NVPT6HA5.js} +5 -5
- package/dist/chat/agent/prompt.d.ts +7 -5
- package/dist/chat/agent/repository-context.d.ts +20 -0
- package/dist/chat/agent/sandbox.d.ts +8 -0
- package/dist/chat/agent/tools.d.ts +3 -0
- package/dist/chat/plugins/agent-hooks.d.ts +2 -2
- package/dist/chat/repository-instructions.d.ts +44 -0
- package/dist/chat/sandbox/noninteractive-command.d.ts +2 -0
- package/dist/chat/sandbox/sandbox.d.ts +3 -0
- package/dist/chat/sandbox/session.d.ts +1 -0
- package/dist/chat/services/context-compaction.d.ts +1 -0
- package/dist/chat/slack/tools/user-lookup.d.ts +2 -6
- package/dist/chat/tasks/execution-stats.d.ts +28 -0
- package/dist/chat/tools/index.d.ts +2 -0
- package/dist/chat/tools/sandbox/bash.d.ts +1 -0
- package/dist/chat/tools/system-time.d.ts +11 -1
- package/dist/{chunk-XTQGVNM3.js → chunk-45DPXMI3.js} +6 -12
- package/dist/{chunk-TU7P77FI.js → chunk-5EX36ZCD.js} +12 -12
- package/dist/{chunk-VL7OYSHD.js → chunk-5LD6EBH2.js} +1 -1
- package/dist/{chunk-HJ4KDO4N.js → chunk-6UNZ5DHG.js} +1 -1
- package/dist/{chunk-IVTHTAVK.js → chunk-AGAHACF7.js} +2 -2
- package/dist/{chunk-HX236W2U.js → chunk-CDQ4YIZM.js} +9 -0
- package/dist/{chunk-5ZAZHLIW.js → chunk-EBRB6ZBF.js} +1 -1
- package/dist/{chunk-VQA25AL4.js → chunk-EJT7EPP3.js} +6 -6
- package/dist/{chunk-FX6BLEDP.js → chunk-HDGTBCQR.js} +1 -1
- package/dist/{chunk-AH5HTUYX.js → chunk-IRTIVX42.js} +1 -1
- package/dist/{chunk-ECUILEUX.js → chunk-NGX2V4WY.js} +430 -29
- package/dist/{chunk-TBVS7GBE.js → chunk-OSCF2BDE.js} +9 -8
- package/dist/{chunk-HTGXUNEC.js → chunk-P2D7IW57.js} +7 -7
- package/dist/{chunk-EJRJWBKG.js → chunk-QQCEMMVN.js} +1 -1
- package/dist/{chunk-LDRO4OQ4.js → chunk-RMI6OX52.js} +2 -2
- package/dist/{chunk-QVEXYYFM.js → chunk-TRZSM67C.js} +11 -1
- package/dist/{chunk-TLN54TOQ.js → chunk-TYEDZVRM.js} +32 -32
- package/dist/{chunk-QWGZ273D.js → chunk-U37P4IIP.js} +81 -27
- package/dist/{chunk-JLN4XSPR.js → chunk-UXYZPEWP.js} +1 -1
- package/dist/{chunk-LNYNTR27.js → chunk-VZEKCQLD.js} +3 -3
- package/dist/{chunk-T5FPIBU2.js → chunk-Y6627MTY.js} +788 -674
- package/dist/{chunk-IKO5LFIU.js → chunk-YPKPXLMS.js} +1 -1
- package/dist/chunk-Z67KVHMJ.js +233 -0
- package/dist/{chunk-WHEMUEXT.js → chunk-ZBQIA5NI.js} +8 -6
- package/dist/cli/chat.js +25 -25
- package/dist/cli/check.js +6 -6
- package/dist/cli/init.js +0 -1
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +7 -7
- package/dist/db/schema/task-executions.d.ts +110 -0
- package/dist/db/schema.d.ts +111 -1
- package/dist/{db-RICMPUFT.js → db-UA6OFL25.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-YFVS4SAX.js → oauth-callback-server-IJDYBSTX.js} +18 -18
- package/dist/{runner-A3LVGZR6.js → runner-K6GID4HN.js} +12 -12
- package/dist/{skills-P7Q6Z6PN.js → skills-KJVS753I.js} +6 -6
- package/dist/{validation-RYHOWBET.js → validation-7VDJGK7K.js} +6 -6
- package/dist/version.js +1 -1
- package/migrations/0019_lowly_valkyrie.sql +14 -0
- package/migrations/0020_restrict_task_execution_kinds.sql +2 -0
- package/migrations/meta/0019_snapshot.json +1904 -0
- package/migrations/meta/0020_snapshot.json +1848 -0
- package/migrations/meta/_journal.json +15 -1
- package/package.json +4 -4
- package/dist/chunk-V365UVCU.js +0 -115
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
toCanonicalInputMessage,
|
|
4
4
|
toCanonicalOutputMessage,
|
|
5
5
|
toGenAiMessagesTraceAttributes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5LD6EBH2.js";
|
|
7
7
|
import {
|
|
8
8
|
extractGenAiUsageAttributes,
|
|
9
9
|
logException,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
normalizeGenAiFinishReason,
|
|
12
12
|
serializeGenAiAttribute,
|
|
13
13
|
withSpan
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QQCEMMVN.js";
|
|
15
15
|
|
|
16
16
|
// src/chat/config.ts
|
|
17
17
|
import { getModel as getModel2 } from "@earendil-works/pi-ai/compat";
|
|
@@ -604,7 +604,11 @@ var taskSummaryBaseSchema = z7.object({
|
|
|
604
604
|
destination: taskDestinationSchema,
|
|
605
605
|
id: z7.string().min(1),
|
|
606
606
|
instruction: z7.string().min(1),
|
|
607
|
-
|
|
607
|
+
lastConversationId: z7.string().min(1).optional(),
|
|
608
|
+
lastRunAt: z7.string().datetime().optional(),
|
|
609
|
+
ownedByViewer: z7.boolean(),
|
|
610
|
+
runsLast7Days: z7.number().int().nonnegative(),
|
|
611
|
+
totalRuns: z7.number().int().nonnegative()
|
|
608
612
|
});
|
|
609
613
|
var scheduledTaskSummarySchema = taskSummaryBaseSchema.extend({
|
|
610
614
|
kind: z7.literal("scheduled"),
|
|
@@ -623,7 +627,13 @@ var taskSummarySchema = z7.discriminatedUnion("kind", [
|
|
|
623
627
|
scheduledTaskSummarySchema,
|
|
624
628
|
eventTaskSummarySchema
|
|
625
629
|
]);
|
|
630
|
+
var taskExecutionDaySchema = z7.object({
|
|
631
|
+
date: z7.string().min(1),
|
|
632
|
+
event: z7.number().int().nonnegative(),
|
|
633
|
+
scheduled: z7.number().int().nonnegative()
|
|
634
|
+
}).strict();
|
|
626
635
|
var taskListSchema = z7.object({
|
|
636
|
+
executionDays: z7.array(taskExecutionDaySchema),
|
|
627
637
|
tasks: z7.array(taskSummarySchema),
|
|
628
638
|
truncated: z7.boolean()
|
|
629
639
|
}).strict();
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getChatConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RMI6OX52.js";
|
|
4
|
+
|
|
5
|
+
// src/chat/sandbox/paths.ts
|
|
6
|
+
function normalizeWorkspaceRoot(input) {
|
|
7
|
+
const candidate = (input ?? "").trim();
|
|
8
|
+
if (!candidate) {
|
|
9
|
+
return "/vercel/sandbox";
|
|
10
|
+
}
|
|
11
|
+
const normalized = candidate.replace(/\/+$/, "");
|
|
12
|
+
return normalized.startsWith("/") ? normalized : `/${normalized}`;
|
|
13
|
+
}
|
|
14
|
+
var SANDBOX_WORKSPACE_ROOT = normalizeWorkspaceRoot(
|
|
15
|
+
process.env.VERCEL_SANDBOX_WORKSPACE_DIR
|
|
16
|
+
);
|
|
17
|
+
var SANDBOX_SKILLS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/skills`;
|
|
18
|
+
var SANDBOX_DATA_ROOT = `${SANDBOX_WORKSPACE_ROOT}/data`;
|
|
19
|
+
function sandboxSkillDir(skillName) {
|
|
20
|
+
return `${SANDBOX_SKILLS_ROOT}/${skillName}`;
|
|
21
|
+
}
|
|
22
|
+
function sandboxSkillFile(skillName) {
|
|
23
|
+
return `${sandboxSkillDir(skillName)}/SKILL.md`;
|
|
24
|
+
}
|
|
25
|
+
function sandboxSkillPathResolution(skillName) {
|
|
26
|
+
const skillDir = sandboxSkillDir(skillName);
|
|
27
|
+
return `Resolve relative paths in this skill against ${skillDir}. For bash commands from this skill, cd to ${skillDir} first or use absolute paths.`;
|
|
28
|
+
}
|
|
4
29
|
|
|
5
30
|
// src/chat/state/adapter.ts
|
|
6
31
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
@@ -271,31 +296,6 @@ async function disconnectStateAdapter() {
|
|
|
271
296
|
}
|
|
272
297
|
}
|
|
273
298
|
|
|
274
|
-
// src/chat/sandbox/paths.ts
|
|
275
|
-
function normalizeWorkspaceRoot(input) {
|
|
276
|
-
const candidate = (input ?? "").trim();
|
|
277
|
-
if (!candidate) {
|
|
278
|
-
return "/vercel/sandbox";
|
|
279
|
-
}
|
|
280
|
-
const normalized = candidate.replace(/\/+$/, "");
|
|
281
|
-
return normalized.startsWith("/") ? normalized : `/${normalized}`;
|
|
282
|
-
}
|
|
283
|
-
var SANDBOX_WORKSPACE_ROOT = normalizeWorkspaceRoot(
|
|
284
|
-
process.env.VERCEL_SANDBOX_WORKSPACE_DIR
|
|
285
|
-
);
|
|
286
|
-
var SANDBOX_SKILLS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/skills`;
|
|
287
|
-
var SANDBOX_DATA_ROOT = `${SANDBOX_WORKSPACE_ROOT}/data`;
|
|
288
|
-
function sandboxSkillDir(skillName) {
|
|
289
|
-
return `${SANDBOX_SKILLS_ROOT}/${skillName}`;
|
|
290
|
-
}
|
|
291
|
-
function sandboxSkillFile(skillName) {
|
|
292
|
-
return `${sandboxSkillDir(skillName)}/SKILL.md`;
|
|
293
|
-
}
|
|
294
|
-
function sandboxSkillPathResolution(skillName) {
|
|
295
|
-
const skillDir = sandboxSkillDir(skillName);
|
|
296
|
-
return `Resolve relative paths in this skill against ${skillDir}. For bash commands from this skill, cd to ${skillDir} first or use absolute paths.`;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
299
|
// src/chat/sleep.ts
|
|
300
300
|
function sleep(ms, signal) {
|
|
301
301
|
if (!signal) {
|
|
@@ -319,15 +319,15 @@ function sleep(ms, signal) {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
export {
|
|
322
|
-
acquireActiveLock,
|
|
323
|
-
getDefaultRedisStateAdapterFor,
|
|
324
|
-
getStateAdapter,
|
|
325
|
-
disconnectStateAdapter,
|
|
326
|
-
sleep,
|
|
327
322
|
SANDBOX_WORKSPACE_ROOT,
|
|
328
323
|
SANDBOX_SKILLS_ROOT,
|
|
329
324
|
SANDBOX_DATA_ROOT,
|
|
330
325
|
sandboxSkillDir,
|
|
331
326
|
sandboxSkillFile,
|
|
332
|
-
sandboxSkillPathResolution
|
|
327
|
+
sandboxSkillPathResolution,
|
|
328
|
+
acquireActiveLock,
|
|
329
|
+
getDefaultRedisStateAdapterFor,
|
|
330
|
+
getStateAdapter,
|
|
331
|
+
disconnectStateAdapter,
|
|
332
|
+
sleep
|
|
333
333
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_SQL_STATEMENT_TIMEOUT_MS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RMI6OX52.js";
|
|
4
4
|
import {
|
|
5
5
|
juniorDestinations,
|
|
6
6
|
timestamptz
|
|
@@ -351,54 +351,106 @@ var juniorStats = pgTable9(
|
|
|
351
351
|
]
|
|
352
352
|
);
|
|
353
353
|
|
|
354
|
-
// src/db/schema/
|
|
354
|
+
// src/db/schema/task-executions.ts
|
|
355
355
|
import { sql as sql4 } from "drizzle-orm";
|
|
356
|
-
import {
|
|
357
|
-
|
|
356
|
+
import {
|
|
357
|
+
bigint as bigint2,
|
|
358
|
+
check,
|
|
359
|
+
foreignKey as foreignKey3,
|
|
360
|
+
index as index7,
|
|
361
|
+
pgTable as pgTable10,
|
|
362
|
+
primaryKey as primaryKey5,
|
|
363
|
+
text as text10
|
|
364
|
+
} from "drizzle-orm/pg-core";
|
|
365
|
+
var juniorTaskExecutions = pgTable10(
|
|
366
|
+
"junior_task_executions",
|
|
367
|
+
{
|
|
368
|
+
executionId: text10("execution_id").notNull(),
|
|
369
|
+
kind: text10("kind").notNull(),
|
|
370
|
+
namespace: text10("namespace").notNull(),
|
|
371
|
+
taskId: text10("task_id").notNull(),
|
|
372
|
+
conversationId: text10("conversation_id").notNull(),
|
|
373
|
+
executedAtMs: bigint2("executed_at_ms", { mode: "number" }).notNull()
|
|
374
|
+
},
|
|
375
|
+
(table) => [
|
|
376
|
+
check(
|
|
377
|
+
"junior_task_executions_kind_check",
|
|
378
|
+
sql4`${table.kind} in ('scheduled', 'event')`
|
|
379
|
+
),
|
|
380
|
+
primaryKey5({
|
|
381
|
+
name: "junior_task_executions_kind_namespace_execution_id_pk",
|
|
382
|
+
columns: [table.kind, table.namespace, table.executionId]
|
|
383
|
+
}),
|
|
384
|
+
foreignKey3({
|
|
385
|
+
name: "junior_task_executions_conversation_id_junior_conversations_conversation_id_fk",
|
|
386
|
+
columns: [table.conversationId],
|
|
387
|
+
foreignColumns: [juniorConversations.conversationId]
|
|
388
|
+
}),
|
|
389
|
+
index7("junior_task_executions_task_time_idx").on(
|
|
390
|
+
table.kind,
|
|
391
|
+
table.namespace,
|
|
392
|
+
table.taskId,
|
|
393
|
+
table.executedAtMs
|
|
394
|
+
),
|
|
395
|
+
index7("junior_task_executions_time_kind_idx").on(
|
|
396
|
+
table.executedAtMs,
|
|
397
|
+
table.kind
|
|
398
|
+
),
|
|
399
|
+
index7("junior_task_executions_conversation_time_idx").on(
|
|
400
|
+
table.conversationId,
|
|
401
|
+
table.executedAtMs
|
|
402
|
+
)
|
|
403
|
+
]
|
|
404
|
+
);
|
|
405
|
+
|
|
406
|
+
// src/db/schema/scheduled-tasks.ts
|
|
407
|
+
import { sql as sql5 } from "drizzle-orm";
|
|
408
|
+
import { bigint as bigint3, index as index8, jsonb as jsonb6, pgTable as pgTable11, text as text11 } from "drizzle-orm/pg-core";
|
|
409
|
+
var juniorSchedulerTasks = pgTable11(
|
|
358
410
|
"junior_scheduler_tasks",
|
|
359
411
|
{
|
|
360
|
-
id:
|
|
361
|
-
teamId:
|
|
412
|
+
id: text11("id").primaryKey(),
|
|
413
|
+
teamId: text11("team_id").notNull(),
|
|
362
414
|
// TODO(v0.128.0): Remove after v0.127.x runtimes no longer write this column.
|
|
363
|
-
creatorSlackUserId:
|
|
364
|
-
creatorIdentityId:
|
|
365
|
-
status:
|
|
366
|
-
nextRunAtMs:
|
|
367
|
-
runNowAtMs:
|
|
368
|
-
createdAtMs:
|
|
415
|
+
creatorSlackUserId: text11("creator_slack_user_id"),
|
|
416
|
+
creatorIdentityId: text11("creator_identity_id"),
|
|
417
|
+
status: text11("status").notNull(),
|
|
418
|
+
nextRunAtMs: bigint3("next_run_at_ms", { mode: "number" }),
|
|
419
|
+
runNowAtMs: bigint3("run_now_at_ms", { mode: "number" }),
|
|
420
|
+
createdAtMs: bigint3("created_at_ms", { mode: "number" }).notNull(),
|
|
369
421
|
record: jsonb6("record").$type().notNull()
|
|
370
422
|
},
|
|
371
423
|
(table) => [
|
|
372
424
|
// TODO(v0.128.0): Remove with creatorSlackUserId.
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
425
|
+
index8("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
|
|
426
|
+
index8("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(
|
|
427
|
+
sql5`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`
|
|
376
428
|
),
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
429
|
+
index8("junior_scheduler_tasks_team_status_idx").on(table.teamId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
|
|
430
|
+
index8("junior_scheduler_tasks_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(
|
|
431
|
+
sql5`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`
|
|
380
432
|
),
|
|
381
|
-
|
|
382
|
-
|
|
433
|
+
index8("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
|
|
434
|
+
sql5`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`
|
|
383
435
|
)
|
|
384
436
|
]
|
|
385
437
|
);
|
|
386
|
-
var juniorSchedulerRuns =
|
|
438
|
+
var juniorSchedulerRuns = pgTable11(
|
|
387
439
|
"junior_scheduler_runs",
|
|
388
440
|
{
|
|
389
|
-
id:
|
|
390
|
-
taskId:
|
|
391
|
-
status:
|
|
392
|
-
scheduledForMs:
|
|
441
|
+
id: text11("id").primaryKey(),
|
|
442
|
+
taskId: text11("task_id").notNull(),
|
|
443
|
+
status: text11("status").notNull(),
|
|
444
|
+
scheduledForMs: bigint3("scheduled_for_ms", { mode: "number" }).notNull(),
|
|
393
445
|
record: jsonb6("record").$type().notNull()
|
|
394
446
|
},
|
|
395
447
|
(table) => [
|
|
396
|
-
|
|
448
|
+
index8("junior_scheduler_runs_task_status_idx").on(
|
|
397
449
|
table.taskId,
|
|
398
450
|
table.status,
|
|
399
451
|
table.scheduledForMs
|
|
400
452
|
),
|
|
401
|
-
|
|
453
|
+
index8("junior_scheduler_runs_status_idx").on(
|
|
402
454
|
table.status,
|
|
403
455
|
table.scheduledForMs
|
|
404
456
|
)
|
|
@@ -416,6 +468,7 @@ var juniorSqlSchema = {
|
|
|
416
468
|
juniorEventTasks,
|
|
417
469
|
juniorIdentities,
|
|
418
470
|
juniorStats,
|
|
471
|
+
juniorTaskExecutions,
|
|
419
472
|
juniorSchedulerRuns,
|
|
420
473
|
juniorSchedulerTasks,
|
|
421
474
|
juniorUsers
|
|
@@ -680,6 +733,7 @@ export {
|
|
|
680
733
|
juniorConversationBindings,
|
|
681
734
|
juniorEventTasks,
|
|
682
735
|
juniorStats,
|
|
736
|
+
juniorTaskExecutions,
|
|
683
737
|
juniorSchedulerTasks,
|
|
684
738
|
juniorSchedulerRuns,
|
|
685
739
|
createJuniorSqlExecutor
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
juniorConversations,
|
|
6
6
|
juniorIdentities,
|
|
7
7
|
juniorUsers
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-U37P4IIP.js";
|
|
9
9
|
import {
|
|
10
10
|
TURN_REASONING_LEVELS,
|
|
11
11
|
getChatConfig,
|
|
12
12
|
modelProfileSchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RMI6OX52.js";
|
|
14
14
|
import {
|
|
15
15
|
juniorDestinations
|
|
16
16
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-F3B2YJ76.js";
|
|
21
21
|
import {
|
|
22
22
|
normalizeIdentityEmail
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-QQCEMMVN.js";
|
|
24
24
|
|
|
25
25
|
// src/chat/conversations/sql/store.ts
|
|
26
26
|
import { randomUUID as randomUUID2 } from "crypto";
|