dropthis 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,50 +4,14 @@ Official CLI for Dropthis. Publish a file, folder, URL, stdin, or generated arti
4
4
 
5
5
  ## For AI Agents
6
6
 
7
- Add this to your project's `CLAUDE.md`, `.cursorrules`, or agent instructions:
7
+ Read [SKILL.md](./SKILL.md) and follow the instructions to publish with dropthis.
8
8
 
9
- ~~~markdown
10
- ## dropthis — publish anything online
9
+ ## For Humans
11
10
 
12
- dropthis CLI publishes HTML, files, or folders and returns a permanent URL. One command in, one URL out.
13
-
14
- ### Install
15
-
16
- ```bash
17
- npm install -g dropthis
18
- ```
19
-
20
- ### First-time setup
21
-
22
- If `dropthis whoami` fails with exit code 3, the user needs to log in:
23
-
24
- 1. Ask the user for their email address
25
- 2. Run `dropthis login request --email <their-email>`
26
- 3. Tell the user to check their email for a one-time code
27
- 4. Once they give you the code, run `dropthis login verify --email <their-email> --otp <code>`
28
- 5. Confirm with `dropthis whoami --json`
29
-
30
- ### Publishing
31
-
32
- ```bash
33
- # Publish a file
34
- dropthis publish ./page.html --url
35
-
36
- # Publish a folder
37
- dropthis publish ./dist --url
38
-
39
- # Publish generated HTML from stdin
40
- echo "<h1>Hello</h1>" | dropthis publish --content-type text/html --path index.html --url
41
- ```
42
-
43
- `--url` prints only the published URL. Use `--json` for full response.
44
-
45
- ### After setup, offer a demo
46
-
47
- Once authenticated, offer: "Want me to create a page and publish it so you can see dropthis in action?"
48
-
49
- If yes: generate a single HTML file with something relevant to the user's project, publish it with `dropthis publish`, and return the URL.
50
- ~~~
11
+ 1. Copy the instruction above and send it to your AI agent.
12
+ 2. Your agent will install dropthis and ask for your email.
13
+ 3. Check your inbox for an OTP code and give it to your agent.
14
+ 4. Done — your agent can now publish pages for you.
51
15
 
52
16
  ## Install
53
17
 
