@sentry/junior 0.163.0 → 0.165.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 (71) hide show
  1. package/dist/{agent-hooks-6IX5CV7G.js → agent-hooks-GSNL33UA.js} +9 -9
  2. package/dist/api/schema/workspace.d.ts +51 -0
  3. package/dist/api/schema.d.ts +2 -0
  4. package/dist/api/schema.js +15 -3
  5. package/dist/api/workspaces/routes.d.ts +4 -0
  6. package/dist/api.js +171 -27
  7. package/dist/app.js +36 -34
  8. package/dist/{catalog-runtime-NEPZNTOM.js → catalog-runtime-4ERDVI7V.js} +5 -5
  9. package/dist/chat/repository-instructions.d.ts +12 -1
  10. package/dist/chat/sandbox/sandbox.d.ts +1 -1
  11. package/dist/chat/sandbox/snapshot/resolve.d.ts +12 -0
  12. package/dist/chat/sandbox/snapshot/runtime.d.ts +2 -0
  13. package/dist/chat/workspaces/store.d.ts +27 -0
  14. package/dist/chat/workspaces/types.d.ts +0 -1
  15. package/dist/chat/workspaces/validation.d.ts +20 -0
  16. package/dist/{chunk-TPT6EF7K.js → chunk-32CCG4WP.js} +1 -1
  17. package/dist/{chunk-ICJ3KCA2.js → chunk-3V2EIQLT.js} +1 -1
  18. package/dist/{chunk-ZDKTZG3G.js → chunk-5T6WPPEI.js} +1 -1
  19. package/dist/{chunk-ZF6IC27P.js → chunk-5WDDWMQ7.js} +260 -8
  20. package/dist/{chunk-TPDNZCZU.js → chunk-65B3PDY7.js} +1 -1
  21. package/dist/{chunk-2FBPN2Y4.js → chunk-6OWVPXNO.js} +2 -1
  22. package/dist/{chunk-2HBJQEBE.js → chunk-6RZ6MMEK.js} +1 -1
  23. package/dist/{chunk-IIT23D3M.js → chunk-6YXCG2XL.js} +4 -4
  24. package/dist/{chunk-XY2IVIAY.js → chunk-7J26TW64.js} +5 -5
  25. package/dist/{chunk-RK7KPI6G.js → chunk-7S2JVUWS.js} +1 -1
  26. package/dist/{chunk-NL53P7PS.js → chunk-AEBF6AO2.js} +1 -1
  27. package/dist/{chunk-O5ZZL7IR.js → chunk-AQEBOQUC.js} +9 -9
  28. package/dist/{chunk-SA6BEEAB.js → chunk-BEC542E6.js} +111 -74
  29. package/dist/{chunk-THS4CKN4.js → chunk-BEHPIDVZ.js} +5 -4
  30. package/dist/{chunk-BLZUFHM7.js → chunk-DKO4RRGJ.js} +1 -1
  31. package/dist/{chunk-MXFL7LNZ.js → chunk-EA4UL5H2.js} +73 -14
  32. package/dist/{chunk-YAUQXZVT.js → chunk-FMOFCEAA.js} +2 -2
  33. package/dist/{chunk-SR6WRBJW.js → chunk-FNNQCHOL.js} +4 -4
  34. package/dist/{chunk-3OZNFCPR.js → chunk-FXX4NHOM.js} +6 -6
  35. package/dist/{chunk-GCLHNRMU.js → chunk-G72LBEMZ.js} +1 -1
  36. package/dist/{chunk-IX4XI42N.js → chunk-HPWZ4BJJ.js} +72 -120
  37. package/dist/{chunk-FEIHINKR.js → chunk-HZDLOFO4.js} +9 -5
  38. package/dist/{chunk-ATWHPSMF.js → chunk-IZHR2OES.js} +4 -13
  39. package/dist/{chunk-O4IK4O7C.js → chunk-N2BRRIQZ.js} +1 -1
  40. package/dist/{chunk-MWVQ35U6.js → chunk-NPW6LM2X.js} +12 -12
  41. package/dist/{chunk-JI5EPI3O.js → chunk-RQQTOF3H.js} +3 -3
  42. package/dist/{chunk-WPGYWDJR.js → chunk-SA5FVUWJ.js} +6 -6
  43. package/dist/{chunk-KD3ROG6P.js → chunk-T6BAHCT6.js} +17 -17
  44. package/dist/{chunk-4P2XNVTO.js → chunk-TCWPG5VL.js} +2 -2
  45. package/dist/{chunk-EKGJVUVS.js → chunk-VDNNVTX2.js} +5 -5
  46. package/dist/{chunk-RTPJRLOP.js → chunk-XOINKFDJ.js} +7 -7
  47. package/dist/{chunk-3T7RJVDJ.js → chunk-ZUKU2Y3J.js} +1 -1
  48. package/dist/cli/chat.js +29 -29
  49. package/dist/cli/check.js +6 -6
  50. package/dist/cli/plugins.js +12 -12
  51. package/dist/cli/snapshot-create.js +9 -9
  52. package/dist/cli/upgrade.js +7 -7
  53. package/dist/db/schema/workspaces.d.ts +0 -17
  54. package/dist/db/schema.d.ts +0 -17
  55. package/dist/{db-6VBMHVW2.js → db-5TTEPMTY.js} +7 -7
  56. package/dist/instrumentation.js +4 -4
  57. package/dist/nitro.js +2 -2
  58. package/dist/{oauth-callback-server-5NCCUIM2.js → oauth-callback-server-IVFC5YHY.js} +22 -22
  59. package/dist/{runner-6ONEB6TQ.js → runner-G76TSHWO.js} +31 -33
  60. package/dist/{skills-Y5R36UH4.js → skills-F6PSLVSG.js} +6 -6
  61. package/dist/spawn-WMJPIAZL.js +37 -0
  62. package/dist/{validation-HLHEQDEK.js → validation-56EJI6UQ.js} +6 -6
  63. package/dist/version.js +1 -1
  64. package/dist/{work-VIEFYTFG.js → work-RNRQCP3Y.js} +17 -17
  65. package/dist/worker-FBR2WUI4.js +24 -0
  66. package/migrations/0030_drop_workspace_repo_primary.sql +2 -0
  67. package/migrations/meta/0030_snapshot.json +2799 -0
  68. package/migrations/meta/_journal.json +8 -1
  69. package/package.json +6 -5
  70. package/dist/spawn-RFMBQ6B3.js +0 -37
  71. package/dist/worker-MRSKPKQZ.js +0 -24
