@oneie/cli 0.5.2 → 0.5.3

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 ADDED
@@ -0,0 +1,71 @@
1
+ # @oneie/cli
2
+
3
+ The command line for [ONE](https://one.ie) — scaffold, validate, publish, and operate AI agents, skills, and whole agency workspaces from your terminal.
4
+
5
+ Ships two bins: **`one`** and **`oneie`** (aliases — same entry).
6
+
7
+ ```bash
8
+ npm install -g @oneie/cli
9
+ # or run without installing:
10
+ npx @oneie/cli --help
11
+ ```
12
+
13
+ ## Quick start — operate an agency on ONE
14
+
15
+ A ONE node (agency or client) is three folders the CLI compiles to the substrate:
16
+
17
+ ```
18
+ <node>/
19
+ ├── ai/ agents · skills · tools · workflows · context.md
20
+ ├── data/ types · lifecycles · content
21
+ └── _node.toml who it is
22
+ ```
23
+
24
+ ```bash
25
+ one setup # stand up your agency workspace (idempotent)
26
+ one client add <slug> # provision a managed client (workspace + credits + brand + agents)
27
+ one push [clients/<slug>] # compile ai/ + data/ → agents, skills, context, lifecycles, types
28
+ one status # P&L — funded · burned · margin · balance
29
+ one deploy # wrangler deploy the node's site/
30
+ ```
31
+
32
+ `one push` understands TOML array-of-tables (`[[stages]]`, `[[fields]]`) and compiles
33
+ `data/lifecycles/*.toml` and `data/types/*.toml` into the shapes the substrate expects.
34
+
35
+ ## Reach the whole surface
36
+
37
+ The receiver namespace *is* the API — discover it, then call anything:
38
+
39
+ ```bash
40
+ one catalog [--goal G] # browse receivers grouped by recipe
41
+ one ask <receiver> '{json}' # typed, validated pass-through to any receiver
42
+ one signal <receiver> '{json}' # fire-and-forget variant
43
+ one groups | actors | things | paths | events | learning # dimension reads
44
+ one mark | warn | fade | follow | select # the verbs
45
+ ```
46
+
47
+ ## Build agents & skills
48
+
49
+ ```bash
50
+ one agent new <name> --profile core|commerce|asi
51
+ one agent validate | lint | compile --target mcp|a2a|web|skillmd
52
+ one agent publish # sync to your ONE workspace
53
+ one skill new | import <ref> | publish
54
+ one init --name N --email E # zero-to-live: register + workspace + agent + skills
55
+ ```
56
+
57
+ ## Auth
58
+
59
+ ```bash
60
+ one login --key <key> # stored at ~/.config/oneie/key (0600)
61
+ # or set ONEIE_API_KEY in the environment
62
+ ```
63
+
64
+ Workspace operations use a Bearer token `<slug>:<key>`. Override the API base per command with `--api` (default `https://one.ie`).
65
+
66
+ ## Links
67
+
68
+ - Platform: **https://one.ie**
69
+ - Developers + SDK + MCP: **https://github.com/one-ie/one**
70
+
71
+ MIT © ONE
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@oneie/cli",
3
+ "version": "0.5.3",
4
+ "description": "ONE agent CLI",
5
+ "type": "module",
6
+ "bin": {
7
+ "oneie": "dist/src/index.js",
8
+ "one": "dist/src/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc && cp package.json dist/ && chmod +x dist/src/index.js",
16
+ "dev": "tsx src/index.ts",
17
+ "typecheck": "tsc --noEmit",
18
+ "prepublishOnly": "bun run build"
19
+ },
20
+ "dependencies": {
21
+ "commander": "^12.0.0",
22
+ "@oneie/sdk": "^0.14.4",
23
+ "@oneie/evals": "^0.1.0"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^25.6.0",
27
+ "tsx": "^4.0.0",
28
+ "typescript": "^5.4.0"
29
+ },
30
+ "license": "SEE LICENSE IN LICENSE",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/one-ie/packages.git",
34
+ "directory": "cli"
35
+ }
36
+ }
@@ -8,6 +8,16 @@ export function parseToml(src) {
8
8
  const line = rawLine.trim();
9
9
  if (!line || line.startsWith('#'))
10
10
  continue;
11
+ if (line.startsWith('[[') && line.endsWith(']]')) {
12
+ // Array-of-tables: [[stages]] / [[fields]] — append a fresh item, point at it.
13
+ const key = line.slice(2, -2).trim();
14
+ if (!Array.isArray(root[key]))
15
+ root[key] = [];
16
+ const item = {};
17
+ root[key].push(item);
18
+ current = item;
19
+ continue;
20
+ }
11
21
  if (line.startsWith('[') && line.endsWith(']')) {
12
22
  const key = line.slice(1, -1).trim();
13
23
  if (!root[key])
@@ -157,22 +167,64 @@ export async function compileNode(dir, agencySlug, opts) {
157
167
  }
158
168
  }
159
169
  // data/types/*.toml → world:declare-types
170
+ // The receiver wants { group, types: [{ key, label, dimension, type, columns[], fields[] }] }
171
+ // with each column/field { field, label, kind(enum) }. The TOML authors { id, label,
172
+ // dimension?, [[fields]]{ name, type, label } }; map field.type → a render `kind`.
173
+ const TYPE_KIND = {
174
+ string: 'text', url: 'text', number: 'number', currency: 'currency', date: 'date',
175
+ tags: 'tags', select: 'select', image: 'image', markdown: 'markdown', relation: 'relation', bool: 'select',
176
+ };
160
177
  for (const f of walk(join(dir, 'data', 'types'), '.toml')) {
161
178
  try {
162
179
  const toml = parseToml(readFileSync(f, 'utf8'));
163
- compiled.push({ path: f, receiver: 'world:declare-types', payload: { slug: agencySlug, types: toml } });
180
+ const rawFields = Array.isArray(toml.fields) ? toml.fields : [];
181
+ const cols = rawFields.map((fl) => {
182
+ const field = String(fl.name ?? fl.field ?? '');
183
+ return {
184
+ field,
185
+ label: String(fl.label ?? field),
186
+ kind: String(fl.kind ?? TYPE_KIND[String(fl.type ?? 'string')] ?? 'text'),
187
+ };
188
+ });
189
+ const key = String(toml.id ?? basename(f, '.toml'));
190
+ const type = {
191
+ key,
192
+ label: String(toml.label ?? key),
193
+ dimension: String(toml.dimension ?? 'things'),
194
+ type: key,
195
+ columns: cols,
196
+ fields: cols,
197
+ };
198
+ compiled.push({ path: f, receiver: 'world:declare-types', payload: { group: agencySlug, types: [type] } });
164
199
  }
165
200
  catch (e) {
166
201
  errors.push({ path: f, message: String(e) });
167
202
  }
168
203
  }
169
204
  // data/lifecycles/*.toml → lifecycle:save
205
+ // Build the LifecycleDef that the receiver's saveDef() persists. The TOML authors the
206
+ // human bits {id,label,tags,description,[[stages]]}; the rest is derived deterministically:
207
+ // stage.slot numeric order (the wall loads ORDER BY slot) → the stage index
208
+ // stage.tag full namespaced tag lifecycle:<id>:<stageId> (LifecycleStage.tag)
209
+ // stage.subSteps / enter_when empty / null (no sub-steps or auto-enter rule by default)
170
210
  for (const f of walk(join(dir, 'data', 'lifecycles'), '.toml')) {
171
211
  try {
172
- const src = readFileSync(f, 'utf8');
173
- const toml = parseToml(src);
174
- const lifecycle = String(toml.lifecycle ?? basename(f, '.toml'));
175
- compiled.push({ path: f, receiver: 'lifecycle:save', payload: { slug: agencySlug, lifecycle, def: src } });
212
+ const toml = parseToml(readFileSync(f, 'utf8'));
213
+ const id = String(toml.id ?? toml.lifecycle ?? basename(f, '.toml'));
214
+ const rawStages = Array.isArray(toml.stages) ? toml.stages : [];
215
+ const stages = rawStages.map((s, i) => {
216
+ const stageId = String(s.id ?? '');
217
+ return {
218
+ id: stageId,
219
+ label: String(s.label ?? stageId),
220
+ tag: `lifecycle:${id}:${stageId}`,
221
+ slot: i,
222
+ subSteps: [],
223
+ enter_when: null,
224
+ };
225
+ });
226
+ const def = { id, name: String(toml.label ?? id), version: 1, stages, transitions: [], arcs: [], monotonic: true };
227
+ compiled.push({ path: f, receiver: 'lifecycle:save', payload: { slug: agencySlug, lifecycle: id, def } });
176
228
  }
177
229
  catch (e) {
178
230
  errors.push({ path: f, message: String(e) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneie/cli",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "ONE agent CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,15 +12,15 @@
12
12
  "README.md"
13
13
  ],
14
14
  "scripts": {
15
- "build": "tsc && chmod +x dist/src/index.js",
15
+ "build": "tsc && cp package.json dist/ && chmod +x dist/src/index.js",
16
16
  "dev": "tsx src/index.ts",
17
17
  "typecheck": "tsc --noEmit",
18
18
  "prepublishOnly": "bun run build"
19
19
  },
20
20
  "dependencies": {
21
21
  "commander": "^12.0.0",
22
- "@oneie/sdk": "^0.14.2",
23
- "@oneie/evals": "workspace:*"
22
+ "@oneie/sdk": "^0.14.4",
23
+ "@oneie/evals": "^0.1.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^25.6.0",