@prestack/thread 0.0.2 → 0.1.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 (183) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/dist/core/{asking.d.ts → answers.d.ts} +6 -14
  3. package/dist/core/{asking.js → answers.js} +13 -332
  4. package/dist/core/{asking.ts → answers.ts} +14 -357
  5. package/dist/core/attach.js +2 -2
  6. package/dist/core/attach.ts +2 -3
  7. package/dist/core/chain.js +4 -11
  8. package/dist/core/chain.ts +4 -3
  9. package/dist/core/client.d.ts +57 -0
  10. package/dist/core/client.js +186 -0
  11. package/dist/core/client.ts +227 -0
  12. package/dist/core/descend.d.ts +2 -0
  13. package/dist/core/descend.js +109 -16
  14. package/dist/core/descend.ts +120 -16
  15. package/dist/core/files.d.ts +45 -0
  16. package/dist/core/files.js +95 -0
  17. package/dist/core/files.ts +137 -0
  18. package/dist/core/init.d.ts +1 -0
  19. package/dist/core/init.js +10 -2
  20. package/dist/core/init.ts +8 -2
  21. package/dist/core/invoked.js +1 -1
  22. package/dist/core/invoked.ts +1 -1
  23. package/dist/core/rows.d.ts +2 -0
  24. package/dist/core/rows.js +65 -0
  25. package/dist/core/rows.ts +58 -0
  26. package/dist/core/tree.js +1 -1
  27. package/dist/core/tree.ts +1 -1
  28. package/dist/derivation/attach.js +0 -12
  29. package/dist/derivation/attach.ts +0 -12
  30. package/dist/derivation/generators/build.js +8 -7
  31. package/dist/derivation/generators/build.ts +8 -7
  32. package/dist/derivation/generators/release.d.ts +1 -1
  33. package/dist/derivation/generators/release.js +15 -23
  34. package/dist/derivation/generators/release.ts +15 -15
  35. package/dist/integrations/attach.js +1 -19
  36. package/dist/integrations/attach.ts +1 -19
  37. package/dist/integrations/generators/read.js +2 -2
  38. package/dist/integrations/generators/read.ts +4 -4
  39. package/dist/integrations/generators/vault.js +4 -12
  40. package/dist/integrations/generators/vault.ts +4 -4
  41. package/dist/integrations/module.js +5 -3
  42. package/dist/integrations/module.ts +5 -3
  43. package/dist/integrations/vault.js +5 -5
  44. package/dist/integrations/vault.ts +5 -5
  45. package/dist/integrity/attach.js +0 -12
  46. package/dist/integrity/attach.ts +0 -12
  47. package/dist/integrity/check-threads.js +1 -1
  48. package/dist/integrity/check-threads.ts +1 -1
  49. package/dist/integrity/constraint.d.ts +11 -2
  50. package/dist/integrity/constraint.js +163 -20
  51. package/dist/integrity/constraint.ts +174 -22
  52. package/dist/integrity/generators/compiler.js +1 -1
  53. package/dist/integrity/generators/compiler.ts +1 -1
  54. package/dist/integrity/generators/gate.js +8 -16
  55. package/dist/integrity/generators/gate.ts +8 -7
  56. package/dist/integrity/generators/publish.js +14 -26
  57. package/dist/integrity/generators/publish.ts +14 -17
  58. package/dist/integrity/generators/trial.d.ts +2 -2
  59. package/dist/integrity/generators/trial.js +108 -50
  60. package/dist/integrity/generators/trial.ts +107 -48
  61. package/dist/integrity/lint.js +3 -3
  62. package/dist/integrity/lint.ts +3 -3
  63. package/dist/integrity/lsp/diagnostics.js +1 -1
  64. package/dist/integrity/lsp/diagnostics.ts +1 -1
  65. package/dist/integrity/lsp/lint.js +1 -1
  66. package/dist/integrity/lsp/lint.ts +1 -1
  67. package/dist/integrity/slopnator.d.ts +1 -14
  68. package/dist/integrity/slopnator.js +8 -40
  69. package/dist/integrity/slopnator.ts +9 -51
  70. package/dist/integrity/slopnators/sl_broken_lineage.js +4 -2
  71. package/dist/integrity/slopnators/sl_broken_lineage.ts +4 -2
  72. package/dist/integrity/slopnators/sl_declared_elsewhere.js +24 -3
  73. package/dist/integrity/slopnators/sl_declared_elsewhere.ts +24 -3
  74. package/dist/integrity/slopnators/sl_derived_drift.js +10 -4
  75. package/dist/integrity/slopnators/sl_derived_drift.ts +10 -4
  76. package/dist/integrity/slopnators/sl_inert_island.js +7 -13
  77. package/dist/integrity/slopnators/sl_inert_island.ts +7 -16
  78. package/dist/integrity/slopnators/sl_inert_slopnator.js +8 -8
  79. package/dist/integrity/slopnators/sl_inert_slopnator.ts +8 -8
  80. package/dist/integrity/slopnators/sl_missing_row.js +14 -9
  81. package/dist/integrity/slopnators/sl_missing_row.ts +14 -10
  82. package/dist/integrity/slopnators/sl_no_child_process.js +8 -8
  83. package/dist/integrity/slopnators/sl_no_child_process.ts +8 -8
  84. package/dist/integrity/slopnators/sl_no_import_cycle.js +1 -1
  85. package/dist/integrity/slopnators/sl_no_import_cycle.ts +1 -1
  86. package/dist/integrity/slopnators/sl_no_such_command.js +20 -5
  87. package/dist/integrity/slopnators/sl_no_such_command.ts +22 -5
  88. package/dist/integrity/slopnators/sl_only_takes_a_literal.js +8 -8
  89. package/dist/integrity/slopnators/sl_only_takes_a_literal.ts +8 -8
  90. package/dist/integrity/slopnators/sl_stale_path.js +91 -18
  91. package/dist/integrity/slopnators/sl_stale_path.ts +97 -18
  92. package/dist/integrity/slopnators/sl_twice_meant.js +25 -2
  93. package/dist/integrity/slopnators/sl_twice_meant.ts +28 -2
  94. package/dist/integrity/slopnators/sl_twice_parented.js +26 -5
  95. package/dist/integrity/slopnators/sl_twice_parented.ts +26 -5
  96. package/dist/integrity/slopnators/sl_undeclared_node.js +18 -2
  97. package/dist/integrity/slopnators/sl_undeclared_node.ts +18 -2
  98. package/dist/integrity/slopnators/sl_undeclared_operation.js +3 -1
  99. package/dist/integrity/slopnators/sl_undeclared_operation.ts +3 -1
  100. package/dist/integrity/slopnators/sl_undeclared_variant.js +6 -2
  101. package/dist/integrity/slopnators/sl_undeclared_variant.ts +6 -2
  102. package/dist/integrity/slopnators/sl_ungoverned_island.js +3 -4
  103. package/dist/integrity/slopnators/sl_ungoverned_island.ts +3 -4
  104. package/dist/integrity/slopnators/sl_unkept_rows.js +1 -1
  105. package/dist/integrity/slopnators/sl_unkept_rows.ts +1 -1
  106. package/dist/integrity/slopnators/sl_unpaired_member.js +13 -8
  107. package/dist/integrity/slopnators/sl_unpaired_member.ts +16 -8
  108. package/dist/integrity/slopnators/sl_unpaired_slopnator.js +16 -3
  109. package/dist/integrity/slopnators/sl_unpaired_slopnator.ts +16 -3
  110. package/dist/integrity/slopnators/sl_unthreaded.d.ts +1 -0
  111. package/dist/integrity/slopnators/sl_unthreaded.js +18 -10
  112. package/dist/integrity/slopnators/sl_unthreaded.ts +19 -11
  113. package/dist/integrity/slopnators/sl_untranslated_key.js +1 -1
  114. package/dist/integrity/slopnators/sl_untranslated_key.ts +1 -1
  115. package/dist/integrity/slopnators/sl_unversioned.js +16 -2
  116. package/dist/integrity/slopnators/sl_unversioned.ts +16 -2
  117. package/dist/integrity/sweep.js +17 -3
  118. package/dist/integrity/sweep.ts +20 -3
  119. package/dist/knowledge/attach.js +0 -6
  120. package/dist/knowledge/attach.ts +0 -6
  121. package/dist/knowledge/generators/docsgen.js +12 -3
  122. package/dist/knowledge/generators/docsgen.ts +12 -2
  123. package/dist/knowledge/generators/glossary.js +1 -1
  124. package/dist/knowledge/generators/glossary.ts +1 -1
  125. package/dist/operations/attach.js +2 -26
  126. package/dist/operations/attach.ts +2 -27
  127. package/dist/operations/dispatch.js +2 -3
  128. package/dist/operations/dispatch.ts +2 -3
  129. package/dist/operations/generators/capability.js +4 -7
  130. package/dist/operations/generators/capability.ts +3 -6
  131. package/dist/operations/generators/compile.js +8 -13
  132. package/dist/operations/generators/compile.ts +8 -4
  133. package/dist/operations/generators/permits.js +4 -13
  134. package/dist/operations/generators/permits.ts +3 -3
  135. package/dist/operations/generators/seed.js +5 -2
  136. package/dist/operations/generators/seed.ts +6 -2
  137. package/dist/operations/generators/trial.js +10 -10
  138. package/dist/operations/generators/trial.ts +10 -10
  139. package/dist/operations/http.js +4 -1
  140. package/dist/operations/http.ts +6 -1
  141. package/package.json +2 -2
  142. package/dist/core/cli.d.ts +0 -2
  143. package/dist/core/cli.js +0 -1761
  144. package/dist/core/cli.ts +0 -2004
  145. package/dist/core/generators/meta.d.ts +0 -2
  146. package/dist/core/generators/meta.js +0 -829
  147. package/dist/core/generators/meta.ts +0 -1006
  148. package/dist/derivation/generators/derivation.d.ts +0 -3
  149. package/dist/derivation/generators/derivation.js +0 -273
  150. package/dist/derivation/generators/derivation.ts +0 -347
  151. package/dist/derivation/makers/release.d.ts +0 -1
  152. package/dist/derivation/makers/release.js +0 -107
  153. package/dist/derivation/makers/release.ts +0 -135
  154. package/dist/integrations/generators/secret.d.ts +0 -1
  155. package/dist/integrations/generators/secret.js +0 -233
  156. package/dist/integrations/generators/secret.ts +0 -289
  157. package/dist/integrations/generators/target.d.ts +0 -1
  158. package/dist/integrations/generators/target.js +0 -775
  159. package/dist/integrations/generators/target.ts +0 -944
  160. package/dist/integrity/generators/rule.d.ts +0 -2
  161. package/dist/integrity/generators/rule.js +0 -213
  162. package/dist/integrity/generators/rule.ts +0 -271
  163. package/dist/integrity/generators/seal.d.ts +0 -4
  164. package/dist/integrity/generators/seal.js +0 -101
  165. package/dist/integrity/generators/seal.ts +0 -117
  166. package/dist/integrity/sealed.d.ts +0 -1
  167. package/dist/integrity/sealed.js +0 -56
  168. package/dist/integrity/sealed.ts +0 -56
  169. package/dist/knowledge/generators/skills.d.ts +0 -1
  170. package/dist/knowledge/generators/skills.js +0 -222
  171. package/dist/knowledge/generators/skills.ts +0 -263
  172. package/dist/operations/generators/grant.d.ts +0 -1
  173. package/dist/operations/generators/grant.js +0 -267
  174. package/dist/operations/generators/grant.ts +0 -336
  175. package/dist/operations/generators/operation.d.ts +0 -1
  176. package/dist/operations/generators/operation.js +0 -811
  177. package/dist/operations/generators/operation.ts +0 -972
  178. package/dist/operations/makers/capability.d.ts +0 -1
  179. package/dist/operations/makers/capability.js +0 -117
  180. package/dist/operations/makers/capability.ts +0 -166
  181. package/dist/operations/makers/trial.d.ts +0 -1
  182. package/dist/operations/makers/trial.js +0 -413
  183. package/dist/operations/makers/trial.ts +0 -520
