@sentry/junior 0.95.0 → 0.97.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.
Files changed (144) hide show
  1. package/dist/{agent-hooks-FTQ5EGPO.js → agent-hooks-XSUIVRQS.js} +10 -8
  2. package/dist/{reporting → api}/conversations/activity.d.ts +1 -1
  3. package/dist/api/conversations/detail-projection.d.ts +10 -0
  4. package/dist/api/conversations/detail.d.ts +3 -0
  5. package/dist/api/conversations/detail.query.d.ts +3 -0
  6. package/dist/api/conversations/list.d.ts +3 -0
  7. package/dist/api/conversations/list.query.d.ts +94 -0
  8. package/dist/api/conversations/projection.d.ts +14 -0
  9. package/dist/api/conversations/schema.d.ts +683 -0
  10. package/dist/{reporting → api}/conversations/shared.d.ts +1 -5
  11. package/dist/api/conversations/stats.d.ts +3 -0
  12. package/dist/api/conversations/stats.query.d.ts +3 -0
  13. package/dist/api/conversations/subagent.d.ts +3 -0
  14. package/dist/{reporting → api}/conversations/transcript.d.ts +4 -4
  15. package/dist/api/people/list.d.ts +1 -2
  16. package/dist/api/people/list.query.d.ts +3 -4
  17. package/dist/api/people/profile.d.ts +1 -2
  18. package/dist/api/people/profile.query.d.ts +3 -4
  19. package/dist/api/people/schema.d.ts +193 -0
  20. package/dist/api/people/shared.d.ts +31 -9
  21. package/dist/api/schema.d.ts +20 -0
  22. package/dist/api/schema.js +50 -0
  23. package/dist/api-reference.d.ts +4 -3
  24. package/dist/api.d.ts +3 -0
  25. package/dist/api.js +156 -0
  26. package/dist/app.d.ts +1 -4
  27. package/dist/app.js +108 -370
  28. package/dist/build/virtual-config.d.ts +2 -2
  29. package/dist/{catalog-runtime-2D7IVKUT.js → catalog-runtime-PFHVMHDR.js} +5 -4
  30. package/dist/chat/agent/resume.d.ts +3 -1
  31. package/dist/chat/agent/tools.d.ts +2 -1
  32. package/dist/chat/config.d.ts +1 -8
  33. package/dist/chat/conversations/history.d.ts +241 -27
  34. package/dist/chat/conversations/legacy-advisor-session.d.ts +7 -0
  35. package/dist/chat/conversations/legacy-import.d.ts +2 -2
  36. package/dist/chat/conversations/projection.d.ts +19 -3
  37. package/dist/chat/conversations/sql/legacy-history-import.d.ts +1 -1
  38. package/dist/chat/conversations/sql/store.d.ts +15 -9
  39. package/dist/chat/conversations/store.d.ts +9 -4
  40. package/dist/chat/logging.d.ts +2 -2
  41. package/dist/chat/model-profile.d.ts +14 -0
  42. package/dist/chat/pi/transcript.d.ts +5 -3
  43. package/dist/chat/plugins/auth/oauth-request.d.ts +2 -0
  44. package/dist/chat/resource-events/notification.d.ts +2 -0
  45. package/dist/chat/resource-events/store.d.ts +2 -2
  46. package/dist/chat/runtime/agent-run-outcome.d.ts +3 -0
  47. package/dist/chat/sentry.d.ts +1 -1
  48. package/dist/chat/services/context-compaction.d.ts +15 -0
  49. package/dist/chat/services/turn-result.d.ts +1 -0
  50. package/dist/chat/services/turn-session-record.d.ts +6 -6
  51. package/dist/chat/state/turn-session.d.ts +18 -5
  52. package/dist/chat/task-execution/store.d.ts +2 -2
  53. package/dist/chat/tools/handoff/tool.d.ts +45 -0
  54. package/dist/chat/tools/types.d.ts +7 -2
  55. package/dist/chat/usage.d.ts +27 -13
  56. package/dist/{chunk-6ONME5IG.js → chunk-35BNLDOJ.js} +339 -578
  57. package/dist/{chunk-HDTO3A74.js → chunk-3ECW2K2O.js} +8 -3
  58. package/dist/{chunk-CRRBJ3JP.js → chunk-3F4OPKGF.js} +90 -56
  59. package/dist/chunk-3V7OFJZC.js +264 -0
  60. package/dist/chunk-4ZNGQH7C.js +25 -0
  61. package/dist/{chunk-NSCHU54X.js → chunk-5HLDPVYS.js} +15 -448
  62. package/dist/{chunk-3DA7X2U3.js → chunk-6GWA276C.js} +15 -0
  63. package/dist/{chunk-HZNJLKKI.js → chunk-6U26PYI5.js} +24 -14
  64. package/dist/chunk-AUUCAFDE.js +546 -0
  65. package/dist/{chunk-6APU57E6.js → chunk-B3IT5END.js} +41 -260
  66. package/dist/chunk-CEA3A3UA.js +86 -0
  67. package/dist/{chunk-AYP4ERVZ.js → chunk-D5KZYS4T.js} +1 -1
  68. package/dist/{chunk-GUE7HTNR.js → chunk-EEZCY5WX.js} +79 -29
  69. package/dist/{chunk-E3E2XNCN.js → chunk-EOWXRY5E.js} +2 -2
  70. package/dist/{chunk-5XMNOD3S.js → chunk-FBHZJFHI.js} +3 -3
  71. package/dist/{chunk-CZEX6KIQ.js → chunk-G3E7SCME.js} +0 -23
  72. package/dist/chunk-GUAP3H7O.js +319 -0
  73. package/dist/{chunk-WCMQJE4F.js → chunk-H66UCBPW.js} +7 -5
  74. package/dist/{chunk-WPOJ443W.js → chunk-I35CTGPO.js} +58 -6
  75. package/dist/{chunk-GVOUCI2O.js → chunk-LMJPRYHP.js} +16 -6
  76. package/dist/chunk-LUAE4MGW.js +199 -0
  77. package/dist/{chunk-GY34VGP5.js → chunk-LVA4I4H7.js} +3 -1
  78. package/dist/chunk-LVUKF5CE.js +63 -0
  79. package/dist/{chunk-EKNJM5IG.js → chunk-NG2AV7IB.js} +2 -72
  80. package/dist/chunk-ON6YKIQ7.js +260 -0
  81. package/dist/chunk-PDO5BLNM.js +22 -0
  82. package/dist/chunk-QNVHH5PU.js +20 -0
  83. package/dist/{chunk-XX4N4E6C.js → chunk-T533JLM3.js} +9 -11
  84. package/dist/chunk-UAMKJPDF.js +11 -0
  85. package/dist/chunk-VFH4ZKZT.js +66 -0
  86. package/dist/{chunk-KDPCGVIT.js → chunk-WGXMTFNU.js} +17 -75
  87. package/dist/{chunk-WAGQ377B.js → chunk-WJOSZOON.js} +288 -263
  88. package/dist/chunk-WTYEKPXU.js +451 -0
  89. package/dist/{chunk-HCXXB35T.js → chunk-XIRPQQVE.js} +613 -369
  90. package/dist/cli/chat.js +26 -23
  91. package/dist/cli/check.js +6 -5
  92. package/dist/cli/init.js +12 -0
  93. package/dist/cli/main.js +1 -1
  94. package/dist/cli/plugins.js +14 -11
  95. package/dist/cli/snapshot-warmup.js +10 -8
  96. package/dist/cli/upgrade.js +267 -139
  97. package/dist/db/db.d.ts +4 -0
  98. package/dist/db/schema/conversations.d.ts +128 -0
  99. package/dist/db/schema.d.ts +129 -60
  100. package/dist/{db-W55B74OP.js → db-BWXYIKFQ.js} +5 -5
  101. package/dist/detail-GA6NXWQJ.js +43 -0
  102. package/dist/discovery-RMHYSRL7.js +43 -0
  103. package/dist/handlers/health.d.ts +3 -0
  104. package/dist/instrumentation.js +2 -2
  105. package/dist/{legacy-import-ZPLGLAFD.js → legacy-import-3NQJVGQL.js} +6 -6
  106. package/dist/{api/people/list.js → list-A3WFRIYX.js} +26 -16
  107. package/dist/list-UXJI5Q5X.js +27 -0
  108. package/dist/nitro.d.ts +1 -1
  109. package/dist/nitro.js +2 -1
  110. package/dist/plugin-conversations-DDNGC35A.js +36 -0
  111. package/dist/{api/people/profile.js → profile-4RYDXWTF.js} +33 -18
  112. package/dist/reporting/plugin-conversations.d.ts +3 -0
  113. package/dist/reporting-schema.d.ts +140 -0
  114. package/dist/reporting.d.ts +12 -81
  115. package/dist/{runner-OOSBDYRK.js → runner-JALSYH2P.js} +19 -14
  116. package/dist/{sentry-EGFOV3DH.js → sentry-JMWTS32N.js} +11 -1
  117. package/dist/skills-MAZXZ2KE.js +26 -0
  118. package/dist/stats-XKXH3PTY.js +217 -0
  119. package/dist/subagent-TZ55XY37.js +48 -0
  120. package/dist/usage-schema.d.ts +25 -0
  121. package/dist/{validation-QCGRFRFZ.js → validation-FMEAEKCY.js} +6 -5
  122. package/migrations/0000_initial.sql +115 -0
  123. package/migrations/0001_conversation_metrics.sql +4 -0
  124. package/migrations/README.md +12 -30
  125. package/migrations/meta/0000_snapshot.json +1 -33
  126. package/migrations/meta/0001_snapshot.json +972 -0
  127. package/migrations/meta/_journal.json +9 -2
  128. package/package.json +14 -18
  129. package/dist/api/people/types.d.ts +0 -85
  130. package/dist/chat/advisor-request.d.ts +0 -4
  131. package/dist/chat/conversations/sql/migrations.d.ts +0 -22
  132. package/dist/chat/tools/advisor/session-store.d.ts +0 -9
  133. package/dist/chat/tools/advisor/tool.d.ts +0 -72
  134. package/dist/chunk-N4RNJ32C.js +0 -48
  135. package/dist/chunk-RAIB6WSG.js +0 -142
  136. package/dist/db/schema/migrations.d.ts +0 -58
  137. package/dist/reporting/conversations/context.d.ts +0 -8
  138. package/dist/reporting/conversations/details.d.ts +0 -6
  139. package/dist/reporting/conversations/index.d.ts +0 -4
  140. package/dist/reporting/conversations/statistics.d.ts +0 -4
  141. package/dist/reporting/conversations/summaries.d.ts +0 -17
  142. package/dist/reporting/conversations/types.d.ts +0 -178
  143. package/dist/reporting/conversations.d.ts +0 -1
  144. package/dist/reporting.js +0 -1065
