@oneie/cli 4.1.0 → 4.2.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
@@ -63,6 +63,23 @@ one connect telegram --token T # connect a channel by pasting its credential
63
63
  one trail <tag,tag> # ranked next-best tasks for a tag combination
64
64
  ```
65
65
 
66
+ ## Tasks — see, sequence, act
67
+
68
+ ```bash
69
+ one tasks brief --workspace one --tree # one screen: counts, ready, blocked-by, stale DONE, next five moves
70
+ one tasks board --workspace one --tree --all # every row; --kind work|approval|all (default work)
71
+ one tasks plan <goal-tid|tag> --tree # waves + critical path in hops; cycles, outside waits, ownerless
72
+ one tasks plan <goal> --emit dispatch --out w.json # hand-off: tid/assignee/model/effort/touches/accept per wave
73
+ one tasks sequence <tid> <tid> <tid> --apply # chain in order (one tasks:bulk call); preview without --apply
74
+ one tasks depend <tid> <blockedBy> # one edge; undepend removes it
75
+ one tasks set --where-tag t --set-status done # filter-driven edit; preview unless --apply
76
+ one tasks bulk --file plan.json # creates/edits from a file, chunked at 25
77
+ ```
78
+
79
+ Rows tagged `approval` are parked workflow runs: excluded by default, counted, and never closed by
80
+ status (`set --apply` refuses them unless `--kind all`). Every read states `total`, `truncated` and
81
+ `asOf`; a partial read says it is partial.
82
+
66
83
  ## Auth
67
84
 
68
85
  ```bash
@@ -113,6 +130,66 @@ one social list --group G | create --group G ... # draft/publish/list socia
113
130
  one fn run <name> '{json}' | list # call an allowlisted analytics/routing RPC
114
131
  one coordinate recall [about] | reputation [uid] # cross-session memory and reputation
115
132
  one group bulk-create --csv # idempotent batch client provisioning
