oneie 5.8.0 → 5.9.0

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 (270) hide show
  1. package/README.md +114 -6
  2. package/dist/package.json +37 -11
  3. package/dist/src/age-1k8hs4ec.js +1 -0
  4. package/dist/src/client-n6fpnd9f.js +1 -0
  5. package/dist/src/evm-tx-cqhm9rtt.js +1 -0
  6. package/dist/src/hl-run-0pv1e0p2.js +1 -0
  7. package/dist/src/index-f5vhzspa.js +12 -0
  8. package/dist/src/index-h3nrt8bx.js +4 -0
  9. package/dist/src/index-st6k9vhc.js +2062 -0
  10. package/dist/src/index.js +1122 -134
  11. package/dist/src/message-key-yczrxszr.js +1 -0
  12. package/dist/src/message-lock-thr851d5.js +5 -0
  13. package/dist/src/sweep-order-jrq2hkye.js +1 -0
  14. package/dist/src/sweep-runner-jftw9em7.js +1 -0
  15. package/package.json +37 -11
  16. package/dist/src/agent.d.ts +0 -75
  17. package/dist/src/agent.js +0 -1334
  18. package/dist/src/agentverse.d.ts +0 -26
  19. package/dist/src/agentverse.js +0 -171
  20. package/dist/src/args.d.ts +0 -9
  21. package/dist/src/args.js +0 -61
  22. package/dist/src/auth.d.ts +0 -6
  23. package/dist/src/auth.js +0 -121
  24. package/dist/src/balances.d.ts +0 -89
  25. package/dist/src/balances.js +0 -202
  26. package/dist/src/banner.d.ts +0 -1
  27. package/dist/src/banner.js +0 -17
  28. package/dist/src/broadcast.d.ts +0 -8
  29. package/dist/src/broadcast.js +0 -175
  30. package/dist/src/catalog.d.ts +0 -12
  31. package/dist/src/catalog.js +0 -76
  32. package/dist/src/ceiling.d.ts +0 -36
  33. package/dist/src/ceiling.js +0 -189
  34. package/dist/src/chat.d.ts +0 -2
  35. package/dist/src/chat.js +0 -92
  36. package/dist/src/check.d.ts +0 -11
  37. package/dist/src/check.js +0 -53
  38. package/dist/src/client.d.ts +0 -5
  39. package/dist/src/client.js +0 -157
  40. package/dist/src/compiler.d.ts +0 -36
  41. package/dist/src/compiler.js +0 -366
  42. package/dist/src/config.d.ts +0 -24
  43. package/dist/src/config.js +0 -70
  44. package/dist/src/connect.d.ts +0 -2
  45. package/dist/src/connect.js +0 -64
  46. package/dist/src/coordinate.d.ts +0 -3
  47. package/dist/src/coordinate.js +0 -58
  48. package/dist/src/create.d.ts +0 -2
  49. package/dist/src/create.js +0 -113
  50. package/dist/src/credits.d.ts +0 -29
  51. package/dist/src/credits.js +0 -88
  52. package/dist/src/deploy.d.ts +0 -2
  53. package/dist/src/deploy.js +0 -19
  54. package/dist/src/dev.d.ts +0 -2
  55. package/dist/src/dev.js +0 -75
  56. package/dist/src/device-flow.d.ts +0 -57
  57. package/dist/src/device-flow.js +0 -173
  58. package/dist/src/doctor.d.ts +0 -26
  59. package/dist/src/doctor.js +0 -146
  60. package/dist/src/draw.d.ts +0 -18
  61. package/dist/src/draw.js +0 -156
  62. package/dist/src/endpoint.d.ts +0 -2
  63. package/dist/src/endpoint.js +0 -250
  64. package/dist/src/env.d.ts +0 -3
  65. package/dist/src/env.js +0 -37
  66. package/dist/src/eval.d.ts +0 -2
  67. package/dist/src/eval.js +0 -43
  68. package/dist/src/fn.d.ts +0 -2
  69. package/dist/src/fn.js +0 -70
  70. package/dist/src/group.d.ts +0 -2
  71. package/dist/src/group.js +0 -117
  72. package/dist/src/hl-run.d.ts +0 -119
  73. package/dist/src/hl-run.js +0 -480
  74. package/dist/src/hl.d.ts +0 -17
  75. package/dist/src/hl.js +0 -148
  76. package/dist/src/index.d.ts +0 -2
  77. package/dist/src/init.d.ts +0 -76
  78. package/dist/src/init.js +0 -278
  79. package/dist/src/join.d.ts +0 -11
  80. package/dist/src/join.js +0 -297
  81. package/dist/src/key-publish.d.ts +0 -40
  82. package/dist/src/key-publish.js +0 -232
  83. package/dist/src/key-seal.d.ts +0 -21
  84. package/dist/src/key-seal.js +0 -142
  85. package/dist/src/key-sweep.d.ts +0 -93
  86. package/dist/src/key-sweep.js +0 -270
  87. package/dist/src/key.d.ts +0 -26
  88. package/dist/src/key.js +0 -338
  89. package/dist/src/lib/age-plugin.d.ts +0 -51
  90. package/dist/src/lib/age-plugin.js +0 -130
  91. package/dist/src/lib/agent-env.d.ts +0 -12
  92. package/dist/src/lib/agent-env.js +0 -48
  93. package/dist/src/lib/api-path.d.ts +0 -2
  94. package/dist/src/lib/api-path.js +0 -40
  95. package/dist/src/lib/asker.d.ts +0 -34
  96. package/dist/src/lib/asker.js +0 -126
  97. package/dist/src/lib/check-words.d.ts +0 -57
  98. package/dist/src/lib/check-words.js +0 -144
  99. package/dist/src/lib/client.d.ts +0 -20
  100. package/dist/src/lib/client.js +0 -71
  101. package/dist/src/lib/env-sealed.d.ts +0 -53
  102. package/dist/src/lib/env-sealed.js +0 -184
  103. package/dist/src/lib/flow-tag.d.ts +0 -86
  104. package/dist/src/lib/flow-tag.js +0 -230
  105. package/dist/src/lib/hl-core/actions.d.ts +0 -99
  106. package/dist/src/lib/hl-core/actions.js +0 -69
  107. package/dist/src/lib/hl-core/eip712.d.ts +0 -33
  108. package/dist/src/lib/hl-core/eip712.js +0 -107
  109. package/dist/src/lib/hl-core/errors.d.ts +0 -10
  110. package/dist/src/lib/hl-core/errors.js +0 -15
  111. package/dist/src/lib/hl-core/exchange.d.ts +0 -24
  112. package/dist/src/lib/hl-core/exchange.js +0 -47
  113. package/dist/src/lib/hl-core/index.d.ts +0 -13
  114. package/dist/src/lib/hl-core/index.js +0 -14
  115. package/dist/src/lib/hl-core/meta.d.ts +0 -57
  116. package/dist/src/lib/hl-core/meta.js +0 -110
  117. package/dist/src/lib/hl-core/msgpack.d.ts +0 -18
  118. package/dist/src/lib/hl-core/msgpack.js +0 -136
  119. package/dist/src/lib/hl-core/net.d.ts +0 -2
  120. package/dist/src/lib/hl-core/net.js +0 -7
  121. package/dist/src/lib/hl-core/signing.d.ts +0 -103
  122. package/dist/src/lib/hl-core/signing.js +0 -295
  123. package/dist/src/lib/hl-core/wire.d.ts +0 -34
  124. package/dist/src/lib/hl-core/wire.js +0 -81
  125. package/dist/src/lib/invoked-as.d.ts +0 -2
  126. package/dist/src/lib/invoked-as.js +0 -24
  127. package/dist/src/lib/journey-words.d.ts +0 -84
  128. package/dist/src/lib/journey-words.js +0 -363
  129. package/dist/src/lib/journey.d.ts +0 -150
  130. package/dist/src/lib/journey.js +0 -264
  131. package/dist/src/lib/key-receipt.d.ts +0 -48
  132. package/dist/src/lib/key-receipt.js +0 -116
  133. package/dist/src/lib/key-source.d.ts +0 -9
  134. package/dist/src/lib/key-source.js +0 -33
  135. package/dist/src/lib/keyfile.d.ts +0 -136
  136. package/dist/src/lib/keyfile.js +0 -397
  137. package/dist/src/lib/launch-claude.d.ts +0 -5
  138. package/dist/src/lib/launch-claude.js +0 -45
  139. package/dist/src/lib/lock-lookup.d.ts +0 -40
  140. package/dist/src/lib/lock-lookup.js +0 -92
  141. package/dist/src/lib/message-seal.d.ts +0 -63
  142. package/dist/src/lib/message-seal.js +0 -150
  143. package/dist/src/lib/net-choice.d.ts +0 -28
  144. package/dist/src/lib/net-choice.js +0 -72
  145. package/dist/src/lib/network.d.ts +0 -22
  146. package/dist/src/lib/network.js +0 -50
  147. package/dist/src/lib/next-words.d.ts +0 -105
  148. package/dist/src/lib/next-words.js +0 -298
  149. package/dist/src/lib/paths.d.ts +0 -41
  150. package/dist/src/lib/paths.js +0 -91
  151. package/dist/src/lib/plan-draw.d.ts +0 -56
  152. package/dist/src/lib/plan-draw.js +0 -219
  153. package/dist/src/lib/plan-live.d.ts +0 -20
  154. package/dist/src/lib/plan-live.js +0 -192
  155. package/dist/src/lib/qr.d.ts +0 -21
  156. package/dist/src/lib/qr.js +0 -402
  157. package/dist/src/lib/roster.d.ts +0 -20
  158. package/dist/src/lib/roster.js +0 -79
  159. package/dist/src/lib/sale-card.d.ts +0 -117
  160. package/dist/src/lib/sale-card.js +0 -261
  161. package/dist/src/lib/shop-init.d.ts +0 -62
  162. package/dist/src/lib/shop-init.js +0 -63
  163. package/dist/src/lib/sui-grpc-send.d.ts +0 -90
  164. package/dist/src/lib/sui-grpc-send.js +0 -128
  165. package/dist/src/lib/swap-core.d.ts +0 -163
  166. package/dist/src/lib/swap-core.js +0 -405
  167. package/dist/src/lib/tasks-digest.d.ts +0 -66
  168. package/dist/src/lib/tasks-digest.js +0 -200
  169. package/dist/src/lib/tasks-graph.d.ts +0 -79
  170. package/dist/src/lib/tasks-graph.js +0 -463
  171. package/dist/src/lib/tasks-lens.d.ts +0 -31
  172. package/dist/src/lib/tasks-lens.js +0 -47
  173. package/dist/src/lib/tasks-next.d.ts +0 -25
  174. package/dist/src/lib/tasks-next.js +0 -103
  175. package/dist/src/lib/tasks-prove.d.ts +0 -15
  176. package/dist/src/lib/tasks-prove.js +0 -68
  177. package/dist/src/lib/tasks-route.d.ts +0 -29
  178. package/dist/src/lib/tasks-route.js +0 -151
  179. package/dist/src/lib/tasks-score.d.ts +0 -36
  180. package/dist/src/lib/tasks-score.js +0 -152
  181. package/dist/src/lib/tasks-workspace.d.ts +0 -18
  182. package/dist/src/lib/tasks-workspace.js +0 -73
  183. package/dist/src/lib/timed-fetch.d.ts +0 -33
  184. package/dist/src/lib/timed-fetch.js +0 -59
  185. package/dist/src/lib/vault-read.d.ts +0 -24
  186. package/dist/src/lib/vault-read.js +0 -77
  187. package/dist/src/lib/vaultfile.d.ts +0 -103
  188. package/dist/src/lib/vaultfile.js +0 -249
  189. package/dist/src/lib/wallet-money.d.ts +0 -222
  190. package/dist/src/lib/wallet-money.js +0 -578
  191. package/dist/src/lib/wallet-request.d.ts +0 -50
  192. package/dist/src/lib/wallet-request.js +0 -86
  193. package/dist/src/links.d.ts +0 -5
  194. package/dist/src/links.js +0 -45
  195. package/dist/src/media.d.ts +0 -29
  196. package/dist/src/media.js +0 -487
  197. package/dist/src/message-receipt.d.ts +0 -25
  198. package/dist/src/message-receipt.js +0 -71
  199. package/dist/src/message.d.ts +0 -13
  200. package/dist/src/message.js +0 -92
  201. package/dist/src/move.d.ts +0 -36
  202. package/dist/src/move.js +0 -152
  203. package/dist/src/network-cmd.d.ts +0 -17
  204. package/dist/src/network-cmd.js +0 -74
  205. package/dist/src/next.d.ts +0 -12
  206. package/dist/src/next.js +0 -67
  207. package/dist/src/onboard.d.ts +0 -16
  208. package/dist/src/onboard.js +0 -149
  209. package/dist/src/plugin.d.ts +0 -2
  210. package/dist/src/plugin.js +0 -193
  211. package/dist/src/push.d.ts +0 -2
  212. package/dist/src/push.js +0 -115
  213. package/dist/src/render.d.ts +0 -21
  214. package/dist/src/render.js +0 -32
  215. package/dist/src/secrets-device.d.ts +0 -32
  216. package/dist/src/secrets-device.js +0 -127
  217. package/dist/src/secrets-give.d.ts +0 -125
  218. package/dist/src/secrets-give.js +0 -236
  219. package/dist/src/secrets-list.d.ts +0 -27
  220. package/dist/src/secrets-list.js +0 -84
  221. package/dist/src/secrets-run.d.ts +0 -31
  222. package/dist/src/secrets-run.js +0 -182
  223. package/dist/src/secrets.d.ts +0 -33
  224. package/dist/src/secrets.js +0 -200
  225. package/dist/src/setup.d.ts +0 -6
  226. package/dist/src/setup.js +0 -127
  227. package/dist/src/ship.d.ts +0 -2
  228. package/dist/src/ship.js +0 -18
  229. package/dist/src/shop-buy.d.ts +0 -16
  230. package/dist/src/shop-buy.js +0 -101
  231. package/dist/src/shop.d.ts +0 -10
  232. package/dist/src/shop.js +0 -112
  233. package/dist/src/skill-parser.d.ts +0 -14
  234. package/dist/src/skill-parser.js +0 -113
  235. package/dist/src/skill.d.ts +0 -2
  236. package/dist/src/skill.js +0 -493
  237. package/dist/src/slug.d.ts +0 -2
  238. package/dist/src/slug.js +0 -6
  239. package/dist/src/social.d.ts +0 -2
  240. package/dist/src/social.js +0 -106
  241. package/dist/src/staff.d.ts +0 -2
  242. package/dist/src/staff.js +0 -104
  243. package/dist/src/start.d.ts +0 -27
  244. package/dist/src/start.js +0 -225
  245. package/dist/src/status.d.ts +0 -2
  246. package/dist/src/status.js +0 -52
  247. package/dist/src/substrate.d.ts +0 -2
  248. package/dist/src/substrate.js +0 -258
  249. package/dist/src/swap.d.ts +0 -93
  250. package/dist/src/swap.js +0 -622
  251. package/dist/src/tasks.d.ts +0 -2
  252. package/dist/src/tasks.js +0 -743
  253. package/dist/src/templates.d.ts +0 -1
  254. package/dist/src/templates.js +0 -213
  255. package/dist/src/thread.d.ts +0 -2
  256. package/dist/src/thread.js +0 -52
  257. package/dist/src/trade.d.ts +0 -2
  258. package/dist/src/trade.js +0 -91
  259. package/dist/src/trail.d.ts +0 -2
  260. package/dist/src/trail.js +0 -41
  261. package/dist/src/validate.d.ts +0 -13
  262. package/dist/src/validate.js +0 -35
  263. package/dist/src/wallet-money.d.ts +0 -158
  264. package/dist/src/wallet-money.js +0 -664
  265. package/dist/src/wallet.d.ts +0 -169
  266. package/dist/src/wallet.js +0 -973
  267. package/dist/src/workflow.d.ts +0 -2
  268. package/dist/src/workflow.js +0 -169
  269. package/dist/src/write.d.ts +0 -43
  270. package/dist/src/write.js +0 -180
