@sentry/junior 0.164.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.
Files changed (74) hide show
  1. package/dist/{agent-hooks-WTBPNRTC.js → agent-hooks-ZIPK2HUF.js} +9 -9
  2. package/dist/api/schema/workspace.d.ts +10 -4
  3. package/dist/api/schema.js +1 -1
  4. package/dist/api.js +52 -27
  5. package/dist/app.js +59 -60
  6. package/dist/{catalog-runtime-CZ2SQINY.js → catalog-runtime-GEZAHBUP.js} +5 -5
  7. package/dist/chat/pi/transcript.d.ts +10 -10
  8. package/dist/chat/repository-instructions.d.ts +12 -1
  9. package/dist/chat/sandbox/sandbox.d.ts +1 -1
  10. package/dist/chat/sandbox/snapshot/resolve.d.ts +16 -0
  11. package/dist/chat/sandbox/snapshot/runtime.d.ts +2 -0
  12. package/dist/chat/services/conversation-memory.d.ts +7 -0
  13. package/dist/chat/workspaces/store.d.ts +10 -3
  14. package/dist/chat/workspaces/types.d.ts +8 -1
  15. package/dist/chat/workspaces/validation.d.ts +0 -1
  16. package/dist/{chunk-HHW6ZVIZ.js → chunk-22RO7IDD.js} +109 -21
  17. package/dist/{chunk-FKDY7NTC.js → chunk-2KV4BAAN.js} +12 -12
  18. package/dist/{chunk-Y2B6AXZQ.js → chunk-2ZKFLHVP.js} +6 -6
  19. package/dist/{chunk-ZUTAGCPH.js → chunk-3EZ5V7XQ.js} +9 -9
  20. package/dist/{chunk-3L23VTY7.js → chunk-43KLUCAM.js} +17 -17
  21. package/dist/{chunk-PU45BSBS.js → chunk-4CMORAHL.js} +9 -5
  22. package/dist/chunk-4DARCEZH.js +274 -0
  23. package/dist/{chunk-6ENAACWN.js → chunk-4MDEQNSW.js} +9 -5
  24. package/dist/{chunk-ZSNABC2E.js → chunk-65SNO3WK.js} +9 -7
  25. package/dist/{chunk-WJUKESU2.js → chunk-ABNRESX6.js} +1 -1
  26. package/dist/{chunk-FX4PX3SA.js → chunk-AEKBVJMV.js} +2 -2
  27. package/dist/{chunk-26JYGL2L.js → chunk-BKP3PVKR.js} +1 -1
  28. package/dist/{chunk-XAIRI54J.js → chunk-C3USHSIJ.js} +1 -1
  29. package/dist/{chunk-RYYEHWIL.js → chunk-CDBTQQQ4.js} +1 -1
  30. package/dist/{chunk-2K25MRZK.js → chunk-DTQAMME2.js} +5 -5
  31. package/dist/{chunk-BXBZDV3C.js → chunk-EKBVHDZO.js} +1 -1
  32. package/dist/{chunk-6BXV63YX.js → chunk-FEYQVP64.js} +5 -5
  33. package/dist/{chunk-H36GJVJV.js → chunk-FFE3BMAT.js} +7 -7
  34. package/dist/{chunk-LPLVNMVN.js → chunk-JDTCQDRU.js} +3 -3
  35. package/dist/{chunk-VHSEMJTS.js → chunk-JUFZR2LD.js} +1 -1
  36. package/dist/{chunk-RBV4JHCP.js → chunk-KQ5YZGDV.js} +1 -1
  37. package/dist/{chunk-4GTOFUQF.js → chunk-LGSGPWYH.js} +1 -1
  38. package/dist/{chunk-NLTQRYNP.js → chunk-MDW5YPXW.js} +2 -2
  39. package/dist/{chunk-5FWQ73UZ.js → chunk-OCOGPNHA.js} +1 -1
  40. package/dist/{chunk-JW23XD4I.js → chunk-OYN45QUQ.js} +6 -6
  41. package/dist/{chunk-VV2DN24T.js → chunk-P6UQMGM2.js} +1 -1
  42. package/dist/{chunk-RJHZNPDH.js → chunk-Q2IPCX7J.js} +45 -282
  43. package/dist/{chunk-7WKWMMYQ.js → chunk-SLWGX3G5.js} +93 -85
  44. package/dist/{chunk-CGCNFEAU.js → chunk-U2UCDSDF.js} +4 -4
  45. package/dist/{chunk-RULIISEI.js → chunk-VNPG55CU.js} +1 -1
  46. package/dist/{chunk-YHCTPDXS.js → chunk-WX42YNDQ.js} +67 -24
  47. package/dist/{chunk-5GLGQHO3.js → chunk-YTIKGCPC.js} +2 -1
  48. package/dist/{chunk-NAGI2XH3.js → chunk-ZKJO4K6M.js} +4 -4
  49. package/dist/cli/chat.js +30 -29
  50. package/dist/cli/check.js +6 -6
  51. package/dist/cli/plugins.js +12 -12
  52. package/dist/cli/snapshot-create.js +12 -10
  53. package/dist/cli/upgrade.js +7 -7
  54. package/dist/db/schema/workspaces.d.ts +68 -17
  55. package/dist/db/schema.d.ts +68 -17
  56. package/dist/{db-32KRFS6L.js → db-TGZBS2CP.js} +7 -7
  57. package/dist/instrumentation.js +4 -4
  58. package/dist/nitro.js +2 -2
  59. package/dist/{oauth-callback-server-CGZP2Z6U.js → oauth-callback-server-Z54WUF5H.js} +22 -22
  60. package/dist/{runner-S5N4Q2XL.js → runner-PVFHKKK6.js} +12 -12
  61. package/dist/{skills-KYPSHSQR.js → skills-BYRH3QWD.js} +6 -6
  62. package/dist/spawn-RIPWK7EP.js +37 -0
  63. package/dist/{validation-SZBE7JNF.js → validation-VZIE4RHA.js} +6 -6
  64. package/dist/version.js +1 -1
  65. package/dist/{work-GCZKHEZX.js → work-JTHAOPDQ.js} +17 -17
  66. package/dist/worker-APEVP56Y.js +24 -0
  67. package/migrations/0030_drop_workspace_repo_primary.sql +2 -0
  68. package/migrations/0031_wild_phantom_reporter.sql +4 -0
  69. package/migrations/meta/0030_snapshot.json +2799 -0
  70. package/migrations/meta/0031_snapshot.json +2823 -0
  71. package/migrations/meta/_journal.json +15 -1
  72. package/package.json +6 -5
  73. package/dist/spawn-EGOB3CLV.js +0 -37
  74. package/dist/worker-6MY5Q4A2.js +0 -24