@@ -3,9 +3,8 @@ import { juniorConversationMessages } from "./schema/conversation-messages";
3
3
  import { juniorConversations } from "./schema/conversations";
4
4
  import { juniorDestinations } from "./schema/destinations";
5
5
  import { juniorIdentities } from "./schema/identities";
6
- import { juniorSchemaMigrations } from "./schema/migrations";
7
6
  import { juniorUsers } from "./schema/users";
8
- export { juniorAgentSteps, juniorConversationMessages, juniorConversations, juniorDestinations, juniorIdentities, juniorSchemaMigrations, juniorUsers, };
7
+ export { juniorAgentSteps, juniorConversationMessages, juniorConversations, juniorDestinations, juniorIdentities, juniorUsers, };
9
8
  export declare const juniorSqlSchema: {
10
9
  juniorAgentSteps: import("drizzle-orm/pg-core").PgTableWithColumns<{
11
10
  name: "junior_agent_steps";
@@ -730,6 +729,134 @@ export declare const juniorSqlSchema: {
730
729
  identity: undefined;
731
730
  generated: undefined;
732
731
  }, {}, {}>;
732
+ durationMs: import("drizzle-orm/pg-core").PgColumn<{
733
+ name: "duration_ms";
734
+ tableName: "junior_conversations";
735
+ dataType: "number";
736
+ columnType: "PgInteger";
737
+ data: number;
738
+ driverParam: string | number;
739
+ notNull: true;
740
+ hasDefault: true;
741
+ isPrimaryKey: false;
742
+ isAutoincrement: false;
743
+ hasRuntimeDefault: false;
744
+ enumValues: undefined;
745
+ baseColumn: never;
746
+ identity: undefined;
747
+ generated: undefined;
748
+ }, {}, {}>;
749
+ usage: import("drizzle-orm/pg-core").PgColumn<{
750
+ name: "usage_json";
751
+ tableName: "junior_conversations";
752
+ dataType: "json";
753
+ columnType: "PgJsonb";
754
+ data: {
755
+ inputTokens?: number | undefined;
756
+ outputTokens?: number | undefined;
757
+ cachedInputTokens?: number | undefined;
758
+ cacheCreationTokens?: number | undefined;
759
+ reasoningTokens?: number | undefined;
760
+ totalTokens?: number | undefined;
761
+ cost?: {
762
+ input?: number | undefined;
763
+ output?: number | undefined;
764
+ cacheRead?: number | undefined;
765
+ cacheWrite?: number | undefined;
766
+ total?: number | undefined;
767
+ } | undefined;
768
+ };
769
+ driverParam: unknown;
770
+ notNull: false;
771
+ hasDefault: false;
772
+ isPrimaryKey: false;
773
+ isAutoincrement: false;
774
+ hasRuntimeDefault: false;
775
+ enumValues: undefined;
776
+ baseColumn: never;
777
+ identity: undefined;
778
+ generated: undefined;
779
+ }, {}, {
780
+ $type: {
781
+ inputTokens?: number | undefined;
782
+ outputTokens?: number | undefined;
783
+ cachedInputTokens?: number | undefined;
784
+ cacheCreationTokens?: number | undefined;
785
+ reasoningTokens?: number | undefined;
786
+ totalTokens?: number | undefined;
787
+ cost?: {
788
+ input?: number | undefined;
789
+ output?: number | undefined;
790
+ cacheRead?: number | undefined;
791
+ cacheWrite?: number | undefined;
792
+ total?: number | undefined;
793
+ } | undefined;
794
+ };
795
+ }>;
796
+ executionDurationMs: import("drizzle-orm/pg-core").PgColumn<{
797
+ name: "execution_duration_ms";
798
+ tableName: "junior_conversations";
799
+ dataType: "number";
800
+ columnType: "PgInteger";
801
+ data: number;
802
+ driverParam: string | number;
803
+ notNull: true;
804
+ hasDefault: true;
805
+ isPrimaryKey: false;
806
+ isAutoincrement: false;
807
+ hasRuntimeDefault: false;
808
+ enumValues: undefined;
809
+ baseColumn: never;
810
+ identity: undefined;
811
+ generated: undefined;
812
+ }, {}, {}>;
813
+ executionUsage: import("drizzle-orm/pg-core").PgColumn<{
814
+ name: "execution_usage_json";
815
+ tableName: "junior_conversations";
816
+ dataType: "json";
817
+ columnType: "PgJsonb";
818
+ data: {
819
+ inputTokens?: number | undefined;
820
+ outputTokens?: number | undefined;
821
+ cachedInputTokens?: number | undefined;
822
+ cacheCreationTokens?: number | undefined;
823
+ reasoningTokens?: number | undefined;
824
+ totalTokens?: number | undefined;
825
+ cost?: {
826
+ input?: number | undefined;
827
+ output?: number | undefined;
828
+ cacheRead?: number | undefined;
829
+ cacheWrite?: number | undefined;
830
+ total?: number | undefined;
831
+ } | undefined;
832
+ };
833
+ driverParam: unknown;
834
+ notNull: false;
835
+ hasDefault: false;
836
+ isPrimaryKey: false;
837
+ isAutoincrement: false;
838
+ hasRuntimeDefault: false;
839
+ enumValues: undefined;
840
+ baseColumn: never;
841
+ identity: undefined;
842
+ generated: undefined;
843
+ }, {}, {
844
+ $type: {
845
+ inputTokens?: number | undefined;
846
+ outputTokens?: number | undefined;
847
+ cachedInputTokens?: number | undefined;
848
+ cacheCreationTokens?: number | undefined;
849
+ reasoningTokens?: number | undefined;
850
+ totalTokens?: number | undefined;
851
+ cost?: {
852
+ input?: number | undefined;
853
+ output?: number | undefined;
854
+ cacheRead?: number | undefined;
855
+ cacheWrite?: number | undefined;
856
+ total?: number | undefined;
857
+ } | undefined;
858
+ };
859
+ }>;
733
860
  };
734
861
  dialect: "pg";
735
862
  }>;
