@sentry/junior 0.102.3 → 0.104.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-I4I2DHSW.js → agent-hooks-EOFSY2PD.js} +5 -5
- package/dist/api/conversations/archive.d.ts +7 -0
- package/dist/api/conversations/detail.d.ts +7 -0
- package/dist/api/conversations/list.d.ts +109 -0
- package/dist/api/conversations/routes.d.ts +3 -0
- package/dist/api/conversations/schema.d.ts +88 -69
- package/dist/api/conversations/stats.d.ts +7 -0
- package/dist/api/conversations/subagent.d.ts +7 -0
- package/dist/api/http.d.ts +5 -0
- package/dist/api/locations/detail.d.ts +10 -2
- package/dist/api/locations/list.d.ts +7 -0
- package/dist/api/locations/routes.d.ts +3 -0
- package/dist/api/locations/schema.d.ts +4 -3
- package/dist/api/people/list.d.ts +7 -0
- package/dist/api/people/profile.d.ts +7 -0
- package/dist/api/people/routes.d.ts +3 -0
- package/dist/api/people/schema.d.ts +35 -33
- package/dist/api/people/shared.d.ts +4 -4
- package/dist/api/route.d.ts +7 -0
- package/dist/api/schema.js +11 -17
- package/dist/api.js +2184 -88
- package/dist/app.js +120 -162
- package/dist/chat/conversations/history.d.ts +6 -6
- package/dist/chat/conversations/store.d.ts +1 -0
- package/dist/chat/pi/messages.d.ts +2 -2
- package/dist/chat/plugins/agent-hooks.d.ts +2 -2
- package/dist/chat/resource-events/store.d.ts +2 -2
- package/dist/chat/sandbox/runtime-dependencies.d.ts +2 -0
- package/dist/chat/sandbox/sandbox.d.ts +1 -0
- package/dist/chat/services/provider-retry.d.ts +1 -2
- package/dist/chat/slack/tools/conversation-search.d.ts +2 -2
- package/dist/chat/state/session-log.d.ts +2 -2
- package/dist/chat/task-execution/store.d.ts +2 -2
- package/dist/chat/tools/search-tools.d.ts +2 -2
- package/dist/{chunk-ZSHL44IQ.js → chunk-4PDVOHXP.js} +1 -1
- package/dist/{chunk-3OABPOHR.js → chunk-7G4J3CR7.js} +11 -2
- package/dist/chunk-AIRE7Q2W.js +362 -0
- package/dist/{chunk-QZGVPPIJ.js → chunk-BCULHGZK.js} +24 -4
- package/dist/{chunk-IQ36I3DF.js → chunk-CCTCIISK.js} +1 -1
- package/dist/{chunk-SHBPSE7A.js → chunk-M3UAVLEN.js} +2 -3
- package/dist/{chunk-EMUZSROX.js → chunk-O7ILGCMJ.js} +78 -1
- package/dist/{chunk-EOB77KME.js → chunk-QDKRE3LS.js} +340 -9
- package/dist/{chunk-DTUSCR2Y.js → chunk-QVTVCJR4.js} +7 -7
- package/dist/{chunk-5K4N73TP.js → chunk-RMZ65YAA.js} +3 -3
- package/dist/{chunk-VSAFV2GI.js → chunk-RYDF4GOX.js} +3 -3
- package/dist/{chunk-ZIX4PNBI.js → chunk-TMWUGGSA.js} +37 -35
- package/dist/{chunk-3UK5DFKW.js → chunk-U26ZWZCN.js} +1 -1
- package/dist/{chunk-X2IPNCB5.js → chunk-VDHMFCDY.js} +65 -12
- package/dist/cli/chat.js +13 -14
- package/dist/cli/plugins.js +6 -6
- package/dist/cli/snapshot-warmup.js +7 -3
- package/dist/cli/upgrade.js +6 -7
- package/dist/db/schema/conversations.d.ts +17 -0
- package/dist/db/schema.d.ts +17 -0
- package/dist/{db-6QP6HY7U.js → db-PDMC67T3.js} +2 -2
- package/dist/{legacy-import-R3BMM2GH.js → legacy-import-G333RHJZ.js} +3 -3
- package/dist/reporting-schema.d.ts +4 -4
- package/dist/{runner-C2ZTIOUD.js → runner-6A7MQRUE.js} +9 -10
- package/migrations/0004_useful_magus.sql +1 -0
- package/migrations/meta/0004_snapshot.json +1041 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +6 -6
- package/dist/api/conversations/list.query.d.ts +0 -103
- package/dist/chunk-2RNOB32R.js +0 -17
- package/dist/chunk-4XNQSJAX.js +0 -331
- package/dist/chunk-4YN2ZXKB.js +0 -66
- package/dist/chunk-B5QS4AVO.js +0 -319
- package/dist/chunk-F4CQEUTP.js +0 -77
- package/dist/chunk-HYDQULR2.js +0 -214
- package/dist/chunk-KFP3TZOS.js +0 -102
- package/dist/chunk-LJB2TLVT.js +0 -273
- package/dist/chunk-LVUKF5CE.js +0 -63
- package/dist/chunk-NSP6OGL2.js +0 -671
- package/dist/chunk-QNVHH5PU.js +0 -20
- package/dist/chunk-QOZOJNSE.js +0 -96
- package/dist/chunk-WPHCUGN7.js +0 -84
- package/dist/detail-OEIVZYXS.js +0 -68
- package/dist/detail-V37NTVBN.js +0 -29
- package/dist/list-AJ6RWBOG.js +0 -30
- package/dist/list-FWLIZHSW.js +0 -30
- package/dist/list-NTUT6A5M.js +0 -121
- package/dist/plugin-conversations-F3IBVNFX.js +0 -37
- package/dist/profile-3FRQP4HP.js +0 -212
- package/dist/reporting/plugin-conversations.d.ts +0 -3
- package/dist/stats-7UFY6FPE.js +0 -174
- package/dist/subagent-X3ZWJHR4.js +0 -49
package/dist/chunk-QOZOJNSE.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
// src/api/conversations/reporting.ts
|
|
2
|
-
var PRIVATE_CONVERSATION_LABEL = "Private Conversation";
|
|
3
|
-
function channelFromConversationId(conversationId) {
|
|
4
|
-
const [provider, channel] = conversationId.split(":");
|
|
5
|
-
return provider === "slack" && channel ? channel : void 0;
|
|
6
|
-
}
|
|
7
|
-
function surfaceFromRow(row) {
|
|
8
|
-
if (row.source === "api" || row.source === "scheduler" || row.source === "slack") {
|
|
9
|
-
return row.source;
|
|
10
|
-
}
|
|
11
|
-
if (row.conversationId.startsWith("slack:")) return "slack";
|
|
12
|
-
if (row.conversationId.startsWith("scheduler:")) return "scheduler";
|
|
13
|
-
if (row.conversationId.startsWith("api:")) return "api";
|
|
14
|
-
return "internal";
|
|
15
|
-
}
|
|
16
|
-
function statusFromRow(row) {
|
|
17
|
-
if (row.executionStatus === "failed") return "failed";
|
|
18
|
-
if (row.executionStatus === "idle") return "completed";
|
|
19
|
-
return "active";
|
|
20
|
-
}
|
|
21
|
-
function surfaceLabel(surface) {
|
|
22
|
-
if (surface === "scheduler") return "Scheduler";
|
|
23
|
-
if (surface === "api") return "API";
|
|
24
|
-
if (surface === "internal") return "Internal";
|
|
25
|
-
return "Conversation";
|
|
26
|
-
}
|
|
27
|
-
function slackLocationLabel(args) {
|
|
28
|
-
const channelId = args.channel;
|
|
29
|
-
if (!channelId) return void 0;
|
|
30
|
-
if (args.channelNameRedacted && args.channelName) return args.channelName;
|
|
31
|
-
const name = args.channelName?.replace(/^#/, "");
|
|
32
|
-
if (channelId.startsWith("D")) return "Direct Message";
|
|
33
|
-
if (channelId.startsWith("C")) {
|
|
34
|
-
return name ? `#${name}` : "Public Channel";
|
|
35
|
-
}
|
|
36
|
-
if (channelId.startsWith("G")) {
|
|
37
|
-
if (name?.startsWith("mpdm-")) return "Group DM";
|
|
38
|
-
return "Private Channel";
|
|
39
|
-
}
|
|
40
|
-
return name || channelId;
|
|
41
|
-
}
|
|
42
|
-
function channelNameFromRow(row) {
|
|
43
|
-
if (row.destinationVisibility !== "public") {
|
|
44
|
-
return PRIVATE_CONVERSATION_LABEL;
|
|
45
|
-
}
|
|
46
|
-
return row.channelName ?? void 0;
|
|
47
|
-
}
|
|
48
|
-
function titleFromRow(row, surface) {
|
|
49
|
-
if (row.destinationVisibility !== "public") {
|
|
50
|
-
return PRIVATE_CONVERSATION_LABEL;
|
|
51
|
-
}
|
|
52
|
-
const channel = channelFromConversationId(row.conversationId);
|
|
53
|
-
return row.title ?? slackLocationLabel({
|
|
54
|
-
channel,
|
|
55
|
-
channelName: row.channelName ?? void 0
|
|
56
|
-
}) ?? surfaceLabel(surface);
|
|
57
|
-
}
|
|
58
|
-
function actorFromRow(row) {
|
|
59
|
-
const actor = {
|
|
60
|
-
...row.email ? { email: row.email } : {},
|
|
61
|
-
...row.fullName ? { fullName: row.fullName } : {},
|
|
62
|
-
...row.providerSubjectId ? { slackUserId: row.providerSubjectId } : {},
|
|
63
|
-
...row.handle ? { slackUserName: row.handle } : {}
|
|
64
|
-
};
|
|
65
|
-
return Object.keys(actor).length ? actor : void 0;
|
|
66
|
-
}
|
|
67
|
-
function summaryFromRow(row) {
|
|
68
|
-
const surface = surfaceFromRow(row);
|
|
69
|
-
const channel = channelFromConversationId(row.conversationId);
|
|
70
|
-
const channelName = channelNameFromRow(row);
|
|
71
|
-
const channelNameRedacted = row.destinationVisibility !== "public";
|
|
72
|
-
const actorIdentity = actorFromRow(row);
|
|
73
|
-
return {
|
|
74
|
-
conversationId: row.conversationId,
|
|
75
|
-
cumulativeDurationMs: row.durationMs,
|
|
76
|
-
displayTitle: titleFromRow(row, surface),
|
|
77
|
-
lastProgressAt: new Date(
|
|
78
|
-
row.executionUpdatedAt ?? row.updatedAt
|
|
79
|
-
).toISOString(),
|
|
80
|
-
lastSeenAt: row.lastActivityAt.toISOString(),
|
|
81
|
-
startedAt: row.createdAt.toISOString(),
|
|
82
|
-
status: statusFromRow(row),
|
|
83
|
-
surface,
|
|
84
|
-
...actorIdentity ? { actorIdentity } : {},
|
|
85
|
-
...channel ? { channel } : {},
|
|
86
|
-
...channelName ? { channelName } : {},
|
|
87
|
-
...channelNameRedacted ? { channelNameRedacted: true } : {},
|
|
88
|
-
...row.destinationVisibility === "public" && row.destinationId ? { locationId: row.destinationId } : {}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export {
|
|
93
|
-
surfaceLabel,
|
|
94
|
-
slackLocationLabel,
|
|
95
|
-
summaryFromRow
|
|
96
|
-
};
|
package/dist/chunk-WPHCUGN7.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
actorIdentitySchema,
|
|
3
|
-
conversationStatsItemSchema,
|
|
4
|
-
conversationSummaryReportSchema
|
|
5
|
-
} from "./chunk-HYDQULR2.js";
|
|
6
|
-
import {
|
|
7
|
-
juniorDestinationKindSchema
|
|
8
|
-
} from "./chunk-FXFQNHRU.js";
|
|
9
|
-
|
|
10
|
-
// src/api/activity.ts
|
|
11
|
-
import { z } from "zod";
|
|
12
|
-
var dailyConversationActivitySchema = z.object({
|
|
13
|
-
active: z.number(),
|
|
14
|
-
conversations: z.number(),
|
|
15
|
-
date: z.string(),
|
|
16
|
-
durationMs: z.number(),
|
|
17
|
-
failed: z.number(),
|
|
18
|
-
tokens: z.number().optional()
|
|
19
|
-
}).strict();
|
|
20
|
-
function emptyActivityDay(date) {
|
|
21
|
-
return {
|
|
22
|
-
active: 0,
|
|
23
|
-
conversations: 0,
|
|
24
|
-
date,
|
|
25
|
-
durationMs: 0,
|
|
26
|
-
failed: 0
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function activityDays(days, nowMs, count) {
|
|
30
|
-
const items = [];
|
|
31
|
-
const end = new Date(nowMs);
|
|
32
|
-
end.setUTCHours(0, 0, 0, 0);
|
|
33
|
-
const start = new Date(end);
|
|
34
|
-
start.setUTCDate(start.getUTCDate() - (count - 1));
|
|
35
|
-
for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setUTCDate(cursor.getUTCDate() + 1)) {
|
|
36
|
-
const date = cursor.toISOString().slice(0, 10);
|
|
37
|
-
items.push(days.get(date) ?? emptyActivityDay(date));
|
|
38
|
-
}
|
|
39
|
-
return items;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// src/api/locations/schema.ts
|
|
43
|
-
import { z as z2 } from "zod";
|
|
44
|
-
var locationSummaryReportSchema = conversationStatsItemSchema.extend({
|
|
45
|
-
id: z2.string(),
|
|
46
|
-
firstSeenAt: z2.string(),
|
|
47
|
-
kind: juniorDestinationKindSchema,
|
|
48
|
-
lastSeenAt: z2.string(),
|
|
49
|
-
provider: z2.string(),
|
|
50
|
-
providerDestinationId: z2.string(),
|
|
51
|
-
visibility: z2.literal("public")
|
|
52
|
-
}).strict();
|
|
53
|
-
var locationActorSummaryReportSchema = conversationStatsItemSchema.extend({ actor: actorIdentitySchema }).strict();
|
|
54
|
-
var locationActivityDayReportSchema = z2.object({
|
|
55
|
-
date: z2.string(),
|
|
56
|
-
privateConversations: z2.number(),
|
|
57
|
-
publicConversations: z2.number()
|
|
58
|
-
}).strict();
|
|
59
|
-
var locationDirectoryReportSchema = z2.object({
|
|
60
|
-
activityDays: z2.array(locationActivityDayReportSchema),
|
|
61
|
-
generatedAt: z2.string(),
|
|
62
|
-
locations: z2.array(locationSummaryReportSchema),
|
|
63
|
-
privateActivity: conversationStatsItemSchema,
|
|
64
|
-
source: z2.literal("conversation_index"),
|
|
65
|
-
windowEnd: z2.string(),
|
|
66
|
-
windowStart: z2.string()
|
|
67
|
-
}).strict();
|
|
68
|
-
var locationDetailReportSchema = locationSummaryReportSchema.extend({
|
|
69
|
-
activityDays: z2.array(dailyConversationActivitySchema),
|
|
70
|
-
actors: z2.array(locationActorSummaryReportSchema),
|
|
71
|
-
generatedAt: z2.string(),
|
|
72
|
-
recentConversations: z2.array(conversationSummaryReportSchema),
|
|
73
|
-
source: z2.literal("conversation_index"),
|
|
74
|
-
windowEnd: z2.string(),
|
|
75
|
-
windowStart: z2.string()
|
|
76
|
-
}).strict();
|
|
77
|
-
|
|
78
|
-
export {
|
|
79
|
-
dailyConversationActivitySchema,
|
|
80
|
-
activityDays,
|
|
81
|
-
locationActivityDayReportSchema,
|
|
82
|
-
locationDirectoryReportSchema,
|
|
83
|
-
locationDetailReportSchema
|
|
84
|
-
};
|
package/dist/detail-OEIVZYXS.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buildConversationDetail
|
|
3
|
-
} from "./chunk-NSP6OGL2.js";
|
|
4
|
-
import {
|
|
5
|
-
readConversationRecordFromSql
|
|
6
|
-
} from "./chunk-LJB2TLVT.js";
|
|
7
|
-
import {
|
|
8
|
-
conversationDetailReportSchema
|
|
9
|
-
} from "./chunk-HYDQULR2.js";
|
|
10
|
-
import "./chunk-LVUKF5CE.js";
|
|
11
|
-
import "./chunk-EMUZSROX.js";
|
|
12
|
-
import {
|
|
13
|
-
listBoundedAgentTurnSessionSummariesForConversation
|
|
14
|
-
} from "./chunk-EOB77KME.js";
|
|
15
|
-
import "./chunk-B5QS4AVO.js";
|
|
16
|
-
import "./chunk-VSAFV2GI.js";
|
|
17
|
-
import "./chunk-PDO5BLNM.js";
|
|
18
|
-
import "./chunk-IQ36I3DF.js";
|
|
19
|
-
import "./chunk-QZGVPPIJ.js";
|
|
20
|
-
import "./chunk-4ZNGQH7C.js";
|
|
21
|
-
import "./chunk-SHBPSE7A.js";
|
|
22
|
-
import "./chunk-FXFQNHRU.js";
|
|
23
|
-
import "./chunk-RT5BUHR5.js";
|
|
24
|
-
import "./chunk-B7PUBQQM.js";
|
|
25
|
-
import {
|
|
26
|
-
logException
|
|
27
|
-
} from "./chunk-AEWZ7F65.js";
|
|
28
|
-
import "./chunk-OB42YVAE.js";
|
|
29
|
-
import "./chunk-6GWA276C.js";
|
|
30
|
-
import "./chunk-7FBGKXPE.js";
|
|
31
|
-
import "./chunk-MLKGABMK.js";
|
|
32
|
-
|
|
33
|
-
// src/api/conversations/detail.query.ts
|
|
34
|
-
async function readLatestRun(conversationId) {
|
|
35
|
-
try {
|
|
36
|
-
return (await listBoundedAgentTurnSessionSummariesForConversation(conversationId)).find((summary) => summary.modelId || summary.reasoningLevel);
|
|
37
|
-
} catch (error) {
|
|
38
|
-
logException(error, "conversation_execution_settings_read_failed", {
|
|
39
|
-
conversationId
|
|
40
|
-
});
|
|
41
|
-
return void 0;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
async function readConversationDetailFromSql(conversationId) {
|
|
45
|
-
const record = await readConversationRecordFromSql(conversationId);
|
|
46
|
-
if (!record) return void 0;
|
|
47
|
-
const [report, latestRun] = await Promise.all([
|
|
48
|
-
buildConversationDetail({
|
|
49
|
-
...record,
|
|
50
|
-
usage: record.usage ?? void 0
|
|
51
|
-
}),
|
|
52
|
-
readLatestRun(conversationId)
|
|
53
|
-
]);
|
|
54
|
-
return {
|
|
55
|
-
...report,
|
|
56
|
-
...latestRun?.modelId ? { modelId: latestRun.modelId } : {},
|
|
57
|
-
...latestRun?.reasoningLevel ? { reasoningLevel: latestRun.reasoningLevel } : {}
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// src/api/conversations/detail.ts
|
|
62
|
-
async function readConversationDetail(conversationId) {
|
|
63
|
-
const report = await readConversationDetailFromSql(conversationId);
|
|
64
|
-
return report ? conversationDetailReportSchema.parse(report) : void 0;
|
|
65
|
-
}
|
|
66
|
-
export {
|
|
67
|
-
readConversationDetail
|
|
68
|
-
};
|
package/dist/detail-V37NTVBN.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
readLocationDetailFromSql
|
|
3
|
-
} from "./chunk-4XNQSJAX.js";
|
|
4
|
-
import "./chunk-QOZOJNSE.js";
|
|
5
|
-
import "./chunk-F4CQEUTP.js";
|
|
6
|
-
import {
|
|
7
|
-
locationDetailReportSchema
|
|
8
|
-
} from "./chunk-WPHCUGN7.js";
|
|
9
|
-
import "./chunk-HYDQULR2.js";
|
|
10
|
-
import "./chunk-PDO5BLNM.js";
|
|
11
|
-
import "./chunk-QZGVPPIJ.js";
|
|
12
|
-
import "./chunk-SHBPSE7A.js";
|
|
13
|
-
import "./chunk-FXFQNHRU.js";
|
|
14
|
-
import "./chunk-RT5BUHR5.js";
|
|
15
|
-
import "./chunk-B7PUBQQM.js";
|
|
16
|
-
import "./chunk-AEWZ7F65.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
|
-
};
|
package/dist/list-AJ6RWBOG.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
readConversationFeedFromSql
|
|
3
|
-
} from "./chunk-LJB2TLVT.js";
|
|
4
|
-
import {
|
|
5
|
-
conversationFeedSchema
|
|
6
|
-
} from "./chunk-HYDQULR2.js";
|
|
7
|
-
import "./chunk-EMUZSROX.js";
|
|
8
|
-
import "./chunk-PDO5BLNM.js";
|
|
9
|
-
import "./chunk-IQ36I3DF.js";
|
|
10
|
-
import "./chunk-QZGVPPIJ.js";
|
|
11
|
-
import "./chunk-4ZNGQH7C.js";
|
|
12
|
-
import "./chunk-SHBPSE7A.js";
|
|
13
|
-
import "./chunk-FXFQNHRU.js";
|
|
14
|
-
import "./chunk-RT5BUHR5.js";
|
|
15
|
-
import "./chunk-B7PUBQQM.js";
|
|
16
|
-
import "./chunk-AEWZ7F65.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/conversations/list.ts
|
|
23
|
-
async function readConversationFeed(options = {}) {
|
|
24
|
-
return conversationFeedSchema.parse(
|
|
25
|
-
await readConversationFeedFromSql({ actorEmail: options.actorEmail })
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
readConversationFeed
|
|
30
|
-
};
|
package/dist/list-FWLIZHSW.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
readLocationDirectoryFromSql
|
|
3
|
-
} from "./chunk-4XNQSJAX.js";
|
|
4
|
-
import "./chunk-QOZOJNSE.js";
|
|
5
|
-
import "./chunk-F4CQEUTP.js";
|
|
6
|
-
import {
|
|
7
|
-
locationDirectoryReportSchema
|
|
8
|
-
} from "./chunk-WPHCUGN7.js";
|
|
9
|
-
import "./chunk-HYDQULR2.js";
|
|
10
|
-
import "./chunk-PDO5BLNM.js";
|
|
11
|
-
import "./chunk-QZGVPPIJ.js";
|
|
12
|
-
import "./chunk-SHBPSE7A.js";
|
|
13
|
-
import "./chunk-FXFQNHRU.js";
|
|
14
|
-
import "./chunk-RT5BUHR5.js";
|
|
15
|
-
import "./chunk-B7PUBQQM.js";
|
|
16
|
-
import "./chunk-AEWZ7F65.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
|
-
};
|
package/dist/list-NTUT6A5M.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
verifiedActorWhere
|
|
3
|
-
} from "./chunk-KFP3TZOS.js";
|
|
4
|
-
import {
|
|
5
|
-
conversationActiveDaysColumn,
|
|
6
|
-
conversationAggregateColumns,
|
|
7
|
-
conversationRangeColumns
|
|
8
|
-
} from "./chunk-F4CQEUTP.js";
|
|
9
|
-
import {
|
|
10
|
-
actorDirectoryReportSchema
|
|
11
|
-
} from "./chunk-4YN2ZXKB.js";
|
|
12
|
-
import "./chunk-HYDQULR2.js";
|
|
13
|
-
import "./chunk-PDO5BLNM.js";
|
|
14
|
-
import {
|
|
15
|
-
getDb,
|
|
16
|
-
juniorConversations,
|
|
17
|
-
juniorIdentities,
|
|
18
|
-
juniorUsers
|
|
19
|
-
} from "./chunk-QZGVPPIJ.js";
|
|
20
|
-
import "./chunk-SHBPSE7A.js";
|
|
21
|
-
import "./chunk-FXFQNHRU.js";
|
|
22
|
-
import "./chunk-RT5BUHR5.js";
|
|
23
|
-
import "./chunk-B7PUBQQM.js";
|
|
24
|
-
import "./chunk-AEWZ7F65.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 { and, eq, gte, sql } from "drizzle-orm";
|
|
32
|
-
var DIRECTORY_ACTIVITY_DAYS = 90;
|
|
33
|
-
function activityWindow(nowMs) {
|
|
34
|
-
const end = new Date(nowMs);
|
|
35
|
-
end.setUTCHours(0, 0, 0, 0);
|
|
36
|
-
const start = new Date(end);
|
|
37
|
-
start.setUTCDate(start.getUTCDate() - (DIRECTORY_ACTIVITY_DAYS - 1));
|
|
38
|
-
return { end, start };
|
|
39
|
-
}
|
|
40
|
-
function directoryActivityDays(rows, nowMs) {
|
|
41
|
-
const days = new Map(rows.map((row) => [row.date, row]));
|
|
42
|
-
const { end, start } = activityWindow(nowMs);
|
|
43
|
-
const items = [];
|
|
44
|
-
for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setUTCDate(cursor.getUTCDate() + 1)) {
|
|
45
|
-
const date = cursor.toISOString().slice(0, 10);
|
|
46
|
-
items.push(days.get(date) ?? { activePeople: 0, conversations: 0, date });
|
|
47
|
-
}
|
|
48
|
-
return items;
|
|
49
|
-
}
|
|
50
|
-
async function readPeopleListFromSql() {
|
|
51
|
-
const nowMs = Date.now();
|
|
52
|
-
const { end, start } = activityWindow(nowMs);
|
|
53
|
-
const activityDate = sql`TO_CHAR(
|
|
54
|
-
${juniorConversations.lastActivityAt} AT TIME ZONE 'UTC',
|
|
55
|
-
'YYYY-MM-DD'
|
|
56
|
-
)`;
|
|
57
|
-
const [rows, activityRows] = await Promise.all([
|
|
58
|
-
getDb().select({
|
|
59
|
-
email: juniorUsers.primaryEmailNormalized,
|
|
60
|
-
fullName: juniorUsers.displayName,
|
|
61
|
-
slackUserId: sql`MAX(${juniorIdentities.providerSubjectId})`,
|
|
62
|
-
slackUserName: sql`MAX(${juniorIdentities.handle})`,
|
|
63
|
-
activeDays: conversationActiveDaysColumn(),
|
|
64
|
-
...conversationAggregateColumns(),
|
|
65
|
-
...conversationRangeColumns()
|
|
66
|
-
}).from(juniorConversations).innerJoin(
|
|
67
|
-
juniorIdentities,
|
|
68
|
-
eq(juniorIdentities.id, juniorConversations.actorIdentityId)
|
|
69
|
-
).innerJoin(juniorUsers, eq(juniorUsers.id, juniorIdentities.userId)).where(verifiedActorWhere()).groupBy(juniorUsers.primaryEmailNormalized, juniorUsers.displayName),
|
|
70
|
-
getDb().select({
|
|
71
|
-
activePeople: sql`COUNT(DISTINCT ${juniorUsers.id})::int`,
|
|
72
|
-
conversations: sql`COUNT(*)::int`,
|
|
73
|
-
date: activityDate
|
|
74
|
-
}).from(juniorConversations).innerJoin(
|
|
75
|
-
juniorIdentities,
|
|
76
|
-
eq(juniorIdentities.id, juniorConversations.actorIdentityId)
|
|
77
|
-
).innerJoin(juniorUsers, eq(juniorUsers.id, juniorIdentities.userId)).where(
|
|
78
|
-
and(
|
|
79
|
-
verifiedActorWhere(),
|
|
80
|
-
gte(juniorConversations.lastActivityAt, start)
|
|
81
|
-
)
|
|
82
|
-
).groupBy(activityDate)
|
|
83
|
-
]);
|
|
84
|
-
const people = rows.map((row) => {
|
|
85
|
-
const actor = {
|
|
86
|
-
email: row.email,
|
|
87
|
-
...row.fullName ? { fullName: row.fullName } : {},
|
|
88
|
-
...row.slackUserId ? { slackUserId: row.slackUserId } : {},
|
|
89
|
-
...row.slackUserName ? { slackUserName: row.slackUserName } : {}
|
|
90
|
-
};
|
|
91
|
-
return {
|
|
92
|
-
active: row.active,
|
|
93
|
-
activeDays: row.activeDays,
|
|
94
|
-
conversations: row.conversations,
|
|
95
|
-
durationMs: row.durationMs,
|
|
96
|
-
failed: row.failed,
|
|
97
|
-
firstSeenAt: row.firstSeenAt.toISOString(),
|
|
98
|
-
lastSeenAt: row.lastSeenAt.toISOString(),
|
|
99
|
-
actor,
|
|
100
|
-
...row.tokens !== null ? { tokens: row.tokens } : {}
|
|
101
|
-
};
|
|
102
|
-
});
|
|
103
|
-
return {
|
|
104
|
-
activityDays: directoryActivityDays(activityRows, nowMs),
|
|
105
|
-
generatedAt: new Date(nowMs).toISOString(),
|
|
106
|
-
people: people.sort(
|
|
107
|
-
(left, right) => Date.parse(right.lastSeenAt) - Date.parse(left.lastSeenAt) || right.conversations - left.conversations || left.actor.email.localeCompare(right.actor.email)
|
|
108
|
-
),
|
|
109
|
-
source: "conversation_index",
|
|
110
|
-
windowEnd: end.toISOString(),
|
|
111
|
-
windowStart: start.toISOString()
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// src/api/people/list.ts
|
|
116
|
-
async function readPeopleList() {
|
|
117
|
-
return actorDirectoryReportSchema.parse(await readPeopleListFromSql());
|
|
118
|
-
}
|
|
119
|
-
export {
|
|
120
|
-
readPeopleList
|
|
121
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
readConversationFeedFromSql
|
|
3
|
-
} from "./chunk-LJB2TLVT.js";
|
|
4
|
-
import "./chunk-EMUZSROX.js";
|
|
5
|
-
import "./chunk-IQ36I3DF.js";
|
|
6
|
-
import "./chunk-QZGVPPIJ.js";
|
|
7
|
-
import "./chunk-4ZNGQH7C.js";
|
|
8
|
-
import "./chunk-SHBPSE7A.js";
|
|
9
|
-
import "./chunk-FXFQNHRU.js";
|
|
10
|
-
import "./chunk-RT5BUHR5.js";
|
|
11
|
-
import "./chunk-B7PUBQQM.js";
|
|
12
|
-
import "./chunk-AEWZ7F65.js";
|
|
13
|
-
import "./chunk-OB42YVAE.js";
|
|
14
|
-
import "./chunk-6GWA276C.js";
|
|
15
|
-
import "./chunk-7FBGKXPE.js";
|
|
16
|
-
import "./chunk-MLKGABMK.js";
|
|
17
|
-
|
|
18
|
-
// src/reporting/plugin-conversations.ts
|
|
19
|
-
async function listRecentConversationSummaries(requestedLimit = 25) {
|
|
20
|
-
const limit = Math.max(0, Math.min(100, Math.floor(requestedLimit)));
|
|
21
|
-
const feed = await readConversationFeedFromSql({ limit });
|
|
22
|
-
return feed.conversations.map((report) => {
|
|
23
|
-
return {
|
|
24
|
-
conversationId: report.conversationId,
|
|
25
|
-
displayTitle: report.displayTitle,
|
|
26
|
-
lastActivityAt: report.lastSeenAt,
|
|
27
|
-
lastUpdatedAt: report.lastProgressAt,
|
|
28
|
-
status: report.status,
|
|
29
|
-
...report.channelName ? { channelName: report.channelName } : {},
|
|
30
|
-
...report.channelNameRedacted ? { channelNameRedacted: true } : {},
|
|
31
|
-
source: report.surface
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
listRecentConversationSummaries
|
|
37
|
-
};
|