@@ -13,19 +13,19 @@ import {
13
13
  getPlugins,
14
14
  setPlugins,
15
15
  validatePlugins
16
- } from "./chunk-YHCTPDXS.js";
17
- import "./chunk-LPLVNMVN.js";
18
- import "./chunk-ZSNABC2E.js";
16
+ } from "./chunk-WX42YNDQ.js";
17
+ import "./chunk-JDTCQDRU.js";
18
+ import "./chunk-65SNO3WK.js";
19
19
  import "./chunk-BVREIWBD.js";
20
- import "./chunk-BXBZDV3C.js";
21
- import "./chunk-FX4PX3SA.js";
20
+ import "./chunk-EKBVHDZO.js";
21
+ import "./chunk-AEKBVJMV.js";
22
22
  import "./chunk-VFUK3X5B.js";
23
- import "./chunk-RBV4JHCP.js";
23
+ import "./chunk-KQ5YZGDV.js";
24
24
  import "./chunk-V7YE4WCP.js";
25
- import "./chunk-VHSEMJTS.js";
25
+ import "./chunk-JUFZR2LD.js";
26
26
  import "./chunk-6GWA276C.js";
27
- import "./chunk-26JYGL2L.js";
28
- import "./chunk-5GLGQHO3.js";
27
+ import "./chunk-BKP3PVKR.js";
28
+ import "./chunk-YTIKGCPC.js";
29
29
  import "./chunk-MLKGABMK.js";
