@dbx-tools/appkit-mastra 0.4.1 → 0.5.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.
package/src/agents.ts CHANGED
@@ -26,14 +26,14 @@ import { createTool } from "@mastra/core/tools";
26
26
  import type { Workspace } from "@mastra/core/workspace";
27
27
  import type { PgVectorConfig, PostgresStoreConfig } from "@mastra/pg";
28
28
 
29
- import { buildRenderDataTool } from "./chart";
30
- import type { MastraPluginConfig } from "./config";
31
- import { buildGenieToolkitProvider, resolveGenieSpaces } from "./genie";
32
- import type { MemoryBuilder } from "./memory";
33
- import { buildModel } from "./model";
34
- import { ResultProcessor, stripStaleChartsProcessor } from "./processors";
35
- import { buildSummarizeTool } from "./summarize";
36
- import { createWorkspace } from "./workspaces";
29
+ import { buildRenderDataTool } from "./chart.ts";
30
+ import type { MastraPluginConfig } from "./config.ts";
31
+ import { buildGenieToolkitProvider, resolveGenieSpaces } from "./genie.ts";
32
+ import type { MemoryBuilder } from "./memory.ts";
33
+ import { buildModel } from "./model.ts";
34
+ import { ResultProcessor, stripStaleChartsProcessor } from "./processors.ts";
35
+ import { buildSummarizeTool } from "./summarize.ts";
36
+ import { createWorkspace } from "./workspaces.ts";
37
37
 
38
38
  /**
39
39
  * Tool record accepted by every Mastra `Agent.tools` field and by the
package/src/chart.ts CHANGED
@@ -36,8 +36,8 @@ import type { RequestContext } from "@mastra/core/request-context";
36
36
  import { createTool } from "@mastra/core/tools";
37
37
  import { z } from "zod";
38
38
 
39
- import { resolveUserKey, type MastraPluginConfig } from "./config";
40
- import { buildModel } from "./model";
39
+ import { resolveUserKey, type MastraPluginConfig } from "./config.ts";
40
+ import { buildModel } from "./model.ts";
41
41
 
42
42
  const logger = log.logger("mastra/chart");
43
43
 
package/src/config.ts CHANGED
@@ -22,8 +22,8 @@ import type { RequestContext } from "@mastra/core/request-context";
22
22
  import { MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY } from "@mastra/core/request-context";
23
23
  import type { PgVectorConfig, PostgresStoreConfig } from "@mastra/pg";
24
24
 
25
- import type { MastraAgentDefinition, MastraTools } from "./agents";
26
- import type { GenieSpacesConfig } from "./genie";
25
+ import type { MastraAgentDefinition, MastraTools } from "./agents.ts";
26
+ import type { GenieSpacesConfig } from "./genie.ts";
27
27
 
28
28
  /**
29
29
  * `RequestContext` key under which {@link MastraServer} stores the
package/src/genie.ts CHANGED
@@ -54,12 +54,12 @@ import { MASTRA_THREAD_ID_KEY } from "@mastra/core/request-context";
54
54
  import { createTool } from "@mastra/core/tools";
55
55
  import { z } from "zod";
56
56
 
57
- import type { MastraTools } from "./agents";
58
- import { chartPlannerRequestSchema, prepareChart } from "./chart";
59
- import { MASTRA_USER_KEY, resolveUserKey } from "./config";
60
- import type { MastraPluginConfig, User } from "./config";
61
- import { fetchStatementData } from "./statement";
62
- import { safeWrite } from "./writer";
57
+ import type { MastraTools } from "./agents.ts";
58
+ import { chartPlannerRequestSchema, prepareChart } from "./chart.ts";
59
+ import { MASTRA_USER_KEY, resolveUserKey } from "./config.ts";
60
+ import type { MastraPluginConfig, User } from "./config.ts";
61
+ import { fetchStatementData } from "./statement.ts";
62
+ import { safeWrite } from "./writer.ts";
63
63
 
64
64
  const logger = log.logger("mastra/genie");
65
65
 
package/src/history.ts CHANGED
@@ -32,7 +32,7 @@ import { MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY } from "@mastra/core/reque
32
32
  import type { ContextWithMastra } from "@mastra/core/server";
33
33
  import { registerApiRoute } from "@mastra/core/server";
34
34
 
35
- import { clampPerPage, parseIntParam } from "./pagination";
35
+ import { clampPerPage, parseIntParam } from "./pagination.ts";
36
36
 
37
37
  const logger = log.logger("mastra/history");
38
38
 
package/src/mcp.ts CHANGED
@@ -15,8 +15,8 @@
15
15
  import type { Agent } from "@mastra/core/agent";
16
16
  import { MCPServer } from "@mastra/mcp";
17
17
 
18
- import type { MastraTools } from "./agents";
19
- import type { MastraMcpConfig, MastraPluginConfig } from "./config";
18
+ import type { MastraTools } from "./agents.ts";
19
+ import type { MastraMcpConfig, MastraPluginConfig } from "./config.ts";
20
20
 
21
21
  /** MCP server version advertised when the caller doesn't pin one. */
