oneie 3.8.3 → 4.0.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 +86 -0
- package/README.md +63 -952
- package/dist/package.json +38 -0
- package/dist/src/agent.d.ts +2 -0
- package/dist/src/agent.js +888 -0
- package/dist/src/args.d.ts +9 -0
- package/dist/src/args.js +61 -0
- package/dist/src/auth.d.ts +6 -0
- package/dist/src/auth.js +122 -0
- package/dist/{banner.d.ts → src/banner.d.ts} +0 -1
- package/dist/src/banner.js +16 -0
- package/dist/src/broadcast.d.ts +6 -0
- package/dist/src/broadcast.js +150 -0
- package/dist/src/catalog.d.ts +2 -0
- package/dist/src/catalog.js +78 -0
- package/dist/src/chat.d.ts +2 -0
- package/dist/src/chat.js +92 -0
- package/dist/src/client.d.ts +5 -0
- package/dist/src/client.js +151 -0
- package/dist/src/compiler.d.ts +36 -0
- package/dist/src/compiler.js +314 -0
- package/dist/src/config.d.ts +24 -0
- package/dist/src/config.js +70 -0
- package/dist/src/connect.d.ts +2 -0
- package/dist/src/connect.js +64 -0
- package/dist/src/coordinate.d.ts +3 -0
- package/dist/src/coordinate.js +58 -0
- package/dist/src/create.d.ts +2 -0
- package/dist/src/create.js +113 -0
- package/dist/src/deploy.d.ts +2 -0
- package/dist/src/deploy.js +19 -0
- package/dist/src/dev.d.ts +2 -0
- package/dist/src/dev.js +75 -0
- package/dist/src/device-flow.d.ts +57 -0
- package/dist/src/device-flow.js +173 -0
- package/dist/src/doctor.d.ts +26 -0
- package/dist/src/doctor.js +91 -0
- package/dist/src/env.d.ts +3 -0
- package/dist/src/env.js +37 -0
- package/dist/src/eval.d.ts +2 -0
- package/dist/src/eval.js +42 -0
- package/dist/src/fn.d.ts +2 -0
- package/dist/src/fn.js +73 -0
- package/dist/src/group.d.ts +2 -0
- package/dist/src/group.js +115 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +102 -0
- package/dist/src/init.d.ts +11 -0
- package/dist/src/init.js +121 -0
- package/dist/src/lib/agent-env.d.ts +5 -0
- package/dist/src/lib/agent-env.js +25 -0
- package/dist/src/lib/api-path.d.ts +1 -0
- package/dist/src/lib/api-path.js +9 -0
- package/dist/src/lib/client.d.ts +16 -0
- package/dist/src/lib/client.js +57 -0
- package/dist/src/lib/launch-claude.d.ts +5 -0
- package/dist/src/lib/launch-claude.js +45 -0
- package/dist/src/links.d.ts +5 -0
- package/dist/src/links.js +44 -0
- package/dist/src/onboard.d.ts +16 -0
- package/dist/src/onboard.js +146 -0
- package/dist/src/plugin.d.ts +2 -0
- package/dist/src/plugin.js +184 -0
- package/dist/src/push.d.ts +2 -0
- package/dist/src/push.js +114 -0
- package/dist/src/render.d.ts +21 -0
- package/dist/src/render.js +32 -0
- package/dist/src/setup.d.ts +6 -0
- package/dist/src/setup.js +126 -0
- package/dist/src/ship.d.ts +2 -0
- package/dist/src/ship.js +18 -0
- package/dist/src/skill-parser.d.ts +14 -0
- package/dist/src/skill-parser.js +113 -0
- package/dist/src/skill.d.ts +2 -0
- package/dist/src/skill.js +377 -0
- package/dist/src/slug.d.ts +2 -0
- package/dist/src/slug.js +6 -0
- package/dist/src/social.d.ts +2 -0
- package/dist/src/social.js +87 -0
- package/dist/src/staff.d.ts +2 -0
- package/dist/src/staff.js +93 -0
- package/dist/src/status.d.ts +2 -0
- package/dist/src/status.js +46 -0
- package/dist/src/substrate.d.ts +2 -0
- package/dist/src/substrate.js +243 -0
- package/dist/src/templates/_node/site/one.config.d.ts +2 -0
- package/dist/src/templates/_node/site/one.config.js +22 -0
- package/dist/src/templates.d.ts +1 -0
- package/dist/src/templates.js +205 -0
- package/dist/src/trade.d.ts +2 -0
- package/dist/src/trade.js +95 -0
- package/dist/src/trail.d.ts +2 -0
- package/dist/src/trail.js +41 -0
- package/dist/src/validate.d.ts +13 -0
- package/dist/src/validate.js +35 -0
- package/dist/src/wallet.d.ts +9 -0
- package/dist/src/wallet.js +209 -0
- package/package.json +26 -54
- package/LICENSE.md +0 -89
- package/dist/admin/build.d.ts +0 -15
- package/dist/admin/build.d.ts.map +0 -1
- package/dist/admin/build.js +0 -295
- package/dist/admin/build.js.map +0 -1
- package/dist/admin/index.d.ts +0 -24
- package/dist/admin/index.d.ts.map +0 -1
- package/dist/admin/index.js +0 -98
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/list.d.ts +0 -14
- package/dist/admin/list.d.ts.map +0 -1
- package/dist/admin/list.js +0 -90
- package/dist/admin/list.js.map +0 -1
- package/dist/admin/manifest.d.ts +0 -86
- package/dist/admin/manifest.d.ts.map +0 -1
- package/dist/admin/manifest.js +0 -183
- package/dist/admin/manifest.js.map +0 -1
- package/dist/admin/monorepo.d.ts +0 -25
- package/dist/admin/monorepo.d.ts.map +0 -1
- package/dist/admin/monorepo.js +0 -59
- package/dist/admin/monorepo.js.map +0 -1
- package/dist/admin/release.d.ts +0 -17
- package/dist/admin/release.d.ts.map +0 -1
- package/dist/admin/release.js +0 -144
- package/dist/admin/release.js.map +0 -1
- package/dist/admin/sync.d.ts +0 -14
- package/dist/admin/sync.d.ts.map +0 -1
- package/dist/admin/sync.js +0 -104
- package/dist/admin/sync.js.map +0 -1
- package/dist/admin/validate.d.ts +0 -15
- package/dist/admin/validate.d.ts.map +0 -1
- package/dist/admin/validate.js +0 -169
- package/dist/admin/validate.js.map +0 -1
- package/dist/banner.d.ts.map +0 -1
- package/dist/banner.js +0 -15
- package/dist/banner.js.map +0 -1
- package/dist/clone-docs.d.ts +0 -17
- package/dist/clone-docs.d.ts.map +0 -1
- package/dist/clone-docs.js +0 -62
- package/dist/clone-docs.js.map +0 -1
- package/dist/clone-web.d.ts +0 -12
- package/dist/clone-web.d.ts.map +0 -1
- package/dist/clone-web.js +0 -50
- package/dist/clone-web.js.map +0 -1
- package/dist/commands/agent.d.ts +0 -20
- package/dist/commands/agent.d.ts.map +0 -1
- package/dist/commands/agent.js +0 -315
- package/dist/commands/agent.js.map +0 -1
- package/dist/commands/ask.d.ts +0 -4
- package/dist/commands/ask.d.ts.map +0 -1
- package/dist/commands/ask.js +0 -8
- package/dist/commands/ask.js.map +0 -1
- package/dist/commands/bounty.d.ts +0 -4
- package/dist/commands/bounty.d.ts.map +0 -1
- package/dist/commands/bounty.js +0 -24
- package/dist/commands/bounty.js.map +0 -1
- package/dist/commands/buy.d.ts +0 -19
- package/dist/commands/buy.d.ts.map +0 -1
- package/dist/commands/buy.js +0 -63
- package/dist/commands/buy.js.map +0 -1
- package/dist/commands/capabilities.d.ts +0 -4
- package/dist/commands/capabilities.d.ts.map +0 -1
- package/dist/commands/capabilities.js +0 -18
- package/dist/commands/capabilities.js.map +0 -1
- package/dist/commands/claw.d.ts +0 -4
- package/dist/commands/claw.d.ts.map +0 -1
- package/dist/commands/claw.js +0 -14
- package/dist/commands/claw.js.map +0 -1
- package/dist/commands/commend.d.ts +0 -4
- package/dist/commands/commend.d.ts.map +0 -1
- package/dist/commands/commend.js +0 -13
- package/dist/commands/commend.js.map +0 -1
- package/dist/commands/completion.d.ts +0 -4
- package/dist/commands/completion.d.ts.map +0 -1
- package/dist/commands/completion.js +0 -49
- package/dist/commands/completion.js.map +0 -1
- package/dist/commands/config.d.ts +0 -4
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -78
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/deploy.d.ts +0 -4
- package/dist/commands/deploy.d.ts.map +0 -1
- package/dist/commands/deploy.js +0 -45
- package/dist/commands/deploy.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -4
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -72
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/domain.d.ts +0 -4
- package/dist/commands/domain.d.ts.map +0 -1
- package/dist/commands/domain.js +0 -19
- package/dist/commands/domain.js.map +0 -1
- package/dist/commands/export.d.ts +0 -4
- package/dist/commands/export.d.ts.map +0 -1
- package/dist/commands/export.js +0 -15
- package/dist/commands/export.js.map +0 -1
- package/dist/commands/fade.d.ts +0 -4
- package/dist/commands/fade.d.ts.map +0 -1
- package/dist/commands/fade.js +0 -15
- package/dist/commands/fade.js.map +0 -1
- package/dist/commands/flag.d.ts +0 -4
- package/dist/commands/flag.d.ts.map +0 -1
- package/dist/commands/flag.js +0 -13
- package/dist/commands/flag.js.map +0 -1
- package/dist/commands/forget.d.ts +0 -4
- package/dist/commands/forget.d.ts.map +0 -1
- package/dist/commands/forget.js +0 -16
- package/dist/commands/forget.js.map +0 -1
- package/dist/commands/frontier.d.ts +0 -4
- package/dist/commands/frontier.d.ts.map +0 -1
- package/dist/commands/frontier.js +0 -11
- package/dist/commands/frontier.js.map +0 -1
- package/dist/commands/group.d.ts +0 -3
- package/dist/commands/group.d.ts.map +0 -1
- package/dist/commands/group.js +0 -123
- package/dist/commands/group.js.map +0 -1
- package/dist/commands/health.d.ts +0 -4
- package/dist/commands/health.d.ts.map +0 -1
- package/dist/commands/health.js +0 -11
- package/dist/commands/health.js.map +0 -1
- package/dist/commands/highways.d.ts +0 -4
- package/dist/commands/highways.d.ts.map +0 -1
- package/dist/commands/highways.js +0 -14
- package/dist/commands/highways.js.map +0 -1
- package/dist/commands/hire.d.ts +0 -4
- package/dist/commands/hire.d.ts.map +0 -1
- package/dist/commands/hire.js +0 -16
- package/dist/commands/hire.js.map +0 -1
- package/dist/commands/init.d.ts +0 -17
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -308
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/invite.d.ts +0 -4
- package/dist/commands/invite.d.ts.map +0 -1
- package/dist/commands/invite.js +0 -37
- package/dist/commands/invite.js.map +0 -1
- package/dist/commands/know.d.ts +0 -4
- package/dist/commands/know.d.ts.map +0 -1
- package/dist/commands/know.js +0 -8
- package/dist/commands/know.js.map +0 -1
- package/dist/commands/launch.d.ts +0 -4
- package/dist/commands/launch.d.ts.map +0 -1
- package/dist/commands/launch.js +0 -16
- package/dist/commands/launch.js.map +0 -1
- package/dist/commands/mark.d.ts +0 -4
- package/dist/commands/mark.d.ts.map +0 -1
- package/dist/commands/mark.js +0 -15
- package/dist/commands/mark.js.map +0 -1
- package/dist/commands/pay.d.ts +0 -4
- package/dist/commands/pay.d.ts.map +0 -1
- package/dist/commands/pay.js +0 -21
- package/dist/commands/pay.js.map +0 -1
- package/dist/commands/pipe.d.ts +0 -4
- package/dist/commands/pipe.d.ts.map +0 -1
- package/dist/commands/pipe.js +0 -35
- package/dist/commands/pipe.js.map +0 -1
- package/dist/commands/publish.d.ts +0 -4
- package/dist/commands/publish.d.ts.map +0 -1
- package/dist/commands/publish.js +0 -23
- package/dist/commands/publish.js.map +0 -1
- package/dist/commands/recall.d.ts +0 -4
- package/dist/commands/recall.d.ts.map +0 -1
- package/dist/commands/recall.js +0 -12
- package/dist/commands/recall.js.map +0 -1
- package/dist/commands/repl.d.ts +0 -4
- package/dist/commands/repl.d.ts.map +0 -1
- package/dist/commands/repl.js +0 -56
- package/dist/commands/repl.js.map +0 -1
- package/dist/commands/reveal.d.ts +0 -4
- package/dist/commands/reveal.d.ts.map +0 -1
- package/dist/commands/reveal.js +0 -11
- package/dist/commands/reveal.js.map +0 -1
- package/dist/commands/revenue.d.ts +0 -4
- package/dist/commands/revenue.d.ts.map +0 -1
- package/dist/commands/revenue.js +0 -11
- package/dist/commands/revenue.js.map +0 -1
- package/dist/commands/select.d.ts +0 -4
- package/dist/commands/select.d.ts.map +0 -1
- package/dist/commands/select.js +0 -19
- package/dist/commands/select.js.map +0 -1
- package/dist/commands/sell.d.ts +0 -15
- package/dist/commands/sell.d.ts.map +0 -1
- package/dist/commands/sell.js +0 -49
- package/dist/commands/sell.js.map +0 -1
- package/dist/commands/signal.d.ts +0 -4
- package/dist/commands/signal.d.ts.map +0 -1
- package/dist/commands/signal.js +0 -8
- package/dist/commands/signal.js.map +0 -1
- package/dist/commands/stats.d.ts +0 -4
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js +0 -11
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/status.d.ts +0 -4
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -18
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/subscribe.d.ts +0 -14
- package/dist/commands/subscribe.d.ts.map +0 -1
- package/dist/commands/subscribe.js +0 -33
- package/dist/commands/subscribe.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -4
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js +0 -20
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/tail.d.ts +0 -4
- package/dist/commands/tail.d.ts.map +0 -1
- package/dist/commands/tail.js +0 -51
- package/dist/commands/tail.js.map +0 -1
- package/dist/commands/warn.d.ts +0 -4
- package/dist/commands/warn.d.ts.map +0 -1
- package/dist/commands/warn.js +0 -15
- package/dist/commands/warn.js.map +0 -1
- package/dist/copy-claude-config.d.ts +0 -2
- package/dist/copy-claude-config.d.ts.map +0 -1
- package/dist/copy-claude-config.js +0 -32
- package/dist/copy-claude-config.js.map +0 -1
- package/dist/create-org-profile.d.ts +0 -10
- package/dist/create-org-profile.d.ts.map +0 -1
- package/dist/create-org-profile.js +0 -136
- package/dist/create-org-profile.js.map +0 -1
- package/dist/create-user-profile.d.ts +0 -9
- package/dist/create-user-profile.d.ts.map +0 -1
- package/dist/create-user-profile.js +0 -115
- package/dist/create-user-profile.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -375
- package/dist/index.js.map +0 -1
- package/dist/lib/agent-detection.d.ts +0 -19
- package/dist/lib/agent-detection.d.ts.map +0 -1
- package/dist/lib/agent-detection.js +0 -87
- package/dist/lib/agent-detection.js.map +0 -1
- package/dist/lib/args.d.ts +0 -11
- package/dist/lib/args.d.ts.map +0 -1
- package/dist/lib/args.js +0 -57
- package/dist/lib/args.js.map +0 -1
- package/dist/lib/config.d.ts +0 -12
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js +0 -38
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/detect.d.ts +0 -45
- package/dist/lib/detect.d.ts.map +0 -1
- package/dist/lib/detect.js +0 -221
- package/dist/lib/detect.js.map +0 -1
- package/dist/lib/http.d.ts +0 -9
- package/dist/lib/http.d.ts.map +0 -1
- package/dist/lib/http.js +0 -25
- package/dist/lib/http.js.map +0 -1
- package/dist/lib/output.d.ts +0 -5
- package/dist/lib/output.d.ts.map +0 -1
- package/dist/lib/output.js +0 -32
- package/dist/lib/output.js.map +0 -1
- package/dist/lib/sdk.d.ts +0 -10
- package/dist/lib/sdk.d.ts.map +0 -1
- package/dist/lib/sdk.js +0 -22
- package/dist/lib/sdk.js.map +0 -1
- package/dist/lib/telemetry.d.ts +0 -4
- package/dist/lib/telemetry.d.ts.map +0 -1
- package/dist/lib/telemetry.js +0 -61
- package/dist/lib/telemetry.js.map +0 -1
- package/dist/sync-agents.d.ts +0 -5
- package/dist/sync-agents.d.ts.map +0 -1
- package/dist/sync-agents.js +0 -28
- package/dist/sync-agents.js.map +0 -1
- package/dist/sync-ontology.d.ts +0 -4
- package/dist/sync-ontology.d.ts.map +0 -1
- package/dist/sync-ontology.js +0 -40
- package/dist/sync-ontology.js.map +0 -1
- package/dist/utils/file-resolver.d.ts +0 -83
- package/dist/utils/file-resolver.d.ts.map +0 -1
- package/dist/utils/file-resolver.js +0 -194
- package/dist/utils/file-resolver.js.map +0 -1
- package/dist/utils/installation-setup.d.ts +0 -88
- package/dist/utils/installation-setup.d.ts.map +0 -1
- package/dist/utils/installation-setup.js +0 -409
- package/dist/utils/installation-setup.js.map +0 -1
- package/dist/utils/launch-claude.d.ts +0 -7
- package/dist/utils/launch-claude.d.ts.map +0 -1
- package/dist/utils/launch-claude.js +0 -86
- package/dist/utils/launch-claude.js.map +0 -1
- package/dist/utils/validation.d.ts +0 -48
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -73
- package/dist/utils/validation.js.map +0 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
export const TEMPLATES = {
|
|
2
|
+
core: `---
|
|
3
|
+
agentmd: "0.1"
|
|
4
|
+
name: template
|
|
5
|
+
title: Template Agent
|
|
6
|
+
model: anthropic/claude-haiku-4-5
|
|
7
|
+
summary: A helpful agent.
|
|
8
|
+
description: Use when you need to accomplish tasks.
|
|
9
|
+
sensitivity: public
|
|
10
|
+
lifecycle: active
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
You are a helpful assistant. Complete tasks clearly and concisely.
|
|
14
|
+
`,
|
|
15
|
+
commerce: `---
|
|
16
|
+
agentmd: "0.1"
|
|
17
|
+
name: template
|
|
18
|
+
title: Template Commerce Agent
|
|
19
|
+
model: anthropic/claude-haiku-4-5
|
|
20
|
+
summary: An agent that provides paid services.
|
|
21
|
+
description: Use when you need paid skill execution with x402 payments.
|
|
22
|
+
sensitivity: public
|
|
23
|
+
lifecycle: active
|
|
24
|
+
skills: []
|
|
25
|
+
wallet: ""
|
|
26
|
+
accepts:
|
|
27
|
+
- scheme: exact
|
|
28
|
+
network: "eip155:8453"
|
|
29
|
+
asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
|
|
30
|
+
max: "0.05"
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
You provide services at a fee. Verify payment before executing paid skills.
|
|
34
|
+
`,
|
|
35
|
+
asi: `---
|
|
36
|
+
agentmd: "0.1"
|
|
37
|
+
name: template
|
|
38
|
+
title: Template ASI Agent
|
|
39
|
+
model: anthropic/claude-opus-4-7
|
|
40
|
+
summary: An autonomous agent registered on Fetch.ai Almanac.
|
|
41
|
+
description: Use for long-running autonomous tasks and multi-agent coordination.
|
|
42
|
+
sensitivity: restricted
|
|
43
|
+
lifecycle: active
|
|
44
|
+
mailbox: true
|
|
45
|
+
agentverse: https://agentverse.ai
|
|
46
|
+
intervals:
|
|
47
|
+
- period: 300
|
|
48
|
+
task: Check for new signals and coordinate with peer agents.
|
|
49
|
+
skills: []
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
You are an autonomous agent. Coordinate with peers, monitor signals, and act on intervals.
|
|
53
|
+
`,
|
|
54
|
+
'travel-planner': `---
|
|
55
|
+
agentmd: "0.1"
|
|
56
|
+
name: template
|
|
57
|
+
title: Travel Planner
|
|
58
|
+
model: anthropic/claude-sonnet-4-5
|
|
59
|
+
summary: Creates detailed travel itineraries with real logistics and budgets.
|
|
60
|
+
description: Use when you need personalised travel planning — itinerary, budget, packing.
|
|
61
|
+
sensitivity: public
|
|
62
|
+
lifecycle: active
|
|
63
|
+
tools:
|
|
64
|
+
- emit_card
|
|
65
|
+
- emit_chips
|
|
66
|
+
skills:
|
|
67
|
+
- name: plan
|
|
68
|
+
description: Research and create a day-by-day travel itinerary
|
|
69
|
+
price: 0.10
|
|
70
|
+
tags: [travel, planning, itinerary]
|
|
71
|
+
- name: budget
|
|
72
|
+
description: Estimate trip costs including flights, hotels, meals, activities
|
|
73
|
+
price: 0.05
|
|
74
|
+
tags: [travel, budget, finance]
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
You are a personal travel planner. You turn destinations and dates into detailed, actionable itineraries — real places, real logistics, real costs.
|
|
78
|
+
|
|
79
|
+
Ask first: where, when, how long, who's going, budget range. Then deliver a day-by-day plan with morning/afternoon/evening blocks, transport options, and booking notes.
|
|
80
|
+
`,
|
|
81
|
+
'marketing-strategist': `---
|
|
82
|
+
agentmd: "0.1"
|
|
83
|
+
name: template
|
|
84
|
+
title: Marketing Strategist
|
|
85
|
+
model: anthropic/claude-sonnet-4-5
|
|
86
|
+
summary: Audits channels, plans campaigns, writes copy, and reads metrics.
|
|
87
|
+
description: Use when you need strategic marketing thinking plus concrete deliverables.
|
|
88
|
+
sensitivity: public
|
|
89
|
+
lifecycle: active
|
|
90
|
+
tools:
|
|
91
|
+
- emit_card
|
|
92
|
+
- emit_chips
|
|
93
|
+
skills:
|
|
94
|
+
- name: audit
|
|
95
|
+
description: Audit existing marketing channels and surface quick wins
|
|
96
|
+
price: 0.08
|
|
97
|
+
tags: [marketing, audit, analysis]
|
|
98
|
+
- name: campaign
|
|
99
|
+
description: Plan a campaign from brief to launch checklist
|
|
100
|
+
price: 0.12
|
|
101
|
+
tags: [marketing, campaign, strategy]
|
|
102
|
+
- name: copy
|
|
103
|
+
description: Write headlines, CTAs, email subjects, ad copy variants
|
|
104
|
+
price: 0.06
|
|
105
|
+
tags: [marketing, copy, writing]
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
You are a senior marketing strategist. You think in funnels and ICPs, then translate that into concrete copy and launch plans any team can execute.
|
|
109
|
+
|
|
110
|
+
Start by understanding the product, the customer, and the current state of marketing. Then: audit → recommend → plan → execute.
|
|
111
|
+
`,
|
|
112
|
+
'support-tier1': `---
|
|
113
|
+
agentmd: "0.1"
|
|
114
|
+
name: template
|
|
115
|
+
title: Support — Tier 1
|
|
116
|
+
model: anthropic/claude-sonnet-4-5
|
|
117
|
+
summary: Resolves common support issues fast; escalates edge cases with full context.
|
|
118
|
+
description: Use as a first-line support agent for how-to, account, and billing questions.
|
|
119
|
+
sensitivity: public
|
|
120
|
+
lifecycle: active
|
|
121
|
+
tools:
|
|
122
|
+
- emit_card
|
|
123
|
+
- emit_chips
|
|
124
|
+
skills:
|
|
125
|
+
- name: triage
|
|
126
|
+
description: Classify the issue and route to the right resolution path
|
|
127
|
+
price: 0.02
|
|
128
|
+
tags: [support, triage, routing]
|
|
129
|
+
- name: resolve
|
|
130
|
+
description: Walk the user through a step-by-step fix
|
|
131
|
+
price: 0.03
|
|
132
|
+
tags: [support, resolution, troubleshooting]
|
|
133
|
+
- name: escalate
|
|
134
|
+
description: Prepare a structured escalation summary for Tier 2
|
|
135
|
+
price: 0.02
|
|
136
|
+
tags: [support, escalation, handoff]
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
You are a Tier 1 support agent. Your job is to resolve common issues fast, escalate edge cases with full context, and leave every user feeling heard.
|
|
140
|
+
|
|
141
|
+
1. Acknowledge — one sentence that shows you understand the problem. 2. Triage — classify: account / billing / bug / how-to / feature request. 3. Resolve — walk through it step by step. 4. Escalate — prepare a clean handoff summary.
|
|
142
|
+
`,
|
|
143
|
+
'sales-discovery': `---
|
|
144
|
+
agentmd: "0.1"
|
|
145
|
+
name: template
|
|
146
|
+
title: Sales Discovery
|
|
147
|
+
model: anthropic/claude-sonnet-4-5
|
|
148
|
+
summary: Qualifies leads, preps discovery calls, handles objections, and structures proposals.
|
|
149
|
+
description: Use to accelerate the discovery-to-proposal stage of your sales process.
|
|
150
|
+
sensitivity: restricted
|
|
151
|
+
lifecycle: active
|
|
152
|
+
tools:
|
|
153
|
+
- emit_card
|
|
154
|
+
- emit_chips
|
|
155
|
+
skills:
|
|
156
|
+
- name: qualify
|
|
157
|
+
description: Run a BANT qualification check on an inbound lead
|
|
158
|
+
price: 0.04
|
|
159
|
+
tags: [sales, qualification, lead]
|
|
160
|
+
- name: discovery
|
|
161
|
+
description: Deep-dive discovery call questions for a specific ICP
|
|
162
|
+
price: 0.06
|
|
163
|
+
tags: [sales, discovery, questions]
|
|
164
|
+
- name: proposal
|
|
165
|
+
description: Outline a custom proposal structure for a qualified account
|
|
166
|
+
price: 0.08
|
|
167
|
+
tags: [sales, proposal, closing]
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
You are a sales discovery specialist. You help sales reps qualify faster, ask sharper questions, and turn stalled conversations into momentum.
|
|
171
|
+
|
|
172
|
+
Start with the lead context: industry, size, role, how they came in. Then run the right playbook: qualify → discover → handle objections → propose.
|
|
173
|
+
`,
|
|
174
|
+
'code-reviewer': `---
|
|
175
|
+
agentmd: "0.1"
|
|
176
|
+
name: template
|
|
177
|
+
title: Code Reviewer
|
|
178
|
+
model: anthropic/claude-sonnet-4-5
|
|
179
|
+
summary: Gives concrete, severity-labelled code review findings with actionable fixes.
|
|
180
|
+
description: Use for code review, security audits, performance checks, and refactor suggestions.
|
|
181
|
+
sensitivity: restricted
|
|
182
|
+
lifecycle: active
|
|
183
|
+
tools:
|
|
184
|
+
- emit_card
|
|
185
|
+
- emit_chips
|
|
186
|
+
skills:
|
|
187
|
+
- name: review
|
|
188
|
+
description: Full code review with severity-labelled findings
|
|
189
|
+
price: 0.08
|
|
190
|
+
tags: [engineering, review, quality]
|
|
191
|
+
- name: security
|
|
192
|
+
description: Security-focused audit for OWASP Top 10 and common patterns
|
|
193
|
+
price: 0.10
|
|
194
|
+
tags: [engineering, security, audit]
|
|
195
|
+
- name: refactor
|
|
196
|
+
description: Propose a concrete refactor with before/after diffs
|
|
197
|
+
price: 0.08
|
|
198
|
+
tags: [engineering, refactor, design]
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
You are a senior code reviewer. You give concrete, actionable feedback that improves code quality without creating review theatre.
|
|
202
|
+
|
|
203
|
+
Label every finding: BLOCKER / MAJOR / MINOR / NIT. Always include the specific line reference and a concrete fix — not vague advice.
|
|
204
|
+
`,
|
|
205
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { askPath } from './lib/api-path.js';
|
|
2
|
+
const DEFAULT_API = process.env.ONEIE_BASE_URL ?? process.env.ONE_API_URL ?? 'https://api.one.ie';
|
|
3
|
+
function apiKey() {
|
|
4
|
+
return process.env.ONEIE_API_KEY ?? process.env.ONE_API_KEY ?? '';
|
|
5
|
+
}
|
|
6
|
+
function base(opts) {
|
|
7
|
+
return (opts.api ?? DEFAULT_API).replace(/\/$/, '');
|
|
8
|
+
}
|
|
9
|
+
function authHeaders() {
|
|
10
|
+
const h = { 'Content-Type': 'application/json' };
|
|
11
|
+
const k = apiKey();
|
|
12
|
+
if (k)
|
|
13
|
+
h['Authorization'] = `Bearer ${k}`;
|
|
14
|
+
return h;
|
|
15
|
+
}
|
|
16
|
+
async function ask(b, receiver, data) {
|
|
17
|
+
const res = await fetch(askPath(b, receiver), {
|
|
18
|
+
method: 'POST',
|
|
19
|
+
headers: authHeaders(),
|
|
20
|
+
body: JSON.stringify({ data }),
|
|
21
|
+
});
|
|
22
|
+
if (!res.ok) {
|
|
23
|
+
process.stderr.write(`${receiver} → ${res.status}\n`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
return res.json();
|
|
27
|
+
}
|
|
28
|
+
export function tradeCommands(program) {
|
|
29
|
+
program
|
|
30
|
+
.command('market')
|
|
31
|
+
.description('Discover agents and skills on the market')
|
|
32
|
+
.option('--query <text>', 'Search for agents or skills by keyword')
|
|
33
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
34
|
+
.option('--json', 'Output raw JSON')
|
|
35
|
+
.action(async (opts) => {
|
|
36
|
+
const b = base(opts);
|
|
37
|
+
const data = opts.query
|
|
38
|
+
? await ask(b, 'actors:find', { search: opts.query, type: 'agent' })
|
|
39
|
+
: await ask(b, 'market:list', {});
|
|
40
|
+
process.stdout.write(JSON.stringify(data, null, 2) + '\n');
|
|
41
|
+
});
|
|
42
|
+
program
|
|
43
|
+
.command('hire <skillId>')
|
|
44
|
+
.description('Hire an agent for a skill (use --dry-run to simulate)')
|
|
45
|
+
.option('--dry-run', 'Simulate — no settlement, no cost')
|
|
46
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
47
|
+
.option('--provider <uid>', 'Preferred provider UID')
|
|
48
|
+
.option('--budget <n>', 'Credit budget', '0')
|
|
49
|
+
.action(async (skillId, opts) => {
|
|
50
|
+
const payload = { skillId };
|
|
51
|
+
if (opts.provider)
|
|
52
|
+
payload.provider = opts.provider;
|
|
53
|
+
if (opts.budget)
|
|
54
|
+
payload.budget = Number(opts.budget);
|
|
55
|
+
if (opts.dryRun)
|
|
56
|
+
payload.simulate = true;
|
|
57
|
+
const data = await ask(base(opts), 'market:hire', payload);
|
|
58
|
+
if (opts.dryRun)
|
|
59
|
+
process.stdout.write('[dry-run] market:hire simulated — nothing settled\n');
|
|
60
|
+
process.stdout.write(JSON.stringify(data, null, 2) + '\n');
|
|
61
|
+
});
|
|
62
|
+
program
|
|
63
|
+
.command('bounty <skillId>')
|
|
64
|
+
.description('Post a bounty for a skill (use --dry-run to simulate)')
|
|
65
|
+
.option('--dry-run', 'Simulate — no settlement, no cost')
|
|
66
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
67
|
+
.option('--price <n>', 'Bounty price in credits', '0')
|
|
68
|
+
.action(async (skillId, opts) => {
|
|
69
|
+
const payload = { skillId, price: Number(opts.price) };
|
|
70
|
+
if (opts.dryRun)
|
|
71
|
+
payload.simulate = true;
|
|
72
|
+
const data = await ask(base(opts), 'market:bounty', payload);
|
|
73
|
+
if (opts.dryRun)
|
|
74
|
+
process.stdout.write('[dry-run] market:bounty simulated — nothing settled\n');
|
|
75
|
+
process.stdout.write(JSON.stringify(data, null, 2) + '\n');
|
|
76
|
+
});
|
|
77
|
+
program
|
|
78
|
+
.command('earn')
|
|
79
|
+
.description('Show credit earned summary (pay:weight)')
|
|
80
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
81
|
+
.option('--json', 'Output raw JSON')
|
|
82
|
+
.action(async (opts) => {
|
|
83
|
+
const data = await ask(base(opts), 'pay:weight', {});
|
|
84
|
+
process.stdout.write(JSON.stringify(data, null, 2) + '\n');
|
|
85
|
+
});
|
|
86
|
+
program
|
|
87
|
+
.command('usage')
|
|
88
|
+
.description('Show credit usage dashboard')
|
|
89
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
90
|
+
.option('--json', 'Output raw JSON')
|
|
91
|
+
.action(async (opts) => {
|
|
92
|
+
const data = await ask(base(opts), 'dashboard:usage', {});
|
|
93
|
+
process.stdout.write(JSON.stringify(data, null, 2) + '\n');
|
|
94
|
+
});
|
|
95
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { authHeaders, jsonMode, resolveBase } from './lib/client.js';
|
|
3
|
+
const DEFAULT_API = resolveBase({}, 'https://one.ie');
|
|
4
|
+
export function trailCmd() {
|
|
5
|
+
const cmd = new Command('trail')
|
|
6
|
+
.description('read trail confidence for a tag combination — ranked next tasks from KV')
|
|
7
|
+
.argument('<tags>', 'comma-separated tags, e.g. fn:engineering,builds,deploy')
|
|
8
|
+
.option('--workspace <ws>', 'workspace slug', 'global')
|
|
9
|
+
.option('--limit <n>', 'max results', '10')
|
|
10
|
+
.option('--api <url>', 'api base url', DEFAULT_API)
|
|
11
|
+
.action(async (tags, opts) => {
|
|
12
|
+
const base = resolveBase(opts, 'https://one.ie');
|
|
13
|
+
const sorted = tags.split(',').map((t) => t.trim()).filter(Boolean).sort().join(',');
|
|
14
|
+
const params = new URLSearchParams({ tags: sorted, workspace: opts.workspace, limit: opts.limit });
|
|
15
|
+
const res = await fetch(`${base}/api/export/trail?${params}`, {
|
|
16
|
+
headers: authHeaders(),
|
|
17
|
+
});
|
|
18
|
+
if (!res.ok) {
|
|
19
|
+
const body = await res.text().catch(() => '');
|
|
20
|
+
process.stderr.write(`trail: ${res.status}\n${body}\n`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
const data = (await res.json());
|
|
24
|
+
if (jsonMode(cmd)) {
|
|
25
|
+
process.stdout.write(JSON.stringify(data, null, 2) + '\n');
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
process.stdout.write(`fingerprint: ${data.fingerprint}\n`);
|
|
29
|
+
process.stdout.write(`confidence: ${(data.confidence * 100).toFixed(1)}%\n\n`);
|
|
30
|
+
if (!data.tasks.length) {
|
|
31
|
+
process.stdout.write('no trail data for these tags — run some /do cycles with matching tags\n');
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
for (const t of data.tasks) {
|
|
35
|
+
const pct = (t.confidence * 100).toFixed(0).padStart(3);
|
|
36
|
+
const score = t.score.toFixed(2).padStart(6);
|
|
37
|
+
process.stdout.write(` ${pct}% score=${score} ${t.slug}\n`);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return cmd;
|
|
41
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ClientShape {
|
|
2
|
+
slug?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
markup_pct?: number | null;
|
|
5
|
+
monthly_cap?: number | null;
|
|
6
|
+
credits?: number | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function validateClient(c: ClientShape): string[];
|
|
9
|
+
export declare function frontmatter(md: string): Record<string, string>;
|
|
10
|
+
export declare function validateAgent(md: string): {
|
|
11
|
+
name: string;
|
|
12
|
+
errors: string[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function validateClient(c) {
|
|
2
|
+
const errs = [];
|
|
3
|
+
if (!c.slug)
|
|
4
|
+
errs.push('client: slug required');
|
|
5
|
+
if (!c.name)
|
|
6
|
+
errs.push('client: name required');
|
|
7
|
+
if (c.markup_pct != null && (c.markup_pct < 0 || c.markup_pct > 100))
|
|
8
|
+
errs.push('client: markup_pct must be 0–100');
|
|
9
|
+
if (c.monthly_cap != null && c.monthly_cap < 0)
|
|
10
|
+
errs.push('client: monthly_cap must be ≥ 0');
|
|
11
|
+
if (c.credits != null && c.credits < 0)
|
|
12
|
+
errs.push('client: credits must be ≥ 0');
|
|
13
|
+
return errs;
|
|
14
|
+
}
|
|
15
|
+
export function frontmatter(md) {
|
|
16
|
+
const m = md.match(/^---\n([\s\S]*?)\n---/);
|
|
17
|
+
if (!m)
|
|
18
|
+
return {};
|
|
19
|
+
const out = {};
|
|
20
|
+
for (const line of m[1].split('\n')) {
|
|
21
|
+
const kv = line.match(/^([A-Za-z_][\w-]*)\s*:\s*(.*)$/);
|
|
22
|
+
if (kv)
|
|
23
|
+
out[kv[1]] = kv[2].trim();
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
export function validateAgent(md) {
|
|
28
|
+
const fm = frontmatter(md);
|
|
29
|
+
const errors = [];
|
|
30
|
+
if (!fm.name)
|
|
31
|
+
errors.push('agent: frontmatter `name` required');
|
|
32
|
+
if (!fm.description)
|
|
33
|
+
errors.push('agent: frontmatter `description` required');
|
|
34
|
+
return { name: fm.name ?? '', errors };
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { askPath } from './lib/api-path.js';
|
|
3
|
+
export { askPath };
|
|
4
|
+
export declare function faucetOk(results: Array<{
|
|
5
|
+
success: boolean;
|
|
6
|
+
}>): boolean;
|
|
7
|
+
export declare function okWrap(result: Record<string, unknown>): Record<string, unknown>;
|
|
8
|
+
export declare function walletCmd(): Command;
|
|
9
|
+
export declare function writeKeysFile(filePath: string, contents: string, accepted: boolean): void;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { mergeEnv } from './env.js';
|
|
3
|
+
import { writeFileSync, chmodSync, readFileSync } from 'node:fs';
|
|
4
|
+
import { generateWallet, recoverWallet } from '@oneie/sdk/wallet';
|
|
5
|
+
import { askPath } from './lib/api-path.js';
|
|
6
|
+
const DEFAULT_API = process.env.ONEIE_BASE_URL ?? process.env.ONE_API_URL ?? 'https://api.one.ie';
|
|
7
|
+
// Re-exported for existing callers/tests — canonical implementation now lives
|
|
8
|
+
// in ./lib/api-path.ts so trade.ts/client.ts/coordinate.ts/catalog.ts can share
|
|
9
|
+
// it instead of each hardcoding /api/ask/<receiver> against DEFAULT_API.
|
|
10
|
+
export { askPath };
|
|
11
|
+
// The ask envelope nests the resolver's return under `result`, not at the top
|
|
12
|
+
// level: { outcome:'result'|'timeout'|'dissolved'|'failure', result, signalId,
|
|
13
|
+
// receiver }. Unwrap it here so callers work with the plain wallet:* shape.
|
|
14
|
+
async function ask(base, key, receiver, data) {
|
|
15
|
+
const res = await fetch(askPath(base, receiver), {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
headers: { 'Content-Type': 'application/json', ...(key ? { Authorization: `Bearer ${key}` } : {}) },
|
|
18
|
+
body: JSON.stringify({ data }),
|
|
19
|
+
});
|
|
20
|
+
if (!res.ok) {
|
|
21
|
+
const body = await res.text().catch(() => '');
|
|
22
|
+
throw new Error(`${receiver} → ${res.status}\n${body}`);
|
|
23
|
+
}
|
|
24
|
+
const envelope = (await res.json());
|
|
25
|
+
if (envelope.outcome && envelope.outcome !== 'result') {
|
|
26
|
+
throw new Error(`${receiver} → ${envelope.outcome}`);
|
|
27
|
+
}
|
|
28
|
+
return envelope.result ?? envelope;
|
|
29
|
+
}
|
|
30
|
+
const DEFAULT_PAY = process.env.ONEIE_PAY_URL ?? 'https://pay.one.ie';
|
|
31
|
+
// pay.one.ie is a separate service from the gateway/one.ie ask surface above —
|
|
32
|
+
// its own protocol envelope, POST <payUrl>/ { protocol, data } → { success, data,
|
|
33
|
+
// error? }. faucet_request is public (no credential), matching the threat model:
|
|
34
|
+
// funding ≠ ownership, anyone can fund any address (wallet-plan.md).
|
|
35
|
+
async function payProtocol(payUrl, protocol, data) {
|
|
36
|
+
const res = await fetch(`${payUrl.replace(/\/$/, '')}/`, {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
headers: { 'Content-Type': 'application/json' },
|
|
39
|
+
body: JSON.stringify({ protocol, data }),
|
|
40
|
+
});
|
|
41
|
+
const body = (await res.json().catch(() => ({})));
|
|
42
|
+
if (!res.ok || !body.success) {
|
|
43
|
+
throw new Error(`${protocol} → ${body.error?.message ?? body.error?.code ?? res.status}`);
|
|
44
|
+
}
|
|
45
|
+
return body.data ?? {};
|
|
46
|
+
}
|
|
47
|
+
function resolveAuth(opts) {
|
|
48
|
+
const env = mergeEnv(process.cwd());
|
|
49
|
+
const key = opts.key ?? env.ONEIE_API_KEY ?? env.ONE_API_KEY ?? '';
|
|
50
|
+
return { base: opts.api.replace(/\/$/, ''), key };
|
|
51
|
+
}
|
|
52
|
+
function resolveWorkspace(explicit) {
|
|
53
|
+
const env = mergeEnv(process.cwd());
|
|
54
|
+
const workspace = explicit ?? env.AGENCY_SLUG;
|
|
55
|
+
if (!workspace) {
|
|
56
|
+
process.stderr.write('--workspace required (or set AGENCY_SLUG)\n');
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
return workspace;
|
|
60
|
+
}
|
|
61
|
+
// A chain with no auto-fund path (ETH/USDC/BTC) legitimately returns success:false
|
|
62
|
+
// with a manualUrls fallback — that's documented, expected behavior (wallet-plan.md:
|
|
63
|
+
// "SUI/SOL auto-fund; ETH/USDC/BTC return a manual URL"), never a call failure.
|
|
64
|
+
// `ok` here means "the request was answered" (payProtocol already throws on a real
|
|
65
|
+
// failure) — per-chain funded/manual status lives in `results`, read that, not `ok`.
|
|
66
|
+
export function faucetOk(results) {
|
|
67
|
+
return results.length > 0;
|
|
68
|
+
}
|
|
69
|
+
// wallet:get/create/transactions return bare data or { error } — no `ok` field
|
|
70
|
+
// of their own. wallet:send already returns { ok, ... }. Normalize both to the
|
|
71
|
+
// { ok, ... } shape out() expects without ever overwriting a real error/false
|
|
72
|
+
// with a hardcoded ok:true.
|
|
73
|
+
export function okWrap(result) {
|
|
74
|
+
if ('ok' in result)
|
|
75
|
+
return result;
|
|
76
|
+
if ('error' in result)
|
|
77
|
+
return { ok: false, ...result };
|
|
78
|
+
return { ok: true, ...result };
|
|
79
|
+
}
|
|
80
|
+
export function walletCmd() {
|
|
81
|
+
const cmd = new Command('wallet').description('Read balances, provision a wallet row, fund from testnet, send crypto — wallet:* receivers + pay.one.ie');
|
|
82
|
+
cmd.command('get')
|
|
83
|
+
.description('Credits, spend ceiling, wallet rows, live chain balances, delegated wallets')
|
|
84
|
+
.option('--workspace <slug>', 'Workspace (defaults to AGENCY_SLUG)')
|
|
85
|
+
.option('--actor <id>', 'Actor within the workspace (defaults to workspace)')
|
|
86
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
87
|
+
.option('--key <key>', 'API key (overrides ONEIE_API_KEY env)')
|
|
88
|
+
.action(async (opts) => {
|
|
89
|
+
const { base, key } = resolveAuth(opts);
|
|
90
|
+
const workspace = resolveWorkspace(opts.workspace);
|
|
91
|
+
const result = await ask(base, key, 'wallet:get', { workspace, actor: opts.actor });
|
|
92
|
+
out(cmd, okWrap(result));
|
|
93
|
+
});
|
|
94
|
+
cmd.command('create')
|
|
95
|
+
.description('Provision a wallet row for an actor (idempotent)')
|
|
96
|
+
.option('--workspace <slug>', 'Workspace (defaults to AGENCY_SLUG)')
|
|
97
|
+
.option('--actor <id>', 'Actor to provision (defaults to workspace)')
|
|
98
|
+
.option('--kind <kind>', 'human | agent', 'human')
|
|
99
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
100
|
+
.option('--key <key>', 'API key (overrides ONEIE_API_KEY env)')
|
|
101
|
+
.action(async (opts) => {
|
|
102
|
+
const { base, key } = resolveAuth(opts);
|
|
103
|
+
const workspace = resolveWorkspace(opts.workspace);
|
|
104
|
+
const result = await ask(base, key, 'wallet:create', { workspace, actor: opts.actor, kind: opts.kind });
|
|
105
|
+
out(cmd, okWrap(result));
|
|
106
|
+
});
|
|
107
|
+
cmd.command('transactions')
|
|
108
|
+
.description('Unified transaction feed across every settlement rail')
|
|
109
|
+
.option('--workspace <slug>', 'Workspace (defaults to AGENCY_SLUG)')
|
|
110
|
+
.option('--limit <n>', 'Max rows (default 100, max 500)', '100')
|
|
111
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
112
|
+
.option('--key <key>', 'API key (overrides ONEIE_API_KEY env)')
|
|
113
|
+
.action(async (opts) => {
|
|
114
|
+
const { base, key } = resolveAuth(opts);
|
|
115
|
+
const workspace = resolveWorkspace(opts.workspace);
|
|
116
|
+
const result = await ask(base, key, 'wallet:transactions', { workspace, limit: Number(opts.limit) });
|
|
117
|
+
out(cmd, okWrap(result));
|
|
118
|
+
});
|
|
119
|
+
cmd.command('faucet <address>')
|
|
120
|
+
.description('Fund an address from a testnet tap — Sui and Solana auto-fund; ETH/USDC/BTC return a manual faucet URL')
|
|
121
|
+
.requiredOption('--chain <chain>', 'sui | sol | eth | usdc | btc | all')
|
|
122
|
+
.option('--network <network>', 'testnet | devnet (Sui only)')
|
|
123
|
+
.option('--pay-url <url>', 'pay.one.ie base URL', DEFAULT_PAY)
|
|
124
|
+
.action(async (address, opts) => {
|
|
125
|
+
const data = await payProtocol(opts.payUrl, 'faucet_request', { chain: opts.chain, address, network: opts.network });
|
|
126
|
+
const results = (data.results ?? []);
|
|
127
|
+
out(cmd, { ok: faucetOk(results), results, manualFaucets: data.manualFaucets });
|
|
128
|
+
});
|
|
129
|
+
cmd.command('send <to>')
|
|
130
|
+
.description('Send crypto via pay.one.ie payment links, incl. Bitcoin — sign the transfer yourself first, pass the tx hash')
|
|
131
|
+
.requiredOption('--chain <chain>', 'SUI | EVM | SOL | BTC | BASE | ARB | OPT')
|
|
132
|
+
.requiredOption('--amount <n>', 'Amount to send')
|
|
133
|
+
.requiredOption('--payment-tx <hash>', 'The transaction hash from signing & broadcasting client-side — this command never signs')
|
|
134
|
+
.option('--workspace <slug>', 'Source workspace (defaults to AGENCY_SLUG)')
|
|
135
|
+
.option('--unit <unit>', 'usd | token', 'usd')
|
|
136
|
+
.option('--currency <currency>', 'NATIVE | USDC', 'NATIVE')
|
|
137
|
+
.option('--user-address <address>', 'Sender address (defaults to --to)')
|
|
138
|
+
.option('--memo <text>', 'Payment memo')
|
|
139
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
140
|
+
.option('--key <key>', 'API key (overrides ONEIE_API_KEY env)')
|
|
141
|
+
.action(async (to, opts) => {
|
|
142
|
+
const { base, key } = resolveAuth(opts);
|
|
143
|
+
const workspace = resolveWorkspace(opts.workspace);
|
|
144
|
+
const result = await ask(base, key, 'wallet:send', {
|
|
145
|
+
workspace, to, chain: opts.chain, amount: Number(opts.amount), paymentTx: opts.paymentTx,
|
|
146
|
+
unit: opts.unit, currency: opts.currency, userAddress: opts.userAddress, memo: opts.memo,
|
|
147
|
+
});
|
|
148
|
+
out(cmd, okWrap(result));
|
|
149
|
+
});
|
|
150
|
+
cmd.command('keygen')
|
|
151
|
+
.description('Generate or recover a self-hosted wallet locally — 4 chains (Sui/EVM/Sol/BTC), fully offline, never touches the network or a server. Prints once by default; use --out for scripted bulk provisioning')
|
|
152
|
+
.option('--recover', 'Recover from a 24-word BIP-39 mnemonic (ONE_WALLET_MNEMONIC env or stdin) instead of generating a fresh one')
|
|
153
|
+
.option('--out <file>', 'Write the mnemonic + keys to a file at mode 0600 instead of printing once')
|
|
154
|
+
.option('--yes-i-accept-plaintext-file', 'Required with --out — acknowledge that unencrypted key material will be written to disk')
|
|
155
|
+
.action(async (opts) => {
|
|
156
|
+
const wallet = opts.recover ? await recoverWallet(readMnemonic()) : await generateWallet();
|
|
157
|
+
const addresses = Object.fromEntries(wallet.keys.map((k) => [k.chain, k.address]));
|
|
158
|
+
if (opts.out) {
|
|
159
|
+
const contents = JSON.stringify({ mnemonic: wallet.mnemonic, keys: wallet.keys }, null, 2) + '\n';
|
|
160
|
+
writeKeysFile(opts.out, contents, Boolean(opts.yesIAcceptPlaintextFile));
|
|
161
|
+
out(cmd, { ok: true, out: opts.out, chains: wallet.keys.map((k) => k.chain), addresses });
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
out(cmd, { ok: true, mnemonic: wallet.mnemonic, addresses, keys: wallet.keys });
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
return cmd;
|
|
168
|
+
}
|
|
169
|
+
// Read the recovery mnemonic for `keygen --recover`: ONE_WALLET_MNEMONIC env first
|
|
170
|
+
// (scriptable), else stdin (fd 0). Never a CLI arg — keeps the phrase out of the
|
|
171
|
+
// process table / shell history.
|
|
172
|
+
function readMnemonic() {
|
|
173
|
+
const fromEnv = process.env.ONE_WALLET_MNEMONIC?.trim();
|
|
174
|
+
if (fromEnv)
|
|
175
|
+
return fromEnv;
|
|
176
|
+
try {
|
|
177
|
+
return readFileSync(0, 'utf8').trim();
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
throw new Error('--recover needs a mnemonic — set ONE_WALLET_MNEMONIC or pipe the phrase on stdin');
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// Write key material to a plaintext file at mode 0600, and ONLY when the operator
|
|
184
|
+
// explicitly accepted the risk. chmod after write in case umask stripped bits at
|
|
185
|
+
// create time. Exported for the demo gate.
|
|
186
|
+
export function writeKeysFile(filePath, contents, accepted) {
|
|
187
|
+
if (!accepted) {
|
|
188
|
+
throw new Error('refusing to write plaintext key material to disk — pass --yes-i-accept-plaintext-file to override');
|
|
189
|
+
}
|
|
190
|
+
writeFileSync(filePath, contents, { mode: 0o600 });
|
|
191
|
+
chmodSync(filePath, 0o600);
|
|
192
|
+
}
|
|
193
|
+
function out(cmd, data) {
|
|
194
|
+
const isJson = cmd.parent?.opts().json;
|
|
195
|
+
if (isJson) {
|
|
196
|
+
process.stdout.write(JSON.stringify(data) + '\n');
|
|
197
|
+
}
|
|
198
|
+
else if (data.ok) {
|
|
199
|
+
const pairs = Object.entries(data)
|
|
200
|
+
.filter(([k]) => k !== 'ok')
|
|
201
|
+
.map(([k, v]) => `${k}=${JSON.stringify(v)}`)
|
|
202
|
+
.join(' ');
|
|
203
|
+
console.log('✓', pairs);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
const detail = data.error ?? data.errors ?? data.issues ?? data;
|
|
207
|
+
console.error('✗', typeof detail === 'string' ? detail : JSON.stringify(detail));
|
|
208
|
+
}
|
|
209
|
+
}
|