@databricks/appkit 0.82.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 (225) hide show
  1. package/CLAUDE.md +21 -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/index.js +1 -1
  19. package/dist/connectors/lakebase/routing-pool.d.ts +1 -1
  20. package/dist/connectors/lakebase/routing-pool.d.ts.map +1 -1
  21. package/dist/connectors/lakebase/routing-pool.js +6 -12
  22. package/dist/connectors/lakebase/routing-pool.js.map +1 -1
  23. package/dist/context/caller-context.d.ts +25 -0
  24. package/dist/context/caller-context.d.ts.map +1 -0
  25. package/dist/context/caller-context.js +21 -0
  26. package/dist/context/caller-context.js.map +1 -0
  27. package/dist/context/deprecation.js +14 -0
  28. package/dist/context/deprecation.js.map +1 -0
  29. package/dist/context/execution-context.d.ts +40 -4
  30. package/dist/context/execution-context.d.ts.map +1 -1
  31. package/dist/context/execution-context.js +87 -33
  32. package/dist/context/execution-context.js.map +1 -1
  33. package/dist/context/index.d.ts +3 -2
  34. package/dist/context/index.js +3 -1
  35. package/dist/context/request-scope.d.ts +2 -0
  36. package/dist/context/request-scope.js +39 -0
  37. package/dist/context/request-scope.js.map +1 -0
  38. package/dist/context/resource-capabilities.js +59 -0
  39. package/dist/context/resource-capabilities.js.map +1 -0
  40. package/dist/context/scoped-api.js +104 -0
  41. package/dist/context/scoped-api.js.map +1 -0
  42. package/dist/context/service-context.d.ts +18 -12
  43. package/dist/context/service-context.d.ts.map +1 -1
  44. package/dist/context/service-context.js +45 -55
  45. package/dist/context/service-context.js.map +1 -1
  46. package/dist/context/user-context.d.ts +16 -22
  47. package/dist/context/user-context.d.ts.map +1 -1
  48. package/dist/context/user-context.js +57 -3
  49. package/dist/context/user-context.js.map +1 -1
  50. package/dist/core/agent/load-agents.d.ts.map +1 -1
  51. package/dist/core/agent/load-agents.js +5 -2
  52. package/dist/core/agent/load-agents.js.map +1 -1
  53. package/dist/core/agent/run-agent.d.ts +19 -6
  54. package/dist/core/agent/run-agent.d.ts.map +1 -1
  55. package/dist/core/agent/run-agent.js +53 -17
  56. package/dist/core/agent/run-agent.js.map +1 -1
  57. package/dist/core/agent/types.d.ts +18 -1
  58. package/dist/core/agent/types.d.ts.map +1 -1
  59. package/dist/core/agent/types.js.map +1 -1
  60. package/dist/core/appkit.d.ts +4 -3
  61. package/dist/core/appkit.d.ts.map +1 -1
  62. package/dist/core/appkit.js +34 -11
  63. package/dist/core/appkit.js.map +1 -1
  64. package/dist/core/plugin-context.d.ts +14 -15
  65. package/dist/core/plugin-context.d.ts.map +1 -1
  66. package/dist/core/plugin-context.js +24 -14
  67. package/dist/core/plugin-context.js.map +1 -1
  68. package/dist/errors/base.d.ts +2 -2
  69. package/dist/errors/base.js +2 -2
  70. package/dist/errors/base.js.map +1 -1
  71. package/dist/errors/identity-expired.d.ts +14 -0
  72. package/dist/errors/identity-expired.d.ts.map +1 -0
  73. package/dist/errors/identity-expired.js +33 -0
  74. package/dist/errors/identity-expired.js.map +1 -0
  75. package/dist/errors/index.js +1 -0
  76. package/dist/index.d.ts +12 -6
  77. package/dist/index.js +7 -2
  78. package/dist/logging/logger.js +1 -1
  79. package/dist/plugin/execution-result.d.ts +4 -1
  80. package/dist/plugin/execution-result.d.ts.map +1 -1
  81. package/dist/plugin/interceptors/telemetry.js +6 -4
  82. package/dist/plugin/interceptors/telemetry.js.map +1 -1
  83. package/dist/plugin/plugin.d.ts +14 -22
  84. package/dist/plugin/plugin.d.ts.map +1 -1
  85. package/dist/plugin/plugin.js +42 -123
  86. package/dist/plugin/plugin.js.map +1 -1
  87. package/dist/plugins/agents/agents.d.ts +13 -1
  88. package/dist/plugins/agents/agents.d.ts.map +1 -1
  89. package/dist/plugins/agents/agents.js +65 -15
  90. package/dist/plugins/agents/agents.js.map +1 -1
  91. package/dist/plugins/agents/auth-mode.js +42 -0
  92. package/dist/plugins/agents/auth-mode.js.map +1 -0
  93. package/dist/plugins/agents/index.d.ts +1 -1
  94. package/dist/plugins/agents/mlflow.js +11 -3
  95. package/dist/plugins/agents/mlflow.js.map +1 -1
  96. package/dist/plugins/agents/tool-dispatch.js +9 -1
  97. package/dist/plugins/agents/tool-dispatch.js.map +1 -1
  98. package/dist/plugins/ai-search/ai-search.d.ts +1 -1
  99. package/dist/plugins/ai-search/ai-search.d.ts.map +1 -1
  100. package/dist/plugins/ai-search/ai-search.js +4 -4
  101. package/dist/plugins/ai-search/ai-search.js.map +1 -1
  102. package/dist/plugins/analytics/analytics.d.ts +3 -3
  103. package/dist/plugins/analytics/analytics.d.ts.map +1 -1
  104. package/dist/plugins/analytics/analytics.js +9 -7
  105. package/dist/plugins/analytics/analytics.js.map +1 -1
  106. package/dist/plugins/database/crud/contract.js +2 -2
  107. package/dist/plugins/database/crud/contract.js.map +1 -1
  108. package/dist/plugins/database/database.d.ts +1 -1
  109. package/dist/plugins/files/plugin.d.ts +21 -15
  110. package/dist/plugins/files/plugin.d.ts.map +1 -1
  111. package/dist/plugins/files/plugin.js +50 -29
  112. package/dist/plugins/files/plugin.js.map +1 -1
  113. package/dist/plugins/genie/genie.d.ts +10 -1
  114. package/dist/plugins/genie/genie.d.ts.map +1 -1
  115. package/dist/plugins/genie/genie.js +12 -3
  116. package/dist/plugins/genie/genie.js.map +1 -1
  117. package/dist/plugins/genie/manifest.js +1 -0
  118. package/dist/plugins/jobs/plugin.d.ts +1 -1
  119. package/dist/plugins/jobs/plugin.js +2 -2
  120. package/dist/plugins/jobs/plugin.js.map +1 -1
  121. package/dist/plugins/lakebase/lakebase.d.ts +11 -18
  122. package/dist/plugins/lakebase/lakebase.d.ts.map +1 -1
  123. package/dist/plugins/lakebase/lakebase.js +16 -21
  124. package/dist/plugins/lakebase/lakebase.js.map +1 -1
  125. package/dist/plugins/server/client-config-sanitizer.js +1 -4
  126. package/dist/plugins/server/client-config-sanitizer.js.map +1 -1
  127. package/dist/plugins/server/dev-obo-middleware.js +60 -0
  128. package/dist/plugins/server/dev-obo-middleware.js.map +1 -0
  129. package/dist/plugins/server/index.d.ts +1 -1
  130. package/dist/plugins/server/index.d.ts.map +1 -1
  131. package/dist/plugins/server/index.js +3 -0
  132. package/dist/plugins/server/index.js.map +1 -1
  133. package/dist/plugins/serving/manifest.js +1 -0
  134. package/dist/plugins/serving/serving.d.ts +1 -1
  135. package/dist/plugins/serving/serving.js +6 -6
  136. package/dist/plugins/serving/serving.js.map +1 -1
  137. package/dist/resources/index.d.ts +1 -0
  138. package/dist/resources/index.js +3 -0
  139. package/dist/resources/warehouse.d.ts +16 -0
  140. package/dist/resources/warehouse.d.ts.map +1 -0
  141. package/dist/resources/warehouse.js +93 -0
  142. package/dist/resources/warehouse.js.map +1 -0
  143. package/dist/schemas/manifest.d.ts +44 -1
  144. package/dist/schemas/manifest.d.ts.map +1 -1
  145. package/dist/schemas/manifest.js +122 -3
  146. package/dist/schemas/manifest.js.map +1 -1
  147. package/dist/shared/src/dev-obo.js +86 -0
  148. package/dist/shared/src/dev-obo.js.map +1 -0
  149. package/dist/shared/src/index.d.ts +1 -1
  150. package/dist/shared/src/plugin.d.ts +12 -1
  151. package/dist/shared/src/plugin.d.ts.map +1 -1
  152. package/dist/shared/src/schemas/manifest.d.ts +17 -0
  153. package/dist/shared/src/schemas/manifest.d.ts.map +1 -1
  154. package/dist/shared/src/schemas/manifest.js +53 -3
  155. package/dist/shared/src/schemas/manifest.js.map +1 -1
  156. package/dist/stream/stream-manager.d.ts.map +1 -1
  157. package/dist/stream/stream-manager.js +5 -2
  158. package/dist/stream/stream-manager.js.map +1 -1
  159. package/dist/telemetry/execution-span-processor.js +21 -0
  160. package/dist/telemetry/execution-span-processor.js.map +1 -0
  161. package/dist/telemetry/telemetry-manager.js +2 -1
  162. package/dist/telemetry/telemetry-manager.js.map +1 -1
  163. package/dist/testing/create-test-app.d.ts +2 -2
  164. package/dist/testing/create-test-app.js +2 -2
  165. package/dist/testing/create-test-app.js.map +1 -1
  166. package/dist/testing/fixtures.d.ts +3 -2
  167. package/dist/testing/fixtures.d.ts.map +1 -1
  168. package/dist/testing/fixtures.js +21 -14
  169. package/dist/testing/fixtures.js.map +1 -1
  170. package/dist/testing/reset-singletons.js +1 -1
  171. package/dist/testing/test-plugin-context.d.ts +3 -12
  172. package/dist/testing/test-plugin-context.d.ts.map +1 -1
  173. package/dist/testing/test-plugin-context.js +24 -16
  174. package/dist/testing/test-plugin-context.js.map +1 -1
  175. package/dist/utils/is-plain-object.js +11 -0
  176. package/dist/utils/is-plain-object.js.map +1 -0
  177. package/docs/api/appkit/Class.AppKitError.md +2 -1
  178. package/docs/api/appkit/Class.AuthenticationError.md +1 -1
  179. package/docs/api/appkit/Class.ConfigurationError.md +1 -1
  180. package/docs/api/appkit/Class.ConnectionError.md +1 -1
  181. package/docs/api/appkit/Class.DatabaseValidationError.md +1 -1
  182. package/docs/api/appkit/Class.ExecutionError.md +1 -1
  183. package/docs/api/appkit/Class.IdentityExpiredError.md +190 -0
  184. package/docs/api/appkit/Class.InitializationError.md +1 -1
  185. package/docs/api/appkit/Class.Plugin.md +9 -13
  186. package/docs/api/appkit/Class.ServerError.md +1 -1
  187. package/docs/api/appkit/Class.ServiceContext.md +169 -0
  188. package/docs/api/appkit/Class.TunnelError.md +1 -1
  189. package/docs/api/appkit/Class.ValidationError.md +1 -1
  190. package/docs/api/appkit/Function.createApp.md +12 -12
  191. package/docs/api/appkit/Function.getCallerContext.md +12 -0
  192. package/docs/api/appkit/Function.getCurrentActorId.md +12 -0
  193. package/docs/api/appkit/Function.getCurrentPrincipalKey.md +12 -0
  194. package/docs/api/appkit/Function.getCurrentUserId.md +14 -0
  195. package/docs/api/appkit/Function.getExecutionContext.md +5 -3
  196. package/docs/api/appkit/Function.getUserContext.md +16 -0
  197. package/docs/api/appkit/Function.getWarehouseId.md +20 -0
  198. package/docs/api/appkit/Function.isInUserContext.md +12 -0
  199. package/docs/api/appkit/Function.isUserContext.md +20 -0
  200. package/docs/api/appkit/Function.runAgent.md +1 -1
  201. package/docs/api/appkit/Function.runInCallerContext.md +27 -0
  202. package/docs/api/appkit/Function.runInUserContext.md +29 -0
  203. package/docs/api/appkit/Interface.AgentDefinition.md +11 -0
  204. package/docs/api/appkit/Interface.AgentsPluginConfig.md +11 -0
  205. package/docs/api/appkit/Interface.CallerContext.md +54 -0
  206. package/docs/api/appkit/Interface.IndexConfig.md +1 -1
  207. package/docs/api/appkit/Interface.PluginManifest.md +33 -2
  208. package/docs/api/appkit/Interface.RegisteredAgent.md +11 -0
  209. package/docs/api/appkit/Interface.RunAgentInput.md +45 -1
  210. package/docs/api/appkit/TypeAlias.AgentAuth.md +8 -0
  211. package/docs/api/appkit/TypeAlias.AppKitApi.md +35 -0
  212. package/docs/api/appkit/TypeAlias.CallerPrincipal.md +13 -0
  213. package/docs/api/appkit/TypeAlias.ExecutionContext.md +9 -0
  214. package/docs/api/appkit/TypeAlias.ExecutionResult.md +65 -0
  215. package/docs/api/appkit/TypeAlias.ScopedPluginMap.md +12 -0
  216. package/docs/api/appkit/TypeAlias.UserContext.md +109 -0
  217. package/docs/api/appkit/TypeAlias.UserScopedApp.md +39 -0
  218. package/docs/api/appkit.md +20 -0
  219. package/docs/plugins/agents.md +45 -0
  220. package/docs/plugins/analytics.md +8 -0
  221. package/docs/plugins/execution-context.md +101 -50
  222. package/docs/plugins/lakebase.md +6 -82
  223. package/llms.txt +21 -1
  224. package/package.json +1 -1
  225. package/sbom.cdx.json +1 -1