@@ -1195,64 +1322,6 @@ export declare const juniorSqlSchema: {
1195
1322
  };
1196
1323
  dialect: "pg";
1197
1324
  }>;
1198
- juniorSchemaMigrations: import("drizzle-orm/pg-core").PgTableWithColumns<{
1199
- name: "junior_schema_migrations";
1200
- schema: undefined;
1201
- columns: {
1202
- id: import("drizzle-orm/pg-core").PgColumn<{
1203
- name: "id";
1204
- tableName: "junior_schema_migrations";
1205
- dataType: "string";
1206
- columnType: "PgText";
1207
- data: string;
1208
- driverParam: string;
1209
- notNull: true;
1210
- hasDefault: false;
1211
- isPrimaryKey: true;
1212
- isAutoincrement: false;
1213
- hasRuntimeDefault: false;
1214
- enumValues: [string, ...string[]];
1215
- baseColumn: never;
1216
- identity: undefined;
1217
- generated: undefined;
1218
- }, {}, {}>;
1219
- checksum: import("drizzle-orm/pg-core").PgColumn<{
1220
- name: "checksum";
1221
- tableName: "junior_schema_migrations";
1222
- dataType: "string";
1223
- columnType: "PgText";
1224
- data: string;
1225
- driverParam: string;
1226
- notNull: true;
1227
- hasDefault: false;
1228
- isPrimaryKey: false;
1229
- isAutoincrement: false;
1230
- hasRuntimeDefault: false;
1231
- enumValues: [string, ...string[]];
1232
- baseColumn: never;
1233
- identity: undefined;
1234
- generated: undefined;
1235
- }, {}, {}>;
1236
- appliedAt: import("drizzle-orm/pg-core").PgColumn<{
1237
- name: string;
1238
- tableName: "junior_schema_migrations";
1239
- dataType: "date";
1240
- columnType: "PgTimestamp";
1241
- data: Date;
1242
- driverParam: string;
1243
- notNull: true;
1244
- hasDefault: true;
1245
- isPrimaryKey: false;
1246
- isAutoincrement: false;
1247
- hasRuntimeDefault: false;
1248
- enumValues: undefined;
1249
- baseColumn: never;
1250
- identity: undefined;
1251
- generated: undefined;
1252
- }, {}, {}>;
1253
- };
1254
- dialect: "pg";
1255
- }>;
1256
1325
  juniorUsers: import("drizzle-orm/pg-core").PgTableWithColumns<{
1257
1326
  name: "junior_users";
1258
1327
  schema: undefined;
@@ -5,13 +5,13 @@ import {
5
5
  getConversationStore,
6
6
  getDb,
7
7
  getSqlExecutor
8
- } from "./chunk-6ONME5IG.js";
9
- import "./chunk-GUE7HTNR.js";
10
- import "./chunk-GY34VGP5.js";
8
+ } from "./chunk-35BNLDOJ.js";
9
+ import "./chunk-EEZCY5WX.js";
10
+ import "./chunk-LVA4I4H7.js";
11
11
  import "./chunk-B7PUBQQM.js";
