@databricks/appkit 0.83.0 → 0.84.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 (210) hide show
  1. package/CLAUDE.md +15 -1
  2. package/dist/agents/databricks.d.ts +15 -3
  3. package/dist/agents/databricks.d.ts.map +1 -1
  4. package/dist/agents/databricks.js +25 -8
  5. package/dist/agents/databricks.js.map +1 -1
  6. package/dist/appkit/package.js +1 -1
  7. package/dist/beta.d.ts +2 -2
  8. package/dist/cache/index.d.ts.map +1 -1
  9. package/dist/cache/index.js +6 -1
  10. package/dist/cache/index.js.map +1 -1
  11. package/dist/cli/commands/agent/eval.js +1 -1
  12. package/dist/cli/commands/generate-types.js +1 -1
  13. package/dist/cli/commands/plugin/sync/sync.js +28 -15
  14. package/dist/cli/commands/plugin/sync/sync.js.map +1 -1
  15. package/dist/cli/commands/registry/add.js +3 -11
  16. package/dist/cli/commands/registry/add.js.map +1 -1
  17. package/dist/cli/commands/registry/config-writer.js +1 -1
  18. package/dist/connectors/lakebase/routing-pool.d.ts.map +1 -1
  19. package/dist/connectors/lakebase/routing-pool.js +4 -10
  20. package/dist/connectors/lakebase/routing-pool.js.map +1 -1
  21. package/dist/context/caller-context.d.ts +4 -1
  22. package/dist/context/caller-context.d.ts.map +1 -1
  23. package/dist/context/caller-context.js.map +1 -1
  24. package/dist/context/execution-context.d.ts +29 -1
  25. package/dist/context/execution-context.d.ts.map +1 -1
  26. package/dist/context/execution-context.js +60 -8
  27. package/dist/context/execution-context.js.map +1 -1
  28. package/dist/context/index.d.ts +2 -2
  29. package/dist/context/index.js +2 -1
  30. package/dist/context/request-scope.d.ts +2 -0
  31. package/dist/context/request-scope.js +39 -0
  32. package/dist/context/request-scope.js.map +1 -0
  33. package/dist/context/resource-capabilities.js +59 -0
  34. package/dist/context/resource-capabilities.js.map +1 -0
  35. package/dist/context/scoped-api.js +104 -0
  36. package/dist/context/scoped-api.js.map +1 -0
  37. package/dist/context/service-context.d.ts.map +1 -1
  38. package/dist/context/service-context.js +1 -1
  39. package/dist/context/service-context.js.map +1 -1
  40. package/dist/context/user-context.d.ts +16 -19
  41. package/dist/context/user-context.d.ts.map +1 -1
  42. package/dist/context/user-context.js +30 -3
  43. package/dist/context/user-context.js.map +1 -1
  44. package/dist/core/agent/load-agents.d.ts.map +1 -1
  45. package/dist/core/agent/load-agents.js +5 -2
  46. package/dist/core/agent/load-agents.js.map +1 -1
  47. package/dist/core/agent/run-agent.d.ts +19 -6
  48. package/dist/core/agent/run-agent.d.ts.map +1 -1
  49. package/dist/core/agent/run-agent.js +53 -17
  50. package/dist/core/agent/run-agent.js.map +1 -1
  51. package/dist/core/agent/types.d.ts +18 -1
  52. package/dist/core/agent/types.d.ts.map +1 -1
  53. package/dist/core/agent/types.js.map +1 -1
  54. package/dist/core/appkit.d.ts +4 -3
  55. package/dist/core/appkit.d.ts.map +1 -1
  56. package/dist/core/appkit.js +30 -9
  57. package/dist/core/appkit.js.map +1 -1
  58. package/dist/core/plugin-context.d.ts +14 -15
  59. package/dist/core/plugin-context.d.ts.map +1 -1
  60. package/dist/core/plugin-context.js +24 -14
  61. package/dist/core/plugin-context.js.map +1 -1
  62. package/dist/errors/base.d.ts +2 -2
  63. package/dist/errors/base.js +2 -2
  64. package/dist/errors/base.js.map +1 -1
  65. package/dist/errors/identity-expired.d.ts +14 -0
  66. package/dist/errors/identity-expired.d.ts.map +1 -0
  67. package/dist/errors/identity-expired.js +33 -0
  68. package/dist/errors/identity-expired.js.map +1 -0
  69. package/dist/errors/index.js +1 -0
  70. package/dist/index.d.ts +8 -5
  71. package/dist/index.js +5 -2
  72. package/dist/logging/logger.js +1 -1
  73. package/dist/plugin/execution-result.d.ts +4 -1
  74. package/dist/plugin/execution-result.d.ts.map +1 -1
  75. package/dist/plugin/interceptors/telemetry.js +6 -4
  76. package/dist/plugin/interceptors/telemetry.js.map +1 -1
  77. package/dist/plugin/plugin.d.ts +13 -21
  78. package/dist/plugin/plugin.d.ts.map +1 -1
  79. package/dist/plugin/plugin.js +41 -122
  80. package/dist/plugin/plugin.js.map +1 -1
  81. package/dist/plugins/agents/agents.d.ts +12 -0
  82. package/dist/plugins/agents/agents.d.ts.map +1 -1
  83. package/dist/plugins/agents/agents.js +65 -15
  84. package/dist/plugins/agents/agents.js.map +1 -1
  85. package/dist/plugins/agents/auth-mode.js +42 -0
  86. package/dist/plugins/agents/auth-mode.js.map +1 -0
  87. package/dist/plugins/agents/index.d.ts +1 -1
  88. package/dist/plugins/agents/mlflow.js +11 -3
  89. package/dist/plugins/agents/mlflow.js.map +1 -1
  90. package/dist/plugins/agents/tool-dispatch.js +9 -1
  91. package/dist/plugins/agents/tool-dispatch.js.map +1 -1
  92. package/dist/plugins/ai-search/ai-search.d.ts.map +1 -1
  93. package/dist/plugins/ai-search/ai-search.js +4 -4
  94. package/dist/plugins/ai-search/ai-search.js.map +1 -1
  95. package/dist/plugins/analytics/analytics.d.ts +2 -2
  96. package/dist/plugins/analytics/analytics.js +6 -6
  97. package/dist/plugins/analytics/analytics.js.map +1 -1
  98. package/dist/plugins/database/crud/contract.js +2 -2
  99. package/dist/plugins/database/crud/contract.js.map +1 -1
  100. package/dist/plugins/files/plugin.d.ts +10 -4
  101. package/dist/plugins/files/plugin.d.ts.map +1 -1
  102. package/dist/plugins/files/plugin.js +34 -13
  103. package/dist/plugins/files/plugin.js.map +1 -1
  104. package/dist/plugins/genie/genie.d.ts +9 -0
  105. package/dist/plugins/genie/genie.d.ts.map +1 -1
  106. package/dist/plugins/genie/genie.js +12 -3
  107. package/dist/plugins/genie/genie.js.map +1 -1
  108. package/dist/plugins/genie/manifest.js +1 -0
  109. package/dist/plugins/jobs/plugin.js +2 -2
  110. package/dist/plugins/jobs/plugin.js.map +1 -1
  111. package/dist/plugins/lakebase/lakebase.d.ts +10 -17
  112. package/dist/plugins/lakebase/lakebase.d.ts.map +1 -1
  113. package/dist/plugins/lakebase/lakebase.js +12 -17
  114. package/dist/plugins/lakebase/lakebase.js.map +1 -1
  115. package/dist/plugins/server/client-config-sanitizer.js +1 -4
  116. package/dist/plugins/server/client-config-sanitizer.js.map +1 -1
  117. package/dist/plugins/server/dev-obo-middleware.js +60 -0
  118. package/dist/plugins/server/dev-obo-middleware.js.map +1 -0
  119. package/dist/plugins/server/index.d.ts.map +1 -1
  120. package/dist/plugins/server/index.js +5 -2
  121. package/dist/plugins/server/index.js.map +1 -1
  122. package/dist/plugins/server/remote-tunnel/remote-tunnel-manager.js +3 -3
  123. package/dist/plugins/server/remote-tunnel/remote-tunnel-manager.js.map +1 -1
  124. package/dist/plugins/server/static-server.js +3 -3
  125. package/dist/plugins/server/static-server.js.map +1 -1
  126. package/dist/plugins/server/utils.js +3 -3
  127. package/dist/plugins/server/utils.js.map +1 -1
  128. package/dist/plugins/server/vite-dev-server.js +4 -4
  129. package/dist/plugins/server/vite-dev-server.js.map +1 -1
  130. package/dist/plugins/serving/manifest.js +1 -0
  131. package/dist/plugins/serving/serving.js +6 -6
  132. package/dist/plugins/serving/serving.js.map +1 -1
  133. package/dist/schemas/manifest.d.ts +35 -1
  134. package/dist/schemas/manifest.d.ts.map +1 -1
  135. package/dist/schemas/manifest.js +112 -4
  136. package/dist/schemas/manifest.js.map +1 -1
  137. package/dist/shared/src/dev-obo.js +86 -0
  138. package/dist/shared/src/dev-obo.js.map +1 -0
  139. package/dist/shared/src/index.d.ts +1 -1
  140. package/dist/shared/src/plugin.d.ts +12 -1
  141. package/dist/shared/src/plugin.d.ts.map +1 -1
  142. package/dist/shared/src/schemas/manifest.d.ts +41 -33
  143. package/dist/shared/src/schemas/manifest.d.ts.map +1 -1
  144. package/dist/shared/src/schemas/manifest.js +43 -4
  145. package/dist/shared/src/schemas/manifest.js.map +1 -1
  146. package/dist/stream/stream-manager.d.ts.map +1 -1
  147. package/dist/stream/stream-manager.js +5 -2
  148. package/dist/stream/stream-manager.js.map +1 -1
  149. package/dist/telemetry/execution-span-processor.js +21 -0
  150. package/dist/telemetry/execution-span-processor.js.map +1 -0
  151. package/dist/telemetry/telemetry-manager.js +2 -1
  152. package/dist/telemetry/telemetry-manager.js.map +1 -1
  153. package/dist/testing/create-test-app.d.ts +2 -2
  154. package/dist/testing/create-test-app.js.map +1 -1
  155. package/dist/testing/test-plugin-context.d.ts +3 -12
  156. package/dist/testing/test-plugin-context.d.ts.map +1 -1
  157. package/dist/testing/test-plugin-context.js +24 -16
  158. package/dist/testing/test-plugin-context.js.map +1 -1
  159. package/dist/type-generator/database/generate.js +3 -3
  160. package/dist/type-generator/database/generate.js.map +1 -1
  161. package/dist/type-generator/migration.js +2 -2
  162. package/dist/type-generator/migration.js.map +1 -1
  163. package/dist/type-generator/serving/server-file-extractor.js +3 -3
  164. package/dist/type-generator/serving/server-file-extractor.js.map +1 -1
  165. package/dist/utils/is-plain-object.js +11 -0
  166. package/dist/utils/is-plain-object.js.map +1 -0
  167. package/docs/api/appkit/Class.AppKitError.md +2 -1
  168. package/docs/api/appkit/Class.AuthenticationError.md +1 -1
  169. package/docs/api/appkit/Class.ConfigurationError.md +1 -1
  170. package/docs/api/appkit/Class.ConnectionError.md +1 -1
  171. package/docs/api/appkit/Class.DatabaseValidationError.md +1 -1
  172. package/docs/api/appkit/Class.ExecutionError.md +1 -1
  173. package/docs/api/appkit/Class.IdentityExpiredError.md +190 -0
  174. package/docs/api/appkit/Class.InitializationError.md +1 -1
  175. package/docs/api/appkit/Class.Plugin.md +8 -12
  176. package/docs/api/appkit/Class.ServerError.md +1 -1
  177. package/docs/api/appkit/Class.ServiceContext.md +169 -0
  178. package/docs/api/appkit/Class.TunnelError.md +1 -1
  179. package/docs/api/appkit/Class.ValidationError.md +1 -1
  180. package/docs/api/appkit/Function.createApp.md +12 -12
  181. package/docs/api/appkit/Function.getCallerContext.md +12 -0
  182. package/docs/api/appkit/Function.getCurrentUserId.md +14 -0
  183. package/docs/api/appkit/Function.getExecutionContext.md +1 -1
  184. package/docs/api/appkit/Function.getUserContext.md +16 -0
  185. package/docs/api/appkit/Function.isInUserContext.md +12 -0
  186. package/docs/api/appkit/Function.isUserContext.md +20 -0
  187. package/docs/api/appkit/Function.runAgent.md +1 -1
  188. package/docs/api/appkit/Function.runInCallerContext.md +27 -0
  189. package/docs/api/appkit/Function.runInUserContext.md +29 -0
  190. package/docs/api/appkit/Interface.AgentDefinition.md +11 -0
  191. package/docs/api/appkit/Interface.AgentsPluginConfig.md +11 -0
  192. package/docs/api/appkit/Interface.CallerContext.md +13 -0
  193. package/docs/api/appkit/Interface.IndexConfig.md +1 -1
  194. package/docs/api/appkit/Interface.PluginManifest.md +9 -1
  195. package/docs/api/appkit/Interface.RegisteredAgent.md +11 -0
  196. package/docs/api/appkit/Interface.RunAgentInput.md +45 -1
  197. package/docs/api/appkit/TypeAlias.AgentAuth.md +8 -0
  198. package/docs/api/appkit/TypeAlias.AppKitApi.md +35 -0
  199. package/docs/api/appkit/TypeAlias.ExecutionContext.md +4 -1
  200. package/docs/api/appkit/TypeAlias.ExecutionResult.md +65 -0
  201. package/docs/api/appkit/TypeAlias.ScopedPluginMap.md +12 -0
  202. package/docs/api/appkit/TypeAlias.UserContext.md +109 -0
  203. package/docs/api/appkit/TypeAlias.UserScopedApp.md +39 -0
  204. package/docs/api/appkit.md +14 -0
  205. package/docs/plugins/agents.md +45 -0
  206. package/docs/plugins/execution-context.md +101 -50
  207. package/docs/plugins/lakebase.md +6 -82
  208. package/llms.txt +15 -1
  209. package/package.json +1 -1
  210. package/sbom.cdx.json +1 -1