@@ -0,0 +1,20 @@
1
+ # ~~Function: isUserContext()~~
2
+
3
+ ```ts
4
+ function isUserContext(ctx: ExecutionContext): ctx is UserContext & Partial<CallerContext>;
5
+
6
+ ```
7
+
8
+ ## Parameters[​](#parameters "Direct link to Parameters")
9
+
10
+ | Parameter | Type |
11
+ | --------- | --------------------------------------------------------------------------- |
12
+ | `ctx` | [`ExecutionContext`](./docs/api/appkit/TypeAlias.ExecutionContext.md) |
13
+
14
+ ## Returns[​](#returns "Direct link to Returns")
15
+
16
+ `ctx is UserContext & Partial<CallerContext>`
17
+
18
+ ## Deprecated[​](#deprecated "Direct link to Deprecated")
19
+
20
+ Use isCallerContext. Active caller contexts retain the legacy identity accessors for callers narrowed by this guard.
@@ -9,7 +9,7 @@ Standalone agent execution without `createApp`. Resolves the adapter, binds inli
9
9
 
10
10
  Limitations vs. running through the agents() plugin:
11
11
 
12
- * **No OBO and no approval gate** — there is no HTTP request, so plugin tools run as the service principal. The agents-plugin approval gate that prompts for human confirmation on `effect: "write" | "update" | "destructive"` tools is also absent. LLM-controlled tool arguments flow straight through to the SP. Treat standalone runAgent as a trusted-prompt environment (CI, batch eval, internal scripts) — not as an exposed user-facing surface.
12
+ * **No approval gate**: tools inherit the run's principal, SP by default. Explicit caller credentials enable user execution. The agents-plugin gate that prompts for human confirmation on `effect: "write" | "update" | "destructive"` tools is also absent. LLM-controlled tool arguments flow straight through to the tools. Treat standalone runAgent as a trusted-prompt environment (CI, batch eval, internal scripts), not as an exposed user-facing surface.
13
13
  * **Hosted tools (MCP) are not supported** — they require a live MCP client that only exists inside the agents plugin's lifecycle. `runAgent` rejects them at index-build time with a clear error.