22
22
  const DEFAULT_MCP_VERSION = "1.0.0";
package/src/memory.ts CHANGED
@@ -36,10 +36,10 @@ import { Memory } from "@mastra/memory";
36
36
  import { PgVector, PostgresStore } from "@mastra/pg";
37
37
  import { Pool, type PoolConfig } from "pg";
38
38
 
39
- import type { MastraAgentDefinition, MastraMemoryConfigOverride } from "./agents";
40
- import type { MastraPluginConfig } from "./config";
41
- import { agentStorageSchemaName } from "./storage-schema";
42
- import { summaryModel, TITLE_INSTRUCTIONS } from "./summarize";
39
+ import type { MastraAgentDefinition, MastraMemoryConfigOverride } from "./agents.ts";
40
+ import type { MastraPluginConfig } from "./config.ts";
41
+ import { agentStorageSchemaName } from "./storage-schema.ts";
42
+ import { summaryModel, TITLE_INSTRUCTIONS } from "./summarize.ts";
43
43
 
44
44
  const logger = log.logger("mastra/memory");
45
45
 
package/src/mlflow.ts CHANGED
@@ -22,7 +22,7 @@
22
22
  import { appkit } from "@dbx-tools/appkit";
23
23
  import { async, error, log } from "@dbx-tools/shared-core";
24
24
  import { feedback } from "@dbx-tools/shared-mastra";
25
- import { databricksFetch, readResponseJson, readResponseText } from "./rest";
25
+ import { databricksFetch, readResponseJson, readResponseText } from "./rest.ts";
26
26
 
27
27
  const logger = log.logger("mastra/mlflow");
28
28
 
package/src/model.ts CHANGED
@@ -30,9 +30,9 @@ import { model } from "@dbx-tools/shared-model";
30
30
  import type { MastraModelConfig } from "@mastra/core/llm";
31
31
  import type { RequestContext } from "@mastra/core/request-context";
32
32
 
33
- import { MASTRA_USER_KEY, type MastraPluginConfig, type User } from "./config";
34
- import { MASTRA_MODEL_OVERRIDE_KEY, resolveServingConfig } from "./serving";
35
- import { rewriteServingBody, rewriteServingResponseBody } from "./serving-sanitize";
33
+ import { MASTRA_USER_KEY, type MastraPluginConfig, type User } from "./config.ts";
34
+ import { rewriteServingBody, rewriteServingResponseBody } from "./serving-sanitize.ts";
35
+ import { MASTRA_MODEL_OVERRIDE_KEY, resolveServingConfig } from "./serving.ts";
36
36
 
37
37
  type ModelClass = model.ModelClass;
38
38
  const { parseModelClass } = classes;
@@ -38,7 +38,7 @@ import { log } from "@dbx-tools/shared-core";
38
38
  import { Observability } from "@mastra/observability";
39
39
  import { OtelBridge } from "@mastra/otel-bridge";
40
40
 
41
- import { TRACE_REQUEST_CONTEXT_KEYS } from "./config";
41
+ import { TRACE_REQUEST_CONTEXT_KEYS } from "./config.ts";
42
42
 
43
43
  const logger = log.logger("mastra/observability");
44
44
 
package/src/plugin.ts CHANGED
@@ -74,32 +74,32 @@ import type { RequestContext } from "@mastra/core/request-context";
74
74
  import express from "express";
75
75
  import type { Pool } from "pg";
76
76
 
77
- import { buildAgents, FALLBACK_AGENT_ID, type BuiltAgents } from "./agents";
78
- import { fetchChart } from "./chart";
79
- import { MASTRA_CONFIG_SCHEMA, resolveUserKey, type MastraPluginConfig } from "./config";
77
+ import { buildAgents, FALLBACK_AGENT_ID, type BuiltAgents } from "./agents.ts";
78
+ import { fetchChart } from "./chart.ts";
79
+ import { MASTRA_CONFIG_SCHEMA, resolveUserKey, type MastraPluginConfig } from "./config.ts";
80
80
  import {
81
81
  chartFetchDefaults,
82
82
  feedbackWriteDefaults,
83
83
  genieSuggestionDefaults,
84
84
  modelCatalogueDefaults,
85
85
  statementDataDefaults,
86
- } from "./defaults";
87
- import { collectSpaceSuggestions, resolveGenieSpaces } from "./genie";
88
- import { historyRoute } from "./history";
89
- import { buildMcpServer, type ResolvedMcp } from "./mcp";
90
- import { createMemoryBuilder, createServicePrincipalPool, needsLakebase } from "./memory";
91
- import { logFeedback, resolveFeedbackEnabled } from "./mlflow";
92
- import { buildObservability } from "./observability";
86
+ } from "./defaults.ts";
87
+ import { collectSpaceSuggestions, resolveGenieSpaces } from "./genie.ts";
88
+ import { historyRoute } from "./history.ts";
89
+ import { buildMcpServer, type ResolvedMcp } from "./mcp.ts";
90
+ import { createMemoryBuilder, createServicePrincipalPool, needsLakebase } from "./memory.ts";
91
+ import { logFeedback, resolveFeedbackEnabled } from "./mlflow.ts";
92
+ import { buildObservability } from "./observability.ts";
93
93
  import {
94
94
  attachRoutePatchMiddleware,
95
95
  createRequestContext,
96
96
  isMastraRequestAllowed,
97
97
  MastraServer,
98
- } from "./server";
99
- import { resolveServingConfig } from "./serving";
100
- import { fetchStatementData, STATEMENT_ROW_CAP } from "./statement";
101
- import { threadsRoute } from "./threads";
102
- import { invalidFields } from "./validation";
98
+ } from "./server.ts";
99
+ import { resolveServingConfig } from "./serving.ts";
100
+ import { fetchStatementData, STATEMENT_ROW_CAP } from "./statement.ts";
101
+ import { threadsRoute } from "./threads.ts";
102
+ import { invalidFields } from "./validation.ts";
103
103
 
