@sentry/junior 0.165.0 → 0.166.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-GSNL33UA.js → agent-hooks-ZIPK2HUF.js} +9 -9
- package/dist/api/schema/workspace.d.ts +2 -0
- package/dist/api/schema.js +1 -1
- package/dist/api.js +40 -47
- package/dist/app.js +62 -63
- package/dist/{catalog-runtime-4ERDVI7V.js → catalog-runtime-GEZAHBUP.js} +5 -5
- package/dist/chat/pi/transcript.d.ts +10 -10
- package/dist/chat/sandbox/snapshot/resolve.d.ts +4 -0
- package/dist/chat/services/conversation-memory.d.ts +7 -0
- package/dist/chat/workspaces/store.d.ts +10 -1
- package/dist/chat/workspaces/types.d.ts +8 -0
- package/dist/{chunk-EA4UL5H2.js → chunk-22RO7IDD.js} +40 -11
- package/dist/{chunk-NPW6LM2X.js → chunk-2KV4BAAN.js} +12 -12
- package/dist/{chunk-SA5FVUWJ.js → chunk-2ZKFLHVP.js} +6 -6
- package/dist/{chunk-AQEBOQUC.js → chunk-3EZ5V7XQ.js} +9 -9
- package/dist/{chunk-T6BAHCT6.js → chunk-43KLUCAM.js} +17 -17
- package/dist/{chunk-BEC542E6.js → chunk-4CMORAHL.js} +2 -1
- package/dist/chunk-4DARCEZH.js +274 -0
- package/dist/{chunk-HZDLOFO4.js → chunk-4MDEQNSW.js} +5 -5
- package/dist/{chunk-IZHR2OES.js → chunk-65SNO3WK.js} +13 -2
- package/dist/{chunk-3V2EIQLT.js → chunk-ABNRESX6.js} +1 -1
- package/dist/{chunk-FMOFCEAA.js → chunk-AEKBVJMV.js} +2 -2
- package/dist/{chunk-5T6WPPEI.js → chunk-BKP3PVKR.js} +1 -1
- package/dist/{chunk-6RZ6MMEK.js → chunk-C3USHSIJ.js} +1 -1
- package/dist/{chunk-DKO4RRGJ.js → chunk-CDBTQQQ4.js} +1 -1
- package/dist/{chunk-VDNNVTX2.js → chunk-DTQAMME2.js} +5 -5
- package/dist/{chunk-65B3PDY7.js → chunk-EKBVHDZO.js} +1 -1
- package/dist/{chunk-7J26TW64.js → chunk-FEYQVP64.js} +5 -5
- package/dist/{chunk-XOINKFDJ.js → chunk-FFE3BMAT.js} +7 -7
- package/dist/{chunk-RQQTOF3H.js → chunk-JDTCQDRU.js} +3 -3
- package/dist/{chunk-32CCG4WP.js → chunk-JUFZR2LD.js} +1 -1
- package/dist/{chunk-ZUKU2Y3J.js → chunk-KQ5YZGDV.js} +1 -1
- package/dist/{chunk-G72LBEMZ.js → chunk-LGSGPWYH.js} +1 -1
- package/dist/{chunk-TCWPG5VL.js → chunk-MDW5YPXW.js} +2 -2
- package/dist/{chunk-AEBF6AO2.js → chunk-OCOGPNHA.js} +1 -1
- package/dist/{chunk-FXX4NHOM.js → chunk-OYN45QUQ.js} +6 -6
- package/dist/{chunk-N2BRRIQZ.js → chunk-P6UQMGM2.js} +1 -1
- package/dist/{chunk-BEHPIDVZ.js → chunk-Q2IPCX7J.js} +45 -283
- package/dist/{chunk-HPWZ4BJJ.js → chunk-SLWGX3G5.js} +72 -68
- package/dist/{chunk-FNNQCHOL.js → chunk-U2UCDSDF.js} +4 -4
- package/dist/{chunk-7S2JVUWS.js → chunk-VNPG55CU.js} +1 -1
- package/dist/{chunk-5WDDWMQ7.js → chunk-WX42YNDQ.js} +64 -7
- package/dist/{chunk-6OWVPXNO.js → chunk-YTIKGCPC.js} +1 -1
- package/dist/{chunk-6YXCG2XL.js → chunk-ZKJO4K6M.js} +4 -4
- package/dist/cli/chat.js +30 -29
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +12 -10
- package/dist/cli/upgrade.js +7 -7
- package/dist/db/schema/workspaces.d.ts +68 -0
- package/dist/db/schema.d.ts +68 -0
- package/dist/{db-5TTEPMTY.js → db-TGZBS2CP.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-IVFC5YHY.js → oauth-callback-server-Z54WUF5H.js} +22 -22
- package/dist/{runner-G76TSHWO.js → runner-PVFHKKK6.js} +12 -12
- package/dist/{skills-F6PSLVSG.js → skills-BYRH3QWD.js} +6 -6
- package/dist/spawn-RIPWK7EP.js +37 -0
- package/dist/{validation-56EJI6UQ.js → validation-VZIE4RHA.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-RNRQCP3Y.js → work-JTHAOPDQ.js} +17 -17
- package/dist/worker-APEVP56Y.js +24 -0
- package/migrations/0031_wild_phantom_reporter.sql +4 -0
- package/migrations/meta/0031_snapshot.json +2823 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
- package/dist/spawn-WMJPIAZL.js +0 -37
- package/dist/worker-FBR2WUI4.js +0 -24
|
@@ -13,19 +13,19 @@ import {
|
|
|
13
13
|
getPlugins,
|
|
14
14
|
setPlugins,
|
|
15
15
|
validatePlugins
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-WX42YNDQ.js";
|
|
17
|
+
import "./chunk-JDTCQDRU.js";
|
|
18
|
+
import "./chunk-65SNO3WK.js";
|
|
19
19
|
import "./chunk-BVREIWBD.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-EKBVHDZO.js";
|
|
21
|
+
import "./chunk-AEKBVJMV.js";
|
|
22
22
|
import "./chunk-VFUK3X5B.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-KQ5YZGDV.js";
|
|
24
24
|
import "./chunk-V7YE4WCP.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-JUFZR2LD.js";
|
|
26
26
|
import "./chunk-6GWA276C.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-BKP3PVKR.js";
|
|
28
|
+
import "./chunk-YTIKGCPC.js";
|
|
29
29
|
import "./chunk-MLKGABMK.js";
|
|
30
30
|
export {
|
|
31
31
|
PluginHookDeniedError,
|
|
@@ -16,6 +16,7 @@ export declare const workspaceSchema: z.ZodObject<{
|
|
|
16
16
|
snapshot: z.ZodNullable<z.ZodObject<{
|
|
17
17
|
id: z.ZodString;
|
|
18
18
|
generatedAt: z.ZodISODateTime;
|
|
19
|
+
buildDurationMs: z.ZodNumber;
|
|
19
20
|
}, z.core.$strict>>;
|
|
20
21
|
}, z.core.$strict>;
|
|
21
22
|
export declare const workspaceListSchema: z.ZodObject<{
|
|
@@ -31,6 +32,7 @@ export declare const workspaceListSchema: z.ZodObject<{
|
|
|
31
32
|
snapshot: z.ZodNullable<z.ZodObject<{
|
|
32
33
|
id: z.ZodString;
|
|
33
34
|
generatedAt: z.ZodISODateTime;
|
|
35
|
+
buildDurationMs: z.ZodNumber;
|
|
34
36
|
}, z.core.$strict>>;
|
|
35
37
|
}, z.core.$strict>>;
|
|
36
38
|
}, z.core.$strict>;
|
package/dist/api/schema.js
CHANGED
package/dist/api.js
CHANGED
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
workspaceListSchema,
|
|
42
42
|
workspaceParamsSchema,
|
|
43
43
|
workspaceSchema
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-4CMORAHL.js";
|
|
45
45
|
import {
|
|
46
46
|
appendAndEnqueueApiConversationMessage,
|
|
47
47
|
authenticatePersonalToken,
|
|
@@ -59,15 +59,15 @@ import {
|
|
|
59
59
|
revokePersonalToken,
|
|
60
60
|
viewerConversationMembership,
|
|
61
61
|
webActorFromEmail
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-2KV4BAAN.js";
|
|
63
63
|
import {
|
|
64
64
|
buildSentryConversationUrl,
|
|
65
65
|
getWebAuthorization
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-OCOGPNHA.js";
|
|
67
67
|
import {
|
|
68
68
|
cancelHumanFacingPendingMessages,
|
|
69
69
|
getConversation
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-ZKJO4K6M.js";
|
|
71
71
|
import {
|
|
72
72
|
readTaskExecutionByConversationId,
|
|
73
73
|
readTaskExecutionDays,
|
|
@@ -75,8 +75,8 @@ import {
|
|
|
75
75
|
readTaskExecutionSummaries,
|
|
76
76
|
readTaskExecutions,
|
|
77
77
|
readTaskRuns
|
|
78
|
-
} from "./chunk-
|
|
79
|
-
import "./chunk-
|
|
78
|
+
} from "./chunk-3EZ5V7XQ.js";
|
|
79
|
+
import "./chunk-DTQAMME2.js";
|
|
80
80
|
import {
|
|
81
81
|
healthReportSchema,
|
|
82
82
|
pluginOperationalReportFeedSchema,
|
|
@@ -102,21 +102,20 @@ import {
|
|
|
102
102
|
listPublicScheduledTasksForTeams,
|
|
103
103
|
readLiveAttachment,
|
|
104
104
|
readStats
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-4MDEQNSW.js";
|
|
106
106
|
import {
|
|
107
107
|
parseSlackThreadId
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-ABNRESX6.js";
|
|
109
109
|
import {
|
|
110
110
|
agentTurnUsageSchema,
|
|
111
111
|
fallbackShortTitle,
|
|
112
112
|
hasAgentTurnUsage,
|
|
113
113
|
renderJuniorNativeConversationEvent
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-22RO7IDD.js";
|
|
115
115
|
import "./chunk-3Y47VMHV.js";
|
|
116
116
|
import {
|
|
117
|
-
getCachedSnapshot,
|
|
118
117
|
hash
|
|
119
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-4DARCEZH.js";
|
|
120
119
|
import "./chunk-PDO5BLNM.js";
|
|
121
120
|
import {
|
|
122
121
|
WorkspaceValidationError,
|
|
@@ -136,7 +135,7 @@ import {
|
|
|
136
135
|
updateWorkspace,
|
|
137
136
|
withSlackRetries,
|
|
138
137
|
workspaceRepoCheckoutPath
|
|
139
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-WX42YNDQ.js";
|
|
140
139
|
import {
|
|
141
140
|
decodeStoredConversationEvent,
|
|
142
141
|
getConversationStore,
|
|
@@ -144,22 +143,22 @@ import {
|
|
|
144
143
|
getSqlExecutor,
|
|
145
144
|
locationFromRow,
|
|
146
145
|
parseSessionSource
|
|
147
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-JDTCQDRU.js";
|
|
148
147
|
import {
|
|
149
148
|
juniorConversationEvents,
|
|
150
149
|
juniorConversations,
|
|
151
150
|
juniorIdentities,
|
|
152
151
|
juniorUsers
|
|
153
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-65SNO3WK.js";
|
|
154
153
|
import "./chunk-BVREIWBD.js";
|
|
155
|
-
import "./chunk-
|
|
156
|
-
import "./chunk-
|
|
154
|
+
import "./chunk-EKBVHDZO.js";
|
|
155
|
+
import "./chunk-AEKBVJMV.js";
|
|
157
156
|
import {
|
|
158
157
|
juniorDestinations
|
|
159
158
|
} from "./chunk-VFUK3X5B.js";
|
|
160
|
-
import "./chunk-
|
|
161
|
-
import "./chunk-
|
|
162
|
-
import "./chunk-
|
|
159
|
+
import "./chunk-KQ5YZGDV.js";
|
|
160
|
+
import "./chunk-VNPG55CU.js";
|
|
161
|
+
import "./chunk-P6UQMGM2.js";
|
|
163
162
|
import "./chunk-BDUENQD3.js";
|
|
164
163
|
import {
|
|
165
164
|
parseSlackChannelId,
|
|
@@ -169,12 +168,12 @@ import {
|
|
|
169
168
|
import {
|
|
170
169
|
logException,
|
|
171
170
|
logWarn
|
|
172
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-JUFZR2LD.js";
|
|
173
172
|
import "./chunk-6GWA276C.js";
|
|
174
173
|
import "./chunk-OOUNJNMR.js";
|
|
175
174
|
import "./chunk-H4HBKISO.js";
|
|
176
|
-
import "./chunk-
|
|
177
|
-
import "./chunk-
|
|
175
|
+
import "./chunk-BKP3PVKR.js";
|
|
176
|
+
import "./chunk-YTIKGCPC.js";
|
|
178
177
|
import "./chunk-MLKGABMK.js";
|
|
179
178
|
|
|
180
179
|
// src/api.ts
|
|
@@ -4075,7 +4074,7 @@ async function readPeoplePluginReports(args) {
|
|
|
4075
4074
|
source: "plugins"
|
|
4076
4075
|
});
|
|
4077
4076
|
}
|
|
4078
|
-
const { getPluginProfileReports } = await import("./agent-hooks-
|
|
4077
|
+
const { getPluginProfileReports } = await import("./agent-hooks-ZIPK2HUF.js");
|
|
4079
4078
|
return pluginOperationalReportFeedSchema.parse({
|
|
4080
4079
|
generatedAt: new Date(nowMs).toISOString(),
|
|
4081
4080
|
reports: await getPluginProfileReports({
|
|
@@ -4629,6 +4628,17 @@ function createTaskRoutes() {
|
|
|
4629
4628
|
|
|
4630
4629
|
// src/api/workspaces/routes.ts
|
|
4631
4630
|
import { Hono as Hono7 } from "hono";
|
|
4631
|
+
function snapshotView(workspace) {
|
|
4632
|
+
const recorded = workspace.snapshot;
|
|
4633
|
+
if (!recorded) return null;
|
|
4634
|
+
const profileHash = hash(SANDBOX_RUNTIME, workspace);
|
|
4635
|
+
if (!profileHash || recorded.profileHash !== profileHash) return null;
|
|
4636
|
+
return {
|
|
4637
|
+
id: recorded.id,
|
|
4638
|
+
generatedAt: recorded.generatedAt.toISOString(),
|
|
4639
|
+
buildDurationMs: recorded.buildDurationMs
|
|
4640
|
+
};
|
|
4641
|
+
}
|
|
4632
4642
|
function view(workspace) {
|
|
4633
4643
|
return {
|
|
4634
4644
|
id: workspace.id,
|
|
@@ -4642,27 +4652,10 @@ function view(workspace) {
|
|
|
4642
4652
|
snapshot: null
|
|
4643
4653
|
};
|
|
4644
4654
|
}
|
|
4645
|
-
|
|
4646
|
-
const profileHash = hash(SANDBOX_RUNTIME, workspace);
|
|
4647
|
-
let snapshot = null;
|
|
4648
|
-
if (profileHash) {
|
|
4649
|
-
try {
|
|
4650
|
-
const cached = await getCachedSnapshot(profileHash);
|
|
4651
|
-
if (cached) {
|
|
4652
|
-
snapshot = {
|
|
4653
|
-
id: cached.snapshotId,
|
|
4654
|
-
generatedAt: new Date(cached.createdAtMs).toISOString()
|
|
4655
|
-
};
|
|
4656
|
-
}
|
|
4657
|
-
} catch (error) {
|
|
4658
|
-
logException(error, "api.workspaces.snapshot_lookup.failed", {
|
|
4659
|
-
"app.workspace.id": workspace.id
|
|
4660
|
-
});
|
|
4661
|
-
}
|
|
4662
|
-
}
|
|
4655
|
+
function detailView(workspace) {
|
|
4663
4656
|
return {
|
|
4664
4657
|
...view(workspace),
|
|
4665
|
-
snapshot
|
|
4658
|
+
snapshot: snapshotView(workspace)
|
|
4666
4659
|
};
|
|
4667
4660
|
}
|
|
4668
4661
|
function handleValidationError(error) {
|
|
@@ -4704,7 +4697,7 @@ function createWorkspaceRoutes() {
|
|
|
4704
4697
|
const { id } = context.req.valid("param");
|
|
4705
4698
|
const workspace = await getWorkspace(getDb(), id);
|
|
4706
4699
|
if (!workspace) throwApiError(404, "Workspace not found.");
|
|
4707
|
-
return jsonResponse(workspaceSchema,
|
|
4700
|
+
return jsonResponse(workspaceSchema, detailView(workspace));
|
|
4708
4701
|
}
|
|
4709
4702
|
);
|
|
4710
4703
|
app.put(
|
|
@@ -4778,7 +4771,7 @@ function readDescriptionText(home) {
|
|
|
4778
4771
|
}
|
|
4779
4772
|
}
|
|
4780
4773
|
async function readSkillReports() {
|
|
4781
|
-
const { discoverSkills } = await import("./skills-
|
|
4774
|
+
const { discoverSkills } = await import("./skills-BYRH3QWD.js");
|
|
4782
4775
|
const skills = await discoverSkills();
|
|
4783
4776
|
return skillReportsSchema.parse(
|
|
4784
4777
|
skills.map((skill) => ({
|
|
@@ -4788,7 +4781,7 @@ async function readSkillReports() {
|
|
|
4788
4781
|
);
|
|
4789
4782
|
}
|
|
4790
4783
|
async function readPlugins() {
|
|
4791
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
4784
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-GEZAHBUP.js");
|
|
4792
4785
|
return pluginsSchema.parse(
|
|
4793
4786
|
pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
4794
4787
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
@@ -4801,7 +4794,7 @@ async function readPlugins() {
|
|
|
4801
4794
|
async function readRuntimeInfoReport() {
|
|
4802
4795
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
4803
4796
|
import("./discovery-GUFTFBTL.js"),
|
|
4804
|
-
import("./catalog-runtime-
|
|
4797
|
+
import("./catalog-runtime-GEZAHBUP.js"),
|
|
4805
4798
|
readPlugins(),
|
|
4806
4799
|
readSkillReports()
|
|
4807
4800
|
]);
|
|
@@ -4817,7 +4810,7 @@ async function readRuntimeInfoReport() {
|
|
|
4817
4810
|
}
|
|
4818
4811
|
async function readPluginOperationalReportFeed() {
|
|
4819
4812
|
const nowMs = Date.now();
|
|
4820
|
-
const { getPluginOperationalReports } = await import("./agent-hooks-
|
|
4813
|
+
const { getPluginOperationalReports } = await import("./agent-hooks-ZIPK2HUF.js");
|
|
4821
4814
|
return pluginOperationalReportFeedSchema.parse({
|
|
4822
4815
|
source: "plugins",
|
|
4823
4816
|
generatedAt: new Date(nowMs).toISOString(),
|
package/dist/app.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
processConversationWork
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U2UCDSDF.js";
|
|
4
4
|
import {
|
|
5
5
|
bindSpawnAgent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-C3USHSIJ.js";
|
|
7
7
|
import {
|
|
8
8
|
createAgentInvocationWorker,
|
|
9
9
|
enqueueAgentInvocation,
|
|
10
10
|
listPendingAgentInvocationMailboxAppends,
|
|
11
11
|
routeAgentInvocationWork
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2ZKFLHVP.js";
|
|
13
13
|
import {
|
|
14
14
|
GET as GET2,
|
|
15
15
|
GET2 as GET3,
|
|
@@ -36,12 +36,12 @@ import {
|
|
|
36
36
|
startSlackProcessingReaction,
|
|
37
37
|
stripLeadingBotMention,
|
|
38
38
|
wakePausedTurn
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-43KLUCAM.js";
|
|
40
40
|
import "./chunk-FA6POGLH.js";
|
|
41
41
|
import {
|
|
42
42
|
getTurnRequestDeadline,
|
|
43
43
|
runWithTurnRequestDeadline
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-CDBTQQQ4.js";
|
|
45
45
|
import {
|
|
46
46
|
GET,
|
|
47
47
|
apiTurnIdForMessage,
|
|
@@ -58,8 +58,8 @@ import {
|
|
|
58
58
|
resolveSlackConversationContext,
|
|
59
59
|
routeApiTurnWork,
|
|
60
60
|
webActorFromEmail
|
|
61
|
-
} from "./chunk-
|
|
62
|
-
import "./chunk-
|
|
61
|
+
} from "./chunk-2KV4BAAN.js";
|
|
62
|
+
import "./chunk-OCOGPNHA.js";
|
|
63
63
|
import {
|
|
64
64
|
CONVERSATION_WORK_STALE_ENQUEUE_MS,
|
|
65
65
|
appendAndEnqueueInboundMessage,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
isInvalidConversationRecordError,
|
|
71
71
|
listActiveConversationIds,
|
|
72
72
|
removeActiveConversation
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-ZKJO4K6M.js";
|
|
74
74
|
import {
|
|
75
75
|
buildDeliveredTurnStatePatch,
|
|
76
76
|
claimDispatchMailboxAppend,
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
requireTurnFailureEventId,
|
|
102
102
|
resolveTurnSessionRouting,
|
|
103
103
|
scheduleSessionCompletedPluginTasks
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-3EZ5V7XQ.js";
|
|
105
105
|
import {
|
|
106
106
|
ConversationTurnLifecycleService,
|
|
107
107
|
coerceThreadConversationState,
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
persistThreadRuntimeState,
|
|
112
112
|
persistThreadState,
|
|
113
113
|
persistThreadStateById
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-DTQAMME2.js";
|
|
115
115
|
import "./chunk-UTL3MHPC.js";
|
|
116
116
|
import {
|
|
117
117
|
getVercelConversationWorkQueue,
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
import {
|
|
131
131
|
validatePluginEgressCredentialHooks,
|
|
132
132
|
validatePluginRegistrations
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-LGSGPWYH.js";
|
|
134
134
|
import {
|
|
135
135
|
defineJuniorPlugins,
|
|
136
136
|
pluginCatalogConfigFromEnv,
|
|
@@ -165,11 +165,11 @@ import {
|
|
|
165
165
|
shouldEmitDevAgentTrace,
|
|
166
166
|
shouldPropagateSandboxEgressTrace,
|
|
167
167
|
unpublishedArtifactHeaders
|
|
168
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-SLWGX3G5.js";
|
|
169
169
|
import {
|
|
170
170
|
AuthorizationFlowDisabledError,
|
|
171
171
|
PluginCredentialFailureError
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-FEYQVP64.js";
|
|
173
173
|
import "./chunk-DIB4GX3G.js";
|
|
174
174
|
import {
|
|
175
175
|
createAgentRunner,
|
|
@@ -177,7 +177,7 @@ import {
|
|
|
177
177
|
deleteMcpAuthSessionsForUserProvider,
|
|
178
178
|
deleteMcpServerSessionId,
|
|
179
179
|
deleteMcpStoredOAuthCredentials
|
|
180
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-FFE3BMAT.js";
|
|
181
181
|
import {
|
|
182
182
|
RetryableDeliveryError
|
|
183
183
|
} from "./chunk-RF6J3DIO.js";
|
|
@@ -185,13 +185,17 @@ import {
|
|
|
185
185
|
formatProviderLabel,
|
|
186
186
|
postSlackMessage,
|
|
187
187
|
startOAuthFlow
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-OYN45QUQ.js";
|
|
189
189
|
import "./chunk-7MA4HV4W.js";
|
|
190
190
|
import {
|
|
191
191
|
getExperimentalFeatures,
|
|
192
192
|
isExperimentalFeatureEnabled,
|
|
193
193
|
setExperimentalFeatures
|
|
194
194
|
} from "./chunk-VRS6WDK5.js";
|
|
195
|
+
import {
|
|
196
|
+
getSandboxResourceConfig,
|
|
197
|
+
setSandboxResourceConfig
|
|
198
|
+
} from "./chunk-Q2IPCX7J.js";
|
|
195
199
|
import {
|
|
196
200
|
collectAttachmentGarbage,
|
|
197
201
|
createSchedulerSqlStore,
|
|
@@ -199,16 +203,17 @@ import {
|
|
|
199
203
|
logScheduledTaskRunSkipped,
|
|
200
204
|
requestAttachmentDeletion,
|
|
201
205
|
scheduledTaskRunAttributes
|
|
202
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-4MDEQNSW.js";
|
|
203
207
|
import {
|
|
204
208
|
parseSlackThreadId
|
|
205
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-ABNRESX6.js";
|
|
206
210
|
import {
|
|
207
211
|
ConversationTurnBoundaryError,
|
|
208
212
|
CooperativeTurnYieldError,
|
|
209
213
|
TurnInputCommitLostError,
|
|
210
214
|
TurnInputDeferredError,
|
|
211
215
|
abandonTurnRecord,
|
|
216
|
+
appendThreadContextMessages,
|
|
212
217
|
buildConversationContext,
|
|
213
218
|
buildDeterministicAssistantMessageId,
|
|
214
219
|
buildDeterministicTurnId,
|
|
@@ -253,12 +258,9 @@ import {
|
|
|
253
258
|
trimTrailingAssistantMessages,
|
|
254
259
|
turnHasReply,
|
|
255
260
|
upsertConversationMessage
|
|
256
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-22RO7IDD.js";
|
|
257
262
|
import "./chunk-3Y47VMHV.js";
|
|
258
|
-
import
|
|
259
|
-
getSandboxResourceConfig,
|
|
260
|
-
setSandboxResourceConfig
|
|
261
|
-
} from "./chunk-BEHPIDVZ.js";
|
|
263
|
+
import "./chunk-4DARCEZH.js";
|
|
262
264
|
import "./chunk-PDO5BLNM.js";
|
|
263
265
|
import "./chunk-UIE3R5XU.js";
|
|
264
266
|
import {
|
|
@@ -286,7 +288,7 @@ import {
|
|
|
286
288
|
verifyEventTaskCredentialSubject,
|
|
287
289
|
verifyScheduledTaskCredentialSubject,
|
|
288
290
|
verifySlackDirectCredentialSubject
|
|
289
|
-
} from "./chunk-
|
|
291
|
+
} from "./chunk-WX42YNDQ.js";
|
|
290
292
|
import {
|
|
291
293
|
contextProvenance,
|
|
292
294
|
createSlackDestination,
|
|
@@ -299,13 +301,13 @@ import {
|
|
|
299
301
|
requireSlackDestination,
|
|
300
302
|
withConversationEventLock,
|
|
301
303
|
withConversationMutationLock
|
|
302
|
-
} from "./chunk-
|
|
304
|
+
} from "./chunk-JDTCQDRU.js";
|
|
303
305
|
import {
|
|
304
306
|
juniorAgentBindings,
|
|
305
307
|
juniorAgentInvocations,
|
|
306
308
|
juniorConversationEvents,
|
|
307
309
|
juniorConversations
|
|
308
|
-
} from "./chunk-
|
|
310
|
+
} from "./chunk-65SNO3WK.js";
|
|
309
311
|
import {
|
|
310
312
|
sleep
|
|
311
313
|
} from "./chunk-BVREIWBD.js";
|
|
@@ -313,7 +315,7 @@ import {
|
|
|
313
315
|
acquireActiveLock,
|
|
314
316
|
getStateAdapter,
|
|
315
317
|
withActiveLock
|
|
316
|
-
} from "./chunk-
|
|
318
|
+
} from "./chunk-EKBVHDZO.js";
|
|
317
319
|
import {
|
|
318
320
|
STANDARD_MODEL_PROFILE,
|
|
319
321
|
botConfig,
|
|
@@ -331,16 +333,16 @@ import {
|
|
|
331
333
|
modelIdForProfile,
|
|
332
334
|
setSlackReactionConfig,
|
|
333
335
|
standardModelId
|
|
334
|
-
} from "./chunk-
|
|
336
|
+
} from "./chunk-AEKBVJMV.js";
|
|
335
337
|
import {
|
|
336
338
|
juniorDestinations
|
|
337
339
|
} from "./chunk-VFUK3X5B.js";
|
|
338
|
-
import "./chunk-
|
|
339
|
-
import "./chunk-
|
|
340
|
+
import "./chunk-KQ5YZGDV.js";
|
|
341
|
+
import "./chunk-MDW5YPXW.js";
|
|
340
342
|
import {
|
|
341
343
|
pluginCatalogRuntime
|
|
342
|
-
} from "./chunk-
|
|
343
|
-
import "./chunk-
|
|
344
|
+
} from "./chunk-VNPG55CU.js";
|
|
345
|
+
import "./chunk-P6UQMGM2.js";
|
|
344
346
|
import {
|
|
345
347
|
credentialContextForActor
|
|
346
348
|
} from "./chunk-BDUENQD3.js";
|
|
@@ -372,7 +374,7 @@ import {
|
|
|
372
374
|
withContext,
|
|
373
375
|
withLogContext,
|
|
374
376
|
withSpan
|
|
375
|
-
} from "./chunk-
|
|
377
|
+
} from "./chunk-JUFZR2LD.js";
|
|
376
378
|
import {
|
|
377
379
|
continueTrace
|
|
378
380
|
} from "./chunk-6GWA276C.js";
|
|
@@ -380,10 +382,10 @@ import "./chunk-OOUNJNMR.js";
|
|
|
380
382
|
import "./chunk-H4HBKISO.js";
|
|
381
383
|
import {
|
|
382
384
|
JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
|
|
383
|
-
} from "./chunk-
|
|
385
|
+
} from "./chunk-BKP3PVKR.js";
|
|
384
386
|
import {
|
|
385
387
|
JUNIOR_VERSION
|
|
386
|
-
} from "./chunk-
|
|
388
|
+
} from "./chunk-YTIKGCPC.js";
|
|
387
389
|
import "./chunk-MLKGABMK.js";
|
|
388
390
|
|
|
389
391
|
// src/app.ts
|
|
@@ -6152,7 +6154,7 @@ function parkedInputKey(message) {
|
|
|
6152
6154
|
const text = first && typeof first === "object" && "text" in first ? String(first.text ?? "") : "";
|
|
6153
6155
|
return `${message.timestamp}:${text}`;
|
|
6154
6156
|
}
|
|
6155
|
-
function
|
|
6157
|
+
function renderRecentThreadMessageLines(conversationContext, messages) {
|
|
6156
6158
|
const passiveMessages = messages.filter((queued) => {
|
|
6157
6159
|
if (queued.explicitMention) {
|
|
6158
6160
|
return false;
|
|
@@ -6161,35 +6163,33 @@ function renderRecentThreadMessages(conversationContext, messages) {
|
|
|
6161
6163
|
return !slackTs || !conversationContext?.includes(`slack_ts="${slackTs}"`);
|
|
6162
6164
|
});
|
|
6163
6165
|
if (passiveMessages.length === 0) {
|
|
6164
|
-
return
|
|
6166
|
+
return [];
|
|
6165
6167
|
}
|
|
6166
|
-
const lines = [
|
|
6168
|
+
const lines = [];
|
|
6167
6169
|
for (const queued of passiveMessages) {
|
|
6168
6170
|
const actor = queuedInstructionActor(queued);
|
|
6171
|
+
const author = escapeXml(actor?.authorName ?? "user");
|
|
6169
6172
|
const attrs = [
|
|
6170
|
-
|
|
6171
|
-
|
|
6173
|
+
`role="user"`,
|
|
6174
|
+
`author="${author}"`,
|
|
6175
|
+
actor?.authorId ? `actor_id="${escapeXml(actor.authorId)}"` : void 0,
|
|
6172
6176
|
actor?.slackTs ? `slack_ts="${escapeXml(actor.slackTs)}"` : void 0
|
|
6173
6177
|
].filter((attr) => Boolean(attr)).join(" ");
|
|
6178
|
+
const text = escapeXml(queued.userText.replace(/\s+/g, " "));
|
|
6174
6179
|
lines.push(
|
|
6175
|
-
|
|
6176
|
-
|
|
6180
|
+
` <message ${attrs}>`,
|
|
6181
|
+
`[user] ${author}: ${text}`,
|
|
6177
6182
|
" </message>"
|
|
6178
6183
|
);
|
|
6179
6184
|
}
|
|
6180
|
-
lines
|
|
6181
|
-
return lines.join("\n");
|
|
6185
|
+
return lines;
|
|
6182
6186
|
}
|
|
6183
6187
|
function appendRecentThreadMessagesToContext(conversationContext, messages, options) {
|
|
6184
|
-
const
|
|
6185
|
-
|
|
6186
|
-
|
|
6188
|
+
const baseContext = options?.includeConversationContext === false ? void 0 : conversationContext;
|
|
6189
|
+
return appendThreadContextMessages(
|
|
6190
|
+
baseContext,
|
|
6191
|
+
renderRecentThreadMessageLines(conversationContext, messages)
|
|
6187
6192
|
);
|
|
6188
|
-
const contextParts = [
|
|
6189
|
-
options?.includeConversationContext === false ? void 0 : conversationContext?.trim(),
|
|
6190
|
-
recentThreadMessages
|
|
6191
|
-
].filter((part) => Boolean(part));
|
|
6192
|
-
return contextParts.length > 0 ? contextParts.join("\n\n") : void 0;
|
|
6193
6193
|
}
|
|
6194
6194
|
function queuedInstructionActor(queued) {
|
|
6195
6195
|
const actor = getMessageActorIdentity(queued.message);
|
|
@@ -6436,17 +6436,14 @@ function createReplyToThread(deps) {
|
|
|
6436
6436
|
text: queued.userText,
|
|
6437
6437
|
timestampMs: queued.message.metadata.dateSent.getTime(),
|
|
6438
6438
|
omittedImageAttachmentCount: !isVisionEnabled() && hasPotentialImageAttachment(attachments) ? countPotentialImageAttachments(attachments) : 0,
|
|
6439
|
-
attachments: await deps.resolveUserAttachments(
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
messageTs: getMessageTimestamp(queued.message)
|
|
6448
|
-
}
|
|
6449
|
-
)
|
|
6439
|
+
attachments: await deps.resolveUserAttachments(attachments, {
|
|
6440
|
+
threadId,
|
|
6441
|
+
actorId: isResourceEventSlackMessage(queued.message) ? void 0 : queued.message.author.userId,
|
|
6442
|
+
channelId,
|
|
6443
|
+
runId,
|
|
6444
|
+
conversation: preparedState.conversation,
|
|
6445
|
+
messageTs: getMessageTimestamp(queued.message)
|
|
6446
|
+
})
|
|
6450
6447
|
};
|
|
6451
6448
|
})
|
|
6452
6449
|
);
|
|
@@ -6989,7 +6986,9 @@ function createReplyToThread(deps) {
|
|
|
6989
6986
|
slackConversation,
|
|
6990
6987
|
source,
|
|
6991
6988
|
destination,
|
|
6992
|
-
publishExternally: shouldPublishExternally2(
|
|
6989
|
+
publishExternally: shouldPublishExternally2(
|
|
6990
|
+
options.publishExternally
|
|
6991
|
+
),
|
|
6993
6992
|
...destinationVisibility ? { destinationVisibility } : {},
|
|
6994
6993
|
surface: options.execution?.surface ?? "slack",
|
|
6995
6994
|
dispatch: options.execution?.dispatch,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-VNPG55CU.js";
|
|
4
|
+
import "./chunk-P6UQMGM2.js";
|
|
5
5
|
import "./chunk-BDUENQD3.js";
|
|
6
6
|
import "./chunk-V7YE4WCP.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-JUFZR2LD.js";
|
|
8
8
|
import "./chunk-6GWA276C.js";
|
|
9
9
|
import "./chunk-OOUNJNMR.js";
|
|
10
10
|
import "./chunk-H4HBKISO.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-BKP3PVKR.js";
|
|
12
|
+
import "./chunk-YTIKGCPC.js";
|
|
13
13
|
import "./chunk-MLKGABMK.js";
|
|
14
14
|
export {
|
|
15
15
|
pluginCatalogRuntime
|
|
@@ -34,16 +34,16 @@ export declare function retainRuntimeTurnContext(messages: PiMessage[]): PiMessa
|
|
|
34
34
|
/**
|
|
35
35
|
* Reduce a runtime user-turn prompt to only the current turn's instruction.
|
|
36
36
|
*
|
|
37
|
-
* Live user prompts embed prior-thread context
|
|
38
|
-
*
|
|
39
|
-
* the
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
37
|
+
* Live user prompts embed prior-thread context as `<thread-context
|
|
38
|
+
* authority="evidence-only">` (or legacy transcript/background blocks) beside
|
|
39
|
+
* the `<current-instruction>` block. Those blocks hold other participants'
|
|
40
|
+
* verbatim messages, so completed-run projections consumed by plugins must
|
|
41
|
+
* expose only the instruction authored by this turn's actor — otherwise
|
|
42
|
+
* per-entry provenance can be defeated by reading another user's text out of an
|
|
43
|
+
* instruction-authority entry. Prior thread context is projected separately as
|
|
44
|
+
* per-author context-authority entries, so dropping it here is non-lossy for
|
|
45
|
+
* plugins. This is projection-only; it never touches what the model sees during
|
|
46
|
+
* a live run.
|
|
47
47
|
*/
|
|
48
48
|
export declare function instructionTextForProjection(text: string): string;
|
|
49
49
|
/** Return the projected instruction text carried by one user message. */
|
|
@@ -7,6 +7,7 @@ declare const cachedSnapshotSchema: z.ZodObject<{
|
|
|
7
7
|
runtime: z.ZodString;
|
|
8
8
|
createdAtMs: z.ZodNumber;
|
|
9
9
|
dependencyCount: z.ZodNumber;
|
|
10
|
+
buildDurationMs: z.ZodNumber;
|
|
10
11
|
}, z.core.$strict>;
|
|
11
12
|
type CachedSnapshot = z.output<typeof cachedSnapshotSchema>;
|
|
12
13
|
export type ResolveOutcome = "no_profile" | "cache_hit" | "cache_hit_after_lock_wait" | "rebuilt" | "forced_rebuild";
|
|
@@ -19,6 +20,9 @@ export interface Snapshot {
|
|
|
19
20
|
cacheHit: boolean;
|
|
20
21
|
resolveOutcome: ResolveOutcome;
|
|
21
22
|
rebuildReason?: RebuildReason;
|
|
23
|
+
/** Present when the Redis registry has a concrete snapshot entry. */
|
|
24
|
+
createdAtMs?: number;
|
|
25
|
+
buildDurationMs?: number;
|
|
22
26
|
}
|
|
23
27
|
export type ProgressPhase = "resolve_start" | "cache_hit" | "waiting_for_lock" | "building_snapshot" | "build_complete";
|
|
24
28
|
/** Read one cached snapshot pointer; only a missing key is a cache miss. */
|