14
14
  * **Sub-agents** (`agents: { ... }` on the def) are executed as nested `runAgent` calls with no shared thread state. Plugin instances ARE shared across the recursion (same cache as the parent).
15
15
  * **Plugin tools** (used inside the function form via `plugins.<name>.toolkit(...)`) require passing `plugins: [...]` via `RunAgentInput`. Each plugin in that array is constructed once, `attachContext({})` and `await setup()` are called eagerly, and the resulting instance is shared across the top-level run and all sub-agent recursions. Plugins whose `setup()` requires runtime that only `createApp` provides (e.g. `WorkspaceClient`, `ServiceContext`, `PluginContext`) throw at standalone-init time with a clear "use createApp instead" message — not mid-stream.
@@ -0,0 +1,27 @@
1
+ # Function: runInCallerContext()
2
+
3
+ ```ts
4
+ function runInCallerContext<T>(callerContext: CallerContext, fn: () => T): T;
5
+
6
+ ```
7
+
8
+ Run a function with an immutable snapshot of the caller context. Nested and concurrent scopes keep their own identities.
9
+
10
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
11
+
12
+ | Type Parameter |
13
+ | -------------- |
14
+ | `T` |
15
+
16
+ ## Parameters[​](#parameters "Direct link to Parameters")
17
+
18
+ | Parameter | Type | Description |
19
+ | --------------- | --------------------------------------------------------------------- | ------------------------- |
20
+ | `callerContext` | [`CallerContext`](./docs/api/appkit/Interface.CallerContext.md) | The caller context to use |
21
+ | `fn` | () => `T` | The function to run |
22
+
23
+ ## Returns[​](#returns "Direct link to Returns")
24
+
25
+ `T`
26
+
27
+ The result of the function
@@ -0,0 +1,29 @@
1
+ # ~~Function: runInUserContext()~~
2
+
3
+ ```ts
4
+ function runInUserContext<T>(userContext:
5
+ | UserContext
6
+ | CallerContext & Pick<UserContext, "warehouseId">, fn: () => T): T;
7
+
8
+ ```
9
+
10
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
11
+
12
+ | Type Parameter |
13
+ | -------------- |
14
+ | `T` |
15
+
16
+ ## Parameters[​](#parameters "Direct link to Parameters")
17
+
18
+ | Parameter | Type |
19
+ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
20
+ | `userContext` | \| [`UserContext`](./docs/api/appkit/TypeAlias.UserContext.md) \| [`CallerContext`](./docs/api/appkit/Interface.CallerContext.md) & `Pick`<[`UserContext`](./docs/api/appkit/TypeAlias.UserContext.md), `"warehouseId"`> |
21
+ | `fn` | () => `T` |
22
+
23
+ ## Returns[​](#returns "Direct link to Returns")
24
+
25
+ `T`
26
+
27
+ ## Deprecated[​](#deprecated "Direct link to Deprecated")
28
+
29
+ Use runInCallerContext.
@@ -13,6 +13,17 @@ Sub-agents, exposed as `agent-<key>` tools on this agent.
13
13
 
