@sentry/junior 0.306.0 → 0.307.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-context-CnY-i32r.js → adapter-context-B69WPn6b.js} +2 -2
- package/dist/{admin-BLLdLnXh.js → admin-nCJXMgkp.js} +2 -2
- package/dist/{agent-runner-BaLjEjPR.js → agent-runner-DdFcxAxG.js} +226 -137
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +4 -4
- package/dist/api.d.ts +1 -1
- package/dist/api.js +328 -298
- package/dist/{app-DvYbM9UD.d.ts → app-EZur8cVC.d.ts} +12 -3
- package/dist/app.d.ts +2 -2
- package/dist/app.js +84 -44
- package/dist/background-compaction-queue-BhEe4UfU.js +231 -0
- package/dist/{briefs-DvyzXfrF.js → briefs-Dl9lxi7J.js} +2 -2
- package/dist/{catalog-runtime-B1R-nHd3.js → catalog-runtime-OXrv2Ewn.js} +1 -1
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +17 -16
- package/dist/cli/check.js +58 -48
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.d.ts +1 -1
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +2 -2
- package/dist/cli/upgrade.js +3 -8
- package/dist/{config-DUD-zMvp.js → config-362yMSIz.js} +74 -38
- package/dist/{connections-CDhsqPcC.js → connections-BJv3EjmB.js} +10 -8
- package/dist/{continue-in-slack-BXQizz9o.js → continue-in-slack-CFEevC7z.js} +5 -5
- package/dist/{conversation-privacy-YE54gMN8.js → conversation-privacy-Tjj5P2W6.js} +1 -1
- package/dist/{conversation-turn-BzdmrHb0.js → conversation-turn-DU0_WDAr.js} +19 -47
- package/dist/{credential-sync-Cdm-e1vJ.js → credential-sync-D6aFARKE.js} +28 -28
- package/dist/{db-DV2ZUb1Y.js → db-Bcbd9zQc.js} +140 -11
- package/dist/{db-pH357Dkt.d.ts → db-C41UgdBj.d.ts} +1 -1
- package/dist/{executor-CjNhwwnj.js → executor-DBMBrpNV.js} +93 -32
- package/dist/{install-DbD7C5td.js → install-CgoAbzfF.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{lineage-BFdIPb3o.js → lineage-CsZDmz3e.js} +2 -2
- package/dist/{logging-oYpJYr-S.js → logging-CHCuQ5iz.js} +1 -1
- package/dist/{message-BBPcMKJY.js → message-B8vCbZZB.js} +8 -8
- package/dist/{model-input-DYYF3a8B.js → model-input-Xluiy-1W.js} +3 -3
- package/dist/nitro.d.ts +2 -2
- package/dist/nitro.js +3 -4
- package/dist/{oauth-callback-server-C7Q987su.js → oauth-callback-server-BUuNvfvu.js} +2 -2
- package/dist/{oauth-relay-DAmfVmJu.js → oauth-relay-DGAZzg9m.js} +1 -1
- package/dist/{plugins-B_0Cr0MO.d.ts → plugins-fBrz8PCV.d.ts} +2 -0
- package/dist/{projection-CWXDE0f6.js → projection-xPpvqexa.js} +1112 -693
- package/dist/{prompt-P3eRqO8C.js → prompt-D8u4jFs_.js} +3 -3
- package/dist/{registry-1pzXmplY.js → registry-D20hG3r6.js} +19 -9
- package/dist/{resolve-n87oXY-d.js → resolve-BhCySRCW.js} +3 -3
- package/dist/{result-BmF9v9bv.js → result-DddO63S9.js} +13 -11
- package/dist/{runner-4j7ZsxP5.js → runner-DQR9vYce.js} +9 -9
- package/dist/{sandbox-egress-signals-BRQI8HvT.js → sandbox-egress-signals-DFlNUOnK.js} +1 -1
- package/dist/{schedule-CHPWQn-x.js → schedule-BG1tEbRF.js} +34 -4
- package/dist/{schema-CVbIjrF3.d.ts → schema-CRXcj4fj.d.ts} +350 -143
- package/dist/{schema-D7iIEh6t.js → schema-D4jdesIu.js} +12 -4
- package/dist/{service-account-DzQiOmqa.js → service-account-Bv5QwrEq.js} +8 -6
- package/dist/{service-account-BDQ9xzta.js → service-account-CNfycv0z.js} +3 -3
- package/dist/{session-stop-BQxgHR4X.js → session-stop-BDdwyZaa.js} +36 -23
- package/dist/{skills-CPf4vNuC.js → skills-63i1Bcv1.js} +32 -28
- package/dist/{slack-conversation-unfurl-B1KEptUg.js → slack-conversation-unfurl-DtpBUlUu.js} +10 -10
- package/dist/{spawn-CjGddiAU.js → spawn-mwimEY9_.js} +6 -6
- package/dist/{state-9wfj6aSD.js → state-BBn9L6gC.js} +4 -4
- package/dist/{stop-CsQGuN5n.js → stop-Da-Ug7tg.js} +146 -158
- package/dist/{store-Dz3YZ7gQ.js → store-CdWg2r2L.js} +5 -5
- package/dist/{background-compaction-queue-D2wzxtGU.js → task-queue-BcjAYWyB.js} +164 -180
- package/dist/{task-runner-frzlUvFD.js → task-runner-CoXmMlsW.js} +11 -8
- package/dist/{thread-context-C4QuZlM8.js → thread-context-ZPGqOjW7.js} +6 -6
- package/dist/{turn-session-routing-BXaubz2w.js → turn-session-routing-DFYak28Q.js} +24 -5
- package/dist/{turn-user-message-DNC0eRZ7.js → turn-user-message-B1S8nOnG.js} +3 -3
- package/dist/{users-XCCKn3xW.js → users-DDbENg-I.js} +1 -1
- package/dist/{validation-L5fdjmFX.js → validation-fl21ps-k.js} +1 -1
- package/dist/{version-BFmuwgxP.js → version-DCdMMx_0.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-DKOeHpv3.js → viewer-DN_xzVKj.js} +3 -3
- package/dist/{warmup-mTMIatCV.js → warmup-CxhEhm71.js} +596 -281
- package/dist/{web-message-id-CUaSiGme.js → web-message-id-BT8Mg8LL.js} +1 -1
- package/dist/{worker-Bz4KNxjI.js → worker-Btb1SB5h.js} +8 -7
- package/migrations/0115_automation_creator_slack_index.sql +1 -0
- package/migrations/0116_conversation_event_search.sql +25 -0
- package/migrations/0117_automation_last_run.sql +46 -0
- package/migrations/0118_automation_last_run_index.sql +1 -0
- package/migrations/0119_money_micro_usd.sql +29 -0
- package/migrations/0120_conversation_cost_micro_usd.sql +8 -0
- package/migrations/meta/0115_snapshot.json +5225 -0
- package/migrations/meta/0116_snapshot.json +5388 -0
- package/migrations/meta/0117_snapshot.json +5413 -0
- package/migrations/meta/0118_snapshot.json +5428 -0
- package/migrations/meta/0119_snapshot.json +5441 -0
- package/migrations/meta/0120_snapshot.json +5441 -0
- package/migrations/meta/_journal.json +42 -0
- package/package.json +10 -9
- package/dist/queue-7FSijgqG.js +0 -115
- package/dist/secrets-DHaJ5TTn.js +0 -18
- package/dist/task-queue-CFlrJguF.js +0 -89
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { h as logWarn, p as logException } from "./logging-
|
|
1
|
+
import { h as logWarn, p as logException } from "./logging-CHCuQ5iz.js";
|
|
2
2
|
import { _ as withScope } from "./sentry-CPbZjomA.js";
|
|
3
|
-
import "./config-
|
|
3
|
+
import "./config-362yMSIz.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { sql } from "drizzle-orm";
|
|
6
6
|
import { bigint, boolean, check, customType, date, doublePrecision, foreignKey, index, integer, jsonb, pgSequence, pgTable, primaryKey, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
7
|
+
import { embeddingHalfvec, embeddingVector } from "@sentry/junior-plugin-api/embeddings";
|
|
7
8
|
import { Pool as Pool$1, neon } from "@neondatabase/serverless";
|
|
8
9
|
import { drizzle } from "drizzle-orm/neon-serverless";
|
|
9
10
|
import { Agent } from "undici";
|
|
@@ -374,7 +375,7 @@ const CONVERSATION_METRICS = [
|
|
|
374
375
|
"cached_input_tokens",
|
|
375
376
|
"cache_creation_tokens",
|
|
376
377
|
"reasoning_tokens",
|
|
377
|
-
"
|
|
378
|
+
"cost_micro_usd"
|
|
378
379
|
];
|
|
379
380
|
/**
|
|
380
381
|
* One metric value for one Conversation Run. A Run is one Turn, so People
|
|
@@ -415,7 +416,8 @@ const juniorConversationBriefs = pgTable("junior_conversation_briefs", {
|
|
|
415
416
|
content: jsonb("content").$type().notNull(),
|
|
416
417
|
searchText: text("search_text").notNull(),
|
|
417
418
|
modelId: text("model_id").notNull(),
|
|
418
|
-
|
|
419
|
+
costMicroUsd: bigint("cost_micro_usd", { mode: "number" }),
|
|
420
|
+
legacyCostUsd: doublePrecision("cost_usd"),
|
|
419
421
|
createdAt: timestamptz("created_at").defaultNow().notNull()
|
|
420
422
|
}, (table) => [
|
|
421
423
|
primaryKey({
|
|
@@ -433,21 +435,6 @@ const juniorConversationBriefs = pgTable("junior_conversation_briefs", {
|
|
|
433
435
|
]);
|
|
434
436
|
// src/db/schema/conversation-embeddings.ts
|
|
435
437
|
/**
|
|
436
|
-
* pgvector column without a fixed size, so a change of embedding model needs
|
|
437
|
-
* no migration. The dimensions column records the size of each row.
|
|
438
|
-
*/
|
|
439
|
-
const vector = customType({
|
|
440
|
-
dataType() {
|
|
441
|
-
return "vector";
|
|
442
|
-
},
|
|
443
|
-
toDriver(value) {
|
|
444
|
-
return JSON.stringify(value);
|
|
445
|
-
},
|
|
446
|
-
fromDriver(value) {
|
|
447
|
-
return value.slice(1, -1).split(",").map(Number);
|
|
448
|
-
}
|
|
449
|
-
});
|
|
450
|
-
/**
|
|
451
438
|
* One embedding per Conversation, for semantic search. Its text is the latest
|
|
452
439
|
* Brief. A derived index: the next Brief replaces the row, and deleting that
|
|
453
440
|
* Brief row deletes it.
|
|
@@ -458,13 +445,68 @@ const juniorConversationEmbeddings = pgTable("junior_conversation_embeddings", {
|
|
|
458
445
|
provider: text("provider").notNull(),
|
|
459
446
|
model: text("model").notNull(),
|
|
460
447
|
dimensions: integer("dimensions").notNull(),
|
|
461
|
-
embedding:
|
|
448
|
+
embedding: embeddingVector("embedding").notNull(),
|
|
462
449
|
createdAt: timestamptz("created_at").defaultNow().notNull()
|
|
463
450
|
}, (table) => [foreignKey({
|
|
464
451
|
name: "junior_conversation_embeddings_brief_fk",
|
|
465
452
|
columns: [table.conversationId, table.briefVersion],
|
|
466
453
|
foreignColumns: [juniorConversationBriefs.conversationId, juniorConversationBriefs.version]
|
|
467
454
|
}).onDelete("cascade"), check("junior_conversation_embeddings_dimensions_check", sql`vector_dims(${table.embedding}) = ${table.dimensions}`)]);
|
|
455
|
+
// src/db/schema/conversation-event-embeddings.ts
|
|
456
|
+
/**
|
|
457
|
+
* One embedding per searchable Conversation event, for semantic search of the
|
|
458
|
+
* history of one Conversation. A derived index: a purge that deletes the
|
|
459
|
+
* event deletes its row, and a new embedding model replaces the row.
|
|
460
|
+
*/
|
|
461
|
+
const juniorConversationEventEmbeddings = pgTable("junior_conversation_event_embeddings", {
|
|
462
|
+
conversationId: text("conversation_id").notNull(),
|
|
463
|
+
seq: integer("seq").notNull(),
|
|
464
|
+
provider: text("provider").notNull(),
|
|
465
|
+
model: text("model").notNull(),
|
|
466
|
+
dimensions: integer("dimensions").notNull(),
|
|
467
|
+
embedding: embeddingHalfvec("embedding").notNull(),
|
|
468
|
+
createdAt: timestamptz("created_at").defaultNow().notNull()
|
|
469
|
+
}, (table) => [
|
|
470
|
+
primaryKey({
|
|
471
|
+
name: "junior_conversation_event_embeddings_pk",
|
|
472
|
+
columns: [table.conversationId, table.seq]
|
|
473
|
+
}),
|
|
474
|
+
foreignKey({
|
|
475
|
+
name: "junior_conversation_event_embeddings_event_fk",
|
|
476
|
+
columns: [table.conversationId, table.seq],
|
|
477
|
+
foreignColumns: [juniorConversationEvents.conversationId, juniorConversationEvents.seq]
|
|
478
|
+
}).onDelete("cascade"),
|
|
479
|
+
check("junior_conversation_event_embeddings_dimensions_check", sql`vector_dims(${table.embedding}) = ${table.dimensions}`)
|
|
480
|
+
]);
|
|
481
|
+
// src/db/schema/tsvector.ts
|
|
482
|
+
/** Postgres full-text lexemes. Queries read them only through SQL. */
|
|
483
|
+
const tsvector = customType({ dataType() {
|
|
484
|
+
return "tsvector";
|
|
485
|
+
} });
|
|
486
|
+
// src/db/schema/conversation-event-lexemes.ts
|
|
487
|
+
/**
|
|
488
|
+
* Stored full-text lexemes of one searchable Conversation event, for keyword
|
|
489
|
+
* search of the history of one Conversation. A derived index: a purge that
|
|
490
|
+
* deletes the event deletes its row. Events are immutable, so a row never
|
|
491
|
+
* changes.
|
|
492
|
+
*/
|
|
493
|
+
const juniorConversationEventLexemes = pgTable("junior_conversation_event_lexemes", {
|
|
494
|
+
conversationId: text("conversation_id").notNull(),
|
|
495
|
+
seq: integer("seq").notNull(),
|
|
496
|
+
lexemes: tsvector("lexemes").notNull(),
|
|
497
|
+
createdAt: timestamptz("created_at").defaultNow().notNull()
|
|
498
|
+
}, (table) => [
|
|
499
|
+
primaryKey({
|
|
500
|
+
name: "junior_conversation_event_lexemes_pk",
|
|
501
|
+
columns: [table.conversationId, table.seq]
|
|
502
|
+
}),
|
|
503
|
+
foreignKey({
|
|
504
|
+
name: "junior_conversation_event_lexemes_event_fk",
|
|
505
|
+
columns: [table.conversationId, table.seq],
|
|
506
|
+
foreignColumns: [juniorConversationEvents.conversationId, juniorConversationEvents.seq]
|
|
507
|
+
}).onDelete("cascade"),
|
|
508
|
+
index("junior_conversation_event_lexemes_lexemes_idx").using("gin", table.lexemes)
|
|
509
|
+
]);
|
|
468
510
|
// src/db/schema/conversation-bindings.ts
|
|
469
511
|
/** Provider conversation coordinates bound to Junior's opaque durable conversation id. */
|
|
470
512
|
const juniorConversationBindings = pgTable("junior_conversation_bindings", {
|
|
@@ -598,7 +640,8 @@ const juniorStats = pgTable("junior_stats", {
|
|
|
598
640
|
namespace: text("namespace").notNull(),
|
|
599
641
|
metric: text("metric").notNull(),
|
|
600
642
|
name: text("name").notNull(),
|
|
601
|
-
count:
|
|
643
|
+
count: bigint("value", { mode: "number" }).notNull().default(0),
|
|
644
|
+
legacyCount: integer("count").notNull().default(0)
|
|
602
645
|
}, (table) => [primaryKey({
|
|
603
646
|
name: "junior_stats_date_namespace_metric_name_pk",
|
|
604
647
|
columns: [
|
|
@@ -638,6 +681,13 @@ const juniorAutomations = pgTable("junior_automations", {
|
|
|
638
681
|
createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
|
|
639
682
|
nextRunAtMs: bigint("next_run_at_ms", { mode: "number" }),
|
|
640
683
|
runNowAtMs: bigint("run_now_at_ms", { mode: "number" }),
|
|
684
|
+
/**
|
|
685
|
+
* The latest run with an outcome. The list reads its end time and status
|
|
686
|
+
* to order by activity and to find failed last runs.
|
|
687
|
+
* `refreshAutomationLastRun` sets it after each run write. A purged run
|
|
688
|
+
* clears it.
|
|
689
|
+
*/
|
|
690
|
+
lastRunId: text("last_run_id").references(() => juniorAutomationRuns.id, { onDelete: "set null" }),
|
|
641
691
|
namespace: text("namespace"),
|
|
642
692
|
identifier: text("identifier"),
|
|
643
693
|
record: jsonb("record").$type().notNull()
|
|
@@ -649,6 +699,8 @@ const juniorAutomations = pgTable("junior_automations", {
|
|
|
649
699
|
check("junior_automations_trigger_check", sql`(${table.kind} = 'scheduled' and ${table.namespace} is null and ${table.identifier} is null) or (${table.kind} = 'event' and ${table.namespace} is not null and ${table.nextRunAtMs} is null and ${table.runNowAtMs} is null and ${table.status} <> 'completed')`),
|
|
650
700
|
index("junior_automations_team_idx").on(table.teamId, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted'`),
|
|
651
701
|
index("junior_automations_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id),
|
|
702
|
+
index("junior_automations_creator_slack_idx").on(table.teamId, table.creatorSlackUserId).where(sql`${table.status} <> 'deleted'`),
|
|
703
|
+
index("junior_automations_last_run_idx").on(table.lastRunId),
|
|
652
704
|
index("junior_automations_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(sql`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`),
|
|
653
705
|
index("junior_automations_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(sql`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`),
|
|
654
706
|
index("junior_automations_skill_idx").on(table.skill, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted' AND ${table.skill} IS NOT NULL`),
|
|
@@ -697,7 +749,8 @@ const juniorAutomationRuns = pgTable("junior_automation_runs", {
|
|
|
697
749
|
startedAtMs: bigint("started_at_ms", { mode: "number" }),
|
|
698
750
|
completedAtMs: bigint("completed_at_ms", { mode: "number" }),
|
|
699
751
|
errorMessage: text("error_message"),
|
|
700
|
-
resultMessageTs: text("result_message_ts")
|
|
752
|
+
resultMessageTs: text("result_message_ts"),
|
|
753
|
+
costMicroUsd: bigint("cost_micro_usd", { mode: "number" })
|
|
701
754
|
}, (table) => [
|
|
702
755
|
foreignKey({
|
|
703
756
|
name: "junior_automation_runs_automation_version_fk",
|
|
@@ -909,6 +962,8 @@ const juniorSqlSchema = {
|
|
|
909
962
|
juniorConversationEvents,
|
|
910
963
|
juniorConversationMetrics,
|
|
911
964
|
juniorConversationEmbeddings,
|
|
965
|
+
juniorConversationEventEmbeddings,
|
|
966
|
+
juniorConversationEventLexemes,
|
|
912
967
|
juniorConversationBriefs,
|
|
913
968
|
juniorConversationBindings,
|
|
914
969
|
juniorConversationParticipants,
|
|
@@ -946,6 +1001,20 @@ function forwardInfoMessages(pool, onInfo) {
|
|
|
946
1001
|
});
|
|
947
1002
|
});
|
|
948
1003
|
}
|
|
1004
|
+
// src/db/postgres-error.ts
|
|
1005
|
+
const MAX_CAUSE_DEPTH = 5;
|
|
1006
|
+
/**
|
|
1007
|
+
* Return whether a PostgreSQL failure, or an error that it wraps as `cause`,
|
|
1008
|
+
* has the requested SQLSTATE.
|
|
1009
|
+
*/
|
|
1010
|
+
function isPostgresErrorCode(error, code) {
|
|
1011
|
+
let current = error;
|
|
1012
|
+
for (let depth = 0; depth < MAX_CAUSE_DEPTH && typeof current === "object" && current !== null; depth += 1) {
|
|
1013
|
+
if ("code" in current && current.code === code) return true;
|
|
1014
|
+
current = "cause" in current ? current.cause : void 0;
|
|
1015
|
+
}
|
|
1016
|
+
return false;
|
|
1017
|
+
}
|
|
949
1018
|
// src/db/migrate.ts
|
|
950
1019
|
const LOCK_TIMEOUT_MS = 5e3;
|
|
951
1020
|
const LOCK_ATTEMPTS = 5;
|
|
@@ -974,14 +1043,6 @@ function concurrentIndexes(tag, statements) {
|
|
|
974
1043
|
};
|
|
975
1044
|
});
|
|
976
1045
|
}
|
|
977
|
-
function isLockTimeout(error) {
|
|
978
|
-
let current = error;
|
|
979
|
-
for (let depth = 0; current instanceof Error && depth < 5; depth += 1) {
|
|
980
|
-
if ("code" in current && current.code === LOCK_NOT_AVAILABLE) return true;
|
|
981
|
-
current = current.cause;
|
|
982
|
-
}
|
|
983
|
-
return false;
|
|
984
|
-
}
|
|
985
1046
|
/**
|
|
986
1047
|
* Wait for the migration lock by polling `pg_try_advisory_lock`. A session
|
|
987
1048
|
* blocked in `pg_advisory_lock` holds a snapshot, and `CREATE INDEX
|
|
@@ -996,7 +1057,7 @@ async function retryOnLockTimeout(tag, apply) {
|
|
|
996
1057
|
await apply();
|
|
997
1058
|
return;
|
|
998
1059
|
} catch (error) {
|
|
999
|
-
if (attempt >= LOCK_ATTEMPTS || !
|
|
1060
|
+
if (attempt >= LOCK_ATTEMPTS || !isPostgresErrorCode(error, LOCK_NOT_AVAILABLE)) throw error;
|
|
1000
1061
|
logWarn("db.migration.lock_timeout", {
|
|
1001
1062
|
"app.db.migration.tag": tag,
|
|
1002
1063
|
"app.db.migration.attempt": attempt
|
|
@@ -1417,4 +1478,4 @@ function createJuniorSqlExecutor(args) {
|
|
|
1417
1478
|
statementTimeoutMs
|
|
1418
1479
|
});
|
|
1419
1480
|
}
|
|
1420
|
-
export {
|
|
1481
|
+
export { juniorConversationEvents as A, juniorUsers as B, juniorConversationEventLexemes as C, CONVERSATION_METRICS as D, juniorConversationBriefs as E, juniorAttachmentUploads as F, juniorArtifacts as H, juniorAttachments as I, juniorMessageAttachments as L, juniorConversationAnnotations as M, juniorCodeChanges as N, juniorConversationMetrics as O, juniorCodeRepositories as P, juniorConversations as R, juniorConversationBindings as S, juniorConversationEmbeddings as T, juniorDestinations as V, juniorLocationConfigurations as _, juniorWorkspaces as a, juniorConversationReadPositions as b, juniorPlanItems as c, juniorReviewItemSlackCards as d, juniorReviewItems as f, juniorStats as g, juniorAutomations as h, juniorWorkspaceRepos as i, juniorApiTokens as j, isUserInstruction as k, juniorReviewItemAssignees as l, juniorAutomationVersions as m, isPostgresErrorCode as n, juniorPushSubscriptions as o, juniorAutomationRuns as p, juniorSnapshots as r, juniorPlanItemVersionSeq as s, createJuniorSqlExecutor as t, juniorReviewItemConversations as u, juniorAgentBindings as v, juniorConversationEventEmbeddings as w, juniorConversationParticipants as x, juniorAgentInvocations as y, juniorIdentities as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { E as withSpan, b as setSpanAttributes } from "./logging-
|
|
1
|
+
import { Aa as SANDBOX_COMMAND_PATH, Fa as SANDBOX_WORKSPACE_ROOT, Va as runNonInteractiveCommand } from "./projection-xPpvqexa.js";
|
|
2
|
+
import { E as withSpan, b as setSpanAttributes } from "./logging-CHCuQ5iz.js";
|
|
3
3
|
// src/chat/sandbox/resources.ts
|
|
4
4
|
let configuredResources;
|
|
5
5
|
function resourcesFromEnv() {
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON, s as getTraceData } from "./sentry-CPbZjomA.js";
|
|
2
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
2
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-Tjj5P2W6.js";
|
|
3
3
|
import { n as isPushServiceHost } from "./push-endpoint-CO-nomUd.js";
|
|
4
4
|
import { n as redactSandboxEgressProxyPath } from "./proxy-path-BHYoKZdq.js";
|
|
5
5
|
import { n as promoteHttpRouteName, r as routeNameMiddleware, t as nameRequestRoute } from "./sentry-route-name-C6EIzAGP.js";
|
|
6
6
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
|
|
7
|
-
import { B as getDeploymentServiceVersion, V as getDeploymentTelemetryAttributes } from "./logging-
|
|
7
|
+
import { B as getDeploymentServiceVersion, V as getDeploymentTelemetryAttributes } from "./logging-CHCuQ5iz.js";
|
|
8
8
|
import { performance } from "node:perf_hooks";
|
|
9
9
|
import { subscribe, unsubscribe } from "node:diagnostics_channel";
|
|
10
10
|
// src/chat/pi/gateway-request-timing.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as conversationKindFromRow, o as getDb } from "./db-
|
|
2
|
-
import {
|
|
1
|
+
import { A as conversationKindFromRow, o as getDb } from "./db-Bcbd9zQc.js";
|
|
2
|
+
import { R as juniorConversations } from "./executor-DBMBrpNV.js";
|
|
3
3
|
import { desc, eq, sql } from "drizzle-orm";
|
|
4
4
|
// src/chat/conversations/lineage.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as withScope, d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException } from "./sentry-CPbZjomA.js";
|
|
2
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-DCdMMx_0.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
5
|
import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import { $t as readChildConversationSender, Bt as getActiveAgentInvocationForConversation, Cn as findChildAgentConversationId, Sn as AgentMessageTargetError, Tn as PARENT_AGENT_TARGET, Ut as getLatestAgentInvocationForConversation, un as enqueueAgentInvocation, vn as createAgentInvocationForMessage, xn as AgentMessagePausedError } from "./warmup-
|
|
4
|
-
import { a as enqueueAgentMessageToParent } from "./result-
|
|
5
|
-
import {
|
|
6
|
-
import { Z as renderUntrustedTag, n as botConfig } from "./config-
|
|
7
|
-
import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-
|
|
8
|
-
import { $ as postAutomatedTurnLimitNoticeForConversation, F as EVENT_WAIT_MS, ot as admitAutomatedTurn } from "./session-stop-
|
|
9
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
2
|
+
import { F as actorFromRun, I as toolInvocationDestination } from "./agent-runner-DdFcxAxG.js";
|
|
3
|
+
import { $t as readChildConversationSender, Bt as getActiveAgentInvocationForConversation, Cn as findChildAgentConversationId, Sn as AgentMessageTargetError, Tn as PARENT_AGENT_TARGET, Ut as getLatestAgentInvocationForConversation, un as enqueueAgentInvocation, vn as createAgentInvocationForMessage, xn as AgentMessagePausedError } from "./warmup-CxhEhm71.js";
|
|
4
|
+
import { a as enqueueAgentMessageToParent } from "./result-DddO63S9.js";
|
|
5
|
+
import { Wa as canAccessConversation, qa as readConversationAccessFromSql } from "./projection-xPpvqexa.js";
|
|
6
|
+
import { Z as renderUntrustedTag, n as botConfig } from "./config-362yMSIz.js";
|
|
7
|
+
import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-Bcbd9zQc.js";
|
|
8
|
+
import { $ as postAutomatedTurnLimitNoticeForConversation, F as EVENT_WAIT_MS, ot as admitAutomatedTurn } from "./session-stop-BDdwyZaa.js";
|
|
9
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-CdWg2r2L.js";
|
|
10
10
|
// src/chat/agent-invocations/top-level-message.ts
|
|
11
11
|
const AGENT_MESSAGE_EVENT_NAMESPACE = "junior";
|
|
12
12
|
/** Event type of a message from another top-level agent. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { s as getSqlExecutor } from "./db-
|
|
3
|
-
import { h as isVisionImageMediaType, m as detectImageMediaType } from "./web-message-id-
|
|
4
|
-
import {
|
|
2
|
+
import { s as getSqlExecutor } from "./db-Bcbd9zQc.js";
|
|
3
|
+
import { h as isVisionImageMediaType, m as detectImageMediaType } from "./web-message-id-BT8Mg8LL.js";
|
|
4
|
+
import { bo as readLiveAttachment } from "./projection-xPpvqexa.js";
|
|
5
5
|
// src/chat/attachments/model-input.ts
|
|
6
6
|
var model_input_exports = /* @__PURE__ */ __exportAll({ loadInputAttachments: () => loadInputAttachments });
|
|
7
7
|
/** Largest file that Slack and web send to the model in the prompt. */
|
package/dist/nitro.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as JuniorPluginSet } from "./plugins-
|
|
2
|
-
import { i as JuniorDashboardOptions } from "./app-
|
|
1
|
+
import { n as JuniorPluginSet } from "./plugins-fBrz8PCV.js";
|
|
2
|
+
import { i as JuniorDashboardOptions } from "./app-EZur8cVC.js";
|
|
3
3
|
import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
|
|
4
4
|
type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
|
|
5
5
|
type SentryNitroOptions = NonNullable<Parameters<typeof withSentryConfig$1>[1]>;
|
package/dist/nitro.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-x4AvVhMj.js";
|
|
2
2
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-Bkk0XRo2.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
5
|
-
import {
|
|
6
|
-
import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, B as getDeploymentServiceVersion, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE } from "./logging-oYpJYr-S.js";
|
|
3
|
+
import { a as CACHE_WARMUP_QUEUE_TOPIC, h as resolveConversationWorkQueueTopic, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./background-compaction-queue-BhEe4UfU.js";
|
|
4
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BcjAYWyB.js";
|
|
5
|
+
import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, B as getDeploymentServiceVersion, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE } from "./logging-CHCuQ5iz.js";
|
|
7
6
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cv2ETe8Y.js";
|
|
8
7
|
import path from "node:path";
|
|
9
8
|
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
2
|
-
import {
|
|
1
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-D6aFARKE.js";
|
|
2
|
+
import { bn as createUserTokenStore } from "./projection-xPpvqexa.js";
|
|
3
3
|
import { createServer } from "node:http";
|
|
4
4
|
// src/chat/local/oauth-callback-server.ts
|
|
5
5
|
const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
2
|
+
import { d as readJuniorSecret } from "./task-queue-BcjAYWyB.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { randomBytes } from "node:crypto";
|
|
5
5
|
import { SignJWT, jwtVerify } from "jose";
|
|
@@ -50,6 +50,7 @@ type PluginCredentialConfig = PluginCredentialConfigBase & {
|
|
|
50
50
|
interface PluginManifestConfig {
|
|
51
51
|
displayName?: string;
|
|
52
52
|
description?: string;
|
|
53
|
+
reviewContext?: string | null;
|
|
53
54
|
configKeys?: string[];
|
|
54
55
|
domains?: string[] | null;
|
|
55
56
|
apiHeaders?: Record<string, string | null> | null;
|
|
@@ -77,6 +78,7 @@ interface PluginManifestConfig {
|
|
|
77
78
|
configKey?: string;
|
|
78
79
|
commandFlags?: string[] | null;
|
|
79
80
|
} | null;
|
|
81
|
+
toolsSendNoCredential?: boolean | null;
|
|
80
82
|
}
|
|
81
83
|
type JuniorPluginInput = PluginRegistration | string;
|
|
82
84
|
interface JuniorPluginSetOptions {
|