12
- import "./chunk-WPOJ443W.js";
12
+ import "./chunk-I35CTGPO.js";
13
13
  import "./chunk-OB42YVAE.js";
14
- import "./chunk-3DA7X2U3.js";
14
+ import "./chunk-6GWA276C.js";
15
15
  import "./chunk-7FBGKXPE.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
  export {
@@ -0,0 +1,43 @@
1
+ import {
2
+ buildConversationDetail
3
+ } from "./chunk-AUUCAFDE.js";
4
+ import {
5
+ readConversationRecordFromSql
6
+ } from "./chunk-ON6YKIQ7.js";
7
+ import {
8
+ conversationDetailReportSchema
9
+ } from "./chunk-LUAE4MGW.js";
10
+ import "./chunk-LVUKF5CE.js";
11
+ import "./chunk-NG2AV7IB.js";
12
+ import "./chunk-GUAP3H7O.js";
13
+ import "./chunk-3F4OPKGF.js";
14
+ import "./chunk-PDO5BLNM.js";
15
+ import "./chunk-WTYEKPXU.js";
16
+ import "./chunk-35BNLDOJ.js";
17
+ import "./chunk-4ZNGQH7C.js";
18
+ import "./chunk-EEZCY5WX.js";
19
+ import "./chunk-LVA4I4H7.js";
20
+ import "./chunk-B7PUBQQM.js";
21
+ import "./chunk-I35CTGPO.js";
22
+ import "./chunk-OB42YVAE.js";
23
+ import "./chunk-6GWA276C.js";
24
+ import "./chunk-7FBGKXPE.js";
25
+ import "./chunk-MLKGABMK.js";
26
+
27
+ // src/api/conversations/detail.query.ts
28
+ async function readConversationDetailFromSql(conversationId) {
29
+ const record = await readConversationRecordFromSql(conversationId);
30
+ return record ? buildConversationDetail({
31
+ ...record,
32
+ usage: record.usage ?? void 0
33
+ }) : void 0;
34
+ }
35
+
36
+ // src/api/conversations/detail.ts
37
+ async function readConversationDetail(conversationId) {
38
+ const report = await readConversationDetailFromSql(conversationId);
39
+ return report ? conversationDetailReportSchema.parse(report) : void 0;
40
+ }
41
+ export {
42
+ readConversationDetail
43
+ };
@@ -0,0 +1,43 @@
1
+ import {
2
+ dataDir,
3
+ dataRoots,
4
+ descriptionPath,
5
+ descriptionPathCandidates,
6
+ discoverNodeModulesDirs,
7
+ discoverProjectRoots,
8
+ homeDir,
9
+ isDirectory,
10
+ isFile,
11
+ listReferenceFiles,
12
+ pluginRoots,
13
+ pluginsDir,
14
+ resolveHomeDir,
15
+ skillRoots,
16
+ skillsDir,
17
+ soulPath,
18
+ soulPathCandidates,
19
+ worldPath,
20
+ worldPathCandidates
21
+ } from "./chunk-3V7OFJZC.js";
22
+ import "./chunk-MLKGABMK.js";
23
+ export {
24
+ dataDir,
25
+ dataRoots,
26
+ descriptionPath,
27
+ descriptionPathCandidates,
28
+ discoverNodeModulesDirs,
29
+ discoverProjectRoots,
30
+ homeDir,
31
+ isDirectory,
32
+ isFile,
33
+ listReferenceFiles,
34
+ pluginRoots,
35
+ pluginsDir,
36
+ resolveHomeDir,
37
+ skillRoots,
38
+ skillsDir,
39
+ soulPath,
40
+ soulPathCandidates,
41
+ worldPath,
42
+ worldPathCandidates
43
+ };
@@ -1,3 +1,6 @@
1
+ import type { HealthReport } from "@/reporting-schema";
2
+ /** Build Junior's process health value for HTTP and reporting consumers. */
3
+ export declare function readHealthReport(): HealthReport;
1
4
  /**
2
5
  * Returns a minimal JSON health response for runtime health checks.
3
6
  */
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-CM5EZD5F.js";
4
4
  import {
5
5
  getCurrentConversationPrivacy
6
- } from "./chunk-GY34VGP5.js";
6
+ } from "./chunk-LVA4I4H7.js";
7
7
  import "./chunk-OB42YVAE.js";