package/dist/cli.cjs CHANGED
@@ -1053,7 +1053,7 @@ var MemoryCredentialStore = class {
1053
1053
  function buildProgram(options = {}) {
1054
1054
  const program = new import_commander.Command();
1055
1055
  const store = options.store ?? new MemoryCredentialStore();
1056
- program.name("dropthis").description("Publish anything online and get a URL back.").version("0.1.0");
1056
+ program.name("dropthis").description("Publish anything online and get a URL back.").version("0.1.1");
1057
1057
  program.option("--api-key <key>", "Override API key for this invocation");
1058
1058
  program.option("--api-url <url>", "Override API base URL");
1059
1059
  program.option("--json", "Force JSON output");
package/dist/cli.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/program.ts","../src/auth.ts","../src/output.ts","../src/commands/account.ts","../src/commands/api-keys.ts","../src/commands/commands.ts","../src/commands/deployments.ts","../src/commands/doctor.ts","../src/options.ts","../src/commands/drops.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/commands/publish.ts","../src/commands/json_body.ts","../src/commands/update.ts","../src/commands/whoami.ts","../src/context.ts","../src/storage.ts","../src/cli.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { resolveCredential } from \"./auth.js\";\nimport { runAccountGet } from \"./commands/account.js\";\nimport {\n\trunApiKeysCreate,\n\trunApiKeysDelete,\n\trunApiKeysList,\n} from \"./commands/api-keys.js\";\nimport { runCommands } from \"./commands/commands.js\";\nimport {\n\trunDeploymentsGet,\n\trunDeploymentsList,\n} from \"./commands/deployments.js\";\nimport { runDoctor } from \"./commands/doctor.js\";\nimport {\n\trunDropsDelete,\n\trunDropsGet,\n\trunDropsList,\n\trunDropsUpdate,\n} from \"./commands/drops.js\";\nimport { runLoginRequest, runLoginVerify } from \"./commands/login.js\";\nimport { runLogout } from \"./commands/logout.js\";\nimport { runPublish } from \"./commands/publish.js\";\nimport { runUpdate } from \"./commands/update.js\";\nimport { runWhoami } from \"./commands/whoami.js\";\nimport { createContext, type GlobalOptions } from \"./context.js\";\nimport type { RawDropOptions } from \"./options.js\";\nimport { type CredentialStore, MemoryCredentialStore } from \"./storage.js\";\n\ntype BuildProgramOptions = {\n\tstore?: CredentialStore;\n\tclient?: unknown;\n\tenv?: Record<string, string | undefined>;\n\tstdin?: AsyncIterable<string | Uint8Array>;\n\tstdout?: (value: string) => void;\n\tstderr?: (value: string) => void;\n\tstdoutIsTTY?: boolean;\n\tstdinIsTTY?: boolean;\n};\n\nexport function buildProgram(options: BuildProgramOptions = {}): Command {\n\tconst program = new Command();\n\tconst store = options.store ?? new MemoryCredentialStore();\n\tprogram\n\t\t.name(\"dropthis\")\n\t\t.description(\"Publish anything online and get a URL back.\")\n\t\t.version(\"0.1.0\");\n\tprogram.option(\"--api-key <key>\", \"Override API key for this invocation\");\n\tprogram.option(\"--api-url <url>\", \"Override API base URL\");\n\tprogram.option(\"--json\", \"Force JSON output\");\n\tprogram.option(\"-q, --quiet\", \"Suppress status output and imply JSON\");\n\n\tprogram\n\t\t.command(\"login\")\n\t\t.description(\"Authenticate with email OTP\")\n\t\t.option(\"--email <email>\", \"Email address\")\n\t\t.option(\"--otp <otp>\", \"One-time passcode\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (commandOptions: {\n\t\t\t\temail?: string;\n\t\t\t\totp?: string;\n\t\t\t\tjson?: boolean;\n\t\t\t}) => {\n\t\t\t\tif (!commandOptions.email || !commandOptions.otp) return;\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runLoginVerify>[1][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runLoginVerify(\n\t\t\t\t\t{\n\t\t\t\t\t\temail: commandOptions.email,\n\t\t\t\t\t\totp: commandOptions.otp,\n\t\t\t\t\t\t...(commandOptions.json !== undefined\n\t\t\t\t\t\t\t? { json: commandOptions.json }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t},\n\t\t\t\t\tdeps,\n\t\t\t\t);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tconst login = program.commands.find((command) => command.name() === \"login\");\n\tlogin\n\t\t?.command(\"request\")\n\t\t.description(\"Request an email OTP\")\n\t\t.requiredOption(\"--email <email>\", \"Email address\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { email: string; json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runLoginRequest>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runLoginRequest(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\tlogin\n\t\t?.command(\"verify\")\n\t\t.description(\"Verify email OTP and store an API key\")\n\t\t.requiredOption(\"--email <email>\", \"Email address\")\n\t\t.requiredOption(\"--otp <otp>\", \"One-time passcode\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (commandOptions: {\n\t\t\t\temail: string;\n\t\t\t\totp: string;\n\t\t\t\tjson?: boolean;\n\t\t\t}) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runLoginVerify>[1][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runLoginVerify(commandOptions, deps);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tprogram\n\t\t.command(\"logout\")\n\t\t.description(\"Remove stored credentials\")\n\t\t.option(\"--revoke\", \"Best-effort revoke the saved API key\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { revoke?: boolean; json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<Parameters<typeof runLogout>[1][\"client\"]>(\n\t\t\t\tprogram,\n\t\t\t\toptions,\n\t\t\t\tstore,\n\t\t\t\tcommandOptions,\n\t\t\t);\n\t\t\tconst result = await runLogout(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tprogram\n\t\t.command(\"whoami\")\n\t\t.description(\"Show current authentication status\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<unknown>(\n\t\t\t\tprogram,\n\t\t\t\toptions,\n\t\t\t\tstore,\n\t\t\t\tcommandOptions,\n\t\t\t);\n\t\t\tconst result = await runWhoami(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tprogram\n\t\t.command(\"account\")\n\t\t.description(\"Account commands\")\n\t\t.command(\"get\")\n\t\t.description(\"Get account details\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runAccountGet>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runAccountGet(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tprogram\n\t\t.command(\"publish [input...]\")\n\t\t.description(\n\t\t\t\"Publish files, folders, URLs, strings, or stdin.\\nMultiple files are bundled into one drop.\\nUse - to read stdin explicitly, or pipe without args.\",\n\t\t)\n\t\t.option(\"--from-json <path>\", \"Read exact POST /drops JSON request body\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.option(\"--title <title>\", \"Drop title\")\n\t\t.option(\"--visibility <visibility>\", \"Drop visibility\")\n\t\t.option(\"--password <password>\", \"Set password\")\n\t\t.option(\"--no-password\", \"Clear password\")\n\t\t.option(\"--noindex\", \"Prevent indexing\")\n\t\t.option(\"--index\", \"Allow indexing\")\n\t\t.option(\"--expires-at <datetime>\", \"Expiration datetime\")\n\t\t.option(\"--metadata <json>\", \"Metadata JSON object\")\n\t\t.option(\"--metadata-file <path>\", \"Metadata JSON file\")\n\t\t.option(\"--entry <path>\", \"Entry file path\")\n\t\t.option(\"--content-type <mime>\", \"Content type\")\n\t\t.option(\"--path <path>\", \"Path for stdin or byte input\")\n\t\t.option(\"--idempotency-key <key>\", \"Idempotency key\")\n\t\t.option(\"--url\", \"Print only the published URL\")\n\t\t.option(\"--dry-run\", \"Validate without publishing\")\n\t\t.action(async (inputs: string[], commandOptions: RawCommandOptions) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runPublish>[2][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\tlet publishInput: string | string[] | undefined;\n\t\t\tif (commandOptions.dryRun && inputs.length > 1) {\n\t\t\t\tpublishInput = inputs;\n\t\t\t} else {\n\t\t\t\tpublishInput = await resolvePublishInputs(\n\t\t\t\t\tinputs,\n\t\t\t\t\toptions.stdin,\n\t\t\t\t\tstdinIsTTY,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst result = await runPublish(\n\t\t\t\tpublishInput,\n\t\t\t\ttoDropOptions(commandOptions),\n\t\t\t\tdeps,\n\t\t\t);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tprogram\n\t\t.command(\"update <target> [input]\")\n\t\t.description(\"Update an existing drop by id\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.option(\"--slug <slug>\", \"Replace shared hosted drop slug\")\n\t\t.option(\"--title <title>\", \"Drop title\")\n\t\t.option(\"--visibility <visibility>\", \"Drop visibility\")\n\t\t.option(\"--password <password>\", \"Set password\")\n\t\t.option(\"--no-password\", \"Clear password\")\n\t\t.option(\"--noindex\", \"Prevent indexing\")\n\t\t.option(\"--index\", \"Allow indexing\")\n\t\t.option(\"--expires-at <datetime>\", \"Expiration datetime\")\n\t\t.option(\"--metadata <json>\", \"Metadata JSON object\")\n\t\t.option(\"--metadata-file <path>\", \"Metadata JSON file\")\n\t\t.option(\"--entry <path>\", \"Entry file path\")\n\t\t.option(\"--content-type <mime>\", \"Content type\")\n\t\t.option(\"--path <path>\", \"Path for stdin or byte input\")\n\t\t.option(\"--idempotency-key <key>\", \"Idempotency key\")\n\t\t.option(\"--if-revision <n>\", \"Expected current revision\", parseInteger)\n\t\t.option(\n\t\t\t\"--from-json <path>\",\n\t\t\t\"Read exact POST /drops/{drop_id}/deployments JSON request body\",\n\t\t)\n\t\t.option(\"--url\", \"Print only the published URL\")\n\t\t.option(\"--dry-run\", \"Validate without publishing\")\n\t\t.action(\n\t\t\tasync (\n\t\t\t\ttarget: string,\n\t\t\t\tinput: string | undefined,\n\t\t\t\tcommandOptions: RawCommandOptions & { ifRevision?: number },\n\t\t\t) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runUpdate>[3][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst updateInput = input\n\t\t\t\t\t? await resolveCommandInput(input, options.stdin)\n\t\t\t\t\t: undefined;\n\t\t\t\tconst result = await runUpdate(\n\t\t\t\t\ttarget,\n\t\t\t\t\tupdateInput,\n\t\t\t\t\ttoDropOptions(commandOptions),\n\t\t\t\t\tdeps,\n\t\t\t\t);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tconst drops = program.command(\"drops\").description(\"Drop resource commands\");\n\tdrops\n\t\t.command(\"list\")\n\t\t.option(\"--limit <n>\", \"Page size\", parseInteger)\n\t\t.option(\"--cursor <cursor>\", \"Pagination cursor\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (commandOptions: {\n\t\t\t\tlimit?: number;\n\t\t\t\tcursor?: string;\n\t\t\t\tjson?: boolean;\n\t\t\t}) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runDropsList>[1][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runDropsList(commandOptions, deps);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\tdrops\n\t\t.command(\"get <dropId>\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (dropId: string, commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runDropsGet>[2][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runDropsGet(dropId, commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\tdrops\n\t\t.command(\"update <dropId>\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.option(\"--title <title>\", \"Drop title\")\n\t\t.option(\"--visibility <visibility>\", \"Drop visibility\")\n\t\t.option(\"--password <password>\", \"Set password\")\n\t\t.option(\"--no-password\", \"Clear password\")\n\t\t.option(\"--noindex\", \"Prevent indexing\")\n\t\t.option(\"--index\", \"Allow indexing\")\n\t\t.option(\"--expires-at <datetime>\", \"Expiration datetime\")\n\t\t.option(\"--metadata <json>\", \"Metadata JSON object\")\n\t\t.option(\"--metadata-file <path>\", \"Metadata JSON file\")\n\t\t.action(async (dropId: string, commandOptions: RawCommandOptions) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runDropsUpdate>[2][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runDropsUpdate(\n\t\t\t\tdropId,\n\t\t\t\ttoDropOptions(commandOptions),\n\t\t\t\tdeps,\n\t\t\t);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\tdrops\n\t\t.command(\"delete <dropId>\")\n\t\t.option(\"--yes\", \"Confirm deletion\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (\n\t\t\t\tdropId: string,\n\t\t\t\tcommandOptions: { yes?: boolean; json?: boolean },\n\t\t\t) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runDropsDelete>[2][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runDropsDelete(\n\t\t\t\t\tdropId,\n\t\t\t\t\t{ ...commandOptions, interactive: deps.outputMode === \"human\" },\n\t\t\t\t\tdeps,\n\t\t\t\t);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tconst apiKeys = program.command(\"api-keys\").description(\"API key commands\");\n\tapiKeys\n\t\t.command(\"create\")\n\t\t.option(\"--label <label>\", \"API key label\", \"CLI\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { label: string; json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runApiKeysCreate>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runApiKeysCreate(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\tapiKeys\n\t\t.command(\"list\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runApiKeysList>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runApiKeysList(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\tapiKeys\n\t\t.command(\"delete <keyId>\")\n\t\t.option(\"--yes\", \"Confirm deletion\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (\n\t\t\t\tkeyId: string,\n\t\t\t\tcommandOptions: { yes?: boolean; json?: boolean },\n\t\t\t) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runApiKeysDelete>[2][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runApiKeysDelete(\n\t\t\t\t\tkeyId,\n\t\t\t\t\t{ ...commandOptions, interactive: deps.outputMode === \"human\" },\n\t\t\t\t\tdeps,\n\t\t\t\t);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tconst deployments = program\n\t\t.command(\"deployments\")\n\t\t.description(\"Deployment commands\");\n\tdeployments\n\t\t.command(\"list <dropId>\")\n\t\t.option(\"--limit <n>\", \"Page size\", parseInteger)\n\t\t.option(\"--cursor <cursor>\", \"Pagination cursor\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (\n\t\t\t\tdropId: string,\n\t\t\t\tcommandOptions: { limit?: number; cursor?: string; json?: boolean },\n\t\t\t) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runDeploymentsList>[2][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runDeploymentsList(dropId, commandOptions, deps);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\tdeployments\n\t\t.command(\"get <dropId> <deploymentId>\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (\n\t\t\t\tdropId: string,\n\t\t\t\tdeploymentId: string,\n\t\t\t\tcommandOptions: { json?: boolean },\n\t\t\t) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runDeploymentsGet>[3][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runDeploymentsGet(\n\t\t\t\t\tdropId,\n\t\t\t\t\tdeploymentId,\n\t\t\t\t\tcommandOptions,\n\t\t\t\t\tdeps,\n\t\t\t\t);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tprogram\n\t\t.command(\"doctor\")\n\t\t.description(\"Report CLI diagnostics\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<unknown>(\n\t\t\t\tprogram,\n\t\t\t\toptions,\n\t\t\t\tstore,\n\t\t\t\tcommandOptions,\n\t\t\t);\n\t\t\tconst result = await runDoctor(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tprogram\n\t\t.command(\"commands\")\n\t\t.description(\"Print machine-readable command metadata\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<unknown>(\n\t\t\t\tprogram,\n\t\t\t\toptions,\n\t\t\t\tstore,\n\t\t\t\tcommandOptions,\n\t\t\t);\n\t\t\tconst result = await runCommands(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\treturn program;\n}\n\ntype RawCommandOptions = Omit<RawDropOptions, \"password\"> & {\n\tjson?: boolean;\n\tquiet?: boolean;\n\turl?: boolean;\n\tifRevision?: number;\n\tfromJson?: string;\n\tdryRun?: boolean;\n\tpassword?: string | boolean;\n};\n\ntype RunnerDeps<TClient> = {\n\tstore: CredentialStore;\n\tclient: TClient;\n\tapiKey?: string;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\toutputMode: \"human\" | \"json\";\n};\n\nasync function commandDeps<TClient>(\n\tprogram: Command,\n\toptions: BuildProgramOptions,\n\tstore: CredentialStore,\n\tcommandOptions: { json?: boolean; quiet?: boolean },\n): Promise<RunnerDeps<TClient>> {\n\tconst global = globalOptions(program, commandOptions);\n\tconst context = createContext({\n\t\tglobal,\n\t\t...(options.env !== undefined ? { env: options.env } : {}),\n\t\t...(options.stdout !== undefined ? { stdout: options.stdout } : {}),\n\t\t...(options.stderr !== undefined ? { stderr: options.stderr } : {}),\n\t\t...(options.stdoutIsTTY !== undefined\n\t\t\t? { stdoutIsTTY: options.stdoutIsTTY }\n\t\t\t: {}),\n\t});\n\tconst credential = await resolveCredential({\n\t\t...(global.apiKey ? { apiKey: global.apiKey } : {}),\n\t\tenv: context.env,\n\t\tstore,\n\t});\n\treturn {\n\t\tstore,\n\t\tclient: (options.client ??\n\t\t\tcontext.createClient(credential?.apiKey)) as TClient,\n\t\t...(global.apiKey ? { apiKey: global.apiKey } : {}),\n\t\tenv: context.env,\n\t\tstdout: context.stdout,\n\t\tstderr: context.stderr,\n\t\toutputMode: context.output.mode,\n\t};\n}\n\nfunction globalOptions(\n\tprogram: Command,\n\tcommandOptions: { json?: boolean; quiet?: boolean },\n): GlobalOptions {\n\tconst opts = program.opts<GlobalOptions>();\n\treturn {\n\t\t...(opts.apiKey ? { apiKey: opts.apiKey } : {}),\n\t\t...(opts.apiUrl ? { apiUrl: opts.apiUrl } : {}),\n\t\t...(commandOptions.json !== undefined\n\t\t\t? { json: commandOptions.json }\n\t\t\t: opts.json !== undefined\n\t\t\t\t? { json: opts.json }\n\t\t\t\t: {}),\n\t\t...(commandOptions.quiet !== undefined\n\t\t\t? { quiet: commandOptions.quiet }\n\t\t\t: opts.quiet !== undefined\n\t\t\t\t? { quiet: opts.quiet }\n\t\t\t\t: {}),\n\t};\n}\n\nfunction toDropOptions(options: RawCommandOptions): RawDropOptions & {\n\tjson?: boolean;\n\tquiet?: boolean;\n\turl?: boolean;\n\tifRevision?: number;\n\tfromJson?: string;\n\tdryRun?: boolean;\n} {\n\treturn {\n\t\t...(options.slug ? { slug: options.slug } : {}),\n\t\t...(options.title ? { title: options.title } : {}),\n\t\t...(options.visibility === \"public\" || options.visibility === \"unlisted\"\n\t\t\t? { visibility: options.visibility }\n\t\t\t: {}),\n\t\t...(typeof options.password === \"string\"\n\t\t\t? { password: options.password }\n\t\t\t: {}),\n\t\t...(options.password === false || options.noPassword\n\t\t\t? { noPassword: true }\n\t\t\t: {}),\n\t\t...(options.noindex ? { noindex: true } : {}),\n\t\t...(options.index ? { index: true } : {}),\n\t\t...(options.expiresAt ? { expiresAt: options.expiresAt } : {}),\n\t\t...(options.metadata ? { metadata: options.metadata } : {}),\n\t\t...(options.metadataFile ? { metadataFile: options.metadataFile } : {}),\n\t\t...(options.entry ? { entry: options.entry } : {}),\n\t\t...(options.contentType ? { contentType: options.contentType } : {}),\n\t\t...(options.path ? { path: options.path } : {}),\n\t\t...(options.idempotencyKey\n\t\t\t? { idempotencyKey: options.idempotencyKey }\n\t\t\t: {}),\n\t\t...(options.json !== undefined ? { json: options.json } : {}),\n\t\t...(options.quiet !== undefined ? { quiet: options.quiet } : {}),\n\t\t...(options.url !== undefined ? { url: options.url } : {}),\n\t\t...(options.ifRevision !== undefined\n\t\t\t? { ifRevision: options.ifRevision }\n\t\t\t: {}),\n\t\t...(options.fromJson ? { fromJson: options.fromJson } : {}),\n\t\t...(options.dryRun ? { dryRun: options.dryRun } : {}),\n\t};\n}\n\nfunction parseInteger(value: string): number {\n\treturn Number.parseInt(value, 10);\n}\n\nasync function resolveCommandInput(\n\tinput: string,\n\tstdin?: AsyncIterable<string | Uint8Array>,\n): Promise<string> {\n\tif (input !== \"-\") return input;\n\tconst buf = await readStdinBytes(stdin ?? process.stdin);\n\treturn buf.toString(\"utf8\");\n}\n\nasync function resolvePublishInputs(\n\tinputs: string[],\n\tstdin?: AsyncIterable<string | Uint8Array>,\n\tstdinIsTTY?: boolean,\n): Promise<string | undefined> {\n\tif (inputs.length === 0) {\n\t\tif (stdinIsTTY) return undefined;\n\t\tconst buf = await readStdinBytes(stdin ?? process.stdin);\n\t\tif (buf.length === 0) return undefined;\n\t\treturn buf.toString(\"utf8\");\n\t}\n\tif (inputs.length === 1) {\n\t\tif (inputs[0] === \"-\") {\n\t\t\tconst buf = await readStdinBytes(stdin ?? process.stdin);\n\t\t\treturn buf.toString(\"utf8\");\n\t\t}\n\t\treturn inputs[0];\n\t}\n\tconst resolved: string[] = [];\n\tfor (const input of inputs) {\n\t\tif (input === \"-\") {\n\t\t\tconst buf = await readStdinBytes(stdin ?? process.stdin);\n\t\t\tconst tmpPath = `/tmp/.dropthis-stdin-${Date.now()}`;\n\t\t\tconst { writeFile } = await import(\"node:fs/promises\");\n\t\t\tawait writeFile(tmpPath, buf);\n\t\t\tresolved.push(tmpPath);\n\t\t} else {\n\t\t\tresolved.push(input);\n\t\t}\n\t}\n\tconst { mkdtemp, copyFile, stat: fsStat } = await import(\"node:fs/promises\");\n\tconst { join, basename: pathBasename } = await import(\"node:path\");\n\tconst { tmpdir } = await import(\"node:os\");\n\tconst tmpDir = await mkdtemp(join(tmpdir(), \"dropthis-multi-\"));\n\tfor (const filePath of resolved) {\n\t\tconst info = await fsStat(filePath);\n\t\tif (info.isDirectory()) {\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot mix directories with multiple file arguments. Use a single folder instead: dropthis publish ${filePath}`,\n\t\t\t);\n\t\t}\n\t\tconst destName = pathBasename(filePath);\n\t\tawait copyFile(filePath, join(tmpDir, destName));\n\t}\n\treturn tmpDir;\n}\n\nasync function readStdinBytes(\n\tstdin: AsyncIterable<string | Uint8Array>,\n): Promise<Buffer> {\n\tconst chunks: Buffer[] = [];\n\tfor await (const chunk of stdin) {\n\t\tchunks.push(\n\t\t\ttypeof chunk === \"string\" ? Buffer.from(chunk) : Buffer.from(chunk),\n\t\t);\n\t}\n\treturn Buffer.concat(chunks);\n}\n","import type { CredentialStore } from \"./storage.js\";\n\nexport type ResolvedCredential = {\n\tapiKey: string;\n\tsource: \"flag\" | \"env\" | \"storage\";\n\tkeyId?: string;\n\tkeyLast4?: string;\n\taccountId?: string;\n\temail?: string;\n};\n\nexport async function resolveCredential(input: {\n\tapiKey?: string;\n\tenv: Record<string, string | undefined>;\n\tstore: CredentialStore;\n}): Promise<ResolvedCredential | null> {\n\tif (input.apiKey) return { apiKey: input.apiKey, source: \"flag\" };\n\tif (input.env.DROPTHIS_API_KEY) {\n\t\treturn { apiKey: input.env.DROPTHIS_API_KEY, source: \"env\" };\n\t}\n\tconst stored = await input.store.read();\n\tif (!stored) return null;\n\treturn {\n\t\tapiKey: stored.apiKey,\n\t\tsource: \"storage\",\n\t\t...(stored.keyId ? { keyId: stored.keyId } : {}),\n\t\t...(stored.keyLast4 ? { keyLast4: stored.keyLast4 } : {}),\n\t\t...(stored.accountId ? { accountId: stored.accountId } : {}),\n\t\t...(stored.email ? { email: stored.email } : {}),\n\t};\n}\n\nexport function maskKey(apiKey: string): string {\n\treturn apiKey.length <= 8\n\t\t? \"sk_...\"\n\t\t: `${apiKey.slice(0, 3)}...${apiKey.slice(-4)}`;\n}\n","export type OutputMode = \"human\" | \"json\";\nexport type CliErrorCode =\n\t| \"api_error\"\n\t| \"auth_error\"\n\t| \"credential_storage_unavailable\"\n\t| \"generic_error\"\n\t| \"invalid_usage\"\n\t| \"local_input_error\"\n\t| \"network_error\";\n\nexport type Output = {\n\tmode: OutputMode;\n\tquiet: boolean;\n};\n\nexport type ApiErrorDetails = {\n\tcode?: string;\n\tmessage: string;\n\tstatusCode?: number | null;\n\tdetail?: unknown;\n\tparam?: string | null;\n\tcurrentRevision?: number;\n\trequestId?: string | null;\n};\n\nconst UPLOAD_NEXT_ACTIONS: Record<string, string> = {\n\tupload_expired: \"Create a new upload session and retry the publish.\",\n\tupload_already_used:\n\t\t\"Create a new upload session; upload sessions are single-use.\",\n\tupload_verification_failed:\n\t\t\"Re-upload the file bytes and complete the upload again.\",\n\ttoo_many_active_uploads:\n\t\t\"Cancel unused uploads or wait for expired uploads to be cleaned.\",\n\tupload_not_complete: \"Complete the upload session before publishing.\",\n};\n\nexport function createOutput(input: {\n\tjson?: boolean;\n\tquiet?: boolean;\n\tstdoutIsTTY: boolean;\n\tenv: Record<string, string | undefined>;\n}): Output {\n\tconst json =\n\t\tinput.json === true ||\n\t\tinput.quiet === true ||\n\t\tinput.stdoutIsTTY === false ||\n\t\tinput.env.CI === \"true\";\n\treturn { mode: json ? \"json\" : \"human\", quiet: input.quiet === true };\n}\n\nexport function successEnvelope<T>(data: T): { ok: true; data: T } {\n\treturn { ok: true, data };\n}\n\nexport function errorEnvelope(\n\tcode: CliErrorCode,\n\tmessage: string,\n\tnextAction?: string,\n): {\n\tok: false;\n\terror: { code: CliErrorCode; message: string; next_action?: string };\n} {\n\treturn {\n\t\tok: false,\n\t\terror: {\n\t\t\tcode,\n\t\t\tmessage,\n\t\t\t...(nextAction ? { next_action: nextAction } : {}),\n\t\t},\n\t};\n}\n\nexport function apiErrorEnvelope(error: ApiErrorDetails): {\n\tok: false;\n\terror: Record<string, unknown>;\n} {\n\treturn {\n\t\tok: false,\n\t\terror: {\n\t\t\tcode: error.code ?? \"api_error\",\n\t\t\tmessage: error.message,\n\t\t\t...(error.statusCode !== undefined ? { status: error.statusCode } : {}),\n\t\t\t...(typeof error.detail === \"string\" ? { detail: error.detail } : {}),\n\t\t\t...(error.param ? { param: error.param } : {}),\n\t\t\t...(error.currentRevision !== undefined\n\t\t\t\t? { current_revision: error.currentRevision }\n\t\t\t\t: {}),\n\t\t\t...(error.requestId ? { request_id: error.requestId } : {}),\n\t\t\tnext_action: nextActionForApiError(error),\n\t\t},\n\t};\n}\n\nfunction nextActionForApiError(error: ApiErrorDetails): string {\n\tconst uploadNextAction = error.code\n\t\t? UPLOAD_NEXT_ACTIONS[error.code]\n\t\t: undefined;\n\tif (uploadNextAction) return uploadNextAction;\n\tif (error.code === \"revision_conflict\") {\n\t\treturn \"Fetch the drop, merge your changes, and retry with the current revision.\";\n\t}\n\tif (error.statusCode === 401 || error.code === \"missing_api_key\") {\n\t\treturn \"Authenticate with dropthis login or set DROPTHIS_API_KEY.\";\n\t}\n\tif (error.statusCode === 413 || error.code === \"quota_exceeded\") {\n\t\treturn \"Reduce the upload size or upgrade the account limit.\";\n\t}\n\tif (error.statusCode === 422) {\n\t\treturn \"Fix the input shown in the error detail and retry.\";\n\t}\n\tif (\n\t\terror.statusCode !== undefined &&\n\t\terror.statusCode !== null &&\n\t\terror.statusCode >= 500\n\t) {\n\t\treturn \"Retry the request with the same idempotency key, or contact support with the request id.\";\n\t}\n\treturn \"Fix the request or retry after checking the drop state.\";\n}\n\nexport function exitCodeFor(code: CliErrorCode): number {\n\tif (code === \"invalid_usage\") return 2;\n\tif (code === \"auth_error\") return 3;\n\tif (code === \"local_input_error\") return 4;\n\tif (code === \"network_error\") return 5;\n\treturn 1;\n}\n","import { resolveCredential } from \"../auth.js\";\nimport { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: { message: string };\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype AccountClient = {\n\taccount: { get(): Promise<SdkResult<unknown>> };\n};\n\ntype CommandDeps = {\n\tstore: CredentialStore;\n\tclient: AccountClient;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n};\n\nexport async function runAccountGet(\n\t_input: { json?: boolean },\n\tdeps: CommandDeps,\n): Promise<{ exitCode: number }> {\n\tif (\n\t\t(await resolveCredential({ env: deps.env, store: deps.store })) === null\n\t) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"auth_error\") };\n\t}\n\tconst result = await deps.client.account.get();\n\tif (result.error) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"api_error\", result.error.message))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tdeps.stdout(`${JSON.stringify({ ok: true, account: result.data })}\\n`);\n\treturn { exitCode: 0 };\n}\n","import { resolveCredential } from \"../auth.js\";\nimport { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: { message: string };\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype ApiKeysCreateClient = {\n\tapiKeys: {\n\t\tcreate(input: {\n\t\t\tlabel: string;\n\t\t}): Promise<SdkResult<Record<string, unknown>>>;\n\t};\n};\n\ntype ApiKeysListClient = {\n\tapiKeys: {\n\t\tlist(): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype ApiKeysDeleteClient = {\n\tapiKeys: {\n\t\tdelete(\n\t\t\tkeyId: string,\n\t\t): Promise<SdkResult<null>> | SdkResult<null> | undefined;\n\t};\n};\n\ntype CommandDeps<TClient> = {\n\tstore: CredentialStore;\n\tclient: TClient;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n};\n\nexport async function runApiKeysCreate(\n\tinput: { label: string; json?: boolean },\n\tdeps: CommandDeps<ApiKeysCreateClient>,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.apiKeys.create({ label: input.label });\n\tif (result.error) return apiError(deps, result.error.message);\n\tdeps.stdout(`${JSON.stringify({ ok: true, api_key: result.data })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nexport async function runApiKeysList(\n\t_input: { json?: boolean },\n\tdeps: CommandDeps<ApiKeysListClient>,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.apiKeys.list();\n\tif (result.error) return apiError(deps, result.error.message);\n\tdeps.stdout(\n\t\t`${JSON.stringify({ ok: true, api_keys: listItems(result.data) })}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n\nexport async function runApiKeysDelete(\n\tkeyId: string,\n\tinput: { yes?: boolean; json?: boolean; interactive?: boolean },\n\tdeps: CommandDeps<ApiKeysDeleteClient>,\n): Promise<{ exitCode: number }> {\n\tif (!input.yes && input.interactive === false) {\n\t\treturn invalidUsage(deps, \"Pass --yes to delete in non-interactive mode.\");\n\t}\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.apiKeys.delete(keyId);\n\tif (result?.error) return apiError(deps, result.error.message);\n\tdeps.stdout(`${JSON.stringify({ ok: true, deleted: true, id: keyId })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nasync function hasCredential(deps: CommandDeps<unknown>): Promise<boolean> {\n\treturn (\n\t\t(await resolveCredential({ env: deps.env, store: deps.store })) !== null\n\t);\n}\n\nfunction listItems(data: unknown): unknown {\n\tif (data && typeof data === \"object\" && \"data\" in data) {\n\t\treturn (data as { data: unknown }).data;\n\t}\n\tif (data && typeof data === \"object\" && \"apiKeys\" in data) {\n\t\treturn (data as { apiKeys: unknown }).apiKeys;\n\t}\n\treturn data;\n}\n\nfunction authError(deps: Pick<CommandDeps<unknown>, \"stderr\">): {\n\texitCode: number;\n} {\n\tdeps.stderr(\n\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t);\n\treturn { exitCode: exitCodeFor(\"auth_error\") };\n}\n\nfunction apiError(\n\tdeps: Pick<CommandDeps<unknown>, \"stderr\">,\n\tmessage: string,\n): { exitCode: number } {\n\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"api_error\", message))}\\n`);\n\treturn { exitCode: exitCodeFor(\"api_error\") };\n}\n\nfunction invalidUsage(\n\tdeps: Pick<CommandDeps<unknown>, \"stderr\">,\n\tmessage: string,\n): { exitCode: number } {\n\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"invalid_usage\", message))}\\n`);\n\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n}\n","const COMMANDS = [\n\t{\n\t\tname: \"publish\",\n\t\tdescription: \"Publish an input and return a Dropthis URL.\",\n\t\targuments: [\"input\"],\n\t\toptions: [\"--json\", \"--url\", \"--dry-run\", \"--title\", \"--metadata\"],\n\t\texamples: [\n\t\t\t\"dropthis publish ./site --json\",\n\t\t\t\"dropthis publish ./site --url\",\n\t\t\t\"dropthis publish ./dist --dry-run\",\n\t\t],\n\t},\n\t{\n\t\tname: \"update\",\n\t\tdescription: \"Update an existing drop by id.\",\n\t\targuments: [\"target\", \"input\"],\n\t\toptions: [\"--json\", \"--url\", \"--dry-run\", \"--if-revision\"],\n\t\texamples: [\n\t\t\t\"dropthis update drop_abc ./site --json\",\n\t\t\t\"dropthis update drop_abc --title 'New Title' --dry-run\",\n\t\t],\n\t},\n\t{\n\t\tname: \"deployments list <dropId>\",\n\t\tdescription: \"List deployments for a drop.\",\n\t\targuments: [\"dropId\"],\n\t\toptions: [\"--json\", \"--limit\", \"--cursor\"],\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis deployments list drop_abc --json\"],\n\t},\n\t{\n\t\tname: \"deployments get <dropId> <deploymentId>\",\n\t\tdescription: \"Get deployment details for a drop.\",\n\t\targuments: [\"dropId\", \"deploymentId\"],\n\t\toptions: [\"--json\"],\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis deployments get drop_abc dep_abc --json\"],\n\t},\n\t{\n\t\tname: \"drops\",\n\t\tdescription: \"List, inspect, update, and delete drops.\",\n\t\texamples: [\"dropthis drops list --json\"],\n\t},\n\t{\n\t\tname: \"api-keys\",\n\t\tdescription: \"Create, list, and delete API keys.\",\n\t\texamples: [\"dropthis api-keys create --label CI --json\"],\n\t},\n\t{\n\t\tname: \"login\",\n\t\tdescription: \"Authenticate with email OTP and store an API key.\",\n\t\texamples: [\n\t\t\t\"dropthis login verify --email user@example.com --otp 123456 --json\",\n\t\t],\n\t},\n\t{\n\t\tname: \"logout\",\n\t\tdescription: \"Remove stored local credentials.\",\n\t\texamples: [\"dropthis logout --json\"],\n\t},\n\t{\n\t\tname: \"whoami\",\n\t\tdescription: \"Show current auth source and credential metadata.\",\n\t\texamples: [\"dropthis whoami --json\"],\n\t},\n\t{\n\t\tname: \"account\",\n\t\tdescription: \"Get account details.\",\n\t\texamples: [\"dropthis account get --json\"],\n\t},\n\t{\n\t\tname: \"doctor\",\n\t\tdescription: \"Report local CLI diagnostics.\",\n\t\texamples: [\"dropthis doctor --json\"],\n\t},\n\t{\n\t\tname: \"commands\",\n\t\tdescription: \"Print this machine-readable command tree.\",\n\t\texamples: [\"dropthis commands --json\"],\n\t},\n];\n\nexport async function runCommands(\n\t_input: { json?: boolean },\n\tdeps: { stdout: (value: string) => void },\n): Promise<{ exitCode: number }> {\n\tdeps.stdout(\n\t\t`${JSON.stringify({\n\t\t\tok: true,\n\t\t\toutput: \"JSON by default in CI, pipes, non-TTY, --json, or --quiet.\",\n\t\t\tcommands: COMMANDS,\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n","import { resolveCredential } from \"../auth.js\";\nimport { apiErrorEnvelope, errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype ApiError = {\n\tmessage: string;\n\tcode?: string;\n\tstatusCode?: number | null;\n\tdetail?: unknown;\n\tparam?: string | null;\n\trequestId?: string | null;\n};\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| { data: null; error: ApiError; headers?: Record<string, string> };\n\ntype DeploymentsClient = {\n\tdeployments: {\n\t\tlist(\n\t\t\tdropId: string,\n\t\t\tparams?: { limit?: number; cursor?: string },\n\t\t): Promise<SdkResult<unknown>>;\n\t\tget(dropId: string, deploymentId: string): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype Deps = {\n\tstore: CredentialStore;\n\tclient: DeploymentsClient;\n\tapiKey?: string;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n};\n\nexport async function runDeploymentsList(\n\tdropId: string,\n\tinput: { limit?: number; cursor?: string; json?: boolean },\n\tdeps: Deps,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst params = {\n\t\t...(input.limit !== undefined ? { limit: input.limit } : {}),\n\t\t...(input.cursor ? { cursor: input.cursor } : {}),\n\t};\n\tconst result = await deps.client.deployments.list(dropId, params);\n\tif (result.error) {\n\t\tdeps.stderr(`${JSON.stringify(apiErrorEnvelope(result.error))}\\n`);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tdeps.stdout(`${JSON.stringify({ ok: true, ...spreadData(result.data) })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nexport async function runDeploymentsGet(\n\tdropId: string,\n\tdeploymentId: string,\n\t_input: { json?: boolean },\n\tdeps: Deps,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.deployments.get(dropId, deploymentId);\n\tif (result.error) {\n\t\tdeps.stderr(`${JSON.stringify(apiErrorEnvelope(result.error))}\\n`);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tdeps.stdout(`${JSON.stringify({ ok: true, deployment: result.data })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nasync function hasCredential(\n\tdeps: Pick<Deps, \"apiKey\" | \"env\" | \"store\">,\n): Promise<boolean> {\n\treturn (\n\t\t(await resolveCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t})) !== null\n\t);\n}\n\nfunction authError(deps: Pick<Deps, \"stderr\">): { exitCode: number } {\n\tdeps.stderr(\n\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t);\n\treturn { exitCode: exitCodeFor(\"auth_error\") };\n}\n\nfunction spreadData(data: unknown): Record<string, unknown> {\n\treturn data && typeof data === \"object\"\n\t\t? (data as Record<string, unknown>)\n\t\t: { data };\n}\n","import { resolveCredential } from \"../auth.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype CommandDeps = {\n\tstore: CredentialStore;\n\tclient: unknown;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n};\n\nexport async function runDoctor(\n\t_input: { json?: boolean },\n\tdeps: CommandDeps,\n): Promise<{ exitCode: number }> {\n\tconst stored = await deps.store.read();\n\tconst credential = await resolveCredential({\n\t\tenv: deps.env,\n\t\tstore: deps.store,\n\t});\n\tdeps.stdout(\n\t\t`${JSON.stringify({\n\t\t\tok: true,\n\t\t\tversion: \"0.1.0\",\n\t\t\tauth: { source: credential?.source ?? \"missing\" },\n\t\t\tstorage: { backend: stored?.storage ?? \"none\" },\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n","import { readFile } from \"node:fs/promises\";\n\nexport type RawDropOptions = {\n\tslug?: string;\n\ttitle?: string;\n\tvisibility?: \"public\" | \"unlisted\";\n\tpassword?: string;\n\tnoPassword?: boolean;\n\tnoindex?: boolean;\n\tindex?: boolean;\n\texpiresAt?: string;\n\tmetadata?: string;\n\tmetadataFile?: string;\n\tentry?: string;\n\tcontentType?: string;\n\tpath?: string;\n\tidempotencyKey?: string;\n};\n\nexport type ParsedDropOptions = {\n\tslug?: string;\n\ttitle?: string;\n\tvisibility?: \"public\" | \"unlisted\";\n\tpassword?: string | null;\n\tnoindex?: boolean;\n\texpiresAt?: string;\n\tmetadata?: Record<string, unknown>;\n\tentry?: string;\n\tcontentType?: string;\n\tpath?: string;\n\tidempotencyKey?: string;\n};\n\nexport async function parseDropOptions(\n\traw: RawDropOptions,\n): Promise<ParsedDropOptions> {\n\tif (raw.metadata && raw.metadataFile) {\n\t\tthrow new Error(\"Use either --metadata or --metadata-file, not both.\");\n\t}\n\tif (raw.password && raw.noPassword) {\n\t\tthrow new Error(\"Use either --password or --no-password, not both.\");\n\t}\n\tif (raw.noindex && raw.index) {\n\t\tthrow new Error(\"Use either --noindex or --index, not both.\");\n\t}\n\tconst metadata = raw.metadata\n\t\t? parseJsonObject(raw.metadata, \"--metadata\")\n\t\t: raw.metadataFile\n\t\t\t? parseJsonObject(\n\t\t\t\t\tawait readFile(raw.metadataFile, \"utf8\"),\n\t\t\t\t\t\"--metadata-file\",\n\t\t\t\t)\n\t\t\t: undefined;\n\treturn {\n\t\t...(raw.slug ? { slug: raw.slug } : {}),\n\t\t...(raw.title ? { title: raw.title } : {}),\n\t\t...(raw.visibility ? { visibility: raw.visibility } : {}),\n\t\t...(raw.password ? { password: raw.password } : {}),\n\t\t...(raw.noPassword ? { password: null } : {}),\n\t\t...(raw.noindex ? { noindex: true } : {}),\n\t\t...(raw.index ? { noindex: false } : {}),\n\t\t...(raw.expiresAt ? { expiresAt: raw.expiresAt } : {}),\n\t\t...(metadata ? { metadata } : {}),\n\t\t...(raw.entry ? { entry: raw.entry } : {}),\n\t\t...(raw.contentType ? { contentType: raw.contentType } : {}),\n\t\t...(raw.path ? { path: raw.path } : {}),\n\t\t...(raw.idempotencyKey ? { idempotencyKey: raw.idempotencyKey } : {}),\n\t};\n}\n\nfunction parseJsonObject(\n\tvalue: string,\n\tlabel: string,\n): Record<string, unknown> {\n\tconst parsed = JSON.parse(value) as unknown;\n\tif (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n\t\tthrow new Error(`${label} must be a JSON object.`);\n\t}\n\treturn parsed as Record<string, unknown>;\n}\n","import { resolveCredential } from \"../auth.js\";\nimport { parseDropOptions, type RawDropOptions } from \"../options.js\";\nimport { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: { message: string };\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype DropsListClient = {\n\tdrops: {\n\t\tlist(params: {\n\t\t\tlimit?: number;\n\t\t\tcursor?: string;\n\t\t}): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype DropsGetClient = {\n\tdrops: {\n\t\tget(dropId: string): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype DropsUpdateClient = {\n\tdrops: {\n\t\tupdate(\n\t\t\tdropId: string,\n\t\t\tinput: Record<string, unknown>,\n\t\t): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype DropsDeleteClient = {\n\tdrops: {\n\t\tdelete(\n\t\t\tdropId: string,\n\t\t): Promise<SdkResult<null>> | SdkResult<null> | undefined;\n\t};\n};\n\ntype CommandDeps<TClient> = {\n\tstore: CredentialStore;\n\tclient: TClient;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n};\n\nexport async function runDropsList(\n\tinput: { limit?: number; cursor?: string; json?: boolean },\n\tdeps: CommandDeps<DropsListClient>,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst params = {\n\t\t...(input.limit !== undefined ? { limit: input.limit } : {}),\n\t\t...(input.cursor ? { cursor: input.cursor } : {}),\n\t};\n\tconst result = await deps.client.drops.list(params);\n\tif (result.error) return apiError(deps, result.error.message);\n\tdeps.stdout(\n\t\t`${JSON.stringify({ ok: true, drops: listItems(result.data) })}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n\nexport async function runDropsGet(\n\tdropId: string,\n\t_input: { json?: boolean },\n\tdeps: CommandDeps<DropsGetClient>,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.drops.get(dropId);\n\tif (result.error) return apiError(deps, result.error.message);\n\tdeps.stdout(`${JSON.stringify({ ok: true, drop: result.data })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nexport async function runDropsUpdate(\n\tdropId: string,\n\tinput: RawDropOptions & { json?: boolean },\n\tdeps: CommandDeps<DropsUpdateClient>,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\ttry {\n\t\tconst options = await parseDropOptions(input);\n\t\tconst result = await deps.client.drops.update(dropId, options);\n\t\tif (result.error) return apiError(deps, result.error.message);\n\t\tdeps.stdout(`${JSON.stringify({ ok: true, drop: result.data })}\\n`);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\treturn invalidUsage(\n\t\t\tdeps,\n\t\t\terror instanceof Error ? error.message : \"Invalid drop options.\",\n\t\t);\n\t}\n}\n\nexport async function runDropsDelete(\n\tdropId: string,\n\tinput: { yes?: boolean; json?: boolean; interactive?: boolean },\n\tdeps: CommandDeps<DropsDeleteClient>,\n): Promise<{ exitCode: number }> {\n\tif (!input.yes && input.interactive === false) {\n\t\treturn invalidUsage(deps, \"Pass --yes to delete in non-interactive mode.\");\n\t}\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.drops.delete(dropId);\n\tif (result?.error) return apiError(deps, result.error.message);\n\tdeps.stdout(`${JSON.stringify({ ok: true, deleted: true, id: dropId })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nasync function hasCredential(deps: CommandDeps<unknown>): Promise<boolean> {\n\treturn (\n\t\t(await resolveCredential({ env: deps.env, store: deps.store })) !== null\n\t);\n}\n\nfunction listItems(data: unknown): unknown {\n\tif (data && typeof data === \"object\" && \"data\" in data) {\n\t\treturn (data as { data: unknown }).data;\n\t}\n\tif (data && typeof data === \"object\" && \"drops\" in data) {\n\t\treturn (data as { drops: unknown }).drops;\n\t}\n\treturn data;\n}\n\nfunction authError(deps: Pick<CommandDeps<unknown>, \"stderr\">): {\n\texitCode: number;\n} {\n\tdeps.stderr(\n\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t);\n\treturn { exitCode: exitCodeFor(\"auth_error\") };\n}\n\nfunction apiError(\n\tdeps: Pick<CommandDeps<unknown>, \"stderr\">,\n\tmessage: string,\n): { exitCode: number } {\n\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"api_error\", message))}\\n`);\n\treturn { exitCode: exitCodeFor(\"api_error\") };\n}\n\nfunction invalidUsage(\n\tdeps: Pick<CommandDeps<unknown>, \"stderr\">,\n\tmessage: string,\n): { exitCode: number } {\n\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"invalid_usage\", message))}\\n`);\n\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n}\n","import { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: { message: string };\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype OtpRequestData = {\n\tok: true;\n\texpiresIn: number;\n};\n\ntype SessionData = {\n\ttoken: string;\n\taccountId: string;\n\tisNewAccount: boolean;\n};\n\ntype ApiKeyData = {\n\tid: string;\n\tkey: string;\n\tkeyLast4: string;\n\taccountId?: string | null;\n\tisNewAccount?: boolean;\n};\n\ntype LoginRequestClient = {\n\tauth: {\n\t\trequestEmailOtp(input: {\n\t\t\temail: string;\n\t\t}): Promise<SdkResult<OtpRequestData>>;\n\t};\n};\n\ntype LoginClient = {\n\tauth: {\n\t\tverifyEmailOtp(input: {\n\t\t\temail: string;\n\t\t\tcode: string;\n\t\t}): Promise<SdkResult<SessionData>>;\n\t};\n\tapiKeys: {\n\t\tcreate(input: { label: string }): Promise<SdkResult<ApiKeyData>>;\n\t};\n};\n\nexport async function runLoginRequest(\n\tinput: { email: string; json?: boolean },\n\tdeps: {\n\t\tclient: LoginRequestClient;\n\t\tstdout: (value: string) => void;\n\t\tstderr: (value: string) => void;\n\t},\n): Promise<{ exitCode: number }> {\n\tconst result = await deps.client.auth.requestEmailOtp({\n\t\temail: input.email,\n\t});\n\tif (result.error) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"api_error\", result.error.message))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tdeps.stdout(\n\t\t`${JSON.stringify({\n\t\t\tok: true,\n\t\t\temail: input.email,\n\t\t\texpires_in: result.data.expiresIn,\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n\nexport async function runLoginVerify(\n\tinput: { email: string; otp: string; json?: boolean },\n\tdeps: {\n\t\tclient: LoginClient;\n\t\tstore: CredentialStore;\n\t\tstdout: (value: string) => void;\n\t\tstderr: (value: string) => void;\n\t},\n): Promise<{ exitCode: number }> {\n\tconst session = await deps.client.auth.verifyEmailOtp({\n\t\temail: input.email,\n\t\tcode: input.otp,\n\t});\n\tif (session.error) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"api_error\", session.error.message))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tconst apiKey = await deps.client.apiKeys.create({ label: \"CLI\" });\n\tif (apiKey.error) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"api_error\", apiKey.error.message))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tawait deps.store.save({\n\t\tapiKey: apiKey.data.key,\n\t\tkeyId: apiKey.data.id,\n\t\tkeyLast4: apiKey.data.keyLast4,\n\t\taccountId: apiKey.data.accountId ?? session.data.accountId,\n\t\temail: input.email,\n\t\tstorage: \"secure\",\n\t});\n\tdeps.stdout(\n\t\t`${JSON.stringify({\n\t\t\tok: true,\n\t\t\taccount_id: apiKey.data.accountId ?? session.data.accountId,\n\t\t\tkey_id: apiKey.data.id,\n\t\t\tkey_last4: apiKey.data.keyLast4,\n\t\t\tis_new_account: apiKey.data.isNewAccount ?? session.data.isNewAccount,\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n","import { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype DeleteResult =\n\t| { data: null; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: { message: string };\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype LogoutClient = {\n\tapiKeys: {\n\t\tdelete(\n\t\t\tkeyId: string,\n\t\t): DeleteResult | Promise<DeleteResult> | undefined | Promise<undefined>;\n\t};\n};\n\nexport async function runLogout(\n\tinput: { json?: boolean; revoke?: boolean },\n\tdeps: {\n\t\tstore: CredentialStore;\n\t\tclient: LogoutClient;\n\t\tstdout: (value: string) => void;\n\t\tstderr: (value: string) => void;\n\t},\n): Promise<{ exitCode: number }> {\n\tconst stored = await deps.store.read();\n\tlet revokeError: string | undefined;\n\tif (input.revoke && stored?.keyId) {\n\t\tconst result = await deps.client.apiKeys.delete(stored.keyId);\n\t\tif (result?.error) revokeError = result.error.message;\n\t}\n\tawait deps.store.clear();\n\tif (revokeError) {\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"api_error\", revokeError))}\\n`);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tdeps.stdout(`${JSON.stringify({ ok: true })}\\n`);\n\treturn { exitCode: 0 };\n}\n","import { randomUUID } from \"node:crypto\";\nimport { stat } from \"node:fs/promises\";\nimport { basename, extname } from \"node:path\";\nimport { resolveCredential } from \"../auth.js\";\nimport {\n\ttype ParsedDropOptions,\n\tparseDropOptions,\n\ttype RawDropOptions,\n} from \"../options.js\";\nimport {\n\ttype ApiErrorDetails,\n\tapiErrorEnvelope,\n\terrorEnvelope,\n\texitCodeFor,\n} from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport { readJsonObjectFile } from \"./json_body.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: ApiErrorDetails;\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype DropData = { url: string; [key: string]: unknown };\n\ntype ManifestFile = {\n\tpath: string;\n\tcontentType: string;\n\tsizeBytes: number;\n};\n\ntype PreparedResult =\n\t| { kind: \"json\"; body: Record<string, unknown> }\n\t| {\n\t\t\tkind: \"staged\";\n\t\t\tmanifest: { files: ManifestFile[]; entry?: string | null };\n\t\t\toptions: Record<string, unknown>;\n\t\t\tmetadata?: Record<string, unknown>;\n\t };\n\ntype PublishClient = {\n\tpublish(\n\t\tinput: string,\n\t\toptions: ParsedDropOptions,\n\t): Promise<SdkResult<DropData>>;\n\tprepare?(input: string, options: ParsedDropOptions): Promise<PreparedResult>;\n\tdrops: {\n\t\tcreateRaw(\n\t\t\tbody: unknown,\n\t\t\toptions?: { idempotencyKey?: string },\n\t\t): Promise<SdkResult<DropData>>;\n\t};\n};\n\ntype PublishOptions = RawDropOptions & {\n\tdryRun?: boolean;\n\tfromJson?: string;\n\tjson?: boolean;\n\tquiet?: boolean;\n\turl?: boolean;\n\tapiKey?: string;\n};\n\ntype PublishDeps = {\n\tstore: CredentialStore;\n\tclient: PublishClient;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\treadJsonObject?: (path: string) => Promise<Record<string, unknown>>;\n\toutputMode?: \"human\" | \"json\";\n};\n\nconst MAX_BUNDLE_FILE_COUNT = 200;\n\nexport async function runPublish(\n\tinput: string | string[] | undefined,\n\traw: PublishOptions,\n\tdeps: PublishDeps,\n): Promise<{ exitCode: number }> {\n\tconst credential = await resolveCredential({\n\t\t...(raw.apiKey ? { apiKey: raw.apiKey } : {}),\n\t\tenv: deps.env,\n\t\tstore: deps.store,\n\t});\n\tif (!credential) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"auth_error\") };\n\t}\n\n\tif (raw.dryRun) {\n\t\treturn handlePublishDryRun(input, raw, deps);\n\t}\n\n\tconst singleInput = Array.isArray(input) ? input[0] : input;\n\ttry {\n\t\tif (raw.fromJson && singleInput) {\n\t\t\tthrow new Error(\"Use either <input> or --from-json, not both.\");\n\t\t}\n\t\tconst options = withPublishIdempotency(await parseDropOptions(raw));\n\t\tconst result = raw.fromJson\n\t\t\t? await deps.client.drops.createRaw(\n\t\t\t\t\tawait (deps.readJsonObject ?? readJsonObjectFile)(raw.fromJson),\n\t\t\t\t\toptions.idempotencyKey\n\t\t\t\t\t\t? { idempotencyKey: options.idempotencyKey }\n\t\t\t\t\t\t: {},\n\t\t\t\t)\n\t\t\t: singleInput\n\t\t\t\t? await deps.client.publish(singleInput, options)\n\t\t\t\t: (() => {\n\t\t\t\t\t\tthrow new Error(\"Publish requires <input> or --from-json.\");\n\t\t\t\t\t})();\n\t\tif (result.error) {\n\t\t\tdeps.stderr(`${JSON.stringify(apiErrorEnvelope(result.error))}\\n`);\n\t\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t\t}\n\t\tif (raw.url) deps.stdout(`${result.data.url}\\n`);\n\t\telse if (deps.outputMode === \"human\")\n\t\t\tdeps.stdout(`Published: ${result.data.url}\\n`);\n\t\telse deps.stdout(`${JSON.stringify({ ok: true, drop: result.data })}\\n`);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"Publish failed.\";\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"invalid_usage\", message))}\\n`);\n\t\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n\t}\n}\n\nasync function handlePublishDryRun(\n\tinput: string | string[] | undefined,\n\traw: PublishOptions,\n\tdeps: PublishDeps,\n): Promise<{ exitCode: number }> {\n\tif (raw.url) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"invalid_usage\", \"--url and --dry-run cannot be combined.\", \"Remove --url; dry-run outputs JSON describing what would be published.\"))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n\t}\n\ttry {\n\t\tif (raw.fromJson) {\n\t\t\tif (input)\n\t\t\t\tthrow new Error(\"Use either <input> or --from-json, not both.\");\n\t\t\tconst body = await (deps.readJsonObject ?? readJsonObjectFile)(\n\t\t\t\traw.fromJson,\n\t\t\t);\n\t\t\tdeps.stdout(\n\t\t\t\t`${JSON.stringify({ dryRun: true, kind: \"raw_json\", endpoint: \"POST /drops\", body }, null, 2)}\\n`,\n\t\t\t);\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\n\t\tif (!input || (Array.isArray(input) && input.length === 0)) {\n\t\t\tthrow new Error(\"Publish requires <input> or --from-json.\");\n\t\t}\n\n\t\tconst options = await parseDropOptions(raw);\n\n\t\tif (Array.isArray(input)) {\n\t\t\treturn dryRunMultiFile(input, options, deps);\n\t\t}\n\n\t\tif (!deps.client.prepare) {\n\t\t\tthrow new Error(\"Client does not support dry-run.\");\n\t\t}\n\t\tconst prepared = await deps.client.prepare(input, options);\n\t\tconst output = formatDryRunOutput(prepared);\n\t\tvalidateDryRunOutput(output);\n\t\twarnInlineSize(output, deps);\n\t\tdeps.stdout(`${JSON.stringify(output, null, 2)}\\n`);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst code = isFileSystemError(error)\n\t\t\t? \"local_input_error\"\n\t\t\t: \"invalid_usage\";\n\t\tconst message = error instanceof Error ? error.message : \"Dry-run failed.\";\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(code, message))}\\n`);\n\t\treturn { exitCode: exitCodeFor(code) };\n\t}\n}\n\nasync function dryRunMultiFile(\n\tinputs: string[],\n\toptions: ParsedDropOptions,\n\tdeps: PublishDeps,\n): Promise<{ exitCode: number }> {\n\tconst files: ManifestFile[] = [];\n\tfor (const filePath of inputs) {\n\t\tlet info: Awaited<ReturnType<typeof stat>>;\n\t\ttry {\n\t\t\tinfo = await stat(filePath);\n\t\t} catch {\n\t\t\tdeps.stderr(\n\t\t\t\t`${JSON.stringify(errorEnvelope(\"local_input_error\", `File not found: ${filePath}`))}\\n`,\n\t\t\t);\n\t\t\treturn { exitCode: exitCodeFor(\"local_input_error\") };\n\t\t}\n\t\tif (info.isDirectory()) {\n\t\t\tdeps.stderr(\n\t\t\t\t`${JSON.stringify(errorEnvelope(\"local_input_error\", `Cannot mix directories with multiple file arguments. Use a single folder instead: dropthis publish ${filePath}`))}\\n`,\n\t\t\t);\n\t\t\treturn { exitCode: exitCodeFor(\"local_input_error\") };\n\t\t}\n\t\tfiles.push({\n\t\t\tpath: basename(filePath),\n\t\t\tcontentType: mimeForPath(filePath),\n\t\t\tsizeBytes: info.size,\n\t\t});\n\t}\n\n\tif (files.length > MAX_BUNDLE_FILE_COUNT) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"local_input_error\", `Bundle contains ${files.length} files, exceeding the maximum of ${MAX_BUNDLE_FILE_COUNT}.`))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"local_input_error\") };\n\t}\n\n\tconst entry =\n\t\toptions.entry ??\n\t\tfiles.find((f) => f.path === \"index.html\")?.path ??\n\t\tfiles[0]?.path ??\n\t\tnull;\n\tconst totalBytes = files.reduce((sum, f) => sum + f.sizeBytes, 0);\n\tconst output = {\n\t\tdryRun: true as const,\n\t\tkind: \"staged\" as const,\n\t\tmanifest: { files, entry },\n\t\toptions: dryRunOptionsBody(options),\n\t\ttotalBytes,\n\t};\n\n\tdeps.stdout(`${JSON.stringify(output, null, 2)}\\n`);\n\treturn { exitCode: 0 };\n}\n\nconst MAX_INLINE_CONTENT_BYTES = 1_048_576;\n\nfunction formatDryRunOutput(prepared: PreparedResult): Record<string, unknown> {\n\tif (prepared.kind === \"json\") {\n\t\treturn { dryRun: true, kind: \"json\", body: prepared.body };\n\t}\n\tconst totalBytes = prepared.manifest.files.reduce(\n\t\t(sum, f) => sum + f.sizeBytes,\n\t\t0,\n\t);\n\treturn {\n\t\tdryRun: true,\n\t\tkind: \"staged\",\n\t\tmanifest: {\n\t\t\tfiles: prepared.manifest.files,\n\t\t\tentry: prepared.manifest.entry ?? null,\n\t\t},\n\t\toptions: prepared.options,\n\t\t...(prepared.metadata ? { metadata: prepared.metadata } : {}),\n\t\ttotalBytes,\n\t};\n}\n\nfunction warnInlineSize(\n\toutput: Record<string, unknown>,\n\tdeps: PublishDeps,\n): void {\n\tif (output.kind !== \"json\") return;\n\tconst body = output.body as Record<string, unknown>;\n\tconst content = body?.content;\n\tif (typeof content !== \"string\") return;\n\tconst sizeBytes = Buffer.byteLength(content);\n\tif (sizeBytes > MAX_INLINE_CONTENT_BYTES) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify({ warning: `Inline content is ${sizeBytes} bytes, exceeding the ${MAX_INLINE_CONTENT_BYTES} byte threshold. The server will use staged upload.` })}\\n`,\n\t\t);\n\t}\n}\n\nfunction validateDryRunOutput(output: Record<string, unknown>): void {\n\tif (output.kind !== \"staged\") return;\n\tconst manifest = output.manifest as {\n\t\tfiles: ManifestFile[];\n\t};\n\tif (manifest.files.length > MAX_BUNDLE_FILE_COUNT) {\n\t\tthrow Object.assign(\n\t\t\tnew Error(\n\t\t\t\t`Bundle contains ${manifest.files.length} files, exceeding the maximum of ${MAX_BUNDLE_FILE_COUNT}.`,\n\t\t\t),\n\t\t\t{ code: \"ELIMIT\" },\n\t\t);\n\t}\n}\n\nfunction dryRunOptionsBody(\n\toptions: ParsedDropOptions,\n): Record<string, unknown> {\n\tconst result: Record<string, unknown> = {};\n\tif (options.title) result.title = options.title;\n\tif (options.visibility) result.visibility = options.visibility;\n\tif (options.password !== undefined) result.password = options.password;\n\tif (options.noindex !== undefined) result.noindex = options.noindex;\n\tif (options.expiresAt) result.expires_at = options.expiresAt;\n\treturn result;\n}\n\nfunction mimeForPath(filePath: string): string {\n\tconst ext = extname(filePath).toLowerCase();\n\tconst types: Record<string, string> = {\n\t\t\".html\": \"text/html\",\n\t\t\".htm\": \"text/html\",\n\t\t\".css\": \"text/css\",\n\t\t\".js\": \"text/javascript\",\n\t\t\".mjs\": \"text/javascript\",\n\t\t\".json\": \"application/json\",\n\t\t\".xml\": \"application/xml\",\n\t\t\".svg\": \"image/svg+xml\",\n\t\t\".txt\": \"text/plain\",\n\t\t\".md\": \"text/markdown\",\n\t\t\".jpg\": \"image/jpeg\",\n\t\t\".jpeg\": \"image/jpeg\",\n\t\t\".png\": \"image/png\",\n\t\t\".gif\": \"image/gif\",\n\t\t\".webp\": \"image/webp\",\n\t\t\".ico\": \"image/x-icon\",\n\t\t\".avif\": \"image/avif\",\n\t\t\".pdf\": \"application/pdf\",\n\t\t\".zip\": \"application/zip\",\n\t\t\".woff\": \"font/woff\",\n\t\t\".woff2\": \"font/woff2\",\n\t\t\".ttf\": \"font/ttf\",\n\t\t\".mp4\": \"video/mp4\",\n\t\t\".webm\": \"video/webm\",\n\t};\n\treturn types[ext] ?? \"application/octet-stream\";\n}\n\nfunction isFileSystemError(error: unknown): boolean {\n\tif (!(error instanceof Error)) return false;\n\tconst code = (error as NodeJS.ErrnoException).code;\n\treturn code === \"ENOENT\" || code === \"ENOTDIR\" || code === \"ELIMIT\";\n}\n\nfunction withPublishIdempotency(options: ParsedDropOptions): ParsedDropOptions {\n\treturn options.idempotencyKey\n\t\t? options\n\t\t: { ...options, idempotencyKey: `cli_pub_${randomUUID()}` };\n}\n","import { readFile } from \"node:fs/promises\";\n\nexport async function readJsonObjectFile(\n\tpath: string,\n): Promise<Record<string, unknown>> {\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(await readFile(path, \"utf8\"));\n\t} catch (error) {\n\t\tconst message =\n\t\t\terror instanceof Error ? error.message : \"Unknown parse error\";\n\t\tthrow new Error(`Invalid JSON body in ${path}: ${message}`);\n\t}\n\tif (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n\t\tthrow new Error(\"JSON body must be an object.\");\n\t}\n\treturn parsed as Record<string, unknown>;\n}\n","import { randomUUID } from \"node:crypto\";\nimport { resolveCredential } from \"../auth.js\";\nimport {\n\ttype ParsedDropOptions,\n\tparseDropOptions,\n\ttype RawDropOptions,\n} from \"../options.js\";\nimport {\n\ttype ApiErrorDetails,\n\tapiErrorEnvelope,\n\terrorEnvelope,\n\texitCodeFor,\n} from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport { readJsonObjectFile } from \"./json_body.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| { data: null; error: ApiErrorDetails; headers?: Record<string, string> };\n\ntype DropData = { url: string; [key: string]: unknown };\ntype UpdateOptions = ParsedDropOptions & { ifRevision?: number };\n\ntype ManifestFile = {\n\tpath: string;\n\tcontentType: string;\n\tsizeBytes: number;\n};\n\ntype PreparedResult =\n\t| { kind: \"json\"; body: Record<string, unknown> }\n\t| {\n\t\t\tkind: \"staged\";\n\t\t\tmanifest: { files: ManifestFile[]; entry?: string | null };\n\t\t\toptions: Record<string, unknown>;\n\t\t\tmetadata?: Record<string, unknown>;\n\t };\n\ntype UpdateClient = {\n\tupdate(\n\t\ttarget: string,\n\t\tinputOrOptions: string | UpdateOptions,\n\t\toptions?: UpdateOptions,\n\t): Promise<SdkResult<DropData>>;\n\tprepare?(input: string, options: ParsedDropOptions): Promise<PreparedResult>;\n\tdeployments: {\n\t\tcreateRaw(\n\t\t\tdropId: string,\n\t\t\tbody: unknown,\n\t\t\toptions?: { idempotencyKey?: string; ifRevision?: number },\n\t\t): Promise<SdkResult<DropData>>;\n\t};\n};\n\ntype RawUpdateOptions = RawDropOptions & {\n\tdryRun?: boolean;\n\tifRevision?: number;\n\tfromJson?: string;\n\tjson?: boolean;\n\tquiet?: boolean;\n\turl?: boolean;\n\tapiKey?: string;\n};\n\ntype UpdateDeps = {\n\tstore: CredentialStore;\n\tclient: UpdateClient;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\treadJsonObject?: (path: string) => Promise<Record<string, unknown>>;\n\toutputMode?: \"human\" | \"json\";\n};\n\nexport async function runUpdate(\n\ttarget: string,\n\tinput: string | undefined,\n\traw: RawUpdateOptions,\n\tdeps: UpdateDeps,\n): Promise<{ exitCode: number }> {\n\tconst credential = await resolveCredential({\n\t\t...(raw.apiKey ? { apiKey: raw.apiKey } : {}),\n\t\tenv: deps.env,\n\t\tstore: deps.store,\n\t});\n\tif (!credential) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"auth_error\") };\n\t}\n\n\tif (raw.dryRun) {\n\t\treturn handleUpdateDryRun(target, input, raw, deps);\n\t}\n\n\ttry {\n\t\tassertDropId(target);\n\t\tif (raw.fromJson && input) {\n\t\t\tthrow new Error(\"Use either [input] or --from-json, not both.\");\n\t\t}\n\t\tconst parsed = await parseDropOptions(raw);\n\t\tconst revisionOptions =\n\t\t\traw.ifRevision !== undefined\n\t\t\t\t? { ifRevision: Number(raw.ifRevision) }\n\t\t\t\t: {};\n\t\tconst result = raw.fromJson\n\t\t\t? await deps.client.deployments.createRaw(\n\t\t\t\t\ttarget,\n\t\t\t\t\tawait (deps.readJsonObject ?? readJsonObjectFile)(raw.fromJson),\n\t\t\t\t\twithUpdateIdempotency({\n\t\t\t\t\t\t...revisionOptions,\n\t\t\t\t\t\t...(parsed.idempotencyKey\n\t\t\t\t\t\t\t? { idempotencyKey: parsed.idempotencyKey }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t: input\n\t\t\t\t? await deps.client.update(\n\t\t\t\t\t\ttarget,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\twithUpdateIdempotency({\n\t\t\t\t\t\t\t...parsed,\n\t\t\t\t\t\t\t...revisionOptions,\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t: await deps.client.update(target, parsed, revisionOptions);\n\t\tif (result.error) {\n\t\t\tdeps.stderr(`${JSON.stringify(apiErrorEnvelope(result.error))}\\n`);\n\t\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t\t}\n\t\tif (raw.url) deps.stdout(`${result.data.url}\\n`);\n\t\telse if (deps.outputMode === \"human\")\n\t\t\tdeps.stdout(`Updated: ${result.data.url}\\n`);\n\t\telse deps.stdout(`${JSON.stringify({ ok: true, drop: result.data })}\\n`);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"Update failed.\";\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"invalid_usage\", message))}\\n`);\n\t\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n\t}\n}\n\nasync function handleUpdateDryRun(\n\ttarget: string,\n\tinput: string | undefined,\n\traw: RawUpdateOptions,\n\tdeps: UpdateDeps,\n): Promise<{ exitCode: number }> {\n\tif (raw.url) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"invalid_usage\", \"--url and --dry-run cannot be combined.\", \"Remove --url; dry-run outputs JSON describing what would be published.\"))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n\t}\n\ttry {\n\t\tassertDropId(target);\n\n\t\tif (raw.fromJson) {\n\t\t\tif (input)\n\t\t\t\tthrow new Error(\"Use either [input] or --from-json, not both.\");\n\t\t\tconst body = await (deps.readJsonObject ?? readJsonObjectFile)(\n\t\t\t\traw.fromJson,\n\t\t\t);\n\t\t\tdeps.stdout(\n\t\t\t\t`${JSON.stringify({ dryRun: true, kind: \"raw_json\", endpoint: `POST /drops/${target}/deployments`, body }, null, 2)}\\n`,\n\t\t\t);\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\n\t\tconst options = await parseDropOptions(raw);\n\n\t\tif (!input) {\n\t\t\tconst fields: Record<string, unknown> = {};\n\t\t\tif (options.slug) fields.slug = options.slug;\n\t\t\tif (options.title) fields.title = options.title;\n\t\t\tif (options.visibility) fields.visibility = options.visibility;\n\t\t\tif (options.password !== undefined) fields.password = options.password;\n\t\t\tif (options.noindex !== undefined) fields.noindex = options.noindex;\n\t\t\tif (options.expiresAt) fields.expires_at = options.expiresAt;\n\t\t\tif (options.metadata) fields.metadata = options.metadata;\n\t\t\tdeps.stdout(\n\t\t\t\t`${JSON.stringify({ dryRun: true, kind: \"options_update\", target, fields }, null, 2)}\\n`,\n\t\t\t);\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\n\t\tif (!deps.client.prepare) {\n\t\t\tthrow new Error(\"Client does not support dry-run.\");\n\t\t}\n\t\tconst prepared = await deps.client.prepare(input, options);\n\t\tconst output = formatUpdateDryRun(target, prepared);\n\t\tvalidateDryRunFileCount(output);\n\t\tdeps.stdout(`${JSON.stringify(output, null, 2)}\\n`);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst code = isFileSystemError(error)\n\t\t\t? \"local_input_error\"\n\t\t\t: \"invalid_usage\";\n\t\tconst message = error instanceof Error ? error.message : \"Dry-run failed.\";\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(code, message))}\\n`);\n\t\treturn { exitCode: exitCodeFor(code) };\n\t}\n}\n\nconst MAX_BUNDLE_FILE_COUNT = 200;\n\nfunction formatUpdateDryRun(\n\ttarget: string,\n\tprepared: PreparedResult,\n): Record<string, unknown> {\n\tif (prepared.kind === \"json\") {\n\t\treturn { dryRun: true, kind: \"json\", target, body: prepared.body };\n\t}\n\tconst totalBytes = prepared.manifest.files.reduce(\n\t\t(sum, f) => sum + f.sizeBytes,\n\t\t0,\n\t);\n\treturn {\n\t\tdryRun: true,\n\t\tkind: \"staged\",\n\t\ttarget,\n\t\tmanifest: {\n\t\t\tfiles: prepared.manifest.files,\n\t\t\tentry: prepared.manifest.entry ?? null,\n\t\t},\n\t\toptions: prepared.options,\n\t\t...(prepared.metadata ? { metadata: prepared.metadata } : {}),\n\t\ttotalBytes,\n\t};\n}\n\nfunction validateDryRunFileCount(output: Record<string, unknown>): void {\n\tif (output.kind !== \"staged\") return;\n\tconst manifest = output.manifest as { files: ManifestFile[] };\n\tif (manifest.files.length > MAX_BUNDLE_FILE_COUNT) {\n\t\tthrow Object.assign(\n\t\t\tnew Error(\n\t\t\t\t`Bundle contains ${manifest.files.length} files, exceeding the maximum of ${MAX_BUNDLE_FILE_COUNT}.`,\n\t\t\t),\n\t\t\t{ code: \"ELIMIT\" },\n\t\t);\n\t}\n}\n\nfunction isFileSystemError(error: unknown): boolean {\n\tif (!(error instanceof Error)) return false;\n\tconst code = (error as NodeJS.ErrnoException).code;\n\treturn code === \"ENOENT\" || code === \"ENOTDIR\";\n}\n\nfunction withUpdateIdempotency(options: UpdateOptions): UpdateOptions {\n\treturn options.idempotencyKey\n\t\t? options\n\t\t: { ...options, idempotencyKey: `cli_upd_${randomUUID()}` };\n}\n\nfunction assertDropId(target: string): void {\n\tif (!target.startsWith(\"drop_\")) {\n\t\tthrow new Error(\n\t\t\t\"Update target must be a drop id returned by --json output, for example drop_...\",\n\t\t);\n\t}\n}\n","import { maskKey, resolveCredential } from \"../auth.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\nexport async function runWhoami(\n\t_input: { json?: boolean },\n\tdeps: {\n\t\tstore: CredentialStore;\n\t\tenv: Record<string, string | undefined>;\n\t\tstdout: (value: string) => void;\n\t\tstderr: (value: string) => void;\n\t},\n): Promise<{ exitCode: number }> {\n\tconst credential = await resolveCredential({\n\t\tenv: deps.env,\n\t\tstore: deps.store,\n\t});\n\tif (!credential) {\n\t\tdeps.stdout(`${JSON.stringify({ ok: true, authenticated: false })}\\n`);\n\t\treturn { exitCode: 0 };\n\t}\n\tdeps.stdout(\n\t\t`${JSON.stringify({\n\t\t\tok: true,\n\t\t\tauthenticated: true,\n\t\t\tsource: credential.source,\n\t\t\tmasked_key: maskKey(credential.apiKey),\n\t\t\t...(credential.keyId ? { key_id: credential.keyId } : {}),\n\t\t\t...(credential.keyLast4 ? { key_last4: credential.keyLast4 } : {}),\n\t\t\t...(credential.accountId ? { account_id: credential.accountId } : {}),\n\t\t\t...(credential.email ? { email: credential.email } : {}),\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n","import { Dropthis } from \"@dropthis/sdk\";\nimport { createOutput, type Output } from \"./output.js\";\n\nexport type GlobalOptions = {\n\tapiKey?: string;\n\tapiUrl?: string;\n\tjson?: boolean;\n\tquiet?: boolean;\n};\n\nexport type CliContext = {\n\tenv: Record<string, string | undefined>;\n\tglobal: GlobalOptions;\n\toutput: Output;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\tcreateClient: (apiKey?: string) => Dropthis;\n};\n\nexport function createContext(input: {\n\tglobal?: GlobalOptions;\n\tenv?: Record<string, string | undefined>;\n\tstdout?: (value: string) => void;\n\tstderr?: (value: string) => void;\n\tstdoutIsTTY?: boolean;\n}): CliContext {\n\tconst env = input.env ?? process.env;\n\tconst global = input.global ?? {};\n\treturn {\n\t\tenv,\n\t\tglobal,\n\t\toutput: createOutput({\n\t\t\t...(global.json !== undefined ? { json: global.json } : {}),\n\t\t\t...(global.quiet !== undefined ? { quiet: global.quiet } : {}),\n\t\t\tstdoutIsTTY: input.stdoutIsTTY ?? process.stdout.isTTY === true,\n\t\t\tenv,\n\t\t}),\n\t\tstdout: input.stdout ?? ((value) => process.stdout.write(value)),\n\t\tstderr: input.stderr ?? ((value) => process.stderr.write(value)),\n\t\tcreateClient(apiKey) {\n\t\t\tconst baseUrl = global.apiUrl ?? env.DROPTHIS_API_URL;\n\t\t\treturn new Dropthis({\n\t\t\t\t...(apiKey ? { apiKey } : {}),\n\t\t\t\t...(baseUrl ? { baseUrl } : {}),\n\t\t\t});\n\t\t},\n\t};\n}\n","import { chmod, mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\nimport { Entry } from \"@napi-rs/keyring\";\n\nexport type StoredCredential = {\n\tapiKey: string;\n\tkeyId?: string;\n\tkeyLast4?: string;\n\taccountId?: string;\n\temail?: string;\n\tstorage: \"secure\" | \"insecure\";\n};\n\nexport interface CredentialStore {\n\tread(): Promise<StoredCredential | null>;\n\tsave(credential: StoredCredential): Promise<void>;\n\tclear(): Promise<void>;\n}\n\nexport type KeyringAdapter = {\n\tgetPassword(): string | null | undefined | Promise<string | null | undefined>;\n\tsetPassword(value: string): void | Promise<void>;\n\tdeletePassword(): void | Promise<void>;\n};\n\nexport class MemoryCredentialStore implements CredentialStore {\n\tprivate credential: StoredCredential | null = null;\n\n\tasync read(): Promise<StoredCredential | null> {\n\t\treturn this.credential;\n\t}\n\n\tasync save(credential: StoredCredential): Promise<void> {\n\t\tthis.credential = credential;\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tthis.credential = null;\n\t}\n}\n\nexport class InsecureFileCredentialStore implements CredentialStore {\n\tprivate readonly filePath: string;\n\n\tconstructor(options: { configDir?: string } = {}) {\n\t\tthis.filePath = credentialPath(options.configDir);\n\t}\n\n\tasync read(): Promise<StoredCredential | null> {\n\t\tconst value = await readJsonFile(this.filePath);\n\t\treturn value\n\t\t\t? ({ ...value, storage: \"insecure\" } as StoredCredential)\n\t\t\t: null;\n\t}\n\n\tasync save(credential: StoredCredential): Promise<void> {\n\t\tawait writeCredentialFile(this.filePath, {\n\t\t\t...credential,\n\t\t\tstorage: \"insecure\",\n\t\t});\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tawait rm(this.filePath, { force: true });\n\t}\n}\n\nexport class KeyringCredentialStore implements CredentialStore {\n\tprivate readonly filePath: string;\n\tprivate readonly keyring: KeyringAdapter;\n\n\tconstructor(options: { configDir?: string; keyring?: KeyringAdapter } = {}) {\n\t\tthis.filePath = credentialPath(options.configDir);\n\t\tthis.keyring = options.keyring ?? defaultKeyringAdapter();\n\t}\n\n\tasync read(): Promise<StoredCredential | null> {\n\t\tconst metadata = await readJsonFile(this.filePath);\n\t\tif (!metadata) return null;\n\t\tconst apiKey = await this.keyring.getPassword();\n\t\tif (!apiKey) return null;\n\t\treturn { ...metadata, apiKey, storage: \"secure\" } as StoredCredential;\n\t}\n\n\tasync save(credential: StoredCredential): Promise<void> {\n\t\tawait this.keyring.setPassword(credential.apiKey);\n\t\tconst { apiKey: _apiKey, ...metadata } = credential;\n\t\tawait writeCredentialFile(this.filePath, {\n\t\t\t...metadata,\n\t\t\tstorage: \"secure\",\n\t\t});\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tawait this.keyring.deletePassword();\n\t\tawait rm(this.filePath, { force: true });\n\t}\n}\n\nexport function createCredentialStore(\n\toptions: { insecure?: boolean; configDir?: string } = {},\n): CredentialStore {\n\tif (options.insecure) return new InsecureFileCredentialStore(options);\n\treturn new KeyringCredentialStore(options);\n}\n\nfunction defaultKeyringAdapter(): KeyringAdapter {\n\tconst entry = new Entry(\"dropthis\", \"default\");\n\treturn {\n\t\tgetPassword: () => entry.getPassword(),\n\t\tsetPassword: (value) => entry.setPassword(value),\n\t\tdeletePassword: () => {\n\t\t\tentry.deletePassword();\n\t\t},\n\t};\n}\n\nfunction credentialPath(configDir?: string): string {\n\treturn join(\n\t\tconfigDir ?? join(homedir(), \".config\", \"dropthis\"),\n\t\t\"credentials.json\",\n\t);\n}\n\nasync function readJsonFile(\n\tpath: string,\n): Promise<Record<string, unknown> | null> {\n\ttry {\n\t\treturn JSON.parse(await readFile(path, \"utf8\")) as Record<string, unknown>;\n\t} catch (error) {\n\t\tif (\n\t\t\terror &&\n\t\t\ttypeof error === \"object\" &&\n\t\t\t\"code\" in error &&\n\t\t\terror.code === \"ENOENT\"\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nasync function writeCredentialFile(\n\tpath: string,\n\tcredential: Record<string, unknown>,\n): Promise<void> {\n\tawait mkdir(dirname(path), { recursive: true });\n\tawait writeFile(path, `${JSON.stringify(credential, null, 2)}\\n`, {\n\t\tmode: 0o600,\n\t});\n\tawait chmod(path, 0o600);\n}\n","#!/usr/bin/env node\nimport { buildProgram } from \"./program.js\";\n\nbuildProgram()\n\t.parseAsync(process.argv)\n\t.catch((error: unknown) => {\n\t\tconsole.error(error);\n\t\tprocess.exitCode = 1;\n\t});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAwB;;;ACWxB,eAAsB,kBAAkB,OAID;AACtC,MAAI,MAAM,OAAQ,QAAO,EAAE,QAAQ,MAAM,QAAQ,QAAQ,OAAO;AAChE,MAAI,MAAM,IAAI,kBAAkB;AAC/B,WAAO,EAAE,QAAQ,MAAM,IAAI,kBAAkB,QAAQ,MAAM;AAAA,EAC5D;AACA,QAAM,SAAS,MAAM,MAAM,MAAM,KAAK;AACtC,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO;AAAA,IACN,QAAQ,OAAO;AAAA,IACf,QAAQ;AAAA,IACR,GAAI,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AAAA,IAC9C,GAAI,OAAO,WAAW,EAAE,UAAU,OAAO,SAAS,I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AAkB;AACrD,YAAMA,WAAU,SAAS,GAAG;AAC5B,eAAS,KAAK,OAAO;AAAA,IACtB,OAAO;AACN,eAAS,KAAK,KAAK;AAAA,IACpB;AAAA,EACD;AACA,QAAM,EAAE,SAAS,UAAU,MAAM,OAAO,IAAI,MAAM,OAAO,aAAkB;AAC3E,QAAM,EAAE,MAAAC,OAAM,UAAU,aAAa,IAAI,MAAM,OAAO,MAAW;AACjE,QAAM,EAAE,OAAO,IAAI,MAAM,OAAO,IAAS;AACzC,QAAM,SAAS,MAAM,QAAQA,MAAK,OAAO,GAAG,iBAAiB,CAAC;AAC9D,aAAW,YAAY,UAAU;AAChC,UAAM,OAAO,MAAM,OAAO,QAAQ;AAClC,QAAI,KAAK,YAAY,GAAG;AACvB,YAAM,IAAI;AAAA,QACT,sGAAsG,QAAQ;AAAA,MAC/G;AAAA,IACD;AACA,UAAM,WAAW,aAAa,QAAQ;AACtC,UAAM,SAAS,UAAUA,MAAK,QAAQ,QAAQ,CAAC;AAAA,EAChD;AACA,SAAO;AACR;AAEA,eAAe,eACd,OACkB;AAClB,QAAM,SAAmB,CAAC;AAC1B,mBAAiB,SAAS,OAAO;AAChC,WAAO;AAAA,MACN,OAAO,UAAU,WAAW,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK;AAAA,IACnE;AAAA,EACD;AACA,SAAO,OAAO,OAAO,MAAM;AAC5B;;;AkBlnBA,aAAa,EACX,WAAW,QAAQ,IAAI,EACvB,MAAM,CAAC,UAAmB;AAC1B,UAAQ,MAAM,KAAK;AACnB,UAAQ,WAAW;AACpB,CAAC;","names":["hasCredential","authError","hasCredential","authError","apiError","listItems","invalidUsage","import_promises","import_promises","import_node_crypto","isFileSystemError","MAX_BUNDLE_FILE_COUNT","import_promises","import_node_path","writeFile","join"]}
1
+ {"version":3,"sources":["../src/program.ts","../src/auth.ts","../src/output.ts","../src/commands/account.ts","../src/commands/api-keys.ts","../src/commands/commands.ts","../src/commands/deployments.ts","../src/commands/doctor.ts","../src/options.ts","../src/commands/drops.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/commands/publish.ts","../src/commands/json_body.ts","../src/commands/update.ts","../src/commands/whoami.ts","../src/context.ts","../src/storage.ts","../src/cli.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { resolveCredential } from \"./auth.js\";\nimport { runAccountGet } from \"./commands/account.js\";\nimport {\n\trunApiKeysCreate,\n\trunApiKeysDelete,\n\trunApiKeysList,\n} from \"./commands/api-keys.js\";\nimport { runCommands } from \"./commands/commands.js\";\nimport {\n\trunDeploymentsGet,\n\trunDeploymentsList,\n} from \"./commands/deployments.js\";\nimport { runDoctor } from \"./commands/doctor.js\";\nimport {\n\trunDropsDelete,\n\trunDropsGet,\n\trunDropsList,\n\trunDropsUpdate,\n} from \"./commands/drops.js\";\nimport { runLoginRequest, runLoginVerify } from \"./commands/login.js\";\nimport { runLogout } from \"./commands/logout.js\";\nimport { runPublish } from \"./commands/publish.js\";\nimport { runUpdate } from \"./commands/update.js\";\nimport { runWhoami } from \"./commands/whoami.js\";\nimport { createContext, type GlobalOptions } from \"./context.js\";\nimport type { RawDropOptions } from \"./options.js\";\nimport { type CredentialStore, MemoryCredentialStore } from \"./storage.js\";\n\ntype BuildProgramOptions = {\n\tstore?: CredentialStore;\n\tclient?: unknown;\n\tenv?: Record<string, string | undefined>;\n\tstdin?: AsyncIterable<string | Uint8Array>;\n\tstdout?: (value: string) => void;\n\tstderr?: (value: string) => void;\n\tstdoutIsTTY?: boolean;\n\tstdinIsTTY?: boolean;\n};\n\nexport function buildProgram(options: BuildProgramOptions = {}): Command {\n\tconst program = new Command();\n\tconst store = options.store ?? new MemoryCredentialStore();\n\tprogram\n\t\t.name(\"dropthis\")\n\t\t.description(\"Publish anything online and get a URL back.\")\n\t\t.version(PKG_VERSION);\n\tprogram.option(\"--api-key <key>\", \"Override API key for this invocation\");\n\tprogram.option(\"--api-url <url>\", \"Override API base URL\");\n\tprogram.option(\"--json\", \"Force JSON output\");\n\tprogram.option(\"-q, --quiet\", \"Suppress status output and imply JSON\");\n\n\tprogram\n\t\t.command(\"login\")\n\t\t.description(\"Authenticate with email OTP\")\n\t\t.option(\"--email <email>\", \"Email address\")\n\t\t.option(\"--otp <otp>\", \"One-time passcode\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (commandOptions: {\n\t\t\t\temail?: string;\n\t\t\t\totp?: string;\n\t\t\t\tjson?: boolean;\n\t\t\t}) => {\n\t\t\t\tif (!commandOptions.email || !commandOptions.otp) return;\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runLoginVerify>[1][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runLoginVerify(\n\t\t\t\t\t{\n\t\t\t\t\t\temail: commandOptions.email,\n\t\t\t\t\t\totp: commandOptions.otp,\n\t\t\t\t\t\t...(commandOptions.json !== undefined\n\t\t\t\t\t\t\t? { json: commandOptions.json }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t},\n\t\t\t\t\tdeps,\n\t\t\t\t);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tconst login = program.commands.find((command) => command.name() === \"login\");\n\tlogin\n\t\t?.command(\"request\")\n\t\t.description(\"Request an email OTP\")\n\t\t.requiredOption(\"--email <email>\", \"Email address\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { email: string; json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runLoginRequest>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runLoginRequest(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\tlogin\n\t\t?.command(\"verify\")\n\t\t.description(\"Verify email OTP and store an API key\")\n\t\t.requiredOption(\"--email <email>\", \"Email address\")\n\t\t.requiredOption(\"--otp <otp>\", \"One-time passcode\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (commandOptions: {\n\t\t\t\temail: string;\n\t\t\t\totp: string;\n\t\t\t\tjson?: boolean;\n\t\t\t}) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runLoginVerify>[1][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runLoginVerify(commandOptions, deps);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tprogram\n\t\t.command(\"logout\")\n\t\t.description(\"Remove stored credentials\")\n\t\t.option(\"--revoke\", \"Best-effort revoke the saved API key\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { revoke?: boolean; json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<Parameters<typeof runLogout>[1][\"client\"]>(\n\t\t\t\tprogram,\n\t\t\t\toptions,\n\t\t\t\tstore,\n\t\t\t\tcommandOptions,\n\t\t\t);\n\t\t\tconst result = await runLogout(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tprogram\n\t\t.command(\"whoami\")\n\t\t.description(\"Show current authentication status\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<unknown>(\n\t\t\t\tprogram,\n\t\t\t\toptions,\n\t\t\t\tstore,\n\t\t\t\tcommandOptions,\n\t\t\t);\n\t\t\tconst result = await runWhoami(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tprogram\n\t\t.command(\"account\")\n\t\t.description(\"Account commands\")\n\t\t.command(\"get\")\n\t\t.description(\"Get account details\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runAccountGet>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runAccountGet(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tprogram\n\t\t.command(\"publish [input...]\")\n\t\t.description(\n\t\t\t\"Publish files, folders, URLs, strings, or stdin.\\nMultiple files are bundled into one drop.\\nUse - to read stdin explicitly, or pipe without args.\",\n\t\t)\n\t\t.option(\"--from-json <path>\", \"Read exact POST /drops JSON request body\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.option(\"--title <title>\", \"Drop title\")\n\t\t.option(\"--visibility <visibility>\", \"Drop visibility\")\n\t\t.option(\"--password <password>\", \"Set password\")\n\t\t.option(\"--no-password\", \"Clear password\")\n\t\t.option(\"--noindex\", \"Prevent indexing\")\n\t\t.option(\"--index\", \"Allow indexing\")\n\t\t.option(\"--expires-at <datetime>\", \"Expiration datetime\")\n\t\t.option(\"--metadata <json>\", \"Metadata JSON object\")\n\t\t.option(\"--metadata-file <path>\", \"Metadata JSON file\")\n\t\t.option(\"--entry <path>\", \"Entry file path\")\n\t\t.option(\"--content-type <mime>\", \"Content type\")\n\t\t.option(\"--path <path>\", \"Path for stdin or byte input\")\n\t\t.option(\"--idempotency-key <key>\", \"Idempotency key\")\n\t\t.option(\"--url\", \"Print only the published URL\")\n\t\t.option(\"--dry-run\", \"Validate without publishing\")\n\t\t.action(async (inputs: string[], commandOptions: RawCommandOptions) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runPublish>[2][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\tlet publishInput: string | string[] | undefined;\n\t\t\tif (commandOptions.dryRun && inputs.length > 1) {\n\t\t\t\tpublishInput = inputs;\n\t\t\t} else {\n\t\t\t\tpublishInput = await resolvePublishInputs(\n\t\t\t\t\tinputs,\n\t\t\t\t\toptions.stdin,\n\t\t\t\t\tstdinIsTTY,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst result = await runPublish(\n\t\t\t\tpublishInput,\n\t\t\t\ttoDropOptions(commandOptions),\n\t\t\t\tdeps,\n\t\t\t);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tprogram\n\t\t.command(\"update <target> [input]\")\n\t\t.description(\"Update an existing drop by id\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.option(\"--slug <slug>\", \"Replace shared hosted drop slug\")\n\t\t.option(\"--title <title>\", \"Drop title\")\n\t\t.option(\"--visibility <visibility>\", \"Drop visibility\")\n\t\t.option(\"--password <password>\", \"Set password\")\n\t\t.option(\"--no-password\", \"Clear password\")\n\t\t.option(\"--noindex\", \"Prevent indexing\")\n\t\t.option(\"--index\", \"Allow indexing\")\n\t\t.option(\"--expires-at <datetime>\", \"Expiration datetime\")\n\t\t.option(\"--metadata <json>\", \"Metadata JSON object\")\n\t\t.option(\"--metadata-file <path>\", \"Metadata JSON file\")\n\t\t.option(\"--entry <path>\", \"Entry file path\")\n\t\t.option(\"--content-type <mime>\", \"Content type\")\n\t\t.option(\"--path <path>\", \"Path for stdin or byte input\")\n\t\t.option(\"--idempotency-key <key>\", \"Idempotency key\")\n\t\t.option(\"--if-revision <n>\", \"Expected current revision\", parseInteger)\n\t\t.option(\n\t\t\t\"--from-json <path>\",\n\t\t\t\"Read exact POST /drops/{drop_id}/deployments JSON request body\",\n\t\t)\n\t\t.option(\"--url\", \"Print only the published URL\")\n\t\t.option(\"--dry-run\", \"Validate without publishing\")\n\t\t.action(\n\t\t\tasync (\n\t\t\t\ttarget: string,\n\t\t\t\tinput: string | undefined,\n\t\t\t\tcommandOptions: RawCommandOptions & { ifRevision?: number },\n\t\t\t) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runUpdate>[3][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst updateInput = input\n\t\t\t\t\t? await resolveCommandInput(input, options.stdin)\n\t\t\t\t\t: undefined;\n\t\t\t\tconst result = await runUpdate(\n\t\t\t\t\ttarget,\n\t\t\t\t\tupdateInput,\n\t\t\t\t\ttoDropOptions(commandOptions),\n\t\t\t\t\tdeps,\n\t\t\t\t);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tconst drops = program.command(\"drops\").description(\"Drop resource commands\");\n\tdrops\n\t\t.command(\"list\")\n\t\t.option(\"--limit <n>\", \"Page size\", parseInteger)\n\t\t.option(\"--cursor <cursor>\", \"Pagination cursor\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (commandOptions: {\n\t\t\t\tlimit?: number;\n\t\t\t\tcursor?: string;\n\t\t\t\tjson?: boolean;\n\t\t\t}) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runDropsList>[1][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runDropsList(commandOptions, deps);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\tdrops\n\t\t.command(\"get <dropId>\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (dropId: string, commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runDropsGet>[2][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runDropsGet(dropId, commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\tdrops\n\t\t.command(\"update <dropId>\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.option(\"--title <title>\", \"Drop title\")\n\t\t.option(\"--visibility <visibility>\", \"Drop visibility\")\n\t\t.option(\"--password <password>\", \"Set password\")\n\t\t.option(\"--no-password\", \"Clear password\")\n\t\t.option(\"--noindex\", \"Prevent indexing\")\n\t\t.option(\"--index\", \"Allow indexing\")\n\t\t.option(\"--expires-at <datetime>\", \"Expiration datetime\")\n\t\t.option(\"--metadata <json>\", \"Metadata JSON object\")\n\t\t.option(\"--metadata-file <path>\", \"Metadata JSON file\")\n\t\t.action(async (dropId: string, commandOptions: RawCommandOptions) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runDropsUpdate>[2][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runDropsUpdate(\n\t\t\t\tdropId,\n\t\t\t\ttoDropOptions(commandOptions),\n\t\t\t\tdeps,\n\t\t\t);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\tdrops\n\t\t.command(\"delete <dropId>\")\n\t\t.option(\"--yes\", \"Confirm deletion\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (\n\t\t\t\tdropId: string,\n\t\t\t\tcommandOptions: { yes?: boolean; json?: boolean },\n\t\t\t) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runDropsDelete>[2][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runDropsDelete(\n\t\t\t\t\tdropId,\n\t\t\t\t\t{ ...commandOptions, interactive: deps.outputMode === \"human\" },\n\t\t\t\t\tdeps,\n\t\t\t\t);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tconst apiKeys = program.command(\"api-keys\").description(\"API key commands\");\n\tapiKeys\n\t\t.command(\"create\")\n\t\t.option(\"--label <label>\", \"API key label\", \"CLI\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { label: string; json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runApiKeysCreate>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runApiKeysCreate(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\tapiKeys\n\t\t.command(\"list\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runApiKeysList>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runApiKeysList(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\tapiKeys\n\t\t.command(\"delete <keyId>\")\n\t\t.option(\"--yes\", \"Confirm deletion\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (\n\t\t\t\tkeyId: string,\n\t\t\t\tcommandOptions: { yes?: boolean; json?: boolean },\n\t\t\t) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runApiKeysDelete>[2][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runApiKeysDelete(\n\t\t\t\t\tkeyId,\n\t\t\t\t\t{ ...commandOptions, interactive: deps.outputMode === \"human\" },\n\t\t\t\t\tdeps,\n\t\t\t\t);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tconst deployments = program\n\t\t.command(\"deployments\")\n\t\t.description(\"Deployment commands\");\n\tdeployments\n\t\t.command(\"list <dropId>\")\n\t\t.option(\"--limit <n>\", \"Page size\", parseInteger)\n\t\t.option(\"--cursor <cursor>\", \"Pagination cursor\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (\n\t\t\t\tdropId: string,\n\t\t\t\tcommandOptions: { limit?: number; cursor?: string; json?: boolean },\n\t\t\t) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runDeploymentsList>[2][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runDeploymentsList(dropId, commandOptions, deps);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\tdeployments\n\t\t.command(\"get <dropId> <deploymentId>\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(\n\t\t\tasync (\n\t\t\t\tdropId: string,\n\t\t\t\tdeploymentId: string,\n\t\t\t\tcommandOptions: { json?: boolean },\n\t\t\t) => {\n\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\tParameters<typeof runDeploymentsGet>[3][\"client\"]\n\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\tconst result = await runDeploymentsGet(\n\t\t\t\t\tdropId,\n\t\t\t\t\tdeploymentId,\n\t\t\t\t\tcommandOptions,\n\t\t\t\t\tdeps,\n\t\t\t\t);\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\n\tprogram\n\t\t.command(\"doctor\")\n\t\t.description(\"Report CLI diagnostics\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<unknown>(\n\t\t\t\tprogram,\n\t\t\t\toptions,\n\t\t\t\tstore,\n\t\t\t\tcommandOptions,\n\t\t\t);\n\t\t\tconst result = await runDoctor(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tprogram\n\t\t.command(\"commands\")\n\t\t.description(\"Print machine-readable command metadata\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<unknown>(\n\t\t\t\tprogram,\n\t\t\t\toptions,\n\t\t\t\tstore,\n\t\t\t\tcommandOptions,\n\t\t\t);\n\t\t\tconst result = await runCommands(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\treturn program;\n}\n\ntype RawCommandOptions = Omit<RawDropOptions, \"password\"> & {\n\tjson?: boolean;\n\tquiet?: boolean;\n\turl?: boolean;\n\tifRevision?: number;\n\tfromJson?: string;\n\tdryRun?: boolean;\n\tpassword?: string | boolean;\n};\n\ntype RunnerDeps<TClient> = {\n\tstore: CredentialStore;\n\tclient: TClient;\n\tapiKey?: string;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\toutputMode: \"human\" | \"json\";\n};\n\nasync function commandDeps<TClient>(\n\tprogram: Command,\n\toptions: BuildProgramOptions,\n\tstore: CredentialStore,\n\tcommandOptions: { json?: boolean; quiet?: boolean },\n): Promise<RunnerDeps<TClient>> {\n\tconst global = globalOptions(program, commandOptions);\n\tconst context = createContext({\n\t\tglobal,\n\t\t...(options.env !== undefined ? { env: options.env } : {}),\n\t\t...(options.stdout !== undefined ? { stdout: options.stdout } : {}),\n\t\t...(options.stderr !== undefined ? { stderr: options.stderr } : {}),\n\t\t...(options.stdoutIsTTY !== undefined\n\t\t\t? { stdoutIsTTY: options.stdoutIsTTY }\n\t\t\t: {}),\n\t});\n\tconst credential = await resolveCredential({\n\t\t...(global.apiKey ? { apiKey: global.apiKey } : {}),\n\t\tenv: context.env,\n\t\tstore,\n\t});\n\treturn {\n\t\tstore,\n\t\tclient: (options.client ??\n\t\t\tcontext.createClient(credential?.apiKey)) as TClient,\n\t\t...(global.apiKey ? { apiKey: global.apiKey } : {}),\n\t\tenv: context.env,\n\t\tstdout: context.stdout,\n\t\tstderr: context.stderr,\n\t\toutputMode: context.output.mode,\n\t};\n}\n\nfunction globalOptions(\n\tprogram: Command,\n\tcommandOptions: { json?: boolean; quiet?: boolean },\n): GlobalOptions {\n\tconst opts = program.opts<GlobalOptions>();\n\treturn {\n\t\t...(opts.apiKey ? { apiKey: opts.apiKey } : {}),\n\t\t...(opts.apiUrl ? { apiUrl: opts.apiUrl } : {}),\n\t\t...(commandOptions.json !== undefined\n\t\t\t? { json: commandOptions.json }\n\t\t\t: opts.json !== undefined\n\t\t\t\t? { json: opts.json }\n\t\t\t\t: {}),\n\t\t...(commandOptions.quiet !== undefined\n\t\t\t? { quiet: commandOptions.quiet }\n\t\t\t: opts.quiet !== undefined\n\t\t\t\t? { quiet: opts.quiet }\n\t\t\t\t: {}),\n\t};\n}\n\nfunction toDropOptions(options: RawCommandOptions): RawDropOptions & {\n\tjson?: boolean;\n\tquiet?: boolean;\n\turl?: boolean;\n\tifRevision?: number;\n\tfromJson?: string;\n\tdryRun?: boolean;\n} {\n\treturn {\n\t\t...(options.slug ? { slug: options.slug } : {}),\n\t\t...(options.title ? { title: options.title } : {}),\n\t\t...(options.visibility === \"public\" || options.visibility === \"unlisted\"\n\t\t\t? { visibility: options.visibility }\n\t\t\t: {}),\n\t\t...(typeof options.password === \"string\"\n\t\t\t? { password: options.password }\n\t\t\t: {}),\n\t\t...(options.password === false || options.noPassword\n\t\t\t? { noPassword: true }\n\t\t\t: {}),\n\t\t...(options.noindex ? { noindex: true } : {}),\n\t\t...(options.index ? { index: true } : {}),\n\t\t...(options.expiresAt ? { expiresAt: options.expiresAt } : {}),\n\t\t...(options.metadata ? { metadata: options.metadata } : {}),\n\t\t...(options.metadataFile ? { metadataFile: options.metadataFile } : {}),\n\t\t...(options.entry ? { entry: options.entry } : {}),\n\t\t...(options.contentType ? { contentType: options.contentType } : {}),\n\t\t...(options.path ? { path: options.path } : {}),\n\t\t...(options.idempotencyKey\n\t\t\t? { idempotencyKey: options.idempotencyKey }\n\t\t\t: {}),\n\t\t...(options.json !== undefined ? { json: options.json } : {}),\n\t\t...(options.quiet !== undefined ? { quiet: options.quiet } : {}),\n\t\t...(options.url !== undefined ? { url: options.url } : {}),\n\t\t...(options.ifRevision !== undefined\n\t\t\t? { ifRevision: options.ifRevision }\n\t\t\t: {}),\n\t\t...(options.fromJson ? { fromJson: options.fromJson } : {}),\n\t\t...(options.dryRun ? { dryRun: options.dryRun } : {}),\n\t};\n}\n\nfunction parseInteger(value: string): number {\n\treturn Number.parseInt(value, 10);\n}\n\nasync function resolveCommandInput(\n\tinput: string,\n\tstdin?: AsyncIterable<string | Uint8Array>,\n): Promise<string> {\n\tif (input !== \"-\") return input;\n\tconst buf = await readStdinBytes(stdin ?? process.stdin);\n\treturn buf.toString(\"utf8\");\n}\n\nasync function resolvePublishInputs(\n\tinputs: string[],\n\tstdin?: AsyncIterable<string | Uint8Array>,\n\tstdinIsTTY?: boolean,\n): Promise<string | undefined> {\n\tif (inputs.length === 0) {\n\t\tif (stdinIsTTY) return undefined;\n\t\tconst buf = await readStdinBytes(stdin ?? process.stdin);\n\t\tif (buf.length === 0) return undefined;\n\t\treturn buf.toString(\"utf8\");\n\t}\n\tif (inputs.length === 1) {\n\t\tif (inputs[0] === \"-\") {\n\t\t\tconst buf = await readStdinBytes(stdin ?? process.stdin);\n\t\t\treturn buf.toString(\"utf8\");\n\t\t}\n\t\treturn inputs[0];\n\t}\n\tconst resolved: string[] = [];\n\tfor (const input of inputs) {\n\t\tif (input === \"-\") {\n\t\t\tconst buf = await readStdinBytes(stdin ?? process.stdin);\n\t\t\tconst tmpPath = `/tmp/.dropthis-stdin-${Date.now()}`;\n\t\t\tconst { writeFile } = await import(\"node:fs/promises\");\n\t\t\tawait writeFile(tmpPath, buf);\n\t\t\tresolved.push(tmpPath);\n\t\t} else {\n\t\t\tresolved.push(input);\n\t\t}\n\t}\n\tconst { mkdtemp, copyFile, stat: fsStat } = await import(\"node:fs/promises\");\n\tconst { join, basename: pathBasename } = await import(\"node:path\");\n\tconst { tmpdir } = await import(\"node:os\");\n\tconst tmpDir = await mkdtemp(join(tmpdir(), \"dropthis-multi-\"));\n\tfor (const filePath of resolved) {\n\t\tconst info = await fsStat(filePath);\n\t\tif (info.isDirectory()) {\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot mix directories with multiple file arguments. Use a single folder instead: dropthis publish ${filePath}`,\n\t\t\t);\n\t\t}\n\t\tconst destName = pathBasename(filePath);\n\t\tawait copyFile(filePath, join(tmpDir, destName));\n\t}\n\treturn tmpDir;\n}\n\nasync function readStdinBytes(\n\tstdin: AsyncIterable<string | Uint8Array>,\n): Promise<Buffer> {\n\tconst chunks: Buffer[] = [];\n\tfor await (const chunk of stdin) {\n\t\tchunks.push(\n\t\t\ttypeof chunk === \"string\" ? Buffer.from(chunk) : Buffer.from(chunk),\n\t\t);\n\t}\n\treturn Buffer.concat(chunks);\n}\n","import type { CredentialStore } from \"./storage.js\";\n\nexport type ResolvedCredential = {\n\tapiKey: string;\n\tsource: \"flag\" | \"env\" | \"storage\";\n\tkeyId?: string;\n\tkeyLast4?: string;\n\taccountId?: string;\n\temail?: string;\n};\n\nexport async function resolveCredential(input: {\n\tapiKey?: string;\n\tenv: Record<string, string | undefined>;\n\tstore: CredentialStore;\n}): Promise<ResolvedCredential | null> {\n\tif (input.apiKey) return { apiKey: input.apiKey, source: \"flag\" };\n\tif (input.env.DROPTHIS_API_KEY) {\n\t\treturn { apiKey: input.env.DROPTHIS_API_KEY, source: \"env\" };\n\t}\n\tconst stored = await input.store.read();\n\tif (!stored) return null;\n\treturn {\n\t\tapiKey: stored.apiKey,\n\t\tsource: \"storage\",\n\t\t...(stored.keyId ? { keyId: stored.keyId } : {}),\n\t\t...(stored.keyLast4 ? { keyLast4: stored.keyLast4 } : {}),\n\t\t...(stored.accountId ? { accountId: stored.accountId } : {}),\n\t\t...(stored.email ? { email: stored.email } : {}),\n\t};\n}\n\nexport function maskKey(apiKey: string): string {\n\treturn apiKey.length <= 8\n\t\t? \"sk_...\"\n\t\t: `${apiKey.slice(0, 3)}...${apiKey.slice(-4)}`;\n}\n","export type OutputMode = \"human\" | \"json\";\nexport type CliErrorCode =\n\t| \"api_error\"\n\t| \"auth_error\"\n\t| \"credential_storage_unavailable\"\n\t| \"generic_error\"\n\t| \"invalid_usage\"\n\t| \"local_input_error\"\n\t| \"network_error\";\n\nexport type Output = {\n\tmode: OutputMode;\n\tquiet: boolean;\n};\n\nexport type ApiErrorDetails = {\n\tcode?: string;\n\tmessage: string;\n\tstatusCode?: number | null;\n\tdetail?: unknown;\n\tparam?: string | null;\n\tcurrentRevision?: number;\n\trequestId?: string | null;\n};\n\nconst UPLOAD_NEXT_ACTIONS: Record<string, string> = {\n\tupload_expired: \"Create a new upload session and retry the publish.\",\n\tupload_already_used:\n\t\t\"Create a new upload session; upload sessions are single-use.\",\n\tupload_verification_failed:\n\t\t\"Re-upload the file bytes and complete the upload again.\",\n\ttoo_many_active_uploads:\n\t\t\"Cancel unused uploads or wait for expired uploads to be cleaned.\",\n\tupload_not_complete: \"Complete the upload session before publishing.\",\n};\n\nexport function createOutput(input: {\n\tjson?: boolean;\n\tquiet?: boolean;\n\tstdoutIsTTY: boolean;\n\tenv: Record<string, string | undefined>;\n}): Output {\n\tconst json =\n\t\tinput.json === true ||\n\t\tinput.quiet === true ||\n\t\tinput.stdoutIsTTY === false ||\n\t\tinput.env.CI === \"true\";\n\treturn { mode: json ? \"json\" : \"human\", quiet: input.quiet === true };\n}\n\nexport function successEnvelope<T>(data: T): { ok: true; data: T } {\n\treturn { ok: true, data };\n}\n\nexport function errorEnvelope(\n\tcode: CliErrorCode,\n\tmessage: string,\n\tnextAction?: string,\n): {\n\tok: false;\n\terror: { code: CliErrorCode; message: string; next_action?: string };\n} {\n\treturn {\n\t\tok: false,\n\t\terror: {\n\t\t\tcode,\n\t\t\tmessage,\n\t\t\t...(nextAction ? { next_action: nextAction } : {}),\n\t\t},\n\t};\n}\n\nexport function apiErrorEnvelope(error: ApiErrorDetails): {\n\tok: false;\n\terror: Record<string, unknown>;\n} {\n\treturn {\n\t\tok: false,\n\t\terror: {\n\t\t\tcode: error.code ?? \"api_error\",\n\t\t\tmessage: error.message,\n\t\t\t...(error.statusCode !== undefined ? { status: error.statusCode } : {}),\n\t\t\t...(typeof error.detail === \"string\" ? { detail: error.detail } : {}),\n\t\t\t...(error.param ? { param: error.param } : {}),\n\t\t\t...(error.currentRevision !== undefined\n\t\t\t\t? { current_revision: error.currentRevision }\n\t\t\t\t: {}),\n\t\t\t...(error.requestId ? { request_id: error.requestId } : {}),\n\t\t\tnext_action: nextActionForApiError(error),\n\t\t},\n\t};\n}\n\nfunction nextActionForApiError(error: ApiErrorDetails): string {\n\tconst uploadNextAction = error.code\n\t\t? UPLOAD_NEXT_ACTIONS[error.code]\n\t\t: undefined;\n\tif (uploadNextAction) return uploadNextAction;\n\tif (error.code === \"revision_conflict\") {\n\t\treturn \"Fetch the drop, merge your changes, and retry with the current revision.\";\n\t}\n\tif (error.statusCode === 401 || error.code === \"missing_api_key\") {\n\t\treturn \"Authenticate with dropthis login or set DROPTHIS_API_KEY.\";\n\t}\n\tif (error.statusCode === 413 || error.code === \"quota_exceeded\") {\n\t\treturn \"Reduce the upload size or upgrade the account limit.\";\n\t}\n\tif (error.statusCode === 422) {\n\t\treturn \"Fix the input shown in the error detail and retry.\";\n\t}\n\tif (\n\t\terror.statusCode !== undefined &&\n\t\terror.statusCode !== null &&\n\t\terror.statusCode >= 500\n\t) {\n\t\treturn \"Retry the request with the same idempotency key, or contact support with the request id.\";\n\t}\n\treturn \"Fix the request or retry after checking the drop state.\";\n}\n\nexport function exitCodeFor(code: CliErrorCode): number {\n\tif (code === \"invalid_usage\") return 2;\n\tif (code === \"auth_error\") return 3;\n\tif (code === \"local_input_error\") return 4;\n\tif (code === \"network_error\") return 5;\n\treturn 1;\n}\n","import { resolveCredential } from \"../auth.js\";\nimport { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: { message: string };\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype AccountClient = {\n\taccount: { get(): Promise<SdkResult<unknown>> };\n};\n\ntype CommandDeps = {\n\tstore: CredentialStore;\n\tclient: AccountClient;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n};\n\nexport async function runAccountGet(\n\t_input: { json?: boolean },\n\tdeps: CommandDeps,\n): Promise<{ exitCode: number }> {\n\tif (\n\t\t(await resolveCredential({ env: deps.env, store: deps.store })) === null\n\t) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"auth_error\") };\n\t}\n\tconst result = await deps.client.account.get();\n\tif (result.error) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"api_error\", result.error.message))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tdeps.stdout(`${JSON.stringify({ ok: true, account: result.data })}\\n`);\n\treturn { exitCode: 0 };\n}\n","import { resolveCredential } from \"../auth.js\";\nimport { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: { message: string };\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype ApiKeysCreateClient = {\n\tapiKeys: {\n\t\tcreate(input: {\n\t\t\tlabel: string;\n\t\t}): Promise<SdkResult<Record<string, unknown>>>;\n\t};\n};\n\ntype ApiKeysListClient = {\n\tapiKeys: {\n\t\tlist(): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype ApiKeysDeleteClient = {\n\tapiKeys: {\n\t\tdelete(\n\t\t\tkeyId: string,\n\t\t): Promise<SdkResult<null>> | SdkResult<null> | undefined;\n\t};\n};\n\ntype CommandDeps<TClient> = {\n\tstore: CredentialStore;\n\tclient: TClient;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n};\n\nexport async function runApiKeysCreate(\n\tinput: { label: string; json?: boolean },\n\tdeps: CommandDeps<ApiKeysCreateClient>,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.apiKeys.create({ label: input.label });\n\tif (result.error) return apiError(deps, result.error.message);\n\tdeps.stdout(`${JSON.stringify({ ok: true, api_key: result.data })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nexport async function runApiKeysList(\n\t_input: { json?: boolean },\n\tdeps: CommandDeps<ApiKeysListClient>,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.apiKeys.list();\n\tif (result.error) return apiError(deps, result.error.message);\n\tdeps.stdout(\n\t\t`${JSON.stringify({ ok: true, api_keys: listItems(result.data) })}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n\nexport async function runApiKeysDelete(\n\tkeyId: string,\n\tinput: { yes?: boolean; json?: boolean; interactive?: boolean },\n\tdeps: CommandDeps<ApiKeysDeleteClient>,\n): Promise<{ exitCode: number }> {\n\tif (!input.yes && input.interactive === false) {\n\t\treturn invalidUsage(deps, \"Pass --yes to delete in non-interactive mode.\");\n\t}\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.apiKeys.delete(keyId);\n\tif (result?.error) return apiError(deps, result.error.message);\n\tdeps.stdout(`${JSON.stringify({ ok: true, deleted: true, id: keyId })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nasync function hasCredential(deps: CommandDeps<unknown>): Promise<boolean> {\n\treturn (\n\t\t(await resolveCredential({ env: deps.env, store: deps.store })) !== null\n\t);\n}\n\nfunction listItems(data: unknown): unknown {\n\tif (data && typeof data === \"object\" && \"data\" in data) {\n\t\treturn (data as { data: unknown }).data;\n\t}\n\tif (data && typeof data === \"object\" && \"apiKeys\" in data) {\n\t\treturn (data as { apiKeys: unknown }).apiKeys;\n\t}\n\treturn data;\n}\n\nfunction authError(deps: Pick<CommandDeps<unknown>, \"stderr\">): {\n\texitCode: number;\n} {\n\tdeps.stderr(\n\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t);\n\treturn { exitCode: exitCodeFor(\"auth_error\") };\n}\n\nfunction apiError(\n\tdeps: Pick<CommandDeps<unknown>, \"stderr\">,\n\tmessage: string,\n): { exitCode: number } {\n\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"api_error\", message))}\\n`);\n\treturn { exitCode: exitCodeFor(\"api_error\") };\n}\n\nfunction invalidUsage(\n\tdeps: Pick<CommandDeps<unknown>, \"stderr\">,\n\tmessage: string,\n): { exitCode: number } {\n\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"invalid_usage\", message))}\\n`);\n\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n}\n","const COMMANDS = [\n\t{\n\t\tname: \"publish\",\n\t\tdescription: \"Publish an input and return a Dropthis URL.\",\n\t\targuments: [\"input\"],\n\t\toptions: [\"--json\", \"--url\", \"--dry-run\", \"--title\", \"--metadata\"],\n\t\texamples: [\n\t\t\t\"dropthis publish ./site --json\",\n\t\t\t\"dropthis publish ./site --url\",\n\t\t\t\"dropthis publish ./dist --dry-run\",\n\t\t],\n\t},\n\t{\n\t\tname: \"update\",\n\t\tdescription: \"Update an existing drop by id.\",\n\t\targuments: [\"target\", \"input\"],\n\t\toptions: [\"--json\", \"--url\", \"--dry-run\", \"--if-revision\"],\n\t\texamples: [\n\t\t\t\"dropthis update drop_abc ./site --json\",\n\t\t\t\"dropthis update drop_abc --title 'New Title' --dry-run\",\n\t\t],\n\t},\n\t{\n\t\tname: \"deployments list <dropId>\",\n\t\tdescription: \"List deployments for a drop.\",\n\t\targuments: [\"dropId\"],\n\t\toptions: [\"--json\", \"--limit\", \"--cursor\"],\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis deployments list drop_abc --json\"],\n\t},\n\t{\n\t\tname: \"deployments get <dropId> <deploymentId>\",\n\t\tdescription: \"Get deployment details for a drop.\",\n\t\targuments: [\"dropId\", \"deploymentId\"],\n\t\toptions: [\"--json\"],\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis deployments get drop_abc dep_abc --json\"],\n\t},\n\t{\n\t\tname: \"drops\",\n\t\tdescription: \"List, inspect, update, and delete drops.\",\n\t\texamples: [\"dropthis drops list --json\"],\n\t},\n\t{\n\t\tname: \"api-keys\",\n\t\tdescription: \"Create, list, and delete API keys.\",\n\t\texamples: [\"dropthis api-keys create --label CI --json\"],\n\t},\n\t{\n\t\tname: \"login\",\n\t\tdescription: \"Authenticate with email OTP and store an API key.\",\n\t\texamples: [\n\t\t\t\"dropthis login verify --email user@example.com --otp 123456 --json\",\n\t\t],\n\t},\n\t{\n\t\tname: \"logout\",\n\t\tdescription: \"Remove stored local credentials.\",\n\t\texamples: [\"dropthis logout --json\"],\n\t},\n\t{\n\t\tname: \"whoami\",\n\t\tdescription: \"Show current auth source and credential metadata.\",\n\t\texamples: [\"dropthis whoami --json\"],\n\t},\n\t{\n\t\tname: \"account\",\n\t\tdescription: \"Get account details.\",\n\t\texamples: [\"dropthis account get --json\"],\n\t},\n\t{\n\t\tname: \"doctor\",\n\t\tdescription: \"Report local CLI diagnostics.\",\n\t\texamples: [\"dropthis doctor --json\"],\n\t},\n\t{\n\t\tname: \"commands\",\n\t\tdescription: \"Print this machine-readable command tree.\",\n\t\texamples: [\"dropthis commands --json\"],\n\t},\n];\n\nexport async function runCommands(\n\t_input: { json?: boolean },\n\tdeps: { stdout: (value: string) => void },\n): Promise<{ exitCode: number }> {\n\tdeps.stdout(\n\t\t`${JSON.stringify({\n\t\t\tok: true,\n\t\t\toutput: \"JSON by default in CI, pipes, non-TTY, --json, or --quiet.\",\n\t\t\tcommands: COMMANDS,\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n","import { resolveCredential } from \"../auth.js\";\nimport { apiErrorEnvelope, errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype ApiError = {\n\tmessage: string;\n\tcode?: string;\n\tstatusCode?: number | null;\n\tdetail?: unknown;\n\tparam?: string | null;\n\trequestId?: string | null;\n};\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| { data: null; error: ApiError; headers?: Record<string, string> };\n\ntype DeploymentsClient = {\n\tdeployments: {\n\t\tlist(\n\t\t\tdropId: string,\n\t\t\tparams?: { limit?: number; cursor?: string },\n\t\t): Promise<SdkResult<unknown>>;\n\t\tget(dropId: string, deploymentId: string): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype Deps = {\n\tstore: CredentialStore;\n\tclient: DeploymentsClient;\n\tapiKey?: string;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n};\n\nexport async function runDeploymentsList(\n\tdropId: string,\n\tinput: { limit?: number; cursor?: string; json?: boolean },\n\tdeps: Deps,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst params = {\n\t\t...(input.limit !== undefined ? { limit: input.limit } : {}),\n\t\t...(input.cursor ? { cursor: input.cursor } : {}),\n\t};\n\tconst result = await deps.client.deployments.list(dropId, params);\n\tif (result.error) {\n\t\tdeps.stderr(`${JSON.stringify(apiErrorEnvelope(result.error))}\\n`);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tdeps.stdout(`${JSON.stringify({ ok: true, ...spreadData(result.data) })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nexport async function runDeploymentsGet(\n\tdropId: string,\n\tdeploymentId: string,\n\t_input: { json?: boolean },\n\tdeps: Deps,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.deployments.get(dropId, deploymentId);\n\tif (result.error) {\n\t\tdeps.stderr(`${JSON.stringify(apiErrorEnvelope(result.error))}\\n`);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tdeps.stdout(`${JSON.stringify({ ok: true, deployment: result.data })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nasync function hasCredential(\n\tdeps: Pick<Deps, \"apiKey\" | \"env\" | \"store\">,\n): Promise<boolean> {\n\treturn (\n\t\t(await resolveCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t})) !== null\n\t);\n}\n\nfunction authError(deps: Pick<Deps, \"stderr\">): { exitCode: number } {\n\tdeps.stderr(\n\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t);\n\treturn { exitCode: exitCodeFor(\"auth_error\") };\n}\n\nfunction spreadData(data: unknown): Record<string, unknown> {\n\treturn data && typeof data === \"object\"\n\t\t? (data as Record<string, unknown>)\n\t\t: { data };\n}\n","import { resolveCredential } from \"../auth.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype CommandDeps = {\n\tstore: CredentialStore;\n\tclient: unknown;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n};\n\nexport async function runDoctor(\n\t_input: { json?: boolean },\n\tdeps: CommandDeps,\n): Promise<{ exitCode: number }> {\n\tconst stored = await deps.store.read();\n\tconst credential = await resolveCredential({\n\t\tenv: deps.env,\n\t\tstore: deps.store,\n\t});\n\tdeps.stdout(\n\t\t`${JSON.stringify({\n\t\t\tok: true,\n\t\t\tversion: \"0.1.0\",\n\t\t\tauth: { source: credential?.source ?? \"missing\" },\n\t\t\tstorage: { backend: stored?.storage ?? \"none\" },\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n","import { readFile } from \"node:fs/promises\";\n\nexport type RawDropOptions = {\n\tslug?: string;\n\ttitle?: string;\n\tvisibility?: \"public\" | \"unlisted\";\n\tpassword?: string;\n\tnoPassword?: boolean;\n\tnoindex?: boolean;\n\tindex?: boolean;\n\texpiresAt?: string;\n\tmetadata?: string;\n\tmetadataFile?: string;\n\tentry?: string;\n\tcontentType?: string;\n\tpath?: string;\n\tidempotencyKey?: string;\n};\n\nexport type ParsedDropOptions = {\n\tslug?: string;\n\ttitle?: string;\n\tvisibility?: \"public\" | \"unlisted\";\n\tpassword?: string | null;\n\tnoindex?: boolean;\n\texpiresAt?: string;\n\tmetadata?: Record<string, unknown>;\n\tentry?: string;\n\tcontentType?: string;\n\tpath?: string;\n\tidempotencyKey?: string;\n};\n\nexport async function parseDropOptions(\n\traw: RawDropOptions,\n): Promise<ParsedDropOptions> {\n\tif (raw.metadata && raw.metadataFile) {\n\t\tthrow new Error(\"Use either --metadata or --metadata-file, not both.\");\n\t}\n\tif (raw.password && raw.noPassword) {\n\t\tthrow new Error(\"Use either --password or --no-password, not both.\");\n\t}\n\tif (raw.noindex && raw.index) {\n\t\tthrow new Error(\"Use either --noindex or --index, not both.\");\n\t}\n\tconst metadata = raw.metadata\n\t\t? parseJsonObject(raw.metadata, \"--metadata\")\n\t\t: raw.metadataFile\n\t\t\t? parseJsonObject(\n\t\t\t\t\tawait readFile(raw.metadataFile, \"utf8\"),\n\t\t\t\t\t\"--metadata-file\",\n\t\t\t\t)\n\t\t\t: undefined;\n\treturn {\n\t\t...(raw.slug ? { slug: raw.slug } : {}),\n\t\t...(raw.title ? { title: raw.title } : {}),\n\t\t...(raw.visibility ? { visibility: raw.visibility } : {}),\n\t\t...(raw.password ? { password: raw.password } : {}),\n\t\t...(raw.noPassword ? { password: null } : {}),\n\t\t...(raw.noindex ? { noindex: true } : {}),\n\t\t...(raw.index ? { noindex: false } : {}),\n\t\t...(raw.expiresAt ? { expiresAt: raw.expiresAt } : {}),\n\t\t...(metadata ? { metadata } : {}),\n\t\t...(raw.entry ? { entry: raw.entry } : {}),\n\t\t...(raw.contentType ? { contentType: raw.contentType } : {}),\n\t\t...(raw.path ? { path: raw.path } : {}),\n\t\t...(raw.idempotencyKey ? { idempotencyKey: raw.idempotencyKey } : {}),\n\t};\n}\n\nfunction parseJsonObject(\n\tvalue: string,\n\tlabel: string,\n): Record<string, unknown> {\n\tconst parsed = JSON.parse(value) as unknown;\n\tif (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n\t\tthrow new Error(`${label} must be a JSON object.`);\n\t}\n\treturn parsed as Record<string, unknown>;\n}\n","import { resolveCredential } from \"../auth.js\";\nimport { parseDropOptions, type RawDropOptions } from \"../options.js\";\nimport { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: { message: string };\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype DropsListClient = {\n\tdrops: {\n\t\tlist(params: {\n\t\t\tlimit?: number;\n\t\t\tcursor?: string;\n\t\t}): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype DropsGetClient = {\n\tdrops: {\n\t\tget(dropId: string): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype DropsUpdateClient = {\n\tdrops: {\n\t\tupdate(\n\t\t\tdropId: string,\n\t\t\tinput: Record<string, unknown>,\n\t\t): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype DropsDeleteClient = {\n\tdrops: {\n\t\tdelete(\n\t\t\tdropId: string,\n\t\t): Promise<SdkResult<null>> | SdkResult<null> | undefined;\n\t};\n};\n\ntype CommandDeps<TClient> = {\n\tstore: CredentialStore;\n\tclient: TClient;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n};\n\nexport async function runDropsList(\n\tinput: { limit?: number; cursor?: string; json?: boolean },\n\tdeps: CommandDeps<DropsListClient>,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst params = {\n\t\t...(input.limit !== undefined ? { limit: input.limit } : {}),\n\t\t...(input.cursor ? { cursor: input.cursor } : {}),\n\t};\n\tconst result = await deps.client.drops.list(params);\n\tif (result.error) return apiError(deps, result.error.message);\n\tdeps.stdout(\n\t\t`${JSON.stringify({ ok: true, drops: listItems(result.data) })}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n\nexport async function runDropsGet(\n\tdropId: string,\n\t_input: { json?: boolean },\n\tdeps: CommandDeps<DropsGetClient>,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.drops.get(dropId);\n\tif (result.error) return apiError(deps, result.error.message);\n\tdeps.stdout(`${JSON.stringify({ ok: true, drop: result.data })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nexport async function runDropsUpdate(\n\tdropId: string,\n\tinput: RawDropOptions & { json?: boolean },\n\tdeps: CommandDeps<DropsUpdateClient>,\n): Promise<{ exitCode: number }> {\n\tif (!(await hasCredential(deps))) return authError(deps);\n\ttry {\n\t\tconst options = await parseDropOptions(input);\n\t\tconst result = await deps.client.drops.update(dropId, options);\n\t\tif (result.error) return apiError(deps, result.error.message);\n\t\tdeps.stdout(`${JSON.stringify({ ok: true, drop: result.data })}\\n`);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\treturn invalidUsage(\n\t\t\tdeps,\n\t\t\terror instanceof Error ? error.message : \"Invalid drop options.\",\n\t\t);\n\t}\n}\n\nexport async function runDropsDelete(\n\tdropId: string,\n\tinput: { yes?: boolean; json?: boolean; interactive?: boolean },\n\tdeps: CommandDeps<DropsDeleteClient>,\n): Promise<{ exitCode: number }> {\n\tif (!input.yes && input.interactive === false) {\n\t\treturn invalidUsage(deps, \"Pass --yes to delete in non-interactive mode.\");\n\t}\n\tif (!(await hasCredential(deps))) return authError(deps);\n\tconst result = await deps.client.drops.delete(dropId);\n\tif (result?.error) return apiError(deps, result.error.message);\n\tdeps.stdout(`${JSON.stringify({ ok: true, deleted: true, id: dropId })}\\n`);\n\treturn { exitCode: 0 };\n}\n\nasync function hasCredential(deps: CommandDeps<unknown>): Promise<boolean> {\n\treturn (\n\t\t(await resolveCredential({ env: deps.env, store: deps.store })) !== null\n\t);\n}\n\nfunction listItems(data: unknown): unknown {\n\tif (data && typeof data === \"object\" && \"data\" in data) {\n\t\treturn (data as { data: unknown }).data;\n\t}\n\tif (data && typeof data === \"object\" && \"drops\" in data) {\n\t\treturn (data as { drops: unknown }).drops;\n\t}\n\treturn data;\n}\n\nfunction authError(deps: Pick<CommandDeps<unknown>, \"stderr\">): {\n\texitCode: number;\n} {\n\tdeps.stderr(\n\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t);\n\treturn { exitCode: exitCodeFor(\"auth_error\") };\n}\n\nfunction apiError(\n\tdeps: Pick<CommandDeps<unknown>, \"stderr\">,\n\tmessage: string,\n): { exitCode: number } {\n\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"api_error\", message))}\\n`);\n\treturn { exitCode: exitCodeFor(\"api_error\") };\n}\n\nfunction invalidUsage(\n\tdeps: Pick<CommandDeps<unknown>, \"stderr\">,\n\tmessage: string,\n): { exitCode: number } {\n\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"invalid_usage\", message))}\\n`);\n\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n}\n","import { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: { message: string };\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype OtpRequestData = {\n\tok: true;\n\texpiresIn: number;\n};\n\ntype SessionData = {\n\ttoken: string;\n\taccountId: string;\n\tisNewAccount: boolean;\n};\n\ntype ApiKeyData = {\n\tid: string;\n\tkey: string;\n\tkeyLast4: string;\n\taccountId?: string | null;\n\tisNewAccount?: boolean;\n};\n\ntype LoginRequestClient = {\n\tauth: {\n\t\trequestEmailOtp(input: {\n\t\t\temail: string;\n\t\t}): Promise<SdkResult<OtpRequestData>>;\n\t};\n};\n\ntype LoginClient = {\n\tauth: {\n\t\tverifyEmailOtp(input: {\n\t\t\temail: string;\n\t\t\tcode: string;\n\t\t}): Promise<SdkResult<SessionData>>;\n\t};\n\tapiKeys: {\n\t\tcreate(input: { label: string }): Promise<SdkResult<ApiKeyData>>;\n\t};\n};\n\nexport async function runLoginRequest(\n\tinput: { email: string; json?: boolean },\n\tdeps: {\n\t\tclient: LoginRequestClient;\n\t\tstdout: (value: string) => void;\n\t\tstderr: (value: string) => void;\n\t},\n): Promise<{ exitCode: number }> {\n\tconst result = await deps.client.auth.requestEmailOtp({\n\t\temail: input.email,\n\t});\n\tif (result.error) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"api_error\", result.error.message))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tdeps.stdout(\n\t\t`${JSON.stringify({\n\t\t\tok: true,\n\t\t\temail: input.email,\n\t\t\texpires_in: result.data.expiresIn,\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n\nexport async function runLoginVerify(\n\tinput: { email: string; otp: string; json?: boolean },\n\tdeps: {\n\t\tclient: LoginClient;\n\t\tstore: CredentialStore;\n\t\tstdout: (value: string) => void;\n\t\tstderr: (value: string) => void;\n\t},\n): Promise<{ exitCode: number }> {\n\tconst session = await deps.client.auth.verifyEmailOtp({\n\t\temail: input.email,\n\t\tcode: input.otp,\n\t});\n\tif (session.error) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"api_error\", session.error.message))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tconst apiKey = await deps.client.apiKeys.create({ label: \"CLI\" });\n\tif (apiKey.error) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"api_error\", apiKey.error.message))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tawait deps.store.save({\n\t\tapiKey: apiKey.data.key,\n\t\tkeyId: apiKey.data.id,\n\t\tkeyLast4: apiKey.data.keyLast4,\n\t\taccountId: apiKey.data.accountId ?? session.data.accountId,\n\t\temail: input.email,\n\t\tstorage: \"secure\",\n\t});\n\tdeps.stdout(\n\t\t`${JSON.stringify({\n\t\t\tok: true,\n\t\t\taccount_id: apiKey.data.accountId ?? session.data.accountId,\n\t\t\tkey_id: apiKey.data.id,\n\t\t\tkey_last4: apiKey.data.keyLast4,\n\t\t\tis_new_account: apiKey.data.isNewAccount ?? session.data.isNewAccount,\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n","import { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\ntype DeleteResult =\n\t| { data: null; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: { message: string };\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype LogoutClient = {\n\tapiKeys: {\n\t\tdelete(\n\t\t\tkeyId: string,\n\t\t): DeleteResult | Promise<DeleteResult> | undefined | Promise<undefined>;\n\t};\n};\n\nexport async function runLogout(\n\tinput: { json?: boolean; revoke?: boolean },\n\tdeps: {\n\t\tstore: CredentialStore;\n\t\tclient: LogoutClient;\n\t\tstdout: (value: string) => void;\n\t\tstderr: (value: string) => void;\n\t},\n): Promise<{ exitCode: number }> {\n\tconst stored = await deps.store.read();\n\tlet revokeError: string | undefined;\n\tif (input.revoke && stored?.keyId) {\n\t\tconst result = await deps.client.apiKeys.delete(stored.keyId);\n\t\tif (result?.error) revokeError = result.error.message;\n\t}\n\tawait deps.store.clear();\n\tif (revokeError) {\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"api_error\", revokeError))}\\n`);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\tdeps.stdout(`${JSON.stringify({ ok: true })}\\n`);\n\treturn { exitCode: 0 };\n}\n","import { randomUUID } from \"node:crypto\";\nimport { stat } from \"node:fs/promises\";\nimport { basename, extname } from \"node:path\";\nimport { resolveCredential } from \"../auth.js\";\nimport {\n\ttype ParsedDropOptions,\n\tparseDropOptions,\n\ttype RawDropOptions,\n} from \"../options.js\";\nimport {\n\ttype ApiErrorDetails,\n\tapiErrorEnvelope,\n\terrorEnvelope,\n\texitCodeFor,\n} from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport { readJsonObjectFile } from \"./json_body.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| {\n\t\t\tdata: null;\n\t\t\terror: ApiErrorDetails;\n\t\t\theaders?: Record<string, string>;\n\t };\n\ntype DropData = { url: string; [key: string]: unknown };\n\ntype ManifestFile = {\n\tpath: string;\n\tcontentType: string;\n\tsizeBytes: number;\n};\n\ntype PreparedResult =\n\t| { kind: \"json\"; body: Record<string, unknown> }\n\t| {\n\t\t\tkind: \"staged\";\n\t\t\tmanifest: { files: ManifestFile[]; entry?: string | null };\n\t\t\toptions: Record<string, unknown>;\n\t\t\tmetadata?: Record<string, unknown>;\n\t };\n\ntype PublishClient = {\n\tpublish(\n\t\tinput: string,\n\t\toptions: ParsedDropOptions,\n\t): Promise<SdkResult<DropData>>;\n\tprepare?(input: string, options: ParsedDropOptions): Promise<PreparedResult>;\n\tdrops: {\n\t\tcreateRaw(\n\t\t\tbody: unknown,\n\t\t\toptions?: { idempotencyKey?: string },\n\t\t): Promise<SdkResult<DropData>>;\n\t};\n};\n\ntype PublishOptions = RawDropOptions & {\n\tdryRun?: boolean;\n\tfromJson?: string;\n\tjson?: boolean;\n\tquiet?: boolean;\n\turl?: boolean;\n\tapiKey?: string;\n};\n\ntype PublishDeps = {\n\tstore: CredentialStore;\n\tclient: PublishClient;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\treadJsonObject?: (path: string) => Promise<Record<string, unknown>>;\n\toutputMode?: \"human\" | \"json\";\n};\n\nconst MAX_BUNDLE_FILE_COUNT = 200;\n\nexport async function runPublish(\n\tinput: string | string[] | undefined,\n\traw: PublishOptions,\n\tdeps: PublishDeps,\n): Promise<{ exitCode: number }> {\n\tconst credential = await resolveCredential({\n\t\t...(raw.apiKey ? { apiKey: raw.apiKey } : {}),\n\t\tenv: deps.env,\n\t\tstore: deps.store,\n\t});\n\tif (!credential) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"auth_error\") };\n\t}\n\n\tif (raw.dryRun) {\n\t\treturn handlePublishDryRun(input, raw, deps);\n\t}\n\n\tconst singleInput = Array.isArray(input) ? input[0] : input;\n\ttry {\n\t\tif (raw.fromJson && singleInput) {\n\t\t\tthrow new Error(\"Use either <input> or --from-json, not both.\");\n\t\t}\n\t\tconst options = withPublishIdempotency(await parseDropOptions(raw));\n\t\tconst result = raw.fromJson\n\t\t\t? await deps.client.drops.createRaw(\n\t\t\t\t\tawait (deps.readJsonObject ?? readJsonObjectFile)(raw.fromJson),\n\t\t\t\t\toptions.idempotencyKey\n\t\t\t\t\t\t? { idempotencyKey: options.idempotencyKey }\n\t\t\t\t\t\t: {},\n\t\t\t\t)\n\t\t\t: singleInput\n\t\t\t\t? await deps.client.publish(singleInput, options)\n\t\t\t\t: (() => {\n\t\t\t\t\t\tthrow new Error(\"Publish requires <input> or --from-json.\");\n\t\t\t\t\t})();\n\t\tif (result.error) {\n\t\t\tdeps.stderr(`${JSON.stringify(apiErrorEnvelope(result.error))}\\n`);\n\t\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t\t}\n\t\tif (raw.url) deps.stdout(`${result.data.url}\\n`);\n\t\telse if (deps.outputMode === \"human\")\n\t\t\tdeps.stdout(`Published: ${result.data.url}\\n`);\n\t\telse deps.stdout(`${JSON.stringify({ ok: true, drop: result.data })}\\n`);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"Publish failed.\";\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"invalid_usage\", message))}\\n`);\n\t\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n\t}\n}\n\nasync function handlePublishDryRun(\n\tinput: string | string[] | undefined,\n\traw: PublishOptions,\n\tdeps: PublishDeps,\n): Promise<{ exitCode: number }> {\n\tif (raw.url) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"invalid_usage\", \"--url and --dry-run cannot be combined.\", \"Remove --url; dry-run outputs JSON describing what would be published.\"))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n\t}\n\ttry {\n\t\tif (raw.fromJson) {\n\t\t\tif (input)\n\t\t\t\tthrow new Error(\"Use either <input> or --from-json, not both.\");\n\t\t\tconst body = await (deps.readJsonObject ?? readJsonObjectFile)(\n\t\t\t\traw.fromJson,\n\t\t\t);\n\t\t\tdeps.stdout(\n\t\t\t\t`${JSON.stringify({ dryRun: true, kind: \"raw_json\", endpoint: \"POST /drops\", body }, null, 2)}\\n`,\n\t\t\t);\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\n\t\tif (!input || (Array.isArray(input) && input.length === 0)) {\n\t\t\tthrow new Error(\"Publish requires <input> or --from-json.\");\n\t\t}\n\n\t\tconst options = await parseDropOptions(raw);\n\n\t\tif (Array.isArray(input)) {\n\t\t\treturn dryRunMultiFile(input, options, deps);\n\t\t}\n\n\t\tif (!deps.client.prepare) {\n\t\t\tthrow new Error(\"Client does not support dry-run.\");\n\t\t}\n\t\tconst prepared = await deps.client.prepare(input, options);\n\t\tconst output = formatDryRunOutput(prepared);\n\t\tvalidateDryRunOutput(output);\n\t\twarnInlineSize(output, deps);\n\t\tdeps.stdout(`${JSON.stringify(output, null, 2)}\\n`);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst code = isFileSystemError(error)\n\t\t\t? \"local_input_error\"\n\t\t\t: \"invalid_usage\";\n\t\tconst message = error instanceof Error ? error.message : \"Dry-run failed.\";\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(code, message))}\\n`);\n\t\treturn { exitCode: exitCodeFor(code) };\n\t}\n}\n\nasync function dryRunMultiFile(\n\tinputs: string[],\n\toptions: ParsedDropOptions,\n\tdeps: PublishDeps,\n): Promise<{ exitCode: number }> {\n\tconst files: ManifestFile[] = [];\n\tfor (const filePath of inputs) {\n\t\tlet info: Awaited<ReturnType<typeof stat>>;\n\t\ttry {\n\t\t\tinfo = await stat(filePath);\n\t\t} catch {\n\t\t\tdeps.stderr(\n\t\t\t\t`${JSON.stringify(errorEnvelope(\"local_input_error\", `File not found: ${filePath}`))}\\n`,\n\t\t\t);\n\t\t\treturn { exitCode: exitCodeFor(\"local_input_error\") };\n\t\t}\n\t\tif (info.isDirectory()) {\n\t\t\tdeps.stderr(\n\t\t\t\t`${JSON.stringify(errorEnvelope(\"local_input_error\", `Cannot mix directories with multiple file arguments. Use a single folder instead: dropthis publish ${filePath}`))}\\n`,\n\t\t\t);\n\t\t\treturn { exitCode: exitCodeFor(\"local_input_error\") };\n\t\t}\n\t\tfiles.push({\n\t\t\tpath: basename(filePath),\n\t\t\tcontentType: mimeForPath(filePath),\n\t\t\tsizeBytes: info.size,\n\t\t});\n\t}\n\n\tif (files.length > MAX_BUNDLE_FILE_COUNT) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"local_input_error\", `Bundle contains ${files.length} files, exceeding the maximum of ${MAX_BUNDLE_FILE_COUNT}.`))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"local_input_error\") };\n\t}\n\n\tconst entry =\n\t\toptions.entry ??\n\t\tfiles.find((f) => f.path === \"index.html\")?.path ??\n\t\tfiles[0]?.path ??\n\t\tnull;\n\tconst totalBytes = files.reduce((sum, f) => sum + f.sizeBytes, 0);\n\tconst output = {\n\t\tdryRun: true as const,\n\t\tkind: \"staged\" as const,\n\t\tmanifest: { files, entry },\n\t\toptions: dryRunOptionsBody(options),\n\t\ttotalBytes,\n\t};\n\n\tdeps.stdout(`${JSON.stringify(output, null, 2)}\\n`);\n\treturn { exitCode: 0 };\n}\n\nconst MAX_INLINE_CONTENT_BYTES = 1_048_576;\n\nfunction formatDryRunOutput(prepared: PreparedResult): Record<string, unknown> {\n\tif (prepared.kind === \"json\") {\n\t\treturn { dryRun: true, kind: \"json\", body: prepared.body };\n\t}\n\tconst totalBytes = prepared.manifest.files.reduce(\n\t\t(sum, f) => sum + f.sizeBytes,\n\t\t0,\n\t);\n\treturn {\n\t\tdryRun: true,\n\t\tkind: \"staged\",\n\t\tmanifest: {\n\t\t\tfiles: prepared.manifest.files,\n\t\t\tentry: prepared.manifest.entry ?? null,\n\t\t},\n\t\toptions: prepared.options,\n\t\t...(prepared.metadata ? { metadata: prepared.metadata } : {}),\n\t\ttotalBytes,\n\t};\n}\n\nfunction warnInlineSize(\n\toutput: Record<string, unknown>,\n\tdeps: PublishDeps,\n): void {\n\tif (output.kind !== \"json\") return;\n\tconst body = output.body as Record<string, unknown>;\n\tconst content = body?.content;\n\tif (typeof content !== \"string\") return;\n\tconst sizeBytes = Buffer.byteLength(content);\n\tif (sizeBytes > MAX_INLINE_CONTENT_BYTES) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify({ warning: `Inline content is ${sizeBytes} bytes, exceeding the ${MAX_INLINE_CONTENT_BYTES} byte threshold. The server will use staged upload.` })}\\n`,\n\t\t);\n\t}\n}\n\nfunction validateDryRunOutput(output: Record<string, unknown>): void {\n\tif (output.kind !== \"staged\") return;\n\tconst manifest = output.manifest as {\n\t\tfiles: ManifestFile[];\n\t};\n\tif (manifest.files.length > MAX_BUNDLE_FILE_COUNT) {\n\t\tthrow Object.assign(\n\t\t\tnew Error(\n\t\t\t\t`Bundle contains ${manifest.files.length} files, exceeding the maximum of ${MAX_BUNDLE_FILE_COUNT}.`,\n\t\t\t),\n\t\t\t{ code: \"ELIMIT\" },\n\t\t);\n\t}\n}\n\nfunction dryRunOptionsBody(\n\toptions: ParsedDropOptions,\n): Record<string, unknown> {\n\tconst result: Record<string, unknown> = {};\n\tif (options.title) result.title = options.title;\n\tif (options.visibility) result.visibility = options.visibility;\n\tif (options.password !== undefined) result.password = options.password;\n\tif (options.noindex !== undefined) result.noindex = options.noindex;\n\tif (options.expiresAt) result.expires_at = options.expiresAt;\n\treturn result;\n}\n\nfunction mimeForPath(filePath: string): string {\n\tconst ext = extname(filePath).toLowerCase();\n\tconst types: Record<string, string> = {\n\t\t\".html\": \"text/html\",\n\t\t\".htm\": \"text/html\",\n\t\t\".css\": \"text/css\",\n\t\t\".js\": \"text/javascript\",\n\t\t\".mjs\": \"text/javascript\",\n\t\t\".json\": \"application/json\",\n\t\t\".xml\": \"application/xml\",\n\t\t\".svg\": \"image/svg+xml\",\n\t\t\".txt\": \"text/plain\",\n\t\t\".md\": \"text/markdown\",\n\t\t\".jpg\": \"image/jpeg\",\n\t\t\".jpeg\": \"image/jpeg\",\n\t\t\".png\": \"image/png\",\n\t\t\".gif\": \"image/gif\",\n\t\t\".webp\": \"image/webp\",\n\t\t\".ico\": \"image/x-icon\",\n\t\t\".avif\": \"image/avif\",\n\t\t\".pdf\": \"application/pdf\",\n\t\t\".zip\": \"application/zip\",\n\t\t\".woff\": \"font/woff\",\n\t\t\".woff2\": \"font/woff2\",\n\t\t\".ttf\": \"font/ttf\",\n\t\t\".mp4\": \"video/mp4\",\n\t\t\".webm\": \"video/webm\",\n\t};\n\treturn types[ext] ?? \"application/octet-stream\";\n}\n\nfunction isFileSystemError(error: unknown): boolean {\n\tif (!(error instanceof Error)) return false;\n\tconst code = (error as NodeJS.ErrnoException).code;\n\treturn code === \"ENOENT\" || code === \"ENOTDIR\" || code === \"ELIMIT\";\n}\n\nfunction withPublishIdempotency(options: ParsedDropOptions): ParsedDropOptions {\n\treturn options.idempotencyKey\n\t\t? options\n\t\t: { ...options, idempotencyKey: `cli_pub_${randomUUID()}` };\n}\n","import { readFile } from \"node:fs/promises\";\n\nexport async function readJsonObjectFile(\n\tpath: string,\n): Promise<Record<string, unknown>> {\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(await readFile(path, \"utf8\"));\n\t} catch (error) {\n\t\tconst message =\n\t\t\terror instanceof Error ? error.message : \"Unknown parse error\";\n\t\tthrow new Error(`Invalid JSON body in ${path}: ${message}`);\n\t}\n\tif (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n\t\tthrow new Error(\"JSON body must be an object.\");\n\t}\n\treturn parsed as Record<string, unknown>;\n}\n","import { randomUUID } from \"node:crypto\";\nimport { resolveCredential } from \"../auth.js\";\nimport {\n\ttype ParsedDropOptions,\n\tparseDropOptions,\n\ttype RawDropOptions,\n} from \"../options.js\";\nimport {\n\ttype ApiErrorDetails,\n\tapiErrorEnvelope,\n\terrorEnvelope,\n\texitCodeFor,\n} from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport { readJsonObjectFile } from \"./json_body.js\";\n\ntype SdkResult<T> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| { data: null; error: ApiErrorDetails; headers?: Record<string, string> };\n\ntype DropData = { url: string; [key: string]: unknown };\ntype UpdateOptions = ParsedDropOptions & { ifRevision?: number };\n\ntype ManifestFile = {\n\tpath: string;\n\tcontentType: string;\n\tsizeBytes: number;\n};\n\ntype PreparedResult =\n\t| { kind: \"json\"; body: Record<string, unknown> }\n\t| {\n\t\t\tkind: \"staged\";\n\t\t\tmanifest: { files: ManifestFile[]; entry?: string | null };\n\t\t\toptions: Record<string, unknown>;\n\t\t\tmetadata?: Record<string, unknown>;\n\t };\n\ntype UpdateClient = {\n\tupdate(\n\t\ttarget: string,\n\t\tinputOrOptions: string | UpdateOptions,\n\t\toptions?: UpdateOptions,\n\t): Promise<SdkResult<DropData>>;\n\tprepare?(input: string, options: ParsedDropOptions): Promise<PreparedResult>;\n\tdeployments: {\n\t\tcreateRaw(\n\t\t\tdropId: string,\n\t\t\tbody: unknown,\n\t\t\toptions?: { idempotencyKey?: string; ifRevision?: number },\n\t\t): Promise<SdkResult<DropData>>;\n\t};\n};\n\ntype RawUpdateOptions = RawDropOptions & {\n\tdryRun?: boolean;\n\tifRevision?: number;\n\tfromJson?: string;\n\tjson?: boolean;\n\tquiet?: boolean;\n\turl?: boolean;\n\tapiKey?: string;\n};\n\ntype UpdateDeps = {\n\tstore: CredentialStore;\n\tclient: UpdateClient;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\treadJsonObject?: (path: string) => Promise<Record<string, unknown>>;\n\toutputMode?: \"human\" | \"json\";\n};\n\nexport async function runUpdate(\n\ttarget: string,\n\tinput: string | undefined,\n\traw: RawUpdateOptions,\n\tdeps: UpdateDeps,\n): Promise<{ exitCode: number }> {\n\tconst credential = await resolveCredential({\n\t\t...(raw.apiKey ? { apiKey: raw.apiKey } : {}),\n\t\tenv: deps.env,\n\t\tstore: deps.store,\n\t});\n\tif (!credential) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"auth_error\", \"No API key found.\", \"Set DROPTHIS_API_KEY or run dropthis login.\"))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"auth_error\") };\n\t}\n\n\tif (raw.dryRun) {\n\t\treturn handleUpdateDryRun(target, input, raw, deps);\n\t}\n\n\ttry {\n\t\tassertDropId(target);\n\t\tif (raw.fromJson && input) {\n\t\t\tthrow new Error(\"Use either [input] or --from-json, not both.\");\n\t\t}\n\t\tconst parsed = await parseDropOptions(raw);\n\t\tconst revisionOptions =\n\t\t\traw.ifRevision !== undefined\n\t\t\t\t? { ifRevision: Number(raw.ifRevision) }\n\t\t\t\t: {};\n\t\tconst result = raw.fromJson\n\t\t\t? await deps.client.deployments.createRaw(\n\t\t\t\t\ttarget,\n\t\t\t\t\tawait (deps.readJsonObject ?? readJsonObjectFile)(raw.fromJson),\n\t\t\t\t\twithUpdateIdempotency({\n\t\t\t\t\t\t...revisionOptions,\n\t\t\t\t\t\t...(parsed.idempotencyKey\n\t\t\t\t\t\t\t? { idempotencyKey: parsed.idempotencyKey }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t: input\n\t\t\t\t? await deps.client.update(\n\t\t\t\t\t\ttarget,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\twithUpdateIdempotency({\n\t\t\t\t\t\t\t...parsed,\n\t\t\t\t\t\t\t...revisionOptions,\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t: await deps.client.update(target, parsed, revisionOptions);\n\t\tif (result.error) {\n\t\t\tdeps.stderr(`${JSON.stringify(apiErrorEnvelope(result.error))}\\n`);\n\t\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t\t}\n\t\tif (raw.url) deps.stdout(`${result.data.url}\\n`);\n\t\telse if (deps.outputMode === \"human\")\n\t\t\tdeps.stdout(`Updated: ${result.data.url}\\n`);\n\t\telse deps.stdout(`${JSON.stringify({ ok: true, drop: result.data })}\\n`);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"Update failed.\";\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"invalid_usage\", message))}\\n`);\n\t\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n\t}\n}\n\nasync function handleUpdateDryRun(\n\ttarget: string,\n\tinput: string | undefined,\n\traw: RawUpdateOptions,\n\tdeps: UpdateDeps,\n): Promise<{ exitCode: number }> {\n\tif (raw.url) {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"invalid_usage\", \"--url and --dry-run cannot be combined.\", \"Remove --url; dry-run outputs JSON describing what would be published.\"))}\\n`,\n\t\t);\n\t\treturn { exitCode: exitCodeFor(\"invalid_usage\") };\n\t}\n\ttry {\n\t\tassertDropId(target);\n\n\t\tif (raw.fromJson) {\n\t\t\tif (input)\n\t\t\t\tthrow new Error(\"Use either [input] or --from-json, not both.\");\n\t\t\tconst body = await (deps.readJsonObject ?? readJsonObjectFile)(\n\t\t\t\traw.fromJson,\n\t\t\t);\n\t\t\tdeps.stdout(\n\t\t\t\t`${JSON.stringify({ dryRun: true, kind: \"raw_json\", endpoint: `POST /drops/${target}/deployments`, body }, null, 2)}\\n`,\n\t\t\t);\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\n\t\tconst options = await parseDropOptions(raw);\n\n\t\tif (!input) {\n\t\t\tconst fields: Record<string, unknown> = {};\n\t\t\tif (options.slug) fields.slug = options.slug;\n\t\t\tif (options.title) fields.title = options.title;\n\t\t\tif (options.visibility) fields.visibility = options.visibility;\n\t\t\tif (options.password !== undefined) fields.password = options.password;\n\t\t\tif (options.noindex !== undefined) fields.noindex = options.noindex;\n\t\t\tif (options.expiresAt) fields.expires_at = options.expiresAt;\n\t\t\tif (options.metadata) fields.metadata = options.metadata;\n\t\t\tdeps.stdout(\n\t\t\t\t`${JSON.stringify({ dryRun: true, kind: \"options_update\", target, fields }, null, 2)}\\n`,\n\t\t\t);\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\n\t\tif (!deps.client.prepare) {\n\t\t\tthrow new Error(\"Client does not support dry-run.\");\n\t\t}\n\t\tconst prepared = await deps.client.prepare(input, options);\n\t\tconst output = formatUpdateDryRun(target, prepared);\n\t\tvalidateDryRunFileCount(output);\n\t\tdeps.stdout(`${JSON.stringify(output, null, 2)}\\n`);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst code = isFileSystemError(error)\n\t\t\t? \"local_input_error\"\n\t\t\t: \"invalid_usage\";\n\t\tconst message = error instanceof Error ? error.message : \"Dry-run failed.\";\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(code, message))}\\n`);\n\t\treturn { exitCode: exitCodeFor(code) };\n\t}\n}\n\nconst MAX_BUNDLE_FILE_COUNT = 200;\n\nfunction formatUpdateDryRun(\n\ttarget: string,\n\tprepared: PreparedResult,\n): Record<string, unknown> {\n\tif (prepared.kind === \"json\") {\n\t\treturn { dryRun: true, kind: \"json\", target, body: prepared.body };\n\t}\n\tconst totalBytes = prepared.manifest.files.reduce(\n\t\t(sum, f) => sum + f.sizeBytes,\n\t\t0,\n\t);\n\treturn {\n\t\tdryRun: true,\n\t\tkind: \"staged\",\n\t\ttarget,\n\t\tmanifest: {\n\t\t\tfiles: prepared.manifest.files,\n\t\t\tentry: prepared.manifest.entry ?? null,\n\t\t},\n\t\toptions: prepared.options,\n\t\t...(prepared.metadata ? { metadata: prepared.metadata } : {}),\n\t\ttotalBytes,\n\t};\n}\n\nfunction validateDryRunFileCount(output: Record<string, unknown>): void {\n\tif (output.kind !== \"staged\") return;\n\tconst manifest = output.manifest as { files: ManifestFile[] };\n\tif (manifest.files.length > MAX_BUNDLE_FILE_COUNT) {\n\t\tthrow Object.assign(\n\t\t\tnew Error(\n\t\t\t\t`Bundle contains ${manifest.files.length} files, exceeding the maximum of ${MAX_BUNDLE_FILE_COUNT}.`,\n\t\t\t),\n\t\t\t{ code: \"ELIMIT\" },\n\t\t);\n\t}\n}\n\nfunction isFileSystemError(error: unknown): boolean {\n\tif (!(error instanceof Error)) return false;\n\tconst code = (error as NodeJS.ErrnoException).code;\n\treturn code === \"ENOENT\" || code === \"ENOTDIR\";\n}\n\nfunction withUpdateIdempotency(options: UpdateOptions): UpdateOptions {\n\treturn options.idempotencyKey\n\t\t? options\n\t\t: { ...options, idempotencyKey: `cli_upd_${randomUUID()}` };\n}\n\nfunction assertDropId(target: string): void {\n\tif (!target.startsWith(\"drop_\")) {\n\t\tthrow new Error(\n\t\t\t\"Update target must be a drop id returned by --json output, for example drop_...\",\n\t\t);\n\t}\n}\n","import { maskKey, resolveCredential } from \"../auth.js\";\nimport type { CredentialStore } from \"../storage.js\";\n\nexport async function runWhoami(\n\t_input: { json?: boolean },\n\tdeps: {\n\t\tstore: CredentialStore;\n\t\tenv: Record<string, string | undefined>;\n\t\tstdout: (value: string) => void;\n\t\tstderr: (value: string) => void;\n\t},\n): Promise<{ exitCode: number }> {\n\tconst credential = await resolveCredential({\n\t\tenv: deps.env,\n\t\tstore: deps.store,\n\t});\n\tif (!credential) {\n\t\tdeps.stdout(`${JSON.stringify({ ok: true, authenticated: false })}\\n`);\n\t\treturn { exitCode: 0 };\n\t}\n\tdeps.stdout(\n\t\t`${JSON.stringify({\n\t\t\tok: true,\n\t\t\tauthenticated: true,\n\t\t\tsource: credential.source,\n\t\t\tmasked_key: maskKey(credential.apiKey),\n\t\t\t...(credential.keyId ? { key_id: credential.keyId } : {}),\n\t\t\t...(credential.keyLast4 ? { key_last4: credential.keyLast4 } : {}),\n\t\t\t...(credential.accountId ? { account_id: credential.accountId } : {}),\n\t\t\t...(credential.email ? { email: credential.email } : {}),\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n","import { Dropthis } from \"@dropthis/sdk\";\nimport { createOutput, type Output } from \"./output.js\";\n\nexport type GlobalOptions = {\n\tapiKey?: string;\n\tapiUrl?: string;\n\tjson?: boolean;\n\tquiet?: boolean;\n};\n\nexport type CliContext = {\n\tenv: Record<string, string | undefined>;\n\tglobal: GlobalOptions;\n\toutput: Output;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\tcreateClient: (apiKey?: string) => Dropthis;\n};\n\nexport function createContext(input: {\n\tglobal?: GlobalOptions;\n\tenv?: Record<string, string | undefined>;\n\tstdout?: (value: string) => void;\n\tstderr?: (value: string) => void;\n\tstdoutIsTTY?: boolean;\n}): CliContext {\n\tconst env = input.env ?? process.env;\n\tconst global = input.global ?? {};\n\treturn {\n\t\tenv,\n\t\tglobal,\n\t\toutput: createOutput({\n\t\t\t...(global.json !== undefined ? { json: global.json } : {}),\n\t\t\t...(global.quiet !== undefined ? { quiet: global.quiet } : {}),\n\t\t\tstdoutIsTTY: input.stdoutIsTTY ?? process.stdout.isTTY === true,\n\t\t\tenv,\n\t\t}),\n\t\tstdout: input.stdout ?? ((value) => process.stdout.write(value)),\n\t\tstderr: input.stderr ?? ((value) => process.stderr.write(value)),\n\t\tcreateClient(apiKey) {\n\t\t\tconst baseUrl = global.apiUrl ?? env.DROPTHIS_API_URL;\n\t\t\treturn new Dropthis({\n\t\t\t\t...(apiKey ? { apiKey } : {}),\n\t\t\t\t...(baseUrl ? { baseUrl } : {}),\n\t\t\t});\n\t\t},\n\t};\n}\n","import { chmod, mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\nimport { Entry } from \"@napi-rs/keyring\";\n\nexport type StoredCredential = {\n\tapiKey: string;\n\tkeyId?: string;\n\tkeyLast4?: string;\n\taccountId?: string;\n\temail?: string;\n\tstorage: \"secure\" | \"insecure\";\n};\n\nexport interface CredentialStore {\n\tread(): Promise<StoredCredential | null>;\n\tsave(credential: StoredCredential): Promise<void>;\n\tclear(): Promise<void>;\n}\n\nexport type KeyringAdapter = {\n\tgetPassword(): string | null | undefined | Promise<string | null | undefined>;\n\tsetPassword(value: string): void | Promise<void>;\n\tdeletePassword(): void | Promise<void>;\n};\n\nexport class MemoryCredentialStore implements CredentialStore {\n\tprivate credential: StoredCredential | null = null;\n\n\tasync read(): Promise<StoredCredential | null> {\n\t\treturn this.credential;\n\t}\n\n\tasync save(credential: StoredCredential): Promise<void> {\n\t\tthis.credential = credential;\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tthis.credential = null;\n\t}\n}\n\nexport class InsecureFileCredentialStore implements CredentialStore {\n\tprivate readonly filePath: string;\n\n\tconstructor(options: { configDir?: string } = {}) {\n\t\tthis.filePath = credentialPath(options.configDir);\n\t}\n\n\tasync read(): Promise<StoredCredential | null> {\n\t\tconst value = await readJsonFile(this.filePath);\n\t\treturn value\n\t\t\t? ({ ...value, storage: \"insecure\" } as StoredCredential)\n\t\t\t: null;\n\t}\n\n\tasync save(credential: StoredCredential): Promise<void> {\n\t\tawait writeCredentialFile(this.filePath, {\n\t\t\t...credential,\n\t\t\tstorage: \"insecure\",\n\t\t});\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tawait rm(this.filePath, { force: true });\n\t}\n}\n\nexport class KeyringCredentialStore implements CredentialStore {\n\tprivate readonly filePath: string;\n\tprivate readonly keyring: KeyringAdapter;\n\n\tconstructor(options: { configDir?: string; keyring?: KeyringAdapter } = {}) {\n\t\tthis.filePath = credentialPath(options.configDir);\n\t\tthis.keyring = options.keyring ?? defaultKeyringAdapter();\n\t}\n\n\tasync read(): Promise<StoredCredential | null> {\n\t\tconst metadata = await readJsonFile(this.filePath);\n\t\tif (!metadata) return null;\n\t\tconst apiKey = await this.keyring.getPassword();\n\t\tif (!apiKey) return null;\n\t\treturn { ...metadata, apiKey, storage: \"secure\" } as StoredCredential;\n\t}\n\n\tasync save(credential: StoredCredential): Promise<void> {\n\t\tawait this.keyring.setPassword(credential.apiKey);\n\t\tconst { apiKey: _apiKey, ...metadata } = credential;\n\t\tawait writeCredentialFile(this.filePath, {\n\t\t\t...metadata,\n\t\t\tstorage: \"secure\",\n\t\t});\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tawait this.keyring.deletePassword();\n\t\tawait rm(this.filePath, { force: true });\n\t}\n}\n\nexport function createCredentialStore(\n\toptions: { insecure?: boolean; configDir?: string } = {},\n): CredentialStore {\n\tif (options.insecure) return new InsecureFileCredentialStore(options);\n\treturn new KeyringCredentialStore(options);\n}\n\nfunction defaultKeyringAdapter(): KeyringAdapter {\n\tconst entry = new Entry(\"dropthis\", \"default\");\n\treturn {\n\t\tgetPassword: () => entry.getPassword(),\n\t\tsetPassword: (value) => entry.setPassword(value),\n\t\tdeletePassword: () => {\n\t\t\tentry.deletePassword();\n\t\t},\n\t};\n}\n\nfunction credentialPath(configDir?: string): string {\n\treturn join(\n\t\tconfigDir ?? join(homedir(), \".config\", \"dropthis\"),\n\t\t\"credentials.json\",\n\t);\n}\n\nasync function readJsonFile(\n\tpath: string,\n): Promise<Record<string, unknown> | null> {\n\ttry {\n\t\treturn JSON.parse(await readFile(path, \"utf8\")) as Record<string, unknown>;\n\t} catch (error) {\n\t\tif (\n\t\t\terror &&\n\t\t\ttypeof error === \"object\" &&\n\t\t\t\"code\" in error &&\n\t\t\terror.code === \"ENOENT\"\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nasync function writeCredentialFile(\n\tpath: string,\n\tcredential: Record<string, unknown>,\n): Promise<void> {\n\tawait mkdir(dirname(path), { recursive: true });\n\tawait writeFile(path, `${JSON.stringify(credential, null, 2)}\\n`, {\n\t\tmode: 0o600,\n\t});\n\tawait chmod(path, 0o600);\n}\n","#!/usr/bin/env node\nimport { buildProgram } from \"./program.js\";\n\nbuildProgram()\n\t.parseAsync(process.argv)\n\t.catch((error: unknown) => {\n\t\tconsole.error(error);\n\t\tprocess.exitCode = 1;\n\t});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAwB;;;ACWxB,eAAsB,kBAAkB,OAID;AACtC,MAAI,MAAM,OAAQ,QAAO,EAAE,QAAQ,MAAM,QAAQ,QAAQ,OAAO;AAChE,MAAI,MAAM,IAAI,kBAAkB;AAC/B,WAAO,EAAE,QAAQ,MAAM,IAAI,kBAAkB,QAAQ,MAAM;AAAA,EAC5D;AACA,QAAM,SAAS,MAAM,MAAM,MAAM,KAAK;AACtC,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO;AAAA,IACN,QAAQ,OAAO;AAAA,IACf,QAAQ;AAAA,IACR,GAAI,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AAAA,IAC9C,GAAI,OAAO,WAAW,EAAE,UAAU,OAAO,SAAS,IAAI,CAAC;AAAA,IACvD,GAAI,OAAO,YAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,IAC1D,GAAI,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AAAA,EAC/C;AACD;AAEO,SAAS,QAAQ,QAAwB;AAC/C,SAAO,OAAO,UAAU,IACrB,WACA,GAAG,OAAO,MAAM,GAAG,CAAC,CAAC,MAAM,OAAO,MAAM,EAAE,CAAC;AAC/C;;;ACXA,IAAM,sBAA8C;AAAA,EACnD,gBAAgB;AAAA,EAChB,qBACC;AAAA,EACD,4BACC;AAAA,EACD,yBACC;AAAA,EACD,qBAAqB;AACtB;AAEO,SAAS,aAAa,OAKlB;AACV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AAK,YAAY,GAAG;AACvB,YAAM,IAAI;AAAA,QACT,sGAAsG,QAAQ;AAAA,MAC/G;AAAA,IACD;AACA,UAAM,WAAW,aAAa,QAAQ;AACtC,UAAM,SAAS,UAAUA,MAAK,QAAQ,QAAQ,CAAC;AAAA,EAChD;AACA,SAAO;AACR;AAEA,eAAe,eACd,OACkB;AAClB,QAAM,SAAmB,CAAC;AAC1B,mBAAiB,SAAS,OAAO;AAChC,WAAO;AAAA,MACN,OAAO,UAAU,WAAW,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK;AAAA,IACnE;AAAA,EACD;AACA,SAAO,OAAO,OAAO,MAAM;AAC5B;;;AkBlnBA,aAAa,EACX,WAAW,QAAQ,IAAI,EACvB,MAAM,CAAC,UAAmB;AAC1B,UAAQ,MAAM,KAAK;AACnB,UAAQ,WAAW;AACpB,CAAC;","names":["hasCredential","authError","hasCredential","authError","apiError","listItems","invalidUsage","import_promises","import_promises","import_node_crypto","isFileSystemError","MAX_BUNDLE_FILE_COUNT","import_promises","import_node_path","writeFile","join"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dropthis",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Official CLI for Dropthis.",
5
5
  "license": "MIT",
6
6
  "repository": {