@@ -13,19 +13,19 @@ import {
13
13
  getPlugins,
14
14
  setPlugins,
15
15
  validatePlugins
16
- } from "./chunk-ZF6IC27P.js";
17
- import "./chunk-JI5EPI3O.js";
18
- import "./chunk-ATWHPSMF.js";
16
+ } from "./chunk-5WDDWMQ7.js";
17
+ import "./chunk-RQQTOF3H.js";
18
+ import "./chunk-IZHR2OES.js";
19
19
  import "./chunk-BVREIWBD.js";
20
- import "./chunk-TPDNZCZU.js";
21
- import "./chunk-YAUQXZVT.js";
20
+ import "./chunk-65B3PDY7.js";
21
+ import "./chunk-FMOFCEAA.js";
22
22
  import "./chunk-VFUK3X5B.js";
23
- import "./chunk-3T7RJVDJ.js";
23
+ import "./chunk-ZUKU2Y3J.js";
24
24
  import "./chunk-V7YE4WCP.js";
25
- import "./chunk-TPT6EF7K.js";
25
+ import "./chunk-32CCG4WP.js";
26
26
  import "./chunk-6GWA276C.js";
27
- import "./chunk-ZDKTZG3G.js";
28
- import "./chunk-2FBPN2Y4.js";
27
+ import "./chunk-5T6WPPEI.js";
28
+ import "./chunk-6OWVPXNO.js";
29
29
  import "./chunk-MLKGABMK.js";