8
8
  import {
9
9
  getClient,
@@ -11,7 +11,7 @@ import {
11
11
  init,
12
12
  vercelAIIntegration,
13
13
  withStreamedSpan
14
- } from "./chunk-3DA7X2U3.js";
14
+ } from "./chunk-6GWA276C.js";
15
15
  import {
16
16
  getDeploymentServiceVersion,
17
17
  getDeploymentTelemetryAttributes
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  ensureLegacyConversationImport,
3
3
  importConversationFromLegacy
4
- } from "./chunk-CRRBJ3JP.js";
5
- import "./chunk-6ONME5IG.js";
6
- import "./chunk-GUE7HTNR.js";
7
- import "./chunk-GY34VGP5.js";
4
+ } from "./chunk-3F4OPKGF.js";
5
+ import "./chunk-35BNLDOJ.js";
6
+ import "./chunk-EEZCY5WX.js";
7
+ import "./chunk-LVA4I4H7.js";
8
8
  import "./chunk-B7PUBQQM.js";
9
- import "./chunk-WPOJ443W.js";
9
+ import "./chunk-I35CTGPO.js";
10
10
  import "./chunk-OB42YVAE.js";
11
- import "./chunk-3DA7X2U3.js";
11
+ import "./chunk-6GWA276C.js";
12
12
  import "./chunk-7FBGKXPE.js";