30
30
  export {
31
31
  PluginHookDeniedError,
@@ -3,7 +3,6 @@ export declare const workspaceRepoSchema: z.ZodObject<{
3
3
  provider: z.ZodString;
4
4
  repo: z.ZodString;
5
5
  checkoutPath: z.ZodString;
6
- isPrimary: z.ZodBoolean;
7
6
  }, z.core.$strict>;
8
7
  export declare const workspaceSchema: z.ZodObject<{
9
8
  id: z.ZodString;
@@ -13,7 +12,11 @@ export declare const workspaceSchema: z.ZodObject<{
13
12
  provider: z.ZodString;
14
13
  repo: z.ZodString;
15
14
  checkoutPath: z.ZodString;
16
- isPrimary: z.ZodBoolean;
15
+ }, z.core.$strict>>;
16
+ snapshot: z.ZodNullable<z.ZodObject<{
17
+ id: z.ZodString;
18
+ generatedAt: z.ZodISODateTime;
19
+ buildDurationMs: z.ZodNumber;
17
20
  }, z.core.$strict>>;
18
21
  }, z.core.$strict>;
19
22
  export declare const workspaceListSchema: z.ZodObject<{
@@ -25,7 +28,11 @@ export declare const workspaceListSchema: z.ZodObject<{
25
28
  provider: z.ZodString;
26
29
  repo: z.ZodString;
27
30
  checkoutPath: z.ZodString;
28
- isPrimary: z.ZodBoolean;
31
+ }, z.core.$strict>>;
32
+ snapshot: z.ZodNullable<z.ZodObject<{
33
+ id: z.ZodString;
34
+ generatedAt: z.ZodISODateTime;
35
+ buildDurationMs: z.ZodNumber;
29
36
  }, z.core.$strict>>;
30
37
  }, z.core.$strict>>;
31
38
  }, z.core.$strict>;
@@ -35,7 +42,6 @@ export declare const workspaceBodySchema: z.ZodObject<{
35
42
  repos: z.ZodArray<z.ZodObject<{
36
43
  provider: z.ZodString;
37
44
  repo: z.ZodString;
38
- isPrimary: z.ZodOptional<z.ZodBoolean>;
39
45
  }, z.core.$strict>>;
40
46
  }, z.core.$strict>;