30
30
  export {
31
31
  PluginHookDeniedError,
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+ export declare const workspaceRepoSchema: z.ZodObject<{
3
+ provider: z.ZodString;
4
+ repo: z.ZodString;
5
+ checkoutPath: z.ZodString;
6
+ }, z.core.$strict>;
7
+ export declare const workspaceSchema: z.ZodObject<{
8
+ id: z.ZodString;
9
+ name: z.ZodString;
10
+ setupScript: z.ZodString;
11
+ repos: z.ZodArray<z.ZodObject<{
12
+ provider: z.ZodString;
13
+ repo: z.ZodString;
14
+ checkoutPath: z.ZodString;
15
+ }, z.core.$strict>>;
16
+ snapshot: z.ZodNullable<z.ZodObject<{
17
+ id: z.ZodString;
18
+ generatedAt: z.ZodISODateTime;
19
+ }, z.core.$strict>>;
20
+ }, z.core.$strict>;
21
+ export declare const workspaceListSchema: z.ZodObject<{
22
+ workspaces: z.ZodArray<z.ZodObject<{
23
+ id: z.ZodString;
24
+ name: z.ZodString;
25
+ setupScript: z.ZodString;
26
+ repos: z.ZodArray<z.ZodObject<{
27
+ provider: z.ZodString;
28
+ repo: z.ZodString;
29
+ checkoutPath: z.ZodString;
30
+ }, z.core.$strict>>;
31
+ snapshot: z.ZodNullable<z.ZodObject<{
32
+ id: z.ZodString;
33
+ generatedAt: z.ZodISODateTime;
34
+ }, z.core.$strict>>;
35
+ }, z.core.$strict>>;
36
+ }, z.core.$strict>;
37
+ export declare const workspaceBodySchema: z.ZodObject<{
38
+ name: z.ZodString;
39
+ setupScript: z.ZodOptional<z.ZodString>;
40
+ repos: z.ZodArray<z.ZodObject<{
41
+ provider: z.ZodString;
42
+ repo: z.ZodString;
43
+ }, z.core.$strict>>;
44
+ }, z.core.$strict>;
45
+ export declare const workspaceParamsSchema: z.ZodObject<{
46
+ id: z.ZodString;
47
+ }, z.core.$strict>;
48
+ export declare const deleteWorkspaceResponseSchema: z.ZodObject<{
49
+ deleted: z.ZodLiteral<true>;
50
+ }, z.core.$strict>;
51
+ export type WorkspaceReport = z.infer<typeof workspaceSchema>;
@@ -10,6 +10,8 @@ export { apiErrorSchema } from "./schema/common";
10
10
  export type { ApiError } from "./schema/common";
11
11
  export { createPersonalTokenBodySchema, createdPersonalTokenSchema, personalTokenListSchema, personalTokenMetadataSchema, personalTokenParamsSchema, revokePersonalTokenResponseSchema, } from "./schema/personal-token";
12
12
  export type { PersonalTokenMetadata } from "./schema/personal-token";
13
+ export { deleteWorkspaceResponseSchema, workspaceBodySchema, workspaceListSchema, workspaceParamsSchema, workspaceRepoSchema, workspaceSchema, } from "./schema/workspace";
14
+ export type { WorkspaceReport } from "./schema/workspace";
13
15
  export { eventTaskSummarySchema, scheduledTaskSummarySchema, taskExecutionListSchema, taskExecutionSchema, taskExecutionStatusDaySchema, taskExecutionStatusSchema, taskListSchema, taskParamsSchema, taskRunListSchema, taskRunSchema, taskSummarySchema, } from "./schema/task";
14
16
  export type { TaskExecution, TaskExecutionDay, TaskExecutionList, TaskExecutionStatusDay, TaskList, TaskRun, TaskRunList, TaskSummary, } from "./schema/task";
15
17
  export { statSchema, statsReportSchema } from "./schema/stats";
@@ -29,6 +29,7 @@ import {
29
29
  createPersonalTokenBodySchema,
30
30
  createdPersonalTokenSchema,
31
31
  dailyConversationActivitySchema,
32
+ deleteWorkspaceResponseSchema,
32
33
  eventTaskSummarySchema,
33
34
  locationActivityDayReportSchema,
34
35
  locationDetailReportSchema,
@@ -51,8 +52,13 @@ import {
51
52
  taskParamsSchema,
52
53
  taskRunListSchema,
53
54
  taskRunSchema,
54
- taskSummarySchema
55
- } from "../chunk-SA6BEEAB.js";
55
+ taskSummarySchema,
56
+ workspaceBodySchema,
57
+ workspaceListSchema,
58
+ workspaceParamsSchema,
59
+ workspaceRepoSchema,
60
+ workspaceSchema
61
+ } from "../chunk-BEC542E6.js";
56
62
  import {
57
63
  healthReportSchema,
58
64
  pluginOperationalReportFeedSchema,
@@ -99,6 +105,7 @@ export {
99
105
  createPersonalTokenBodySchema,
100
106
  createdPersonalTokenSchema,
101
107
  dailyConversationActivitySchema,
108
+ deleteWorkspaceResponseSchema,
102
109
  eventTaskSummarySchema,
103
110
  healthReportSchema,
104
111
  locationActivityDayReportSchema,
@@ -131,5 +138,10 @@ export {
131
138
  taskParamsSchema,
132
139
  taskRunListSchema,
133
140
  taskRunSchema,
134
- taskSummarySchema
141
+ taskSummarySchema,
142
+ workspaceBodySchema,
143
+ workspaceListSchema,
144
+ workspaceParamsSchema,
145
+ workspaceRepoSchema,
146
+ workspaceSchema
135
147
  };
@@ -0,0 +1,4 @@
1
+ import { Hono } from "hono";
2
+ import type { JuniorApiEnv } from "../route";
3
+ /** Create authenticated native Workspace list and admin routes. */
4
+ export declare function createWorkspaceRoutes(): Hono<JuniorApiEnv>;
package/dist/api.js CHANGED
@@ -23,6 +23,7 @@ import {
23
23
  createConversationMessageBodySchema,
24
24
  createPersonalTokenBodySchema,
25
25
  createdPersonalTokenSchema,
26
+ deleteWorkspaceResponseSchema,
26
27
  locationDetailReportSchema,
27
28
  locationDirectoryReportSchema,
28
29
  locationParamsSchema,
@@ -35,8 +36,12 @@ import {
35
36
  taskExecutionListSchema,
36
37
  taskListSchema,
37
38
  taskParamsSchema,
38
- taskRunListSchema
39
- } from "./chunk-SA6BEEAB.js";
39
+ taskRunListSchema,
40
+ workspaceBodySchema,
41
+ workspaceListSchema,
42
+ workspaceParamsSchema,
43
+ workspaceSchema
44
+ } from "./chunk-BEC542E6.js";
40
45
  import {
41
46
  appendAndEnqueueApiConversationMessage,
42
47
  authenticatePersonalToken,
@@ -54,15 +59,15 @@ import {
54
59
  revokePersonalToken,
55
60
  viewerConversationMembership,
56
61
  webActorFromEmail
57
- } from "./chunk-MWVQ35U6.js";
62
+ } from "./chunk-NPW6LM2X.js";
58
63
  import {
59
64
  buildSentryConversationUrl,
60
65
  getWebAuthorization
61
- } from "./chunk-NL53P7PS.js";
66
+ } from "./chunk-AEBF6AO2.js";
62
67
  import {
63
68
  cancelHumanFacingPendingMessages,
64
69
  getConversation
65
- } from "./chunk-IIT23D3M.js";
70
+ } from "./chunk-6YXCG2XL.js";
66
71
  import {
67
72
  readTaskExecutionByConversationId,
68
73
  readTaskExecutionDays,
@@ -70,8 +75,8 @@ import {
70
75
  readTaskExecutionSummaries,
71
76
  readTaskExecutions,
72
77
  readTaskRuns
73
- } from "./chunk-O5ZZL7IR.js";
74
- import "./chunk-EKGJVUVS.js";
78
+ } from "./chunk-AQEBOQUC.js";
79
+ import "./chunk-VDNNVTX2.js";
75
80
  import {
76
81
  healthReportSchema,
77
82
  pluginOperationalReportFeedSchema,
@@ -85,6 +90,7 @@ import {
85
90
  import "./chunk-JAL3CH4G.js";
86
91
  import "./chunk-5I6ORJUY.js";
87
92
  import {
93
+ SANDBOX_RUNTIME,
88
94
  createSchedulerSqlStore,
89
95
  deleteEventTask,
90
96
  eventTaskBelongsToUser,
@@ -96,30 +102,41 @@ import {
96
102
  listPublicScheduledTasksForTeams,
97
103
  readLiveAttachment,
98
104
  readStats
99
- } from "./chunk-FEIHINKR.js";
105
+ } from "./chunk-HZDLOFO4.js";
100
106
  import {
101
107
  parseSlackThreadId
102
- } from "./chunk-ICJ3KCA2.js";
108
+ } from "./chunk-3V2EIQLT.js";
103
109
  import {
104
110
  agentTurnUsageSchema,
105
111
  fallbackShortTitle,
106
112
  hasAgentTurnUsage,
107
113
  renderJuniorNativeConversationEvent
108
- } from "./chunk-MXFL7LNZ.js";
114
+ } from "./chunk-EA4UL5H2.js";
109
115
  import "./chunk-3Y47VMHV.js";
116
+ import {
117
+ getCachedSnapshot,
118
+ hash
119
+ } from "./chunk-BEHPIDVZ.js";
110
120
  import "./chunk-PDO5BLNM.js";
111
121
  import {
122
+ WorkspaceValidationError,
112
123
  createPluginLogger,
124
+ createWorkspace,
125
+ deleteWorkspace,
113
126
  findUserByEmail,
114
127
  getPlugins,
115
128
  getSlackClient,
129
+ getWorkspace,
116
130
  listConversationAnnotations,
117
131
  listConversationAnnotationsById,
132
+ listWorkspaces,
118
133
  renderPluginConversationEvent,
119
134
  resolveViewerUser,
120
135
  updateViewerDisplayName,
121
- withSlackRetries
122
- } from "./chunk-ZF6IC27P.js";
136
+ updateWorkspace,
137
+ withSlackRetries,
138
+ workspaceRepoCheckoutPath
139
+ } from "./chunk-5WDDWMQ7.js";
123
140
  import {
124
141
  decodeStoredConversationEvent,
125
142
  getConversationStore,
@@ -127,20 +144,22 @@ import {
127
144
  getSqlExecutor,
128
145
  locationFromRow,
129
146
  parseSessionSource
130
- } from "./chunk-JI5EPI3O.js";
147
+ } from "./chunk-RQQTOF3H.js";
131
148
  import {
132
149
  juniorConversationEvents,
133
150
  juniorConversations,
134
151
  juniorIdentities,
135
152
  juniorUsers
136
- } from "./chunk-ATWHPSMF.js";
153
+ } from "./chunk-IZHR2OES.js";
137
154
  import "./chunk-BVREIWBD.js";
