@sentry/junior 0.98.0 → 0.100.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-OSW6C3CJ.js → agent-hooks-V6KU7PQN.js} +6 -5
- package/dist/api/activity.d.ts +14 -0
- package/dist/api/conversations/aggregate.d.ts +16 -0
- package/dist/api/conversations/detail-projection.d.ts +1 -0
- package/dist/api/conversations/list.d.ts +7 -2
- package/dist/api/conversations/list.query.d.ts +12 -3
- package/dist/api/conversations/projection.d.ts +1 -0
- package/dist/api/conversations/reporting.d.ts +42 -0
- package/dist/api/conversations/schema.d.ts +7 -7
- package/dist/api/conversations/stats.query.d.ts +1 -1
- package/dist/api/locations/detail.d.ts +81 -0
- package/dist/api/locations/list.d.ts +30 -0
- package/dist/api/locations/query.d.ts +5 -0
- package/dist/api/locations/schema.d.ts +175 -0
- package/dist/api/people/list.query.d.ts +1 -1
- package/dist/api/people/profile.query.d.ts +1 -1
- package/dist/api/people/schema.d.ts +10 -14
- package/dist/api/people/shared.d.ts +38 -78
- package/dist/api/schema.d.ts +11 -0
- package/dist/api/schema.js +16 -3
- package/dist/api-reference.d.ts +1 -1
- package/dist/api.js +41 -13
- package/dist/app.js +35 -27
- package/dist/chat/agent/request.d.ts +3 -0
- package/dist/chat/config.d.ts +2 -0
- package/dist/chat/reasoning-level.d.ts +4 -0
- package/dist/chat/services/context-compaction.d.ts +1 -0
- package/dist/chat/services/{turn-thinking-level.d.ts → turn-reasoning-level.d.ts} +11 -10
- package/dist/chat/services/turn-result.d.ts +3 -3
- package/dist/chat/tools/search-tools.d.ts +2 -2
- package/dist/{chunk-UAMKJPDF.js → chunk-2RNOB32R.js} +7 -1
- package/dist/{chunk-NJEDJFK4.js → chunk-2T7DCRAW.js} +1 -1
- package/dist/{chunk-DPHWDS6I.js → chunk-45DMFMY2.js} +81 -69
- package/dist/chunk-4AQUWWEM.js +75 -0
- package/dist/{chunk-EEZCY5WX.js → chunk-A7X2FDUO.js} +18 -2
- package/dist/{chunk-WTYEKPXU.js → chunk-FP5N5OWZ.js} +1 -1
- package/dist/chunk-FXFQNHRU.js +48 -0
- package/dist/chunk-GEUUJRQF.js +102 -0
- package/dist/{chunk-CRQVIHDI.js → chunk-IDZBM3NW.js} +2 -8
- package/dist/{chunk-DHHU2WSG.js → chunk-IQIBZXGB.js} +2 -2
- package/dist/{chunk-OL6XQ23W.js → chunk-IVXL57YF.js} +3 -3
- package/dist/{chunk-IO65E4ZD.js → chunk-JPQISMMJ.js} +3 -3
- package/dist/{chunk-KJHAW6VE.js → chunk-JSAANELJ.js} +28 -9
- package/dist/{chunk-EUZ44ROE.js → chunk-MM5UFDAC.js} +1 -3
- package/dist/{chunk-WJ7STXT6.js → chunk-NSOCZGOH.js} +3 -3
- package/dist/chunk-PGGEOCQY.js +77 -0
- package/dist/{chunk-EOWXRY5E.js → chunk-PWC24W5F.js} +1 -1
- package/dist/chunk-QOZOJNSE.js +96 -0
- package/dist/chunk-QSBQJ3PA.js +275 -0
- package/dist/{chunk-FTTFV6DC.js → chunk-TPTJEHUE.js} +4 -4
- package/dist/{chunk-OGHXZ4KQ.js → chunk-VHRM6GNH.js} +88 -122
- package/dist/{chunk-NG2AV7IB.js → chunk-VVIXK2BX.js} +1 -1
- package/dist/{chunk-6HHEZENZ.js → chunk-VY7BT4SM.js} +16 -7
- package/dist/{chunk-H66UCBPW.js → chunk-XJA7BPHS.js} +1 -1
- package/dist/{chunk-ER45IV77.js → chunk-XSBIISXS.js} +9 -9
- package/dist/cli/chat.js +15 -14
- package/dist/cli/plugins.js +6 -5
- package/dist/cli/snapshot-warmup.js +2 -2
- package/dist/cli/upgrade.js +8 -7
- package/dist/db/schema/conversations.d.ts +17 -0
- package/dist/db/schema/destinations.d.ts +12 -3
- package/dist/db/schema.d.ts +19 -2
- package/dist/{db-GFSCDAHS.js → db-RCZB7KNM.js} +3 -2
- package/dist/detail-5SLCGT6J.js +29 -0
- package/dist/{detail-W4ZSD45K.js → detail-LU6COZO6.js} +11 -10
- package/dist/{legacy-import-6WWXMALY.js → legacy-import-VCYLWT2V.js} +4 -3
- package/dist/list-2FI5SFV7.js +80 -0
- package/dist/list-4ALSU6ZW.js +30 -0
- package/dist/{list-3KZNG3SJ.js → list-KHRAWZWU.js} +11 -8
- package/dist/{plugin-conversations-ZYRWZYEA.js → plugin-conversations-JANXC4GA.js} +7 -6
- package/dist/profile-3O3OVENT.js +212 -0
- package/dist/{runner-267ZRLZD.js → runner-BM7D35YW.js} +12 -11
- package/dist/stats-J3YGCYDF.js +174 -0
- package/dist/{subagent-5HZPQC7V.js → subagent-P7HOSMVC.js} +10 -9
- package/migrations/0003_peaceful_scalphunter.sql +4 -0
- package/migrations/meta/0003_snapshot.json +1035 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +5 -5
- package/dist/chunk-CV22LUIV.js +0 -261
- package/dist/list-M5BRWW3D.js +0 -92
- package/dist/profile-UEIRSVT3.js +0 -146
- package/dist/stats-L62E4O4U.js +0 -207
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
conversationSummaryFromStoredConversation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JSAANELJ.js";
|
|
4
4
|
import {
|
|
5
5
|
buildSentryConversationUrl,
|
|
6
6
|
buildSentryTraceUrl
|
|
@@ -8,15 +8,16 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
loadProjection,
|
|
10
10
|
projectSteps
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IQIBZXGB.js";
|
|
12
12
|
import {
|
|
13
13
|
getAgentStepStore,
|
|
14
14
|
getConversationMessageStore
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VHRM6GNH.js";
|
|
16
16
|
import {
|
|
17
|
+
stripRuntimeTurnContext,
|
|
17
18
|
unescapeXml,
|
|
18
19
|
unwrapCurrentInstruction
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-A7X2FDUO.js";
|
|
20
21
|
import {
|
|
21
22
|
canExposeConversationPayload
|
|
22
23
|
} from "./chunk-LVA4I4H7.js";
|
|
@@ -449,12 +450,19 @@ function historyContent(args) {
|
|
|
449
450
|
(step) => step.entry.type === "context_epoch_started"
|
|
450
451
|
);
|
|
451
452
|
const projection = projectSteps(steps);
|
|
452
|
-
const projected =
|
|
453
|
+
const projected = [];
|
|
454
|
+
const projectedProvenance = [];
|
|
455
|
+
projection.messages.forEach((message, index) => {
|
|
456
|
+
for (const retained of stripRuntimeTurnContext([message])) {
|
|
457
|
+
projected.push(retained);
|
|
458
|
+
projectedProvenance.push(projection.provenance[index]);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
453
461
|
const replacementSummaryIndex = marker?.entry.reason === "compaction" ? summaryIndex(
|
|
454
462
|
projected,
|
|
455
|
-
|
|
463
|
+
projectedProvenance,
|
|
456
464
|
COMPACTION_SUMMARY_PREFIXES
|
|
457
|
-
) : marker?.entry.reason === "handoff" ? summaryIndex(projected,
|
|
465
|
+
) : marker?.entry.reason === "handoff" ? summaryIndex(projected, projectedProvenance, [
|
|
458
466
|
MODEL_HANDOFF_SUMMARY_PREFIX
|
|
459
467
|
]) : -1;
|
|
460
468
|
const summary = replacementSummaryIndex >= 0 ? summaryAfterPrefix(
|
|
@@ -556,6 +564,7 @@ async function buildConversationDetail(args) {
|
|
|
556
564
|
...conversationSummaryFromStoredConversation({
|
|
557
565
|
conversation,
|
|
558
566
|
durationMs: args.durationMs,
|
|
567
|
+
...args.locationId ? { locationId: args.locationId } : {},
|
|
559
568
|
usage: args.usage
|
|
560
569
|
}),
|
|
561
570
|
...traceId ? { traceId } : {},
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
getPersistedThreadState,
|
|
10
10
|
markTurnCompleted,
|
|
11
11
|
mergeArtifactsState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NSOCZGOH.js";
|
|
13
13
|
import {
|
|
14
14
|
coerceThreadConversationState
|
|
15
15
|
} from "./chunk-6DTVCPLO.js";
|
|
16
16
|
import {
|
|
17
17
|
getAgentTurnSessionRecord
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IVXL57YF.js";
|
|
19
19
|
import {
|
|
20
20
|
generateConversationId,
|
|
21
21
|
hydrateConversationMessages,
|
|
@@ -23,19 +23,19 @@ import {
|
|
|
23
23
|
normalizeConversationText,
|
|
24
24
|
updateConversationStats,
|
|
25
25
|
upsertConversationMessage
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-JPQISMMJ.js";
|
|
27
27
|
import {
|
|
28
28
|
createPluginEmbedder,
|
|
29
29
|
createPluginModel,
|
|
30
30
|
getPlugins
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-TPTJEHUE.js";
|
|
32
32
|
import {
|
|
33
33
|
createPluginLogger,
|
|
34
34
|
createPluginState
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-PWC24W5F.js";
|
|
36
36
|
import {
|
|
37
37
|
getDb
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-VHRM6GNH.js";
|
|
39
39
|
import {
|
|
40
40
|
GEN_AI_PROVIDER_NAME,
|
|
41
41
|
botConfig,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
isToolResultMessage,
|
|
47
47
|
normalizeToolNameFromResult,
|
|
48
48
|
stripRuntimeTurnContext
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-A7X2FDUO.js";
|
|
50
50
|
import {
|
|
51
51
|
buildTurnFailureResponse
|
|
52
52
|
} from "./chunk-I35CTGPO.js";
|
|
@@ -105,8 +105,8 @@ function getAgentTurnDiagnosticsAttributes(reply) {
|
|
|
105
105
|
"app.ai.tool_error_results": reply.diagnostics.toolErrorCount,
|
|
106
106
|
"app.ai.tool_call_count": reply.diagnostics.toolCalls.length,
|
|
107
107
|
"app.ai.used_primary_text": reply.diagnostics.usedPrimaryText,
|
|
108
|
-
...reply.diagnostics.
|
|
109
|
-
"gen_ai.request.reasoning.level": reply.diagnostics.
|
|
108
|
+
...reply.diagnostics.reasoningLevel ? {
|
|
109
|
+
"gen_ai.request.reasoning.level": reply.diagnostics.reasoningLevel
|
|
110
110
|
} : {},
|
|
111
111
|
...reply.diagnostics.stopReason ? {
|
|
112
112
|
"gen_ai.response.finish_reasons": [reply.diagnostics.stopReason]
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAgentRunner,
|
|
3
3
|
executeAgentRun
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-45DMFMY2.js";
|
|
5
|
+
import "../chunk-NSOCZGOH.js";
|
|
6
6
|
import "../chunk-6DTVCPLO.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-IVXL57YF.js";
|
|
8
|
+
import "../chunk-IQIBZXGB.js";
|
|
9
|
+
import "../chunk-JPQISMMJ.js";
|
|
10
|
+
import "../chunk-XJA7BPHS.js";
|
|
11
11
|
import "../chunk-PDO5BLNM.js";
|
|
12
12
|
import "../chunk-CM5EZD5F.js";
|
|
13
13
|
import {
|
|
14
14
|
loadAppPluginSet
|
|
15
15
|
} from "../chunk-Y2CM7HXH.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-TPTJEHUE.js";
|
|
17
|
+
import "../chunk-FP5N5OWZ.js";
|
|
18
|
+
import "../chunk-PWC24W5F.js";
|
|
19
|
+
import "../chunk-VHRM6GNH.js";
|
|
20
20
|
import "../chunk-G3E7SCME.js";
|
|
21
21
|
import "../chunk-4ZNGQH7C.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-A7X2FDUO.js";
|
|
23
|
+
import "../chunk-FXFQNHRU.js";
|
|
23
24
|
import "../chunk-LVA4I4H7.js";
|
|
24
25
|
import "../chunk-B7PUBQQM.js";
|
|
25
26
|
import "../chunk-3ECW2K2O.js";
|
|
@@ -152,10 +153,10 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
152
153
|
databaseModule
|
|
153
154
|
] = await Promise.all([
|
|
154
155
|
import("../plugins-PZMDS7AT.js"),
|
|
155
|
-
import("../agent-hooks-
|
|
156
|
+
import("../agent-hooks-V6KU7PQN.js"),
|
|
156
157
|
import("../catalog-runtime-PFHVMHDR.js"),
|
|
157
158
|
import("../validation-FMEAEKCY.js"),
|
|
158
|
-
import("../db-
|
|
159
|
+
import("../db-RCZB7KNM.js")
|
|
159
160
|
]);
|
|
160
161
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
161
162
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -216,7 +217,7 @@ function newRunConversationId() {
|
|
|
216
217
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
217
218
|
defaultStateAdapterForLocalChat();
|
|
218
219
|
await configureLocalChatPlugins(pluginSet);
|
|
219
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
220
|
+
const { runLocalAgentTurn } = await import("../runner-BM7D35YW.js");
|
|
220
221
|
const deps = {
|
|
221
222
|
agentRunner: createAgentRunner(executeAgentRun),
|
|
222
223
|
deliverReply: async (reply) => {
|
package/dist/cli/plugins.js
CHANGED
|
@@ -13,17 +13,18 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
setPlugins,
|
|
15
15
|
validatePlugins
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-TPTJEHUE.js";
|
|
17
|
+
import "../chunk-FP5N5OWZ.js";
|
|
18
18
|
import {
|
|
19
19
|
createPluginLogger
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-PWC24W5F.js";
|
|
21
21
|
import {
|
|
22
22
|
getDb
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-VHRM6GNH.js";
|
|
24
24
|
import "../chunk-G3E7SCME.js";
|
|
25
25
|
import "../chunk-4ZNGQH7C.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-A7X2FDUO.js";
|
|
27
|
+
import "../chunk-FXFQNHRU.js";
|
|
27
28
|
import "../chunk-LVA4I4H7.js";
|
|
28
29
|
import "../chunk-B7PUBQQM.js";
|
|
29
30
|
import {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveRuntimeDependencySnapshot
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-XJA7BPHS.js";
|
|
4
4
|
import "../chunk-G3E7SCME.js";
|
|
5
5
|
import "../chunk-4ZNGQH7C.js";
|
|
6
6
|
import {
|
|
7
7
|
disconnectStateAdapter
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-A7X2FDUO.js";
|
|
9
9
|
import "../chunk-LVA4I4H7.js";
|
|
10
10
|
import {
|
|
11
11
|
pluginCatalogRuntime
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
recordConversationActivity,
|
|
5
5
|
recordConversationExecution,
|
|
6
6
|
requestConversationWork
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-2T7DCRAW.js";
|
|
8
8
|
import {
|
|
9
9
|
defineJuniorPlugins,
|
|
10
10
|
pluginCatalogConfigFromEnv,
|
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
addAgentTurnUsage,
|
|
20
20
|
listAgentTurnSessionSummariesForConversations
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-IVXL57YF.js";
|
|
22
|
+
import "../chunk-IQIBZXGB.js";
|
|
23
23
|
import {
|
|
24
24
|
importConversationFromLegacy
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-JPQISMMJ.js";
|
|
26
26
|
import "../chunk-PDO5BLNM.js";
|
|
27
27
|
import {
|
|
28
28
|
loadAppPluginSet
|
|
@@ -30,18 +30,19 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
createPluginLogger,
|
|
32
32
|
createPluginState
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-PWC24W5F.js";
|
|
34
34
|
import {
|
|
35
35
|
createJuniorSqlExecutor,
|
|
36
36
|
createSqlConversationMessageStore,
|
|
37
37
|
createSqlStore,
|
|
38
38
|
getDb
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-VHRM6GNH.js";
|
|
40
40
|
import {
|
|
41
41
|
disconnectStateAdapter,
|
|
42
42
|
getChatConfig,
|
|
43
43
|
getConnectedStateContext
|
|
44
|
-
} from "../chunk-
|
|
44
|
+
} from "../chunk-A7X2FDUO.js";
|
|
45
|
+
import "../chunk-FXFQNHRU.js";
|
|
45
46
|
import "../chunk-LVA4I4H7.js";
|
|
46
47
|
import {
|
|
47
48
|
parseDestination,
|
|
@@ -575,6 +575,23 @@ export declare const juniorConversations: import("drizzle-orm/pg-core").PgTableW
|
|
|
575
575
|
} | undefined;
|
|
576
576
|
};
|
|
577
577
|
}>;
|
|
578
|
+
metricRunId: import("drizzle-orm/pg-core").PgColumn<{
|
|
579
|
+
name: "metric_run_id";
|
|
580
|
+
tableName: "junior_conversations";
|
|
581
|
+
dataType: "string";
|
|
582
|
+
columnType: "PgText";
|
|
583
|
+
data: string;
|
|
584
|
+
driverParam: string;
|
|
585
|
+
notNull: false;
|
|
586
|
+
hasDefault: false;
|
|
587
|
+
isPrimaryKey: false;
|
|
588
|
+
isAutoincrement: false;
|
|
589
|
+
hasRuntimeDefault: false;
|
|
590
|
+
enumValues: [string, ...string[]];
|
|
591
|
+
baseColumn: never;
|
|
592
|
+
identity: undefined;
|
|
593
|
+
generated: undefined;
|
|
594
|
+
}, {}, {}>;
|
|
578
595
|
};
|
|
579
596
|
dialect: "pg";
|
|
580
597
|
}>;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const juniorDestinationKindSchema: z.ZodEnum<{
|
|
3
|
+
channel: "channel";
|
|
4
|
+
dm: "dm";
|
|
5
|
+
group: "group";
|
|
6
|
+
local_conversation: "local_conversation";
|
|
7
|
+
thread: "thread";
|
|
8
|
+
web_session: "web_session";
|
|
9
|
+
}>;
|
|
10
|
+
export type JuniorDestinationKind = z.infer<typeof juniorDestinationKindSchema>;
|
|
2
11
|
export type JuniorDestinationVisibility = "direct" | "private" | "public" | "unknown";
|
|
3
12
|
export declare const juniorDestinations: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
13
|
name: "junior_destinations";
|
|
@@ -77,7 +86,7 @@ export declare const juniorDestinations: import("drizzle-orm/pg-core").PgTableWi
|
|
|
77
86
|
tableName: "junior_destinations";
|
|
78
87
|
dataType: "string";
|
|
79
88
|
columnType: "PgText";
|
|
80
|
-
data:
|
|
89
|
+
data: "channel" | "dm" | "group" | "local_conversation" | "thread" | "web_session";
|
|
81
90
|
driverParam: string;
|
|
82
91
|
notNull: true;
|
|
83
92
|
hasDefault: false;
|
|
@@ -89,7 +98,7 @@ export declare const juniorDestinations: import("drizzle-orm/pg-core").PgTableWi
|
|
|
89
98
|
identity: undefined;
|
|
90
99
|
generated: undefined;
|
|
91
100
|
}, {}, {
|
|
92
|
-
$type:
|
|
101
|
+
$type: "channel" | "dm" | "group" | "local_conversation" | "thread" | "web_session";
|
|
93
102
|
}>;
|
|
94
103
|
parentDestinationId: import("drizzle-orm/pg-core").PgColumn<{
|
|
95
104
|
name: "parent_destination_id";
|
package/dist/db/schema.d.ts
CHANGED
|
@@ -857,6 +857,23 @@ export declare const juniorSqlSchema: {
|
|
|
857
857
|
} | undefined;
|
|
858
858
|
};
|
|
859
859
|
}>;
|
|
860
|
+
metricRunId: import("drizzle-orm/pg-core").PgColumn<{
|
|
861
|
+
name: "metric_run_id";
|
|
862
|
+
tableName: "junior_conversations";
|
|
863
|
+
dataType: "string";
|
|
864
|
+
columnType: "PgText";
|
|
865
|
+
data: string;
|
|
866
|
+
driverParam: string;
|
|
867
|
+
notNull: false;
|
|
868
|
+
hasDefault: false;
|
|
869
|
+
isPrimaryKey: false;
|
|
870
|
+
isAutoincrement: false;
|
|
871
|
+
hasRuntimeDefault: false;
|
|
872
|
+
enumValues: [string, ...string[]];
|
|
873
|
+
baseColumn: never;
|
|
874
|
+
identity: undefined;
|
|
875
|
+
generated: undefined;
|
|
876
|
+
}, {}, {}>;
|
|
860
877
|
};
|
|
861
878
|
dialect: "pg";
|
|
862
879
|
}>;
|
|
@@ -937,7 +954,7 @@ export declare const juniorSqlSchema: {
|
|
|
937
954
|
tableName: "junior_destinations";
|
|
938
955
|
dataType: "string";
|
|
939
956
|
columnType: "PgText";
|
|
940
|
-
data:
|
|
957
|
+
data: "channel" | "dm" | "group" | "local_conversation" | "thread" | "web_session";
|
|
941
958
|
driverParam: string;
|
|
942
959
|
notNull: true;
|
|
943
960
|
hasDefault: false;
|
|
@@ -949,7 +966,7 @@ export declare const juniorSqlSchema: {
|
|
|
949
966
|
identity: undefined;
|
|
950
967
|
generated: undefined;
|
|
951
968
|
}, {}, {
|
|
952
|
-
$type:
|
|
969
|
+
$type: "channel" | "dm" | "group" | "local_conversation" | "thread" | "web_session";
|
|
953
970
|
}>;
|
|
954
971
|
parentDestinationId: import("drizzle-orm/pg-core").PgColumn<{
|
|
955
972
|
name: "parent_destination_id";
|
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
getConversationStore,
|
|
7
7
|
getDb,
|
|
8
8
|
getSqlExecutor
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-VHRM6GNH.js";
|
|
10
|
+
import "./chunk-A7X2FDUO.js";
|
|
11
|
+
import "./chunk-FXFQNHRU.js";
|
|
11
12
|
import "./chunk-LVA4I4H7.js";
|
|
12
13
|
import "./chunk-B7PUBQQM.js";
|
|
13
14
|
import "./chunk-I35CTGPO.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readLocationDetailFromSql
|
|
3
|
+
} from "./chunk-QSBQJ3PA.js";
|
|
4
|
+
import "./chunk-QOZOJNSE.js";
|
|
5
|
+
import "./chunk-PGGEOCQY.js";
|
|
6
|
+
import {
|
|
7
|
+
locationDetailReportSchema
|
|
8
|
+
} from "./chunk-4AQUWWEM.js";
|
|
9
|
+
import "./chunk-MM5UFDAC.js";
|
|
10
|
+
import "./chunk-PDO5BLNM.js";
|
|
11
|
+
import "./chunk-VHRM6GNH.js";
|
|
12
|
+
import "./chunk-A7X2FDUO.js";
|
|
13
|
+
import "./chunk-FXFQNHRU.js";
|
|
14
|
+
import "./chunk-LVA4I4H7.js";
|
|
15
|
+
import "./chunk-B7PUBQQM.js";
|
|
16
|
+
import "./chunk-I35CTGPO.js";
|
|
17
|
+
import "./chunk-OB42YVAE.js";
|
|
18
|
+
import "./chunk-6GWA276C.js";
|
|
19
|
+
import "./chunk-7FBGKXPE.js";
|
|
20
|
+
import "./chunk-MLKGABMK.js";
|
|
21
|
+
|
|
22
|
+
// src/api/locations/detail.ts
|
|
23
|
+
async function readLocationDetail(locationId) {
|
|
24
|
+
const report = await readLocationDetailFromSql(locationId);
|
|
25
|
+
return report ? locationDetailReportSchema.parse(report) : void 0;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
readLocationDetail
|
|
29
|
+
};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildConversationDetail
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VY7BT4SM.js";
|
|
4
4
|
import {
|
|
5
5
|
readConversationRecordFromSql
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JSAANELJ.js";
|
|
7
7
|
import {
|
|
8
8
|
conversationDetailReportSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MM5UFDAC.js";
|
|
10
10
|
import "./chunk-LVUKF5CE.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-VVIXK2BX.js";
|
|
12
12
|
import {
|
|
13
13
|
listBoundedAgentTurnSessionSummariesForConversation
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-IVXL57YF.js";
|
|
15
|
+
import "./chunk-IQIBZXGB.js";
|
|
16
|
+
import "./chunk-JPQISMMJ.js";
|
|
17
17
|
import "./chunk-PDO5BLNM.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-FP5N5OWZ.js";
|
|
19
|
+
import "./chunk-VHRM6GNH.js";
|
|
20
20
|
import "./chunk-4ZNGQH7C.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-A7X2FDUO.js";
|
|
22
|
+
import "./chunk-FXFQNHRU.js";
|
|
22
23
|
import "./chunk-LVA4I4H7.js";
|
|
23
24
|
import "./chunk-B7PUBQQM.js";
|
|
24
25
|
import {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureLegacyConversationImport,
|
|
3
3
|
importConversationFromLegacy
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-JPQISMMJ.js";
|
|
5
|
+
import "./chunk-VHRM6GNH.js";
|
|
6
|
+
import "./chunk-A7X2FDUO.js";
|
|
7
|
+
import "./chunk-FXFQNHRU.js";
|
|
7
8
|
import "./chunk-LVA4I4H7.js";
|
|
8
9
|
import "./chunk-B7PUBQQM.js";
|
|
9
10
|
import "./chunk-I35CTGPO.js";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
verifiedActorWhere
|
|
3
|
+
} from "./chunk-GEUUJRQF.js";
|
|
4
|
+
import {
|
|
5
|
+
conversationActiveDaysColumn,
|
|
6
|
+
conversationAggregateColumns,
|
|
7
|
+
conversationRangeColumns
|
|
8
|
+
} from "./chunk-PGGEOCQY.js";
|
|
9
|
+
import {
|
|
10
|
+
actorDirectoryReportSchema
|
|
11
|
+
} from "./chunk-IDZBM3NW.js";
|
|
12
|
+
import "./chunk-MM5UFDAC.js";
|
|
13
|
+
import "./chunk-PDO5BLNM.js";
|
|
14
|
+
import {
|
|
15
|
+
getDb,
|
|
16
|
+
juniorConversations,
|
|
17
|
+
juniorIdentities,
|
|
18
|
+
juniorUsers
|
|
19
|
+
} from "./chunk-VHRM6GNH.js";
|
|
20
|
+
import "./chunk-A7X2FDUO.js";
|
|
21
|
+
import "./chunk-FXFQNHRU.js";
|
|
22
|
+
import "./chunk-LVA4I4H7.js";
|
|
23
|
+
import "./chunk-B7PUBQQM.js";
|
|
24
|
+
import "./chunk-I35CTGPO.js";
|
|
25
|
+
import "./chunk-OB42YVAE.js";
|
|
26
|
+
import "./chunk-6GWA276C.js";
|
|
27
|
+
import "./chunk-7FBGKXPE.js";
|
|
28
|
+
import "./chunk-MLKGABMK.js";
|
|
29
|
+
|
|
30
|
+
// src/api/people/list.query.ts
|
|
31
|
+
import { eq, sql } from "drizzle-orm";
|
|
32
|
+
async function readPeopleListFromSql() {
|
|
33
|
+
const nowMs = Date.now();
|
|
34
|
+
const rows = await getDb().select({
|
|
35
|
+
email: juniorUsers.primaryEmailNormalized,
|
|
36
|
+
fullName: juniorUsers.displayName,
|
|
37
|
+
slackUserId: sql`MAX(${juniorIdentities.providerSubjectId})`,
|
|
38
|
+
slackUserName: sql`MAX(${juniorIdentities.handle})`,
|
|
39
|
+
activeDays: conversationActiveDaysColumn(),
|
|
40
|
+
...conversationAggregateColumns(),
|
|
41
|
+
...conversationRangeColumns()
|
|
42
|
+
}).from(juniorConversations).innerJoin(
|
|
43
|
+
juniorIdentities,
|
|
44
|
+
eq(juniorIdentities.id, juniorConversations.actorIdentityId)
|
|
45
|
+
).innerJoin(juniorUsers, eq(juniorUsers.id, juniorIdentities.userId)).where(verifiedActorWhere()).groupBy(juniorUsers.primaryEmailNormalized, juniorUsers.displayName);
|
|
46
|
+
const people = rows.map((row) => {
|
|
47
|
+
const actor = {
|
|
48
|
+
email: row.email,
|
|
49
|
+
...row.fullName ? { fullName: row.fullName } : {},
|
|
50
|
+
...row.slackUserId ? { slackUserId: row.slackUserId } : {},
|
|
51
|
+
...row.slackUserName ? { slackUserName: row.slackUserName } : {}
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
active: row.active,
|
|
55
|
+
activeDays: row.activeDays,
|
|
56
|
+
conversations: row.conversations,
|
|
57
|
+
durationMs: row.durationMs,
|
|
58
|
+
failed: row.failed,
|
|
59
|
+
firstSeenAt: row.firstSeenAt.toISOString(),
|
|
60
|
+
lastSeenAt: row.lastSeenAt.toISOString(),
|
|
61
|
+
actor,
|
|
62
|
+
...row.tokens !== null ? { tokens: row.tokens } : {}
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
generatedAt: new Date(nowMs).toISOString(),
|
|
67
|
+
people: people.sort(
|
|
68
|
+
(left, right) => Date.parse(right.lastSeenAt) - Date.parse(left.lastSeenAt) || right.conversations - left.conversations || left.actor.email.localeCompare(right.actor.email)
|
|
69
|
+
),
|
|
70
|
+
source: "conversation_index"
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// src/api/people/list.ts
|
|
75
|
+
async function readPeopleList() {
|
|
76
|
+
return actorDirectoryReportSchema.parse(await readPeopleListFromSql());
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
readPeopleList
|
|
80
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readLocationDirectoryFromSql
|
|
3
|
+
} from "./chunk-QSBQJ3PA.js";
|
|
4
|
+
import "./chunk-QOZOJNSE.js";
|
|
5
|
+
import "./chunk-PGGEOCQY.js";
|
|
6
|
+
import {
|
|
7
|
+
locationDirectoryReportSchema
|
|
8
|
+
} from "./chunk-4AQUWWEM.js";
|
|
9
|
+
import "./chunk-MM5UFDAC.js";
|
|
10
|
+
import "./chunk-PDO5BLNM.js";
|
|
11
|
+
import "./chunk-VHRM6GNH.js";
|
|
12
|
+
import "./chunk-A7X2FDUO.js";
|
|
13
|
+
import "./chunk-FXFQNHRU.js";
|
|
14
|
+
import "./chunk-LVA4I4H7.js";
|
|
15
|
+
import "./chunk-B7PUBQQM.js";
|
|
16
|
+
import "./chunk-I35CTGPO.js";
|
|
17
|
+
import "./chunk-OB42YVAE.js";
|
|
18
|
+
import "./chunk-6GWA276C.js";
|
|
19
|
+
import "./chunk-7FBGKXPE.js";
|
|
20
|
+
import "./chunk-MLKGABMK.js";
|
|
21
|
+
|
|
22
|
+
// src/api/locations/list.ts
|
|
23
|
+
async function readLocationDirectory() {
|
|
24
|
+
return locationDirectoryReportSchema.parse(
|
|
25
|
+
await readLocationDirectoryFromSql()
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
readLocationDirectory
|
|
30
|
+
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readConversationFeedFromSql
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JSAANELJ.js";
|
|
4
4
|
import {
|
|
5
5
|
conversationFeedSchema
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-MM5UFDAC.js";
|
|
7
|
+
import "./chunk-VVIXK2BX.js";
|
|
8
8
|
import "./chunk-PDO5BLNM.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-FP5N5OWZ.js";
|
|
10
|
+
import "./chunk-VHRM6GNH.js";
|
|
11
11
|
import "./chunk-4ZNGQH7C.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-A7X2FDUO.js";
|
|
13
|
+
import "./chunk-FXFQNHRU.js";
|
|
13
14
|
import "./chunk-LVA4I4H7.js";
|
|
14
15
|
import "./chunk-B7PUBQQM.js";
|
|
15
16
|
import "./chunk-I35CTGPO.js";
|
|
@@ -19,8 +20,10 @@ import "./chunk-7FBGKXPE.js";
|
|
|
19
20
|
import "./chunk-MLKGABMK.js";
|
|
20
21
|
|
|
21
22
|
// src/api/conversations/list.ts
|
|
22
|
-
async function readConversationFeed() {
|
|
23
|
-
return conversationFeedSchema.parse(
|
|
23
|
+
async function readConversationFeed(options = {}) {
|
|
24
|
+
return conversationFeedSchema.parse(
|
|
25
|
+
await readConversationFeedFromSql({ actorEmail: options.actorEmail })
|
|
26
|
+
);
|
|
24
27
|
}
|
|
25
28
|
export {
|
|
26
29
|
readConversationFeed
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readConversationFeedFromSql
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JSAANELJ.js";
|
|
4
|
+
import "./chunk-VVIXK2BX.js";
|
|
5
|
+
import "./chunk-FP5N5OWZ.js";
|
|
6
|
+
import "./chunk-VHRM6GNH.js";
|
|
7
7
|
import "./chunk-4ZNGQH7C.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-A7X2FDUO.js";
|
|
9
|
+
import "./chunk-FXFQNHRU.js";
|
|
9
10
|
import "./chunk-LVA4I4H7.js";
|
|
10
11
|
import "./chunk-B7PUBQQM.js";
|
|
11
12
|
import "./chunk-I35CTGPO.js";
|
|
@@ -17,7 +18,7 @@ import "./chunk-MLKGABMK.js";
|
|
|
17
18
|
// src/reporting/plugin-conversations.ts
|
|
18
19
|
async function listRecentConversationSummaries(requestedLimit = 25) {
|
|
19
20
|
const limit = Math.max(0, Math.min(100, Math.floor(requestedLimit)));
|
|
20
|
-
const feed = await readConversationFeedFromSql(limit);
|
|
21
|
+
const feed = await readConversationFeedFromSql({ limit });
|
|
21
22
|
return feed.conversations.map((report) => {
|
|
22
23
|
return {
|
|
23
24
|
conversationId: report.conversationId,
|