@axintai/compiler 0.2.1 → 0.3.1

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
@@ -14,10 +14,11 @@
14
14
  </p>
15
15
 
16
16
  <p align="center">
17
- <a href="https://www.npmjs.com/package/axint"><img src="https://img.shields.io/npm/v/axint?color=f05138&label=npm" alt="npm" /></a>
17
+ <a href="https://www.npmjs.com/package/@axintai/compiler"><img src="https://img.shields.io/npm/v/@axintai/compiler?color=f05138&label=npm" alt="npm" /></a>
18
18
  <a href="https://github.com/agenticempire/axint/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="License" /></a>
19
- <a href="https://github.com/agenticempire/axint/actions"><img src="https://img.shields.io/badge/tests-124%20passing-brightgreen" alt="Tests" /></a>
19
+ <a href="https://github.com/agenticempire/axint/actions/workflows/ci.yml"><img src="https://github.com/agenticempire/axint/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
20
20
  <a href="https://axint.ai"><img src="https://img.shields.io/badge/playground-axint.ai-7c3aed" alt="Playground" /></a>
21
+ <a href="https://axint.ai/wwdc"><img src="https://img.shields.io/badge/WWDC%202026-60%20days-f05138" alt="WWDC 2026" /></a>
21
22
  </p>
22
23
 
23
24
  <p align="center">
@@ -32,7 +33,7 @@
32
33
 
33
34
  ## The picks and shovels of Agent Siri
34
35
 
35
- WWDC 2026 is weeks away. Apple is fusing **Model Context Protocol with App Intents** on iOS 26.1 and macOS Tahoe 26.1Agent Siri runs a 3B-parameter on-device model that invokes App Intents as tools. Every App Intent you ship today automatically becomes an MCP-addressable capability tomorrow.
36
+ WWDC 2026 is weeks away. Apple is expanding **App Intents as the universal action layer** across iOS 26, macOS Tahoe, and Apple Intelligence every App Intent you ship becomes a capability that Siri, Shortcuts, Spotlight, and on-device AI agents can invoke. The surface area is growing fast.
36
37
 
37
38
  Axint is the fastest path from an AI coding tool to a shipped App Intent. **One TypeScript definition. Two agent surfaces. Zero Swift required.**
38
39
 
@@ -56,16 +57,16 @@ Axint is the fastest path from an AI coding tool to a shipped App Intent. **One
56
57
 
57
58
  ---
58
59
 
59
- ## Why Axint v0.2.0
60
+ ## Why Axint
60
61
 
61
62
  - **Real TypeScript AST parser.** Not regex. Uses the TypeScript compiler API, same as `tsc`, so you get full type fidelity and proper diagnostics with line/column spans.
62
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.
63
64
  - **Return-type-aware `perform()` signatures.** Every generated intent is a drop-in tool for Agent Siri and Shortcuts.
64
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.
65
- - **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.
66
67
  - **Rust-grade diagnostics.** 16 diagnostic codes (`AX001`–`AX202`) with fix suggestions and color-coded output.
67
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.
68
- - **124 tests.** Parser, validator, generator, and emit paths — all covered.
69
+ - **155 tests.** Parser, validator, generator, emit paths, watch mode, and sandbox — all covered.
69
70
  - **Apache 2.0, no CLA.** Fork it, extend it, ship it.
70
71
 
71
72
  ---
@@ -76,8 +77,8 @@ Axint is the fastest path from an AI coding tool to a shipped App Intent. **One
76
77
  # Install globally
77
78
  npm install -g @axintai/compiler
78
79
 
79
- # Or use without installing
80
- npx axint compile my-intent.ts --stdout
80
+ # Or use without installing (runs from npm cache)
81
+ npx -p @axintai/compiler axint compile my-intent.ts --stdout
81
82
  ```
82
83
 
83
84
  Create `my-intent.ts`:
@@ -119,6 +120,31 @@ ios/Intents/
119
120
 
120
121
  ---
121
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
+
122
148
  ## Compiled Swift output
123
149
 
124
150
  ```swift
@@ -182,13 +208,15 @@ Axint ships with `axint-mcp`, a Model Context Protocol server that exposes the c
182
208
  }
183
209
  ```
184
210
 
185
- Three tools are exposed:
211
+ Five tools are exposed:
186
212
 
187
- | Tool | What it does |
188
- | ----------------- | -------------------------------------------------------------------------- |
189
- | `axint_scaffold` | Generates a TypeScript intent from a natural-language description |
190
- | `axint_compile` | Runs the full pipeline and returns `.swift` + `.plist` + `.entitlements` |
191
- | `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 |
192
220
 
193
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.
194
222
 
@@ -271,7 +299,7 @@ axint/
271
299
  │ ├── mcp/ # MCP server (scaffold, compile, validate)
272
300
  │ ├── cli/ # axint CLI (Commander.js)
273
301
  │ └── templates/ # Intent template registry
274
- ├── tests/ # 124 vitest tests
302
+ ├── tests/ # 155 vitest tests
275
303
  ├── examples/ # Example intent definitions
276
304
  └── docs/ # Error reference, contributing, assets
277
305
  ```
@@ -299,10 +327,11 @@ See [`ROADMAP.md`](ROADMAP.md) for the full plan. Highlights:
299
327
  - [x] Info.plist and `.entitlements` emit (v0.2.0)
300
328
  - [x] Return-type-aware `perform()` (v0.2.0)
301
329
  - [x] MCP scaffold tool (v0.2.0)
302
- - [x] 124-test suite with snapshot coverage (v0.2.0)
303
- - [ ] Intent template library (v0.3.0)
304
- - [ ] `--watch` mode for live Swift preview
305
- - [ ] 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)
306
335
  - [ ] GitHub template repo (`axint-starter`)
307
336
  - [ ] Axint Cloud (hosted compilation)
308
337