@@ -13,8 +13,8 @@ declare const resourceFieldEntrySchema: z.ZodObject<{
13
13
  type: z.ZodLiteral<"kind">;
14
14
  resourceKind: z.ZodEnum<{
15
15
  volume: "volume";
16
- genie_space: "genie_space";
17
16
  warehouse: "warehouse";
17
+ genie_space: "genie_space";
18
18
  postgres_project: "postgres_project";
19
19
  postgres_branch: "postgres_branch";
20
20
  postgres_database: "postgres_database";
@@ -34,6 +34,14 @@ declare const resourceFieldEntrySchema: z.ZodObject<{
34
34
  }, z.core.$strict>;
35
35
  declare const pluginManifestSchema: z.ZodObject<{
36
36
  scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
37
+ sql: "sql";
38
+ "sql:restricted-query": "sql:restricted-query";
39
+ genie: "genie";
40
+ postgres: "postgres";
41
+ "model-serving": "model-serving";
42
+ files: "files";
43
+ "vector-search": "vector-search";
44
+ "catalog.connections": "catalog.connections";
37
45
  "ai-gateway": "ai-gateway";
38
46
  "mcp.external": "mcp.external";
39
47
  "mcp.functions": "mcp.functions";
@@ -68,8 +76,8 @@ declare const pluginManifestSchema: z.ZodObject<{
68
76
  type: z.ZodLiteral<"kind">;
69
77
  resourceKind: z.ZodEnum<{
70
78
  volume: "volume";
71
- genie_space: "genie_space";
72
79
  warehouse: "warehouse";
80
+ genie_space: "genie_space";
73
81
  postgres_project: "postgres_project";
74
82
  postgres_branch: "postgres_branch";
75
83
  postgres_database: "postgres_database";
@@ -109,8 +117,8 @@ declare const pluginManifestSchema: z.ZodObject<{
109
117
  type: z.ZodLiteral<"kind">;
110
118
  resourceKind: z.ZodEnum<{
111
119
  volume: "volume";
112
- genie_space: "genie_space";
113
120
  warehouse: "warehouse";
121
+ genie_space: "genie_space";
114
122
  postgres_project: "postgres_project";
115
123
  postgres_branch: "postgres_branch";
116
124
  postgres_database: "postgres_database";
@@ -149,8 +157,8 @@ declare const pluginManifestSchema: z.ZodObject<{
149
157
  type: z.ZodLiteral<"kind">;
150
158
  resourceKind: z.ZodEnum<{
151
159
  volume: "volume";
152
- genie_space: "genie_space";
153
160
  warehouse: "warehouse";
161
+ genie_space: "genie_space";
154
162
  postgres_project: "postgres_project";
155
163
  postgres_branch: "postgres_branch";
156
164
  postgres_database: "postgres_database";
@@ -171,9 +179,9 @@ declare const pluginManifestSchema: z.ZodObject<{
171
179
  type: z.ZodLiteral<"sql_warehouse">;
172
180
  }, z.core.$strict>, z.ZodObject<{
173
181
  permission: z.ZodEnum<{
182
+ CAN_QUERY: "CAN_QUERY";
174
183
  CAN_VIEW: "CAN_VIEW";
175
184
  CAN_MANAGE: "CAN_MANAGE";
176
- CAN_QUERY: "CAN_QUERY";
177
185
  }>;
178
186
  alias: z.ZodString;
179
187
  resourceKey: z.ZodString;
@@ -190,8 +198,8 @@ declare const pluginManifestSchema: z.ZodObject<{
190
198
  type: z.ZodLiteral<"kind">;
191
199
  resourceKind: z.ZodEnum<{
192
200
  volume: "volume";
193
- genie_space: "genie_space";
194
201
  warehouse: "warehouse";
202
+ genie_space: "genie_space";
195
203
  postgres_project: "postgres_project";
196
204
  postgres_branch: "postgres_branch";
197
205
  postgres_database: "postgres_database";
@@ -230,8 +238,8 @@ declare const pluginManifestSchema: z.ZodObject<{
230
238
  type: z.ZodLiteral<"kind">;
231
239
  resourceKind: z.ZodEnum<{
232
240
  volume: "volume";
233
- genie_space: "genie_space";
234
241
  warehouse: "warehouse";
242
+ genie_space: "genie_space";
235
243
  postgres_project: "postgres_project";
236
244
  postgres_branch: "postgres_branch";
237
245
  postgres_database: "postgres_database";
@@ -269,8 +277,8 @@ declare const pluginManifestSchema: z.ZodObject<{
269
277
  type: z.ZodLiteral<"kind">;
270
278
  resourceKind: z.ZodEnum<{
271
279
  volume: "volume";
272
- genie_space: "genie_space";
273
280
  warehouse: "warehouse";
281
+ genie_space: "genie_space";
274
282
  postgres_project: "postgres_project";
275
283
  postgres_branch: "postgres_branch";
276
284
  postgres_database: "postgres_database";
@@ -308,8 +316,8 @@ declare const pluginManifestSchema: z.ZodObject<{
308
316
  type: z.ZodLiteral<"kind">;
309
317
  resourceKind: z.ZodEnum<{
310
318
  volume: "volume";
311
- genie_space: "genie_space";
312
319
  warehouse: "warehouse";
320
+ genie_space: "genie_space";
313
321
  postgres_project: "postgres_project";
314
322
  postgres_branch: "postgres_branch";
315
323
  postgres_database: "postgres_database";
@@ -347,8 +355,8 @@ declare const pluginManifestSchema: z.ZodObject<{
347
355
  type: z.ZodLiteral<"kind">;
348
356
  resourceKind: z.ZodEnum<{
349
357
  volume: "volume";
350
- genie_space: "genie_space";
351
358
  warehouse: "warehouse";
359
+ genie_space: "genie_space";
352
360
  postgres_project: "postgres_project";
353
361
  postgres_branch: "postgres_branch";
354
362
  postgres_database: "postgres_database";
@@ -386,8 +394,8 @@ declare const pluginManifestSchema: z.ZodObject<{
386
394
  type: z.ZodLiteral<"kind">;
387
395
  resourceKind: z.ZodEnum<{
388
396
  volume: "volume";
389
- genie_space: "genie_space";
390
397
  warehouse: "warehouse";
398
+ genie_space: "genie_space";
391
399
  postgres_project: "postgres_project";
392
400
  postgres_branch: "postgres_branch";
393
401
  postgres_database: "postgres_database";
@@ -425,8 +433,8 @@ declare const pluginManifestSchema: z.ZodObject<{
425
433
  type: z.ZodLiteral<"kind">;
426
434
  resourceKind: z.ZodEnum<{
427
435
  volume: "volume";
428
- genie_space: "genie_space";
429
436
  warehouse: "warehouse";
437
+ genie_space: "genie_space";
430
438
  postgres_project: "postgres_project";
431
439
  postgres_branch: "postgres_branch";
432
440
  postgres_database: "postgres_database";
@@ -447,10 +455,10 @@ declare const pluginManifestSchema: z.ZodObject<{
447
455
  type: z.ZodLiteral<"postgres">;
448
456
  }, z.core.$strict>, z.ZodObject<{
449
457
  permission: z.ZodEnum<{
458
+ CAN_EDIT: "CAN_EDIT";
450
459
  CAN_VIEW: "CAN_VIEW";
451
460
  CAN_MANAGE: "CAN_MANAGE";
452
461
  CAN_RUN: "CAN_RUN";
453
- CAN_EDIT: "CAN_EDIT";
454
462
  }>;
455
463
  alias: z.ZodString;
456
464
  resourceKey: z.ZodString;
@@ -467,8 +475,8 @@ declare const pluginManifestSchema: z.ZodObject<{
467
475
  type: z.ZodLiteral<"kind">;
468
476
  resourceKind: z.ZodEnum<{
469
477
  volume: "volume";
470
- genie_space: "genie_space";
471
478
  warehouse: "warehouse";
479
+ genie_space: "genie_space";
472
480
  postgres_project: "postgres_project";
473
481
  postgres_branch: "postgres_branch";
474
482
  postgres_database: "postgres_database";
@@ -489,8 +497,8 @@ declare const pluginManifestSchema: z.ZodObject<{
489
497
  type: z.ZodLiteral<"genie_space">;
490
498
  }, z.core.$strict>, z.ZodObject<{
491
499
  permission: z.ZodEnum<{
492
- CAN_MANAGE: "CAN_MANAGE";
493
500
  CAN_EDIT: "CAN_EDIT";
501
+ CAN_MANAGE: "CAN_MANAGE";
494
502
  CAN_READ: "CAN_READ";
495
503
  }>;
496
504
  alias: z.ZodString;
@@ -508,8 +516,8 @@ declare const pluginManifestSchema: z.ZodObject<{
508
516
  type: z.ZodLiteral<"kind">;
509
517
  resourceKind: z.ZodEnum<{
510
518
  volume: "volume";
511
- genie_space: "genie_space";
512
519
  warehouse: "warehouse";
520
+ genie_space: "genie_space";
513
521
  postgres_project: "postgres_project";
514
522
  postgres_branch: "postgres_branch";
515
523
  postgres_database: "postgres_database";
@@ -547,8 +555,8 @@ declare const pluginManifestSchema: z.ZodObject<{
547
555
  type: z.ZodLiteral<"kind">;
548
556
  resourceKind: z.ZodEnum<{
549
557
  volume: "volume";
550
- genie_space: "genie_space";
551
558
  warehouse: "warehouse";
559
+ genie_space: "genie_space";
552
560
  postgres_project: "postgres_project";
553
561
  postgres_branch: "postgres_branch";
554
562
  postgres_database: "postgres_database";
@@ -589,8 +597,8 @@ declare const pluginManifestSchema: z.ZodObject<{
589
597
  type: z.ZodLiteral<"kind">;
590
598
  resourceKind: z.ZodEnum<{
591
599
  volume: "volume";
592
- genie_space: "genie_space";
593
600
  warehouse: "warehouse";
601
+ genie_space: "genie_space";
594
602
  postgres_project: "postgres_project";
595
603
  postgres_branch: "postgres_branch";
596
604
  postgres_database: "postgres_database";
@@ -630,8 +638,8 @@ declare const pluginManifestSchema: z.ZodObject<{
630
638
  type: z.ZodLiteral<"kind">;
631
639
  resourceKind: z.ZodEnum<{
632
640
  volume: "volume";
633
- genie_space: "genie_space";
634
641
  warehouse: "warehouse";
642
+ genie_space: "genie_space";
635
643
  postgres_project: "postgres_project";
636
644
  postgres_branch: "postgres_branch";
637
645
  postgres_database: "postgres_database";
@@ -670,8 +678,8 @@ declare const pluginManifestSchema: z.ZodObject<{
670
678
  type: z.ZodLiteral<"kind">;
671
679
  resourceKind: z.ZodEnum<{
672
680
  volume: "volume";
673
- genie_space: "genie_space";
674
681
  warehouse: "warehouse";
682
+ genie_space: "genie_space";
675
683
  postgres_project: "postgres_project";
676
684
  postgres_branch: "postgres_branch";
677
685
  postgres_database: "postgres_database";
@@ -692,9 +700,9 @@ declare const pluginManifestSchema: z.ZodObject<{
692
700
  type: z.ZodLiteral<"sql_warehouse">;
693
701
  }, z.core.$strict>, z.ZodObject<{
694
702
  permission: z.ZodEnum<{
703
+ CAN_QUERY: "CAN_QUERY";
695
704
  CAN_VIEW: "CAN_VIEW";
696
705
  CAN_MANAGE: "CAN_MANAGE";
697
- CAN_QUERY: "CAN_QUERY";
698
706
  }>;
699
707
  alias: z.ZodString;
700
708
  resourceKey: z.ZodString;
@@ -711,8 +719,8 @@ declare const pluginManifestSchema: z.ZodObject<{
711
719
  type: z.ZodLiteral<"kind">;
712
720
  resourceKind: z.ZodEnum<{
713
721
  volume: "volume";
714
- genie_space: "genie_space";
715
722
  warehouse: "warehouse";
723
+ genie_space: "genie_space";
716
724
  postgres_project: "postgres_project";
717
725
  postgres_branch: "postgres_branch";
718
726
  postgres_database: "postgres_database";
@@ -751,8 +759,8 @@ declare const pluginManifestSchema: z.ZodObject<{
751
759
  type: z.ZodLiteral<"kind">;
752
760
  resourceKind: z.ZodEnum<{
753
761
  volume: "volume";
754
- genie_space: "genie_space";
755
762
  warehouse: "warehouse";
763
+ genie_space: "genie_space";
756
764
  postgres_project: "postgres_project";
757
765
  postgres_branch: "postgres_branch";
758
766
  postgres_database: "postgres_database";
@@ -790,8 +798,8 @@ declare const pluginManifestSchema: z.ZodObject<{
790
798
  type: z.ZodLiteral<"kind">;
791
799
  resourceKind: z.ZodEnum<{
792
800
  volume: "volume";
793
- genie_space: "genie_space";
794
801
  warehouse: "warehouse";
802
+ genie_space: "genie_space";
795
803
  postgres_project: "postgres_project";
796
804
  postgres_branch: "postgres_branch";
797
805
  postgres_database: "postgres_database";
@@ -829,8 +837,8 @@ declare const pluginManifestSchema: z.ZodObject<{
829
837
  type: z.ZodLiteral<"kind">;
830
838
  resourceKind: z.ZodEnum<{
831
839
  volume: "volume";
832
- genie_space: "genie_space";
833
840
  warehouse: "warehouse";
841
+ genie_space: "genie_space";
834
842
  postgres_project: "postgres_project";
835
843
  postgres_branch: "postgres_branch";
836
844
  postgres_database: "postgres_database";
@@ -868,8 +876,8 @@ declare const pluginManifestSchema: z.ZodObject<{
868
876
  type: z.ZodLiteral<"kind">;
869
877
  resourceKind: z.ZodEnum<{
870
878
  volume: "volume";
871
- genie_space: "genie_space";
872
879
  warehouse: "warehouse";
880
+ genie_space: "genie_space";
873
881
  postgres_project: "postgres_project";
874
882
  postgres_branch: "postgres_branch";
875
883
  postgres_database: "postgres_database";
@@ -907,8 +915,8 @@ declare const pluginManifestSchema: z.ZodObject<{
907
915
  type: z.ZodLiteral<"kind">;
908
916
  resourceKind: z.ZodEnum<{
909
917
  volume: "volume";
910
- genie_space: "genie_space";
911
918
  warehouse: "warehouse";
919
+ genie_space: "genie_space";
912
920
  postgres_project: "postgres_project";
913
921
  postgres_branch: "postgres_branch";
914
922
  postgres_database: "postgres_database";
@@ -946,8 +954,8 @@ declare const pluginManifestSchema: z.ZodObject<{
946
954
  type: z.ZodLiteral<"kind">;
947
955
  resourceKind: z.ZodEnum<{
948
956
  volume: "volume";
949
- genie_space: "genie_space";
950
957
  warehouse: "warehouse";
958
+ genie_space: "genie_space";
951
959
  postgres_project: "postgres_project";
952
960
  postgres_branch: "postgres_branch";
953
961
  postgres_database: "postgres_database";
@@ -968,10 +976,10 @@ declare const pluginManifestSchema: z.ZodObject<{
968
976
  type: z.ZodLiteral<"postgres">;
969
977
  }, z.core.$strict>, z.ZodObject<{
970
978
  permission: z.ZodEnum<{
979
+ CAN_EDIT: "CAN_EDIT";
971
980
  CAN_VIEW: "CAN_VIEW";
972
981
  CAN_MANAGE: "CAN_MANAGE";
973
982
  CAN_RUN: "CAN_RUN";
974
- CAN_EDIT: "CAN_EDIT";
975
983
  }>;
976
984
  alias: z.ZodString;
977
985
  resourceKey: z.ZodString;
@@ -988,8 +996,8 @@ declare const pluginManifestSchema: z.ZodObject<{
988
996
  type: z.ZodLiteral<"kind">;
989
997
  resourceKind: z.ZodEnum<{
990
998
  volume: "volume";
991
- genie_space: "genie_space";
992
999
  warehouse: "warehouse";
1000
+ genie_space: "genie_space";
993
1001
  postgres_project: "postgres_project";
994
1002
  postgres_branch: "postgres_branch";
995
1003
  postgres_database: "postgres_database";
@@ -1010,8 +1018,8 @@ declare const pluginManifestSchema: z.ZodObject<{
1010
1018
  type: z.ZodLiteral<"genie_space">;
1011
1019
  }, z.core.$strict>, z.ZodObject<{
1012
1020
  permission: z.ZodEnum<{
1013
- CAN_MANAGE: "CAN_MANAGE";
1014
1021
  CAN_EDIT: "CAN_EDIT";
1022
+ CAN_MANAGE: "CAN_MANAGE";
1015
1023
  CAN_READ: "CAN_READ";
1016
1024
  }>;
1017
1025
  alias: z.ZodString;
@@ -1029,8 +1037,8 @@ declare const pluginManifestSchema: z.ZodObject<{
1029
1037
  type: z.ZodLiteral<"kind">;
1030
1038
  resourceKind: z.ZodEnum<{
1031
1039
  volume: "volume";
1032
- genie_space: "genie_space";
1033
1040
  warehouse: "warehouse";
1041
+ genie_space: "genie_space";
1034
1042
  postgres_project: "postgres_project";
1035
1043
  postgres_branch: "postgres_branch";
1036
1044
  postgres_database: "postgres_database";
@@ -1068,8 +1076,8 @@ declare const pluginManifestSchema: z.ZodObject<{
1068
1076
  type: z.ZodLiteral<"kind">;
1069
1077
  resourceKind: z.ZodEnum<{
1070
1078
  volume: "volume";
1071
- genie_space: "genie_space";
1072
1079
  warehouse: "warehouse";
1080
+ genie_space: "genie_space";
1073
1081
  postgres_project: "postgres_project";
1074
1082
  postgres_branch: "postgres_branch";
1075
1083
  postgres_database: "postgres_database";
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAikBrB,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,wBAAA;AAAA,KAOpC,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA"}
@@ -46,6 +46,20 @@ const resourceTypeSchema = z.enum([
46
46
  "experiment",
47
47
  "app"
48
48
  ]).describe("Type of Databricks resource");
49
+ /** Apps user_api_scopes for resource types with confirmed OBO support. */
50
+ const SCOPE_BY_TYPE = {
51
+ sql_warehouse: "sql",
52
+ serving_endpoint: "model-serving",
53
+ genie_space: "genie",
54
+ volume: "files",
55
+ vector_search_index: "vector-search",
56
+ uc_connection: "catalog.connections"
57
+ };
58
+ const APP_ONLY_RESOURCE_TYPES = new Set([
59
+ "secret",
60
+ "database",
61
+ "postgres"
62
+ ]);
49
63
  /** Capabilities that need a user_api_scope but have no resource ID. */
50
64
  const capabilityScopeSchema = z.enum([
51
65
  "ai-gateway",
@@ -56,6 +70,23 @@ const capabilityScopeSchema = z.enum([
56
70
  "catalog.schemas:read",
57
71
  "catalog.tables:read"
58
72
  ]);
73
+ /**
74
+ * Every Apps user_api_scope (short names; the long forms such as
75
+ * `dashboards.genie` are deprecated aliases). A plugin declares one in its
76
+ * `scopes` when it always calls on behalf of the user, or when the capability
77
+ * has no resource ID.
78
+ */
79
+ const userApiScopeSchema = z.enum([
80
+ "sql",
81
+ "sql:restricted-query",
82
+ "genie",
83
+ "postgres",
84
+ "model-serving",
85
+ "files",
86
+ "vector-search",
87
+ "catalog.connections",
88
+ ...capabilityScopeSchema.options
89
+ ]);
59
90
  const secretPermissionSchema = z.enum([
60
91
  "READ",
61
92
  "WRITE",
@@ -329,7 +360,7 @@ const pluginScaffoldingRulesSchema = z.object({
329
360
  }
330
361
  }).describe("Structured rules for scaffolding agents declared at the plugin level. Each rule is a short directive (≤120 chars).");
331
362
  const pluginManifestSchema = z.object({
332
- scopes: z.array(capabilityScopeSchema).optional().describe("Capability-only user_api_scopes with no resource ID."),
363
+ scopes: z.array(userApiScopeSchema).optional().describe("user_api_scopes the plugin always needs, whatever its resources are bound as: calls it makes on behalf of the user unconditionally, or capabilities with no resource ID."),
333
364
  $schema: z.string().optional().describe("Reference to the JSON Schema for validation"),
334
365
  name: z.string().regex(PLUGIN_NAME_PATTERN).describe("Plugin identifier and JS binding. Must start with a lowercase letter; camelCase for multi-word names (e.g. aiSearch)."),
335
366
  displayName: z.string().min(1).describe("Human-readable display name for UI and CLI"),
@@ -392,7 +423,14 @@ const templateResourceRequirementBaseShape = {
392
423
  alias: z.string().min(1).describe("Human-readable label for UI/display only."),
393
424
  resourceKey: z.string().regex(/^[a-z][a-z0-9-]*$/).describe("Stable key for machine use: deduplication, env naming, composite keys."),
394
425
  description: z.string().min(1).describe("Human-readable description of why this resource is needed"),
395
- fields: z.record(z.string(), templateFieldEntrySchema).refine((obj) => Object.keys(obj).length >= 1, { message: "fields must contain at least one entry" }).optional().describe("Map of field name to field entry with computed origin.")
426
+ fields: z.record(z.string(), templateFieldEntrySchema).refine((obj) => Object.keys(obj).length >= 1, { message: "fields must contain at least one entry" }).optional().describe("Map of field name to field entry with computed origin."),
427
+ scope: z.string().min(1).optional().describe("Apps user_api_scope for this resource type. Present only when the type can run on behalf of the user. Resolved by sync from SCOPE_BY_TYPE."),
428
+ appOnly: z.literal(true).optional().describe("Present only when the type always runs as the app service principal and must be bound (secret, database, postgres). Resolved by sync from APP_ONLY_RESOURCE_TYPES."),
429
+ binding: z.object({
430
+ yamlKey: z.string().min(1).describe("DABs YAML key under the resource entry."),
431
+ varFields: z.array(z.tuple([z.string(), z.string()])).describe("[manifestField, dabsField] pairs. Each becomes ${var.<resourceKey>_<manifestField>} written to dabsField."),
432
+ staticFields: z.array(z.tuple([z.string(), z.string()])).optional().describe("[dabsField, value] constant pairs.")
433
+ }).strict().optional().describe("How this resource type binds in databricks.yml as a DABs app resource. Resolved by sync from DABS_BINDING_BY_TYPE.")
396
434
  };
397
435
  function makeTemplateResourceVariant(typeLiteral, permission) {
398
436
  return z.object({
@@ -429,7 +467,8 @@ const templatePluginSchema = z.object({
429
467
  resources: z.object({
430
468
  required: z.array(templateResourceRequirementSchema).describe("Resources that must be available for the plugin to function"),
431
469
  optional: z.array(templateResourceRequirementSchema).describe("Resources that enhance functionality but are not mandatory")
432
- }).strict().describe("Databricks resource requirements for this plugin")
470
+ }).strict().describe("Databricks resource requirements for this plugin"),
471
+ scopes: z.array(userApiScopeSchema).min(1).optional().describe("user_api_scopes the plugin always needs, copied from the plugin manifest. Omitted when empty.")
433
472
  }).strict().describe("Plugin manifest with package source information");
434
473
  const scaffoldingFlagSchema = z.object({
435
474
  description: z.string().describe("Human-readable description of the flag."),
@@ -472,5 +511,5 @@ const templatePluginsManifestSchema = z.object({
472
511
  }).describe("Aggregated plugin manifest for AppKit templates. Read by Databricks CLI during init to discover available plugins and their resource requirements.");
473
512
 
474
513
  //#endregion
475
- export { pluginManifestSchema };
514
+ export { APP_ONLY_RESOURCE_TYPES, SCOPE_BY_TYPE, pluginManifestSchema };
476
515
  //# sourceMappingURL=manifest.js.map