Skip to content

Add TypeScript Mastra adapter - #207

Open
Devx228 wants to merge 1 commit into
oracle:mainfrom
Devx228:feat/ts-adapter-mastra
Open

Add TypeScript Mastra adapter#207
Devx228 wants to merge 1 commit into
oracle:mainfrom
Devx228:feat/ts-adapter-mastra

Conversation

@Devx228

@Devx228 Devx228 commented Jun 29, 2026

Copy link
Copy Markdown

Adds initial Mastra adapter support for the TypeScript SDK.
This includes Agent Spec -> Mastra loading, Mastra-style config -> Agent Spec export, model/tool mapping, datastore target mapping for in-memory and Postgres storage, initial linear Flow -> Mastra Workflow conversion, docs, tests, and adapter examples.

Credit: this work was developed with Darsh Patel (@darshpatel1052). The branch is squashed under my OCA verified contributor account for contribution processing.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 29, 2026
@Devx228
Devx228 marked this pull request as ready for review June 29, 2026 08:23
@Devx228
Devx228 requested a review from a team June 29, 2026 08:23
StartNode -> LlmNode/ToolNode/AgentNode... -> EndNode
```

The converter rejects branching, cycles, disconnected nodes, unsupported node

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would mention that also data flow edges are not supported, if I am not mistaken I did not see their translation either

id,
connectionString: connection.url,
user: connection.user,
password: connection.password,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like user and password are ignored by mastra, as they are extracted from the URL. Can you check if that's true? I think you either have to:

  • construct an authenticated URL, e.g. postgresql://user:password@localhost:5432/agentspec (with correct URL escaping), or
  • use Mastra’s host-based configuration form, where username/password are supported fields.

tools[tool.name] = this.runtime.createTool(toolConfig);
}

return this.runtime.createAgent({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could you reject explicitly configurations that are not supported (e.g., human in the loop)? It would be good to see an explicit message saying that it's not supported, here and in the other conversions that are partially supported.

includeModelApiKey?: boolean;
};

export class MastraToAgentSpecConverter {

@cesarebernardis cesarebernardis Jul 9, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about how exactly docstrings work in typescript, but probably worth having minimal ones in public classes and their public methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants