@mastra/code-sdk 0.2.0-alpha.4 → 0.2.0-alpha.9
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/CHANGELOG.md +100 -0
- package/dist/agents/credential-resolver.d.ts +51 -0
- package/dist/agents/credential-resolver.d.ts.map +1 -0
- package/dist/agents/credential-resolver.js +41 -0
- package/dist/agents/credential-resolver.js.map +1 -0
- package/dist/agents/instructions.d.ts.map +1 -1
- package/dist/agents/instructions.js.map +1 -1
- package/dist/agents/mastracode-gateway.d.ts +11 -4
- package/dist/agents/mastracode-gateway.d.ts.map +1 -1
- package/dist/agents/mastracode-gateway.js +51 -30
- package/dist/agents/mastracode-gateway.js.map +1 -1
- package/dist/agents/model.d.ts +2 -0
- package/dist/agents/model.d.ts.map +1 -1
- package/dist/agents/model.js +13 -2
- package/dist/agents/model.js.map +1 -1
- package/dist/agents/workspace.d.ts +11 -1
- package/dist/agents/workspace.d.ts.map +1 -1
- package/dist/agents/workspace.js +31 -13
- package/dist/agents/workspace.js.map +1 -1
- package/dist/auth/authorization-input.d.ts +16 -0
- package/dist/auth/authorization-input.d.ts.map +1 -0
- package/dist/auth/authorization-input.js +28 -0
- package/dist/auth/authorization-input.js.map +1 -0
- package/dist/auth/device-code.d.ts +93 -0
- package/dist/auth/device-code.d.ts.map +1 -0
- package/dist/auth/device-code.js +97 -0
- package/dist/auth/device-code.js.map +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +3 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/providers/anthropic.d.ts +24 -1
- package/dist/auth/providers/anthropic.d.ts.map +1 -1
- package/dist/auth/providers/anthropic.js +21 -8
- package/dist/auth/providers/anthropic.js.map +1 -1
- package/dist/auth/providers/github-copilot.d.ts +54 -0
- package/dist/auth/providers/github-copilot.d.ts.map +1 -1
- package/dist/auth/providers/github-copilot.js +88 -61
- package/dist/auth/providers/github-copilot.js.map +1 -1
- package/dist/auth/providers/openai-codex.d.ts +44 -0
- package/dist/auth/providers/openai-codex.d.ts.map +1 -1
- package/dist/auth/providers/openai-codex.js +79 -69
- package/dist/auth/providers/openai-codex.js.map +1 -1
- package/dist/auth/providers/xai.d.ts +64 -0
- package/dist/auth/providers/xai.d.ts.map +1 -0
- package/dist/auth/providers/xai.js +171 -0
- package/dist/auth/providers/xai.js.map +1 -0
- package/dist/auth/storage.d.ts.map +1 -1
- package/dist/auth/storage.js +5 -2
- package/dist/auth/storage.js.map +1 -1
- package/dist/auth/types.d.ts +21 -0
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/hooks/types.js.map +1 -1
- package/dist/index.d.ts +12 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -35
- package/dist/index.js.map +1 -1
- package/dist/providers/amazon-bedrock-gateway.d.ts +7 -0
- package/dist/providers/amazon-bedrock-gateway.d.ts.map +1 -1
- package/dist/providers/amazon-bedrock-gateway.js +66 -2
- package/dist/providers/amazon-bedrock-gateway.js.map +1 -1
- package/dist/providers/claude-max.d.ts +3 -1
- package/dist/providers/claude-max.d.ts.map +1 -1
- package/dist/providers/claude-max.js +1 -1
- package/dist/providers/claude-max.js.map +1 -1
- package/dist/providers/github-copilot.d.ts +3 -1
- package/dist/providers/github-copilot.d.ts.map +1 -1
- package/dist/providers/github-copilot.js +1 -1
- package/dist/providers/github-copilot.js.map +1 -1
- package/dist/providers/openai-codex.d.ts +3 -1
- package/dist/providers/openai-codex.d.ts.map +1 -1
- package/dist/providers/openai-codex.js +1 -1
- package/dist/providers/openai-codex.js.map +1 -1
- package/dist/providers/xai.d.ts +33 -0
- package/dist/providers/xai.d.ts.map +1 -0
- package/dist/providers/xai.js +63 -0
- package/dist/providers/xai.js.map +1 -0
- package/dist/tools/request-sandbox-access.d.ts.map +1 -1
- package/dist/tools/request-sandbox-access.js.map +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
|
|
2
|
+
import { AuthStorage } from "../auth/storage.js";
|
|
3
|
+
const XAI_PROVIDER_ID = "xai";
|
|
4
|
+
const XAI_BASE_URL = "https://api.x.ai/v1";
|
|
5
|
+
let authStorageInstance = null;
|
|
6
|
+
function getAuthStorage() {
|
|
7
|
+
if (!authStorageInstance) {
|
|
8
|
+
authStorageInstance = new AuthStorage();
|
|
9
|
+
}
|
|
10
|
+
return authStorageInstance;
|
|
11
|
+
}
|
|
12
|
+
function setAuthStorage(storage) {
|
|
13
|
+
authStorageInstance = storage ?? null;
|
|
14
|
+
}
|
|
15
|
+
function buildXAIOAuthFetch(opts = {}) {
|
|
16
|
+
return (async (url, init) => {
|
|
17
|
+
const storage = opts.authStorage ?? getAuthStorage();
|
|
18
|
+
storage.reload();
|
|
19
|
+
const cred = storage.get(XAI_PROVIDER_ID);
|
|
20
|
+
if (!cred || cred.type !== "oauth") {
|
|
21
|
+
throw new Error("Not logged in to xAI. Run /login first.");
|
|
22
|
+
}
|
|
23
|
+
const accessToken = await storage.getApiKey(XAI_PROVIDER_ID);
|
|
24
|
+
if (!accessToken) {
|
|
25
|
+
throw new Error("Failed to refresh xAI token. Please /login again.");
|
|
26
|
+
}
|
|
27
|
+
const headers = new Headers(url instanceof Request ? url.headers : void 0);
|
|
28
|
+
if (init?.headers) {
|
|
29
|
+
new Headers(init.headers).forEach((value, key) => headers.set(key, value));
|
|
30
|
+
}
|
|
31
|
+
headers.delete("authorization");
|
|
32
|
+
headers.delete("x-api-key");
|
|
33
|
+
headers.set("Authorization", `Bearer ${accessToken}`);
|
|
34
|
+
try {
|
|
35
|
+
return await fetch(url, { ...init, headers });
|
|
36
|
+
} catch (error) {
|
|
37
|
+
if (error && typeof error === "object") {
|
|
38
|
+
Object.assign(error, {
|
|
39
|
+
requestUrl: url instanceof URL ? url.toString() : typeof url === "string" ? url : url.url
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function xaiProvider(modelId, options) {
|
|
47
|
+
const provider = createOpenAICompatible({
|
|
48
|
+
name: XAI_PROVIDER_ID,
|
|
49
|
+
baseURL: XAI_BASE_URL,
|
|
50
|
+
apiKey: "oauth-placeholder",
|
|
51
|
+
// real auth injected by the custom fetch
|
|
52
|
+
headers: options?.headers,
|
|
53
|
+
fetch: buildXAIOAuthFetch({ authStorage: options?.authStorage })
|
|
54
|
+
});
|
|
55
|
+
return provider.chatModel(modelId);
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
buildXAIOAuthFetch,
|
|
59
|
+
getAuthStorage,
|
|
60
|
+
setAuthStorage,
|
|
61
|
+
xaiProvider
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=xai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/providers/xai.ts"],"sourcesContent":["/**\n * xAI (Grok) OAuth Provider\n *\n * Uses OAuth tokens from AuthStorage to authenticate with the xAI API.\n * The xAI API speaks an OpenAI-compatible chat format, and the OAuth access\n * token is accepted as a bearer API key, so we plug `@ai-sdk/openai-compatible`\n * into `https://api.x.ai/v1` with a custom fetch that injects the (auto-refreshed)\n * access token.\n */\n\nimport { createOpenAICompatible } from '@ai-sdk/openai-compatible';\nimport type { MastraModelConfig } from '@mastra/core/llm';\nimport { AuthStorage } from '../auth/storage.js';\nimport type { CredentialStore } from '../auth/types.js';\n\nconst XAI_PROVIDER_ID = 'xai';\nconst XAI_BASE_URL = 'https://api.x.ai/v1';\n\n// Singleton auth storage instance (shared with claude-max.ts / github-copilot.ts when not overridden).\nlet authStorageInstance: AuthStorage | null = null;\n\n/** Get or create the shared AuthStorage instance. */\nexport function getAuthStorage(): AuthStorage {\n if (!authStorageInstance) {\n authStorageInstance = new AuthStorage();\n }\n return authStorageInstance;\n}\n\n/** Set a custom AuthStorage instance (useful for tests / TUI integration). */\nexport function setAuthStorage(storage: AuthStorage | undefined): void {\n authStorageInstance = storage ?? null;\n}\n\n/**\n * Build a fetch wrapper that authenticates with xAI OAuth.\n * Injects the access token (auto-refreshed by AuthStorage) as a bearer token,\n * preserving non-auth headers from the caller.\n */\nexport function buildXAIOAuthFetch(opts: { authStorage?: CredentialStore } = {}): typeof fetch {\n return (async (url: string | URL | Request, init?: Parameters<typeof fetch>[1]) => {\n const storage = opts.authStorage ?? getAuthStorage();\n storage.reload();\n\n const cred = storage.get(XAI_PROVIDER_ID);\n if (!cred || cred.type !== 'oauth') {\n throw new Error('Not logged in to xAI. Run /login first.');\n }\n\n // getApiKey() refreshes the access token if it has expired.\n const accessToken = await storage.getApiKey(XAI_PROVIDER_ID);\n if (!accessToken) {\n throw new Error('Failed to refresh xAI token. Please /login again.');\n }\n\n // Preserve existing headers, strip auth-related ones. Explicit init\n // headers override headers carried by an incoming Request.\n const headers = new Headers(url instanceof Request ? url.headers : undefined);\n if (init?.headers) {\n new Headers(init.headers).forEach((value, key) => headers.set(key, value));\n }\n headers.delete('authorization');\n headers.delete('x-api-key');\n\n headers.set('Authorization', `Bearer ${accessToken}`);\n\n try {\n return await fetch(url, { ...init, headers });\n } catch (error) {\n if (error && typeof error === 'object') {\n Object.assign(error as Record<string, unknown>, {\n requestUrl: url instanceof URL ? url.toString() : typeof url === 'string' ? url : (url as Request).url,\n });\n }\n throw error;\n }\n }) as typeof fetch;\n}\n\n/**\n * Creates an xAI model using OAuth authentication.\n * Uses OAuth tokens from AuthStorage (auto-refreshes when needed).\n */\nexport function xaiProvider(\n modelId: string,\n options?: { headers?: Record<string, string>; authStorage?: CredentialStore },\n): MastraModelConfig {\n const provider = createOpenAICompatible({\n name: XAI_PROVIDER_ID,\n baseURL: XAI_BASE_URL,\n apiKey: 'oauth-placeholder', // real auth injected by the custom fetch\n headers: options?.headers,\n fetch: buildXAIOAuthFetch({ authStorage: options?.authStorage }),\n });\n return provider.chatModel(model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AAA,EACF;AACF;AAMO,SAAS,YACd,SACA,SACmB;AACnB,QAAM,WAAW,uBAAuB;AAAA,IACtC,MAAM;AAAA,IACN,SAAS;AAAA,IACT,QAAQ;AAAA;AAAA,IACR,SAAS,SAAS;AAAA,IAClB,OAAO,mBAAmB,EAAE,aAAa,SAAS,YAAY,CAAC;AAAA,EACjE,CAAC;AACD,SAAO,SAAS,UAAU,OAAO;AACnC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-sandbox-access.d.ts","sourceRoot":"","sources":["../../src/tools/request-sandbox-access.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"request-sandbox-access.d.ts","sourceRoot":"","sources":["../../src/tools/request-sandbox-access.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH,eAAO,MAAM,wBAAwB,sKA4F5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/tools/request-sandbox-access.ts"],"sourcesContent":["/**\n * request_access tool — requests permission to access a directory outside the project root.\n * The user can approve or deny the request via TUI dialog.\n */\n\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport type { AgentControllerRequestContext } from '@mastra/core/agent-controller';\nimport { createTool } from '@mastra/core/tools';\nimport { LocalFilesystem } from '@mastra/core/workspace';\nimport { z } from 'zod';\nimport type { MastraCodeState } from '../schema.js';\nimport { isPathAllowed, getAllowedPathsFromContext } from './utils.js';\n\nfunction expandTilde(p: string): string {\n if (p === '~') return os.homedir();\n if (p.startsWith('~/') || p.startsWith('~\\\\')) return path.join(os.homedir(), p.slice(2));\n return p;\n}\n\ntype RequestSandboxAccessInput = {\n path: string;\n reason: string;\n};\n\nconst requestSandboxAccessInputSchema = z.object({\n path: z.string().min(1).describe('The absolute path to the directory you need access to.'),\n reason: z.string().min(1).describe('Brief explanation of why you need access to this directory.'),\n});\n\nexport const requestSandboxAccessTool = createTool({\n id: 'request_access',\n description: `Request permission to access a directory outside the current project. Use this when you need to read or write files in a directory that is not within the project root. The user will be prompted to approve or deny the request.`,\n inputSchema: requestSandboxAccessInputSchema,\n suspendSchema: z.object({\n kind: z.literal('sandbox_access_request'),\n path: z.string(),\n reason: z.string(),\n }),\n resumeSchema: z.union([z.string(), z.array(z.string())]),\n execute: async ({ path: requestedPath, reason }: RequestSandboxAccessInput, context: any) => {\n try {\n const agentControllerCtx = context?.requestContext?.get('controller') as\n
|
|
1
|
+
{"version":3,"sources":["../../src/tools/request-sandbox-access.ts"],"sourcesContent":["/**\n * request_access tool — requests permission to access a directory outside the project root.\n * The user can approve or deny the request via TUI dialog.\n */\n\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport type { AgentControllerRequestContext } from '@mastra/core/agent-controller';\nimport { createTool } from '@mastra/core/tools';\nimport { LocalFilesystem } from '@mastra/core/workspace';\nimport { z } from 'zod';\nimport type { MastraCodeState } from '../schema.js';\nimport { isPathAllowed, getAllowedPathsFromContext } from './utils.js';\n\nfunction expandTilde(p: string): string {\n if (p === '~') return os.homedir();\n if (p.startsWith('~/') || p.startsWith('~\\\\')) return path.join(os.homedir(), p.slice(2));\n return p;\n}\n\ntype RequestSandboxAccessInput = {\n path: string;\n reason: string;\n};\n\nconst requestSandboxAccessInputSchema = z.object({\n path: z.string().min(1).describe('The absolute path to the directory you need access to.'),\n reason: z.string().min(1).describe('Brief explanation of why you need access to this directory.'),\n});\n\nexport const requestSandboxAccessTool = createTool({\n id: 'request_access',\n description: `Request permission to access a directory outside the current project. Use this when you need to read or write files in a directory that is not within the project root. The user will be prompted to approve or deny the request.`,\n inputSchema: requestSandboxAccessInputSchema,\n suspendSchema: z.object({\n kind: z.literal('sandbox_access_request'),\n path: z.string(),\n reason: z.string(),\n }),\n resumeSchema: z.union([z.string(), z.array(z.string())]),\n execute: async ({ path: requestedPath, reason }: RequestSandboxAccessInput, context: any) => {\n try {\n const agentControllerCtx = context?.requestContext?.get('controller') as\n AgentControllerRequestContext<MastraCodeState> | undefined;\n\n // Resolve to absolute path (expand ~ first since Node path APIs don't handle it)\n const expanded = expandTilde(requestedPath);\n const absolutePath = path.isAbsolute(expanded) ? expanded : path.resolve(process.cwd(), expanded);\n\n // Check if already allowed\n const projectRoot = process.cwd();\n const allowedPaths = getAllowedPathsFromContext(context);\n if (isPathAllowed(absolutePath, projectRoot, allowedPaths)) {\n return {\n content: `Access already granted: \"${absolutePath}\" is within the project root or allowed paths.`,\n isError: false,\n };\n }\n\n const suspend = context?.agent?.suspend ?? context?.suspend;\n const resumeData = context?.agent?.resumeData ?? context?.resumeData;\n\n // First pass: pause via the native tool-suspension primitive so the host can\n // prompt the user. The suspend payload carries the request details; the host\n // resumes with the user's answer as resume data.\n if (resumeData === undefined) {\n if (!suspend) {\n return {\n content: `Cannot request sandbox access: interactive context not available. The user should manually run /sandbox add ${absolutePath}`,\n isError: true,\n };\n }\n await suspend({ kind: 'sandbox_access_request', path: absolutePath, reason });\n return;\n }\n\n const answerText = Array.isArray(resumeData) ? resumeData.join(', ') : String(resumeData);\n const approved = answerText.toLowerCase().startsWith('y') || answerText.toLowerCase() === 'approve';\n if (approved) {\n // Persist to controller state first (and await it) so the value is\n // committed before the next tool call re-derives the workspace's\n // allowed paths from state. The workspace factory rebuilds the\n // filesystem allowlist from `sandboxAllowedPaths` on every call\n // (getDynamicWorkspace), so an unawaited setState would let that\n // rebuild clobber the in-turn widen below before the grant lands.\n const controllerState = agentControllerCtx?.getState();\n const currentAllowed = (controllerState?.sandboxAllowedPaths as string[] | undefined) ?? [];\n const nextAllowed = currentAllowed.includes(absolutePath) ? currentAllowed : [...currentAllowed, absolutePath];\n if (!currentAllowed.includes(absolutePath)) {\n await agentControllerCtx?.setState({\n sandboxAllowedPaths: nextAllowed,\n });\n }\n\n // Also update the live workspace filesystem immediately so tools in\n // the same turn (e.g. `view`) can access the path without waiting for\n // a fresh workspace build. The resolved workspace is carried on the\n // controller request context — the tool-execution context does not expose\n // it — so read the filesystem from there.\n const fs = agentControllerCtx?.workspace?.filesystem ?? context?.workspace?.filesystem;\n if (fs instanceof LocalFilesystem) {\n fs.setAllowedPaths((prev: readonly string[]) => [...prev, absolutePath]);\n }\n\n return {\n content: `Access granted: \"${absolutePath}\" has been added to allowed paths. You can now access files in this directory.`,\n isError: false,\n };\n } else {\n return {\n content: `Access denied: The user declined access to \"${absolutePath}\".`,\n isError: false,\n };\n }\n } catch (error) {\n const msg = error instanceof Error ? error.message : 'Unknown error';\n return {\n content: `Failed to request sandbox access: ${msg}`,\n isError: true,\n };\n }\n },\n} as any);\n"],"mappings":"AAKA,YAAY,QAAQ;AACpB,YAAY,UAAU;AAEtB,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,SAAS;AAElB,SAAS,eAAe,kCAAkC;AAE1D,SAAS,YAAY,GAAmB;AACtC,MAAI,MAAM,IAAK,QAAO,GAAG,QAAQ;AACjC,MAAI,EAAE,WAAW,IAAI,KAAK,EAAE,WAAW,KAAK,EAAG,QAAO,KAAK,KAAK,GAAG,QAAQ,GAAG,EAAE,MAAM,CAAC,CAAC;AACxF,SAAO;AACT;AAOA,MAAM,kCAAkC,EAAE,OAAO;AAAA,EAC/C,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,wDAAwD;AAAA,EACzF,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,6DAA6D;AAClG,CAAC;AAEM,MAAM,2BAA2B,WAAW;AAAA,EACjD,IAAI;AAAA,EACJ,aAAa;AAAA,EACb,aAAa;AAAA,EACb,eAAe,EAAE,OAAO;AAAA,IACtB,MAAM,EAAE,QAAQ,wBAAwB;AAAA,IACxC,MAAM,EAAE,OAAO;AAAA,IACf,QAAQ,EAAE,OAAO;AAAA,EACnB,CAAC;AAAA,EACD,cAAc,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAAA,EACvD,SAA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cAAc,iBAAiB;AACjC,aAAG,gBAAgB,CAAC,SAA4B,CAAC,GAAG,MAAM,YAAY,CAAC;AAAA,QACzE;AAEA,eAAO;AAAA,UACL,SAAS,oBAAoB,YAAY;AAAA,UACzC,SAAS;AAAA,QACX;AAAA,MACF,OAAO;AACL,eAAO;AAAA,UACL,SAAS,+CAA+C,YAAY;AAAA,UACpE,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF,SAAS,OAAO;AACd,YAAM,MAAM,iBAAiB,QAAQ,MAAM,UAAU;AACrD,aAAO;AAAA,QACL,SAAS,qCAAqC,GAAG;AAAA,QACjD,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF,CAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/code-sdk",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.9",
|
|
4
4
|
"description": "Mastra Code SDK: the agent core behind Mastra Code (everything except the TUI) — build your own UIs and surfaces on top of it",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@ai-sdk/openai-compatible": "^2.0.59",
|
|
48
48
|
"@ast-grep/napi": "^0.42.0",
|
|
49
49
|
"@aws-sdk/credential-providers": "^3.864.0",
|
|
50
|
-
"ai": "^6.0.
|
|
50
|
+
"ai": "^6.0.225",
|
|
51
51
|
"execa": "^9.6.1",
|
|
52
52
|
"libsql": "^0.5.29",
|
|
53
53
|
"posthog-node": "^5.37.0",
|
|
@@ -57,25 +57,25 @@
|
|
|
57
57
|
"yaml": "^2.7.1",
|
|
58
58
|
"zod": "^4.3.6",
|
|
59
59
|
"@mastra/agent-browser": "0.4.1",
|
|
60
|
-
"@mastra/github-signals": "0.2.2",
|
|
61
60
|
"@mastra/fastembed": "1.2.0",
|
|
62
|
-
"@mastra/libsql": "1.16.0",
|
|
63
61
|
"@mastra/duckdb": "1.5.1",
|
|
62
|
+
"@mastra/github-signals": "0.2.2",
|
|
63
|
+
"@mastra/libsql": "1.17.0-alpha.1",
|
|
64
|
+
"@mastra/memory": "1.23.1-alpha.1",
|
|
64
65
|
"@mastra/mcp": "1.15.0-alpha.0",
|
|
65
|
-
"@mastra/
|
|
66
|
-
"@mastra/core": "1.52.0-alpha.4",
|
|
67
|
-
"@mastra/observability": "1.16.1",
|
|
66
|
+
"@mastra/pg": "1.17.0-alpha.1",
|
|
68
67
|
"@mastra/schema-compat": "1.3.4",
|
|
69
|
-
"@mastra/pg": "1.16.1-alpha.0",
|
|
70
68
|
"@mastra/stagehand": "0.3.1-alpha.0",
|
|
71
|
-
"@mastra/
|
|
69
|
+
"@mastra/core": "1.52.0-alpha.9",
|
|
70
|
+
"@mastra/tavily": "1.1.1-alpha.0",
|
|
71
|
+
"@mastra/observability": "1.16.2-alpha.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@libsql/client": "^0.17.4",
|
|
75
75
|
"@types/node": "22.20.1",
|
|
76
|
-
"eslint": "^10.
|
|
76
|
+
"eslint": "^10.7.0",
|
|
77
77
|
"tsup": "^8.5.1",
|
|
78
|
-
"tsx": "^4.
|
|
78
|
+
"tsx": "^4.23.1",
|
|
79
79
|
"typescript": "^6.0.3",
|
|
80
80
|
"typescript-eslint": "^8.57.0",
|
|
81
81
|
"vitest": "4.1.10",
|