13
13
  import "./chunk-MLKGABMK.js";
14
14
  export {
@@ -8,17 +8,23 @@ import {
8
8
  reportDate,
9
9
  reportTime,
10
10
  signals,
11
- summaryFromRow
12
- } from "../../chunk-HZNJLKKI.js";
13
- import "../../chunk-6ONME5IG.js";
14
- import "../../chunk-GUE7HTNR.js";
15
- import "../../chunk-GY34VGP5.js";
16
- import "../../chunk-B7PUBQQM.js";
17
- import "../../chunk-WPOJ443W.js";
18
- import "../../chunk-OB42YVAE.js";
19
- import "../../chunk-3DA7X2U3.js";
20
- import "../../chunk-7FBGKXPE.js";
21
- import "../../chunk-MLKGABMK.js";
11
+ summaryFromRow,
12
+ usageTokens
13
+ } from "./chunk-6U26PYI5.js";
14
+ import {
15
+ actorDirectoryReportSchema
16
+ } from "./chunk-VFH4ZKZT.js";
17
+ import "./chunk-LUAE4MGW.js";
18
+ import "./chunk-PDO5BLNM.js";
19
+ import "./chunk-35BNLDOJ.js";
20
+ import "./chunk-EEZCY5WX.js";
21
+ import "./chunk-LVA4I4H7.js";
22
+ import "./chunk-B7PUBQQM.js";
23
+ import "./chunk-I35CTGPO.js";
24
+ import "./chunk-OB42YVAE.js";
25
+ import "./chunk-6GWA276C.js";
26
+ import "./chunk-7FBGKXPE.js";
27
+ import "./chunk-MLKGABMK.js";
22
28
 
23
29
  // src/api/people/list.query.ts
24
30
  function directoryItem(accumulator) {
@@ -32,12 +38,12 @@ function directoryItem(accumulator) {
32
38
  hung: accumulator.hung,
33
39
  lastSeenAt: new Date(accumulator.lastSeenMs).toISOString(),
34
40
  actor: accumulator.actor,
35
- runs: accumulator.runs
41
+ ...accumulator.tokens !== void 0 ? { tokens: accumulator.tokens } : {}
36
42
  };
37
43
  }