@@ -1,289 +0,0 @@
1
- import { spawnSync } from 'node:child_process'
2
- import { appendFileSync, existsSync, readFileSync, writeFileSync } from 'node:fs'
3
- import { join, relative } from 'node:path'
4
- import { argv, stdin, stdout } from 'node:process'
5
- import { createInterface } from 'node:readline'
6
-
7
- import { exit } from '../../core/invoked.ts'
8
- import type { Env } from '../../core/actor.ts'
9
- import { ELSEWHERE, RECEIPT, answer, asking, asksOf, given, issue, needed, only, ownAnswers, refuse, rowLines, seeding, slug, spend, stating, wordsIn } from '../../core/asking.ts'
10
- import { holdsRow, listBounds, rowsIn, withRow } from '../../core/rows.ts'
11
- import { named as packageOf } from '../../core/scope.ts'
12
- import { findTree, inTree } from '../../core/tree.ts'
13
-
14
- import { SAID, SECRECY, secrecyOf, type Secret } from '../secret.ts'
15
- import { IGNORES, KEY_AT, SEALED_AT, keyOf, seal, sealedIn } from '../vault.ts'
16
-
17
- const TREE = findTree()
18
-
19
- const FILE = 'secrets.ts'
20
-
21
- const LIST = 'SECRETS'
22
-
23
- const NAME = /^[a-z][a-z0-9_]*$/
24
-
25
- const ENVS: readonly Env[] = ['sandbox', 'production']
26
-
27
- const WORDS = Object.keys(SECRECY) as (keyof typeof SECRECY)[]
28
-
29
- const ASKS: readonly { readonly key: string; readonly says: readonly string[]; readonly edits?: true }[] = [
30
- { key: 'name', says: ['lower_snake_case, and the prefix is added for you'] },
31
- { key: 'holder', says: [`who may hold it — ${WORDS.join(', ')}`] },
32
- { key: 'describes', says: ['what it is for, in one sentence'], edits: true },
33
- { key: 'header', says: ['blank if this value IS the address of what requires it'], edits: true },
34
- { key: 'prefix', says: ['what precedes it in that header, trailing space and all'], edits: true },
35
- ]
36
-
37
- const TAKES: readonly string[] = ASKS.map((one) => one.key)
38
-
39
- const EDITS: readonly string[] = ASKS.filter((one) => one.edits === true).map((one) => one.key)
40
-
41
- const ASKED: readonly string[] = ASKS.flatMap((one) =>
42
- one.says.map((line, at) => ` ${at === 0 ? `${one.key}:`.padEnd(32) : ' '.repeat(32)}${line}`),
43
- )
44
-
45
- const here = (one: string): string => relative(TREE.at, one).split('\\').join('/')
46
-
47
- const path = inTree(TREE, FILE)
48
-
49
- const at = here(path)
50
-
51
- import { quoted } from '../../core/rows.ts'
52
-
53
- let secrets: readonly Secret[] = []
54
- try {
55
- const taken = (await import(new URL(`file://${path}`).href)) as { SECRETS?: readonly Secret[] }
56
- secrets = taken.SECRETS ?? []
57
- } catch {
58
- refuse(`${at} could not be read. Attach \`${packageOf('integrations')}\` first — an app states its secrets there.`)
59
- }
60
-
61
- const held = new Map(ENVS.map((env) => [env, new Set(sealedIn(TREE.at, env))]))
62
-
63
- const setIn = (id: string): string => {
64
- const found = ENVS.filter((env) => held.get(env)?.has(id) === true)
65
- return found.length === 0 ? 'no value anywhere yet' : `set for ${found.join(' and ')}`
66
- }
67
-
68
- async function sealing(id: string): Promise<number> {
69
- const hidden = async (question: string): Promise<string> => {
70
- stdout.write(question)
71
- const rl = createInterface({ input: stdin, output: stdout, terminal: true })
72
- ;(rl as unknown as { _writeToOutput: (one: string) => void })._writeToOutput = () => {}
73
- const value = await new Promise<string>((done) => rl.question('', done))
74
- rl.close()
75
- stdout.write('\n')
76
- return value
77
- }
78
-
79
- let sealed = 0
80
- for (const env of ENVS) {
81
- const value = await hidden(` ${id} for ${env} (paste it, or press enter to skip): `)
82
- if (value.trim() === '') continue
83
- seal(TREE.at, id, env, value)
84
- sealed += 1
85
- }
86
- if (sealed === 0) return 0
87
-
88
- const ignore = join(TREE.at, '.gitignore')
89
- const already = existsSync(ignore) ? readFileSync(ignore, 'utf8') : ''
90
- const missing = IGNORES.filter((one) => !already.split('\n').some((line) => line.trim() === one))
91
- if (missing.length > 0) {
92
- appendFileSync(ignore, `${already.endsWith('\n') || already === '' ? '' : '\n'}${missing.join('\n')}\n`)
93
- stdout.write(`secret: added ${missing.join(', ')} to .gitignore — the key is never committed.\n`)
94
- }
95
-
96
- stdout.write(`secret: sealed ${id} for ${String(sealed)} environment(s) into ${SEALED_AT}.\n`)
97
- return sealed
98
- }
99
-
100
- const listing =
101
- secrets.length === 0
102
- ? 'no secrets yet.'
103
- : [
104
- `${String(secrets.length)} secret(s):`,
105
- ...secrets.flatMap((one) => [
106
- ` ${one.id} — ${secrecyOf(one.id) ?? 'wearing no prefix, which is refused'}, ${setIn(one.id)}`,
107
- ` ${one.sends === undefined ? 'no `sends`, so it is an address' : `sent as ${one.sends.header}: ${one.sends.prefix ?? ''}<value>`}`,
108
- ]),
109
- ].join('\n')
110
-
111
- const words = wordsIn(['new', 'set'])
112
-
113
- const verb = words[0]
114
-
115
- stdout.write(`${listing}\n`)
116
- if (keyOf(TREE.at) === undefined && secrets.length > 0) {
117
- stdout.write(
118
- `\nthere is no vault key at ${KEY_AT}, so nothing above can be opened here. It is never committed — ` +
119
- 'whoever set this app up has it.\n',
120
- )
121
- }
122
-
123
- const method = (nonce: string): string =>
124
- [
125
- '',
126
- 'what this makes:',
127
- '',
128
- ` thread create secret new <name> ${RECEIPT} ${nonce}`,
129
- ` thread create secret set <id> ${RECEIPT} ${nonce}`,
130
- '',
131
- ...ELSEWHERE,
132
- '',
133
- ` ${RECEIPT} is spent by one run and refused if ${at} moved after it was issued.`,
134
- '',
135
- 'who may hold a value. The word is what you send; the prefix is what the id wears, and the prefix',
136
- 'IS who may hold it — no field says so:',
137
- '',
138
- ...WORDS.flatMap((one) => [` ${one.padEnd(7)} → ${SECRECY[one]}<name>`, ` ${SAID[one]}`, '']),
139
- '`new` asks, in this order:',
140
- '',
141
- ...ASKED,
142
- '',
143
- 'and then, at a terminal only, it asks for the value itself — echo off, sealed as you press enter.',
144
- 'A piped run declares the row and says so instead, because there is no terminal to read one from.',
145
- '',
146
- '`edit` asks the same three, and a blank answer keeps what is already there — except that naming',
147
- 'a DIFFERENT header drops the old prefix unless you give a new one, because a prefix belongs to',
148
- 'the scheme its header names. `-` as the header removes the header and makes this an address.',
149
- '',
150
- 'It will not change who may hold a value. That is the prefix, the prefix is the id, and an id that',
151
- 'changes is a different secret — every target requiring the old name would go on requiring a name',
152
- 'nothing declares. Declare the other one and move what requires it.',
153
- '',
154
- '`set` is the same prompt on its own, for changing a value later or giving one a `new` run skipped.',
155
- 'It takes no answers and cannot be piped. The value goes from the keyboard into the sealed store and',
156
- `nowhere else — not into a row, not into this output, not into ${SEALED_AT} in any readable form.`,
157
- '',
158
- 'So an agent may declare a secret and may never give it one. That is the point of the split.',
159
- ].join('\n')
160
-
161
- const flagged = argv.indexOf(RECEIPT)
162
-
163
- if (verb === undefined && flagged === -1) {
164
- const nonce = issue(TREE.at, listing)
165
- stdout.write(`${method(nonce)}\n`)
166
- stdout.write(`\nsecret: receipt ${nonce} — spent on use, and stale the moment ${at} changes.\n`)
167
- exit(0)
168
- }
169
-
170
- spend(TREE.at, listing, argv[flagged + 1], at)
171
-
172
- if (verb !== 'new' && verb !== 'set' && verb !== 'edit') {
173
- refuse(`there is nothing called "${verb ?? ''}" to do here — say new, edit or set`)
174
- }
175
-
176
- const text = readFileSync(path, 'utf8')
177
- const where = listBounds(text, LIST)
178
- if (where === undefined) refuse(`${at} states no \`${LIST}\` list to declare a secret in`)
179
-
180
- if (verb === 'set') {
181
- const id = words[1] ?? refuse('`set` takes the id of a secret this app already declares')
182
- const one = secrets.find((each) => each.id === id)
183
- if (one === undefined) {
184
- refuse(
185
- `\`${id}\` is not a secret this app declares. Declare it first with \`thread create secret new\` — a value is ` +
186
- 'given to something that said it needed it, or not at all.',
187
- )
188
- }
189
- if (stdin.isTTY !== true) {
190
- refuse(
191
- 'a value is typed by a person at a terminal, and this run is piped. Nothing was written. Run ' +
192
- `\`thread create secret set ${id}\` yourself — an agent may declare a secret and may never give it one.`,
193
- )
194
- }
195
-
196
- if ((await sealing(id)) === 0) {
197
- stdout.write('secret: nothing typed, so nothing was sealed.\n')
198
- exit(0)
199
- }
200
-
201
- const kept = spawnSync('npx', ['thread', 'vault'], { cwd: TREE.at, encoding: 'utf8' })
202
- stdout.write(`${`${kept.stdout ?? ''}${kept.stderr ?? ''}`.trim()}\n`)
203
- exit(kept.status === 0 ? 0 : 1)
204
- }
205
-
206
- const piped = given()
207
- only(piped, TAKES, 'a secret')
208
-
209
- const { ask, line, shut } = asking(piped)
210
-
211
- const own = ownAnswers(piped)
212
-
213
- const name = slug(words[1] ?? (await ask('name', 'name: ')))
214
- if (name === '') {
215
- shut()
216
- refuse('a secret has to be called something')
217
- }
218
- if (!NAME.test(name)) {
219
- shut()
220
- refuse(`"${name}" cannot be the name of a secret — it is written in lower_snake_case`)
221
- }
222
-
223
- const holder = (piped.length > 0 ? needed(own, 'holder', 'a secret') : await ask('holder', `who may hold it — ${WORDS.join(', ')}: `)).trim()
224
- if (!WORDS.includes(holder as keyof typeof SECRECY)) {
225
- shut()
226
- refuse(
227
- `there is no such holder as "${holder}". A secret is held by a ${WORDS.join(' or a ')}, and that prefix is the ` +
228
- 'only thing standing between a server credential and a browser bundle.',
229
- )
230
- }
231
- const word = holder as keyof typeof SECRECY
232
- const id = `${SECRECY[word]}${name}`
233
-
234
- if (secrets.some((one) => one.id === id) || holdsRow(text, where, id)) {
235
- shut()
236
- refuse(`\`${id}\` is already declared in ${at}`)
237
- }
238
-
239
- const describes = (piped.length > 0 ? needed(own, 'describes', 'a secret') : await ask('describes', 'what is it for? ')).trim()
240
- if (describes === '') {
241
- shut()
242
- refuse('a secret says what it is for — the sentence is what somebody reads before requiring it')
243
- }
244
-
245
- const header = (piped.length > 0 ? (answer(own, 'header') ?? '') : await ask('header', 'header (blank if this value IS an address): ')).trim()
246
- const typed = header === '' ? '' : (piped.length > 0 ? (answer(own, 'prefix') ?? '') : await ask('prefix', 'prefix in that header, e.g. "Bearer ": '))
247
-
248
- const { stated, kids } = await stating(asksOf('secret', 'Secret', {}, ['id', 'at', 'describes', 'version', 'sends']), piped, piped.length > 0, ask, line, [])
249
-
250
- shut()
251
-
252
- const prefix = typed === '' || typed.endsWith(' ') ? typed : `${typed} `
253
-
254
- const row = [
255
- ' {',
256
- ` id: ${quoted(id)},`,
257
- ` at: '_threads/${FILE}',`,
258
- ` describes: ${quoted(describes)},`,
259
- ' version: 1,',
260
- ...(header === ''
261
- ? []
262
- : [` sends: { header: ${quoted(header.toLowerCase())}${prefix === '' ? '' : `, prefix: ${quoted(prefix)}`} },`]),
263
- ...rowLines(' ', stated, kids),
264
- ' },',
265
- ].join('\n')
266
-
267
- writeFileSync(path, withRow(text, where, row), 'utf8')
268
-
269
- for (const told of seeding(kids, TREE.at)) stdout.write(`secret: ${told}\n`)
270
-
271
- stdout.write(
272
- `secret: declared ${id} in ${at}${header === '' ? ' — it has no `sends`, so it is the address of whatever requires it' : ''}.\n`,
273
- )
274
-
275
- if (stdin.isTTY === true) {
276
- stdout.write(`\n${SAID[word]}\n\nThe value is not echoed and is sealed straight into ${SEALED_AT}.\n`)
277
- if ((await sealing(id)) === 0) {
278
- stdout.write(`secret: nothing typed, so ${id} has no value yet. Run \`thread create secret set ${id}\` when you have it.\n`)
279
- }
280
- } else {
281
- stdout.write(
282
- `secret: it has no value anywhere yet, and this run is piped — a value is typed by a person at a terminal. ` +
283
- `Run \`thread create secret set ${id}\` yourself.\n`,
284
- )
285
- }
286
-
287
- const kept = spawnSync('npx', ['thread', 'vault'], { cwd: TREE.at, encoding: 'utf8' })
288
- stdout.write(`${`${kept.stdout ?? ''}${kept.stderr ?? ''}`.trim()}\n`)
289
- exit(kept.status === 0 ? 0 : 1)
@@ -1 +0,0 @@
1
- export {};