@axintai/compiler 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -63,10 +63,10 @@ Axint is the fastest path from an AI coding tool to a shipped App Intent. **One
63
63
  - **Native type fidelity.** `int → Int`, `double → Double`, `float → Float`, `date → Date`, `url → URL`, `duration → Measurement<UnitDuration>`, `optional<T> → T?`. Default values and optionality are preserved end-to-end.
64
64
  - **Return-type-aware `perform()` signatures.** Every generated intent is a drop-in tool for Agent Siri and Shortcuts.
65
65
  - **Info.plist and .entitlements emit.** Axint writes the `NSAppIntentsDomains` plist fragment and the App Intents entitlement XML alongside your `.swift` file. Drop all three into Xcode and ship.
66
- - **MCP-native.** A bundled `axint-mcp` server exposes `axint_scaffold`, `axint_compile`, and `axint_validate` to any MCP client. Your AI coding agent can read your project, draft a TypeScript intent, compile it, and open a PR — without a human touching Xcode.
66
+ - **MCP-native.** A bundled `axint-mcp` server exposes five tools — `axint_scaffold`, `axint_compile`, `axint_validate`, `axint_list_templates`, and `axint_template` to any MCP client. Your AI coding agent can read your project, draft a TypeScript intent, compile it, and open a PR — without a human touching Xcode.
67
67
  - **Rust-grade diagnostics.** 16 diagnostic codes (`AX001`–`AX202`) with fix suggestions and color-coded output.
68
68
  - **Sub-millisecond compile.** A typical intent compiles in under a millisecond. The [axint.ai playground](https://axint.ai/#playground) runs the full compiler in your browser with zero server round-trip.
69
- - **152 tests.** Parser, validator, generator, emit paths, and sandbox — all covered.
69
+ - **155 tests.** Parser, validator, generator, emit paths, watch mode, and sandbox — all covered.
70
70
  - **Apache 2.0, no CLA.** Fork it, extend it, ship it.
71
71
 
72
72
  ---
@@ -120,6 +120,31 @@ ios/Intents/
120
120
 
121
121
  ---
122
122
 
123
+ ## Watch mode
124
+
125
+ For iterative development, `axint watch` recompiles on every save with sub-millisecond rebuilds:
126
+
127
+ ```bash
128
+ # Watch a single file
129
+ axint watch my-intent.ts --out ios/Intents/
130
+
131
+ # Watch a directory of intents
132
+ axint watch ./intents/ --out ios/Intents/ --emit-info-plist --emit-entitlements
133
+
134
+ # With swift-format
135
+ axint watch my-intent.ts --out ios/Intents/ --format
136
+
137
+ # Auto-run swift build after each compile
138
+ axint watch ./intents/ --out ios/Intents/ --swift-build
139
+
140
+ # Specify the Swift project root (defaults to --out parent)
141
+ axint watch ./intents/ --out ios/Sources/Intents/ --swift-build --swift-project ios/
142
+ ```
143
+
144
+ The watcher runs an initial compile pass, then re-triggers on file changes with a 150ms debounce. Errors are reported inline without killing the process — fix the file and it recompiles automatically. With `--swift-build`, each successful compile triggers `swift build` in the project directory so you get immediate feedback on whether the generated Swift compiles cleanly.
145
+
146
+ ---
147
+
123
148
  ## Compiled Swift output
124
149
 
125
150
  ```swift
@@ -183,13 +208,15 @@ Axint ships with `axint-mcp`, a Model Context Protocol server that exposes the c
183
208
  }
184
209
  ```
185
210
 
186
- Three tools are exposed:
211
+ Five tools are exposed:
187
212
 
188
- | Tool | What it does |
189
- | ----------------- | -------------------------------------------------------------------------- |
190
- | `axint_scaffold` | Generates a TypeScript intent from a natural-language description |
191
- | `axint_compile` | Runs the full pipeline and returns `.swift` + `.plist` + `.entitlements` |
192
- | `axint_validate` | Dry-run validation with line/column diagnostics |
213
+ | Tool | What it does |
214
+ | --------------------- | -------------------------------------------------------------------------- |
215
+ | `axint_scaffold` | Generates a TypeScript intent from a natural-language description |
216
+ | `axint_compile` | Runs the full pipeline and returns `.swift` + `.plist` + `.entitlements` |
217
+ | `axint_validate` | Dry-run validation with line/column diagnostics |
218
+ | `axint_list_templates`| Lists all bundled intent templates |
219
+ | `axint_template` | Returns the source of a specific bundled template |
193
220
 
194
221
  Once connected, your AI coding agent can read a Swift project, draft an intent, compile it, and open a PR — without a human touching Xcode.
195
222
 
@@ -272,7 +299,7 @@ axint/
272
299
  │ ├── mcp/ # MCP server (scaffold, compile, validate)
273
300
  │ ├── cli/ # axint CLI (Commander.js)
274
301
  │ └── templates/ # Intent template registry
275
- ├── tests/ # 117 vitest tests
302
+ ├── tests/ # 155 vitest tests
276
303
  ├── examples/ # Example intent definitions
277
304
  └── docs/ # Error reference, contributing, assets
278
305
  ```
@@ -300,10 +327,11 @@ See [`ROADMAP.md`](ROADMAP.md) for the full plan. Highlights:
300
327
  - [x] Info.plist and `.entitlements` emit (v0.2.0)
301
328
  - [x] Return-type-aware `perform()` (v0.2.0)
302
329
  - [x] MCP scaffold tool (v0.2.0)
303
- - [x] 152-test suite with snapshot coverage (v0.2.0)
304
- - [ ] Intent template library (v0.3.0)
305
- - [ ] `--watch` mode for live Swift preview
306
- - [ ] Xcode build plugin
330
+ - [x] 155-test suite with snapshot coverage (v0.2.0+)
331
+ - [x] Intent template library with 12+ templates (v0.3.0)
332
+ - [x] `--watch` mode with `--swift-build` for live recompilation (v0.3.0)
333
+ - [x] SPM build plugin — auto-compile during `swift build` (v0.3.0)
334
+ - [x] Registry at registry.axint.ai (v0.3.0)
307
335
  - [ ] GitHub template repo (`axint-starter`)
308
336
  - [ ] Axint Cloud (hosted compilation)
309
337