axint 0.3.7__tar.gz

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.
axint-0.3.7/.gitignore ADDED
@@ -0,0 +1,73 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Build output
5
+ dist/
6
+ *.tsbuildinfo
7
+
8
+ # Environment
9
+ .env
10
+ .env.*
11
+
12
+ # OS
13
+ .DS_Store
14
+ Thumbs.db
15
+
16
+ # Test coverage
17
+ coverage/
18
+
19
+ # Logs
20
+ *.log
21
+ npm-debug.log*
22
+
23
+ # Turbo
24
+ .turbo/
25
+
26
+ # IDE
27
+ .idea/
28
+ .vscode/
29
+ *.swp
30
+ *.swo
31
+ *~
32
+
33
+ # Generated Swift output (keep examples, ignore user output)
34
+ *.generated.swift
35
+ *.swift
36
+ !examples/*.swift
37
+ !extensions/xcode/source-editor-extension/**/*.swift
38
+ !spm-plugin/**/*.swift
39
+ !tools/swift-syntax-helper/**/*.swift
40
+
41
+ # swift-syntax helper build artifacts
42
+ tools/swift-syntax-helper/.build/
43
+ tools/swift-syntax-helper/Package.resolved
44
+
45
+ # tsup temp files
46
+ tsup.config.bundled_*
47
+ tests/.tmp-compiler-tests/
48
+
49
+ # Python
50
+ __pycache__/
51
+ *.pyc
52
+ *.pyo
53
+ *.egg-info/
54
+ python/dist/
55
+ python/build/
56
+
57
+ python/**/__pycache__/
58
+ *.tgz
59
+
60
+ # Hosted separately — not part of the compiler repo
61
+ registry/
62
+ site/
63
+
64
+ # Audit reports (generated, not source)
65
+ *.audit.html
66
+ *-audit*.html
67
+
68
+ # Registry tokens
69
+ .mcpregistry_github_token
70
+ .mcpregistry_registry_token
71
+
72
+ # Smithery build artifacts
73
+ .smithery/
axint-0.3.7/PKG-INFO ADDED
@@ -0,0 +1,169 @@
1
+ Metadata-Version: 2.4
2
+ Name: axint
3
+ Version: 0.3.7
4
+ Summary: Python SDK for Axint — define Apple App Intents, Views, Widgets, and Apps in Python.
5
+ Project-URL: Homepage, https://axint.ai
6
+ Project-URL: Documentation, https://github.com/agenticempire/axint/tree/main/python#readme
7
+ Project-URL: Repository, https://github.com/agenticempire/axint
8
+ Project-URL: Issues, https://github.com/agenticempire/axint/issues
9
+ Project-URL: Changelog, https://github.com/agenticempire/axint/blob/main/CHANGELOG.md
10
+ Author-email: Agentic Empire <hello@axint.ai>
11
+ License: Apache-2.0
12
+ Keywords: ai-agents,app-intents,apple,code-generation,mcp,shortcuts,siri,swift
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Code Generators
22
+ Classifier: Topic :: Software Development :: Compilers
23
+ Requires-Python: >=3.11
24
+ Provides-Extra: all
25
+ Requires-Dist: mcp>=0.1.0; extra == 'all'
26
+ Requires-Dist: pyyaml>=6.0; extra == 'all'
27
+ Provides-Extra: dev
28
+ Requires-Dist: mypy>=1.11; extra == 'dev'
29
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
30
+ Requires-Dist: pytest>=8.0; extra == 'dev'
31
+ Requires-Dist: pyyaml>=6.0; extra == 'dev'
32
+ Requires-Dist: ruff>=0.6; extra == 'dev'
33
+ Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
34
+ Provides-Extra: mcp
35
+ Requires-Dist: mcp>=0.1.0; extra == 'mcp'
36
+ Provides-Extra: registry
37
+ Requires-Dist: pyyaml>=6.0; extra == 'registry'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # axint — Python SDK for Axint
41
+
42
+ <!-- mcp-name: io.github.agenticempire/axint -->
43
+
44
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
45
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
46
+
47
+ Define Apple App Intents, SwiftUI views, WidgetKit widgets, and full apps in Python. Compile to native Swift through the same open-source compiler pipeline that powers the TypeScript SDK.
48
+
49
+ The Python SDK includes a **native Swift generator** — no Node.js dependency required. Parse, validate, and compile entirely from Python.
50
+
51
+ ## Install
52
+
53
+ ```bash
54
+ pip install axint
55
+ ```
56
+
57
+ Or install from source for development:
58
+
59
+ ```bash
60
+ git clone https://github.com/agenticempire/axint.git
61
+ cd axint/python
62
+ pip install -e '.[dev]'
63
+ ```
64
+
65
+ ## Define an intent
66
+
67
+ ```python
68
+ from axint import define_intent, param
69
+
70
+ create_event = define_intent(
71
+ name="CreateCalendarEventIntent",
72
+ title="Create Calendar Event",
73
+ description="Creates a new event on the user's calendar",
74
+ domain="productivity",
75
+ params={
76
+ "event_title": param.string("Title of the event"),
77
+ "start_date": param.date("When the event starts"),
78
+ "duration_minutes": param.int("Length of the event in minutes"),
79
+ "is_all_day": param.boolean("Whether the event is all-day", optional=True, default=False),
80
+ },
81
+ entitlements=["com.apple.developer.calendars"],
82
+ info_plist_keys=["NSCalendarsUsageDescription"],
83
+ )
84
+ ```
85
+
86
+ ## Compile it
87
+
88
+ ```bash
89
+ # Parse and inspect the IR
90
+ axint parse intents/create_event.py
91
+ axint parse intents/create_event.py --json
92
+
93
+ # Compile Python → Swift (native, no Node.js needed)
94
+ axint compile intents/create_event.py --stdout
95
+ axint compile intents/create_event.py --out ios/Intents/
96
+
97
+ # With companion fragments
98
+ axint compile intents/create_event.py --out ios/Intents/ --emit-info-plist --emit-entitlements
99
+
100
+ # Validate without generating Swift
101
+ axint validate intents/create_event.py
102
+
103
+ # Machine-readable output
104
+ axint compile intents/create_event.py --json
105
+ ```
106
+
107
+ ## Use it as a library
108
+
109
+ ```python
110
+ from axint import define_intent, param, generate_swift, validate_intent
111
+
112
+ intent = define_intent(
113
+ name="SendMessage",
114
+ title="Send Message",
115
+ description="Sends a message",
116
+ domain="messaging",
117
+ params={"body": param.string("Message text")},
118
+ )
119
+
120
+ ir = intent.to_ir()
121
+ diagnostics = validate_intent(ir)
122
+ swift_code = generate_swift(ir)
123
+ ```
124
+
125
+ ## Cross-language bridge
126
+
127
+ The Python SDK produces compatible IR JSON that the TypeScript compiler can consume. You can pipe it in for additional validation and Swift generation:
128
+
129
+ ```bash
130
+ axint parse intent.py --json | axint compile - --from-ir --stdout
131
+ ```
132
+
133
+ ## Why Python?
134
+
135
+ Every language-agnostic analysis layer in Axint — the IR, the validator, the generator — works with a stable JSON schema. The Python SDK implements the full pipeline natively, unlocking a massive population of developers who shouldn't have to learn TypeScript to build Siri integrations.
136
+
137
+ The Python parser never runs your code. It walks the Python AST the same way the TypeScript compiler walks the TS AST, so `axint compile` is deterministic, sandboxable, and reproducible.
138
+
139
+ ## Parity with the TypeScript SDK
140
+
141
+ | Feature | TypeScript | Python |
142
+ |----------------------------------|------------|--------|
143
+ | `define_intent` / `defineIntent` | ✅ | ✅ |
144
+ | `param.string/int/double/...` | ✅ | ✅ |
145
+ | `entitlements`, `infoPlistKeys` | ✅ | ✅ |
146
+ | `isDiscoverable` | ✅ | ✅ |
147
+ | Multi-intent files | ✅ | ✅ |
148
+ | Swift codegen (native) | ✅ | ✅ |
149
+ | IR validation | ✅ | ✅ |
150
+ | Info.plist fragment | ✅ | ✅ |
151
+ | Entitlements fragment | ✅ | ✅ |
152
+ | CLI (parse/compile/validate) | ✅ | ✅ |
153
+ | Return-type inference | ✅ | 🟡 v0.3 |
154
+ | MCP server | ✅ | 🟡 v0.3 |
155
+
156
+ ## Development
157
+
158
+ ```bash
159
+ pip install -e '.[dev]'
160
+ pytest -v
161
+ ruff check .
162
+ mypy axint
163
+ ```
164
+
165
+ ## License
166
+
167
+ Apache 2.0 — see [LICENSE](../LICENSE).
168
+
169
+ Part of the [Axint](https://axint.ai) project by [Agentic Empire](https://github.com/agenticempire).
axint-0.3.7/README.md ADDED
@@ -0,0 +1,130 @@
1
+ # axint — Python SDK for Axint
2
+
3
+ <!-- mcp-name: io.github.agenticempire/axint -->
4
+
5
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
6
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7
+
8
+ Define Apple App Intents, SwiftUI views, WidgetKit widgets, and full apps in Python. Compile to native Swift through the same open-source compiler pipeline that powers the TypeScript SDK.
9
+
10
+ The Python SDK includes a **native Swift generator** — no Node.js dependency required. Parse, validate, and compile entirely from Python.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pip install axint
16
+ ```
17
+
18
+ Or install from source for development:
19
+
20
+ ```bash
21
+ git clone https://github.com/agenticempire/axint.git
22
+ cd axint/python
23
+ pip install -e '.[dev]'
24
+ ```
25
+
26
+ ## Define an intent
27
+
28
+ ```python
29
+ from axint import define_intent, param
30
+
31
+ create_event = define_intent(
32
+ name="CreateCalendarEventIntent",
33
+ title="Create Calendar Event",
34
+ description="Creates a new event on the user's calendar",
35
+ domain="productivity",
36
+ params={
37
+ "event_title": param.string("Title of the event"),
38
+ "start_date": param.date("When the event starts"),
39
+ "duration_minutes": param.int("Length of the event in minutes"),
40
+ "is_all_day": param.boolean("Whether the event is all-day", optional=True, default=False),
41
+ },
42
+ entitlements=["com.apple.developer.calendars"],
43
+ info_plist_keys=["NSCalendarsUsageDescription"],
44
+ )
45
+ ```
46
+
47
+ ## Compile it
48
+
49
+ ```bash
50
+ # Parse and inspect the IR
51
+ axint parse intents/create_event.py
52
+ axint parse intents/create_event.py --json
53
+
54
+ # Compile Python → Swift (native, no Node.js needed)
55
+ axint compile intents/create_event.py --stdout
56
+ axint compile intents/create_event.py --out ios/Intents/
57
+
58
+ # With companion fragments
59
+ axint compile intents/create_event.py --out ios/Intents/ --emit-info-plist --emit-entitlements
60
+
61
+ # Validate without generating Swift
62
+ axint validate intents/create_event.py
63
+
64
+ # Machine-readable output
65
+ axint compile intents/create_event.py --json
66
+ ```
67
+
68
+ ## Use it as a library
69
+
70
+ ```python
71
+ from axint import define_intent, param, generate_swift, validate_intent
72
+
73
+ intent = define_intent(
74
+ name="SendMessage",
75
+ title="Send Message",
76
+ description="Sends a message",
77
+ domain="messaging",
78
+ params={"body": param.string("Message text")},
79
+ )
80
+
81
+ ir = intent.to_ir()
82
+ diagnostics = validate_intent(ir)
83
+ swift_code = generate_swift(ir)
84
+ ```
85
+
86
+ ## Cross-language bridge
87
+
88
+ The Python SDK produces compatible IR JSON that the TypeScript compiler can consume. You can pipe it in for additional validation and Swift generation:
89
+
90
+ ```bash
91
+ axint parse intent.py --json | axint compile - --from-ir --stdout
92
+ ```
93
+
94
+ ## Why Python?
95
+
96
+ Every language-agnostic analysis layer in Axint — the IR, the validator, the generator — works with a stable JSON schema. The Python SDK implements the full pipeline natively, unlocking a massive population of developers who shouldn't have to learn TypeScript to build Siri integrations.
97
+
98
+ The Python parser never runs your code. It walks the Python AST the same way the TypeScript compiler walks the TS AST, so `axint compile` is deterministic, sandboxable, and reproducible.
99
+
100
+ ## Parity with the TypeScript SDK
101
+
102
+ | Feature | TypeScript | Python |
103
+ |----------------------------------|------------|--------|
104
+ | `define_intent` / `defineIntent` | ✅ | ✅ |
105
+ | `param.string/int/double/...` | ✅ | ✅ |
106
+ | `entitlements`, `infoPlistKeys` | ✅ | ✅ |
107
+ | `isDiscoverable` | ✅ | ✅ |
108
+ | Multi-intent files | ✅ | ✅ |
109
+ | Swift codegen (native) | ✅ | ✅ |
110
+ | IR validation | ✅ | ✅ |
111
+ | Info.plist fragment | ✅ | ✅ |
112
+ | Entitlements fragment | ✅ | ✅ |
113
+ | CLI (parse/compile/validate) | ✅ | ✅ |
114
+ | Return-type inference | ✅ | 🟡 v0.3 |
115
+ | MCP server | ✅ | 🟡 v0.3 |
116
+
117
+ ## Development
118
+
119
+ ```bash
120
+ pip install -e '.[dev]'
121
+ pytest -v
122
+ ruff check .
123
+ mypy axint
124
+ ```
125
+
126
+ ## License
127
+
128
+ Apache 2.0 — see [LICENSE](../LICENSE).
129
+
130
+ Part of the [Axint](https://axint.ai) project by [Agentic Empire](https://github.com/agenticempire).
@@ -0,0 +1,163 @@
1
+ """
2
+ axint — the Python SDK for Axint.
3
+
4
+ Define Apple App Intents, Views, Widgets, and Apps in Python. Ship them
5
+ through the same open-source compiler pipeline that powers the TypeScript SDK.
6
+
7
+ from axint import define_intent, define_view, define_widget, param, prop, view
8
+
9
+ create_event = define_intent(
10
+ name="CreateCalendarEventIntent",
11
+ title="Create Calendar Event",
12
+ description="Creates a new event on the user's calendar",
13
+ domain="productivity",
14
+ params={
15
+ "event_title": param.string("Title of the event"),
16
+ "start_date": param.date("When the event starts"),
17
+ "duration_minutes": param.int("Length of the event in minutes"),
18
+ },
19
+ perform=lambda: {"event_id": "uuid-v4"},
20
+ )
21
+
22
+ Axint is a cross-language compiler. The TypeScript SDK and the Python
23
+ SDK produce the same language-agnostic intermediate representation, so
24
+ every definition — regardless of which SDK authored it — compiles through
25
+ the same Swift generator and hits the same validator rules.
26
+ """
27
+
28
+ from __future__ import annotations
29
+
30
+ __version__ = "0.3.7"
31
+
32
+ from .generator import (
33
+ generate_entitlements_fragment,
34
+ generate_info_plist_fragment,
35
+ generate_swift,
36
+ generate_swift_app,
37
+ generate_swift_view,
38
+ generate_swift_widget,
39
+ )
40
+ from .ir import (
41
+ AppIR,
42
+ AppleTarget,
43
+ AppSceneIR,
44
+ AppStorageIR,
45
+ DisplayRepresentationIR,
46
+ EntityIR,
47
+ IntentIR,
48
+ IntentParameter,
49
+ ParamType,
50
+ SceneKind,
51
+ ViewIR,
52
+ ViewPropIR,
53
+ ViewStateIR,
54
+ ViewStateKind,
55
+ WidgetEntryIR,
56
+ WidgetFamily,
57
+ WidgetIR,
58
+ WidgetRefreshPolicy,
59
+ )
60
+ from .parser import (
61
+ parse_app_source,
62
+ parse_file,
63
+ parse_file_apps,
64
+ parse_file_views,
65
+ parse_file_widgets,
66
+ parse_source,
67
+ parse_view_source,
68
+ parse_widget_source,
69
+ )
70
+ from .sdk import (
71
+ App,
72
+ AppDefinition,
73
+ Entity,
74
+ EntityDefinition,
75
+ Intent,
76
+ IntentDefinition,
77
+ View,
78
+ ViewDefinition,
79
+ Widget,
80
+ WidgetDefinition,
81
+ define_app,
82
+ define_entity,
83
+ define_intent,
84
+ define_view,
85
+ define_widget,
86
+ entry,
87
+ param,
88
+ prop,
89
+ scene,
90
+ state,
91
+ storage,
92
+ view,
93
+ )
94
+ from .validator import (
95
+ ValidatorDiagnostic,
96
+ validate_app,
97
+ validate_intent,
98
+ validate_view,
99
+ validate_widget,
100
+ )
101
+
102
+ __all__ = [
103
+ "App",
104
+ "AppDefinition",
105
+ "AppIR",
106
+ "AppSceneIR",
107
+ "AppStorageIR",
108
+ "AppleTarget",
109
+ "DisplayRepresentationIR",
110
+ "Entity",
111
+ "EntityDefinition",
112
+ "EntityIR",
113
+ "Intent",
114
+ "IntentDefinition",
115
+ "IntentIR",
116
+ "IntentParameter",
117
+ "ParamType",
118
+ "SceneKind",
119
+ "ValidatorDiagnostic",
120
+ "View",
121
+ "ViewDefinition",
122
+ "ViewIR",
123
+ "ViewPropIR",
124
+ "ViewStateIR",
125
+ "ViewStateKind",
126
+ "Widget",
127
+ "WidgetDefinition",
128
+ "WidgetEntryIR",
129
+ "WidgetFamily",
130
+ "WidgetIR",
131
+ "WidgetRefreshPolicy",
132
+ "__version__",
133
+ "define_app",
134
+ "define_entity",
135
+ "define_intent",
136
+ "define_view",
137
+ "define_widget",
138
+ "entry",
139
+ "generate_entitlements_fragment",
140
+ "generate_info_plist_fragment",
141
+ "generate_swift",
142
+ "generate_swift_app",
143
+ "generate_swift_view",
144
+ "generate_swift_widget",
145
+ "param",
146
+ "parse_app_source",
147
+ "parse_file",
148
+ "parse_file_apps",
149
+ "parse_file_views",
150
+ "parse_file_widgets",
151
+ "parse_source",
152
+ "parse_view_source",
153
+ "parse_widget_source",
154
+ "prop",
155
+ "scene",
156
+ "state",
157
+ "storage",
158
+ "validate_app",
159
+ "validate_intent",
160
+ "validate_view",
161
+ "validate_widget",
162
+ "view",
163
+ ]