133
+ one shop init [--facts F] [--workspace S] # seed the twelve-page shop pack; a fact left out stays a VISIBLE placeholder
134
+ ```
135
+
136
+ ## Your own endpoints — a tenant's HTTPS, called by a workflow
137
+
138
+ Register an HTTPS endpoint you own and let a workflow `tool` step call it. The
139
+ URL is SSRF-checked when you register it **and again on every call** — the
140
+ check is not a one-time gate at the door.
141
+
142
+ ```bash
143
+ one endpoint add <name> <url> [--method POST] [--returns json|url|bytes]
144
+ [--auth-header Authorization] [--secret-env VAR] # the secret is read from the ENV, never from argv, which the shell records
145
+ [--timeout 20000] [--max-bytes 5242880] # clamped 1000-120000 and to 10485760
146
+ one endpoint list [--workspace S] # the sealed secret has NO read door — the column says yes or no, never the value
147
+ one endpoint test <name> # run the SSRF guard WITHOUT spending a request; the refusal comes back by name
148
+ one endpoint call <name> --input '{json}' # the same door a workflow `tool` step uses
149
+ ```
150
+
151
+ `--workspace` on any of these is a workspace you must already control: one you
152
+ may not write is **refused**, never silently downgraded to your own.
153
+
154
+ An endpoint is reachable **two** ways, and the second one is why an outside
155
+ agent can join at all. A workflow `tool` step names it —
156
+ `{ receiver: "endpoint:call", args: { endpoint: "<name>", input: {…} } }` — and
157
+ takes any request and response shape you like; in `bytes` or `url` mode the
158
+ result is filed in the media library and you get the reader URL back. And an
159
+ agent whose frontmatter says `model: endpoint/<name>` is *served by* your
160
+ service: it gets an actor id, a chat UI renders it, and `agent:run` invokes it,
161
+ with none of your code running on anyone's machine. That second path needs your
162
+ service to speak **OpenAI chat completions**, because that is the shape every
163
+ other provider branch already constructs; a service with its own shape belongs
164
+ on the first path, which cares about neither.
165
+
166
+ `endpoint/<name>/<model>` overrides the model id sent in the request body. A
167
+ handle registered by another workspace is **not found**, never borrowed, and an
168
+ endpoint that cannot be served **refuses** rather than quietly answering from a
169
+ different model.
170
+
171
+ ## Media — the library an agent can reach
172
+
173
+ ```bash
174
+ one media list [--workspace S] [--kind image|video] [--prefix media|chat|ads|products|pages|brand|courses]
175
+ one media list --all # follow nextCursor to the end (ceiling 20 pages)
176
+ one media upload <path> [--workspace S] [--filename N] # a local file, sized against the 5 MiB cap before it is sent
177
+ ```
178
+
179
+ Two verbs, because only two earn a wrapper over `one ask`. `list` renders
180
+ `media:list`'s honest fields — `--limit` is R2 objects **scanned** per page, not
181
+ rows returned, and a `total` printed beside a truncation notice is a floor, so
182
+ the renderer says "at least N" rather than reading as complete. `upload` exists
183
+ because you cannot put a local file in a JSON body by hand; it reads, sizes and
184
+ encodes it, and the printed `key` names the workspace prefix the bytes actually
185
+ reached — `media:upload` refuses a workspace you may not write instead of
186
+ silently downgrading to your own.
187
+
188
+ Generation is deliberately **not** a subcommand — it is a prompt string in a
189
+ JSON body, so the raw door is no worse than a wrapper:
190
+
191
+ ```bash
192
+ one ask media:generate --data '{"prompt":"a red bicycle"}'
116
193
  ```
117
194
 
118
195
  ## Chat — fan in · fan out
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneie/cli",
3
- "version": "4.1.0",
3
+ "version": "4.2.1",
4
4
  "description": "ONE agent CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,10 +20,10 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "commander": "^12.0.0",
23
- "@oneie/sdk": "^0.14.12"
23
+ "@oneie/sdk": "^0.16.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@oneie/evals": "^0.1.1",
26
+ "@oneie/evals": "^0.2.0",
27
27
  "@types/node": "^25.6.0",
28
28
  "tsx": "^4.0.0",
29
29
  "typescript": "^5.4.0",
@@ -1,5 +1,53 @@
1
1
  import { Command } from 'commander';
2
2
  export declare function agentCmd(): Command;
3
+ /**
4
+ * Structural validation — mirrors the rules enforced by the web's Zod schema
5
+ * (web/src/lib/agent-schema.ts) without pulling Zod or js-yaml into the CLI
6
+ * dependency graph. Catches the contract violations partners hit most often:
7
+ * missing frontmatter, name shape, journey/section anchor mismatches, chip
8
+ * id collisions, kebab-case ids. Anything outside these rules falls through
9
+ * to the live server-side validation when the agent is published.
10
+ */
11
+ /** Required: a reader REFUSES or silently SUBSTITUTES identity without it.
12
+ * name → publish refuses (world-receivers.ts:1407). kind → one-agents.mjs:191
13
+ * skips the file. (The non-empty body is checked separately.) */
14
+ export declare const AGENT_REQUIRED: readonly ["name", "kind"];
15
+ /** Recommended: every reader falls back without it, but the fallback is a
16
+ * different agent on the page (title → dir, description → 'Generic helpful
17
+ * assistant', tier/domain → inferred from the id). Warned when absent. */
18
+ export declare const AGENT_RECOMMENDED: readonly ["title", "tier", "domain", "subscribes"];
19
+ /** The closed enums the web schema owns (agent-schema.ts) — role-types.ts INFERS
20
+ * a value from the id when the declared one is off-enum, so an off-enum value
21
+ * is a silent re-placement on the org chart, not a load failure. */
22
+ export declare const AGENT_ENUMS: Record<string, readonly string[]>;
23
+ /** Keys the channels parser (channels/src/lib/agent-md.ts) can only read as a
24
+ * BLOCK list. An inline `[a, b]` is stored as the string "[a, b]", so
25
+ * `Array.isArray` fails in resolvePersona and the field is dropped at runtime. */
26
+ export declare const AGENT_BLOCK_LIST_KEYS: readonly ["tools", "subscribes", "emits", "skills", "tags"];
27
+ /** Every top-level key at least one reader consumes — the union of AgentMeta
28
+ * (agent-md.ts:435), agentFrontmatterSchema (agent-schema.ts:229), Persona
29
+ * (channels/src/context.ts:590), compile.ts:319, one-agents.mjs:130,
30
+ * role-types.ts and the publish path. A key outside this set is read by
31
+ * nothing; the validator names it rather than refusing it. `direction` is NOT here on
32
+ * purpose: C20 deleted it from 118 corpus files (0 readers; 93/95 `bidirectional`
33
+ * merely restated subscribes+emits, the rest contradicted them) — keeping it out
34
+ * is what makes `--strict` refuse a resurrection. */
35
+ export declare const AGENT_KNOWN_KEYS: ReadonlySet<string>;
36
+ export interface ValidateResult {
37
+ /** Fail the verdict — a required field is absent or the file is not an agent. */
38
+ errors: string[];
39
+ /** Measured hazards that do not fail by default; `--strict` promotes them. */
40
+ warnings: string[];
41
+ /** Top-level keys no reader consumes, by name. */
42
+ unknownKeys: string[];
43
+ }
44
+ export interface ValidateOpts {
45
+ /** Warnings become errors. */
46
+ strict?: boolean;
47
+ /** `publish` keeps the door's pre-spec gate: frontmatter + name + anchors. */
48
+ door?: 'validate' | 'publish';
49
+ }
50
+ export declare function validate(path: string, opts?: ValidateOpts): ValidateResult;
3
51
  /**
4
52
  * Targets the CLI can actually emit. `a2a` and `erc8004` were advertised in
5
53
  * --target help and in the docs but had no branch — they fell through to
@@ -8,4 +56,20 @@ export declare function agentCmd(): Command;
8
56
  * delegate to, and inventing one here would be worse than an honest error.
9
57
  */
10
58
  export declare const CLI_TARGETS: readonly ["mcp", "uagents", "skillmd", "web"];
59
+ export interface AgentverseReadiness {
60
+ ready: boolean;
61
+ /** Required and absent. Refuses the upload. */
62
+ missing: string[];
63
+ /** Optional and absent — named so an operator can choose, never a refusal. */
64
+ recommended: string[];
65
+ }
66
+ /**
67
+ * Is this agent.md ready to be a HOSTED Agentverse agent?
68
+ *
69
+ * `seed` is the only REQUIRED field, and it is required for one reason: it is the
70
+ * deterministic identity. Without it every deploy of the same file is a different
71
+ * agent as far as the network is concerned — a fresh address, so every peer that
72
+ * learned the old one is now talking to nobody.
73
+ */
74
+ export declare function agentverseReadiness(agentMd: string): AgentverseReadiness;
11
75
  export declare function compileTarget(content: string, target: string, skills?: Record<string, string>): string;
package/dist/src/agent.js CHANGED
@@ -38,10 +38,11 @@ export function agentCmd() {
38
38
  out(cmd, { ok: true, path: outPath, lines: body.split('\n').length });
39
39
  });
40
40
  cmd.command('validate <path>')
41
- .description('Validate agent.md frontmatter against spec')
42
- .action((path) => {
43
- const { errors } = validate(path);
44
- out(cmd, { ok: errors.length === 0, errors, checked: 1 });
41
+ .description('Validate agent.md frontmatter against the ONE agent spec (text/agents-spec.md)')
42
+ .option('--strict', 'Warnings are errors: unknown keys, off-enum values, list shapes the runtime cannot read')
43
+ .action((path, opts) => {
44
+ const { errors, warnings, unknownKeys } = validate(path, { strict: !!opts.strict });
45
+ out(cmd, { ok: errors.length === 0, errors, warnings, unknownKeys, checked: 1 });
45
46
  });
46
47
  cmd.command('lint <path>')
47
48
  .description('Lint agent.md style and spec rules')
@@ -102,12 +103,21 @@ export function agentCmd() {
102
103
  .option('--agentverse-key <key>', 'Agentverse API key (or set AGENTVERSE_API_KEY)')
103
104
  .option('--skills <dir>', 'Directory holding the skill markdown declared in the agent frontmatter (agentverse target)')
104
105
  .option('--live', 'Set lifecycle: active before publishing (skip the draft step)')
106
+ // The override for the Agentverse readiness refusal below. It is a flag, not a
107
+ // prompt, so the decision to deploy a non-deterministic identity is explicit and
108
+ // lands in the shell history of whoever made it.
109
+ .option('--force', 'Deploy to Agentverse even when the agent is not Agentverse-ready (no seed: — a new address every deploy)')
105
110
  .action(async (path, opts) => {
106
111
  if (!existsSync(path)) {
107
112
  out(cmd, { ok: false, error: `not found: ${path}` });
108
113
  return;
109
114
  }
110
- const { errors } = validate(path);
115
+ // The PUBLISH door keeps the gate it always had — the receiver itself
116
+ // refuses on `name:` alone (world-receivers.ts:1407) and this mirrors it.
117
+ // The spec's required set (kind, body) changes `validate`'s verdict, not
118
+ // whether a file may be uploaded; a stricter door here would be a reader
119
+ // changing behaviour, which text/agents-spec.md forbids.
120
+ const { errors } = validate(path, { door: 'publish' });
111
121
  if (errors.length) {
112
122
  out(cmd, { ok: false, errors });
113
123
  return;
@@ -129,6 +139,39 @@ export function agentCmd() {
129
139
  // deployed agent is a shell that cannot answer a message.
130
140
  const found = resolveSkillMds(path, content, opts.skills);
131
141
  warnSkillGap(found, 'uagents');
142
+ // ── The readiness gate — BEFORE the compile, and long before the network ──
143
+ //
144
+ // Placed next to warnSkillGap because it is the same kind of honesty: both
145
+ // name a capability the deployed agent will not have. It differs in what it
146
+ // does about it, and that difference is the whole cycle. A skill gap produces
147
+ // an agent that cannot answer; a seed gap produces an agent at a DIFFERENT
148
+ // ADDRESS each deploy — and the network cannot tell it is the same agent, so
149
+ // the damage is done the moment the upload succeeds, silently, to a caller
150
+ // who was told nothing. Warning and uploading anyway is the `--skip-tests`
151
+ // shape: a notice where a gate belongs. So the default REFUSES.
152
+ //
153
+ // `--force` keeps the plan's letter — it warns, then it uploads — while
154
+ // making the choice explicit and attributable.
155
+ //
156
+ // The refusal is STRUCTURED as well as spoken: `missing` rides the out()
157
+ // envelope so a --json caller branches on the field instead of scraping
158
+ // stderr. Naming which gate bit is the point.
159
+ const readiness = agentverseReadiness(content);
160
+ if (!readiness.ready) {
161
+ warnAgentverseGap(readiness);
162
+ if (!opts.force) {
163
+ out(cmd, {
164
+ ok: false,
165
+ error: `not Agentverse-ready — missing: ${readiness.missing.join(', ')}. Add the field, or pass --force to deploy a non-deterministic identity anyway.`,
166
+ ready: false,
167
+ missing: readiness.missing,
168
+ recommended: readiness.recommended,
169
+ force: '--force',
170
+ });
171
+ return;
172
+ }
173
+ console.error(' --force given — deploying anyway. This address will not be stable.');
174
+ }
132
175
  let python;
133
176
  try {
134
177
  python = compileAgent(content, { target: 'uagents', skills: found.skills });
@@ -767,21 +810,101 @@ function out(cmd, data) {
767
810
  * id collisions, kebab-case ids. Anything outside these rules falls through
768
811
  * to the live server-side validation when the agent is published.
769
812
  */
770
- function validate(path) {
771
- if (!existsSync(path))
772
- return { errors: [`not found: ${path}`] };
773
- const text = readFileSync(path, 'utf8');
813
+ // ── The ONE agent spec — text/agents-spec.md ─────────────────────────────────
814
+ //
815
+ // Six programs read a `kind: agent` file and each reads a different key set. The
816
+ // spec is derived from what they do; these constants are its machine half. Keep
817
+ // them in step with the spec's field table — the test asserts the shape.
818
+ /** Required: a reader REFUSES or silently SUBSTITUTES identity without it.
819
+ * name → publish refuses (world-receivers.ts:1407). kind → one-agents.mjs:191
820
+ * skips the file. (The non-empty body is checked separately.) */
821
+ export const AGENT_REQUIRED = ['name', 'kind'];
822
+ /** Recommended: every reader falls back without it, but the fallback is a
823
+ * different agent on the page (title → dir, description → 'Generic helpful
824
+ * assistant', tier/domain → inferred from the id). Warned when absent. */
825
+ export const AGENT_RECOMMENDED = ['title', 'tier', 'domain', 'subscribes'];
826
+ /** The closed enums the web schema owns (agent-schema.ts) — role-types.ts INFERS
827
+ * a value from the id when the declared one is off-enum, so an off-enum value
828
+ * is a silent re-placement on the org chart, not a load failure. */
829
+ export const AGENT_ENUMS = {
830
+ kind: ['agent', 'skill', 'pack', 'seed'],
831
+ tier: ['chairman', 'ceo', 'director', 'specialist'],
832
+ domain: ['marketing', 'sales', 'service', 'education', 'engineering', 'finance', 'community', 'governance'],
833
+ tone: ['primary', 'secondary', 'tertiary', 'neutral'],
834
+ };
835
+ /** Keys the channels parser (channels/src/lib/agent-md.ts) can only read as a
836
+ * BLOCK list. An inline `[a, b]` is stored as the string "[a, b]", so
837
+ * `Array.isArray` fails in resolvePersona and the field is dropped at runtime. */
838
+ export const AGENT_BLOCK_LIST_KEYS = ['tools', 'subscribes', 'emits', 'skills', 'tags'];
839
+ /** Every top-level key at least one reader consumes — the union of AgentMeta
840
+ * (agent-md.ts:435), agentFrontmatterSchema (agent-schema.ts:229), Persona
841
+ * (channels/src/context.ts:590), compile.ts:319, one-agents.mjs:130,
842
+ * role-types.ts and the publish path. A key outside this set is read by
843
+ * nothing; the validator names it rather than refusing it. `direction` is NOT here on
844
+ * purpose: C20 deleted it from 118 corpus files (0 readers; 93/95 `bidirectional`
845
+ * merely restated subscribes+emits, the rest contradicted them) — keeping it out
846
+ * is what makes `--strict` refuse a resurrection. */
847
+ export const AGENT_KNOWN_KEYS = new Set([
848
+ // identity + chart
849
+ 'agentmd', 'name', 'kind', 'title', 'tier', 'reports_to', 'reportsTo', 'tone', 'icon', 'iconName', 'uid',
850
+ 'tagline', 'domain', 'kpis', 'description', 'version', 'model', 'group', 'tags', 'channels', 'lifecycle',
851
+ 'sensitivity', 'starters', 'skills', 'tools', 'features', 'subscribes', 'emits', 'url',
852
+ // runtime (Persona)
853
+ 'intents', 'maxSteps', 'integrations', 'hooks', 'remote', 'subAgents',
854
+ // uAgents compile
855
+ 'seed', 'port', 'agentverse', 'mailbox', 'startup', 'shutdown', 'intervals', 'endpoints', 'bureau',
856
+ 'when_to_use', 'inputSchema', 'outputSchema', 'summary', 'evals',
857
+ // payments
858
+ 'wallet', 'accepts', 'price', 'currency',
859
+ // A/B + web-only blocks
860
+ 'variants', 'goals', 'journey', 'sections', 'branding', 'theme', 'ui', 'funnel', 'analytics', 'i18n', 'triggers',
861
+ ]);
862
+ /** Top-level frontmatter keys — a column-0 `key:` line. The same extraction the
863
+ * corpus histogram in text/agents-spec.md used, so validator and measurement
864
+ * agree by construction. */
865
+ function topLevelKeys(fm) {
866
+ const keys = [];
867
+ const re = /^([A-Za-z_][A-Za-z0-9_-]*):/gm;
868
+ let m;
869
+ while ((m = re.exec(fm)))
870
+ keys.push(m[1]);
871
+ return keys;
872
+ }
873
+ /** The scalar value of a top-level `key:` line, unquoted, trailing `# comment` stripped. */
874
+ function scalarOf(fm, key) {
875
+ const m = new RegExp(`^${key}:[ \\t]*(.*)$`, 'm').exec(fm);
876
+ if (!m)
877
+ return undefined;
878
+ return m[1].replace(/\s+#.*$/, '').trim().replace(/^["']|["']$/g, '');
879
+ }
880
+ export function validate(path, opts = {}) {
774
881
  const errors = [];
882
+ const warnings = [];
883
+ const unknownKeys = [];
884
+ const door = opts.door ?? 'validate';
885
+ const done = () => {
886
+ if (opts.strict && door === 'validate') {
887
+ errors.push(...warnings);
888
+ warnings.length = 0;
889
+ }
890
+ return { errors, warnings, unknownKeys };
891
+ };
892
+ if (!existsSync(path)) {
893
+ errors.push(`not found: ${path}`);
894
+ return done();
895
+ }
896
+ const text = readFileSync(path, 'utf8');
775
897
  if (!text.startsWith('---')) {
776
898
  errors.push('missing frontmatter — agent.md must start with `---`');
777
- return { errors };
899
+ return done();
778
900
  }
779
901
  const fmMatch = text.match(/^---\n([\s\S]*?)\n---/);
780
902
  if (!fmMatch) {
781
903
  errors.push('frontmatter not terminated — missing closing `---`');
782
- return { errors };
904
+ return done();
783
905
  }
784
906
  const fm = fmMatch[1];
907
+ const body = text.slice(fmMatch[0].length).trim();
785
908
  const nameMatch = /^name:\s*(\S+)/m.exec(fm);
786
909
  if (!nameMatch) {
787
910
  errors.push('missing required field: name');
@@ -811,7 +934,61 @@ function validate(path) {
811
934
  }
812
935
  }
813
936
  }
814
- return { errors };
937
+ // The publish door stops here — its gate is the receiver's own (name), and
938
+ // the spec forbids a door changing behaviour under a stricter validator.
939
+ if (door === 'publish')
940
+ return done();
941
+ // ── The spec's required set (text/agents-spec.md § required) ──────────────
942
+ const keys = topLevelKeys(fm);
943
+ const present = new Set(keys);
944
+ const kind = scalarOf(fm, 'kind');
945
+ if (!present.has('kind') || !kind) {
946
+ errors.push('missing required field: kind — `kind: agent` is what one-agents.mjs:191 and the spec key on; without it the file is the other genus (text/template-agent.md)');
947
+ }
948
+ else if (kind !== 'agent') {
949
+ errors.push(`kind: ${kind} — \`agent validate\` checks the kind: agent spec; a ${kind} file goes through \`oneie skill validate\``);
950
+ }
951
+ if (!body) {
952
+ errors.push('empty body — the markdown after the closing `---` IS the system prompt; empty, channels substitutes personas.one.systemPrompt (context.ts:593) and the agent silently becomes a different agent');
953
+ }
954
+ // ── Recommended: absent → a fallback that is a different agent on the page ──
955
+ for (const k of AGENT_RECOMMENDED) {
956
+ if (!present.has(k))
957
+ warnings.push(`missing recommended field: ${k}`);
958
+ }
959
+ if (!present.has('description') && !present.has('tagline')) {
960
+ warnings.push('missing recommended field: description (or tagline) — Persona falls back to "Generic helpful assistant" (personas.ts:60)');
961
+ }
962
+ else if (!present.has('description') && present.has('tagline')) {
963
+ warnings.push('tagline without description — the chart reads tagline (role-types.ts:396); the runtime reads only description (context.ts:591) and will answer as "Generic helpful assistant"');
964
+ }
965
+ // ── Off-enum values: the chart INFERS a placement instead of using yours ───
966
+ for (const [k, allowed] of Object.entries(AGENT_ENUMS)) {
967
+ if (k === 'kind')
968
+ continue;
969
+ const v = scalarOf(fm, k);
970
+ if (v !== undefined && v !== '' && !allowed.includes(v)) {
971
+ warnings.push(`${k}: ${v} is not one of ${allowed.join('|')} — the web schema reports it and role-types.ts infers ${k} from the id instead`);
972
+ }
973
+ }
974
+ // ── Shapes the runtime cannot read ─────────────────────────────────────────
975
+ for (const k of AGENT_BLOCK_LIST_KEYS) {
976
+ if (new RegExp(`^${k}:[ \\t]*\\[`, 'm').test(fm)) {
977
+ warnings.push(`${k}: is an inline [a, b] list — channels/src/lib/agent-md.ts stores it as a string and resolvePersona drops it; write a block list`);
978
+ }
979
+ }
980
+ if (/^\s+-\s+(signal|tag):\s/m.test(fm)) {
981
+ warnings.push('a `- signal: <tag>` list item — web keeps bare strings only, channels keeps the value, one-agents.mjs strips the prefix; write the bare tag');
982
+ }
983
+ // ── Keys read by nothing — named, never silently accepted ─────────────────
984
+ for (const k of keys) {
985
+ if (!AGENT_KNOWN_KEYS.has(k) && !unknownKeys.includes(k))
986
+ unknownKeys.push(k);
987
+ }
988
+ if (unknownKeys.length) {
989
+ warnings.push(`unknown keys (read by no reader): ${unknownKeys.join(', ')}`);
990
+ }
991
+ return done();
815
992
  }