104
104
  const GENIE_MANIFEST = plugin.data(genie).plugin.manifest;
105
105
  const LAKEBASE_MANIFEST = plugin.data(lakebase).plugin.manifest;
package/src/server.ts CHANGED
@@ -28,10 +28,14 @@ import {
28
28
  MASTRA_USER_NAME_KEY,
29
29
  type MastraPluginConfig,
30
30
  type User,
31
- } from "./config";
32
- import { resolveFeedbackEnabled } from "./mlflow";
31
+ } from "./config.ts";
32
+ import { resolveFeedbackEnabled } from "./mlflow.ts";
33
33
 
34
- import { extractModelOverride, MASTRA_MODEL_OVERRIDE_KEY, resolveServingConfig } from "./serving";
34
+ import {
35
+ extractModelOverride,
36
+ MASTRA_MODEL_OVERRIDE_KEY,
37
+ resolveServingConfig,
38
+ } from "./serving.ts";
35
39
  /**
36
40
  * OpenTelemetry's sentinel for "no valid trace" - 32 zero hex chars.
37
41
  * `trace.getActiveSpan()` returns a non-recording span with this id
package/src/serving.ts CHANGED
@@ -15,7 +15,7 @@ import { serving as nodeServing } from "@dbx-tools/model";
15
15
  import { string } from "@dbx-tools/shared-core";
16
16
  import { override } from "@dbx-tools/shared-mastra";
17
17
 
18
- import type { MastraPluginConfig } from "./config";
18
+ import type { MastraPluginConfig } from "./config.ts";
19
19
 
20
20
  /**
21
21
  * `RequestContext` key under which {@link MastraServer} stores the
package/src/summarize.ts CHANGED
@@ -27,8 +27,8 @@ import type { RequestContext } from "@mastra/core/request-context";
27
27
  import { createTool } from "@mastra/core/tools";
28
28
  import { z } from "zod";
29
29
 
30
- import type { MastraPluginConfig } from "./config";
31
- import { buildModel } from "./model";
30
+ import type { MastraPluginConfig } from "./config.ts";
31
+ import { buildModel } from "./model.ts";
32
32
 
33
33
  /** Fast / small chat tier used for both titling and summaries. */
34
34
  const SUMMARY_MODEL_CLASS = model.ModelClass.ChatFast;
package/src/threads.ts CHANGED
@@ -36,8 +36,8 @@ import { MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY } from "@mastra/core/reque
36
36
  import type { ContextWithMastra } from "@mastra/core/server";
37
37
  import { registerApiRoute } from "@mastra/core/server";
38
38
 
39
- import { clampPerPage, parseIntParam } from "./pagination";
40
- import { invalidFields } from "./validation";
39
+ import { clampPerPage, parseIntParam } from "./pagination.ts";
40
+ import { invalidFields } from "./validation.ts";
41
41
 
42
42
  const logger = log.logger("mastra/threads");
43
43
 
package/src/workspaces.ts CHANGED
@@ -21,8 +21,8 @@ import {
21
21
  type WorkspaceFilesystem,
22
22
  } from "@mastra/core/workspace";
23
23
 
24
- import { MASTRA_SCOPES_KEY, MASTRA_USER_EMAIL_KEY, MASTRA_USER_KEY, type User } from "./config";
25
- import { DatabricksWorkspaceFilesystem, emptyFilesystem } from "./filesystems";
24
+ import { MASTRA_SCOPES_KEY, MASTRA_USER_EMAIL_KEY, MASTRA_USER_KEY, type User } from "./config.ts";
25
+ import { DatabricksWorkspaceFilesystem, emptyFilesystem } from "./filesystems.ts";
26
26
 
27
27
  /* ------------------------------ constants ------------------------------ */
28
28