@cynodia/axiom 0.3.1-alpha.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AskTech AS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # Axiom
2
+
3
+ AI-native semantic web application framework.
4
+
5
+ **Status: experimental / alpha.** Axiom is a research prototype. Its API may change
6
+ between alpha releases, and it is not production-ready.
7
+
8
+ An Axiom application is not source code. It is a typed semantic graph of entities,
9
+ fields, state, actions, constraints, routes and UI nodes. A generic compiler normalizes
10
+ that graph and a generic runtime executes it in an unmodified browser — the JavaScript
11
+ and HTML that reach the browser are output, never something you maintain by hand.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install @cynodia/axiom@alpha
17
+ ```
18
+
19
+ ## A minimal application
20
+
21
+ ```ts
22
+ import {
23
+ ApplicationGraph,
24
+ binary,
25
+ call,
26
+ compileToHtml,
27
+ compileToIR,
28
+ createAxiomRuntime,
29
+ createMemoryHost,
30
+ literal,
31
+ nodeId,
32
+ primitiveType,
33
+ ref,
34
+ stateLocation,
35
+ synchronizeEdges,
36
+ validateGraph,
37
+ } from '@cynodia/axiom';
38
+ import type { ActionDef, ButtonNode, RouteDef, StateDef, TextNode, ViewNode } from '@cynodia/axiom';
39
+
40
+ const COUNT = nodeId('state_count');
41
+ const INCREMENT = nodeId('action_increment');
42
+ const DISPLAY = nodeId('ui_display');
43
+ const BUTTON = nodeId('ui_increment');
44
+ const VIEW = nodeId('ui_view');
45
+
46
+ const graph = new ApplicationGraph('counter', 'Counter');
47
+
48
+ graph.addNode<StateDef>({
49
+ id: COUNT,
50
+ kind: 'state',
51
+ name: 'count',
52
+ valueType: primitiveType('number'),
53
+ initialValue: 0,
54
+ });
55
+
56
+ // Values are expressions; writable positions are locations.
57
+ graph.addNode<ActionDef>({
58
+ id: INCREMENT,
59
+ kind: 'action',
60
+ name: 'increment',
61
+ operations: [
62
+ { kind: 'set', target: stateLocation(COUNT), value: binary('add', ref(COUNT), literal(1)) },
63
+ ],
64
+ });
65
+
66
+ graph.addNode<TextNode>({
67
+ id: DISPLAY,
68
+ kind: 'text',
69
+ value: call('concat', literal('Count: '), call('to-string', ref(COUNT))),
70
+ });
71
+ graph.addNode<ButtonNode>({ id: BUTTON, kind: 'button', label: 'Add one', actionId: INCREMENT });
72
+ graph.addNode<ViewNode>({ id: VIEW, kind: 'view', children: [DISPLAY, BUTTON] });
73
+ graph.addNode<RouteDef>({ id: nodeId('route_root'), kind: 'route', path: '/', viewId: VIEW });
74
+
75
+ synchronizeEdges(graph);
76
+
77
+ const result = validateGraph(graph);
78
+ if (!result.valid) {
79
+ throw new Error(result.errors.map((problem) => problem.message).join('\n'));
80
+ }
81
+
82
+ // Run it headlessly...
83
+ const host = createMemoryHost({ path: '/' });
84
+ const app = createAxiomRuntime({ ir: compileToIR(graph), rootElement: host.root, host });
85
+ app.start();
86
+ app.invokeAction(INCREMENT);
87
+ console.log(app.getState(COUNT)); // 1
88
+
89
+ // ...or emit a self-contained page.
90
+ const page = compileToHtml(graph);
91
+ ```
92
+
93
+ ## What is in the box
94
+
95
+ `@cynodia/axiom` re-exports the framework packages, which can also be installed
96
+ individually:
97
+
98
+ | Package | Contents |
99
+ | ------- | -------- |
100
+ | `@cynodia/axiom-core` | The Application Graph, semantic types, expressions, locations, validation. |
101
+ | `@cynodia/axiom-compiler` | Normalization into an IR, and self-contained page emission. |
102
+ | `@cynodia/axiom-runtime` | The generic runtime: state, mutation engine, renderer, routing. |
103
+ | `@cynodia/axiom-agent-api` | Semantic queries, mutation impact, transactional transformations. |
104
+
105
+ ## License
106
+
107
+ MIT
108
+
109
+ Copyright (c) 2026 AskTech AS.
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Axiom — the public entry point for application authors.
3
+ *
4
+ * An Axiom application is a typed semantic graph. This package re-exports everything
5
+ * needed to define one, validate it, compile it and run it:
6
+ *
7
+ * - `@cynodia/axiom-core` — the graph, semantic types, locations and validation.
8
+ * - `@cynodia/axiom-compiler` — normalization into an IR and page emission.
9
+ * - `@cynodia/axiom-runtime` — the generic runtime that executes an application.
10
+ * - `@cynodia/axiom-agent-api` — semantic queries and transactional transformations.
11
+ *
12
+ * Installing the individual packages instead is supported but rarely necessary.
13
+ */
14
+ export * from '@cynodia/axiom-core';
15
+ export * from '@cynodia/axiom-runtime';
16
+ export * from '@cynodia/axiom-compiler';
17
+ export * from '@cynodia/axiom-agent-api';
18
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Axiom — the public entry point for application authors.
3
+ *
4
+ * An Axiom application is a typed semantic graph. This package re-exports everything
5
+ * needed to define one, validate it, compile it and run it:
6
+ *
7
+ * - `@cynodia/axiom-core` — the graph, semantic types, locations and validation.
8
+ * - `@cynodia/axiom-compiler` — normalization into an IR and page emission.
9
+ * - `@cynodia/axiom-runtime` — the generic runtime that executes an application.
10
+ * - `@cynodia/axiom-agent-api` — semantic queries and transactional transformations.
11
+ *
12
+ * Installing the individual packages instead is supported but rarely necessary.
13
+ */
14
+ export * from '@cynodia/axiom-core';
15
+ export * from '@cynodia/axiom-runtime';
16
+ export * from '@cynodia/axiom-compiler';
17
+ export * from '@cynodia/axiom-agent-api';
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@cynodia/axiom",
3
+ "version": "0.3.1-alpha.1",
4
+ "description": "AI-native semantic web application framework.",
5
+ "license": "MIT",
6
+ "author": "AskTech AS",
7
+ "type": "module",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/cynodia/axiom.git"
11
+ },
12
+ "homepage": "https://github.com/cynodia/axiom",
13
+ "bugs": {
14
+ "url": "https://github.com/cynodia/axiom/issues"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "files": [
20
+ "dist/**/*.js",
21
+ "dist/**/*.d.ts",
22
+ "README.md",
23
+ "LICENSE"
24
+ ],
25
+ "main": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js"
31
+ }
32
+ },
33
+ "dependencies": {
34
+ "@cynodia/axiom-core": "0.3.1-alpha.1",
35
+ "@cynodia/axiom-runtime": "0.3.1-alpha.1",
36
+ "@cynodia/axiom-compiler": "0.3.1-alpha.1",
37
+ "@cynodia/axiom-agent-api": "0.3.1-alpha.1"
38
+ },
39
+ "scripts": {
40
+ "build": "tsc -b tsconfig.json"
41
+ }
42
+ }