138
- import "./chunk-TPDNZCZU.js";
139
- import "./chunk-YAUQXZVT.js";
155
+ import "./chunk-65B3PDY7.js";
156
+ import "./chunk-FMOFCEAA.js";
140
157
  import {
141
158
  juniorDestinations
142
159
  } from "./chunk-VFUK3X5B.js";
143
- import "./chunk-3T7RJVDJ.js";
160
+ import "./chunk-ZUKU2Y3J.js";
161
+ import "./chunk-7S2JVUWS.js";
162
+ import "./chunk-N2BRRIQZ.js";
144
163
  import "./chunk-BDUENQD3.js";
145
164
  import {
146
165
  parseSlackChannelId,
@@ -150,14 +169,16 @@ import {
150
169
  import {
151
170
  logException,
152
171
  logWarn
153
- } from "./chunk-TPT6EF7K.js";
172
+ } from "./chunk-32CCG4WP.js";
154
173
  import "./chunk-6GWA276C.js";
155
- import "./chunk-ZDKTZG3G.js";
156
- import "./chunk-2FBPN2Y4.js";
174
+ import "./chunk-OOUNJNMR.js";
175
+ import "./chunk-H4HBKISO.js";
176
+ import "./chunk-5T6WPPEI.js";
177
+ import "./chunk-6OWVPXNO.js";
157
178
  import "./chunk-MLKGABMK.js";
158
179
 
159
180
  // src/api.ts
160
- import { Hono as Hono7 } from "hono";
181
+ import { Hono as Hono8 } from "hono";
161
182
  import { HTTPException as HTTPException2 } from "hono/http-exception";
162
183
 
163
184
  // src/api/conversations/routes.ts
@@ -4054,7 +4075,7 @@ async function readPeoplePluginReports(args) {
4054
4075
  source: "plugins"
4055
4076
  });