14
14
  ***
15
15
 
16
+ ### auth?[​](#auth "Direct link to auth?")
17
+
18
+ ```ts
19
+ optional auth: "on-behalf-of-user";
20
+
21
+ ```
22
+
23
+ Run this agent on behalf of the signed-in user: the model call, plugin tools, hand-rolled tools, and sub-agents all use the user's credentials. Overrides `agents({ auth })` for this agent. Omit for the default, where the model and hand-rolled tools run as the app service principal and plugin tools run as the user.
24
+
25
+ ***
26
+
16
27
  ### baseSystemPrompt?[​](#basesystemprompt "Direct link to baseSystemPrompt?")
17
28
 
18
29
  ```ts
@@ -60,6 +60,17 @@ Milliseconds to wait before auto-denying. Default: 60\_000.
60
60
 
61
61
  ***
62
62
 
63
+ ### auth?[​](#auth "Direct link to auth?")
64
+
65
+ ```ts
66
+ optional auth: "on-behalf-of-user";
67
+
68
+ ```
69
+
70
+ Default identity for agents that don't set their own `auth`. `"on-behalf-of-user"` runs the whole agent as the signed-in user.
71
+
72
+ ***
73
+
63
74
  ### autoInheritSkills?[​](#autoinheritskills "Direct link to autoInheritSkills?")
64
75
 
65
76
  ```ts
