dispach 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -34
- package/dist/APEv2Parser-etzjd528.js +5 -0
- package/dist/{FlacParser-bf8y3e0w.js.map → APEv2Parser-etzjd528.js.map} +1 -1
- package/dist/{AiffParser-tbx3xkmk.js → AiffParser-y21k3fak.js} +3 -3
- package/dist/{AiffParser-tbx3xkmk.js.map → AiffParser-y21k3fak.js.map} +1 -1
- package/dist/App-4w3qkcs4.js +11 -0
- package/dist/{App-hjn867nc.js.map → App-4w3qkcs4.js.map} +1 -1
- package/dist/{AsfParser-d784ak3y.js → AsfParser-wd98k2h4.js} +3 -3
- package/dist/{AsfParser-d784ak3y.js.map → AsfParser-wd98k2h4.js.map} +1 -1
- package/dist/{ConfigEditor-g7eb2wsm.js → ConfigEditor-vk7vxaa6.js} +3 -3
- package/dist/{ConfigEditor-g7eb2wsm.js.map → ConfigEditor-vk7vxaa6.js.map} +1 -1
- package/dist/{DsdiffParser-vxnfx80c.js → DsdiffParser-cbfaj500.js} +3 -3
- package/dist/{DsdiffParser-vxnfx80c.js.map → DsdiffParser-cbfaj500.js.map} +1 -1
- package/dist/{DsfParser-0xsh0zzk.js → DsfParser-tybrja4x.js} +3 -3
- package/dist/{DsfParser-0xsh0zzk.js.map → DsfParser-tybrja4x.js.map} +1 -1
- package/dist/FlacParser-7t7da7qy.js +5 -0
- package/dist/{APEv2Parser-9wqew3zv.js.map → FlacParser-7t7da7qy.js.map} +1 -1
- package/dist/{KeyProbe-w8c37s9q.js → KeyProbe-5anphmb7.js} +3 -3
- package/dist/{KeyProbe-w8c37s9q.js.map → KeyProbe-5anphmb7.js.map} +1 -1
- package/dist/{MP4Parser-tq7r7wd4.js → MP4Parser-gc94h1n9.js} +3 -3
- package/dist/{MP4Parser-tq7r7wd4.js.map → MP4Parser-gc94h1n9.js.map} +1 -1
- package/dist/{MatroskaParser-a79gsmzb.js → MatroskaParser-cy2k4fac.js} +3 -3
- package/dist/{MatroskaParser-a79gsmzb.js.map → MatroskaParser-cy2k4fac.js.map} +1 -1
- package/dist/{MpegParser-zs61b3wq.js → MpegParser-c460fwf0.js} +3 -3
- package/dist/{MpegParser-zs61b3wq.js.map → MpegParser-c460fwf0.js.map} +1 -1
- package/dist/{MusepackParser-bp8dm6nz.js → MusepackParser-8mq2eabg.js} +3 -3
- package/dist/{MusepackParser-bp8dm6nz.js.map → MusepackParser-8mq2eabg.js.map} +1 -1
- package/dist/{OggParser-7pxr1sn9.js → OggParser-7dnc6apg.js} +3 -3
- package/dist/{OggParser-7pxr1sn9.js.map → OggParser-7dnc6apg.js.map} +1 -1
- package/dist/Picker-j7txnm7w.js +5 -0
- package/dist/{Picker-b09hr4tk.js.map → Picker-j7txnm7w.js.map} +1 -1
- package/dist/SessionPicker-hpv2ncsb.js +5 -0
- package/dist/{SessionPicker-wtfxwdxg.js.map → SessionPicker-hpv2ncsb.js.map} +3 -3
- package/dist/SkillBrowser-qc542n71.js +5 -0
- package/dist/{SkillBrowser-p9ht63c7.js.map → SkillBrowser-qc542n71.js.map} +1 -1
- package/dist/{WavPackParser-gpf3r92t.js → WavPackParser-kt7cds9c.js} +3 -3
- package/dist/{WavPackParser-gpf3r92t.js.map → WavPackParser-kt7cds9c.js.map} +1 -1
- package/dist/{WaveParser-3kcak550.js → WaveParser-g47ja0vy.js} +3 -3
- package/dist/{WaveParser-3kcak550.js.map → WaveParser-g47ja0vy.js.map} +1 -1
- package/dist/WizardApp-q4p979d1.js +5 -0
- package/dist/{WizardApp-494018sk.js.map → WizardApp-q4p979d1.js.map} +3 -3
- package/dist/{channels-yhdvxxrb.js → channels-4t89qpdt.js} +14 -14
- package/dist/{channels-yhdvxxrb.js.map → channels-4t89qpdt.js.map} +1 -1
- package/dist/client.d.ts +242 -1
- package/dist/client.js +11 -11
- package/dist/client.js.map +5 -5
- package/dist/{config-g0ybmm4t.js → config-35r6n1gh.js} +17 -17
- package/dist/{config-g0ybmm4t.js.map → config-35r6n1gh.js.map} +1 -1
- package/dist/{credential-pkme1sfe.js → credential-dpdgg4j6.js} +5 -5
- package/dist/{credential-pkme1sfe.js.map → credential-dpdgg4j6.js.map} +1 -1
- package/dist/{index-q8b1fc3k.js → index-0444sh6x.js} +4 -4
- package/dist/{index-q8b1fc3k.js.map → index-0444sh6x.js.map} +1 -1
- package/dist/{index-ec101x93.js → index-095hrkyr.js} +6 -6
- package/dist/{index-ec101x93.js.map → index-095hrkyr.js.map} +1 -1
- package/dist/index-1x8mzvz7.js +6 -0
- package/dist/{index-f056wkb4.js.map → index-1x8mzvz7.js.map} +1 -1
- package/dist/index-2bsardvh.js +5 -0
- package/dist/{index-9dmgk6d3.js.map → index-2bsardvh.js.map} +2 -2
- package/dist/{index-thmq816c.js → index-2zjh5zd5.js} +4 -4
- package/dist/{index-thmq816c.js.map → index-2zjh5zd5.js.map} +1 -1
- package/dist/{index-t6xnecdx.js → index-323jvr1g.js} +4 -4
- package/dist/{index-t6xnecdx.js.map → index-323jvr1g.js.map} +1 -1
- package/dist/{index-mn34kj95.js → index-3826kf9t.js} +5 -5
- package/dist/{index-mn34kj95.js.map → index-3826kf9t.js.map} +1 -1
- package/dist/index-38gs9anh.js +9 -0
- package/dist/{index-akv6e7ge.js.map → index-38gs9anh.js.map} +1 -1
- package/dist/index-3c5jt6by.js +5 -0
- package/dist/{index-3b3h8kyh.js.map → index-3c5jt6by.js.map} +2 -2
- package/dist/{index-a6mtqkth.js → index-3vzf253k.js} +7 -7
- package/dist/{index-a6mtqkth.js.map → index-3vzf253k.js.map} +1 -1
- package/dist/{index-5m9wydxb.js → index-42e29zs4.js} +4 -4
- package/dist/{index-5m9wydxb.js.map → index-42e29zs4.js.map} +1 -1
- package/dist/{index-v7mz396x.js → index-4fj1k64j.js} +4 -4
- package/dist/{index-v7mz396x.js.map → index-4fj1k64j.js.map} +1 -1
- package/dist/{index-s2tzq27a.js → index-51x0n5z0.js} +5 -5
- package/dist/{index-s2tzq27a.js.map → index-51x0n5z0.js.map} +1 -1
- package/dist/index-664xcamy.js +110 -0
- package/dist/index-664xcamy.js.map +13 -0
- package/dist/index-7mn8ack9.js +6 -0
- package/dist/{index-xa9crtzq.js.map → index-7mn8ack9.js.map} +2 -2
- package/dist/index-8edck2pr.js +6 -0
- package/dist/{index-7gsbzvnc.js.map → index-8edck2pr.js.map} +1 -1
- package/dist/{index-9qv87rq7.js → index-8h6kewy1.js} +7 -7
- package/dist/{index-9qv87rq7.js.map → index-8h6kewy1.js.map} +1 -1
- package/dist/index-8tmv33mr.js +6 -0
- package/dist/{index-vw2hf4d8.js.map → index-8tmv33mr.js.map} +1 -1
- package/dist/index-9914wh1d.js +6 -0
- package/dist/index-9914wh1d.js.map +10 -0
- package/dist/{index-ye2yb3xf.js → index-a2eh8dnk.js} +6 -6
- package/dist/{index-ye2yb3xf.js.map → index-a2eh8dnk.js.map} +1 -1
- package/dist/{index-81vj1bxe.js → index-bqdkm3de.js} +4 -4
- package/dist/{index-81vj1bxe.js.map → index-bqdkm3de.js.map} +1 -1
- package/dist/{index-j20k6k0m.js → index-dzy19wtf.js} +4 -4
- package/dist/{index-j20k6k0m.js.map → index-dzy19wtf.js.map} +1 -1
- package/dist/{index-gqaa06yh.js → index-eqqd4k4f.js} +9 -9
- package/dist/{index-gqaa06yh.js.map → index-eqqd4k4f.js.map} +1 -1
- package/dist/{index-633eqxry.js → index-ew997be5.js} +7 -7
- package/dist/{index-633eqxry.js.map → index-ew997be5.js.map} +1 -1
- package/dist/{index-y34s71qe.js → index-fa9wvpyw.js} +3 -3
- package/dist/{index-y34s71qe.js.map → index-fa9wvpyw.js.map} +1 -1
- package/dist/{index-myg5enf5.js → index-fbsrhcga.js} +4 -4
- package/dist/{index-myg5enf5.js.map → index-fbsrhcga.js.map} +1 -1
- package/dist/{index-x9z2xnct.js → index-fcsg95m5.js} +5 -5
- package/dist/{index-x9z2xnct.js.map → index-fcsg95m5.js.map} +1 -1
- package/dist/{index-zjphh8ch.js → index-gbkma7ds.js} +4 -4
- package/dist/{index-zjphh8ch.js.map → index-gbkma7ds.js.map} +1 -1
- package/dist/{index-ac2wzspd.js → index-gq1npngp.js} +4 -4
- package/dist/{index-ac2wzspd.js.map → index-gq1npngp.js.map} +1 -1
- package/dist/{index-6r9h7ftn.js → index-haypwvzd.js} +85 -85
- package/dist/index-haypwvzd.js.map +21 -0
- package/dist/{index-qh82wtpa.js → index-jc4kmfwa.js} +4 -4
- package/dist/{index-qh82wtpa.js.map → index-jc4kmfwa.js.map} +1 -1
- package/dist/index-kjqksgch.js +429 -0
- package/dist/index-kjqksgch.js.map +12 -0
- package/dist/{index-trx9xb59.js → index-m6fqx0ch.js} +7 -7
- package/dist/{index-trx9xb59.js.map → index-m6fqx0ch.js.map} +1 -1
- package/dist/{index-twcgf73h.js → index-ma6p7bt4.js} +4 -4
- package/dist/{index-twcgf73h.js.map → index-ma6p7bt4.js.map} +1 -1
- package/dist/index-nvc24414.js +6 -0
- package/dist/{index-1f1erzfx.js.map → index-nvc24414.js.map} +1 -1
- package/dist/index-nxhqf597.js +6 -0
- package/dist/{index-w97gprre.js.map → index-nxhqf597.js.map} +1 -1
- package/dist/{index-psk6q25h.js → index-p1zy871m.js} +4 -4
- package/dist/{index-psk6q25h.js.map → index-p1zy871m.js.map} +1 -1
- package/dist/{index-jh2az41t.js → index-p6ya59m6.js} +5 -5
- package/dist/{index-jh2az41t.js.map → index-p6ya59m6.js.map} +1 -1
- package/dist/{index-6c4p19m1.js → index-pszmnhgq.js} +2 -2
- package/dist/index-qg9bn980.js +1213 -0
- package/dist/{index-26ejkp8q.js.map → index-qg9bn980.js.map} +26 -23
- package/dist/index-qgsdgbk8.js +5 -0
- package/dist/{index-wk6andxq.js.map → index-qgsdgbk8.js.map} +2 -2
- package/dist/index-r4ax3x4d.js +74 -0
- package/dist/index-r4ax3x4d.js.map +13 -0
- package/dist/{index-zg89tq04.js → index-snz49ndn.js} +4 -4
- package/dist/{index-zg89tq04.js.map → index-snz49ndn.js.map} +1 -1
- package/dist/index-twn9bfm2.js +8 -0
- package/dist/{index-0mz7wpbw.js.map → index-twn9bfm2.js.map} +2 -2
- package/dist/{index-3fgq1acj.js → index-wc4entme.js} +10 -10
- package/dist/{index-3fgq1acj.js.map → index-wc4entme.js.map} +1 -1
- package/dist/{index-ad5c9t83.js → index-ynsvkqgb.js} +4 -4
- package/dist/{index-ad5c9t83.js.map → index-ynsvkqgb.js.map} +1 -1
- package/dist/index-ytxbw8py.js +63 -0
- package/dist/{index-0pddq849.js.map → index-ytxbw8py.js.map} +2 -2
- package/dist/index-yw3fby4n.js +6 -0
- package/dist/{index-4emtktc0.js.map → index-yw3fby4n.js.map} +2 -2
- package/dist/{index-307qmvb0.js → index-z157at3s.js} +25 -25
- package/dist/{index-307qmvb0.js.map → index-z157at3s.js.map} +1 -1
- package/dist/{index-pdsey1ab.js → index-zce9gy22.js} +62 -62
- package/dist/{index-pdsey1ab.js.map → index-zce9gy22.js.map} +1 -1
- package/dist/{index-skkddg44.js → index-zw6wyas6.js} +4 -4
- package/dist/{index-skkddg44.js.map → index-zw6wyas6.js.map} +1 -1
- package/dist/index.js +307 -291
- package/dist/index.js.map +15 -12
- package/dist/init.d.ts.map +1 -1
- package/dist/lib/agent-template.d.ts +5 -0
- package/dist/lib/agent-template.d.ts.map +1 -1
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/init-flow.d.ts +7 -30
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/owner.d.ts +49 -0
- package/dist/lib/owner.d.ts.map +1 -0
- package/dist/lib/presets.d.ts +44 -0
- package/dist/lib/presets.d.ts.map +1 -0
- package/dist/lib/provision.d.ts +8 -1
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/lib/relay-client.d.ts +17 -0
- package/dist/lib/relay-client.d.ts.map +1 -0
- package/dist/lib/schema.d.ts +2 -0
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/sessions-view.d.ts +2 -0
- package/dist/lib/sessions-view.d.ts.map +1 -1
- package/dist/lib/source.d.ts +17 -0
- package/dist/lib/source.d.ts.map +1 -1
- package/dist/lib/wizard.d.ts.map +1 -1
- package/dist/owner.d.ts +16 -0
- package/dist/owner.d.ts.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/{web-f6869dy2.js → web-zph4h3p9.js} +7 -7
- package/dist/{web-f6869dy2.js.map → web-zph4h3p9.js.map} +1 -1
- package/dist/wire.d.ts +31 -0
- package/dist/wire.js +2 -2
- package/dist/wire.js.map +4 -4
- package/dist/wrapper-f662ny3r.js +5 -0
- package/dist/{wrapper-52c0vacs.js.map → wrapper-f662ny3r.js.map} +1 -1
- package/package.json +4 -1
- package/dist/APEv2Parser-9wqew3zv.js +0 -5
- package/dist/App-hjn867nc.js +0 -11
- package/dist/FlacParser-bf8y3e0w.js +0 -5
- package/dist/Picker-b09hr4tk.js +0 -5
- package/dist/SessionPicker-wtfxwdxg.js +0 -5
- package/dist/SkillBrowser-p9ht63c7.js +0 -5
- package/dist/WizardApp-494018sk.js +0 -5
- package/dist/index-0mz7wpbw.js +0 -8
- package/dist/index-0pddq849.js +0 -63
- package/dist/index-1f1erzfx.js +0 -6
- package/dist/index-26ejkp8q.js +0 -1194
- package/dist/index-3b3h8kyh.js +0 -5
- package/dist/index-4emtktc0.js +0 -6
- package/dist/index-4t3p7vm9.js +0 -6
- package/dist/index-4t3p7vm9.js.map +0 -10
- package/dist/index-6r9h7ftn.js.map +0 -21
- package/dist/index-7gsbzvnc.js +0 -6
- package/dist/index-94k4mh6s.js +0 -96
- package/dist/index-94k4mh6s.js.map +0 -13
- package/dist/index-9dmgk6d3.js +0 -5
- package/dist/index-akv6e7ge.js +0 -9
- package/dist/index-f056wkb4.js +0 -6
- package/dist/index-s57ztjhq.js +0 -74
- package/dist/index-s57ztjhq.js.map +0 -13
- package/dist/index-vw2hf4d8.js +0 -6
- package/dist/index-w97gprre.js +0 -6
- package/dist/index-wk6andxq.js +0 -5
- package/dist/index-xa9crtzq.js +0 -6
- package/dist/index-z0dgxd7d.js +0 -429
- package/dist/index-z0dgxd7d.js.map +0 -11
- package/dist/wrapper-52c0vacs.js +0 -5
- /package/dist/{index-6c4p19m1.js.map → index-pszmnhgq.js.map} +0 -0
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * `config` — a person changing an agent's settings without hand-editing YAML.\n *\n * ## Why this exists\n *\n * `config_read`/`config_set` shipped in Phase 3.6 and are the *agent's*. There was no equivalent for a\n * person, so the routes were editing `agent.yaml` by hand, re-running `init` into a fresh directory, or\n * asking the agent (which needs `config_set` pinned, a matching allow rule, and a restart).\n *\n * The inversion is the argument for the command. Decision 11.29 reserves `allowFrom`, `server.host`,\n * `server.tokenEnv` and `writeRoots` **for the person**, floored so the agent cannot widen its own\n * reach — and that is right. But the only editor ever built was the agent's, so the fields designated\n * as the person's had the worst ergonomics in the system: unvalidated YAML that fails at the next boot.\n * It compounds with `.env` being protected *precisely* so the agent cannot supply its own secrets,\n * which left the one actor who can fill in `MODEL_API_KEY` with no tool for doing it.\n *\n * ## What this does not own\n *\n * The write. `editManifest` places, validates against the real schema, checks that the providers still\n * resolve, and only then writes — one writer for every surface, because the three that existed made\n * the guarantee depend on which caller you happened to be.\n *\n * ## Why nothing here is floored\n *\n * The agent's floor exists because an agent that could widen its own inbound gate could be *talked\n * into* it by the message it is reading. A person at a terminal is not that threat. Two edits are\n * confirmed rather than refused — `tools.policy.deny` and `onMutate: allow` — and `lib/config-view.ts`\n * decides which, so \"what needs a confirmation\" is assertable without performing one.\n */\n\nimport { readFileSync } from \"node:fs\"\nimport {\n HarnessError,\n manifestDocument,\n manifestValueAt,\n nearest,\n parseSettingValue,\n personSetting,\n processAlive,\n readManifestHeader,\n type Setting,\n SqliteStore,\n settingByPath,\n} from \"@dispach/core\"\nimport { applyAllow, applySecret, applySet, checkedHandle } from \"#lib/config-apply\"\nimport type { EditorRow } from \"#lib/config-editor\"\nimport { agentEnv } from \"#lib/config-env\"\nimport { applyEditorRow, currentValues, editorRowsFor } from \"#lib/config-rows\"\nimport {\n confirmationFor,\n envNeeds,\n renderChange,\n renderOne,\n renderSettings,\n settablePaths,\n showValue,\n unmet,\n} from \"#lib/config-view\"\nimport { askSecret, askYesNo } from \"#lib/confirm\"\nimport {\n ENTER_ALT_SCREEN,\n EXIT_FAILURE,\n EXIT_OK,\n FALLBACK_COLUMNS,\n MAX_SCREEN_ROWS,\n} from \"#lib/const\"\nimport { flushOutput, markAltScreen, onExit, restoreTerminal } from \"#lib/exit\"\nimport { negotiateKeyboard } from \"#lib/keyboard\"\nimport { resolveModeFromProcess } from \"#lib/output\"\nimport { bullet, keyValue } from \"#lib/render\"\nimport { resolveAgentRef, storePath } from \"#lib/sandbox\"\nimport { screenColumns } from \"#lib/screen\"\n\nexport interface ConfigCommandOptions {\n /** `list` | `get` | `set` | `env` | `allow`. */\n readonly action?: string\n /** A path or a sandbox agent name. */\n readonly ref?: string\n /** A setting path, an env variable name, or a handle, depending on the action. */\n readonly name?: string\n readonly value?: string\n readonly channel?: string\n readonly remove?: boolean\n readonly yes?: boolean\n readonly store?: string\n /** Injected by tests. */\n readonly confirm?: (question: string) => Promise<boolean>\n readonly secret?: (question: string) => Promise<string | undefined>\n /**\n * The `<ENVPREFIX>HOME` override that relocates the whole sandbox. **Not** the manifest\n * environment: that one is `ambientEnv`, computed from the resolved path, and answers \"is this\n * variable set\". Two env concepts in one options object want two names — conflating them has\n * already cost a round, where `skills install` consulted a different registry from `init`.\n */\n readonly sandboxEnv?: Readonly<Record<string, string | undefined>>\n readonly out?: (text: string) => void\n}\n\nconst ACTIONS = [\"list\", \"get\", \"set\", \"env\", \"allow\", \"edit\"] as const\n\n/**\n * Read the action and the agent out of the positionals, allowing `config <agent>` with no action.\n *\n * The editor is what most people want from this command, so typing its name and an agent has to work.\n * Disambiguated the way this repo already does it twice over: a slash command takes arguments only\n * after a token that is *exactly* a known command, and `resolveAgentRef` lets the filesystem win with a\n * note on genuine ambiguity. Here the six action words win, and anything else is an agent.\n *\n * The collision is an agent literally named after an action, and it gets the note rather than silence —\n * running the wrong thing quietly is the failure worth avoiding, and it does not look wrong in output.\n */\nexport function readAction(\n first: string | undefined,\n second: string | undefined,\n warn: (line: string) => void = (line) => process.stderr.write(line),\n): { readonly action: string; readonly ref: string | undefined } {\n const given = (first ?? \"\").trim()\n if (given === \"\") return { action: \"edit\", ref: undefined }\n if (!ACTIONS.includes(given as (typeof ACTIONS)[number])) {\n return { action: \"edit\", ref: given }\n }\n if (second !== undefined && ACTIONS.includes(second as (typeof ACTIONS)[number])) {\n // Both words are action names, so one of them is an agent and only the order says which. The\n // first wins, and the note is what stops a silently-wrong run — the same choice\n // `resolveAgentRef` makes for a bare name shadowed by a directory.\n warn(`note: reading \"${given}\" as the action and \"${second}\" as the agent\\n`)\n }\n if (second === undefined && given !== \"list\") {\n // A known action word with nothing after it. `config edit` alone is the editor with no agent,\n // which fails later with the usual missing-manifest error; anything else is ambiguous only if an\n // agent has that name, and `resolveAgentRef` is what finds out.\n return { action: given, ref: undefined }\n }\n return { action: given, ref: second }\n}\n\nexport async function configCommand(options: ConfigCommandOptions): Promise<number> {\n const out = options.out ?? ((text: string) => process.stdout.write(text))\n const action = options.action ?? \"\"\n if (!ACTIONS.includes(action as (typeof ACTIONS)[number])) {\n const suggestion = nearest(action, [...ACTIONS])\n throw new HarnessError({\n code: \"cli_config_action_unknown\",\n message: `\"${action}\" is not something config does.`,\n hint: `One of: ${ACTIONS.join(\", \")}.${\n suggestion === undefined ? \"\" : ` Did you mean ${suggestion}?`\n }`,\n })\n }\n\n const manifestPath = resolveAgentRef(options.ref ?? \"\", options.sandboxEnv)\n\n switch (action) {\n case \"list\": {\n out(`${renderSettings(currentValues(manifestPath), manifestPath)}\\n`)\n // What is currently missing belongs here rather than on every `set`: this is the command\n // whose job is the overview, and a note repeated on unrelated edits is one nobody reads.\n const missing = unmet(\n envNeeds(manifestDocument(readFileSync(manifestPath, \"utf8\"))),\n agentEnv(manifestPath),\n )\n for (const need of missing) {\n out(`\\n${bullet(`${need.name} is not set — ${need.why}`)}\\n`)\n out(`${bullet(`\\`config env <agent> ${need.name}\\` fills it in`)}\\n`)\n }\n return EXIT_OK\n }\n case \"get\":\n return get(manifestPath, options, out)\n case \"set\":\n return await set(manifestPath, options, out)\n case \"env\":\n return await env(manifestPath, options, out)\n case \"edit\":\n return await edit(manifestPath, options, out)\n default:\n return await allow(manifestPath, options, out)\n }\n}\n\nfunction get(\n manifestPath: string,\n options: ConfigCommandOptions,\n out: (text: string) => void,\n): number {\n const path = (options.name ?? \"\").trim()\n const setting = requireSetting(path)\n const row = currentValues(manifestPath).find((entry) => entry.setting.path === setting.path)\n out(`${renderOne(setting, row?.value)}\\n`)\n return EXIT_OK\n}\n\nfunction requireSetting(path: string): Setting {\n // `model.fast` is the `model.<role>` row, the one placeholder a person fills in themselves.\n const found = settingByPath(path) ?? personSetting(path)\n if (found !== undefined) return found\n const suggestion = nearest(path, [...settablePaths()])\n throw new HarnessError({\n code: \"cli_config_path_unknown\",\n message: `\"${path}\" is not a setting.`,\n hint: `\\`config list <agent>\\` shows every one with its current value.${\n suggestion === undefined ? \"\" : ` Did you mean ${suggestion}?`\n }`,\n field: \"path\",\n })\n}\n\nasync function set(\n manifestPath: string,\n options: ConfigCommandOptions,\n out: (text: string) => void,\n): Promise<number> {\n const path = (options.name ?? \"\").trim()\n const setting = requireSetting(path)\n\n if (setting.via !== undefined) {\n throw new HarnessError({\n code: \"cli_config_needs_action\",\n message: `${setting.path} is not set by a dotted path.`,\n hint: `Use \\`${setting.via}\\` — it lives inside a list entry, and it gets its value checked against the service that issues it rather than written verbatim.`,\n field: \"path\",\n })\n }\n if (options.value === undefined) {\n throw new HarnessError({\n code: \"cli_config_value_missing\",\n message: `No value given for ${path}.`,\n hint: `A bare word, a number, a list as [\"a\", \"b\"], or a map as {k: v}. \\`config get <agent> ${path}\\` shows what it is now.`,\n field: \"value\",\n })\n }\n\n const value = parseSettingValue(options.value)\n\n // The confirmation, before anything is read or written. It is not a floor — these edits are the\n // person's to make — but both of them stop a check from running, and an edit whose whole effect is\n // invisible until something exploits it is worth one sentence and a keypress.\n const warning = confirmationFor(setting, value)\n if (warning !== undefined && options.yes !== true) {\n out(`${bullet(warning)}\\n`)\n const ask = options.confirm ?? askYesNo\n if (!(await ask(`Change ${setting.path} anyway?`))) {\n out(`${keyValue([{ label: \"unchanged\", value: setting.path }])}\\n`)\n return EXIT_OK\n }\n }\n\n // The agent's own layered environment, not this process's. `ambientEnv` alone does not do it: it\n // demotes a colliding cwd variable and never adds the agent's own file, so a token sitting beside\n // the manifest read as unset.\n const ambient = agentEnv(manifestPath)\n const before = unmet(\n envNeeds(manifestDocument(readFileSync(manifestPath, \"utf8\"))),\n ambient,\n ).map((need) => need.name)\n\n // `applySet` owns the write, so the editor and this command cannot validate a value differently.\n const result = await applySet(manifestPath, path, options.value)\n\n // Newly required only. Computed either side of the edit rather than guessed from the value, so\n // `server.enabled true` reports the token it has just made load-bearing and `limits.maxSteps 9`\n // reports nothing — which a live run got wrong in the other direction, warning that an agent with\n // a disabled server \"will refuse to start\".\n const pending = unmet(\n envNeeds(manifestDocument(readFileSync(manifestPath, \"utf8\"))),\n ambient,\n ).filter((need) => !before.includes(need.name))\n\n const held = await running(manifestPath, options)\n out(\n `${renderChange({\n path,\n before: result.before,\n after: value,\n file: manifestPath,\n reflowed: result.reflowed,\n ...(held === undefined ? {} : { running: held }),\n pending,\n restartHint: restartHint(held?.mode),\n })}\\n`,\n )\n return EXIT_OK\n}\n\n/**\n * How this agent comes back, phrased for how it is currently held.\n *\n * All three `RuntimeMode` values, because the generic sentence is useless for two of them. `embedded` is\n * the case that matters most and is easiest to miss: it is *this* session, so the answer is one word the\n * person can type — and a live run reported `pid 90050, embedded` under \"it is started again\", which is\n * true and gives them nothing.\n */\nfunction restartHint(mode: string | undefined): string {\n if (mode === \"daemon\") return \"`daemon restart <agent>`\"\n if (mode === \"embedded\") return \"`/restart` in this session\"\n if (mode === \"terminal\") return \"that process being started again\"\n return \"it is started again\"\n}\n\n/**\n * A live process holding this agent, or `undefined`.\n *\n * Never a refusal, only a note. Fixing a misconfiguration *while it is running and broken* is the main\n * thing this command is for, so refusing in that state would block the case it exists to serve.\n *\n * Liveness is re-checked rather than trusted: a lease row is a claim, and a boot that failed after\n * claiming leaves a row seconds old with no process under it — which once blocked every retry for\n * ninety seconds while naming a pid that no longer existed.\n */\nasync function running(\n manifestPath: string,\n options: ConfigCommandOptions,\n): Promise<{ readonly pid: number; readonly mode: string } | undefined> {\n let agentId: string | undefined\n try {\n agentId = readManifestHeader(manifestPath).id\n } catch {\n return undefined\n }\n if (agentId === undefined) return undefined\n\n try {\n const store = await SqliteStore.open({\n path: options.store ?? storePath(options.sandboxEnv),\n })\n try {\n for (const lease of await store.leases.all()) {\n if (lease.agentId !== agentId) continue\n if (!processAlive(lease.pid)) continue\n return { pid: lease.pid, mode: lease.mode }\n }\n } finally {\n await store.close()\n }\n } catch {\n // A missing or unreadable store is not a reason to refuse a manifest edit. The note is a\n // courtesy; the write is the command.\n return undefined\n }\n return undefined\n}\n\n/**\n * Put a secret in the `.env` beside the manifest.\n *\n * The value is prompted and never taken from an argument: an argument lands in shell history and in\n * `ps`, readable by every local process for the lifetime of the call. Not a TTY refuses rather than\n * reading a pipe, so a CI run is told nothing was written instead of a secret arriving from a source\n * the caller did not audit.\n *\n * Written 0600 whichever way the file arrived. Under a service manager this file is the *only* path\n * credentials take — launchd hands a job almost no environment and a plist carries none on purpose —\n * so tightening it is right even when this command did not create it.\n */\nasync function env(\n manifestPath: string,\n options: ConfigCommandOptions,\n out: (text: string) => void,\n): Promise<number> {\n const name = (options.name ?? \"\").trim()\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {\n throw new HarnessError({\n code: \"cli_config_env_name_invalid\",\n message: `\"${name}\" is not an environment variable name.`,\n hint: \"Letters, digits and underscores, not starting with a digit — MODEL_API_KEY, TELEGRAM_BOT_TOKEN. `config list <agent>` shows which ones this agent names.\",\n field: \"name\",\n })\n }\n\n // Statically imported, not `await import`. A module reached both ways makes `bun build\n // --splitting` emit its exports twice and the binary refuses to parse — and `bun test` sails\n // through it, because tests import source and the failure is in the bundle. `confirm.ts` pulls in\n // only `node:readline`, so there is nothing to defer.\n const ask = options.secret ?? askSecret\n const value = await ask(`value for ${name} (not echoed):`)\n if (value === undefined) {\n throw new HarnessError({\n code: \"cli_config_env_no_value\",\n message: `Nothing was written for ${name}.`,\n hint: \"A secret is read from a prompt, never from an argument or a pipe — an argument is visible in `ps` and in shell history. Run this at a terminal, or edit the .env beside the manifest yourself.\",\n })\n }\n if (value === \"\") {\n throw new HarnessError({\n code: \"cli_config_env_empty\",\n message: `An empty value for ${name} would not start the agent.`,\n hint: \"A variable set to nothing fails the load exactly as a missing one does. Nothing was written.\",\n })\n }\n\n // The write itself is `applySecret`, which the editor calls too — two callers deciding separately\n // whether to tighten the file's mode is the same class of split as two manifest writers.\n const applied = applySecret(manifestPath, name, value)\n out(`${keyValue([{ label: \"set\", value: applied.note }])}\\n`)\n out(`${bullet(\"takes effect the next time the agent starts\")}\\n`)\n return EXIT_OK\n}\n\n/**\n * Add or remove a handle on a channel's `allowFrom`.\n *\n * Its own action rather than a `config set` path for two reasons. The source editor matches `key:` at\n * an indent and cannot index a sequence, so the field is not addressable — and rewriting the whole\n * `channels` list to change one handle is the dead end this command exists to remove. The second is\n * better: a handle can be *checked against the service that issues it*, and an impossible one is\n * otherwise a bot that is connected, healthy and silently refusing the one person it was set up for.\n */\nasync function allow(\n manifestPath: string,\n options: ConfigCommandOptions,\n out: (text: string) => void,\n): Promise<number> {\n const channels = manifestValueAt(readFileSync(manifestPath, \"utf8\"), [\"channels\"])\n if (!Array.isArray(channels) || channels.length === 0) {\n throw new HarnessError({\n code: \"cli_config_no_channels\",\n message: \"This agent has no channels, so there is nobody to allow.\",\n hint: \"`config set <agent> channels '[{type: telegram, id: tg, tokenEnv: TELEGRAM_BOT_TOKEN, mode: longpoll}]'` declares one first.\",\n })\n }\n\n const entries = channels.filter(\n (entry): entry is Record<string, unknown> =>\n typeof entry === \"object\" && entry !== null && !Array.isArray(entry),\n )\n const ids = entries.map((entry) => String(entry.id ?? \"\")).filter((id) => id !== \"\")\n const wanted = options.channel?.trim()\n if (wanted === undefined && entries.length > 1) {\n throw new HarnessError({\n code: \"cli_config_channel_ambiguous\",\n message: `This agent has ${entries.length} channels, so --channel says which.`,\n hint: `One of: ${ids.join(\", \")}.`,\n field: \"channel\",\n })\n }\n const at =\n wanted === undefined ? 0 : entries.findIndex((entry) => String(entry.id ?? \"\") === wanted)\n if (at === -1) {\n throw new HarnessError({\n code: \"cli_config_channel_unknown\",\n message: `No channel with id \"${wanted}\".`,\n hint: `Declared: ${ids.join(\", \")}.${\n nearest(wanted ?? \"\", ids) === undefined\n ? \"\"\n : ` Did you mean ${nearest(wanted ?? \"\", ids)}?`\n }`,\n field: \"channel\",\n })\n }\n\n const target = entries[at] as Record<string, unknown>\n const handle = checkedHandle(options.name ?? \"\", String(target.type ?? \"\"))\n const current = Array.isArray(target.allowFrom) ? target.allowFrom.map(String) : []\n\n const next =\n options.remove === true\n ? current.filter((entry) => entry !== handle)\n : current.includes(handle)\n ? current\n : [...current, handle]\n\n if (next.length === current.length && options.remove === true) {\n out(\n `${keyValue([\n { label: \"unchanged\", value: `${handle} was not on ${String(target.id)}` },\n ])}\\n`,\n )\n return EXIT_OK\n }\n if (next.length === current.length) {\n // Idempotent on purpose: running it twice is what somebody does when they are not sure it\n // took, and reporting a second write they did not make would be a small lie.\n out(\n `${keyValue([{ label: \"already allowed\", value: `${handle} on ${String(target.id)}` }])}\\n`,\n )\n return EXIT_OK\n }\n\n // `applyAllow` owns the write and the handle check, so the editor cannot validate a handle\n // differently from this command. It takes the whole list, because the whole list is what gets\n // written: one entry's key is not addressable by the source editor.\n const result = await applyAllow(manifestPath, String(target.id ?? \"\"), next)\n const held = await running(manifestPath, options)\n\n out(\n `${keyValue([\n { label: options.remove === true ? \"removed\" : \"allowed\", value: handle },\n { label: \"channel\", value: String(target.id) },\n { label: \"now\", value: showValue(next) },\n { label: \"file\", value: manifestPath },\n ])}\\n`,\n )\n if (result.reflowed) {\n out(`${bullet(\"the file was re-serialised — it is valid, and comments may have moved\")}\\n`)\n }\n if (held !== undefined) {\n out(\n `${bullet(\n `this agent is running (pid ${held.pid}, ${held.mode}) and holds its settings for its lifetime — the change applies after ${restartHint(held.mode)}`,\n )}\\n`,\n )\n }\n return EXIT_OK\n}\n\nexport const CONFIG_EXIT_FAILURE = EXIT_FAILURE\n\n/**\n * The editor, standalone.\n *\n * Alternate screen, because it waits for keys: it takes the terminal and gives it back. A changed flag\n * comes back through `onDone` so the one line printed afterwards can say a restart is needed — printed\n * on the real screen after the restore, because hard rule 8 does not stop applying when a screen closes.\n */\nasync function edit(\n manifestPath: string,\n options: ConfigCommandOptions,\n out: (text: string) => void,\n): Promise<number> {\n // Refused rather than attempted without a terminal. Two things went wrong otherwise, and the second\n // is the serious one: the alternate-screen sequence was written into a *pipe*, and Ink's own \"raw\n // mode is not supported\" error left the command exiting **0** — a failure that reported success,\n // which hard rule 8 exists to prevent. `browse` and `init` already ask this question the same way.\n const decision = resolveModeFromProcess({ plain: false, json: false, oneShot: false })\n if (decision.mode !== \"rich\") {\n throw new HarnessError({\n code: \"cli_config_edit_needs_terminal\",\n message: \"The settings editor needs a terminal.\",\n hint: `Not one here (${decision.because}). \\`config list\\` reads them and \\`config set\\` changes one, both of which work on a pipe.`,\n })\n }\n\n const [{ render }, { createElement }, { ConfigEditor }] = await Promise.all([\n import(\"ink\"),\n import(\"react\"),\n import(\"#components/ConfigEditor\"),\n ])\n\n let changed = false\n let finish: () => void = () => {}\n const closed = new Promise<void>((resolve) => {\n finish = resolve\n })\n\n markAltScreen()\n process.stdout.write(ENTER_ALT_SCREEN)\n\n // No wrapper component: the editor is a *view*, so it owns its own state and its single `useInput`,\n // exactly as `SkillBrowser` and `SessionPicker` do. Holding it here needed `useState` in this file,\n // which is a shared command path — and a static React import there costs ~170-210 ms on every\n // command including `validate --json`, which a boundaries test refuses outright.\n const instance = render(\n createElement(ConfigEditor, {\n rows: editorRowsFor(manifestPath),\n apply: (row: EditorRow, raw: string) => applyEditorRow(manifestPath, row, raw),\n reload: () => editorRowsFor(manifestPath),\n // A pty can report `columns === 0`, which `?? fallback` does not cover — measured, and it\n // once laid a picker's rows out for half the terminal, uniformly, on every row.\n columns: screenColumns(process.stdout.columns, FALLBACK_COLUMNS),\n window: MAX_SCREEN_ROWS,\n onDone: (didChange: boolean) => {\n changed = didChange\n finish()\n },\n }),\n { exitOnCtrlC: false, ...negotiateKeyboard() },\n )\n onExit(() => instance.unmount())\n await closed\n instance.unmount()\n restoreTerminal()\n await flushOutput()\n\n const held = await running(manifestPath, options)\n if (!changed) {\n out(`${keyValue([{ label: \"unchanged\", value: manifestPath }])}\\n`)\n return EXIT_OK\n }\n out(`${keyValue([{ label: \"changed\", value: manifestPath }])}\\n`)\n out(`${bullet(`takes effect after ${restartHint(held?.mode)}`)}\\n`)\n return EXIT_OK\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";mlBA8BA,uBAAS,gBAoET,IAAM,EAAU,CAAC,OAAQ,MAAO,MAAO,MAAO,QAAS,MAAM,EAatD,SAAS,CAAU,CACtB,EACA,EACA,EAA+B,CAAC,IAAS,QAAQ,OAAO,MAAM,CAAI,EACL,CAC7D,IAAM,GAAS,GAAS,IAAI,KAAK,EACjC,GAAI,IAAU,GAAI,MAAO,CAAE,OAAQ,OAAQ,IAAK,MAAU,EAC1D,GAAI,CAAC,EAAQ,SAAS,CAAiC,EACnD,MAAO,CAAE,OAAQ,OAAQ,IAAK,CAAM,EAExC,GAAI,IAAW,QAAa,EAAQ,SAAS,CAAkC,EAI3E,EAAK,kBAAkB,yBAA6B;AAAA,CAAwB,EAEhF,GAAI,IAAW,QAAa,IAAU,OAIlC,MAAO,CAAE,OAAQ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,CAAa,CAAC,CAAC;AAAA,CAAK,EAChE,EAAI,GAAG,EAAO,sBAAsB,EAAY,GAAM,IAAI,GAAG;AAAA,CAAK,EAC3D",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "3D16BD5E494305F664756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t,
|
|
2
|
+
import{t,Nr}from"./index-qg9bn980.js";import"./index-kjqksgch.js";import"./index-9914wh1d.js";import{ot}from"./index-ma6p7bt4.js";import{Ve,ut,ln,eo}from"./index-7mn8ack9.js";import"./index-twn9bfm2.js";function g(e){let n=/^(\d+)\s*(s|m|h|d)?$/.exec(e.trim());if(n===null)throw new ot({code:"credential_usage",message:`--expires ${JSON.stringify(e)} is not a duration.`,hint:"Write it as 30s, 15m, 2h or 7d — or as a plain number of seconds."});let i=Number(n[1]);if(i===0)throw new ot({code:"credential_usage",message:"--expires 0 would mint a credential that has already expired.",hint:"Leave the flag off for a key that never expires, or give it a real duration like 1h."});let s={s:1,m:60,h:3600,d:86400}[n[2]??"s"]??1;return i*s}function y(e){let n=e.split(",").map((s)=>s.trim().toLowerCase()).filter((s)=>s!==""),i=n.filter((s)=>!Nr.includes(s));if(i.length>0)throw new ot({code:"credential_usage",message:`--can names ${i.map((s)=>JSON.stringify(s)).join(", ")}, which is not a capability.`,hint:`They are: ${Nr.join(", ")}. read is every GET; chat sends a message, answers an approval and stops a turn; write covers schedules, phase and clearing a session; admin covers credentials, provisioning and start/stop; peer reaches only a plugin route that asks for it (an A2A endpoint).`});return n}function f(e){return e.split(",").map((n)=>n.trim()).filter((n)=>n!=="")}function l(e){let n=[];if(n.push(e.scope?.agents===void 0?"every agent":e.scope.agents.join(", ")),e.scope?.sessions!==void 0)n.push(`sessions ${e.scope.sessions}`);if(n.push(e.scope?.can===void 0?"all capabilities":e.scope.can.join("+")),e.expiresAt!==void 0)n.push(`until ${e.expiresAt}`);return n.join(" · ")}async function d(e){let n=await Ve(e);if(n===void 0)throw new ot({code:"credential_usage",message:"No server is running, so there is nothing to mint a credential on.",hint:`A credential belongs to a server rather than to a file, so this command is an API client. Start one with \`${t.slug} serve\`, or use POST /v1/keys directly against a server you can already reach.`});return{lease:n,manifest:eo(n.agentId)}}async function v(e){if(e.action==="create")return await h(e);if(e.action==="list")return await p(e);if(e.action==="revoke")return await m(e);throw new ot({code:"credential_usage",message:`Unknown action ${JSON.stringify(e.action)}.`,hint:"The actions are create, list and revoke."})}async function h(e){let n=e.label?.trim();if(n===void 0||n==="")throw new ot({code:"credential_usage",message:"--label is required.",hint:'A label is the only thing distinguishing two credentials in a listing, and "key 2" is a name nobody can act on when deciding which to revoke.'});let i={...e.agents===void 0?{}:{agents:f(e.agents)},...e.sessions===void 0?{}:{sessions:e.sessions},...e.can===void 0?{}:{can:y(e.can)},...e.expires===void 0?{}:{expiresIn:g(e.expires)}},{lease:s,manifest:o}=await d(e.store),a=await ut(s,"/v1/keys",{label:n,...Object.keys(i).length===0?{}:{scope:i}},o);if(!a.ok)return c(a,"mint a credential");let r=a.body;if(e.json===!0)return process.stdout.write(`${JSON.stringify(r,null,2)}
|
|
3
3
|
`),0;return process.stdout.write(`${r.secret}
|
|
4
4
|
`),process.stderr.write(` ${r.label} · ${r.keyId}
|
|
5
5
|
`),process.stderr.write(` reaches ${l(r)}
|
|
6
6
|
`),process.stderr.write(` This is the only time the secret is shown. It is stored as a fingerprint and no route returns it.
|
|
7
|
-
`),0}async function p(e){let{lease:n,manifest:i}=await d(e.store),s=await
|
|
7
|
+
`),0}async function p(e){let{lease:n,manifest:i}=await d(e.store),s=await ln(n,"GET","/v1/keys",i);if(!s.ok)return c(s,"list credentials");let o=s.body,a=o.keys??[];if(e.json===!0)return process.stdout.write(`${JSON.stringify(o,null,2)}
|
|
8
8
|
`),0;if(a.length===0)return process.stdout.write(`No credentials. The server token is the only way in.
|
|
9
9
|
`),0;for(let r of a){let u=r.revokedAt===void 0?"live":"revoked";process.stdout.write(`${r.keyId} ${u.padEnd(7)} ${r.label}
|
|
10
10
|
`),process.stdout.write(` reaches ${l(r)}
|
|
11
11
|
`),process.stdout.write(` created ${r.createdAt}${r.lastUsedAt===void 0?" · never used":` · last used ${r.lastUsedAt}`}
|
|
12
|
-
`)}return 0}async function m(e){let n=e.keyId?.trim();if(n===void 0||n==="")throw new
|
|
12
|
+
`)}return 0}async function m(e){let n=e.keyId?.trim();if(n===void 0||n==="")throw new ot({code:"credential_usage",message:"Which credential?",hint:`\`${t.slug} credential list\` prints the ids. Revoking is permanent — a revoked secret can never be re-presented.`});let{lease:i,manifest:s}=await d(e.store),o=await ln(i,"DELETE",`/v1/keys/${encodeURIComponent(n)}`,s);if(!o.ok)return c(o,"revoke that credential");let a=o.body;if(e.json===!0)return process.stdout.write(`${JSON.stringify(a,null,2)}
|
|
13
13
|
`),0;return process.stdout.write(`revoked ${a.keyId} · ${a.label}
|
|
14
14
|
`),0}function c(e,n){if(process.stderr.write(`Could not ${n}${e.status===0?"":` (${e.status})`}: ${e.detail??"the host did not answer"}
|
|
15
15
|
`),e.hint!==void 0)process.stderr.write(` hint: ${e.hint}
|
|
16
16
|
`);return 1}export{v as credentialCommand};
|
|
17
17
|
|
|
18
|
-
//# debugId=
|
|
19
|
-
//# sourceMappingURL=credential-
|
|
18
|
+
//# debugId=8B4E9CBEBF1930A964756E2164756E21
|
|
19
|
+
//# sourceMappingURL=credential-dpdgg4j6.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * Operator credentials from a terminal: mint one, list them, revoke one.\n *\n * ## Why this is not called `keys`\n *\n * The `keys` command already exists and prints the bytes a terminal sends for a chord — a keyboard\n * diagnostic, nothing to do with credentials. Two unrelated meanings under one verb is the kind of\n * collision that costs somebody a confused minute every time they reach for either, so the new\n * surface takes the word the code and the spec already use for the thing: a **credential**.\n * `token` was the other candidate and loses to `server.tokenEnv`, which is a different credential\n * this command cannot mint or revoke.\n *\n * ## Why it talks to a running server rather than the store\n *\n * A key is a fingerprint in the shared store, so writing one directly would work — and would\n * bypass every check `POST /v1/keys` performs: the label rule, the scope validation, and the\n * refusal of a scope naming an agent that does not exist. That is the *\"a check only one surface\n * performs is a check the two disagree about\"* shape, on the surface where disagreeing means a\n * credential that the API would never have issued. So this is an HTTP client, and it says so when\n * there is no server to talk to.\n */\n\nimport { BRAND, CAPABILITIES, type Capability } from \"@dispach/core\"\nimport { UsageError } from \"#lib/args\"\nimport { anyLiveHost, callHost, manifestForId, postToHost } from \"#lib/lifecycle\"\n\nexport interface CredentialOptions {\n readonly action: string\n readonly keyId?: string\n readonly label?: string\n readonly agents?: string\n readonly sessions?: string\n readonly can?: string\n readonly expires?: string\n readonly json?: boolean\n readonly store?: string\n}\n\n/**\n * `1h`, `30m`, `7d`, `90s`, or plain seconds — into whole seconds.\n *\n * A suffix because \"how long should this credential live\" is a question people answer in hours and\n * days, and `3600` is a number somebody has to compute and can get wrong by a factor of sixty. Bare\n * digits stay accepted, since that is what the wire takes and a script already has the number.\n */\nexport function parseDuration(raw: string): number {\n const match = /^(\\d+)\\s*(s|m|h|d)?$/.exec(raw.trim())\n if (match === null) {\n throw new UsageError({\n code: \"credential_usage\",\n message: `--expires ${JSON.stringify(raw)} is not a duration.`,\n hint: \"Write it as 30s, 15m, 2h or 7d — or as a plain number of seconds.\",\n })\n }\n const value = Number(match[1])\n if (value === 0) {\n throw new UsageError({\n code: \"credential_usage\",\n message: \"--expires 0 would mint a credential that has already expired.\",\n hint: \"Leave the flag off for a key that never expires, or give it a real duration like 1h.\",\n })\n }\n const unit = { s: 1, m: 60, h: 3600, d: 86_400 }[match[2] ?? \"s\"] ?? 1\n return value * unit\n}\n\n/** `chat,read` → the capabilities, refusing anything that is not one rather than dropping it. */\nexport function parseCapabilities(raw: string): readonly Capability[] {\n const names = raw\n .split(\",\")\n .map((entry) => entry.trim().toLowerCase())\n .filter((entry) => entry !== \"\")\n const unknown = names.filter((name) => !(CAPABILITIES as readonly string[]).includes(name))\n if (unknown.length > 0) {\n throw new UsageError({\n code: \"credential_usage\",\n message: `--can names ${unknown.map((name) => JSON.stringify(name)).join(\", \")}, which is not a capability.`,\n hint: `They are: ${CAPABILITIES.join(\", \")}. read is every GET; chat sends a message, answers an approval and stops a turn; write covers schedules, phase and clearing a session; admin covers credentials, provisioning and start/stop; peer reaches only a plugin route that asks for it (an A2A endpoint).`,\n })\n }\n // An empty list is *not* silently promoted to \"everything\": `--can \"\"` is a key that may do\n // nothing, which is a coherent thing to ask for and a confusing thing to be given instead.\n return names as readonly Capability[]\n}\n\n/** A comma list into ids, with the empty entries dropped rather than sent as `\"\"`. */\nfunction parseList(raw: string): readonly string[] {\n return raw\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry !== \"\")\n}\n\ninterface KeyLike {\n readonly keyId: string\n readonly label: string\n readonly createdAt: string\n readonly lastUsedAt?: string\n readonly revokedAt?: string\n readonly expiresAt?: string\n readonly scope?: {\n readonly agents?: readonly string[]\n readonly sessions?: string\n readonly can?: readonly string[]\n }\n}\n\n/**\n * One line describing what a key reaches, for a listing.\n *\n * **Printed back after minting too**, which is the half that matters: a prefix is not a namespace —\n * `team_4` also matches `team_42:x` — so showing what the scope *says* at the moment it is created\n * is the only cheap place to notice that it says something other than what was meant. The same\n * argument `telegramHandle` makes about a username that cannot exist.\n */\nexport function describeScope(key: KeyLike): string {\n const parts: string[] = []\n parts.push(key.scope?.agents === undefined ? \"every agent\" : key.scope.agents.join(\", \"))\n if (key.scope?.sessions !== undefined) parts.push(`sessions ${key.scope.sessions}`)\n parts.push(key.scope?.can === undefined ? \"all capabilities\" : key.scope.can.join(\"+\"))\n if (key.expiresAt !== undefined) parts.push(`until ${key.expiresAt}`)\n return parts.join(\" · \")\n}\n\n/** The host to ask, or a refusal naming why there is none. */\nasync function host(store?: string) {\n const lease = await anyLiveHost(store)\n if (lease === undefined) {\n throw new UsageError({\n code: \"credential_usage\",\n message: \"No server is running, so there is nothing to mint a credential on.\",\n hint: `A credential belongs to a server rather than to a file, so this command is an API client. Start one with \\`${BRAND.slug} serve\\`, or use POST /v1/keys directly against a server you can already reach.`,\n })\n }\n return { lease, manifest: manifestForId(lease.agentId) }\n}\n\nexport async function credentialCommand(options: CredentialOptions): Promise<number> {\n if (options.action === \"create\") return await create(options)\n if (options.action === \"list\") return await list(options)\n if (options.action === \"revoke\") return await revoke(options)\n throw new UsageError({\n code: \"credential_usage\",\n message: `Unknown action ${JSON.stringify(options.action)}.`,\n hint: \"The actions are create, list and revoke.\",\n })\n}\n\nasync function create(options: CredentialOptions): Promise<number> {\n const label = options.label?.trim()\n if (label === undefined || label === \"\") {\n throw new UsageError({\n code: \"credential_usage\",\n message: \"--label is required.\",\n hint: 'A label is the only thing distinguishing two credentials in a listing, and \"key 2\" is a name nobody can act on when deciding which to revoke.',\n })\n }\n const scope = {\n ...(options.agents === undefined ? {} : { agents: parseList(options.agents) }),\n ...(options.sessions === undefined ? {} : { sessions: options.sessions }),\n ...(options.can === undefined ? {} : { can: parseCapabilities(options.can) }),\n ...(options.expires === undefined ? {} : { expiresIn: parseDuration(options.expires) }),\n }\n\n const { lease, manifest } = await host(options.store)\n const reply = await postToHost(\n lease,\n \"/v1/keys\",\n { label, ...(Object.keys(scope).length === 0 ? {} : { scope }) },\n manifest,\n )\n if (!reply.ok) return refused(reply, \"mint a credential\")\n\n const key = reply.body as KeyLike & { readonly secret: string }\n if (options.json === true) {\n process.stdout.write(`${JSON.stringify(key, null, 2)}\\n`)\n return 0\n }\n /**\n * The secret, on its own line, **once**.\n *\n * It is not stored anywhere in a readable form and no route returns it again, so this is the\n * only moment it exists outside the caller's memory. Printed bare rather than inside a sentence\n * so that copying the line copies the credential and nothing else.\n */\n process.stdout.write(`${key.secret}\\n`)\n process.stderr.write(` ${key.label} · ${key.keyId}\\n`)\n process.stderr.write(` reaches ${describeScope(key)}\\n`)\n process.stderr.write(\n \" This is the only time the secret is shown. It is stored as a fingerprint and no route returns it.\\n\",\n )\n return 0\n}\n\nasync function list(options: CredentialOptions): Promise<number> {\n const { lease, manifest } = await host(options.store)\n const reply = await callHost(lease, \"GET\", \"/v1/keys\", manifest)\n if (!reply.ok) return refused(reply, \"list credentials\")\n\n const body = reply.body as { readonly keys?: readonly KeyLike[]; readonly scope?: string }\n const keys = body.keys ?? []\n if (options.json === true) {\n process.stdout.write(`${JSON.stringify(body, null, 2)}\\n`)\n return 0\n }\n if (keys.length === 0) {\n process.stdout.write(\"No credentials. The server token is the only way in.\\n\")\n return 0\n }\n for (const key of keys) {\n // Revoked ones are shown rather than hidden, the same as the API's listing: the row is the\n // only record a credential ever existed, and hiding it makes a revocation unverifiable.\n const state = key.revokedAt === undefined ? \"live\" : \"revoked\"\n process.stdout.write(`${key.keyId} ${state.padEnd(7)} ${key.label}\\n`)\n process.stdout.write(` reaches ${describeScope(key)}\\n`)\n process.stdout.write(\n ` created ${key.createdAt}${key.lastUsedAt === undefined ? \" · never used\" : ` · last used ${key.lastUsedAt}`}\\n`,\n )\n }\n return 0\n}\n\nasync function revoke(options: CredentialOptions): Promise<number> {\n const keyId = options.keyId?.trim()\n if (keyId === undefined || keyId === \"\") {\n throw new UsageError({\n code: \"credential_usage\",\n message: \"Which credential?\",\n hint: `\\`${BRAND.slug} credential list\\` prints the ids. Revoking is permanent — a revoked secret can never be re-presented.`,\n })\n }\n const { lease, manifest } = await host(options.store)\n const reply = await callHost(lease, \"DELETE\", `/v1/keys/${encodeURIComponent(keyId)}`, manifest)\n if (!reply.ok) return refused(reply, \"revoke that credential\")\n const key = reply.body as KeyLike\n if (options.json === true) {\n process.stdout.write(`${JSON.stringify(key, null, 2)}\\n`)\n return 0\n }\n process.stdout.write(`revoked ${key.keyId} · ${key.label}\\n`)\n return 0\n}\n\n/** The server's own words, not a paraphrase — it knows why far better than this command does. */\nfunction refused(reply: { status: number; detail?: string; hint?: string }, what: string): number {\n process.stderr.write(\n `Could not ${what}${reply.status === 0 ? \"\" : ` (${reply.status})`}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n);let r=n/1000;return r<10?`${r.toFixed(1)}k`:`${Math.round(r)}k`}function Aa(n,r,e){if(e)return"installed";let t=yi(n);return r===0?t:`${t} · ${r} script${r===1?"":"s"}`}function Y(n,r){if(r<=0)return"";let e=n.replace(/\s+/g," ").trim();if(e.length<=r)return e;if(r===1)return"…";return`${e.slice(0,r-1)}…`}function To(n,r,e={}){let t=Math.max(18,Math.min(e.nameMax??34,r)),o=18,a=6;if(a+t+o>n)o=Math.max(6,n-a-t);if(a+t+o>n)t=Math.max(6,n-a-o);let m=n-(a+t+o+2);if(n<60||m<24)return{name:t,meta:o,description:0};return{name:t,meta:o,description:m}}function Ro(n,r){return{name:Y(n.name,r.name).padEnd(r.name),meta:Y(n.meta,r.meta).padEnd(r.meta),description:r.description===0?"":Y(n.description,r.description)}}function _o(n,r){let e=Y(n,Math.max(0,r-8)),t=e.length+3;return`${e} ${"─".repeat(Math.max(0,Math.min(r,80)-t))}`}function na(n,r,e){let t=n.length,o=(i)=>n[i]??1;if(n.reduce((i,c)=>i+c,0)<=e)return{from:0,to:t};let a=Math.min(Math.max(0,r),Math.max(0,t-1)),m=a,u=a+1,s=o(a),l=!0;for(;;){let i=u<t&&s+o(u)<=e,c=m>0&&s+o(m-1)<=e;if(!i&&!c)break;if(l&&i||!c)s+=o(u),u+=1;else m-=1,s+=o(m);l=!l}return{from:m,to:u}}function De(n,r,e){if(n<=e)return{from:0,to:n};let t=Math.floor(e/2),o=Math.min(Math.max(0,r-t),n-e);return{from:o,to:o+e}}
|
|
3
|
+
export{yi,Aa,Y,To,Ro,_o,na,De};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=7B015DBEF74DCDC064756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-0444sh6x.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * Laying a catalogue row out in a fixed number of columns. Pure, so the layout is testable as strings.\n *\n * ## Why this is not a component's problem\n *\n * The first version put the name, the size and the whole description in one `<Text>` and let Ink wrap.\n * Every row longer than the terminal became two or three lines, the checkbox column stopped lining up,\n * and a list of forty skills was unreadable. Wrapping is not a styling detail in a list — it destroys the\n * one property a list has, which is that a row is a row.\n *\n * So the width arithmetic lives here, in one place, as functions over numbers and strings: pad the name to\n * a column, pad the meta to a column, give the description whatever is left, and **truncate every field\n * before it can wrap**. `Text` also carries `wrap=\"truncate\"` as a backstop, but a backstop is not a\n * layout — the columns have to add up, or the description gets cut at a width nobody chose.\n */\n\n/** Terminal columns below which the description is dropped rather than shown as three characters. */\nconst NARROW = 60\n/** The name column, wide enough for `create-architectural-decision-record` to be recognisable. */\nconst NAME_MIN = 18\nconst NAME_MAX = 34\n/** `12.3k · 15 scripts` is the widest realistic meta string. */\nconst META = 18\n/** Checkbox plus pointer, both two characters. */\nconst GUTTER = 4\nconst GAP = 2\n\n/** `2284` → `2.3k`. A row is scanned, not audited, and five digits of precision cost a column. */\nexport function compactTokens(tokens: number): string {\n if (tokens < 1000) return String(tokens)\n const thousands = tokens / 1000\n return thousands < 10 ? `${thousands.toFixed(1)}k` : `${Math.round(thousands)}k`\n}\n\nexport function metaOf(tokens: number, scripts: number, installed: boolean): string {\n if (installed) return \"installed\"\n const size = compactTokens(tokens)\n return scripts === 0 ? size : `${size} · ${scripts} script${scripts === 1 ? \"\" : \"s\"}`\n}\n\n/** Cut to `width`, with an ellipsis when anything was lost. Never returns more than `width`. */\nexport function clip(text: string, width: number): string {\n if (width <= 0) return \"\"\n const flat = text.replace(/\\s+/g, \" \").trim()\n if (flat.length <= width) return flat\n if (width === 1) return \"…\"\n return `${flat.slice(0, width - 1)}…`\n}\n\nexport interface RowColumns {\n readonly name: number\n readonly meta: number\n readonly description: number\n}\n\n/**\n * How wide each column is at a given terminal width.\n *\n * The name column flexes with the longest name actually present rather than being fixed: a catalogue of\n * short names should not leave a third of the row empty, and one long name should not push the\n * description off the screen. Clamped at both ends for both reasons.\n */\nexport function columnsFor(\n width: number,\n longestName: number,\n options: { readonly nameMax?: number } = {},\n): RowColumns {\n // Overridden by the plain path, whose names carry a `source/` prefix and which has no cursor to keep\n // near them. Passing a wider name column *without* going through this function is what pushed every\n // piped row twelve characters over the width it was laid out for.\n let name = Math.max(NAME_MIN, Math.min(options.nameMax ?? NAME_MAX, longestName))\n let meta = META\n\n // The name and meta columns shrink before anything else does. Without this the *fixed* part of the row\n // could exceed the terminal on its own — at 40 columns with a 34-character name it came to 60, so every\n // row wrapped no matter what the description did, which is the bug this module exists to remove.\n const chrome = GUTTER + GAP\n if (chrome + name + meta > width) meta = Math.max(6, width - chrome - name)\n if (chrome + name + meta > width) name = Math.max(6, width - chrome - meta)\n\n const description = width - (chrome + name + meta + GAP)\n // Below the threshold the description is dropped entirely. Three characters of a sentence is worse than\n // none: it takes the same column and carries no information.\n if (width < NARROW || description < 24) return { name, meta, description: 0 }\n return { name, meta, description }\n}\n\n/**\n * One row, exactly `width` characters wide or less, in three aligned columns.\n *\n * Returned as one string rather than as fields, because alignment is the whole point and a caller that\n * assembled the parts could get the padding wrong. Colour is applied by the component *around* this — the\n * arithmetic must not know about escape codes, which do not occupy columns and would break every count.\n */\nexport function layoutRow(\n input: {\n readonly name: string\n readonly meta: string\n readonly description: string\n },\n columns: RowColumns,\n): { readonly name: string; readonly meta: string; readonly description: string } {\n return {\n name: clip(input.name, columns.name).padEnd(columns.name),\n meta: clip(input.meta, columns.meta).padEnd(columns.meta),\n description: columns.description === 0 ? \"\" : clip(input.description, columns.description),\n }\n}\n\n/** A heading, drawn as a rule so groups separate without costing a blank line each. */\nexport function headingRule(label: string, width: number): string {\n const text = clip(label, Math.max(0, width - 8))\n const filled = text.length + 3\n return `${text} ${\"─\".repeat(Math.max(0, Math.min(width, 80) - filled))}`\n}\n\n/**\n * Which slice of a longer list to show.\n *\n * Shared by the catalogue list and the input box, which want the same rule for the same reason: both\n * are taller than their allowance and both have a position that must stay visible. It lives here rather\n * than in either component because the second caller is what proved it was layout arithmetic and not a\n * detail of one screen.\n *\n * Originally: Keeps the cursor inside the window rather than paging, because a cursor that jumps a\n * whole viewport loses the reader's place.\n */\n/**\n * `viewport` for rows that are not all one line tall (QA K5).\n *\n * The settings editor draws a heading as a blank line and its label, and counting it as one row made the\n * frame taller than the terminal at 40 rows: the title, the first heading and the cursor scrolled off the\n * top at open. The window grows around `index`, a row below then a row above, until the next one would\n * pass `budget` lines, so the cursor is always inside it.\n */\nexport function viewportByHeight(\n heights: readonly number[],\n index: number,\n budget: number,\n): { readonly from: number; readonly to: number } {\n const total = heights.length\n const at = (i: number) => heights[i] ?? 1\n if (heights.reduce((sum, height) => sum + height, 0) <= budget) return { from: 0, to: total }\n const cursor = Math.min(Math.max(0, index), Math.max(0, total - 1))\n let from = cursor\n let to = cursor + 1\n let used = at(cursor)\n let downward = true\n for (;;) {\n const canDown = to < total && used + at(to) <= budget\n const canUp = from > 0 && used + at(from - 1) <= budget\n if (!canDown && !canUp) break\n if ((downward && canDown) || !canUp) {\n used += at(to)\n to += 1\n } else {\n from -= 1\n used += at(from)\n }\n downward = !downward\n }\n return { from, to }\n}\n\nexport function viewport(\n total: number,\n index: number,\n window: number,\n): { readonly from: number; readonly to: number } {\n if (total <= window) return { from: 0, to: total }\n const half = Math.floor(window / 2)\n const from = Math.min(Math.max(0, index - half), total - window)\n return { from, to: from + window }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AA4BO,SAAS,EAAa,CAAC,EAAwB,CAClD,GAAI,EAAS,KAAM,OAAO,OAAO,CAAM,EACvC,IAAM,EAAY,EAAS,KAC3B,OAAO,EAAY,GAAK,GAAG,EAAU,QAAQ,CAAC,KAAO,GAAG,KAAK,MAAM,CAAS,KAGzE,SAAS,EAAM,CAAC,EAAgB,EAAiB,EAA4B,CAChF,GAAI,EAAW,MAAO,YACtB,IAAM,EAAO,GAAc,CAAM,EACjC,OAAO,IAAY,EAAI,EAAO,GAAG,OAAU,WAAiB,IAAY,EAAI,GAAK,MAI9E,SA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gB,CAC5B,EACA,EACA,EAC8C,CAC9C,IAAM,EAAQ,EAAQ,OAChB,EAAK,CAAC,IAAc,EAAQ,IAAM,EACxC,GAAI,EAAQ,OAAO,CAAC,EAAK,IAAW,EAAM,EAAQ,CAAC,GAAK,EAAQ,MAAO,CAAE,KAAM,EAAG,GAAI,CAAM,EAC5F,IAAM,EAAS,KAAK,IAAI,KAAK,IAAI,EAAG,CAAK,EAAG,KAAK,IAAI,EAAG,EAAQ,CAAC,CAAC,EAC9D,EAAO,EACP,EAAK,EAAS,EACd,EAAO,EAAG,CAAM,EAChB,EAAW,GACf,OAAS,CACL,IAAM,EAAU,EAAK,GAAS,EAAO,EAAG,CAAE,GAAK,EACzC,EAAQ,EAAO,GAAK,EAAO,EAAG,EAAO,CAAC,GAAK,EACjD,GAAI,CAAC,GAAW,CAAC,EAAO,MACxB,GAAK,GAAY,GAAY,CAAC,EAC1B,GAAQ,EAAG,CAAE,EACb,GAAM,EACR,KACE,GAAQ,EACR,GAAQ,EAAG,CAAI,EAEnB,EAAW,CAAC,EAEhB,MAAO,CAAE,OAAM,IAAG,EAGf,SAAS,EAAQ,CACpB,EACA,EACA,EAC8C,CAC9C,GAAI,GAAS,EAAQ,MAAO,CAAE,KAAM,EAAG,GAAI,CAAM,EACjD,IAAM,EAAO,KAAK,MAAM,EAAS,CAAC,EAC5B,EAAO,KAAK,IAAI,KAAK,IAAI,EAAG,EAAQ,CAAI,EAAG,EAAQ,CAAM,EAC/D,MAAO,CAAE,OAAM,GAAI,EAAO,CAAO",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "7B015DBEF74DCDC064756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createInterface as w}from"node:readline";async function
|
|
3
|
-
${u} [y/N] `,t)});return/^y(es)?$/i.test(s.trim())}finally{i.close()}}async function
|
|
4
|
-
${u} `,a)})).trim()===o}finally{s.close()}}async function
|
|
2
|
+
import{createInterface as w}from"node:readline";async function MA(u,o={}){let e=o.input??process.stdin,r=o.output??process.stdout;if(e.isTTY!==!0)return!1;let i=w({input:e,output:r});try{let s=await new Promise((t)=>{i.question(`
|
|
3
|
+
${u} [y/N] `,t)});return/^y(es)?$/i.test(s.trim())}finally{i.close()}}async function ts(u,o,e={}){let r=e.input??process.stdin,i=e.output??process.stdout;if(r.isTTY!==!0)return!1;let s=w({input:r,output:i});try{return(await new Promise((a)=>{s.question(`
|
|
4
|
+
${u} `,a)})).trim()===o}finally{s.close()}}async function Zn(u,o={}){let e=o.input??process.stdin,r=o.output??process.stdout;if(e.isTTY!==!0)return;r.write(`
|
|
5
5
|
${u} `);let i=typeof e.setRawMode==="function";if(i)e.setRawMode?.(!0);e.resume?.();try{return await new Promise((s)=>{let t="",a=!1,d=!1,l=(f)=>{e.removeListener("data",p),r.write(`
|
|
6
6
|
`),s(f)},p=(f)=>{let m=typeof f==="string"?f:f.toString("utf8");for(let c of m){let n=c.charCodeAt(0);if(d){if(n>=64&&n<=126)d=!1;continue}if(a){if(a=!1,c==="["||c==="O")d=!0;continue}if(n===27){a=!0;continue}if(n===13||n===10)return l(t);if(n===3)return l(void 0);if(n===4)return l(t===""?void 0:t);if(n===127||n===8){if(t.length>0)t=t.slice(0,-1),r.write("\b \b");continue}if(n<32)continue;t+=c,r.write("*")}};e.on("data",p)})}finally{if(i)e.setRawMode?.(!1)}}
|
|
7
|
-
export{
|
|
7
|
+
export{MA,ts,Zn};
|
|
8
8
|
|
|
9
|
-
//# debugId=
|
|
10
|
-
//# sourceMappingURL=index-
|
|
9
|
+
//# debugId=53D6C51D513B5AF964756E2164756E21
|
|
10
|
+
//# sourceMappingURL=index-095hrkyr.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * A yes/no question on the plain path.\n *\n * One question, one place. The wizard has its own confirm *screen* under Ink and the picker has a\n * selection; what was missing was the shape a single command needs before doing something outside its\n * own workspace — and the only current caller, `terminal-setup`, is the only command that does that.\n *\n * **Not a TTY means no.** A piped or CI run cannot answer, so the safe answer is the one that changes\n * nothing — and the caller reports that nothing was written rather than treating it as a failure.\n * Defaulting to yes here would make a redirected invocation edit somebody's editor keybindings, which is\n * the kind of surprise that is only discovered later.\n *\n * Deliberately not a general prompt library. A second kind of question can have a second function; a\n * configurable one would grow options nobody needs and hide the TTY rule above inside them. There are\n * three now — `askExactly` is a different bar, and `askSecret` is a different *channel*, because a\n * value that must not be echoed cannot go through readline at all.\n */\n\nimport { createInterface } from \"node:readline\"\n\nexport interface ConfirmOptions {\n /** Injected by tests. The process streams otherwise. */\n readonly input?: NodeJS.ReadableStream & { isTTY?: boolean }\n readonly output?: NodeJS.WritableStream\n}\n\nexport async function askYesNo(question: string, options: ConfirmOptions = {}): Promise<boolean> {\n const input = options.input ?? process.stdin\n const output = options.output ?? process.stdout\n if (input.isTTY !== true) return false\n\n const rl = createInterface({ input, output })\n try {\n const answer = await new Promise<string>((resolve) => {\n rl.question(`\\n${question} [y/N] `, resolve)\n })\n return /^y(es)?$/i.test(answer.trim())\n } finally {\n // Always closed: a readline left open holds the event loop and the process never exits.\n rl.close()\n }\n}\n\n/**\n * A question answered only by typing something back exactly.\n *\n * The bar for an irreversible, multi-part deletion. `askYesNo` is one keypress, which is right for\n * \"shall I edit your keybindings\" and too cheap for \"delete this agent, its conversations and its\n * memory\" — a stray `y` against the wrong listing is a mistake with nothing to undo it, and the whole\n * point of showing the listing first is that somebody reads it. Typing the name is what proves they did.\n *\n * Compared after trimming and nothing else. Case is **not** folded: an agent's ref is the name of a\n * directory, so `Milo` and `milo` are two different agents on a case-sensitive filesystem, and\n * accepting either here would accept the wrong one somewhere else.\n *\n * Not a TTY means no, for the reason `askYesNo` has it: a piped or CI run cannot answer, and the safe\n * answer is the one that changes nothing. The caller reports that nothing was deleted, and `--yes` is\n * how a script says it meant it.\n */\nexport async function askExactly(\n question: string,\n expected: string,\n options: ConfirmOptions = {},\n): Promise<boolean> {\n const input = options.input ?? process.stdin\n const output = options.output ?? process.stdout\n if (input.isTTY !== true) return false\n\n const rl = createInterface({ input, output })\n try {\n const answer = await new Promise<string>((resolve) => {\n rl.question(`\\n${question} `, resolve)\n })\n return answer.trim() === expected\n } finally {\n rl.close()\n }\n}\n\n/**\n * A value typed at a prompt and never echoed. `undefined` means cancelled or unavailable.\n *\n * ## Why this is not readline\n *\n * readline echoes what it reads, and the documented way to stop it is to overwrite a private method on\n * the interface — which needs a cast this codebase does not allow. Reading the bytes is a dozen more\n * lines and it is the honest version: raw mode on, one `*` written per character, raw mode off in a\n * `finally` so a thrown error cannot leave the terminal unable to echo anything the person types next.\n *\n * ## Why a secret never comes from an argument\n *\n * The alternative was `--value`, and it puts the secret in two places nobody intends: the shell's\n * history file, and `ps` output, where every local process can read it for the lifetime of the call.\n * That is the same exposure `renderPlist` throws to prevent — launchd echoes a job's environment in\n * plaintext, so a plist carries no secret — and the reasoning does not change because the process is\n * short-lived. Not a TTY returns `undefined` rather than reading a pipe, so a CI run is *told* that\n * nothing was written instead of a secret arriving from somewhere the caller did not audit.\n *\n * ^C cancels and ^D on an empty line cancels; both return `undefined`, and the caller reports that\n * nothing changed. Backspace is honoured because a mistyped key in a value you cannot see is otherwise\n * unrecoverable without starting the command again.\n */\n/**\n * The narrow surface `askSecret` touches, rather than a widened `ConfirmOptions.input`.\n *\n * `process.stdin`'s declared `on` is a union of overloads, and intersecting that with an object type\n * makes it uncallable — the compiler cannot pick a signature. Declaring only what is used and asserting\n * the real stream against it once keeps the check where it is useful: anything else this function\n * reached for would be a type error here rather than a runtime surprise.\n */\nexport interface SecretInput {\n readonly isTTY?: boolean\n setRawMode?: (mode: boolean) => unknown\n resume?: () => unknown\n on(event: \"data\", listener: (chunk: Buffer | string) => void): unknown\n removeListener(event: \"data\", listener: (chunk: Buffer | string) => void): unknown\n}\n\nexport interface SecretOptions {\n readonly input?: SecretInput\n readonly output?: NodeJS.WritableStream\n}\n\nexport async function askSecret(\n question: string,\n options: SecretOptions = {},\n): Promise<string | undefined> {\n const input = options.input ?? (process.stdin as unknown as SecretInput)\n const output = options.output ?? process.stdout\n if (input.isTTY !== true) return undefined\n\n output.write(`\\n${question} `)\n const raw = typeof input.setRawMode === \"function\"\n if (raw) input.setRawMode?.(true)\n input.resume?.()\n\n try {\n return await new Promise<string | undefined>((resolve) => {\n let value = \"\"\n // Escape-sequence state. Dropping only the escape *byte* left `[A` in the value for an\n // arrow key — two characters of junk in a string nobody can see, which is worse than three\n // because it looks like nothing happened. CSI runs until a byte in 0x40–0x7e ends it.\n let escaped = false\n let csi = false\n const finish = (result: string | undefined) => {\n input.removeListener(\"data\", onData)\n output.write(\"\\n\")\n resolve(result)\n }\n const onData = (chunk: Buffer | string) => {\n const text = typeof chunk === \"string\" ? chunk : chunk.toString(\"utf8\")\n for (const char of text) {\n const code = char.charCodeAt(0)\n if (csi) {\n // The final byte of a CSI sequence, and the end of it.\n if (code >= 0x40 && code <= 0x7e) csi = false\n continue\n }\n if (escaped) {\n escaped = false\n // `[` opens CSI and `O` opens SS3, which is how some terminals send arrows.\n if (char === \"[\" || char === \"O\") csi = true\n continue\n }\n if (code === 27) {\n escaped = true\n continue\n }\n if (code === 13 || code === 10) return finish(value)\n // ^C always cancels; ^D cancels only an empty line, so it cannot silently\n // truncate a value somebody was halfway through typing.\n if (code === 3) return finish(undefined)\n if (code === 4) return finish(value === \"\" ? undefined : value)\n if (code === 127 || code === 8) {\n if (value.length > 0) {\n value = value.slice(0, -1)\n output.write(\"\\b \\b\")\n }\n continue\n }\n // Any remaining control byte is a chord, and a secret has none in it.\n if (code < 32) continue\n value += char\n output.write(\"*\")\n }\n }\n input.on(\"data\", onData)\n })\n } finally {\n // Always restored. A thrown error that left raw mode on would leave the shell that follows\n // unable to echo anything at all, which reads as a hung terminal rather than a failed command.\n if (raw) input.setRawMode?.(false)\n }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAkBA,0BAAS,sBAQF,eAAe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AAM,GAEZ,EAAS,CAAC,IAA2B,CACvC,IAAM,EAAO,OAAO,IAAU,SAAW,EAAQ,EAAM,SAAS,MAAM,EACtE,QAAW,KAAQ,EAAM,CACrB,IAAM,EAAO,EAAK,WAAW,CAAC,EAC9B,GAAI,EAAK,CAEL,GAAI,GAAQ,IAAQ,GAAQ,IAAM,EAAM,GACxC,SAEJ,GAAI,EAAS,CAGT,GAFA,EAAU,GAEN,IAAS,KAAO,IAAS,IAAK,EAAM,GACxC,SAEJ,GAAI,IAAS,GAAI,CACb,EAAU,GACV,SAEJ,GAAI,IAAS,IAAM,IAAS,GAAI,OAAO,EAAO,CAAK,EAGnD,GAAI,IAAS,EAAG,OAAO,EAAO,MAAS,EACvC,GAAI,IAAS,EAAG,OAAO,EAAO,IAAU,GAAK,OAAY,CAAK,EAC9D,GAAI,IAAS,KAAO,IAAS,EAAG,CAC5B,GAAI,EAAM,OAAS,EACf,EAAQ,EAAM,MAAM,EAAG,EAAE,EACzB,EAAO,MAAM,OAAO,EAExB,SAGJ,GAAI,EAAO,GAAI,SACf,GAAS,EACT,EAAO,MAAM,GAAG,IAGxB,EAAM,GAAG,OAAQ,CAAM,EAC1B,EACH,OAAQ,CAGN,GAAI,EAAK,EAAM,aAAa,EAAK",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "53D6C51D513B5AF964756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{i,Qi,ca}from"./index-dzy19wtf.js";import{Text as e}from"ink";import{useEffect as a,useState as c}from"react";import{jsx as f,jsxs as l}from"react/jsx-runtime";function nt({label:r}){let[t,n]=c(0);return a(()=>{let o=setInterval(()=>n((p)=>(p+1)%Qi.length),ca);return()=>clearInterval(o)},[]),l(e,{children:[f(e,{color:i.accent,children:Qi[t]})," ",r]})}
|
|
3
|
+
export{nt};
|
|
4
|
+
|
|
5
|
+
//# debugId=DC473FC8912D4B7B64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-1x8mzvz7.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * A braille spinner with a label. Ten glyphs from the theme, not a dependency (decision 11.10).\n *\n * The one kit component with its own state — the frame index — because animation is presentation,\n * not application state. Callers pair it with `useElapsed` when a count-up matters (the picker's\n * boot transition); it is deliberately not used in the init wizard, whose write-and-validate\n * completes in single-digit milliseconds and would only flash.\n */\n\nimport { Text } from \"ink\"\nimport { useEffect, useState } from \"react\"\nimport { SPINNER_FRAMES, SPINNER_INTERVAL_MS, THEME } from \"#lib/theme\"\n\nexport interface SpinnerProps {\n readonly label: string\n}\n\nexport function Spinner({ label }: SpinnerProps) {\n const [frame, setFrame] = useState(0)\n useEffect(() => {\n const timer = setInterval(\n () => setFrame((current) => (current + 1) % SPINNER_FRAMES.length),\n SPINNER_INTERVAL_MS,\n )\n return () => clearInterval(timer)\n }, [])\n\n return (\n <Text>\n <Text color={THEME.accent}>{SPINNER_FRAMES[frame]}</Text> {label}\n </Text>\n )\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";yCASA,eAAS,YACT,oBAAS,cAAW,gEAOb,SAAS,EAAO,EAAG,SAAuB,CAC7C,IAAO,EAAO,GAAY,EAAS,CAAC,EASpC,OARA,EAAU,IAAM,CACZ,IAAM,EAAQ,YACV,IAAM,EAAS,CAAC,KAAa,EAAU,GAAK,GAAe,MAAM,EACjE,EACJ,EACA,MAAO,IAAM,cAAc,CAAK,GACjC,CAAC,CAAC,EAGD,EAAC,EAAD,UAEE,CADE,EAAC,EAAD,CAAM,MAAO,EAAM,OAAnB,SAA4B,GAAe,GAAS,EADxD,IAC+D,GAC7D",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "DC473FC8912D4B7B64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{Re,Ie,W,Ye,ee,ct,yt,K,lt,et,pe,ZA,tt,It,Qt,$A,XA}from"./index-ytxbw8py.js";var{awsEndpointFunctions:Us,emitWarningIfUnsupportedVersion:ws,createDefaultUserAgentProvider:Hs,NODE_APP_ID_CONFIG_OPTIONS:js,getAwsRegionExtensionConfiguration:zs,resolveAwsRegionExtensionConfiguration:Bs,resolveUserAgentConfig:qs,resolveHostHeaderConfig:Ks,getUserAgentPlugin:Js,getHostHeaderPlugin:Zs,getLoggerPlugin:Qs,getRecursionDetectionPlugin:Ws}=pe(),{resolveEventStreamConfig:Xs,getEventStreamPlugin:Ys}=ZA(),{getHttpAuthSchemeEndpointRuleSetPlugin:en,DefaultIdentityProviderConfig:tn,getHttpSigningPlugin:sn,createPaginator:nn}=et(),{normalizeProvider:Be,getSmithyContext:on,ServiceException:rn,NoOpLogger:an,emitWarningIfUnsupportedVersion:cn,loadConfigsForDefaultMode:pn,getDefaultExtensionConfiguration:un,resolveDefaultRuntimeConfig:ln,Client:qe,makeBuilder:dn,createAggregatedClient:Sn}=Ie(),{Command:xn}=Ie();var Ri=xn,Di=qe;var{resolveDefaultsModeConfig:hn,loadConfig:L,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:En,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:mn,NODE_REGION_CONFIG_OPTIONS:_n,NODE_REGION_CONFIG_FILE_OPTIONS:gn,resolveRegionConfig:vn}=W(),{BinaryDecisionDiagram:Ln,EndpointCache:Tn,decideEndpoint:yn,customEndpointFunctions:In,resolveEndpointConfig:$n,getEndpointPlugin:On}=Ye(),{eventStreamSerdeProvider:fn,resolveEventStreamSerdeConfig:Pn}=yt(),{parseUrl:An,getHttpHandlerExtensionConfiguration:Cn,resolveHttpHandlerRuntimeConfig:Nn,getContentLengthPlugin:kn}=K(),{DEFAULT_RETRY_MODE:Rn,NODE_RETRY_MODE_CONFIG_OPTIONS:Dn,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:bn,resolveRetryConfig:Fn,getRetryPlugin:Mn}=lt(),{TypeRegistry:Ke,getSchemaSerdePlugin:Gn}=Re(),{resolveAwsSdkSigV4Config:Vn,AwsSdkSigV4Signer:Un,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:wn}=tt(),{defaultProvider:Hn}=$A(),{eventStreamPayloadHandlerProvider:jn}=XA(),{toUtf8:zn,fromUtf8:Bn,sdkStreamMixin:qn,toBase64:Kn,fromBase64:Jn,calculateBodyLength:Zn}=ee(),{streamCollector:Qn,NodeHttp2Handler:Wn}=It(),{AwsRestJsonProtocol:Xn}=Qt(),{Sha256:Yn}=ct(),eo=async(e,s,p)=>({operation:on(s).operation,region:await Be(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function to(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"polly",region:e.region},propertiesExtractor:(s,p)=>({signingProperties:{config:s,context:p}})}}var so=(e)=>{let s=[];switch(e.operation){default:s.push(to(e))}return s},no=(e)=>{let s=Vn(e);return Object.assign(s,{authSchemePreference:Be(e.authSchemePreference??[])})},oo=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"polly"}),ro={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},io="3.1140.0",ao={version:io},f="ref",T=-1,A=!0,Fe="isSet",Je="PartitionResult",C="booleanEquals",Me="getAttr",Ge={[f]:"Endpoint"},Ve={[f]:Je},O={},Ue=[{[f]:"Region"}],we={conditions:[[Fe,[Ge]],[Fe,Ue],["aws.partition",Ue,Je],[C,[{[f]:"UseFIPS"},A]],[C,[{[f]:"UseDualStack"},A]],[C,[{fn:Me,argv:[Ve,"supportsDualStack"]},A]],[C,[{fn:Me,argv:[Ve,"supportsFIPS"]},A]]],results:[[T],[T,"Invalid Configuration: FIPS and custom endpoint are not supported"],[T,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[Ge,O],["https://polly-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",O],[T,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://polly-fips.{Region}.{PartitionResult#dnsSuffix}",O],[T,"FIPS is enabled but this partition does not support FIPS"],["https://polly.{Region}.{PartitionResult#dualStackDnsSuffix}",O],[T,"DualStack is enabled but this partition does not support DualStack"],["https://polly.{Region}.{PartitionResult#dnsSuffix}",O],[T,"Invalid Configuration: Missing Region"]]},co=2,l=1e8,po=new Int32Array([-1,1,-1,0,12,3,1,4,l+11,2,5,l+11,3,8,6,4,7,l+10,5,l+8,l+9,4,10,9,6,l+6,l+7,5,11,l+5,6,l+4,l+5,3,l+1,13,4,l+2,l+3]),uo=Ln.from(po,co,we.conditions,we.results),lo=new Tn({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),So=(e,s={})=>lo.get(e,()=>yn(uo,{endpointParams:e,logger:s.logger}));In.aws=Us;class n extends rn{constructor(e){super(e);Object.setPrototypeOf(this,n.prototype)}}class N extends n{name="LexiconNotFoundException";$fault="client";constructor(e){super({name:"LexiconNotFoundException",$fault:"client",...e});Object.setPrototypeOf(this,N.prototype)}}class k extends n{name="ServiceFailureException";$fault="server";constructor(e){super({name:"ServiceFailureException",$fault:"server",...e});Object.setPrototypeOf(this,k.prototype)}}class R extends n{name="InvalidNextTokenException";$fault="client";constructor(e){super({name:"InvalidNextTokenException",$fault:"client",...e});Object.setPrototypeOf(this,R.prototype)}}class D extends n{name="EngineNotSupportedException";$fault="client";constructor(e){super({name:"EngineNotSupportedException",$fault:"client",...e});Object.setPrototypeOf(this,D.prototype)}}class b extends n{name="InvalidTaskIdException";$fault="client";constructor(e){super({name:"InvalidTaskIdException",$fault:"client",...e});Object.setPrototypeOf(this,b.prototype)}}class F extends n{name="SynthesisTaskNotFoundException";$fault="client";constructor(e){super({name:"SynthesisTaskNotFoundException",$fault:"client",...e});Object.setPrototypeOf(this,F.prototype)}}class M extends n{name="InvalidLexiconException";$fault="client";constructor(e){super({name:"InvalidLexiconException",$fault:"client",...e});Object.setPrototypeOf(this,M.prototype)}}class G extends n{name="InvalidS3BucketException";$fault="client";constructor(e){super({name:"InvalidS3BucketException",$fault:"client",...e});Object.setPrototypeOf(this,G.prototype)}}class V extends n{name="InvalidS3KeyException";$fault="client";constructor(e){super({name:"InvalidS3KeyException",$fault:"client",...e});Object.setPrototypeOf(this,V.prototype)}}class U extends n{name="InvalidSampleRateException";$fault="client";constructor(e){super({name:"InvalidSampleRateException",$fault:"client",...e});Object.setPrototypeOf(this,U.prototype)}}class w extends n{name="InvalidSnsTopicArnException";$fault="client";constructor(e){super({name:"InvalidSnsTopicArnException",$fault:"client",...e});Object.setPrototypeOf(this,w.prototype)}}class H extends n{name="InvalidSsmlException";$fault="client";constructor(e){super({name:"InvalidSsmlException",$fault:"client",...e});Object.setPrototypeOf(this,H.prototype)}}class j extends n{name="LanguageNotSupportedException";$fault="client";constructor(e){super({name:"LanguageNotSupportedException",$fault:"client",...e});Object.setPrototypeOf(this,j.prototype)}}class z extends n{name="LexiconSizeExceededException";$fault="client";constructor(e){super({name:"LexiconSizeExceededException",$fault:"client",...e});Object.setPrototypeOf(this,z.prototype)}}class B extends n{name="MarksNotSupportedForFormatException";$fault="client";constructor(e){super({name:"MarksNotSupportedForFormatException",$fault:"client",...e});Object.setPrototypeOf(this,B.prototype)}}class q extends n{name="MaxLexemeLengthExceededException";$fault="client";constructor(e){super({name:"MaxLexemeLengthExceededException",$fault:"client",...e});Object.setPrototypeOf(this,q.prototype)}}class J extends n{name="MaxLexiconsNumberExceededException";$fault="client";constructor(e){super({name:"MaxLexiconsNumberExceededException",$fault:"client",...e});Object.setPrototypeOf(this,J.prototype)}}class Z extends n{name="UnsupportedPlsAlphabetException";$fault="client";constructor(e){super({name:"UnsupportedPlsAlphabetException",$fault:"client",...e});Object.setPrototypeOf(this,Z.prototype)}}class Q extends n{name="UnsupportedPlsLanguageException";$fault="client";constructor(e){super({name:"UnsupportedPlsLanguageException",$fault:"client",...e});Object.setPrototypeOf(this,Q.prototype)}}class X extends n{name="ServiceQuotaExceededException";$fault="client";quotaCode;serviceCode;constructor(e){super({name:"ServiceQuotaExceededException",$fault:"client",...e});Object.setPrototypeOf(this,X.prototype),this.quotaCode=e.quotaCode,this.serviceCode=e.serviceCode}}class Y extends n{name="ThrottlingException";$fault="client";throttlingReasons;constructor(e){super({name:"ThrottlingException",$fault:"client",...e});Object.setPrototypeOf(this,Y.prototype),this.throttlingReasons=e.throttlingReasons}}class te extends n{name="ValidationException";$fault="client";reason;fields;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,te.prototype),this.reason=e.reason,this.fields=e.fields}}class se extends n{name="SsmlMarksNotSupportedForTextTypeException";$fault="client";constructor(e){super({name:"SsmlMarksNotSupportedForTextTypeException",$fault:"client",...e});Object.setPrototypeOf(this,se.prototype)}}class ne extends n{name="TextLengthExceededException";$fault="client";constructor(e){super({name:"TextLengthExceededException",$fault:"client",...e});Object.setPrototypeOf(this,ne.prototype)}}var xo="Alphabet",ho="AudioChunk",Ze="AudioEvent",Eo="AdditionalLanguageCodes",Qe="AudioStream",mo="ActionStream",_o="Attributes",We="Content",Xe="CloseStreamEvent",go="CreationTime",vo="Content-Type",Lo="ContentType",To="DeleteLexicon",yo="DeleteLexiconInput",Io="DeleteLexiconOutput",$o="DescribeVoices",Oo="DescribeVoicesInput",fo="DescribeVoicesOutput",y="Engine",Po="EngineNotSupportedException",Ao="EventStream",Co="Force",st="FlushStreamConfiguration",No="Gender",ko="GetLexicon",Ro="GetLexiconInput",Do="GetLexiconOutput",bo="GetSpeechSynthesisTask",Fo="GetSpeechSynthesisTaskInput",Mo="GetSpeechSynthesisTaskOutput",Go="Id",He="IncludeAdditionalLanguageCodes",Vo="InvalidLexiconException",Uo="InvalidNextTokenException",wo="InvalidS3BucketException",Ho="InvalidSsmlException",jo="InvalidS3KeyException",zo="InvalidSampleRateException",Bo="InvalidSnsTopicArnException",qo="InvalidTaskIdException",nt="Lexicon",ot="LexiconAttributes",Ko="LexiconArn",Jo="LexiconContent",v="LanguageCode",Zo="LexemesCount",Qo="LexiconDescription",Wo="LexiconDescriptionList",Xo="ListLexicons",Yo="ListLexiconsInput",er="ListLexiconsOutput",tr="LastModified",oe="LexiconNames",sr="LexiconNotFoundException",nr="LanguageNotSupportedException",or="LanguageName",rr="LexiconSizeExceededException",ir="ListSpeechSynthesisTasks",ar="ListSpeechSynthesisTasksInput",cr="ListSpeechSynthesisTasksOutput",pr="Lexicons",ur="MaxLexemeLengthExceededException",lr="MaxLexiconsNumberExceededException",dr="MarksNotSupportedForFormatException",je="MaxResults",I="Name",E="NextToken",re="OutputFormat",Sr="OutputS3BucketName",xr="OutputS3KeyPrefix",hr="OutputUri",Er="PutLexicon",mr="PutLexiconInput",_r="PutLexiconOutput",xe="RequestCharacters",gr="Size",rt="StreamClosedEvent",vr="SupportedEngines",it="ServiceFailureException",Lr="SsmlMarksNotSupportedForTextTypeException",he="SpeechMarkTypes",at="ServiceQuotaExceededException",ie="SampleRate",Tr="SynthesizeSpeech",yr="SynthesizeSpeechInput",Ir="SynthesizeSpeechOutput",$r="StartSpeechSynthesisStream",Or="StartSpeechSynthesisStreamActionStream",fr="StartSpeechSynthesisStreamEventStream",Pr="StartSpeechSynthesisStreamInput",Ar="StartSpeechSynthesisStreamOutput",Cr="StartSpeechSynthesisTask",Nr="StartSpeechSynthesisTaskInput",kr="StartSpeechSynthesisTaskOutput",Ee="SynthesisTask",pt="SnsTopicArn",Rr="SynthesisTaskNotFoundException",ut="SynthesisTasks",ze="Status",me="Text",dt="ThrottlingException",St="TextEvent",xt="TaskId",Dr="TextLengthExceededException",br="ThrottlingReason",Fr="ThrottlingReasonList",Mr="TaskStatus",Gr="TaskStatusReason",ae="TextType",Vr="UnsupportedPlsAlphabetException",Ur="UnsupportedPlsLanguageException",wr="Voices",ht="ValidationException",Hr="ValidationExceptionField",jr="ValidationExceptionFieldList",ce="VoiceId",zr="VoiceList",Br="Voice",qr="awsQueryError",c="client",i="error",Kr="eventPayload",Jr="fields",S="http",a="httpError",_="httpHeader",g="httpQuery",o="message",Zr="name",Qr="quotaCode",Et="reason",Wr="resource",mt="smithy.ts.sdk.synthetic.com.amazonaws.polly",Xr="serviceCode",Yr="server",_e="streaming",ei="throttlingReasons",ti="x-amzn-Engine",si="x-amzn-LanguageCode",ni="x-amzn-LexiconNames",oi="x-amzn-OutputFormat",ri="x-amzn-RequestCharacters",ii="x-amzn-SampleRate",ai="x-amzn-VoiceId",t="com.amazonaws.polly",_t=new Ke(mt),gt=[-3,mt,"PollyServiceException",0,[],[]];_t.registerError(gt,n);var r=new Ke(t),vt=[-3,t,Po,{[i]:c,[a]:400},[o],[0]];r.registerError(vt,D);var Lt=[-3,t,Vo,{[i]:c,[a]:400},[o],[0]];r.registerError(Lt,M);var Tt=[-3,t,Uo,{[i]:c,[a]:400},[o],[0]];r.registerError(Tt,R);var $t=[-3,t,wo,{[i]:c,[a]:400},[o],[0]];r.registerError($t,G);var Ot=[-3,t,jo,{[i]:c,[a]:400},[o],[0]];r.registerError(Ot,V);var ft=[-3,t,zo,{[i]:c,[a]:400},[o],[0]];r.registerError(ft,U);var Pt=[-3,t,Bo,{[i]:c,[a]:400},[o],[0]];r.registerError(Pt,w);var At=[-3,t,Ho,{[i]:c,[a]:400},[o],[0]];r.registerError(At,H);var Ct=[-3,t,qo,{[i]:c,[a]:400},[o],[0]];r.registerError(Ct,b);var Nt=[-3,t,nr,{[i]:c,[a]:400},[o],[0]];r.registerError(Nt,j);var kt=[-3,t,sr,{[i]:c,[a]:404},[o],[0]];r.registerError(kt,N);var Rt=[-3,t,rr,{[i]:c,[a]:400},[o],[0]];r.registerError(Rt,z);var Dt=[-3,t,dr,{[i]:c,[a]:400},[o],[0]];r.registerError(Dt,B);var bt=[-3,t,ur,{[i]:c,[a]:400},[o],[0]];r.registerError(bt,q);var Ft=[-3,t,lr,{[i]:c,[a]:400},[o],[0]];r.registerError(Ft,J);var ge=[-3,t,it,{[i]:Yr,[a]:500},[o],[0]];r.registerError(ge,k);var ve=[-3,t,at,{[i]:c,[a]:402},[o,Qr,Xr],[0,0,0],3];r.registerError(ve,X);var Mt=[-3,t,Lr,{[i]:c,[a]:400},[o],[0]];r.registerError(Mt,se);var Gt=[-3,t,Rr,{[i]:c,[a]:400},[o],[0]];r.registerError(Gt,F);var Vt=[-3,t,Dr,{[i]:c,[a]:400},[o],[0]];r.registerError(Vt,ne);var Le=[-3,t,dt,{[qr]:["Throttling",400],[i]:c,[a]:400},[o,ei],[0,()=>li]];r.registerError(Le,Y);var Ut=[-3,t,Vr,{[i]:c,[a]:400},[o],[0]];r.registerError(Ut,Z);var wt=[-3,t,Ur,{[i]:c,[a]:400},[o],[0]];r.registerError(wt,Q);var Te=[-3,t,ht,{[i]:c,[a]:400},[o,Et,Jr],[0,0,()=>di],2];r.registerError(Te,te);var Ht=[_t,r],ci=[0,t,Qe,{[_e]:1},42],jt=[0,t,Jo,8,0],zt=[3,t,Ze,0,[ho],[[21,{[Kr]:1}]]],Bt=[3,t,Xe,0,[],[]],qt=[3,t,yo,0,[I],[[0,1]],1],Kt=[3,t,Io,0,[],[]],Jt=[3,t,Oo,0,[y,v,He,E],[[0,{[g]:y}],[0,{[g]:v}],[2,{[g]:He}],[0,{[g]:E}]]],Zt=[3,t,fo,0,[wr,E],[()=>Si,0]],Wt=[3,t,st,0,[Co],[2]],Xt=[3,t,Ro,0,[I],[[0,1]],1],Yt=[3,t,Do,0,[nt,ot],[[()=>ss,0],()=>ye]],es=[3,t,Fo,0,[xt],[[0,1]],1],ts=[3,t,Mo,0,[Ee],[()=>ue]],ss=[3,t,nt,0,[We,I],[[()=>jt,0],0]],ye=[3,t,ot,0,[xo,v,tr,Ko,Zo,gr],[0,0,4,0,1,1]],ns=[3,t,Qo,0,[I,_o],[0,()=>ye]],os=[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,0],[()=>Le,0]]],ys=[9,t,To,{[S]:["DELETE","/v1/lexicons/{Name}",200]},()=>qt,()=>Kt],Is=[9,t,$o,{[S]:["GET","/v1/voices",200]},()=>Jt,()=>Zt],$s=[9,t,ko,{[S]:["GET","/v1/lexicons/{Name}",200]},()=>Xt,()=>Yt],Os=[9,t,bo,{[S]:["GET","/v1/synthesisTasks/{TaskId}",200]},()=>es,()=>ts],fs=[9,t,Xo,{[S]:["GET","/v1/lexicons",200]},()=>os,()=>rs],Ps=[9,t,ir,{[S]:["GET","/v1/synthesisTasks",200]},()=>is,()=>as],As=[9,t,Er,{[S]:["PUT","/v1/lexicons/{Name}",200]},()=>cs,()=>ps],Cs=[9,t,$r,{[S]:["POST","/v1/synthesisStream",200]},()=>us,()=>ls],Ns=[9,t,Cr,{[S]:["POST","/v1/synthesisTasks",200]},()=>ds,()=>Ss],ks=[9,t,Tr,{[S]:["POST","/v1/speech",200]},()=>hs,()=>Es],xi=(e)=>({apiVersion:"2016-06-10",base64Decoder:e?.base64Decoder??Jn,base64Encoder:e?.base64Encoder??Kn,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??So,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??so,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Un}],logger:e?.logger??new an,protocol:e?.protocol??Xn,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.polly",errorTypeRegistries:Ht,xmlNamespace:"http://polly.amazonaws.com/doc/v1",version:"2016-06-10",serviceTarget:"Parrot_v1"},sdkStreamMixin:e?.sdkStreamMixin??qn,serviceId:e?.serviceId??"Polly",sha256:e?.sha256??Yn,urlParser:e?.urlParser??An,utf8Decoder:e?.utf8Decoder??Bn,utf8Encoder:e?.utf8Encoder??zn}),hi=(e)=>{cn(process.version);let s=hn(e),p=()=>s().then(pn),d=xi(e);ws(process.version);let u={profile:e?.profile,logger:d.logger};return{...d,...e,runtime:"node",defaultsMode:s,authSchemePreference:e?.authSchemePreference??L(wn,u),bodyLengthChecker:e?.bodyLengthChecker??Zn,credentialDefaultProvider:e?.credentialDefaultProvider??Hn,defaultUserAgentProvider:e?.defaultUserAgentProvider??Hs({serviceId:d.serviceId,clientVersion:ao.version}),eventStreamPayloadHandlerProvider:e?.eventStreamPayloadHandlerProvider??jn,eventStreamSerdeProvider:e?.eventStreamSerdeProvider??fn,maxAttempts:e?.maxAttempts??L(bn,e),region:e?.region??L(_n,{...gn,...u}),requestHandler:Wn.create(e?.requestHandler??(async()=>({...await p(),disableConcurrentStreams:!0}))),retryMode:e?.retryMode??L({...Dn,default:async()=>(await p()).retryMode||Rn},e),streamCollector:e?.streamCollector??Qn,useDualstackEndpoint:e?.useDualstackEndpoint??L(mn,u),useFipsEndpoint:e?.useFipsEndpoint??L(En,u),userAgentAppId:e?.userAgentAppId??L(js,u)}},Ei=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:p,credentials:d}=e;return{setHttpAuthScheme(u){let P=s.findIndex((Se)=>Se.schemeId===u.schemeId);if(P===-1)s.push(u);else s.splice(P,1,u)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(u){p=u},httpAuthSchemeProvider(){return p},setCredentials(u){d=u},credentials(){return d}}},mi=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),_i=(e,s)=>{let p=Object.assign(zs(e),un(e),Cn(e),Ei(e));return s.forEach((d)=>d.configure(p)),Object.assign(e,Bs(p),ln(p),Nn(p),mi(p))};class le extends qe{config;constructor(...[e]){let s=hi(e||{});super(s);this.initConfig=s;let p=oo(s),d=qs(p),u=Fn(d),P=vn(u),Se=Ks(P),Ds=$n(Se),bs=Pn(Ds),Fs=no(bs),Ms=Xs(Fs),Gs=_i(Ms,e?.extensions||[]);this.config=Gs,this.middlewareStack.use(Gn(this.config)),this.middlewareStack.use(Js(this.config)),this.middlewareStack.use(Mn(this.config)),this.middlewareStack.use(kn(this.config)),this.middlewareStack.use(Zs(this.config)),this.middlewareStack.use(Qs(this.config)),this.middlewareStack.use(Ws(this.config)),this.middlewareStack.use(en(this.config,{httpAuthSchemeParametersProvider:eo,identityProviderConfigProvider:async(Vs)=>new tn({"aws.auth#sigv4":Vs.credentials})})),this.middlewareStack.use(sn(this.config))}destroy(){super.destroy()}}var x=dn(ro,"Parrot_v1","PollyClient",On),h={},m=(e,s,p,d)=>[],gi=(e,s,p,d)=>[Ys(p)];class $e extends x(h,m,"DeleteLexicon",ys){}class Oe extends x(h,m,"DescribeVoices",Is){}class fe extends x(h,m,"GetLexicon",$s){}class Pe extends x(h,m,"GetSpeechSynthesisTask",Os){}class Ae extends x(h,m,"ListLexicons",fs){}class de extends x(h,m,"ListSpeechSynthesisTasks",Ps){}class Ce extends x(h,m,"PutLexicon",As){}class Ne extends x(h,gi,"StartSpeechSynthesisStream",Cs){}class ke extends x(h,m,"StartSpeechSynthesisTask",Ns){}class De extends x(h,m,"SynthesizeSpeech",ks){}var Rs=nn(le,de,"NextToken","NextToken","MaxResults"),vi={DeleteLexiconCommand:$e,DescribeVoicesCommand:Oe,GetLexiconCommand:fe,GetSpeechSynthesisTaskCommand:Pe,ListLexiconsCommand:Ae,ListSpeechSynthesisTasksCommand:de,PutLexiconCommand:Ce,StartSpeechSynthesisStreamCommand:Ne,StartSpeechSynthesisTaskCommand:ke,SynthesizeSpeechCommand:De},Li={paginateListSpeechSynthesisTasks:Rs};class be extends le{}Sn(vi,be,{paginators:Li});var Ti={GENERATIVE:"generative",LONG_FORM:"long-form",NEURAL:"neural",STANDARD:"standard"},yi={ar_AE:"ar-AE",arb:"arb",ca_ES:"ca-ES",cmn_CN:"cmn-CN",cs_CZ:"cs-CZ",cy_GB:"cy-GB",da_DK:"da-DK",de_AT:"de-AT",de_CH:"de-CH",de_DE:"de-DE",en_AU:"en-AU",en_GB:"en-GB",en_GB_WLS:"en-GB-WLS",en_IE:"en-IE",en_IN:"en-IN",en_NZ:"en-NZ",en_SG:"en-SG",en_US:"en-US",en_ZA:"en-ZA",es_ES:"es-ES",es_MX:"es-MX",es_US:"es-US",fi_FI:"fi-FI",fr_BE:"fr-BE",fr_CA:"fr-CA",fr_FR:"fr-FR",hi_IN:"hi-IN",is_IS:"is-IS",it_IT:"it-IT",ja_JP:"ja-JP",ko_KR:"ko-KR",nb_NO:"nb-NO",nl_BE:"nl-BE",nl_NL:"nl-NL",pl_PL:"pl-PL",pt_BR:"pt-BR",pt_PT:"pt-PT",ro_RO:"ro-RO",ru_RU:"ru-RU",sv_SE:"sv-SE",tr_TR:"tr-TR",yue_CN:"yue-CN"},Ii={Female:"Female",Male:"Male"},$i={Aditi:"Aditi",Adriano:"Adriano",Ambre:"Ambre",Amy:"Amy",Andres:"Andres",Aria:"Aria",Arlet:"Arlet",Arthur:"Arthur",Astrid:"Astrid",Ayanda:"Ayanda",Beatrice:"Beatrice",Bianca:"Bianca",Brian:"Brian",Burcu:"Burcu",Camila:"Camila",Carla:"Carla",Carmen:"Carmen",Celine:"Celine",Chantal:"Chantal",Conchita:"Conchita",Cristiano:"Cristiano",Daniel:"Daniel",Danielle:"Danielle",Dora:"Dora",Elin:"Elin",Emma:"Emma",Enrique:"Enrique",Ewa:"Ewa",Filiz:"Filiz",Florian:"Florian",Gabrielle:"Gabrielle",Geraint:"Geraint",Giorgio:"Giorgio",Gregory:"Gregory",Gwyneth:"Gwyneth",Hala:"Hala",Hannah:"Hannah",Hans:"Hans",Hiujin:"Hiujin",Ida:"Ida",Ines:"Ines",Isabelle:"Isabelle",Ivy:"Ivy",Jacek:"Jacek",Jan:"Jan",Jasmine:"Jasmine",Jihye:"Jihye",Jitka:"Jitka",Joanna:"Joanna",Joey:"Joey",Justin:"Justin",Kajal:"Kajal",Karl:"Karl",Kazuha:"Kazuha",Kendra:"Kendra",Kevin:"Kevin",Kimberly:"Kimberly",Laura:"Laura",Lea:"Lea",Lennart:"Lennart",Liam:"Liam",Lisa:"Lisa",Liv:"Liv",Lorenzo:"Lorenzo",Lotte:"Lotte",Lucia:"Lucia",Lupe:"Lupe",Mads:"Mads",Maja:"Maja",Marlene:"Marlene",Mathieu:"Mathieu",Matthew:"Matthew",Maxim:"Maxim",Mia:"Mia",Miguel:"Miguel",Mizuki:"Mizuki",Naja:"Naja",Niamh:"Niamh",Nicole:"Nicole",Ola:"Ola",Olivia:"Olivia",Pedro:"Pedro",Penelope:"Penelope",Raveena:"Raveena",Remi:"Remi",Ricardo:"Ricardo",Ruben:"Ruben",Russell:"Russell",Ruth:"Ruth",Sabrina:"Sabrina",Salli:"Salli",Seoyeon:"Seoyeon",Sergio:"Sergio",Sofie:"Sofie",Stephen:"Stephen",Suvi:"Suvi",Takumi:"Takumi",Tatyana:"Tatyana",Thiago:"Thiago",Tiffany:"Tiffany",Tomoko:"Tomoko",Vicki:"Vicki",Vitoria:"Vitoria",Zayd:"Zayd",Zeina:"Zeina",Zhiyu:"Zhiyu"},Oi={ALAW:"alaw",JSON:"json",MP3:"mp3",MULAW:"mulaw",OGG_OPUS:"ogg_opus",OGG_VORBIS:"ogg_vorbis",PCM:"pcm"},fi={SENTENCE:"sentence",SSML:"ssml",VISEME:"viseme",WORD:"word"},Pi={COMPLETED:"completed",FAILED:"failed",IN_PROGRESS:"inProgress",SCHEDULED:"scheduled"},Ai={SSML:"ssml",TEXT:"text"},Ci={INPUT_STREAM_INBOUND_EVENT_TIMEOUT:"input-stream-inbound-event-timeout",INPUT_STREAM_TIMEOUT:"input-stream-timeout"},Ni={POLLY:"polly"},ki={FIELD_VALIDATION_FAILED:"fieldValidationFailed",INVALID_INBOUND_EVENT:"invalidInboundEvent",OTHER:"other",UNSUPPORTED_OPERATION:"unsupportedOperation"};var bi=zt,Fi=Bt,Mi=ys,Gi=$e,Vi=qt,Ui=Kt,wi=Is,Hi=Oe,ji=Jt,zi=Zt,Bi=Ti,qi=D,Ki=vt,Ji=Wt,Zi=Ii,Qi=$s,Wi=fe,Xi=Xt,Yi=Yt,ea=Os,ta=Pe,sa=es,na=ts,oa=M,ra=Lt,ia=R,aa=Tt,ca=G,pa=$t,ua=V,la=Ot,da=U,Sa=ft,xa=w,ha=Pt,Ea=H,ma=At,_a=b,ga=Ct,va=yi,La=j,Ta=Nt,ya=ss,Ia=ye,$a=ns,Oa=N,fa=kt,Pa=z,Aa=Rt,Ca=fs,Na=Ae,ka=os,Ra=rs,Da=Ps,ba=de,Fa=is,Ma=as,Ga=B,Va=Dt,Ua=q,wa=bt,Ha=J,ja=Ft,za=Oi,Ba=be,qa=le,Ka=n,Ja=gt,Za=As,Qa=Ce,Wa=cs,Xa=ps,Ya=Ci,ec=Ni,tc=k,sc=ge,nc=X,oc=ve,rc=fi,ic=se,ac=Mt,cc=Cs,pc=Ls,uc=Ne,lc=Ts,dc=us,Sc=ls,xc=Ns,hc=ke,Ec=ds,mc=Ss,_c=xs,gc=ue,vc=F,Lc=Gt,Tc=ks,yc=De,Ic=hs,$c=Es,Oc=Pi,fc=ms,Pc=ne,Ac=Vt,Cc=Ai,Nc=Y,kc=Le,Rc=_s,Dc=Z,bc=Ut,Fc=Q,Mc=wt,Gc=te,Vc=Te,Uc=gs,wc=ki,Hc=vs,jc=$i,zc=Ht,Bc=Rs;export{Ri as $Command,Di as __Client,bi as AudioEvent$,Fi as CloseStreamEvent$,Mi as DeleteLexicon$,Gi as DeleteLexiconCommand,Vi as DeleteLexiconInput$,Ui as DeleteLexiconOutput$,wi as DescribeVoices$,Hi as DescribeVoicesCommand,ji as DescribeVoicesInput$,zi as DescribeVoicesOutput$,Bi as Engine,qi as EngineNotSupportedException,Ki as EngineNotSupportedException$,Ji as FlushStreamConfiguration$,Zi as Gender,Qi as GetLexicon$,Wi as GetLexiconCommand,Xi as GetLexiconInput$,Yi as GetLexiconOutput$,ea as GetSpeechSynthesisTask$,ta as GetSpeechSynthesisTaskCommand,sa as GetSpeechSynthesisTaskInput$,na as GetSpeechSynthesisTaskOutput$,oa as InvalidLexiconException,ra as InvalidLexiconException$,ia as InvalidNextTokenException,aa as InvalidNextTokenException$,ca as InvalidS3BucketException,pa as InvalidS3BucketException$,ua as InvalidS3KeyException,la as InvalidS3KeyException$,da as InvalidSampleRateException,Sa as InvalidSampleRateException$,xa as InvalidSnsTopicArnException,ha as InvalidSnsTopicArnException$,Ea as InvalidSsmlException,ma as InvalidSsmlException$,_a as InvalidTaskIdException,ga as InvalidTaskIdException$,va as LanguageCode,La as LanguageNotSupportedException,Ta as LanguageNotSupportedException$,ya as Lexicon$,Ia as LexiconAttributes$,$a as LexiconDescription$,Oa as LexiconNotFoundException,fa as LexiconNotFoundException$,Pa as LexiconSizeExceededException,Aa as LexiconSizeExceededException$,Ca as ListLexicons$,Na as ListLexiconsCommand,ka as ListLexiconsInput$,Ra as ListLexiconsOutput$,Da as ListSpeechSynthesisTasks$,ba as ListSpeechSynthesisTasksCommand,Fa as ListSpeechSynthesisTasksInput$,Ma as ListSpeechSynthesisTasksOutput$,Ga as MarksNotSupportedForFormatException,Va as MarksNotSupportedForFormatException$,Ua as MaxLexemeLengthExceededException,wa as MaxLexemeLengthExceededException$,Ha as MaxLexiconsNumberExceededException,ja as MaxLexiconsNumberExceededException$,za as OutputFormat,Ba as Polly,qa as PollyClient,Ka as PollyServiceException,Ja as PollyServiceException$,Za as PutLexicon$,Qa as PutLexiconCommand,Wa as PutLexiconInput$,Xa as PutLexiconOutput$,Ya as QuotaCode,ec as ServiceCode,tc as ServiceFailureException,sc as ServiceFailureException$,nc as ServiceQuotaExceededException,oc as ServiceQuotaExceededException$,rc as SpeechMarkType,ic as SsmlMarksNotSupportedForTextTypeException,ac as SsmlMarksNotSupportedForTextTypeException$,cc as StartSpeechSynthesisStream$,pc as StartSpeechSynthesisStreamActionStream$,uc as StartSpeechSynthesisStreamCommand,lc as StartSpeechSynthesisStreamEventStream$,dc as StartSpeechSynthesisStreamInput$,Sc as StartSpeechSynthesisStreamOutput$,xc as StartSpeechSynthesisTask$,hc as StartSpeechSynthesisTaskCommand,Ec as StartSpeechSynthesisTaskInput$,mc as StartSpeechSynthesisTaskOutput$,_c as StreamClosedEvent$,gc as SynthesisTask$,vc as SynthesisTaskNotFoundException,Lc as SynthesisTaskNotFoundException$,Tc as SynthesizeSpeech$,yc as SynthesizeSpeechCommand,Ic as SynthesizeSpeechInput$,$c as SynthesizeSpeechOutput$,Oc as TaskStatus,fc as TextEvent$,Pc as TextLengthExceededException,Ac as TextLengthExceededException$,Cc as TextType,Nc as ThrottlingException,kc as ThrottlingException$,Rc as ThrottlingReason$,Dc as UnsupportedPlsAlphabetException,bc as UnsupportedPlsAlphabetException$,Fc as UnsupportedPlsLanguageException,Mc as UnsupportedPlsLanguageException$,Gc as ValidationException,Vc as ValidationException$,Uc as ValidationExceptionField$,wc as ValidationExceptionReason,Hc as Voice$,jc as VoiceId,zc as errorTypeRegistries,Bc as paginateListSpeechSynthesisTasks};
|
|
3
|
+
|
|
4
|
+
//# debugId=750285FE8C533B5C64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=index-2bsardvh.js.map
|