38
- async function readPeopleListFromSql(options = {}) {
44
+ async function readPeopleListFromSql() {
39
45
  const nowMs = Date.now();
40
- const { rows, truncated } = await actorRows(options);
46
+ const { rows, truncated } = await actorRows();
41
47
  const people = /* @__PURE__ */ new Map();
42
48
  for (const row of rows) {
43
49
  const summary = summaryFromRow(row, nowMs);
@@ -55,7 +61,11 @@ async function readPeopleListFromSql(options = {}) {
55
61
  };
56
62
  accumulator.actor = mergeIdentity(accumulator.actor, actor);
57
63
  accumulator.conversations += 1;
58
- accumulator.runs += 1;
64
+ accumulator.durationMs += summary.cumulativeDurationMs;
65
+ const tokens = usageTokens(row);
66
+ if (tokens !== void 0) {
67
+ accumulator.tokens = (accumulator.tokens ?? 0) + tokens;
68
+ }
59
69
  addSignals(accumulator, signals(summary));
60
70
  accumulator.firstSeenMs = Math.min(accumulator.firstSeenMs, firstSeenMs);
61
71
  accumulator.lastSeenMs = Math.max(accumulator.lastSeenMs, lastSeenMs);
@@ -76,7 +86,7 @@ async function readPeopleListFromSql(options = {}) {
76
86
 
77
87
  // src/api/people/list.ts
78
88
  async function readPeopleList() {
79
- return readPeopleListFromSql();
89
+ return actorDirectoryReportSchema.parse(await readPeopleListFromSql());
80
90
  }
81
91
  export {
82
92
  readPeopleList
@@ -0,0 +1,27 @@
1
+ import {
2
+ readConversationFeedFromSql
3
+ } from "./chunk-ON6YKIQ7.js";
4
+ import {
5
+ conversationFeedSchema
6
+ } from "./chunk-LUAE4MGW.js";
7
+ import "./chunk-NG2AV7IB.js";
8
+ import "./chunk-PDO5BLNM.js";
9
+ import "./chunk-WTYEKPXU.js";
10
+ import "./chunk-35BNLDOJ.js";
11
+ import "./chunk-4ZNGQH7C.js";
12
+ import "./chunk-EEZCY5WX.js";
13
+ import "./chunk-LVA4I4H7.js";
14
+ import "./chunk-B7PUBQQM.js";
15
+ import "./chunk-I35CTGPO.js";
16
+ import "./chunk-OB42YVAE.js";
17
+ import "./chunk-6GWA276C.js";
18
+ import "./chunk-7FBGKXPE.js";
19
+ import "./chunk-MLKGABMK.js";
20
+
21
+ // src/api/conversations/list.ts
22
+ async function readConversationFeed() {
23
+ return conversationFeedSchema.parse(await readConversationFeedFromSql());
24
+ }
25
+ export {
26
+ readConversationFeed
27
+ };
package/dist/nitro.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type JuniorPluginSet } from "./plugins";
2
2
  import type { JuniorDashboardOptions } from "./app";
3
- export type JuniorNitroDashboardOptions = Omit<JuniorDashboardOptions, "reporting">;
3
+ export type JuniorNitroDashboardOptions = JuniorDashboardOptions;
4
4
  export interface JuniorPluginModuleReference {
5
5
  /** Runtime-safe module that exports a `defineJuniorPlugins(...)` set. */
6
6
  module: string;
package/dist/nitro.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  discoverInstalledPluginPackageContent,
18
18
  isValidPackageName,
19
19
  resolvePackageDir
20
- } from "./chunk-6APU57E6.js";
20
+ } from "./chunk-B3IT5END.js";
21
21
  import {
22
22
  JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
23
23
  JUNIOR_HEARTBEAT_CRON_SCHEDULE,
@@ -26,6 +26,7 @@ import {
26
26
  JUNIOR_RETENTION_CRON_SCHEDULE,
27
27
  JUNIOR_RETENTION_ROUTE
28
28
  } from "./chunk-7FBGKXPE.js";
29
+ import "./chunk-3V7OFJZC.js";
29
30
  import "./chunk-MLKGABMK.js";
30
31
 
31
32
  // src/nitro.ts
@@ -0,0 +1,36 @@
1
+ import {
2
+ readConversationFeedFromSql
3
+ } from "./chunk-ON6YKIQ7.js";
4
+ import "./chunk-NG2AV7IB.js";
5
+ import "./chunk-WTYEKPXU.js";
6
+ import "./chunk-35BNLDOJ.js";
7
+ import "./chunk-4ZNGQH7C.js";
8
+ import "./chunk-EEZCY5WX.js";
9
+ import "./chunk-LVA4I4H7.js";
10
+ import "./chunk-B7PUBQQM.js";
11
+ import "./chunk-I35CTGPO.js";
12
+ import "./chunk-OB42YVAE.js";
13
+ import "./chunk-6GWA276C.js";
14
+ import "./chunk-7FBGKXPE.js";
15
+ import "./chunk-MLKGABMK.js";
16
+
17
+ // src/reporting/plugin-conversations.ts
18
+ async function listRecentConversationSummaries(requestedLimit = 25) {
19
+ const limit = Math.max(0, Math.min(100, Math.floor(requestedLimit)));
20
+ const feed = await readConversationFeedFromSql(limit);
21
+ return feed.conversations.map((report) => {
22
+ return {
23
+ conversationId: report.conversationId,
24
+ displayTitle: report.displayTitle,
25
+ lastActivityAt: report.lastSeenAt,
26
+ lastUpdatedAt: report.lastProgressAt,
27
+ status: report.status,
28
+ ...report.channelName ? { channelName: report.channelName } : {},
29
+ ...report.channelNameRedacted ? { channelNameRedacted: true } : {},
30
+ source: report.surface
31
+ };
32
+ });
33
+ }
34
+ export {
35
+ listRecentConversationSummaries
36
+ };
@@ -17,17 +17,23 @@ import {
17
17
  slackLocationLabel,
18
18
  statsItems,
19
19
  summaryFromRow,
20
- surfaceLabel
21
- } from "../../chunk-HZNJLKKI.js";
22
- import "../../chunk-6ONME5IG.js";
23
- import "../../chunk-GUE7HTNR.js";
24
- import "../../chunk-GY34VGP5.js";
25
- import "../../chunk-B7PUBQQM.js";
26
- import "../../chunk-WPOJ443W.js";
27
- import "../../chunk-OB42YVAE.js";
28
- import "../../chunk-3DA7X2U3.js";
29
- import "../../chunk-7FBGKXPE.js";
30
- import "../../chunk-MLKGABMK.js";
20
+ surfaceLabel,
21
+ usageTokens
22
+ } from "./chunk-6U26PYI5.js";
23
+ import {
24
+ actorProfileReportSchema
25
+ } from "./chunk-VFH4ZKZT.js";
26
+ import "./chunk-LUAE4MGW.js";
27
+ import "./chunk-PDO5BLNM.js";
28
+ import "./chunk-35BNLDOJ.js";
29
+ import "./chunk-EEZCY5WX.js";
30
+ import "./chunk-LVA4I4H7.js";
31
+ import "./chunk-B7PUBQQM.js";
32
+ import "./chunk-I35CTGPO.js";
33
+ import "./chunk-OB42YVAE.js";
34
+ import "./chunk-6GWA276C.js";
35
+ import "./chunk-7FBGKXPE.js";
36
+ import "./chunk-MLKGABMK.js";
31
37
 
32
38
  // src/api/people/profile.query.ts
33
39
  function emptyProfile(email, nowMs) {
@@ -51,13 +57,13 @@ function emptyProfile(email, nowMs) {
51
57
  windowStart: start.toISOString()
52
58
  };
53
59
  }
54
- async function readPeopleProfileFromSql(email, options = {}) {
60
+ async function readPeopleProfileFromSql(email) {
55
61
  const nowMs = Date.now();
56
62
  const normalizedEmail = normalizeEmail(email);
57
63
  if (!normalizedEmail) {
58
64
  return emptyProfile("", nowMs);
59
65
  }
60
- const { rows, truncated } = await actorRows(options, normalizedEmail);
66
+ const { rows, truncated } = await actorRows(normalizedEmail);
61
67
  let actor;
62
68
  const totals = emptyTotals();
63
69
  const activeDates = /* @__PURE__ */ new Set();
@@ -75,26 +81,35 @@ async function readPeopleProfileFromSql(email, options = {}) {
75
81
  const value = signals(summary);
76
82
  const date = reportDate(summary.lastSeenAt);
77
83
  totals.conversations += 1;
78
- totals.runs += 1;
84
+ totals.durationMs += summary.cumulativeDurationMs;
85
+ const tokens = usageTokens(row);
86
+ if (tokens !== void 0) totals.tokens = (totals.tokens ?? 0) + tokens;
79
87
  addSignals(totals, value);
80
88
  if (date) {
81
89
  activeDates.add(date);
82
90
  const day = days.get(date) ?? emptyActivityDay(date);
83
91
  day.conversations += 1;
84
- day.runs += 1;
92
+ day.durationMs += summary.cumulativeDurationMs;
93
+ if (tokens !== void 0) day.tokens = (day.tokens ?? 0) + tokens;
85
94
  addSignals(day, value);
86
95
  days.set(date, day);
87
96
  }
88
97
  const location = slackLocationLabel(summary) ?? surfaceLabel(summary.surface);
89
98
  const locationItem = locations.get(location) ?? emptyStatsItem(location);
90
99
  locationItem.conversations += 1;
91
- locationItem.runs += 1;
100
+ locationItem.durationMs += summary.cumulativeDurationMs;
101
+ if (tokens !== void 0) {
102
+ locationItem.tokens = (locationItem.tokens ?? 0) + tokens;
103
+ }
92
104
  addSignals(locationItem, value);
93
105
  locations.set(location, locationItem);
94
106
  const surface = surfaceLabel(summary.surface);
95
107
  const surfaceItem = surfaces.get(surface) ?? emptyStatsItem(surface);
96
108
  surfaceItem.conversations += 1;
97
- surfaceItem.runs += 1;
109
+ surfaceItem.durationMs += summary.cumulativeDurationMs;
110
+ if (tokens !== void 0) {
111
+ surfaceItem.tokens = (surfaceItem.tokens ?? 0) + tokens;
112
+ }
98
113
  addSignals(surfaceItem, value);
99
114
  surfaces.set(surface, surfaceItem);
100
115
  }
@@ -124,7 +139,7 @@ async function readPeopleProfileFromSql(email, options = {}) {
124
139
 
125
140
  // src/api/people/profile.ts
126
141
  async function readPeopleProfile(email) {
127
- return readPeopleProfileFromSql(email);
142
+ return actorProfileReportSchema.parse(await readPeopleProfileFromSql(email));
128
143
  }
129
144
  export {
130
145
  readPeopleProfile
@@ -0,0 +1,3 @@
1
+ import type { PluginConversationSummary } from "@sentry/junior-plugin-api";
2
+ /** Supply bounded SQL conversation metadata to plugin operational reports. */
3
+ export declare function listRecentConversationSummaries(requestedLimit?: number): Promise<PluginConversationSummary[]>;