@@ -0,0 +1,54 @@
1
+ # Interface: CallerContext
2
+
3
+ Caller identity and workspace for one immutable execution scope.
4
+
5
+ ## Properties[​](#properties "Direct link to Properties")
6
+
7
+ ### client[​](#client "Direct link to client")
8
+
9
+ ```ts
10
+ readonly client: WorkspaceClient;
11
+
12
+ ```
13
+
14
+ ***
15
+
16
+ ### principal[​](#principal "Direct link to principal")
17
+
18
+ ```ts
19
+ readonly principal: CallerPrincipal;
20
+
21
+ ```
22
+
23
+ ***
24
+
25
+ ### tokenFingerprint?[​](#tokenfingerprint "Direct link to tokenFingerprint?")
26
+
27
+ ```ts
28
+ readonly optional tokenFingerprint: string;
29
+
30
+ ```
31
+
32
+ Truncated SHA-256 hash of the caller token, used to detect rotation.
33
+
34
+ ***
35
+
36
+ ### ~~warehouseId?~~[​](#warehouseid "Direct link to warehouseid")
37
+
38
+ ```ts
39
+ readonly optional warehouseId: Promise<string>;
40
+
41
+ ```
42
+
43
+ #### Deprecated[​](#deprecated "Direct link to Deprecated")
44
+
45
+ Use getWarehouseId(). Only legacy context access exposes this field.
46
+
47
+ ***
48
+
49
+ ### workspaceId[​](#workspaceid "Direct link to workspaceId")
50
+
51
+ ```ts
52
+ readonly workspaceId: Promise<string>;
53
+
54
+ ```
@@ -5,7 +5,7 @@
5
5
  ### auth?[​](#auth "Direct link to auth?")
6
6
 
7
7
  ```ts
8
- optional auth: "service-principal" | "on-behalf-of-user";
8
+ optional auth: "on-behalf-of-user" | "service-principal";
9
9
 
10
10
  ```
11
11
 
@@ -323,6 +323,37 @@ Omit.scaffolding
323
323
 
324
324
  ***
325
325
 
