Developing with TypeScript
Assets for the Script Development Model can be written in TypeScript as well as in JavaScript (JSSP).
The mechanism of writing function containers in TypeScript and running them after converting them to JSSP JavaScript with the tssp CLI is called tssp.
This page explains how things differ from the previous pages when you choose TypeScript when creating a project.
The mechanisms of skill sets and hooks, and the approach to the AI-native development workflow, are the same as for JavaScript.
tssp is available on iAP 2026 Autumn or later.
For projects for iAP 2026 Spring or earlier, do not choose TypeScript; develop in JavaScript (JSSP) instead.
What Is tssp?
tssp is a CLI that converts intra-mart SSJS written in TypeScript into JSSP JavaScript that Rhino 1.7.15.1 (the SSJS execution engine of intra-mart) can run.
Running bun run tssp:build (or bun run tssp:dev during development) performs type checking, linting for Rhino, conversion to JavaScript, and copying of .html files.
Creating a Project
If you answer No to "Use JavaScript instead of TypeScript?" in the Accel CLI init command, a project for TypeScript is created.
For the steps to create a project, see Creating a New Project.
In a project for TypeScript, the following files differ from those in a project for JavaScript.
| File | Contents in a project for TypeScript |
|---|---|
Instruction files for the AI agent (CLAUDE.md, copilot-instructions.md, AGENTS.md) | Instruction files for TypeScript are deployed. They state that .ts and .html files are placed under src/main/tssp/src, that bun run tssp:dev must succeed before reporting completion, that the skills for tssp are used, and that the other jssp-* skills and rules are applied to TypeScript |
| Rules files | The TypeScript rules file tssp-typescript.md is added. For details, see Rules Files |
| Skills | TypeScript versions are deployed in place of some skills. For details, see Differences in Skill Sets |
package.json | tssp:dev and tssp:build are added to scripts, and @intra-mart/tssp is added to devDependencies |
src/main/tssp/tsconfig.json | Settings for type checking the .ts files under src/main/tssp/src in the editor. bun run tssp:build does not read this file; it type checks with the settings bundled with tssp |
The src/main/tssp directory is included in the template, but the src directory under it is not. Create src/main/tssp/src when you place your first .ts file.
File Placement
Place .ts and .html files under src/main/tssp/src. Place a .ts file and its paired .html file in the same directory with the same name.
bun run tssp:build writes its output under src/main/jssp/src, keeping the directory structure. .ts files are converted to .js, and .html files are copied as is.
| Input file | Output file |
|---|---|
src/main/tssp/src/sample/hello.ts | src/main/jssp/src/sample/hello.js |
src/main/tssp/src/sample/hello.html | src/main/jssp/src/sample/hello.html |
Files under src/main/jssp/src are written by tssp, so do not create or edit them by hand.
To make a fix, correct the .ts file under src/main/tssp/src and build again.
bun run tssp:build outputs only .js and .html files. Place files that bun run tssp:build does not output, such as 2WaySQL .sql files, directly in the same location as for JSSP (under src/main/jssp/src).
Differences in Skill Sets
In a project for TypeScript, TypeScript versions are deployed in place of the following three skills described in Skill Sets.
In addition, tssp-usage, which summarizes how to use tssp, is added.
| For JavaScript | For TypeScript | Purpose |
|---|---|---|
jssp-page-generator | tssp-page-generator | Generate new business screens (.html + .ts) and routing XML |
jssp-page-verifier | tssp-page-verifier | Verification of generated screens. Runs bun run tssp:dev and verifies the build output |
jssp-code-review | tssp-code-review | Automated code review. Adds checks of types and of attempts to bypass type checking |
| (none) | tssp-usage | Where to place .ts / .html files, the processing order of bun run tssp:build, type checking, what the lint for Rhino prohibits, and how to resolve output conflicts |
The skills other than those above are the same as in a project for JavaScript.
For tasks that have no tssp skill, the AI agent rewrites the JavaScript code examples shown by the jssp-* skills into TypeScript.
Rules Files
The rules files are the same jssp-*.md files as in a project for JavaScript, plus the following one.
| File | Key points |
|---|---|
tssp-typescript.md | Defines what changes in how you write code when applying the rules in jssp-*.md to .ts files (type annotations, interface, and the types in d.ts) |
The rules in jssp-*.md also apply to the .ts and .html files under src/main/tssp/src.
Hooks
The hooks settings are the same as in a project for JavaScript.
AI-native Development Workflow
Conversion with bun run tssp:build is added to the basic flow of the AI-native development workflow.
- When you instruct the AI agent, the artifacts are generated under
src/main/tssp/src - Convert them into
src/main/jssp/srcwithbun run tssp:dev(tssp-page-generatorbuilds and verifies withtssp-page-verifierafter generation) - Deploy the artifacts to the intra-mart verification environment and confirm they work
- If there are issues, fix the
.tsfile undersrc/main/tssp/srcand build again
Run the following commands in the project root. tssp is installed when the project is created. If you use npm, read bun run as npm run.
| Command | Output | Use |
|---|---|---|
bun run tssp:dev | .js (not minified) and .js.map | Checking and debugging during development |
bun run tssp:build | Minified .js. No source maps are output | Production |
Build Failures
bun run tssp:build processes in the order of type checking, linting, conversion, conflict checking, and writing.
If it fails at any point before writing, it exits without writing anything.
| Failure | How to fix |
|---|---|
| Type error | There is an API that is not in the d.ts files, or a call that does not match the types. Include the error message in your prompt and ask the AI agent to fix it |
| Lint violation | There is code that Rhino does not accept (class, async, default parameters, and so on). Include the error message in your prompt and ask the AI agent to fix it |
| Conflict | The output location contains a file that tssp did not write. If it is tssp output, delete it and run again; if it is a hand-written file, rename the .ts or .html file |
Debugging
Using the .js.map output with --dev, you can set breakpoints in the original .ts file in the debugger.
Coding Constraints
Because the JavaScript generated by tssp runs on Rhino, there are the following constraints on how you write TypeScript.
For details, see the tssp-usage skill deployed in the project.
- Write bind variables as
export let $data = ...and the entry point asexport function init(request: Request): void - Read only types from other
.tsfiles withimport type. Load common modules used at run time withload(), as in JSSP - Code that Rhino does not accept, such as
class,async, and default parameters, is reported as an error by the lint - Using an API that is not in the d.ts files stops the build at type checking