oneie 4.0.3 → 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.
Files changed (42) hide show
  1. package/README.md +80 -0
  2. package/dist/package.json +4 -4
  3. package/dist/src/agent.d.ts +73 -0
  4. package/dist/src/agent.js +486 -53
  5. package/dist/src/auth.js +3 -4
  6. package/dist/src/compiler.js +38 -5
  7. package/dist/src/doctor.js +61 -6
  8. package/dist/src/endpoint.d.ts +2 -0
  9. package/dist/src/endpoint.js +250 -0
  10. package/dist/src/eval.js +1 -0
  11. package/dist/src/fn.js +5 -8
  12. package/dist/src/index.js +8 -0
  13. package/dist/src/init.js +33 -3
  14. package/dist/src/lib/agent-env.js +7 -0
  15. package/dist/src/lib/client.js +16 -7
  16. package/dist/src/lib/keyfile.d.ts +130 -0
  17. package/dist/src/lib/keyfile.js +381 -0
  18. package/dist/src/lib/paths.d.ts +33 -0
  19. package/dist/src/lib/paths.js +77 -0
  20. package/dist/src/lib/shop-init.d.ts +62 -0
  21. package/dist/src/lib/shop-init.js +63 -0
  22. package/dist/src/lib/tasks-digest.d.ts +66 -0
  23. package/dist/src/lib/tasks-digest.js +200 -0
  24. package/dist/src/lib/tasks-graph.d.ts +78 -0
  25. package/dist/src/lib/tasks-graph.js +425 -0
  26. package/dist/src/lib/vaultfile.d.ts +73 -0
  27. package/dist/src/lib/vaultfile.js +184 -0
  28. package/dist/src/media.d.ts +2 -0
  29. package/dist/src/media.js +256 -0
  30. package/dist/src/plugin.js +10 -1
  31. package/dist/src/shop.d.ts +10 -0
  32. package/dist/src/shop.js +73 -0
  33. package/dist/src/skill.js +128 -12
  34. package/dist/src/tasks.d.ts +2 -0
  35. package/dist/src/tasks.js +424 -0
  36. package/dist/src/templates.js +8 -0
  37. package/dist/src/wallet.d.ts +9 -0
  38. package/dist/src/wallet.js +259 -1
  39. package/dist/src/workflow.js +54 -3
  40. package/package.json +4 -4
  41. package/dist/src/templates/_node/site/one.config.d.ts +0 -2
  42. package/dist/src/templates/_node/site/one.config.js +0 -22
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
@@ -85,11 +102,14 @@ Every actor — human or agent — gets real, self-custodied multi-chain wallets
85
102
  ```bash
86
103
  one wallet create --workspace <slug> --kind agent # provision a wallet row (idempotent)
87
104
  one wallet get --workspace <slug> # credits, ceiling, live balances, delegated wallets
105
+ one wallet register --from keys.json --workspace <slug> # register the PUBLIC receiving addresses — first write wins, permanent
88
106
  one wallet transactions --workspace <slug> --limit 50 # unified feed across every settlement rail
89
107
  one wallet faucet <address> --chain sui # fund from testnet — sui/sol auto-fund, others return a manual URL
90
108
  one wallet send <to> --chain SUI --amount 5 --payment-tx <hash> --workspace <slug>
91
109
  ```
92
110
 
111
+ `register` reads a `wallet keygen` output but transmits only its four address fields — the map it sends is built key-by-key from a fixed chain whitelist, so a `mnemonic` or `privateKey` in that file has no route onto the wire. The write is first-write-wins per chain and cannot be corrected afterwards (`address_conflict`), so it prints the addresses and asks for confirmation; `--yes` skips the prompt for scripted provisioning (needed when the JSON arrives on stdin, which leaves no terminal to answer with).
112
+
93
113
  `send` never signs — sign and broadcast the transfer yourself first (`agent-wallet-client.ts` for an agent, `/w` for a human), then pass the resulting transaction hash. The private key never crosses this command. `faucet` talks to `pay.one.ie` directly (its own protocol, not the `/ask` gateway) and needs no credential — funding any address is public by design, funding ≠ ownership.
94
114
 
95
115
  ## Operate the business
@@ -110,6 +130,66 @@ one social list --group G | create --group G ... # draft/publish/list socia
110
130
  one fn run <name> '{json}' | list # call an allowlisted analytics/routing RPC
111
131
  one coordinate recall [about] | reputation [uid] # cross-session memory and reputation
112
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"}'
113
193
  ```
114
194
 
115
195
  ## Chat — fan in · fan out
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneie",
3
- "version": "4.0.3",
3
+ "version": "4.2.1",
4
4
  "description": "ONE agent CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,15 +15,15 @@
15
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
- "test": "vitest run",
18
+ "test": "bash ../../.claude/scripts/gate-run.sh test-cli -- vitest run",
19
19
  "prepublishOnly": "bun run build"
20
20
  },
21
21
  "dependencies": {
22
22
  "commander": "^12.0.0",
23
- "@oneie/sdk": "^0.14.9"
23
+ "@oneie/sdk": "^0.16.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@oneie/evals": "workspace:*",
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,2 +1,75 @@
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;
51
+ /**
52
+ * Targets the CLI can actually emit. `a2a` and `erc8004` were advertised in
53
+ * --target help and in the docs but had no branch — they fell through to
54
+ * `return content`, echoing the raw agent.md back as if it had compiled. They
55
+ * now FAIL LOUDLY: there is no a2a/erc8004 compiler anywhere in @oneie/sdk to
56
+ * delegate to, and inventing one here would be worse than an honest error.
57
+ */
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;
75
+ export declare function compileTarget(content: string, target: string, skills?: Record<string, string>): string;