326
+ ### scopes?[​](#scopes "Direct link to scopes?")
327
+
328
+ ```ts
329
+ optional scopes: (
330
+ | "postgres"
331
+ | "sql"
332
+ | "model-serving"
333
+ | "genie"
334
+ | "files"
335
+ | "vector-search"
336
+ | "catalog.connections"
337
+ | "ai-gateway"
338
+ | "mcp.external"
339
+ | "mcp.functions"
340
+ | "workspace.workspace"
341
+ | "catalog.catalogs:read"
342
+ | "catalog.schemas:read"
343
+ | "catalog.tables:read"
344
+ | "sql:restricted-query")[];
345
+
346
+ ```
347
+
348
+ #### Inherited from[​](#inherited-from-11 "Direct link to Inherited from")
349
+
350
+ ```ts
351
+ Omit.scopes
352
+
353
+ ```
354
+
355
+ ***
356
+
326
357
  ### stability?[​](#stability "Direct link to stability?")
327
358
 
328
359
  ```ts
@@ -332,7 +363,7 @@ optional stability: "beta" | "ga";
332
363
 
333
364
  Plugin stability level. Beta plugins may have breaking API changes between minor releases but are on a path to GA. GA (general availability) plugins follow semver strictly.
334
365
 
335
- #### Inherited from[​](#inherited-from-11 "Direct link to Inherited from")
366
+ #### Inherited from[​](#inherited-from-12 "Direct link to Inherited from")
336
367
 
337
368
  ```ts
338
369
  Omit.stability
@@ -350,7 +381,7 @@ optional version: string;
350
381
 
351
382
  Plugin version (semver format)
352
383
 
353
- #### Inherited from[​](#inherited-from-12 "Direct link to Inherited from")
384
+ #### Inherited from[​](#inherited-from-13 "Direct link to Inherited from")
354
385
 
355
386
  ```ts
356
387
  Omit.version
@@ -11,6 +11,17 @@ adapter: AgentAdapter;
11
11
 
12
12
  ***
13
13
 
14
+ ### auth?[​](#auth "Direct link to auth?")
15
+
16
+ ```ts
17
+ optional auth: "on-behalf-of-user";
18
+
19
+ ```
20
+
21
+ Effective identity: the agent's `auth`, else the plugin default.
22
+
23
+ ***
24
+
14
25
  ### baseSystemPrompt?[​](#basesystemprompt "Direct link to baseSystemPrompt?")
15
26
 
16
27
  ```ts
@@ -2,6 +2,50 @@
2
2
 
3
3
  ## Properties[​](#properties "Direct link to Properties")
4
4
 
5
+ ### caller?[​](#caller "Direct link to caller?")
6
+
7
+ ```ts
8
+ optional caller: {
9
+ host: string;
10
+ principal: CallerPrincipal;
11
+ token: string;
12
+ workspaceId: string;
13
+ };
14
+
15
+ ```
16
+
17
+ Explicit user credentials for standalone execution. Host and workspace ID are required, so no CLI profile or service-principal identity is selected. Omit to inherit the ambient scope, or use SP when no caller scope is open. Obtain the token through a trusted authentication flow, not model input.
18
+
19
+ #### host[​](#host "Direct link to host")
20
+
21
+ ```ts
22
+ readonly host: string;
23
+
24
+ ```
25
+
26
+ #### principal[​](#principal "Direct link to principal")
27
+
28
+ ```ts
29
+ readonly principal: CallerPrincipal;
30
+
31
+ ```
32
+
33
+ #### token[​](#token "Direct link to token")
34
+
35
+ ```ts
36
+ readonly token: string;
37
+
38
+ ```
39
+
40
+ #### workspaceId[​](#workspaceid "Direct link to workspaceId")
41
+
42
+ ```ts
43
+ readonly workspaceId: string;
44
+
45
+ ```
46
+
47
+ ***
48
+
5
49
  ### messages[​](#messages "Direct link to messages")
6
50
 
7
51
  ```ts
@@ -20,7 +64,7 @@ optional plugins: PluginData<PluginConstructor, unknown, string>[];
20
64
 
21
65
  ```
22
66
 
23
- Optional plugin list. Required when `def.tools` is the function form `(plugins) => Record<string, AgentTool>` and the function dereferences any plugins. `runAgent` constructs a fresh instance per plugin and dispatches tool calls against it as the service principal (no OBO — there is no HTTP request in standalone mode).
67
+ Optional plugin list. Required when `def.tools` is the function form `(plugins) => Record<string, AgentTool>` and the function dereferences any plugins. `runAgent` constructs a fresh instance per plugin and dispatches tool calls with the run's ambient principal.
24
68
 
25
69
  ***
26
70
 