41
47
  export declare const workspaceParamsSchema: z.ZodObject<{
@@ -58,7 +58,7 @@ import {
58
58
  workspaceParamsSchema,
59
59
  workspaceRepoSchema,
60
60
  workspaceSchema
61
- } from "../chunk-PU45BSBS.js";
61
+ } from "../chunk-4CMORAHL.js";
62
62
  import {
63
63
  healthReportSchema,
64
64
  pluginOperationalReportFeedSchema,
package/dist/api.js CHANGED
@@ -41,7 +41,7 @@ import {
41
41
  workspaceListSchema,
42
42
  workspaceParamsSchema,
43
43
  workspaceSchema
44
- } from "./chunk-PU45BSBS.js";
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-FKDY7NTC.js";
62
+ } from "./chunk-2KV4BAAN.js";
63
63
  import {
64
64
  buildSentryConversationUrl,
65
65
  getWebAuthorization
66
- } from "./chunk-5FWQ73UZ.js";
66
+ } from "./chunk-OCOGPNHA.js";
67
67
  import {
68
68
  cancelHumanFacingPendingMessages,
69
69
  getConversation
70
- } from "./chunk-NAGI2XH3.js";
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-ZUTAGCPH.js";
79
- import "./chunk-2K25MRZK.js";
78
+ } from "./chunk-3EZ5V7XQ.js";
79
+ import "./chunk-DTQAMME2.js";
80
80
  import {
81
81
  healthReportSchema,
82
82
  pluginOperationalReportFeedSchema,
@@ -90,6 +90,7 @@ import {
90
90
  import "./chunk-JAL3CH4G.js";
91
91
  import "./chunk-5I6ORJUY.js";
92
92
  import {
93
+ SANDBOX_RUNTIME,
93
94
  createSchedulerSqlStore,
94
95
  deleteEventTask,
95
96
  eventTaskBelongsToUser,
@@ -101,17 +102,20 @@ import {
101
102
  listPublicScheduledTasksForTeams,
102
103
  readLiveAttachment,
103
104
  readStats
104
- } from "./chunk-6ENAACWN.js";
105
+ } from "./chunk-4MDEQNSW.js";
105
106
  import {
106
107
  parseSlackThreadId
107
- } from "./chunk-WJUKESU2.js";
108
+ } from "./chunk-ABNRESX6.js";
108
109
  import {
109
110
  agentTurnUsageSchema,
110
111
  fallbackShortTitle,
111
112
  hasAgentTurnUsage,
112
113
  renderJuniorNativeConversationEvent
113
- } from "./chunk-HHW6ZVIZ.js";
114
+ } from "./chunk-22RO7IDD.js";
114
115
  import "./chunk-3Y47VMHV.js";
116
+ import {
117
+ hash
118
+ } from "./chunk-4DARCEZH.js";
115
119
  import "./chunk-PDO5BLNM.js";
116
120
  import {
117
121
  WorkspaceValidationError,
@@ -131,7 +135,7 @@ import {
131
135
  updateWorkspace,
132
136
  withSlackRetries,
133
137
  workspaceRepoCheckoutPath
134
- } from "./chunk-YHCTPDXS.js";
138
+ } from "./chunk-WX42YNDQ.js";
135
139
  import {
136
140
  decodeStoredConversationEvent,
137
141
  getConversationStore,
@@ -139,20 +143,22 @@ import {
139
143
  getSqlExecutor,
140
144
  locationFromRow,
141
145
  parseSessionSource
142
- } from "./chunk-LPLVNMVN.js";
146
+ } from "./chunk-JDTCQDRU.js";
143
147
  import {
144
148
  juniorConversationEvents,
145
149
  juniorConversations,
146
150
  juniorIdentities,
147
151
  juniorUsers
148
- } from "./chunk-ZSNABC2E.js";
152
+ } from "./chunk-65SNO3WK.js";
149
153
  import "./chunk-BVREIWBD.js";
150
- import "./chunk-BXBZDV3C.js";
151
- import "./chunk-FX4PX3SA.js";
154
+ import "./chunk-EKBVHDZO.js";
155
+ import "./chunk-AEKBVJMV.js";
152
156
  import {
153
157
  juniorDestinations
154
158
  } from "./chunk-VFUK3X5B.js";
155
- import "./chunk-RBV4JHCP.js";
159
+ import "./chunk-KQ5YZGDV.js";
160
+ import "./chunk-VNPG55CU.js";
161
+ import "./chunk-P6UQMGM2.js";
156
162
  import "./chunk-BDUENQD3.js";
157
163
  import {
158
164
  parseSlackChannelId,
@@ -162,10 +168,12 @@ import {
162
168
  import {
163
169
  logException,
164
170
  logWarn
165
- } from "./chunk-VHSEMJTS.js";
171
+ } from "./chunk-JUFZR2LD.js";
166
172
  import "./chunk-6GWA276C.js";
167
- import "./chunk-26JYGL2L.js";
168
- import "./chunk-5GLGQHO3.js";
173
+ import "./chunk-OOUNJNMR.js";
174
+ import "./chunk-H4HBKISO.js";
175
+ import "./chunk-BKP3PVKR.js";
176
+ import "./chunk-YTIKGCPC.js";
169
177
  import "./chunk-MLKGABMK.js";
170
178
 
171
179
  // src/api.ts
@@ -4066,7 +4074,7 @@ async function readPeoplePluginReports(args) {
4066
4074
  source: "plugins"
4067
4075
  });
