@inkeep/agents-core 0.0.0-dev-20260403194639 → 0.0.0-dev-20260404213053

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 (43) hide show
  1. package/dist/auth/auth-schema.d.ts +86 -86
  2. package/dist/auth/auth-validation-schemas.d.ts +154 -154
  3. package/dist/auth/auth.d.ts +6 -6
  4. package/dist/auth/permissions.d.ts +13 -13
  5. package/dist/data-access/index.d.ts +2 -1
  6. package/dist/data-access/index.js +2 -1
  7. package/dist/data-access/manage/agents.d.ts +32 -32
  8. package/dist/data-access/manage/artifactComponents.d.ts +14 -14
  9. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  10. package/dist/data-access/manage/dataComponents.d.ts +4 -4
  11. package/dist/data-access/manage/functionTools.d.ts +10 -10
  12. package/dist/data-access/manage/skills.d.ts +8 -8
  13. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  14. package/dist/data-access/manage/subAgentRelations.d.ts +12 -12
  15. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  16. package/dist/data-access/manage/subAgents.d.ts +12 -12
  17. package/dist/data-access/manage/tools.d.ts +18 -18
  18. package/dist/data-access/manage/triggers.d.ts +2 -2
  19. package/dist/data-access/runtime/apiKeys.d.ts +12 -12
  20. package/dist/data-access/runtime/apps.d.ts +8 -8
  21. package/dist/data-access/runtime/conversations.d.ts +24 -24
  22. package/dist/data-access/runtime/messages.d.ts +24 -24
  23. package/dist/data-access/runtime/streamChunks.d.ts +29 -0
  24. package/dist/data-access/runtime/streamChunks.js +65 -0
  25. package/dist/data-access/runtime/tasks.d.ts +5 -5
  26. package/dist/db/manage/dolt-safe-jsonb.d.ts +2 -2
  27. package/dist/db/manage/manage-schema.d.ts +449 -449
  28. package/dist/db/runtime/runtime-schema.d.ts +508 -376
  29. package/dist/db/runtime/runtime-schema.js +20 -1
  30. package/dist/dolt/ref-helpers.js +15 -1
  31. package/dist/dolt/ref-scope.js +29 -1
  32. package/dist/index.d.ts +3 -2
  33. package/dist/index.js +3 -2
  34. package/dist/utils/error.d.ts +51 -51
  35. package/dist/utils/service-token-auth.d.ts +3 -0
  36. package/dist/utils/service-token-auth.js +5 -2
  37. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  38. package/dist/validation/schemas/skills.d.ts +34 -34
  39. package/dist/validation/schemas.d.ts +2150 -2150
  40. package/drizzle/runtime/0031_fantastic_gorilla_man.sql +13 -0
  41. package/drizzle/runtime/meta/0031_snapshot.json +4872 -0
  42. package/drizzle/runtime/meta/_journal.json +7 -0
  43. package/package.json +1 -1
@@ -3,8 +3,8 @@ import { HTTPException } from "hono/http-exception";
3
3
 
4
4
  //#region src/utils/error.d.ts