@@ -0,0 +1,8 @@
1
+ # Type Alias: AgentAuth
2
+
3
+ ```ts
4
+ type AgentAuth = "on-behalf-of-user";
5
+
6
+ ```
7
+
8
+ Identity an agent runs under. The only value is on-behalf-of-user.
@@ -0,0 +1,35 @@
1
+ # Type Alias: AppKitApi\<U>
2
+
3
+ ```ts
4
+ type AppKitApi<U> = PluginMap<U> & {
5
+ asUser: UserScopedApp<U>;
6
+ };
7
+
8
+ ```
9
+
10
+ App instance with plugin exports and an explicit caller-scoped entry point.
11
+
12
+ ## Type Declaration[​](#type-declaration "Direct link to Type Declaration")
13
+
14
+ ### asUser()[​](#asuser "Direct link to asUser()")
15
+
16
+ ```ts
17
+ asUser(req: IAppRequest): UserScopedApp<U>;
18
+
19
+ ```
20
+
21
+ #### Parameters[​](#parameters "Direct link to Parameters")
22
+
23
+ | Parameter | Type |
24
+ | --------- | ------------- |
25
+ | `req` | `IAppRequest` |
26
+
27
+ #### Returns[​](#returns "Direct link to Returns")
28
+
29
+ [`UserScopedApp`](./docs/api/appkit/TypeAlias.UserScopedApp.md)<`U`>
30
+
31
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
32
+
33
+ | Type Parameter |
34
+ | ----------------------------------------------------------------------------------------------------------------------------------- |
35
+ | `U` *extends* readonly [`PluginData`](./docs/api/appkit/TypeAlias.PluginData.md)<`PluginConstructor`, `unknown`, `string`>\[] |
@@ -0,0 +1,13 @@
1
+ # Type Alias: CallerPrincipal
2
+
3
+ ```ts
4
+ type CallerPrincipal = Readonly<{
5
+ type: "user";
6
+ userEmail?: string;
7
+ userId: string;
8
+ userName?: string;
9
+ }>;
10
+
11
+ ```
12
+
13
+ The caller identity whose permissions authorize execution, not its resources.
@@ -0,0 +1,9 @@
1
+ # Type Alias: ExecutionContext
2
+
3
+ ```ts
4
+ type ExecutionContext =
5
+ | ServiceContextState
6
+ | CallerContext
7
+ | UserContext;
8
+
9
+ ```
@@ -7,6 +7,7 @@ type ExecutionResult<T> =
7
7
  ok: true;
8
8
  }
