@dbx-tools/appkit-mastra 0.9.117 → 0.9.118

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.
package/src/server.ts CHANGED
@@ -409,6 +409,10 @@ const AGENT_METADATA = /^\/agents(\/[^/]+)?$/;
409
409
  const AGENT_SUSPENDED_RUNS = /^\/agents\/[^/]+\/suspended-runs$/i;
410
410
  /** Official AI SDK UI stream route, including `resumeData` continuations. */
411
411
  const AGENT_CHAT = /^\/chat\/[^/]+$/i;
412
+ /** Durable run observation for one agent-owned chat stream. */
413
+ const AGENT_CHAT_RUN = /^\/chat\/[^/]+\/runs\/[^/]+$/i;
414
+ /** Explicit cancellation for one durable chat run. */
415
+ const AGENT_CHAT_RUN_ABORT = /^\/chat\/[^/]+\/runs\/[^/]+\/abort$/i;
412
416
  /** Native resource-scoped memory reads used by history and the thread list. */
413
417
  const MEMORY_READ = /^\/memory\/threads(?:\/[^/]+(?:\/messages)?)?$/i;
414
418
  /** Native thread rename/delete routes. */
@@ -438,6 +442,8 @@ export function isMastraRequestAllowed(
438
442
  if (opts.mcpEnabled && (p === "/mcp" || p.startsWith("/mcp/"))) return true;
439
443
  const m = method.toUpperCase();
440
444
  if (m === "POST" && AGENT_CHAT.test(p)) return true;
445
+ if (m === "GET" && AGENT_CHAT_RUN.test(p)) return true;
446
+ if (m === "POST" && AGENT_CHAT_RUN_ABORT.test(p)) return true;
441
447
  if (m === "POST" && AGENT_INFERENCE.test(p)) return true;
442
448
  if (m === "GET" && (AGENT_METADATA.test(p) || AGENT_SUSPENDED_RUNS.test(p))) return true;
443
449
  if (m === "GET" && MEMORY_READ.test(p)) return true;
package/src/workspaces.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  import { createHash } from "node:crypto";
16
16
  import { tmpdir } from "node:os";
17
17
  import { join } from "node:path";
18
- import { ConfigurationError, createWorkspaceClient } from "@databricks/appkit";
18
+ import { ConfigurationError } from "@databricks/appkit";
19
19
  import type { WorkspaceClient } from "@databricks/appkit";
20
20
  import { appkit, pluginRegistry } from "@dbx-tools/appkit";
21
21
  import {
@@ -439,7 +439,7 @@ function resolveWorkspaceSandbox(
439
439
  const client =
440
440
  typeof options.client === "function"
441
441
  ? options.client({ requestContext })
442
- : (options.client ?? createWorkspaceClient());
442
+ : (options.client ?? (user.executionContext.client as WorkspaceClient));
443
443
  const {
444
444
  provider: _provider,
445
445
  sandboxId: _sandboxId,