5
5
  declare const ErrorCode: z.ZodEnum<{
6
- bad_request: "bad_request";
7
6
  unauthorized: "unauthorized";
7
+ bad_request: "bad_request";
8
8
  payment_required: "payment_required";
9
9
  forbidden: "forbidden";
10
10
  not_found: "not_found";
@@ -21,8 +21,8 @@ declare const problemDetailsSchema: z.ZodObject<{
21
21
  instance: z.ZodOptional<z.ZodString>;
22
22
  requestId: z.ZodOptional<z.ZodString>;
23
23
  code: z.ZodEnum<{
24
- bad_request: "bad_request";
25
24
  unauthorized: "unauthorized";
25
+ bad_request: "bad_request";
26
26
  payment_required: "payment_required";
27
27
  forbidden: "forbidden";
28
28
  not_found: "not_found";
@@ -37,8 +37,8 @@ type ErrorCodes = z.infer<typeof ErrorCode>;
37
37
  declare const errorResponseSchema: z.ZodObject<{
38
38
  error: z.ZodObject<{
39
39
  code: z.ZodEnum<{
40
- bad_request: "bad_request";
41
40
  unauthorized: "unauthorized";
41
+ bad_request: "bad_request";
42
42
  payment_required: "payment_required";
43
43
  forbidden: "forbidden";
44
44
  not_found: "not_found";
@@ -77,12 +77,12 @@ declare const errorSchemaFactory: (code: ErrorCodes, description: string) => {
77
77
  schema: z.ZodObject<{
78
78
  instance: z.ZodOptional<z.ZodString>;
79
79
  requestId: z.ZodOptional<z.ZodString>;
80
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
80
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
81
81
  detail: z.ZodString;
82
82
  title: z.ZodString;
83
83
  status: z.ZodNumber;
84
84
  error: z.ZodObject<{
85
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
85
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
86
86
  message: z.ZodString;
87
87
  }, z.core.$strip>;
88
88
  }, z.core.$strip>;
@@ -99,12 +99,12 @@ declare const commonCreateErrorResponses: {
99
99
  schema: z.ZodObject<{
100
100
  instance: z.ZodOptional<z.ZodString>;
101
101
  requestId: z.ZodOptional<z.ZodString>;
102
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
102
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
103
103
  detail: z.ZodString;
104
104
  title: z.ZodString;
105
105
  status: z.ZodNumber;
106
106
  error: z.ZodObject<{
107
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
107
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
108
108
  message: z.ZodString;
109
109
  }, z.core.$strip>;
110
110
  }, z.core.$strip>;
@@ -118,12 +118,12 @@ declare const commonCreateErrorResponses: {
118
118
  schema: z.ZodObject<{
119
119
  instance: z.ZodOptional<z.ZodString>;
120
120
  requestId: z.ZodOptional<z.ZodString>;
121
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
121
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
122
122
  detail: z.ZodString;
123
123
  title: z.ZodString;
124
124
  status: z.ZodNumber;
125
125
  error: z.ZodObject<{
126
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
126
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
127
127
  message: z.ZodString;
128
128
  }, z.core.$strip>;
129
129
  }, z.core.$strip>;
@@ -137,12 +137,12 @@ declare const commonCreateErrorResponses: {
137
137
  schema: z.ZodObject<{
138
138
  instance: z.ZodOptional<z.ZodString>;
139
139
  requestId: z.ZodOptional<z.ZodString>;
140
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
140
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
141
141
  detail: z.ZodString;
142
142
  title: z.ZodString;
143
143
  status: z.ZodNumber;
144
144
  error: z.ZodObject<{
145
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
145
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
146
146
  message: z.ZodString;
147
147
  }, z.core.$strip>;
148
148
  }, z.core.$strip>;
@@ -156,12 +156,12 @@ declare const commonCreateErrorResponses: {
156
156
  schema: z.ZodObject<{
157
157
  instance: z.ZodOptional<z.ZodString>;
158
158
  requestId: z.ZodOptional<z.ZodString>;
159
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
159
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
160
160
  detail: z.ZodString;
161
161
  title: z.ZodString;
162
162
  status: z.ZodNumber;
163
163
  error: z.ZodObject<{
164
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
164
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
165
165
  message: z.ZodString;
166
166
  }, z.core.$strip>;
167
167
  }, z.core.$strip>;
@@ -175,12 +175,12 @@ declare const commonCreateErrorResponses: {
175
175
  schema: z.ZodObject<{
176
176
  instance: z.ZodOptional<z.ZodString>;
177
177
  requestId: z.ZodOptional<z.ZodString>;
178
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
178
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
179
179
  detail: z.ZodString;
180
180
  title: z.ZodString;
181
181
  status: z.ZodNumber;
182
182
  error: z.ZodObject<{
183
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
183
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
184
184
  message: z.ZodString;
185
185
  }, z.core.$strip>;
186
186
  }, z.core.$strip>;
@@ -196,12 +196,12 @@ declare const commonUpdateErrorResponses: {
196
196
  schema: z.ZodObject<{
197
197
  instance: z.ZodOptional<z.ZodString>;
198
198
  requestId: z.ZodOptional<z.ZodString>;
199
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
199
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
200
200
  detail: z.ZodString;
201
201
  title: z.ZodString;
202
202
  status: z.ZodNumber;
203
203
  error: z.ZodObject<{
204
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
204
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
205
205
  message: z.ZodString;
206
206
  }, z.core.$strip>;
207
207
  }, z.core.$strip>;
@@ -215,12 +215,12 @@ declare const commonUpdateErrorResponses: {
215
215
  schema: z.ZodObject<{
216
216
  instance: z.ZodOptional<z.ZodString>;
217
217
  requestId: z.ZodOptional<z.ZodString>;
218
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
218
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
219
219
  detail: z.ZodString;
220
220
  title: z.ZodString;
221
221
  status: z.ZodNumber;
222
222
  error: z.ZodObject<{
223
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
223
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
224
224
  message: z.ZodString;
225
225
  }, z.core.$strip>;
226
226
  }, z.core.$strip>;
@@ -234,12 +234,12 @@ declare const commonUpdateErrorResponses: {
234
234
  schema: z.ZodObject<{
235
235
  instance: z.ZodOptional<z.ZodString>;
236
236
  requestId: z.ZodOptional<z.ZodString>;
237
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
237
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
238
238
  detail: z.ZodString;
239
239
  title: z.ZodString;
240
240
  status: z.ZodNumber;
241
241
  error: z.ZodObject<{
242
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
242
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
243
243
  message: z.ZodString;
244
244
  }, z.core.$strip>;
245
245
  }, z.core.$strip>;
@@ -253,12 +253,12 @@ declare const commonUpdateErrorResponses: {
253
253
  schema: z.ZodObject<{
254
254
  instance: z.ZodOptional<z.ZodString>;
255
255
  requestId: z.ZodOptional<z.ZodString>;
256
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
256
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
257
257
  detail: z.ZodString;
258
258
  title: z.ZodString;
259
259
  status: z.ZodNumber;
260
260
  error: z.ZodObject<{
261
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
261
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
262
262
  message: z.ZodString;
263
263
  }, z.core.$strip>;
264
264
  }, z.core.$strip>;
@@ -272,12 +272,12 @@ declare const commonUpdateErrorResponses: {
272
272
  schema: z.ZodObject<{
273
273
  instance: z.ZodOptional<z.ZodString>;
274
274
  requestId: z.ZodOptional<z.ZodString>;
275
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
275
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
276
276
  detail: z.ZodString;
277
277
  title: z.ZodString;
278
278
  status: z.ZodNumber;
279
279
  error: z.ZodObject<{
280
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
280
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
281
281
  message: z.ZodString;
282
282
  }, z.core.$strip>;
283
283
  }, z.core.$strip>;
@@ -291,12 +291,12 @@ declare const commonUpdateErrorResponses: {
291
291
  schema: z.ZodObject<{
292
292
  instance: z.ZodOptional<z.ZodString>;
293
293
  requestId: z.ZodOptional<z.ZodString>;
294
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
294
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
295
295
  detail: z.ZodString;
296
296
  title: z.ZodString;
297
297
  status: z.ZodNumber;
298
298
  error: z.ZodObject<{
299
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
299
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
300
300
  message: z.ZodString;
301
301
  }, z.core.$strip>;
302
302
  }, z.core.$strip>;
@@ -312,12 +312,12 @@ declare const commonGetErrorResponses: {
312
312
  schema: z.ZodObject<{
313
313
  instance: z.ZodOptional<z.ZodString>;
314
314
  requestId: z.ZodOptional<z.ZodString>;
315
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
315
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
316
316
  detail: z.ZodString;
317
317
  title: z.ZodString;
318
318
  status: z.ZodNumber;
319
319
  error: z.ZodObject<{
320
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
320
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
321
321
  message: z.ZodString;
322
322
  }, z.core.$strip>;
323
323
  }, z.core.$strip>;
@@ -331,12 +331,12 @@ declare const commonGetErrorResponses: {
331
331
  schema: z.ZodObject<{
332
332
  instance: z.ZodOptional<z.ZodString>;
333
333
  requestId: z.ZodOptional<z.ZodString>;
334
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
334
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
335
335
  detail: z.ZodString;
336
336
  title: z.ZodString;
337
337
  status: z.ZodNumber;
338
338
  error: z.ZodObject<{
339
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
339
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
340
340
  message: z.ZodString;
341
341
  }, z.core.$strip>;
342
342
  }, z.core.$strip>;
@@ -350,12 +350,12 @@ declare const commonGetErrorResponses: {
350
350
  schema: z.ZodObject<{
351
351
  instance: z.ZodOptional<z.ZodString>;
352
352
  requestId: z.ZodOptional<z.ZodString>;
353
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
353
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
354
354
  detail: z.ZodString;
355
355
  title: z.ZodString;
356
356
  status: z.ZodNumber;
357
357
  error: z.ZodObject<{
358
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
358
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
359
359
  message: z.ZodString;
360
360
  }, z.core.$strip>;
361
361
  }, z.core.$strip>;
@@ -369,12 +369,12 @@ declare const commonGetErrorResponses: {
369
369
  schema: z.ZodObject<{
370
370
  instance: z.ZodOptional<z.ZodString>;
371
371
  requestId: z.ZodOptional<z.ZodString>;
372
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
372
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
373
373
  detail: z.ZodString;
374
374
  title: z.ZodString;
375
375
  status: z.ZodNumber;
376
376
  error: z.ZodObject<{
377
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
377
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
378
378
  message: z.ZodString;
379
379
  }, z.core.$strip>;
380
380
  }, z.core.$strip>;
@@ -388,12 +388,12 @@ declare const commonGetErrorResponses: {
388
388
  schema: z.ZodObject<{
389
389
  instance: z.ZodOptional<z.ZodString>;
390
390
  requestId: z.ZodOptional<z.ZodString>;
391
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
391
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
392
392
  detail: z.ZodString;
393
393
  title: z.ZodString;
394
394
  status: z.ZodNumber;
395
395
  error: z.ZodObject<{
396
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
396
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
397
397
  message: z.ZodString;
398
398
  }, z.core.$strip>;
399
399
  }, z.core.$strip>;
@@ -407,12 +407,12 @@ declare const commonGetErrorResponses: {
407
407
  schema: z.ZodObject<{
408
408
  instance: z.ZodOptional<z.ZodString>;
409
409
  requestId: z.ZodOptional<z.ZodString>;
410
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
410
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
411
411
  detail: z.ZodString;
412
412
  title: z.ZodString;
413
413
  status: z.ZodNumber;
414
414
  error: z.ZodObject<{
415
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
415
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
416
416
  message: z.ZodString;
417
417
  }, z.core.$strip>;
418
418
  }, z.core.$strip>;
@@ -428,12 +428,12 @@ declare const commonDeleteErrorResponses: {
428
428
  schema: z.ZodObject<{
429
429
  instance: z.ZodOptional<z.ZodString>;
430
430
  requestId: z.ZodOptional<z.ZodString>;
431
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
431
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
432
432
  detail: z.ZodString;
433
433
  title: z.ZodString;
434
434
  status: z.ZodNumber;
435
435
  error: z.ZodObject<{
436
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
436
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
437
437
  message: z.ZodString;
438
438
  }, z.core.$strip>;
439
439
  }, z.core.$strip>;
@@ -447,12 +447,12 @@ declare const commonDeleteErrorResponses: {
447
447
  schema: z.ZodObject<{
448
448
  instance: z.ZodOptional<z.ZodString>;
449
449
  requestId: z.ZodOptional<z.ZodString>;
450
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
450
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
451
451
  detail: z.ZodString;
452
452
  title: z.ZodString;
453
453
  status: z.ZodNumber;
454
454
  error: z.ZodObject<{
455
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
455
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
456
456
  message: z.ZodString;
457
457
  }, z.core.$strip>;
458
458
  }, z.core.$strip>;
@@ -466,12 +466,12 @@ declare const commonDeleteErrorResponses: {
466
466
  schema: z.ZodObject<{
467
467
  instance: z.ZodOptional<z.ZodString>;
468
468
  requestId: z.ZodOptional<z.ZodString>;
469
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
469
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
470
470
  detail: z.ZodString;
471
471
  title: z.ZodString;
472
472
  status: z.ZodNumber;
473
473
  error: z.ZodObject<{
474
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
474
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
475
475
  message: z.ZodString;
476
476
  }, z.core.$strip>;
477
477
  }, z.core.$strip>;
@@ -485,12 +485,12 @@ declare const commonDeleteErrorResponses: {
485
485
  schema: z.ZodObject<{
486
486
  instance: z.ZodOptional<z.ZodString>;
487
487
  requestId: z.ZodOptional<z.ZodString>;
488
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
488
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
489
489
  detail: z.ZodString;
490
490
  title: z.ZodString;
491
491
  status: z.ZodNumber;
492
492
  error: z.ZodObject<{
493
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
493
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
494
494
  message: z.ZodString;
495
495
  }, z.core.$strip>;
496
496
  }, z.core.$strip>;
@@ -504,12 +504,12 @@ declare const commonDeleteErrorResponses: {
504
504
  schema: z.ZodObject<{
505
505
  instance: z.ZodOptional<z.ZodString>;
506
506
  requestId: z.ZodOptional<z.ZodString>;
507
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
507
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
508
508
  detail: z.ZodString;
509
509
  title: z.ZodString;
510
510
  status: z.ZodNumber;
511
511
  error: z.ZodObject<{
512
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
512
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
513
513
  message: z.ZodString;
514
514
  }, z.core.$strip>;
515
515
  }, z.core.$strip>;
@@ -523,12 +523,12 @@ declare const commonDeleteErrorResponses: {
523
523
  schema: z.ZodObject<{
524
524
  instance: z.ZodOptional<z.ZodString>;
525
525
  requestId: z.ZodOptional<z.ZodString>;
526
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
526
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
527
527
  detail: z.ZodString;
528
528
  title: z.ZodString;
529
529
  status: z.ZodNumber;
530
530
  error: z.ZodObject<{
531
- code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
531
+ code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
532
532
  message: z.ZodString;
533
533
  }, z.core.$strip>;
534
534
  }, z.core.$strip>;
@@ -21,6 +21,8 @@ interface ServiceTokenPayload {
21
21
  type: 'user' | 'api_key';
22
22
  id: string;
23
23
  };
24
+ /** App ID - propagated through delegation chain for app-scoped requests */
25
+ appId?: string;
24
26
  /** Issued at timestamp */
25
27
  iat: number;
26
28
  /** Expiration timestamp (5 minutes from issue) */
@@ -38,6 +40,7 @@ interface GenerateServiceTokenParams {
38
40
  type: 'user' | 'api_key';
39
41
  id: string;
40
42
  };
43
+ appId?: string;
41
44
  }
42
45
  /**
43
46
  * Result of verifying a service token
@@ -18,7 +18,8 @@ async function generateServiceToken(params) {
18
18
  claims: {
19
19
  tenantId: params.tenantId,
20
20
  projectId: params.projectId,
21
- ...params.initiatedBy ? { initiatedBy: params.initiatedBy } : {}
21
+ ...params.initiatedBy ? { initiatedBy: params.initiatedBy } : {},
22
+ ...params.appId ? { appId: params.appId } : {}
22
23
  }
23
24
  });
24
25
  logger.debug({
@@ -52,7 +53,8 @@ async function verifyServiceToken(token) {
52
53
  error: "Invalid token: missing required claims"
53
54
  };
54
55
  }
55
- const initiatedBy = payload.initiatedBy;
56
+ const initiatedBy = payload.initiatedBy && typeof payload.initiatedBy === "object" && "type" in payload.initiatedBy && "id" in payload.initiatedBy && (payload.initiatedBy.type === "user" || payload.initiatedBy.type === "api_key") && typeof payload.initiatedBy.id === "string" ? payload.initiatedBy : void 0;
57
+ const appId = typeof payload.appId === "string" ? payload.appId : void 0;
56
58
  const validPayload = {
57
59
  iss: payload.iss,
58
60
  aud: payload.aud,
@@ -60,6 +62,7 @@ async function verifyServiceToken(token) {
60
62
  tenantId: payload.tenantId,
61
63
  projectId: payload.projectId,
62
64
  ...initiatedBy ? { initiatedBy } : {},
65
+ ...appId ? { appId } : {},
63
66
  iat: payload.iat,
64
67
  exp: payload.exp
65
68
  };
@@ -1,10 +1,10 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import * as drizzle_zod0 from "drizzle-zod";
2
+ import * as drizzle_zod363 from "drizzle-zod";
3
3
  import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
4
4
 
5
5
  //#region src/validation/drizzle-schema-helpers.d.ts
6
- declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod0.BuildSchema<"select", T["_"]["columns"], drizzle_zod0.BuildRefine<T["_"]["columns"], undefined>, undefined>;
7
- declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod0.BuildSchema<"insert", T["_"]["columns"], drizzle_zod0.BuildRefine<Pick<T["_"]["columns"], keyof T["$inferInsert"]>, undefined>, undefined>;
6
+ declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod363.BuildSchema<"select", T["_"]["columns"], drizzle_zod363.BuildRefine<T["_"]["columns"], undefined>, undefined>;
7
+ declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod363.BuildSchema<"insert", T["_"]["columns"], drizzle_zod363.BuildRefine<Pick<T["_"]["columns"], keyof T["$inferInsert"]>, undefined>, undefined>;
8
8
  declare const createSelectSchema: typeof createSelectSchemaWithModifiers;
9
9
  declare const createInsertSchema: typeof createInsertSchemaWithModifiers;
10
10
  /**