9
9
  | {
10
+ error?: IdentityExpiredError;
10
11
  message: string;
11
12
  ok: false;
12
13
  status: number;
@@ -34,3 +35,67 @@ In production, error messages from non-AppKitError sources are handled as:
34
35
  | Type Parameter |
35
36
  | -------------- |
36
37
  | `T` |
38
+
39
+ ## Type Declaration[​](#type-declaration "Direct link to Type Declaration")
40
+
41
+ ```ts
42
+ {
43
+ data: T;
44
+ ok: true;
45
+ }
46
+
47
+ ```
48
+
49
+ ### data[​](#data "Direct link to data")
50
+
51
+ ```ts
52
+ data: T;
53
+
54
+ ```
55
+
56
+ ### ok[​](#ok "Direct link to ok")
57
+
58
+ ```ts
59
+ ok: true;
60
+
61
+ ```
62
+
63
+ ```ts
64
+ {
65
+ error?: IdentityExpiredError;
66
+ message: string;
67
+ ok: false;
68
+ status: number;
69
+ }
70
+
71
+ ```
72
+
73
+ ### error?[​](#error "Direct link to error?")
74
+
75
+ ```ts
76
+ optional error: IdentityExpiredError;
77
+
78
+ ```
79
+
80
+ Typed credential expiry without changing the existing failure envelope.
81
+
82
+ ### message[​](#message "Direct link to message")
83
+
84
+ ```ts
85
+ message: string;
86
+
87
+ ```
88
+
89
+ ### ok[​](#ok-1 "Direct link to ok")
90
+
91
+ ```ts
92
+ ok: false;
93
+
94
+ ```
95
+
96
+ ### status[​](#status "Direct link to status")
97
+
98
+ ```ts
99
+ status: number;
100
+
101
+ ```
@@ -0,0 +1,12 @@
1
+ # Type Alias: ScopedPluginMap\<U>
2
+
3
+ ```ts
4
+ type ScopedPluginMap<U> = { [P in U[number] as P["name"]]: ScopedExports<PluginExports<InstanceType<P["plugin"]>>> };
5
+
6
+ ```
7
+
8
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
9
+
10
+ | Type Parameter |
11
+ | ----------------------------------------------------------------------------------------------------------------------------------- |
12
+ | `U` *extends* readonly [`PluginData`](./docs/api/appkit/TypeAlias.PluginData.md)<`PluginConstructor`, `unknown`, `string`>\[] |
@@ -0,0 +1,109 @@
1
+ # ~~Type Alias: UserContext~~
2
+
3
+ ```ts
4
+ type UserContext = {
5
+ client: ServiceContextState["client"];
6
+ isUserContext: true;
7
+ tokenFingerprint?: string;
8
+ userEmail?: string;
9
+ userId: string;
10
+ userName?: string;
11
+ warehouseId?: Promise<string>;
12
+ workspaceId: Promise<string>;
13
+ };
14
+
15
+ ```
16
+
17
+ ## Deprecated[​](#deprecated "Direct link to Deprecated")
18
+
19
+ Use CallerContext and its principal field. Kept for callers that construct the legacy shape or read its flat identity fields.
20
+
21
+ ## Properties[​](#properties "Direct link to Properties")
22
+
23
+ ### ~~client~~[​](#client "Direct link to client")
24
+
25
+ ```ts
26
+ client: ServiceContextState["client"];
27
+
28
+ ```
29
+
30
+ WorkspaceClient authenticated as the user
31
+
32
+ ***
33
+
34
+ ### ~~isUserContext~~[​](#isusercontext "Direct link to isusercontext")
35
+
36
+ ```ts
37
+ isUserContext: true;
38
+
39
+ ```
40
+
41
+ Flag indicating this is a user context
42
+
43
+ ***
44
+
45
+ ### ~~tokenFingerprint?~~[​](#tokenfingerprint "Direct link to tokenfingerprint")
46
+
47
+ ```ts
48
+ optional tokenFingerprint: string;
49
+
50
+ ```
51
+
52
+ Truncated SHA-256 hash of the user's OBO token, used to detect token rotation
53
+
54
+ ***
55
+
56
+ ### ~~userEmail?~~[​](#useremail "Direct link to useremail")
57
+
58
+ ```ts
59
+ optional userEmail: string;
60
+
61
+ ```
62
+
63
+ The user's email (from `x-forwarded-email` header)
64
+
65
+ ***
66
+
67
+ ### ~~userId~~[​](#userid "Direct link to userid")
68
+
69
+ ```ts
70
+ userId: string;
71
+
72
+ ```
73
+
74
+ The user's ID (from request headers)
75
+
76
+ ***
77
+
78
+ ### ~~userName?~~[​](#username "Direct link to username")
79
+
80
+ ```ts
81
+ optional userName: string;
82
+
83
+ ```
84
+
85
+ The user's name (from request headers)
86
+
87
+ ***
88
+
89
+ ### ~~warehouseId?~~[​](#warehouseid "Direct link to warehouseid")
90
+
91
+ ```ts
92
+ optional warehouseId: Promise<string>;
93
+
94
+ ```
95
+
96
+ #### Deprecated[​](#deprecated-1 "Direct link to Deprecated")
97
+
98
+ Use getWarehouseId() from @databricks/appkit.
99
+
100
+ ***
101
+
102
+ ### ~~workspaceId~~[​](#workspaceid "Direct link to workspaceid")
103
+
104
+ ```ts
105
+ workspaceId: Promise<string>;
106
+
107
+ ```
108
+
109
+ Promise that resolves to the workspace ID (inherited from service context)
@@ -0,0 +1,39 @@
1
+ # Type Alias: UserScopedApp\<U>
2
+
3
+ ```ts
4
+ type UserScopedApp<U> = ScopedPluginMap<U> & {
5
+ run: Promise<T>;
6
+ };
7
+
8
+ ```
9
+
10
+ ## Type Declaration[​](#type-declaration "Direct link to Type Declaration")
11
+
12
+ ### run()[​](#run "Direct link to run()")
13
+
14
+ ```ts
15
+ run<T>(fn: (kit: ScopedPluginMap<U>) => T | Promise<T>): Promise<T>;
16
+
17
+ ```
18
+
19
+ #### Type Parameters[​](#type-parameters "Direct link to Type Parameters")
20
+
21
+ | Type Parameter |
22
+ | -------------- |
23
+ | `T` |
24
+
25
+ #### Parameters[​](#parameters "Direct link to Parameters")
26
+
27
+ | Parameter | Type |
28
+ | --------- | ---------------------------------------------------------------------------------------------------------------- |
29
+ | `fn` | (`kit`: [`ScopedPluginMap`](./docs/api/appkit/TypeAlias.ScopedPluginMap.md)<`U`>) => `T` \| `Promise`<`T`> |
30
+
31
+ #### Returns[​](#returns "Direct link to Returns")
32
+
33
+ `Promise`<`T`>
34
+
35
+ ## Type Parameters[​](#type-parameters-1 "Direct link to Type Parameters")
36
+
37
+ | Type Parameter |
38
+ | ----------------------------------------------------------------------------------------------------------------------------------- |
39
+ | `U` *extends* readonly [`PluginData`](./docs/api/appkit/TypeAlias.PluginData.md)<`PluginConstructor`, `unknown`, `string`>\[] |