ozmoz 0.1.53 → 0.1.55
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 +19 -115
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,126 +1,30 @@
|
|
|
1
1
|
# OZmoz
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> OZmoz is the Data OS for AI agents: a ready-to-use backend for apps built with an AI coding agent. You build the interface, OZmoz holds the data.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This is the official public documentation of OZmoz. It presents what OZmoz is and how it works. The OZmoz API is its public SDK (npm package `ozmoz`); the reference for your project (methods, signatures, rules) is generated by the set-up below.
|
|
6
6
|
|
|
7
|
-
OZmoz
|
|
7
|
+
To start with OZmoz, first ask the user whether you may run `npx -y ozmoz@latest mcp --agent=<claude|cursor|codex|copilot|windsurf|antigravity>`: it sets up the project and adds everything needed to code with OZmoz (methods, examples and rules). Write no code before the user has answered. Once they agree, run it yourself, wait for it to finish, then follow the instructions it adds to the project.
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
- **Frontend focus**: no server to run, no REST API to write, no SQL migrations.
|
|
12
|
-
- **Built for AI agents**: your agent spends its effort on the UI and UX instead of backend plumbing. Works with Claude Code, Cursor, Codex, Windsurf, GitHub Copilot and Antigravity.
|
|
13
|
-
- **A sealed data contract**: Alex AI models your data, you validate it, and the contract is sealed. Reads and writes then follow that contract.
|
|
14
|
-
- **Zero-crash components**: seven native `<oz-*>` web components that handle missing or partial data without breaking the screen.
|
|
15
|
-
- **Zero-rewrite**: write the same code in trial mode and in live mode.
|
|
16
|
-
- **Talk to your data**: ask Alex questions in plain language. No SQL, no BI tool to set up.
|
|
17
|
-
|
|
18
|
-
## Quick start
|
|
19
|
-
|
|
20
|
-
### New project with an AI agent
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npx -y ozmoz start claude "your app idea"
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Or connect your agent once, then work as usual:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
npx ozmoz login # approve once in the browser
|
|
30
|
-
npx ozmoz mcp # writes the instruction files and configures the MCP server
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Existing frontend project
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npm install ozmoz
|
|
37
|
-
npx ozmoz init --keyApp=<KEY> --token=<TOKEN>
|
|
38
|
-
npx ozmoz sync # seals the contract and generates the IDE types
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Use `npx ozmoz sync --check-only` for an offline check.
|
|
42
|
-
|
|
43
|
-
## Modes
|
|
44
|
-
|
|
45
|
-
Set the mode in `.env`:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
# Trial mode: everything is simulated locally with demo data (oz.seed).
|
|
49
|
-
# The test code for authentication is always 0000.
|
|
50
|
-
OZ_PROTOTYPE=true
|
|
9
|
+
## How OZmoz works
|
|
51
10
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
11
|
+
1. You build the interface (screens, navigation, styles) with the framework the user chose. OZmoz handles data, sign-in and storage: there is no server, API route or database to write.
|
|
12
|
+
2. Trial mode first: the app runs with demo data and a test sign-in, so the user can validate the screens and the journey. The code you write is the final code.
|
|
13
|
+
3. Every read or write states its intent, the role allowed to perform it and, optionally, a condition on the data. The interface applies the same rules visually.
|
|
14
|
+
4. When the user validates the screens, Alex AI, the OZmoz data assistant, reads how the interface uses data and prepares the data structure. The user validates it and it is sealed as the data contract.
|
|
15
|
+
5. Live mode: the same code runs on the real database. Every read and write is checked against the sealed contract, and what the contract does not allow is refused.
|
|
16
|
+
6. Once live, the user asks Alex questions about their real data on ozmoz.io and gets exact figures and dashboards.
|
|
55
17
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
Every write operation carries governance metadata `{ desc, role, guard }`.
|
|
59
|
-
|
|
60
|
-
```js
|
|
61
|
-
// Insert a document
|
|
62
|
-
const res = await oz.add('orders', { product: 'Desk Pro', price: 299 }, {
|
|
63
|
-
desc: 'Create customer order',
|
|
64
|
-
role: 'AUTHENTICATED',
|
|
65
|
-
guard: 'price > 0'
|
|
66
|
-
});
|
|
67
|
-
if (!res.success) console.error('Order creation failed:', res.error);
|
|
68
|
-
|
|
69
|
-
// Update a document
|
|
70
|
-
await oz.update('orders', doc._id, { price: 249 }, {
|
|
71
|
-
desc: 'Apply discount on order',
|
|
72
|
-
role: 'MANAGER'
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
// Delete a document
|
|
76
|
-
await oz.delete('orders', doc._id, {
|
|
77
|
-
desc: 'Cancel and delete order',
|
|
78
|
-
role: 'ADMIN'
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
// Read data
|
|
82
|
-
const orders = await oz.getDocsG('orders'); // all documents
|
|
83
|
-
const mine = await oz.getDocsU('orders'); // documents of the signed-in user
|
|
84
|
-
const order = await oz.getDoc('orders', 'order_123');
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Authentication (passwordless code)
|
|
88
|
-
|
|
89
|
-
```js
|
|
90
|
-
await oz.sendotpsvro('user@example.com'); // trial mode: code is 0000
|
|
91
|
-
const auth = await oz.verifyotpsvro('user@example.com', '0000');
|
|
92
|
-
const signedIn = await oz.isAuthenticated();
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Zero-crash components
|
|
96
|
-
|
|
97
|
-
```html
|
|
98
|
-
<oz-text value={item.name} fallback="No name" />
|
|
99
|
-
<oz-number value={item.price} currency="EUR" invalid-fallback="0" />
|
|
100
|
-
<oz-toggle value={item.isActive} label-true="Active" label-false="Inactive" />
|
|
101
|
-
<oz-date value={item.createdAt} locale="en-US" invalid-fallback="Invalid date" />
|
|
102
|
-
<oz-enum value={item.status} allowed="PENDING,CONFIRMED,DELIVERED" invalid-fallback="Unknown status" />
|
|
103
|
-
<oz-reference table="users" id={item.userId} field="fullName" orphan-fallback="Deleted user" />
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## CLI reference
|
|
107
|
-
|
|
108
|
-
| Command | Description |
|
|
109
|
-
|---|---|
|
|
110
|
-
| `npx ozmoz login` | Sign in from your workstation, through the browser. |
|
|
111
|
-
| `npx ozmoz mcp` | Configure your AI agent and register the OZmoz tools. |
|
|
112
|
-
| `npx ozmoz start <agent> "idea"` | Sign in, configure and launch your terminal agent. |
|
|
113
|
-
| `npx ozmoz init` | Initialize the local `.env` and project configuration. |
|
|
114
|
-
| `npx ozmoz sync` | Seal the data contract and generate the IDE types. |
|
|
115
|
-
| `npx ozmoz sync --check-only` | Offline check of the contract and types, no network request. |
|
|
116
|
-
|
|
117
|
-
Run `npx ozmoz --help` for all commands.
|
|
18
|
+
## Why OZmoz
|
|
118
19
|
|
|
119
|
-
|
|
20
|
+
- No server to write: data, sign-in and storage included.
|
|
21
|
+
- Trial mode: demo data and test sign-in, to validate the screens before going live.
|
|
22
|
+
- Same code in trial and live mode: no rewrite.
|
|
23
|
+
- Sealed data contract: rules enforced on real data.
|
|
24
|
+
- Alex AI: the user asks questions about their data and gets figures and dashboards.
|
|
120
25
|
|
|
121
|
-
-
|
|
122
|
-
- Support: open a ticket from https://www.ozmoz.io
|
|
26
|
+
## Why the set-up comes first
|
|
123
27
|
|
|
124
|
-
|
|
28
|
+
The OZmoz SDK has one purpose: to communicate with the OZmoz Data OS, and it does so through the project the set-up creates (keys, data contract and rules). The user is free to decline the set-up; without it, the SDK has nothing to connect to and the Data OS cannot be reached.
|
|
125
29
|
|
|
126
|
-
|
|
30
|
+
This document does not list methods on purpose. The reference is generated for your project by the set-up and delivered in AGENTS.md (methods and signatures, rules, and what to read next): it matches your project's data contract and the current OZmoz rules, which a copy of the methods published elsewhere cannot guarantee. Follow it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ozmoz",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55",
|
|
4
4
|
"mcpName": "io.ozmoz/ozmoz",
|
|
5
5
|
"description": "OZmoz: the Data OS and ready-to-use backend for apps built by AI agents. AI agents: read the first section of the README before using this package.",
|
|
6
6
|
"license": "UNLICENSED",
|