4056
4077
  }
4057
- const { getPluginProfileReports } = await import("./agent-hooks-6IX5CV7G.js");
4078
+ const { getPluginProfileReports } = await import("./agent-hooks-GSNL33UA.js");
4058
4079
  return pluginOperationalReportFeedSchema.parse({
4059
4080
  generatedAt: new Date(nowMs).toISOString(),
4060
4081
  reports: await getPluginProfileReports({
@@ -4606,6 +4627,128 @@ function createTaskRoutes() {
4606
4627
  return app;
4607
4628
  }
4608
4629
 
4630
+ // src/api/workspaces/routes.ts
4631
+ import { Hono as Hono7 } from "hono";
4632
+ function view(workspace) {
4633
+ return {
4634
+ id: workspace.id,
4635
+ name: workspace.name,
4636
+ setupScript: workspace.setupScript,
4637
+ repos: workspace.repos.map((repo) => ({
4638
+ provider: repo.provider,
4639
+ repo: repo.repo,
4640
+ checkoutPath: workspaceRepoCheckoutPath(repo.repo)
4641
+ })),
4642
+ snapshot: null
4643
+ };
4644
+ }
4645
+ async function detailView(workspace) {
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
+ }
4663
+ return {
4664
+ ...view(workspace),
4665
+ snapshot
4666
+ };
4667
+ }
4668
+ function handleValidationError(error) {
4669
+ if (error instanceof WorkspaceValidationError) {
4670
+ throwApiError(400, error.message);
4671
+ }
4672
+ throw error;
4673
+ }
4674
+ function createWorkspaceRoutes() {
4675
+ const app = new Hono7();
4676
+ app.get("/", requireViewer, async () => {
4677
+ return jsonResponse(workspaceListSchema, {
4678
+ workspaces: (await listWorkspaces(getDb())).map(view)
4679
+ });
4680
+ });
4681
+ app.post(
4682
+ "/",
4683
+ requireViewer,
4684
+ validateRequest("json", workspaceBodySchema, "Invalid request body."),
4685
+ async (context) => {
4686
+ const body = context.req.valid("json");
4687
+ try {
4688
+ const workspace = await createWorkspace(body);
4689
+ return jsonResponse(workspaceSchema, view(workspace), { status: 201 });
4690
+ } catch (error) {
4691
+ handleValidationError(error);
4692
+ }
4693
+ }
4694
+ );
4695
+ app.get(
4696
+ "/:id",
4697
+ requireViewer,
4698
+ validateRequest(
4699
+ "param",
4700
+ workspaceParamsSchema,
4701
+ "Invalid route parameters."
4702
+ ),
4703
+ async (context) => {
4704
+ const { id } = context.req.valid("param");
4705
+ const workspace = await getWorkspace(getDb(), id);
4706
+ if (!workspace) throwApiError(404, "Workspace not found.");
4707
+ return jsonResponse(workspaceSchema, await detailView(workspace));
4708
+ }
4709
+ );
4710
+ app.put(
4711
+ "/:id",
4712
+ requireViewer,
4713
+ validateRequest(
4714
+ "param",
4715
+ workspaceParamsSchema,
4716
+ "Invalid route parameters."
4717
+ ),
4718
+ validateRequest("json", workspaceBodySchema, "Invalid request body."),
4719
+ async (context) => {
4720
+ const { id } = context.req.valid("param");
4721
+ const body = context.req.valid("json");
4722
+ try {
4723
+ const workspace = await updateWorkspace(id, body);
4724
+ if (!workspace) throwApiError(404, "Workspace not found.");
4725
+ return jsonResponse(workspaceSchema, view(workspace));
4726
+ } catch (error) {
4727
+ handleValidationError(error);
4728
+ }
4729
+ }
4730
+ );
4731
+ app.delete(
4732
+ "/:id",
4733
+ requireViewer,
4734
+ validateRequest(
4735
+ "param",
4736
+ workspaceParamsSchema,
4737
+ "Invalid route parameters."
4738
+ ),
4739
+ async (context) => {
4740
+ const { id } = context.req.valid("param");
4741
+ if (!await deleteWorkspace(id)) {
4742
+ throwApiError(404, "Workspace not found.");
4743
+ }
4744
+ return jsonResponse(deleteWorkspaceResponseSchema, {
4745
+ deleted: true
4746
+ });
4747
+ }
4748
+ );
4749
+ return app;
4750
+ }
4751
+
4609
4752
  // src/api/stats.ts
4610
4753
  var WINDOW_DAYS2 = 90;
4611
4754
  async function readStatsReport() {
@@ -4635,7 +4778,7 @@ function readDescriptionText(home) {
4635
4778
  }
4636
4779
  }
4637
4780
  async function readSkillReports() {
4638
- const { discoverSkills } = await import("./skills-Y5R36UH4.js");
4781
+ const { discoverSkills } = await import("./skills-F6PSLVSG.js");
4639
4782
  const skills = await discoverSkills();
4640
4783
  return skillReportsSchema.parse(
4641
4784
  skills.map((skill) => ({
@@ -4645,7 +4788,7 @@ async function readSkillReports() {
4645
4788
  );
4646
4789
  }
4647
4790
  async function readPlugins() {
4648
- const { pluginCatalogRuntime } = await import("./catalog-runtime-NEPZNTOM.js");
4791
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-4ERDVI7V.js");
4649
4792
  return pluginsSchema.parse(
4650
4793
  pluginCatalogRuntime.getProviders().map((plugin) => ({
4651
4794
  configKeys: plugin.manifest.configKeys ?? [],
@@ -4658,7 +4801,7 @@ async function readPlugins() {
4658
4801
  async function readRuntimeInfoReport() {
4659
4802
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4660
4803
  import("./discovery-GUFTFBTL.js"),
4661
- import("./catalog-runtime-NEPZNTOM.js"),
4804
+ import("./catalog-runtime-4ERDVI7V.js"),
4662
4805
  readPlugins(),
4663
4806
  readSkillReports()
4664
4807
  ]);
@@ -4674,7 +4817,7 @@ async function readRuntimeInfoReport() {
4674
4817
  }
4675
4818
  async function readPluginOperationalReportFeed() {
4676
4819
  const nowMs = Date.now();
4677
- const { getPluginOperationalReports } = await import("./agent-hooks-6IX5CV7G.js");
4820
+ const { getPluginOperationalReports } = await import("./agent-hooks-GSNL33UA.js");
4678
4821
  return pluginOperationalReportFeedSchema.parse({
4679
4822
  source: "plugins",
4680
4823
  generatedAt: new Date(nowMs).toISOString(),
@@ -4684,7 +4827,7 @@ async function readPluginOperationalReportFeed() {
4684
4827
 
4685
4828
  // src/api.ts
4686
4829
  function createJuniorApi() {
4687
- const app = new Hono7();
4830
+ const app = new Hono8();
4688
4831
  app.get(
4689
4832
  "/api/health",
4690
4833
  async () => jsonResponse(healthReportSchema, readHealthReport())
@@ -4723,6 +4866,7 @@ function createJuniorApi() {
4723
4866
  app.route("/api/locations", createLocationRoutes());
4724
4867
  app.route("/api/user-pages", createUserPageRoutes());
4725
4868
  app.route("/api/tasks", createTaskRoutes());
4869
+ app.route("/api/workspaces", createWorkspaceRoutes());
4726
4870
  app.notFound(
4727
4871
  () => jsonResponse(
4728
4872
  apiErrorSchema,