816
993
  function lint(path) {
817
994
  if (!existsSync(path))
@@ -940,6 +1117,57 @@ function warnSkillGap(found, target) {
940
1117
  }
941
1118
  }
942
1119
  }
1120
+ /** Why each recommended field is worth declaring. Absent ⇒ a capability the hosted agent simply does not have. */
1121
+ const AGENTVERSE_RECOMMENDED = [
1122
+ ['agentverse', 'no Agentverse registration URL — the agent is hosted but not discoverable by name'],
1123
+ ['mailbox', 'mailbox is off — the agent can only be reached while it is running, never asynchronously'],
1124
+ ['endpoints', 'no endpoints — nothing outside the uAgents protocol can call it'],
1125
+ ['bureau', 'no bureau — it runs alone rather than beside its siblings'],
1126
+ ['port', 'no port — the compiler leaves the uAgents default (8000)'],
1127
+ ['when_to_use', 'no when_to_use — a discovering agent has nothing to route on'],
1128
+ ['version', 'no version — two deploys are indistinguishable in the registry'],
1129
+ // The three that emit BEHAVIOUR rather than configuration. Listed for the same
1130
+ // reason as the rest — the cycle enumerated eleven fields and a list silently
1131
+ // covering seven of them reads as an oversight — but they are the ones an operator
1132
+ // should most often decline: each buys a real model call on a schedule.
1133
+ ['intervals', 'no intervals — the agent only ever speaks when spoken to'],
1134
+ ['startup', 'no startup — it announces nothing when it boots'],
1135
+ ['shutdown', 'no shutdown — it announces nothing when it stops'],
1136
+ ];
1137
+ /**
1138
+ * Is this agent.md ready to be a HOSTED Agentverse agent?
1139
+ *
1140
+ * `seed` is the only REQUIRED field, and it is required for one reason: it is the
1141
+ * deterministic identity. Without it every deploy of the same file is a different
1142
+ * agent as far as the network is concerned — a fresh address, so every peer that
1143
+ * learned the old one is now talking to nobody.
1144
+ */
1145
+ export function agentverseReadiness(agentMd) {
1146
+ const { meta } = parseAgentMd(agentMd);
1147
+ const missing = [];
1148
+ // The emitter's own predicate (compile.ts:512), deliberately — not `in`.
1149
+ if (!meta.seed)
1150
+ missing.push('seed');
1151
+ const recommended = AGENTVERSE_RECOMMENDED
1152
+ .filter(([k]) => !meta[k])
1153
+ .map(([k, why]) => `${k}: ${why}`);
1154
+ return { ready: missing.length === 0, missing, recommended };
1155
+ }
1156
+ /**
1157
+ * Say what is missing, in `warnSkillGap`'s register and on the same stream — stderr,
1158
+ * so a `--json` stdout stays one machine-readable line. The caller decides whether to
1159
+ * refuse; this function only speaks.
1160
+ */
1161
+ function warnAgentverseGap(r) {
1162
+ if (r.missing.includes('seed')) {
1163
+ console.error('warning: this agent declares no seed: — its Agentverse identity is NOT deterministic.');
1164
+ console.error(' The compiled Python emits `Agent(name=...)` with no `seed=`, so uAgents derives a');
1165
+ console.error(' fresh key: a NEW agent address on every deploy, and every peer holding the old');
1166
+ console.error(' address is talking to nobody. Add `seed: <a secret phrase>` to the frontmatter.');
1167
+ }
1168
+ for (const line of r.recommended)
1169
+ console.error(` also absent — ${line}`);
1170
+ }
943
1171
  export function compileTarget(content, target, skills = {}) {
944
1172
  const why = UNIMPLEMENTED_TARGETS[target];
945
1173
  if (why) {
package/dist/src/auth.js CHANGED
@@ -1,9 +1,8 @@
1
1
  import { Command } from 'commander';
2
+ import { CONFIG_DIR } from './lib/paths.js';
2
3
  import { writeFileSync, readFileSync, existsSync, mkdirSync, chmodSync, unlinkSync, renameSync, } from 'node:fs';
3
4
  import { resolve, join } from 'node:path';
4
- import { homedir } from 'node:os';
5
5
  import { requestDeviceCode, openBrowser, pollForToken } from './device-flow.js';
6
- const CONFIG_DIR = resolve(homedir(), '.config', 'oneie');
7
6
  const KEY_FILE = resolve(CONFIG_DIR, 'key');
8
7
  const DEFAULT_API = process.env.ONEIE_BASE_URL ?? 'https://one.ie';
9
8
  const CLI_CLIENT_ID = 'oneie-cli';
@@ -12,7 +11,7 @@ const CLI_SCOPE = 'read write';
12
11
  * Command shape, same action, registered under two parents (contract #11). */
13
12
  export function buildLoginCommand() {
14
13
  const cmd = new Command('login')
15
- .description('Sign in via browser and persist token to ~/.config/oneie/key')
14
+ .description('Sign in via browser and persist token to ~/.config/one/key')
16
15
  .option('--key <key>', 'Skip browser flow — store API key directly (or set ONEIE_API_KEY)')
17
16
  .option('--api <url>', 'API base URL', DEFAULT_API)
18
17
  .action(async (opts) => {
@@ -39,7 +38,7 @@ export function buildLoginCommand() {
39
38
  // (c) Poll until token or expiry
40
39
  process.stderr.write(`Waiting for sign-in (expires in ${dc.expires_in}s)…\n`);
41
40
  const token = await pollForToken(base, CLI_CLIENT_ID, dc.device_code, dc.interval, dc.expires_in);
42
- // (d) Write token to ~/.config/oneie/key mode 0600
41
+ // (d) Write token to ~/.config/one/key mode 0600
43
42
  writeKey(token.access_token);
44
43
  // (e) Print success — emit userId if server returned it
45
44
  const userId = token.userId ?? 'unknown';
@@ -164,6 +164,12 @@ export async function compileNode(dir, agencySlug, opts) {
164
164
  // ai/agents/*.md → world:create-thing (agent)
165
165
  for (const f of walk(join(dir, 'ai', 'agents'), '.md')) {
166
166
  try {
167
+ // A README is documentation ABOUT the agents beside it, never an agent.
168
+ // `ai/agents/templates/README.md` explains the starter org chart, has no
169
+ // frontmatter, and was reported as `frontmatter \`name\` required` on every
170
+ // push — an error the author cannot fix without deleting the explanation.
171
+ if (basename(f).toLowerCase() === 'readme.md')
172
+ continue;
167
173
  const md = readFileSync(f, 'utf8');
168
174
  const fm = frontmatter(md);
169
175
  if (!fm.name) {
@@ -223,6 +229,18 @@ export async function compileNode(dir, agencySlug, opts) {
223
229
  string: 'text', url: 'text', number: 'number', currency: 'currency', date: 'date',
224
230
  tags: 'tags', select: 'select', image: 'image', markdown: 'markdown', relation: 'relation', bool: 'select',
225
231
  };
232
+ // ONE call carrying EVERY type, not one call per file. `world:declare-types`
233
+ // REPLACES the whole manifest (world-receivers.ts:1953 — `INSERT … ON CONFLICT
234
+ // DO UPDATE SET manifest = excluded.manifest`), and push.ts sends compiled
235
+ // items sequentially, so a per-file call made every type after the first
236
+ // delete the one before it. Measured 2026-09-22 on a two-file fixture:
237
+ // `declare-types calls emitted: 2 → ["order"], ["product"]`, push reports
238
+ // `Pushed 2/2 item(s).`, and the workspace keeps ONE type. Silent, and it is
239
+ // the exact path baas-features.md sells as "declare your types, a full admin
240
+ // appears" — so a starter could never ship a type SET. Files are walked in a
241
+ // stable order and the batch keeps it, so the manifest order is the file order.
242
+ const declaredTypes = [];
243
+ const typeFiles = [];
226
244
  for (const f of walk(join(dir, 'data', 'types'), '.toml')) {
227
245
  try {
228
246
  const toml = parseToml(readFileSync(f, 'utf8'));
@@ -244,12 +262,22 @@ export async function compileNode(dir, agencySlug, opts) {
244
262
  columns: cols,
245
263
  fields: cols,
246
264
  };
247
- compiled.push({ path: f, receiver: 'world:declare-types', payload: { group: agencySlug, types: [type] } });
265
+ declaredTypes.push(type);
266
+ typeFiles.push(f);
248
267
  }
249
268
  catch (e) {
250
269
  errors.push({ path: f, message: String(e) });
251
270
  }
252
271
  }
272
+ if (declaredTypes.length > 0) {
273
+ // `path` names every file that fed the batch — a dry-run must still say which
274
+ // TOMLs are in play, and an error must be traceable to more than "data/types".
275
+ compiled.push({
276
+ path: typeFiles.join(', '),
277
+ receiver: 'world:declare-types',
278
+ payload: { group: agencySlug, types: declaredTypes },
279
+ });
280
+ }
253
281
  // data/lifecycles/*.toml → lifecycle:save
254
282
  // Build the LifecycleDef that the receiver's saveDef() persists. The TOML authors the
255
283
  // human bits {id,label,tags,description,[[stages]]}; the rest is derived deterministically: