Agent-Wiz icon indicating copy to clipboard operation
Agent-Wiz copied to clipboard

Add Typescript Support - OpenAI agents sdk

Open Aaditya-G opened this issue 3 months ago • 3 comments

Agent wiz currently extends to python based frameworks, however, a lot of agentic frameworks are available in typescript as well.

We can start with adding OpenAI agents TS sdk support. This would pave way for other TS based frameworks. We may need to create a seperate package to be supported by npm.

Aaditya-G avatar Oct 06 '25 12:10 Aaditya-G

@Aaditya-G hey I would love to pick this for the coming week

Prasannajaga avatar Oct 06 '25 19:10 Prasannajaga

Hi @Prasannajaga We would appreciate if you can go through the code structure and come up with an approach of your own - it seems like your above comment is entirely AI generated.

Thanks.

Aaditya-G avatar Oct 07 '25 05:10 Aaditya-G

Good day @Aaditya-G,

I went through the implemention of the python sdk equivalent of the framework and I came with this plan of using the ts-morph lib for parsing the and extracting ast trees and then getting agents and tools definition with relationships as follows:

  • Setup: Create the agentwiz-ts package, install dependencies, and define core TypeScript interfaces for tools, agents, and graph output.

  • Tool Extraction: Parse CallExpressions with the tool identifier, extract tool names, descriptions, and map variable references to each tool definition.

  • Agent Extraction: Find NewExpressions for Agent, extract agent properties (name, tools, handoffs, model, instructions, description), and track their variable names for later mapping.

  • Relationship Resolution: Link tools to agents via their tools arrays, handle agent handoff mutations (e.g., assignments and pushes), and resolve agent-variable references including circular handoffs.

  • Entry Point Detection: Locate Runner instantiations and .run() method calls, extracting the agent used as the code's entry point.

  • Graph Building: Assemble nodes for agents, tools, Start, and End; build edges for tool usage, handoffs, execution start, and create implicit start/end edges for agents without explicit connections; output full JSON graph.

  • CLI & Integration: Implement a CLI with actions for extraction and graph building

  • Testing: Write example TypeScript agent files, verify JSON graph outputs, and test for complex cases such as circular handoffs, multi-file setups, and missing references.

Let me know if there are any questions about the approach and if I can pick this issue up and start the implementation.

Thanks!

shazm12 avatar Oct 09 '25 18:10 shazm12