4068
4076
  }
4069
- const { getPluginProfileReports } = await import("./agent-hooks-WTBPNRTC.js");
4077
+ const { getPluginProfileReports } = await import("./agent-hooks-ZIPK2HUF.js");
4070
4078
  return pluginOperationalReportFeedSchema.parse({
4071
4079
  generatedAt: new Date(nowMs).toISOString(),
4072
4080
  reports: await getPluginProfileReports({
@@ -4620,6 +4628,17 @@ function createTaskRoutes() {
4620
4628
 
4621
4629
  // src/api/workspaces/routes.ts
4622
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
+ }
4623
4642
  function view(workspace) {
4624
4643
  return {
4625
4644
  id: workspace.id,
@@ -4628,9 +4647,15 @@ function view(workspace) {
4628
4647
  repos: workspace.repos.map((repo) => ({
4629
4648
  provider: repo.provider,
4630
4649
  repo: repo.repo,
4631
- checkoutPath: workspaceRepoCheckoutPath(repo.repo),
4632
- isPrimary: repo.isPrimary
4633
- }))
4650
+ checkoutPath: workspaceRepoCheckoutPath(repo.repo)
4651
+ })),
4652
+ snapshot: null
4653
+ };
4654
+ }
4655
+ function detailView(workspace) {
4656
+ return {
4657
+ ...view(workspace),
4658
+ snapshot: snapshotView(workspace)
4634
4659
  };
4635
4660
  }
4636
4661
  function handleValidationError(error) {
@@ -4672,7 +4697,7 @@ function createWorkspaceRoutes() {
4672
4697
  const { id } = context.req.valid("param");
4673
4698
  const workspace = await getWorkspace(getDb(), id);
4674
4699
  if (!workspace) throwApiError(404, "Workspace not found.");
4675
- return jsonResponse(workspaceSchema, view(workspace));
4700
+ return jsonResponse(workspaceSchema, detailView(workspace));
4676
4701
  }
4677
4702
  );
4678
4703
  app.put(
@@ -4746,7 +4771,7 @@ function readDescriptionText(home) {
4746
4771
  }
4747
4772
  }
4748
4773
  async function readSkillReports() {
4749
- const { discoverSkills } = await import("./skills-KYPSHSQR.js");
4774
+ const { discoverSkills } = await import("./skills-BYRH3QWD.js");
4750
4775
  const skills = await discoverSkills();
4751
4776
  return skillReportsSchema.parse(
4752
4777
  skills.map((skill) => ({
@@ -4756,7 +4781,7 @@ async function readSkillReports() {
4756
4781
  );
4757
4782
  }
4758
4783
  async function readPlugins() {
4759
- const { pluginCatalogRuntime } = await import("./catalog-runtime-CZ2SQINY.js");
4784
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-GEZAHBUP.js");
4760
4785
  return pluginsSchema.parse(
4761
4786
  pluginCatalogRuntime.getProviders().map((plugin) => ({
4762
4787
  configKeys: plugin.manifest.configKeys ?? [],
@@ -4769,7 +4794,7 @@ async function readPlugins() {
4769
4794
  async function readRuntimeInfoReport() {
4770
4795
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4771
4796
  import("./discovery-GUFTFBTL.js"),
4772
- import("./catalog-runtime-CZ2SQINY.js"),
4797
+ import("./catalog-runtime-GEZAHBUP.js"),
4773
4798
  readPlugins(),
4774
4799
  readSkillReports()
4775
4800
  ]);
@@ -4785,7 +4810,7 @@ async function readRuntimeInfoReport() {
4785
4810
  }
4786
4811
  async function readPluginOperationalReportFeed() {
4787
4812
  const nowMs = Date.now();
4788
- const { getPluginOperationalReports } = await import("./agent-hooks-WTBPNRTC.js");
4813
+ const { getPluginOperationalReports } = await import("./agent-hooks-ZIPK2HUF.js");
4789
4814
  return pluginOperationalReportFeedSchema.parse({
4790
4815
  source: "plugins",
4791
4816
  generatedAt: new Date(nowMs).toISOString(),
package/dist/app.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  processConversationWork
3
- } from "./chunk-CGCNFEAU.js";
3
+ } from "./chunk-U2UCDSDF.js";
4
4
  import {
5
5
  bindSpawnAgent
6
- } from "./chunk-XAIRI54J.js";
6
+ } from "./chunk-C3USHSIJ.js";
7
7
  import {
8
8
  createAgentInvocationWorker,
9
9
  enqueueAgentInvocation,
10
10
  listPendingAgentInvocationMailboxAppends,
11
11
  routeAgentInvocationWork
12
- } from "./chunk-Y2B6AXZQ.js";
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-3L23VTY7.js";
39
+ } from "./chunk-43KLUCAM.js";
40
40
  import "./chunk-FA6POGLH.js";
41
41
  import {
42
42
  getTurnRequestDeadline,
43
43
  runWithTurnRequestDeadline
44
- } from "./chunk-RYYEHWIL.js";
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-FKDY7NTC.js";
62
- import "./chunk-5FWQ73UZ.js";
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-NAGI2XH3.js";
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-ZUTAGCPH.js";
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-2K25MRZK.js";
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-4GTOFUQF.js";
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-7WKWMMYQ.js";
168
+ } from "./chunk-SLWGX3G5.js";
169
169
  import {
170
170
  AuthorizationFlowDisabledError,
171
171
  PluginCredentialFailureError
172
- } from "./chunk-6BXV63YX.js";
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-H36GJVJV.js";
180
+ } from "./chunk-FFE3BMAT.js";
181
181
  import {
182
182
  RetryableDeliveryError
183
183
  } from "./chunk-RF6J3DIO.js";
@@ -185,7 +185,7 @@ import {
185
185
  formatProviderLabel,
186
186
  postSlackMessage,
187
187
  startOAuthFlow
188
- } from "./chunk-JW23XD4I.js";
188
+ } from "./chunk-OYN45QUQ.js";
189
189
  import "./chunk-7MA4HV4W.js";
190
190
  import {
191
191
  getExperimentalFeatures,
@@ -195,7 +195,7 @@ import {
195
195
  import {
196
196
  getSandboxResourceConfig,
197
197
  setSandboxResourceConfig
198
- } from "./chunk-RJHZNPDH.js";
198
+ } from "./chunk-Q2IPCX7J.js";
199
199
  import {
200
200
  collectAttachmentGarbage,
201
201
  createSchedulerSqlStore,
@@ -203,16 +203,17 @@ import {
203
203
  logScheduledTaskRunSkipped,
204
204
  requestAttachmentDeletion,
205
205
  scheduledTaskRunAttributes
206
- } from "./chunk-6ENAACWN.js";
206
+ } from "./chunk-4MDEQNSW.js";
207
207
  import {
208
208
  parseSlackThreadId
209
- } from "./chunk-WJUKESU2.js";
209
+ } from "./chunk-ABNRESX6.js";
210
210
  import {
211
211
  ConversationTurnBoundaryError,
212
212
  CooperativeTurnYieldError,
213
213
  TurnInputCommitLostError,
214
214
  TurnInputDeferredError,
215
215
  abandonTurnRecord,
216
+ appendThreadContextMessages,
216
217
  buildConversationContext,
217
218
  buildDeterministicAssistantMessageId,
218
219
  buildDeterministicTurnId,
@@ -257,8 +258,9 @@ import {
257
258
  trimTrailingAssistantMessages,
258
259
  turnHasReply,
259
260
  upsertConversationMessage
260
- } from "./chunk-HHW6ZVIZ.js";
261
+ } from "./chunk-22RO7IDD.js";
261
262
  import "./chunk-3Y47VMHV.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-YHCTPDXS.js";
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-LPLVNMVN.js";
304
+ } from "./chunk-JDTCQDRU.js";
303
305
  import {
304
306
  juniorAgentBindings,
305
307
  juniorAgentInvocations,
306
308
  juniorConversationEvents,
307
309
  juniorConversations
308
- } from "./chunk-ZSNABC2E.js";
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-BXBZDV3C.js";
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-FX4PX3SA.js";
336
+ } from "./chunk-AEKBVJMV.js";
335
337
  import {
336
338
  juniorDestinations
337
339
  } from "./chunk-VFUK3X5B.js";
338
- import "./chunk-RBV4JHCP.js";
339
- import "./chunk-NLTQRYNP.js";
340
+ import "./chunk-KQ5YZGDV.js";
341
+ import "./chunk-MDW5YPXW.js";
340
342
  import {
341
343
  pluginCatalogRuntime
342
- } from "./chunk-RULIISEI.js";
343
- import "./chunk-VV2DN24T.js";
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-VHSEMJTS.js";
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-26JYGL2L.js";
385
+ } from "./chunk-BKP3PVKR.js";
384
386
  import {
385
387
  JUNIOR_VERSION
386
- } from "./chunk-5GLGQHO3.js";
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 renderRecentThreadMessages(conversationContext, messages) {
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 void 0;
6166
+ return [];
6165
6167
  }
6166
- const lines = ["<recent-thread-messages>"];
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
- actor?.authorId ? `author_id="${escapeXml(actor.authorId)}"` : void 0,
6171
- actor?.authorName ? `author_name="${escapeXml(actor.authorName)}"` : void 0,
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
- attrs ? ` <message ${attrs}>` : " <message>",
6176
- escapeXml(queued.userText),
6180
+ ` <message ${attrs}>`,
6181
+ `[user] ${author}: ${text}`,
6177
6182
  " </message>"
6178
6183
  );
6179
6184
  }
6180
- lines.push("</recent-thread-messages>");
6181
- return lines.join("\n");
6185
+ return lines;
6182
6186
  }
6183
6187
  function appendRecentThreadMessagesToContext(conversationContext, messages, options) {
6184
- const recentThreadMessages = renderRecentThreadMessages(
6185
- conversationContext,
6186
- messages
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
- attachments,
6441
- {
6442
- threadId,
6443
- actorId: isResourceEventSlackMessage(queued.message) ? void 0 : queued.message.author.userId,
6444
- channelId,
6445
- runId,
6446
- conversation: preparedState.conversation,
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(options.publishExternally),
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-RULIISEI.js";
4
- import "./chunk-VV2DN24T.js";
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-VHSEMJTS.js";
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-26JYGL2L.js";
12
- import "./chunk-5GLGQHO3.js";
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 blocks (`<thread-transcript>`,
38
- * `<recent-thread-messages>`, `<thread-compactions>`, `<thread-background>`) in
39
- * the same message that carries the `<current-instruction>` block. Those blocks
40
- * hold other participants' verbatim messages, so completed-run projections
41
- * consumed by plugins must expose only the instruction authored by this turn's
42
- * actor — otherwise per-entry provenance can be defeated by reading another
43
- * user's text out of an instruction-authority entry. Prior thread context is
44
- * projected separately as per-author context-authority entries, so dropping it
45
- * here is non-lossy for plugins. This is projection-only; it never touches what
46
- * the model sees during a live run.
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. */