@@ -1,127 +0,0 @@
1
- /**
2
- * secrets-device.ts — `one secrets add-device`: make this Mac a reader of your sealed files
3
- * (text/secrets.md deliverable 3; text/secrets-todo.md § C3).
4
- *
5
- * Runs `age-plugin-se keygen --access-control current-biometry -o <identity>`: a key born
6
- * in the Mac's Secure Enclave that never leaves the chip. The identity file is only a
7
- * handle to that key (the chip holds the secret), written mode 600 and never overwritten
8
- * without --replace. The `age1se1…` lock is then appended to ~/.one/secrets-readers.json,
9
- * where C1's `seal` finds it.
10
- *
11
- * The access control is NOT a flag. Real use is always `current-biometry`; the test seam
12
- * below is a module value the command line cannot reach.
13
- *
14
- * Nothing the identity holds is read or printed here: the lock comes from
15
- * `age-plugin-se recipients -i`, and age-plugin-se's own output is discarded.
16
- */
17
- import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync } from 'node:fs';
18
- import { homedir, hostname } from 'node:os';
19
- import { dirname, join } from 'node:path';
20
- import { jsonMode } from './lib/client.js';
21
- import { keygen, PLUGIN_LOCK_RE, recipientOf, requireAge } from './lib/age-plugin.js';
22
- import { fail, readersFile } from './secrets.js';
23
- /** The Secure Enclave identity file. ONE_SECRETS_DEVICE moves it (tests). */
24
- export function deviceIdentityFile() {
25
- return process.env.ONE_SECRETS_DEVICE?.trim() || join(homedir(), '.one', 'secrets-device.txt');
26
- }
27
- /**
28
- * Test seam. Only a test module can set it; there is no flag and no env var for it, so a
29
- * person at a terminal always gets the finger rule. A key made with `none` opens without Touch ID.
30
- */
31
- export const deviceSeam = { accessControl: 'current-biometry' };
32
- const badReaders = (path) => ({ ok: false, error: `${path} is not a list of age1… locks`, code: 'bad_readers_file' });
33
- function lockOf(e) {
34
- const l = typeof e === 'string' ? e : e?.lock;
35
- return typeof l === 'string' ? l.trim() : undefined;
36
- }
37
- /** Both file shapes C1 reads: a JSON array, or `{ "readers": [...] }`. No file is a new list. */
38
- function readReaders(path) {
39
- if (!existsSync(path))
40
- return { shape: 'new', items: [] };
41
- let parsed;
42
- try {
43
- parsed = JSON.parse(readFileSync(path, 'utf8'));
44
- }
45
- catch {
46
- return badReaders(path);
47
- }
48
- if (Array.isArray(parsed))
49
- return { shape: 'list', items: parsed };
50
- const list = parsed?.readers;
51
- if (Array.isArray(list))
52
- return { shape: 'object', items: list };
53
- return badReaders(path);
54
- }
55
- function writeReaders(path, doc, original) {
56
- const body = doc.shape === 'object' ? { ...original, readers: doc.items } : doc.items;
57
- mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
58
- const tmp = `${path}.tmp-${process.pid}`;
59
- writeFileSync(tmp, JSON.stringify(body, null, 2) + '\n', { mode: 0o600 });
60
- renameSync(tmp, path);
61
- }
62
- export async function addDeviceAction(o, c) {
63
- const identity = deviceIdentityFile();
64
- const readersPath = readersFile();
65
- const bins = requireAge();
66
- if (typeof bins === 'string') {
67
- return fail(c, { ok: false, error: bins === 'no_plugin' ? 'the `age-plugin-se` program is not installed — brew install age-plugin-se' : 'the `age` program is not installed — brew install age', code: bins });
68
- }
69
- const doc = readReaders(readersPath);
70
- if ('ok' in doc)
71
- return fail(c, doc);
72
- let oldLock = null;
73
- try {
74
- lstatSync(identity);
75
- if (!o.replace)
76
- return fail(c, { ok: false, error: `${identity} already exists — this Mac is already a reader (pass --replace to make a new key)`, code: 'device_exists' });
77
- oldLock = recipientOf(identity);
78
- }
79
- catch (e) {
80
- if (e.code !== 'ENOENT')
81
- return fail(c, { ok: false, error: `cannot check ${identity}`, code: 'failed' });
82
- }
83
- const tmp = `${identity}.tmp-${process.pid}`;
84
- try {
85
- mkdirSync(dirname(identity), { recursive: true, mode: 0o700 });
86
- const made = keygen(tmp, deviceSeam.accessControl);
87
- if (made !== true) {
88
- // No Secure Enclave (or no biometry) on this machine: a fixed message, exit 3.
89
- fail(c, { ok: false, error: 'this Mac could not make a Secure Enclave key — it has no Secure Enclave, or no Touch ID set up', code: 'no_secure_enclave' });
90
- process.exitCode = 3;
91
- return;
92
- }
93
- chmodSync(tmp, 0o600);
94
- if ((statSync(tmp).mode & 0o777) !== 0o600)
95
- return fail(c, { ok: false, error: `${identity} could not be made private (mode 600)`, code: 'bad_mode' });
96
- const lock = recipientOf(tmp);
97
- if (!lock || !PLUGIN_LOCK_RE.test(lock))
98
- return fail(c, { ok: false, error: 'could not read the lock of the new key', code: 'failed' });
99
- renameSync(tmp, identity);
100
- // Re-reading after the keygen: the file may have changed under a long Touch ID wait.
101
- const fresh = readReaders(readersPath);
102
- if ('ok' in fresh)
103
- return fail(c, fresh);
104
- const original = existsSync(readersPath) ? JSON.parse(readFileSync(readersPath, 'utf8')) : undefined;
105
- const name = o.name?.trim() || hostname();
106
- const items = fresh.items.filter((e) => {
107
- const l = lockOf(e);
108
- return l !== lock && !(oldLock && l === oldLock);
109
- });
110
- items.push({ lock, name, added: new Date().toISOString() });
111
- writeReaders(readersPath, { shape: fresh.shape, items }, original);
112
- if (jsonMode(c))
113
- process.stdout.write(JSON.stringify({ ok: true, lock, name, identity, replaced: Boolean(oldLock) }) + '\n');
114
- else {
115
- process.stdout.write(`device ${lock}\n`);
116
- process.stdout.write(`name ${name}\nidentity ${identity} (a handle — the key stays in the chip)\n`);
117
- process.stdout.write('re-seal your .env to add this Mac as a reader\n');
118
- }
119
- }
120
- catch (e) {
121
- fail(c, { ok: false, error: `could not add this Mac: ${e.code ?? 'failed'}`, code: 'failed' });
122
- }
123
- finally {
124
- if (existsSync(tmp))
125
- unlinkSync(tmp);
126
- }
127
- }
@@ -1,125 +0,0 @@
1
- /**
2
- * secrets-give.ts — `one secrets give NAME`: give a key to ONE from the terminal
3
- * (text/secrets.md deliverable 6; text/secrets-todo.md § C8).
4
- *
5
- * In order, all on this machine until the last step:
6
- *
7
- * 1 ONE's lock, read from ONE's vault (the single entry of its `readers`, plan D5) through
8
- * `@oneie/sdk/secrets-give` `readOneLock`. No answer is `no_one_lock`; a `--lock` that
9
- * differs is `lock_mismatch`. There is no constant to fall back to, ever.
10
- * 2 the value — from `.env.sealed` (opened in memory with your paper key, the C2 way) or
11
- * from piped stdin with `--stdin`. NEVER from argv: a word after NAME refuses exit 2,
12
- * unread, so a key never sits in shell history or `ps`
13
- * 3 sealed to ONE's lock alone (`sealForOne`, which reads ONE's vault itself and seals only to
14
- * what it names — a `--lock` that differs is `lock_mismatch` there too), over the canonical
15
- * plaintext naming this vault, NAME and --provider, so the blob is no other vault's, name's or
16
- * provider's key; the value dropped
17
- * 4 signed by an AGENT's own ed25519 key (`--signer-key <file>`, `giveData`) over
18
- * `canonicalSigned(payload)`. Your master key never signs a give: `--key` opens the
19
- * sealed file and does nothing else, and `--signer person` exits 2 — a person's touch is
20
- * on the seal page (C9)
21
- * 5 `secrets:give` through ask(), under your API key: the web side adds who you are and
22
- * forwards to the opener. The answer names the last four characters and nothing more.
23
- *
24
- * The body names who gives: `--as <actor>` — the actor your API key is, which the web side attests;
25
- * the opener refuses `subject_mismatch` for any other, so a captured give resent under another
26
- * session is never theirs.
27
- *
28
- * ONE's lock has one source: the reader of ONE's vault. Until C14 publishes it, the shipped reader
29
- * answers no lock and this command refuses `no_one_lock` — there is no environment or file
30
- * override (a test injects a reader through `giveLoaders.oneVault`, in code).
31
- *
32
- * A rotate names what it replaces: `--replaces <sigHash>` (the `sigHash` of the last give, or the
33
- * hash a `stale` refusal prints), signed into the body; a first give sends null. A captured give
34
- * re-sent after a rotate is therefore stale at the opener, never a rollback.
35
- *
36
- * Exits 0 given (or checked) · 1 refused · 2 usage. Prints no value, no line of the file, no key.
37
- */
38
- import { Command } from 'commander';
39
- /** The part of `@oneie/sdk/secrets-give` this command uses, typed here so a typecheck does not need that SDK built. */
40
- export interface OneVaultReader {
41
- (): Promise<{
42
- readers: string[];
43
- sealedHash: string | null;
44
- }>;
45
- }
46
- export interface GiveSdk {
47
- readOneLock(reader: OneVaultReader): Promise<{
48
- ok: true;
49
- lock: string;
50
- } | {
51
- ok: false;
52
- error: 'no_one_lock';
53
- detail: string;
54
- }>;
55
- sealForOne(value: string, bind: {
56
- vault: string;
57
- name: string;
58
- provider: string;
59
- }, reader: OneVaultReader, lock?: string): Promise<{
60
- ok: true;
61
- sealed: string;
62
- } | {
63
- ok: false;
64
- error: 'no_one_lock' | 'lock_mismatch';
65
- detail: string;
66
- }>;
67
- giveData(input: {
68
- vault: string;
69
- name: string;
70
- provider: string;
71
- sealed: string;
72
- mode?: 'give' | 'check';
73
- allowFlagged?: boolean;
74
- replaces?: string | null;
75
- subject: string;
76
- }, secret: Uint8Array): {
77
- signer: {
78
- kind: 'agent';
79
- sig: string;
80
- signer: string;
81
- };
82
- payload: {
83
- type: 'give';
84
- vault: string;
85
- body: Record<string, unknown>;
86
- };
87
- };
88
- decodeSignerKey(text: string): Uint8Array | null;
89
- fixtureReader(f?: {
90
- oneLock: string | null;
91
- sealPageHash: string | null;
92
- }): OneVaultReader;
93
- }
94
- /**
95
- * Swappable in tests (the message-seal.ts `loaders` shape): the cli resolves `@oneie/sdk` through
96
- * its own node_modules, which can be a published or main-tree SDK older than `./secrets-give`;
97
- * a test serves the source. `oneVault` is the reader of ONE's vault and the ONLY source of ONE's
98
- * lock — C14 reached testnet 2026-11-08: the fixture is the SDK's mirror of ONE's testnet vault
99
- * (ONE_VAULT_ID), pinned equal to the chain by one-vault-chain.test.ts. Nothing in the environment or on disk can name another lock (C8 repair 3); a
100
- * test injects a reader by assigning this field. `fetch` is the one network call.
101
- */
102
- export declare const giveLoaders: {
103
- sdk: () => Promise<GiveSdk>;
104
- oneVault: (sdk: GiveSdk) => Promise<OneVaultReader>;
105
- fetch: (input: string, init: RequestInit) => Promise<Response>;
106
- };
107
- interface GiveOpts {
108
- provider?: string;
109
- vault?: string;
110
- file: string;
111
- stdin?: boolean;
112
- key?: string;
113
- signer: string;
114
- signerKey?: string;
115
- lock?: string;
116
- check?: boolean;
117
- allowFlagged?: boolean;
118
- replaces?: string;
119
- as?: string;
120
- api?: string;
121
- }
122
- export declare function giveAction(name: string, extra: string[], o: GiveOpts, c: Command): Promise<void>;
123
- /** The `give` subcommand, fresh per call (a Command has one parent). */
124
- export declare function buildGive(): Command;
125
- export {};
@@ -1,236 +0,0 @@
1
- /**
2
- * secrets-give.ts — `one secrets give NAME`: give a key to ONE from the terminal
3
- * (text/secrets.md deliverable 6; text/secrets-todo.md § C8).
4
- *
5
- * In order, all on this machine until the last step:
6
- *
7
- * 1 ONE's lock, read from ONE's vault (the single entry of its `readers`, plan D5) through
8
- * `@oneie/sdk/secrets-give` `readOneLock`. No answer is `no_one_lock`; a `--lock` that
9
- * differs is `lock_mismatch`. There is no constant to fall back to, ever.
10
- * 2 the value — from `.env.sealed` (opened in memory with your paper key, the C2 way) or
11
- * from piped stdin with `--stdin`. NEVER from argv: a word after NAME refuses exit 2,
12
- * unread, so a key never sits in shell history or `ps`
13
- * 3 sealed to ONE's lock alone (`sealForOne`, which reads ONE's vault itself and seals only to
14
- * what it names — a `--lock` that differs is `lock_mismatch` there too), over the canonical
15
- * plaintext naming this vault, NAME and --provider, so the blob is no other vault's, name's or
16
- * provider's key; the value dropped
17
- * 4 signed by an AGENT's own ed25519 key (`--signer-key <file>`, `giveData`) over
18
- * `canonicalSigned(payload)`. Your master key never signs a give: `--key` opens the
19
- * sealed file and does nothing else, and `--signer person` exits 2 — a person's touch is
20
- * on the seal page (C9)
21
- * 5 `secrets:give` through ask(), under your API key: the web side adds who you are and
22
- * forwards to the opener. The answer names the last four characters and nothing more.
23
- *
24
- * The body names who gives: `--as <actor>` — the actor your API key is, which the web side attests;
25
- * the opener refuses `subject_mismatch` for any other, so a captured give resent under another
26
- * session is never theirs.
27
- *
28
- * ONE's lock has one source: the reader of ONE's vault. Until C14 publishes it, the shipped reader
29
- * answers no lock and this command refuses `no_one_lock` — there is no environment or file
30
- * override (a test injects a reader through `giveLoaders.oneVault`, in code).
31
- *
32
- * A rotate names what it replaces: `--replaces <sigHash>` (the `sigHash` of the last give, or the
33
- * hash a `stale` refusal prints), signed into the body; a first give sends null. A captured give
34
- * re-sent after a rotate is therefore stale at the opener, never a rollback.
35
- *
36
- * Exits 0 given (or checked) · 1 refused · 2 usage. Prints no value, no line of the file, no key.
37
- */
38
- import { readFileSync } from 'node:fs';
39
- import { resolve } from 'node:path';
40
- import { Command } from 'commander';
41
- import { askPath } from './lib/api-path.js';
42
- import { authHeaders, jsonMode, resolveBase } from './lib/client.js';
43
- import { parseSealed } from './lib/env-sealed.js';
44
- import { ageModule, io, loadSecretsKey, MAX_INPUT_BYTES } from './lib/message-seal.js';
45
- const GIVE_SPEC = '@oneie/sdk/secrets-give'; // a variable, so a bundler/vite does not resolve it at build time
46
- /**
47
- * Swappable in tests (the message-seal.ts `loaders` shape): the cli resolves `@oneie/sdk` through
48
- * its own node_modules, which can be a published or main-tree SDK older than `./secrets-give`;
49
- * a test serves the source. `oneVault` is the reader of ONE's vault and the ONLY source of ONE's
50
- * lock — C14 reached testnet 2026-11-08: the fixture is the SDK's mirror of ONE's testnet vault
51
- * (ONE_VAULT_ID), pinned equal to the chain by one-vault-chain.test.ts. Nothing in the environment or on disk can name another lock (C8 repair 3); a
52
- * test injects a reader by assigning this field. `fetch` is the one network call.
53
- */
54
- export const giveLoaders = {
55
- sdk: () => import(/* @vite-ignore */ GIVE_SPEC),
56
- oneVault: async (sdk) => sdk.fixtureReader(),
57
- fetch: (input, init) => fetch(input, init),
58
- };
59
- const NAME_RE = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/;
60
- const VAULT_RE = /^0x[0-9a-fA-F]{64}$/;
61
- const HASH_RE = /^[0-9a-f]{64}$/;
62
- const MAX_VALUE = 64 * 1024;
63
- function fail(cmd, f, exit = 1) {
64
- if (jsonMode(cmd))
65
- process.stdout.write(JSON.stringify(f) + '\n');
66
- else
67
- process.stderr.write(`error ${f.error}\n`);
68
- process.exitCode = exit;
69
- }
70
- export async function giveAction(name, extra, o, c) {
71
- // the value is never an argument — refused before anything is read, and the word is never echoed
72
- if (extra.length > 0) {
73
- return fail(c, { ok: false, error: 'a key is never an argument (it would sit in your shell history) — pipe it with --stdin, or keep it in .env.sealed', code: 'value_in_argv' }, 2);
74
- }
75
- if (o.signer === 'person')
76
- return fail(c, { ok: false, error: 'the touch is on the seal page (C9)', code: 'person_signs_on_seal_page' }, 2);
77
- if (o.signer !== 'agent')
78
- return fail(c, { ok: false, error: '--signer is agent (your agent’s own key) — a person signs on the seal page (C9)', code: 'usage' }, 2);
79
- if (!NAME_RE.test(name))
80
- return fail(c, { ok: false, error: 'NAME is a .env name: letters, digits and _', code: 'usage' }, 2);
81
- if (!o.provider)
82
- return fail(c, { ok: false, error: '--provider is required (openai · anthropic · stripe · github · dataforseo)', code: 'usage' }, 2);
83
- if (!o.as || o.as.trim().length === 0 || o.as.length > 256) {
84
- return fail(c, { ok: false, error: 'name who gives: --as <actor> — the actor your API key is (ONE refuses any other as subject_mismatch)', code: 'usage' }, 2);
85
- }
86
- if (o.replaces !== undefined && !HASH_RE.test(o.replaces))
87
- return fail(c, { ok: false, error: '--replaces is the sigHash of the record ONE holds: 64 lower-case hex', code: 'usage' }, 2);
88
- // only an agent's own ed25519 key signs; the master (--key / ONE_WALLET_MNEMONIC) opens the file and nothing else
89
- if (!o.signerKey) {
90
- return fail(c, { ok: false, error: 'only an agent’s own ed25519 key signs a give (--signer-key <file>); your master key never does', code: 'no_signer' });
91
- }
92
- const sdk = await giveLoaders.sdk();
93
- let signerText;
94
- try {
95
- signerText = readFileSync(resolve(o.signerKey), 'utf8');
96
- }
97
- catch {
98
- return fail(c, { ok: false, error: `cannot read ${o.signerKey}`, code: 'bad_signer_key' });
99
- }
100
- const secret = sdk.decodeSignerKey(signerText);
101
- signerText = '';
102
- if (!secret)
103
- return fail(c, { ok: false, error: `${o.signerKey} is not an ed25519 key (suiprivkey1… or 64 hex) — a mnemonic or a key file never signs here`, code: 'bad_signer_key' });
104
- try {
105
- // 1 — ONE's lock, from ONE's vault; never a constant, never the flag alone (checked here before
106
- // anything is opened, and again by sealForOne, which seals to nothing else)
107
- const reader = await giveLoaders.oneVault(sdk);
108
- const one = await sdk.readOneLock(reader);
109
- if (!one.ok)
110
- return fail(c, { ok: false, error: `${one.detail} — nothing was sealed`, code: 'no_one_lock' });
111
- if (o.lock !== undefined && o.lock.trim() !== one.lock) {
112
- return fail(c, { ok: false, error: 'that is not the lock ONE’s vault names — nothing was sealed', code: 'lock_mismatch' });
113
- }
114
- // the vault: --vault, else the sealed file's header
115
- let vault = o.vault;
116
- let sealedText = null;
117
- if (!o.stdin || !vault) {
118
- try {
119
- const b = readFileSync(resolve(o.file));
120
- if (b.length > MAX_INPUT_BYTES)
121
- return fail(c, { ok: false, error: `${o.file} is too big`, code: 'too_big' });
122
- sealedText = b.toString('utf8');
123
- }
124
- catch {
125
- if (!o.stdin)
126
- return fail(c, { ok: false, error: `cannot read ${o.file}`, code: 'no_input' });
127
- }
128
- }
129
- const parsed = sealedText !== null ? parseSealed(sealedText) : null;
130
- if (parsed && 'ok' in parsed && !o.stdin)
131
- return fail(c, parsed);
132
- if (!vault && parsed && !('ok' in parsed))
133
- vault = parsed.vault;
134
- if (!vault || !VAULT_RE.test(vault))
135
- return fail(c, { ok: false, error: 'name your vault: --vault 0x… (64 hex), or a # vault line in the sealed file', code: 'bad_vault' });
136
- vault = vault.toLowerCase();
137
- // 2 — the value, in memory only
138
- let value;
139
- if (o.stdin) {
140
- const bytes = await io.readStdin();
141
- if (bytes.length > MAX_VALUE)
142
- return fail(c, { ok: false, error: 'stdin is too long to be a key', code: 'too_big' });
143
- value = new TextDecoder().decode(bytes).replace(/\r?\n$/, '');
144
- bytes.fill(0);
145
- }
146
- else {
147
- if (!parsed || 'ok' in parsed)
148
- return fail(c, { ok: false, error: `cannot read ${o.file}`, code: 'no_input' });
149
- const entry = parsed.entries.find((e) => e.name === name);
150
- if (!entry)
151
- return fail(c, { ok: false, error: `${name} is not in ${o.file}`, code: 'no_such_name' });
152
- const k = await loadSecretsKey(o.key);
153
- if ('ok' in k)
154
- return fail(c, k);
155
- try {
156
- const age = await ageModule();
157
- let plain;
158
- try {
159
- plain = age.decrypt(entry.file, [k.secret]);
160
- }
161
- catch {
162
- return fail(c, { ok: false, error: `${name} does not open with this key`, code: 'no_identity' });
163
- }
164
- value = new TextDecoder().decode(plain);
165
- plain.fill(0);
166
- }
167
- finally {
168
- k.secret.fill(0);
169
- }
170
- }
171
- if (value.length === 0)
172
- return fail(c, { ok: false, error: 'the value is empty', code: 'bad_key' });
173
- // 3 + 4 — bound to this vault and NAME, sealed to the lock ONE's vault names alone, then signed by the agent's key
174
- const s = await sdk.sealForOne(value, { vault, name, provider: o.provider }, reader, o.lock?.trim() ?? one.lock);
175
- value = '';
176
- if (!s.ok)
177
- return fail(c, { ok: false, error: `${s.detail} — nothing was sealed`, code: s.error });
178
- const data = sdk.giveData({ vault, name, provider: o.provider, sealed: s.sealed, mode: o.check ? 'check' : 'give', allowFlagged: o.allowFlagged === true, replaces: o.replaces ?? null, subject: o.as.trim() }, secret);
179
- // 5 — secrets:give through ask(); the web side adds who you are
180
- const base = resolveBase({ api: o.api });
181
- let res;
182
- try {
183
- res = await giveLoaders.fetch(askPath(base, 'secrets:give'), { method: 'POST', headers: authHeaders(), body: JSON.stringify({ data }) });
184
- }
185
- catch {
186
- return fail(c, { ok: false, error: `could not reach ${base}`, code: 'unreachable' });
187
- }
188
- let json = {};
189
- try {
190
- json = (await res.json());
191
- }
192
- catch {
193
- /* the status speaks */
194
- }
195
- const r = json['result'] ?? json;
196
- if (!res.ok || r['ok'] !== true) {
197
- const code = String(r['refused'] ?? r['error'] ?? `http_${res.status}`);
198
- const detail = typeof r['detail'] === 'string' ? ` (${r['detail']})` : '';
199
- // stale: ONE holds another record for this name — its sigHash is what a rotate signs as --replaces
200
- const hint = code === 'stale' && typeof r['detail'] === 'string' && HASH_RE.test(r['detail']) ? ` — to replace it, run again with --replaces ${r['detail']}` : '';
201
- return fail(c, { ok: false, error: `ONE did not take ${name}: ${code}${detail}${hint}`, code });
202
- }
203
- const given = (r['given'] ?? {});
204
- const stored = r['stored'] === true;
205
- if (jsonMode(c))
206
- process.stdout.write(JSON.stringify({ ok: true, stored, given }) + '\n');
207
- else {
208
- const tail = given.last4 ? `…${given.last4}` : '';
209
- process.stdout.write(`${stored ? 'given' : 'checked'} ${name} ${tail} ${given.provider ?? o.provider} check ${given.check?.status ?? '?'}${given.flagged ? ` flagged: ${given.flagged}` : ''}${stored && given.sigHash ? ` sigHash ${given.sigHash}` : ''}\n`);
210
- }
211
- }
212
- finally {
213
- secret.fill(0);
214
- }
215
- }
216
- /** The `give` subcommand, fresh per call (a Command has one parent). */
217
- export function buildGive() {
218
- return new Command('give')
219
- .description('Give a key to ONE — sealed here to the lock ONE’s vault names, signed by your agent’s key; afterwards only its last four characters show')
220
- .argument('<name>', 'The .env name of the key, e.g. OPENAI_API_KEY')
221
- .argument('[extra...]')
222
- .requiredOption('--provider <name>', 'openai · anthropic · stripe · github · dataforseo')
223
- .option('--vault <id>', 'Your vault (0x…); default: the # vault line of the sealed file')
224
- .option('--file <file>', 'The sealed file the value is read from', '.env.sealed')
225
- .option('--stdin', 'Read the value from piped stdin instead of the sealed file')
226
- .option('--key <file>', 'Key file that opens the sealed file (else ONE_WALLET_MNEMONIC). It never signs')
227
- .option('--signer <kind>', 'agent (the only signer here); a person signs on the seal page (C9)', 'agent')
228
- .option('--signer-key <file>', 'Your agent’s own ed25519 key: suiprivkey1… or 64 hex')
229
- .option('--lock <age1…>', 'The lock you expect ONE to have; refused unless ONE’s vault names the same')
230
- .option('--check', 'Check the key works and what it can do; store nothing')
231
- .option('--allow-flagged', 'Store a key Check it flags: one that can make other keys (an admin key, a full Stripe secret key, a GitHub admin: or key-making scope) or a GitHub token whose scopes cannot be read (scopes_unknown)')
232
- .option('--as <actor>', 'Who gives: the actor your API key is — signed into the body and checked against the caller ONE attests')
233
- .option('--replaces <sigHash>', 'Rotate: the sigHash of the record ONE holds for NAME (printed by the last give, or by a stale refusal)')
234
- .option('--api <url>', 'API base (default: ONE_API_URL or https://one.ie)')
235
- .action((name, extra, o, c) => giveAction(name, extra ?? [], o, c));
236
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * secrets-list.ts — `one secrets list`: your secrets desk from the terminal (text/secrets.md
3
- * § What an agent sees; the `secrets:list` receiver, C15).
4
- *
5
- * Read only. One POST to secrets:list through ask(); the web side reads WHO from the session or
6
- * the API key and D1 — this command sends nothing about the caller. Names and meters only: the
7
- * receiver never returns a value, and this prints only what it returned.
8
- *
9
- * Lending and Stop are not here. A person signs a grant or a Stop with a passkey on the seal
10
- * page, in a window of its own (plan D11, § Signatures); an agent may sign with its own ed25519
11
- * key, but no vault holds a grant-signer list until the D37 package is published (D46), so an
12
- * agent-signed grant has nothing to verify against yet.
13
- */
14
- import { Command } from 'commander';
15
- /** Swappable in tests. `fetch` is the one network call. */
16
- export declare const listLoaders: {
17
- fetch: (input: string, init: RequestInit) => Promise<Response>;
18
- };
19
- type Rec = Record<string, unknown>;
20
- /** The desk in a few human lines — never a value, never a full id where a short one reads. */
21
- export declare function deskLines(r: Rec): string[];
22
- export declare function listAction(o: {
23
- api?: string;
24
- }, c: Command): Promise<void>;
25
- /** The `list` subcommand, fresh per call (a Command has one parent). */
26
- export declare function buildList(): Command;
27
- export {};
@@ -1,84 +0,0 @@
1
- /**
2
- * secrets-list.ts — `one secrets list`: your secrets desk from the terminal (text/secrets.md
3
- * § What an agent sees; the `secrets:list` receiver, C15).
4
- *
5
- * Read only. One POST to secrets:list through ask(); the web side reads WHO from the session or
6
- * the API key and D1 — this command sends nothing about the caller. Names and meters only: the
7
- * receiver never returns a value, and this prints only what it returned.
8
- *
9
- * Lending and Stop are not here. A person signs a grant or a Stop with a passkey on the seal
10
- * page, in a window of its own (plan D11, § Signatures); an agent may sign with its own ed25519
11
- * key, but no vault holds a grant-signer list until the D37 package is published (D46), so an
12
- * agent-signed grant has nothing to verify against yet.
13
- */
14
- import { Command } from 'commander';
15
- import { askPath } from './lib/api-path.js';
16
- import { authHeaders, jsonMode, out, resolveBase } from './lib/client.js';
17
- /** Swappable in tests. `fetch` is the one network call. */
18
- export const listLoaders = {
19
- fetch: (input, init) => fetch(input, init),
20
- };
21
- /** D51: an "unlimited" lend signs this ceiling (UNLIMITED_PER_DAY in @oneie/sdk/secrets; kept here so the CLI runs on a published SDK that predates it). */
22
- const UNLIMITED_PER_DAY = 1_000_000;
23
- const leftLine = (l) => {
24
- const per = Number(l['perDay']);
25
- if (per === UNLIMITED_PER_DAY)
26
- return `${per - Number(l['left_today'] ?? per)} today · no daily limit (ceiling 1,000,000)`;
27
- return `${String(l['left_today'] ?? '?')}/${String(l['perDay'] ?? '?')} left today`;
28
- };
29
- const arr = (v) => (Array.isArray(v) ? v : []);
30
- /** The desk in a few human lines — never a value, never a full id where a short one reads. */
31
- export function deskLines(r) {
32
- const lines = [];
33
- const keys = arr(r['keys']);
34
- const lent = arr(r['lentToMe']);
35
- lines.push(`ok keys=${keys.length} lent_to_me=${lent.length} vaults=${arr(r['vaults']).length}${r['capped'] === true ? ' capped=true' : ''}`);
36
- for (const k of keys) {
37
- const grants = arr(k['grants']);
38
- const live = grants.filter((g) => g['stopped'] !== true).length;
39
- lines.push(`key ${String(k['name'] ?? '?')} ${String(k['provider'] ?? '?')} …${String(k['last4'] ?? '')} grants=${live} live/${grants.length}${k['flagged'] ? ` flagged=${String(k['flagged'])}` : ''}`);
40
- }
41
- for (const l of lent) {
42
- lines.push(`lent ${String(l['name'] ?? '?')} ${String(l['provider'] ?? '?')} from ${String(l['from'] ?? '?')} ${leftLine(l)} until ${String(l['until'] ?? '?')}${l['stopped'] === true ? ' STOPPED' : l['accepted'] === true ? '' : ' not accepted'}`);
43
- }
44
- for (const c of arr(r['composio'])) {
45
- if (!c['requireGrants'])
46
- lines.push(`composio ${String(c['group'] ?? '?')} running without a grant today=${String(c['noGrantToday'] ?? 0)}`);
47
- }
48
- return lines;
49
- }
50
- export async function listAction(o, c) {
51
- const base = resolveBase({ api: o.api });
52
- let res;
53
- try {
54
- res = await listLoaders.fetch(askPath(base, 'secrets:list'), { method: 'POST', headers: authHeaders(), body: JSON.stringify({ data: {} }) });
55
- }
56
- catch {
57
- return out(c, { ok: false, error: `could not reach ${base}`, code: 'unreachable' });
58
- }
59
- let json = {};
60
- try {
61
- json = (await res.json());
62
- }
63
- catch {
64
- /* the status speaks */
65
- }
66
- const r = json['result'] ?? json;
67
- if (!res.ok || r['ok'] !== true) {
68
- const code = String(r['refused'] ?? r['error'] ?? `http_${res.status}`);
69
- const why = code === 'opener_unbound' ? ' — the opener is not live on this host yet; nothing was read' : '';
70
- return out(c, { ok: false, error: `secrets:list refused: ${code}${why}`, code });
71
- }
72
- if (jsonMode(c)) {
73
- process.stdout.write(JSON.stringify(r) + '\n');
74
- return;
75
- }
76
- process.stdout.write(deskLines(r).join('\n') + '\n');
77
- }
78
- /** The `list` subcommand, fresh per call (a Command has one parent). */
79
- export function buildList() {
80
- return new Command('list')
81
- .description('Your secrets desk — the keys you gave ONE, who uses them, keys lent to you. Names and meters, never values')
82
- .option('--api <url>', 'API base (default: ONE_API_URL or https://one.ie)')
83
- .action(listAction);
84
- }
@@ -1,31 +0,0 @@
1
- /**
2
- * secrets-run.ts — `one run -- <cmd…>` and `one secrets run -- <cmd…>`; `one secrets hash`.
3
- * (text/secrets.md deliverable 2; text/secrets-todo.md § C2.)
4
- *
5
- * Opens `.env.sealed` once, hands the values to ONE child process through its environment,
6
- * and writes nothing anywhere. The order is the point:
7
- *
8
- * 1. read the file's exact bytes, parse the header (no key yet)
9
- * 2. sha256 of those bytes must equal the `sealed_hash` of the vault named by `# vault`
10
- * — a file the vault does not know opens NOTHING (the key is not even loaded)
11
- * 3. open every value with the owner's paper identity, in memory
12
- * 4. spawn the child with `{ ...process.env, ...values }`, stdio inherited
13
- * 5. zero the decrypted buffers; exit with the child's exit code
14
- *
15
- * There is no flag that skips step 2. `process.env` of this process is never changed, no
16
- * value is printed, and an error names a variable or a line number, never a value or the key.
17
- */
18
- import { Command } from 'commander';
19
- interface RunOpts {
20
- file: string;
21
- key?: string;
22
- }
23
- export declare function runAction(cmdArgs: string[], o: RunOpts, c: Command): Promise<void>;
24
- /** The `run` subcommand, fresh per call (a Command has one parent). */
25
- export declare function buildRun(): Command;
26
- /** The top-level `one run`. */
27
- export declare const runCmd: () => Command;
28
- /** `one secrets hash [file]` — the sha256 an owner sets on their vault. Names no value, needs no key. */
29
- export declare function hashAction(file: string, _o: unknown, c: Command): Promise<void>;
30
- export declare function buildHash(): Command;
31
- export {};