@dropthis/cli 0.6.0 → 0.6.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 +0 -1
- package/dist/cli.cjs +18 -80
- package/dist/cli.cjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -108,7 +108,6 @@ All publish flags:
|
|
|
108
108
|
| `--metadata <json>` | Metadata as JSON string |
|
|
109
109
|
| `--metadata-file <path>` | Metadata from a JSON file |
|
|
110
110
|
| `--idempotency-key <key>` | Idempotency key |
|
|
111
|
-
| `--from-json <path>` | Read exact POST /drops JSON request body from file |
|
|
112
111
|
| `--url` | Print only the URL, nothing else |
|
|
113
112
|
| `--json` | Output full JSON response |
|
|
114
113
|
| `--dry-run` | Validate without publishing |
|
package/dist/cli.cjs
CHANGED
|
@@ -754,13 +754,13 @@ async function runDoctor(_input, deps) {
|
|
|
754
754
|
const authSource = credential?.source ?? "missing";
|
|
755
755
|
const storageBackend = stored?.storage ?? "none";
|
|
756
756
|
const pairs = [
|
|
757
|
-
["Version", "0.6.
|
|
757
|
+
["Version", "0.6.1"],
|
|
758
758
|
["Auth", authSource],
|
|
759
759
|
["Storage", storageBackend]
|
|
760
760
|
];
|
|
761
761
|
writeKv(deps, pairs, {
|
|
762
762
|
ok: true,
|
|
763
|
-
version: "0.6.
|
|
763
|
+
version: "0.6.1",
|
|
764
764
|
auth: { source: authSource },
|
|
765
765
|
storage: { backend: storageBackend }
|
|
766
766
|
});
|
|
@@ -1140,22 +1140,6 @@ function shouldSpin(outputMode) {
|
|
|
1140
1140
|
return outputMode === "human" && process.stderr.isTTY === true && !process.env.CI;
|
|
1141
1141
|
}
|
|
1142
1142
|
|
|
1143
|
-
// src/commands/json_body.ts
|
|
1144
|
-
var import_promises2 = require("fs/promises");
|
|
1145
|
-
async function readJsonObjectFile(path) {
|
|
1146
|
-
let parsed;
|
|
1147
|
-
try {
|
|
1148
|
-
parsed = JSON.parse(await (0, import_promises2.readFile)(path, "utf8"));
|
|
1149
|
-
} catch (error2) {
|
|
1150
|
-
const message = error2 instanceof Error ? error2.message : "Unknown parse error";
|
|
1151
|
-
throw new Error(`Invalid JSON body in ${path}: ${message}`);
|
|
1152
|
-
}
|
|
1153
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
1154
|
-
throw new Error("JSON body must be an object.");
|
|
1155
|
-
}
|
|
1156
|
-
return parsed;
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
1143
|
// src/commands/publish.ts
|
|
1160
1144
|
async function runPublish(input, raw, deps) {
|
|
1161
1145
|
let credential;
|
|
@@ -1192,14 +1176,9 @@ async function runPublish(input, raw, deps) {
|
|
|
1192
1176
|
const hasInput = Array.isArray(input) ? input.length > 0 : input !== void 0;
|
|
1193
1177
|
const spin = shouldSpin(deps.outputMode) ? createSpinner("Publishing\u2026", deps.stderr) : void 0;
|
|
1194
1178
|
try {
|
|
1195
|
-
if (raw.fromJson && hasInput) {
|
|
1196
|
-
throw new Error("Use either <input> or --from-json, not both.");
|
|
1197
|
-
}
|
|
1198
1179
|
const options = withIdempotencyKey(await parseDropOptions(raw), "pub");
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
const doPublish = (c) => jsonBody ? c.drops.createRaw(jsonBody, idempotencyOpt) : hasInput ? c.publish(input, options) : (() => {
|
|
1202
|
-
throw new Error("Publish requires <input> or --from-json.");
|
|
1180
|
+
const doPublish = (c) => hasInput ? c.publish(input, options) : (() => {
|
|
1181
|
+
throw new Error("Publish requires <input>.");
|
|
1203
1182
|
})();
|
|
1204
1183
|
const result = await doPublish(client);
|
|
1205
1184
|
if (result.error) {
|
|
@@ -1259,20 +1238,8 @@ async function handlePublishDryRun(input, raw, deps, client) {
|
|
|
1259
1238
|
);
|
|
1260
1239
|
}
|
|
1261
1240
|
try {
|
|
1262
|
-
if (raw.fromJson) {
|
|
1263
|
-
if (input)
|
|
1264
|
-
throw new Error("Use either <input> or --from-json, not both.");
|
|
1265
|
-
const body = await (deps.readJsonObject ?? readJsonObjectFile)(
|
|
1266
|
-
raw.fromJson
|
|
1267
|
-
);
|
|
1268
|
-
deps.stdout(
|
|
1269
|
-
`${JSON.stringify({ ok: true, dryRun: true, kind: "raw_json", endpoint: "POST /drops", body }, null, 2)}
|
|
1270
|
-
`
|
|
1271
|
-
);
|
|
1272
|
-
return { exitCode: 0 };
|
|
1273
|
-
}
|
|
1274
1241
|
if (!input || Array.isArray(input) && input.length === 0) {
|
|
1275
|
-
throw new Error("Publish requires <input
|
|
1242
|
+
throw new Error("Publish requires <input>.");
|
|
1276
1243
|
}
|
|
1277
1244
|
const options = await parseDropOptions(raw);
|
|
1278
1245
|
if (!client.prepare) {
|
|
@@ -1313,12 +1280,9 @@ async function runUpdate(target, input, raw, deps) {
|
|
|
1313
1280
|
let spin;
|
|
1314
1281
|
try {
|
|
1315
1282
|
assertDropId(target);
|
|
1316
|
-
if (raw.fromJson && input) {
|
|
1317
|
-
throw new Error("Use either [input] or --from-json, not both.");
|
|
1318
|
-
}
|
|
1319
1283
|
let updateInput = input;
|
|
1320
1284
|
let parsed = await parseDropOptions(raw);
|
|
1321
|
-
if (!updateInput && !
|
|
1285
|
+
if (!updateInput && !hasUpdateFields(parsed)) {
|
|
1322
1286
|
if (shouldPromptForUpdate(deps)) {
|
|
1323
1287
|
const prompted = await promptForUpdate(target, deps.prompts ?? prompts4);
|
|
1324
1288
|
if (!prompted) return { exitCode: 0 };
|
|
@@ -1335,17 +1299,7 @@ async function runUpdate(target, input, raw, deps) {
|
|
|
1335
1299
|
}
|
|
1336
1300
|
const revisionOptions = raw.ifRevision !== void 0 ? { ifRevision: Number(raw.ifRevision) } : {};
|
|
1337
1301
|
spin = shouldSpin(deps.outputMode) ? createSpinner("Updating\u2026", deps.stderr) : void 0;
|
|
1338
|
-
const result =
|
|
1339
|
-
target,
|
|
1340
|
-
await (deps.readJsonObject ?? readJsonObjectFile)(raw.fromJson),
|
|
1341
|
-
withIdempotencyKey(
|
|
1342
|
-
{
|
|
1343
|
-
...revisionOptions,
|
|
1344
|
-
...parsed.idempotencyKey ? { idempotencyKey: parsed.idempotencyKey } : {}
|
|
1345
|
-
},
|
|
1346
|
-
"upd"
|
|
1347
|
-
)
|
|
1348
|
-
) : updateInput ? await deps.client.deploy(
|
|
1302
|
+
const result = updateInput ? await deps.client.deploy(
|
|
1349
1303
|
target,
|
|
1350
1304
|
updateInput,
|
|
1351
1305
|
withIdempotencyKey({ ...parsed, ...revisionOptions }, "upd")
|
|
@@ -1536,18 +1490,6 @@ async function handleUpdateDryRun(target, input, raw, deps) {
|
|
|
1536
1490
|
}
|
|
1537
1491
|
try {
|
|
1538
1492
|
assertDropId(target);
|
|
1539
|
-
if (raw.fromJson) {
|
|
1540
|
-
if (input)
|
|
1541
|
-
throw new Error("Use either [input] or --from-json, not both.");
|
|
1542
|
-
const body = await (deps.readJsonObject ?? readJsonObjectFile)(
|
|
1543
|
-
raw.fromJson
|
|
1544
|
-
);
|
|
1545
|
-
deps.stdout(
|
|
1546
|
-
`${JSON.stringify({ ok: true, dryRun: true, kind: "raw_json", endpoint: `POST /drops/${target}/deployments`, body }, null, 2)}
|
|
1547
|
-
`
|
|
1548
|
-
);
|
|
1549
|
-
return { exitCode: 0 };
|
|
1550
|
-
}
|
|
1551
1493
|
const options = await parseDropOptions(raw);
|
|
1552
1494
|
if (!input) {
|
|
1553
1495
|
const fields = {};
|
|
@@ -1663,7 +1605,7 @@ function createContext(input) {
|
|
|
1663
1605
|
}
|
|
1664
1606
|
|
|
1665
1607
|
// src/storage.ts
|
|
1666
|
-
var
|
|
1608
|
+
var import_promises2 = require("fs/promises");
|
|
1667
1609
|
var import_node_os = require("os");
|
|
1668
1610
|
var import_node_path = require("path");
|
|
1669
1611
|
var import_keyring = require("@napi-rs/keyring");
|
|
@@ -1697,7 +1639,7 @@ var InsecureFileCredentialStore = class {
|
|
|
1697
1639
|
});
|
|
1698
1640
|
}
|
|
1699
1641
|
async clear() {
|
|
1700
|
-
await (0,
|
|
1642
|
+
await (0, import_promises2.rm)(this.filePath, { force: true });
|
|
1701
1643
|
}
|
|
1702
1644
|
};
|
|
1703
1645
|
var KeyringCredentialStore = class {
|
|
@@ -1724,7 +1666,7 @@ var KeyringCredentialStore = class {
|
|
|
1724
1666
|
}
|
|
1725
1667
|
async clear() {
|
|
1726
1668
|
await this.keyring.deletePassword();
|
|
1727
|
-
await (0,
|
|
1669
|
+
await (0, import_promises2.rm)(this.filePath, { force: true });
|
|
1728
1670
|
}
|
|
1729
1671
|
};
|
|
1730
1672
|
function createCredentialStore(options = {}) {
|
|
@@ -1749,7 +1691,7 @@ function credentialPath(configDir) {
|
|
|
1749
1691
|
}
|
|
1750
1692
|
async function readJsonFile(path) {
|
|
1751
1693
|
try {
|
|
1752
|
-
return JSON.parse(await (0,
|
|
1694
|
+
return JSON.parse(await (0, import_promises2.readFile)(path, "utf8"));
|
|
1753
1695
|
} catch (error2) {
|
|
1754
1696
|
if (error2 && typeof error2 === "object" && "code" in error2 && error2.code === "ENOENT") {
|
|
1755
1697
|
return null;
|
|
@@ -1758,14 +1700,14 @@ async function readJsonFile(path) {
|
|
|
1758
1700
|
}
|
|
1759
1701
|
}
|
|
1760
1702
|
async function writeCredentialFile(path, credential) {
|
|
1761
|
-
await (0,
|
|
1703
|
+
await (0, import_promises2.mkdir)((0, import_node_path.dirname)(path), { recursive: true });
|
|
1762
1704
|
const tmpPath = `${path}.${process.pid}.tmp`;
|
|
1763
|
-
await (0,
|
|
1705
|
+
await (0, import_promises2.writeFile)(tmpPath, `${JSON.stringify(credential, null, 2)}
|
|
1764
1706
|
`, {
|
|
1765
1707
|
mode: 384
|
|
1766
1708
|
});
|
|
1767
|
-
await (0,
|
|
1768
|
-
await (0,
|
|
1709
|
+
await (0, import_promises2.chmod)(tmpPath, 384);
|
|
1710
|
+
await (0, import_promises2.rename)(tmpPath, path);
|
|
1769
1711
|
}
|
|
1770
1712
|
|
|
1771
1713
|
// src/program.ts
|
|
@@ -1794,7 +1736,7 @@ function buildProgram(options = {}) {
|
|
|
1794
1736
|
` ${import_picocolors4.default.cyan("dropthis login")}`,
|
|
1795
1737
|
` ${import_picocolors4.default.cyan("dropthis publish ./dist")}`
|
|
1796
1738
|
].join("\n")
|
|
1797
|
-
).version("0.6.
|
|
1739
|
+
).version("0.6.1").configureHelp({
|
|
1798
1740
|
subcommandTerm(cmd) {
|
|
1799
1741
|
const args = cmd.registeredArguments.map((a) => {
|
|
1800
1742
|
const name = a.name();
|
|
@@ -1827,12 +1769,12 @@ function buildProgram(options = {}) {
|
|
|
1827
1769
|
).option("--metadata-file <path>", "Read metadata JSON from a file").option("--path <name>", "Set filename when publishing from stdin").option("--url", "Print only the published URL (no JSON envelope)").option(
|
|
1828
1770
|
"--dry-run",
|
|
1829
1771
|
"Show what would be published without publishing (JSON; cannot combine with --url)"
|
|
1830
|
-
).option("--json", "Force JSON output").option(
|
|
1772
|
+
).option("--json", "Force JSON output").option(
|
|
1831
1773
|
"--idempotency-key <key>",
|
|
1832
1774
|
"Prevent duplicate publishes on retry (auto-generated)"
|
|
1833
1775
|
).action(async (inputs, commandOptions) => {
|
|
1834
1776
|
const stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;
|
|
1835
|
-
if (inputs.length === 0 && stdinIsTTY
|
|
1777
|
+
if (inputs.length === 0 && stdinIsTTY) {
|
|
1836
1778
|
program.outputHelp();
|
|
1837
1779
|
return;
|
|
1838
1780
|
}
|
|
@@ -1896,9 +1838,6 @@ function buildProgram(options = {}) {
|
|
|
1896
1838
|
"--dry-run",
|
|
1897
1839
|
"Show what would be updated without updating (JSON; cannot combine with --url)"
|
|
1898
1840
|
).option("--json", "Force JSON output").option(
|
|
1899
|
-
"--from-json <path>",
|
|
1900
|
-
"Send raw API deployment body from a JSON file"
|
|
1901
|
-
).option(
|
|
1902
1841
|
"--idempotency-key <key>",
|
|
1903
1842
|
"Prevent duplicate updates on retry (auto-generated)"
|
|
1904
1843
|
).action(
|
|
@@ -2212,7 +2151,6 @@ function toDropOptions(options) {
|
|
|
2212
2151
|
...options.quiet !== void 0 ? { quiet: options.quiet } : {},
|
|
2213
2152
|
...options.url !== void 0 ? { url: options.url } : {},
|
|
2214
2153
|
...options.ifRevision !== void 0 ? { ifRevision: options.ifRevision } : {},
|
|
2215
|
-
...options.fromJson ? { fromJson: options.fromJson } : {},
|
|
2216
2154
|
...options.dryRun ? { dryRun: options.dryRun } : {}
|
|
2217
2155
|
};
|
|
2218
2156
|
}
|
package/dist/cli.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/inline-auth.ts","../src/cli.ts","../src/output.ts","../src/program.ts","../src/auth.ts","../src/fmt.ts","../src/ui.ts","../src/commands/account.ts","../src/commands/api-keys.ts","../src/types.ts","../src/catalog.ts","../src/commands/commands.ts","../src/commands/deployments.ts","../src/commands/doctor.ts","../src/commands/drops.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/drop-operations.ts","../src/options.ts","../src/spinner.ts","../src/commands/json_body.ts","../src/commands/publish.ts","../src/commands/update.ts","../src/commands/whoami.ts","../src/context.ts","../src/storage.ts"],"sourcesContent":["import { hostname as osHostname } from \"node:os\";\nimport { createInterface } from \"node:readline\";\nimport type { ResolvedCredential } from \"./auth.js\";\nimport type { CredentialStore } from \"./storage.js\";\nimport type { SdkErrorMessage, SdkResult } from \"./types.js\";\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\nexport type InlineAuthClient = {\n\tauth: {\n\t\trequestEmailOtp(input: {\n\t\t\temail: string;\n\t\t}): Promise<SdkResult<OtpRequestData, SdkErrorMessage>>;\n\t\tverifyEmailOtp(input: {\n\t\t\temail: string;\n\t\t\tcode: string;\n\t\t}): Promise<SdkResult<SessionData, SdkErrorMessage>>;\n\t};\n\tapiKeys: {\n\t\tcreate(input: {\n\t\t\tlabel: string;\n\t\t}): Promise<SdkResult<ApiKeyData, SdkErrorMessage>>;\n\t};\n};\n\ntype InlineAuthDeps = {\n\tclient: InlineAuthClient;\n\tcreateClient: (apiKey: string) => InlineAuthClient;\n\tstore: CredentialStore;\n\tstderr: (value: string) => void;\n\thostname?: string;\n\tprompt?: {\n\t\temail: () => Promise<string | symbol>;\n\t\tcode: (attempt: number, maxAttempts: number) => Promise<string | symbol>;\n\t};\n};\n\nexport async function runInlineAuth(\n\tdeps: InlineAuthDeps,\n): Promise<ResolvedCredential | null> {\n\ttry {\n\t\tconst prompt = deps.prompt ?? defaultPrompts();\n\n\t\tdeps.stderr(\"\\nNot logged in. Let's fix that:\\n\");\n\n\t\tconst emailResult = await prompt.email();\n\t\tif (typeof emailResult === \"symbol\") {\n\t\t\treturn null;\n\t\t}\n\t\tconst email = emailResult;\n\n\t\tconst otpRequest = await deps.client.auth.requestEmailOtp({ email });\n\t\tif (otpRequest.error) {\n\t\t\tdeps.stderr(`${otpRequest.error.message}\\n`);\n\t\t\treturn null;\n\t\t}\n\n\t\tdeps.stderr(\"Code sent! Check your inbox.\\n\");\n\n\t\tconst maxAttempts = 3;\n\t\tlet session: SessionData | null = null;\n\n\t\tfor (let attempt = 1; attempt <= maxAttempts; attempt++) {\n\t\t\tconst codeResult = await prompt.code(attempt, maxAttempts);\n\t\t\tif (typeof codeResult === \"symbol\") {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst code = codeResult;\n\n\t\t\tconst verifyResult = await deps.client.auth.verifyEmailOtp({\n\t\t\t\temail,\n\t\t\t\tcode,\n\t\t\t});\n\t\t\tif (!verifyResult.error) {\n\t\t\t\tsession = verifyResult.data;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (attempt < maxAttempts) {\n\t\t\t\tdeps.stderr(`${verifyResult.error.message}\\n`);\n\t\t\t} else {\n\t\t\t\tdeps.stderr(\n\t\t\t\t\t\"Too many attempts. Run `dropthis login` to request a new code.\\n\",\n\t\t\t\t);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (!session) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst authedClient = deps.createClient(session.token);\n\t\tconst apiKeyResult = await authedClient.apiKeys.create({\n\t\t\tlabel: `CLI on ${deps.hostname ?? osHostname()}`,\n\t\t});\n\t\tif (apiKeyResult.error) {\n\t\t\tdeps.stderr(`${apiKeyResult.error.message}\\n`);\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { id: keyId, key: apiKey, keyLast4, accountId } = apiKeyResult.data;\n\n\t\ttry {\n\t\t\tawait deps.store.save({\n\t\t\t\tapiKey,\n\t\t\t\tkeyId,\n\t\t\t\tkeyLast4,\n\t\t\t\taccountId: accountId ?? session.accountId,\n\t\t\t\temail,\n\t\t\t\tstorage: \"secure\",\n\t\t\t});\n\t\t} catch (err) {\n\t\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\t\tdeps.stderr(`Failed to save credentials: ${message}\\n`);\n\t\t\treturn null;\n\t\t}\n\n\t\tdeps.stderr(\"✓ Logged in\\n\\n\");\n\n\t\treturn {\n\t\t\tapiKey,\n\t\t\tsource: \"storage\",\n\t\t\tkeyId,\n\t\t\tkeyLast4,\n\t\t\taccountId: accountId ?? session.accountId,\n\t\t\temail,\n\t\t};\n\t} catch (err) {\n\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\tdeps.stderr(`Login failed: ${message}\\n`);\n\t\treturn null;\n\t}\n}\n\nfunction defaultPrompts(): NonNullable<InlineAuthDeps[\"prompt\"]> {\n\treturn {\n\t\temail: () => readlineQuestion(\"Email: \"),\n\t\tcode: (attempt) =>\n\t\t\treadlineQuestion(\n\t\t\t\tattempt === 1 ? \"Code: \" : \"Try again — enter the code: \",\n\t\t\t),\n\t};\n}\n\nfunction readlineQuestion(question: string): Promise<string> {\n\tconst rl = createInterface({\n\t\tinput: process.stdin,\n\t\toutput: process.stderr,\n\t});\n\treturn new Promise((resolve) => {\n\t\trl.question(question, (answer) => {\n\t\t\trl.close();\n\t\t\tresolve(answer);\n\t\t});\n\t});\n}\n","#!/usr/bin/env node\nimport { errorEnvelope } from \"./output.js\";\nimport { buildProgram } from \"./program.js\";\nimport { createCredentialStore } from \"./storage.js\";\n\nexport function writeUsageErrorEnvelope(input: {\n\tmessage: string;\n\tjson: boolean;\n\tstderr: (value: string) => void;\n}): number {\n\tif (input.json) {\n\t\tinput.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"usage_error\", input.message))}\\n`,\n\t\t);\n\t} else {\n\t\tinput.stderr(`${input.message}\\n`);\n\t}\n\treturn 2;\n}\n\nfunction isCommanderError(\n\terr: unknown,\n): err is { code: string; message: string; exitCode: number } {\n\treturn (\n\t\ttypeof err === \"object\" &&\n\t\terr !== null &&\n\t\ttypeof (err as { code?: unknown }).code === \"string\" &&\n\t\t(err as { code: string }).code.startsWith(\"commander.\")\n\t);\n}\n\nfunction wantsJson(argv: string[]): boolean {\n\treturn (\n\t\targv.includes(\"--json\") ||\n\t\targv.includes(\"--quiet\") ||\n\t\targv.includes(\"-q\") ||\n\t\tprocess.env.CI === \"true\" ||\n\t\tprocess.stdout.isTTY !== true\n\t);\n}\n\nbuildProgram({ store: createCredentialStore() })\n\t.parseAsync(process.argv)\n\t.catch((error: unknown) => {\n\t\tif (isCommanderError(error)) {\n\t\t\t// commander.help / commander.helpDisplayed / commander.version are\n\t\t\t// non-error exits — render nothing and exit 0.\n\t\t\tif (\n\t\t\t\terror.code === \"commander.help\" ||\n\t\t\t\terror.code === \"commander.helpDisplayed\" ||\n\t\t\t\terror.code === \"commander.version\"\n\t\t\t) {\n\t\t\t\tprocess.exitCode = 0;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprocess.exitCode = writeUsageErrorEnvelope({\n\t\t\t\tmessage: error.message,\n\t\t\t\tjson: wantsJson(process.argv.slice(2)),\n\t\t\t\tstderr: (value) => process.stderr.write(value),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconsole.error(error);\n\t\tprocess.exitCode = 1;\n\t});\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\t| \"usage_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\tsuggestion?: string | null;\n\tretryable?: boolean | 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: normalizeApiErrorCode(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\t...(error.suggestion ? { suggestion: error.suggestion } : {}),\n\t\t\t...(error.retryable !== undefined && error.retryable !== null\n\t\t\t\t? { retryable: error.retryable }\n\t\t\t\t: {}),\n\t\t\tnext_action: nextActionForApiError(error),\n\t\t},\n\t};\n}\n\nexport function normalizeApiErrorCode(error: ApiErrorDetails): string {\n\tif (error.code) return error.code;\n\tif (error.statusCode === 404) return \"not_found\";\n\treturn \"api_error\";\n}\n\nexport function nextActionForApiError(error: ApiErrorDetails): string {\n\tif (error.suggestion) return error.suggestion;\n\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 === 404 || error.code === \"not_found\") {\n\t\treturn \"Check the drop id or slug and retry; list your drops with dropthis drops list.\";\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 === \"usage_error\") return 2;\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 { Command, InvalidArgumentError } from \"commander\";\nimport pc from \"picocolors\";\nimport { type ResolvedCredential, resolveCredential } from \"./auth.js\";\nimport {\n\trunAccountDelete,\n\trunAccountGet,\n\trunAccountUpdate,\n} 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 { runDropsDelete, runDropsGet, runDropsList } from \"./commands/drops.js\";\nimport {\n\trunLoginInteractive,\n\trunLoginRequest,\n\trunLoginVerify,\n} 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 { writeError } from \"./fmt.js\";\nimport type { InlineAuthClient } from \"./inline-auth.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\tconst writeErr =\n\t\toptions.stderr ?? ((value: string) => process.stderr.write(value));\n\tconst jsonModeForOutput = (): boolean => {\n\t\tconst argv =\n\t\t\t(program as Command & { rawArgs?: string[] }).rawArgs ?? process.argv;\n\t\treturn (\n\t\t\targv.includes(\"--json\") ||\n\t\t\targv.includes(\"--quiet\") ||\n\t\t\targv.includes(\"-q\") ||\n\t\t\toptions.env?.CI === \"true\" ||\n\t\t\t(options.env === undefined && process.env.CI === \"true\") ||\n\t\t\toptions.stdoutIsTTY === false ||\n\t\t\t(options.stdoutIsTTY === undefined && process.stdout.isTTY !== true)\n\t\t);\n\t};\n\tprogram.exitOverride();\n\tprogram.configureOutput({\n\t\twriteErr,\n\t\t// In JSON mode, suppress commander's default plain-text error so the\n\t\t// single JSON envelope written by cli.ts's catch is the only output.\n\t\toutputError: (str, write) => {\n\t\t\tif (!jsonModeForOutput()) write(str);\n\t\t},\n\t});\n\tprogram\n\t\t.name(\"dropthis\")\n\t\t.description(\n\t\t\t[\n\t\t\t\tpc.dim(\"Publish anything online and get a URL back.\"),\n\t\t\t\t\"\",\n\t\t\t\t`${pc.bold(\"Quick start:\")}`,\n\t\t\t\t` ${pc.cyan(\"dropthis login\")}`,\n\t\t\t\t` ${pc.cyan(\"dropthis publish ./dist\")}`,\n\t\t\t].join(\"\\n\"),\n\t\t)\n\t\t.version(PKG_VERSION)\n\t\t.configureHelp({\n\t\t\tsubcommandTerm(cmd) {\n\t\t\t\tconst args = cmd.registeredArguments\n\t\t\t\t\t.map((a) => {\n\t\t\t\t\t\tconst name = a.name();\n\t\t\t\t\t\tconst variadic = a.variadic ? \"...\" : \"\";\n\t\t\t\t\t\treturn a.required ? `<${name}${variadic}>` : `[${name}${variadic}]`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\" \");\n\t\t\t\treturn args ? `${cmd.name()} ${args}` : cmd.name();\n\t\t\t},\n\t\t\tstyleTitle: (title) => pc.bold(title),\n\t\t\tstyleCommandText: (str) => pc.cyan(str),\n\t\t\tstyleSubcommandText: (str) => pc.cyan(str),\n\t\t\tstyleOptionText: (str) => pc.yellow(str),\n\t\t});\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\tprogram.option(\"--no-interactive\", \"Disable interactive prompts\");\n\n\tprogram\n\t\t.command(\"publish [input...]\", { isDefault: true })\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(\"--title <title>\", \"Drop title\")\n\t\t.option(\"--visibility <v>\", \"public or unlisted (default: public)\")\n\t\t.option(\"--password <password>\", \"Require password to view\")\n\t\t.option(\"--noindex\", \"Prevent search-engine indexing\")\n\t\t.option(\"--expires-at <datetime>\", \"Auto-delete after this ISO 8601 date\")\n\t\t.option(\n\t\t\t\"--content-type <mime>\",\n\t\t\t\"Override MIME type (auto-detected from extension)\",\n\t\t)\n\t\t.option(\n\t\t\t\"--entry <path>\",\n\t\t\t\"Entry file for multi-file bundles (default: index.html)\",\n\t\t)\n\t\t.option(\n\t\t\t\"--metadata <json>\",\n\t\t\t'Attach JSON key-value pairs, e.g. \\'{\"source\":\"ci\"}\\'',\n\t\t)\n\t\t.option(\"--metadata-file <path>\", \"Read metadata JSON from a file\")\n\t\t.option(\"--path <name>\", \"Set filename when publishing from stdin\")\n\t\t.option(\"--url\", \"Print only the published URL (no JSON envelope)\")\n\t\t.option(\n\t\t\t\"--dry-run\",\n\t\t\t\"Show what would be published without publishing (JSON; cannot combine with --url)\",\n\t\t)\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.option(\"--from-json <path>\", \"Send raw API request body from a JSON file\")\n\t\t.option(\n\t\t\t\"--idempotency-key <key>\",\n\t\t\t\"Prevent duplicate publishes on retry (auto-generated)\",\n\t\t)\n\t\t.action(async (inputs: string[], commandOptions: RawCommandOptions) => {\n\t\t\tconst stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\tif (inputs.length === 0 && stdinIsTTY && !commandOptions.fromJson) {\n\t\t\t\tprogram.outputHelp();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { deps } = await buildPublishDeps(\n\t\t\t\tprogram,\n\t\t\t\toptions,\n\t\t\t\tstore,\n\t\t\t\tcommandOptions,\n\t\t\t\tstdinIsTTY,\n\t\t\t);\n\n\t\t\tlet publishInput: string | string[] | undefined;\n\t\t\ttry {\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} catch (err) {\n\t\t\t\tconst msg = err instanceof Error ? err.message : \"Invalid input.\";\n\t\t\t\tprocess.exitCode = writeError(deps, \"local_input_error\", msg).exitCode;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet dropOpts: ReturnType<typeof toDropOptions>;\n\t\t\ttry {\n\t\t\t\tdropOpts = toDropOptions(commandOptions);\n\t\t\t} catch (err) {\n\t\t\t\tconst msg = err instanceof Error ? err.message : \"Invalid option.\";\n\t\t\t\tprocess.exitCode = writeError(deps, \"invalid_usage\", msg).exitCode;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst result = await runPublish(publishInput, dropOpts, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tconst drops = program.command(\"drops\").description(\"Manage published drops\");\n\tdrops\n\t\t.command(\"list\")\n\t\t.description(\"List your drops\")\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.description(\"Show drop details\")\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> [input]\")\n\t\t.description(\"Update content or metadata\")\n\t\t.option(\"--slug <slug>\", \"Change the vanity slug\")\n\t\t.option(\"--title <title>\", \"Change title\")\n\t\t.option(\"--visibility <v>\", \"Set to public or unlisted\")\n\t\t.option(\"--password <password>\", \"Require password to view\")\n\t\t.option(\"--no-password\", \"Remove password protection\")\n\t\t.option(\"--noindex\", \"Prevent search-engine indexing\")\n\t\t.option(\"--index\", \"Allow search-engine indexing\")\n\t\t.option(\"--expires-at <datetime>\", \"Auto-delete after this ISO 8601 date\")\n\t\t.option(\n\t\t\t\"--content-type <mime>\",\n\t\t\t\"Override MIME type (auto-detected from extension)\",\n\t\t)\n\t\t.option(\n\t\t\t\"--entry <path>\",\n\t\t\t\"Entry file for multi-file bundles (default: index.html)\",\n\t\t)\n\t\t.option(\n\t\t\t\"--metadata <json>\",\n\t\t\t'Attach JSON key-value pairs, e.g. \\'{\"source\":\"ci\"}\\'',\n\t\t)\n\t\t.option(\"--metadata-file <path>\", \"Read metadata JSON from a file\")\n\t\t.option(\"--path <name>\", \"Set filename for stdin content\")\n\t\t.option(\n\t\t\t\"--if-revision <n>\",\n\t\t\t\"Fail if current revision doesn't match (optimistic lock)\",\n\t\t\tparseInteger,\n\t\t)\n\t\t.option(\"--url\", \"Print only the published URL (no JSON envelope)\")\n\t\t.option(\n\t\t\t\"--dry-run\",\n\t\t\t\"Show what would be updated without updating (JSON; cannot combine with --url)\",\n\t\t)\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.option(\n\t\t\t\"--from-json <path>\",\n\t\t\t\"Send raw API deployment body from a JSON file\",\n\t\t)\n\t\t.option(\n\t\t\t\"--idempotency-key <key>\",\n\t\t\t\"Prevent duplicate updates on retry (auto-generated)\",\n\t\t)\n\t\t.action(\n\t\t\tasync (\n\t\t\t\tdropId: 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 stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\t\tconst global = globalOptions(program, commandOptions);\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\tlet updateInput: string | undefined;\n\t\t\t\ttry {\n\t\t\t\t\tupdateInput = input\n\t\t\t\t\t\t? await resolveCommandInput(input, options.stdin)\n\t\t\t\t\t\t: undefined;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst msg = err instanceof Error ? err.message : \"Invalid input.\";\n\t\t\t\t\tprocess.exitCode = writeError(\n\t\t\t\t\t\tdeps,\n\t\t\t\t\t\t\"local_input_error\",\n\t\t\t\t\t\tmsg,\n\t\t\t\t\t).exitCode;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet dropOpts: ReturnType<typeof toDropOptions>;\n\t\t\t\ttry {\n\t\t\t\t\tdropOpts = toDropOptions(commandOptions);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst msg = err instanceof Error ? err.message : \"Invalid option.\";\n\t\t\t\t\tprocess.exitCode = writeError(deps, \"invalid_usage\", msg).exitCode;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst result = await runUpdate(dropId, updateInput, dropOpts, {\n\t\t\t\t\t...deps,\n\t\t\t\t\tinteractive: isInteractive(stdinIsTTY, deps.env, global),\n\t\t\t\t});\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\tdrops\n\t\t.command(\"delete <dropId>\")\n\t\t.description(\"Delete a drop\")\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 stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\t\tconst global = globalOptions(program, commandOptions);\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{\n\t\t\t\t\t\t...commandOptions,\n\t\t\t\t\t\tinteractive: isInteractive(stdinIsTTY, deps.env, global),\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 apiKeys = program.command(\"api-keys\").description(\"Manage API keys\");\n\tapiKeys\n\t\t.command(\"create\")\n\t\t.description(\"Create an API key\")\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.description(\"List API keys\")\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.description(\"Delete an API key\")\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 stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\t\tconst global = globalOptions(program, commandOptions);\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{\n\t\t\t\t\t\t...commandOptions,\n\t\t\t\t\t\tinteractive: isInteractive(stdinIsTTY, deps.env, global),\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 deployments = program\n\t\t.command(\"deployments\")\n\t\t.description(\"View deployment history\");\n\tdeployments\n\t\t.command(\"list <dropId>\")\n\t\t.description(\"List deployments for a drop\")\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.description(\"Show deployment details\")\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\t// --- Auth commands ---\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) {\n\t\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\t\tParameters<typeof runLoginInteractive>[0][\"client\"]\n\t\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\t\tconst global = globalOptions(program, commandOptions);\n\t\t\t\t\tconst context = createContext({ global });\n\t\t\t\t\tconst result = await runLoginInteractive({\n\t\t\t\t\t\t...deps,\n\t\t\t\t\t\tcreateClient: (apiKey) =>\n\t\t\t\t\t\t\tcontext.createClient(apiKey) as Parameters<\n\t\t\t\t\t\t\t\ttypeof runLoginInteractive\n\t\t\t\t\t\t\t>[0][\"client\"],\n\t\t\t\t\t});\n\t\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t\t\treturn;\n\t\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 global = globalOptions(program, commandOptions);\n\t\t\t\tconst verifyContext = createContext({ global });\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\t{\n\t\t\t\t\t\t...deps,\n\t\t\t\t\t\tcreateClient: (apiKey) =>\n\t\t\t\t\t\t\tverifyContext.createClient(apiKey) as Parameters<\n\t\t\t\t\t\t\t\ttypeof runLoginVerify\n\t\t\t\t\t\t\t>[1][\"client\"],\n\t\t\t\t\t},\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 global = globalOptions(program, commandOptions);\n\t\t\t\tconst verifySubContext = createContext({ global });\n\t\t\t\tconst result = await runLoginVerify(commandOptions, {\n\t\t\t\t\t...deps,\n\t\t\t\t\tcreateClient: (apiKey) =>\n\t\t\t\t\t\tverifySubContext.createClient(apiKey) as Parameters<\n\t\t\t\t\t\t\ttypeof runLoginVerify\n\t\t\t\t\t\t>[1][\"client\"],\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(\"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<Parameters<typeof runWhoami>[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 runWhoami(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tconst account = program\n\t\t.command(\"account\")\n\t\t.description(\"Show or manage your account\");\n\taccount\n\t\t.command(\"get\", { isDefault: true })\n\t\t.description(\"Show 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\taccount\n\t\t.command(\"update\")\n\t\t.description(\"Update account display name\")\n\t\t.requiredOption(\"--display-name <name>\", \"Set the display name\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { displayName: string; json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runAccountUpdate>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runAccountUpdate(\n\t\t\t\t{\n\t\t\t\t\tdisplayName: commandOptions.displayName,\n\t\t\t\t\t...(commandOptions.json !== undefined\n\t\t\t\t\t\t? { json: commandOptions.json }\n\t\t\t\t\t\t: {}),\n\t\t\t\t},\n\t\t\t\tdeps,\n\t\t\t);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\taccount\n\t\t.command(\"delete\")\n\t\t.description(\"Delete your account\")\n\t\t.option(\"--yes\", \"Confirm deletion\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { yes?: boolean; json?: boolean }) => {\n\t\t\tconst stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\tconst global = globalOptions(program, commandOptions);\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runAccountDelete>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runAccountDelete(\n\t\t\t\t{\n\t\t\t\t\t...commandOptions,\n\t\t\t\t\tinteractive: isInteractive(stdinIsTTY, deps.env, global),\n\t\t\t\t},\n\t\t\t\tdeps,\n\t\t\t);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\t// --- Diagnostics ---\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, program });\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\nasync function buildPublishDeps(\n\tprogram: Command,\n\toptions: BuildProgramOptions,\n\tstore: CredentialStore,\n\tcommandOptions: { json?: boolean; quiet?: boolean },\n\tstdinIsTTY: boolean,\n): Promise<{\n\tdeps: RunnerDeps<Parameters<typeof runPublish>[2][\"client\"]> & {\n\t\tinteractive: boolean;\n\t\tinlineAuth: () => Promise<ResolvedCredential | null>;\n\t\tcreateClient: (\n\t\t\tapiKey: string,\n\t\t) => Parameters<typeof runPublish>[2][\"client\"];\n\t};\n}> {\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\tconst interactive = isInteractive(stdinIsTTY, context.env, global);\n\n\tconst inlineAuth = async () => {\n\t\tconst { runInlineAuth } = await import(\"./inline-auth.js\");\n\t\treturn runInlineAuth({\n\t\t\tclient: context.createClient() as unknown as InlineAuthClient,\n\t\t\tcreateClient: (apiKey: string) =>\n\t\t\t\tcontext.createClient(apiKey) as unknown as InlineAuthClient,\n\t\t\tstore,\n\t\t\tstderr: context.stderr,\n\t\t});\n\t};\n\n\treturn {\n\t\tdeps: {\n\t\t\tstore,\n\t\t\tclient: (options.client ??\n\t\t\t\tcontext.createClient(credential?.apiKey)) as Parameters<\n\t\t\t\ttypeof runPublish\n\t\t\t>[2][\"client\"],\n\t\t\t...(global.apiKey ? { apiKey: global.apiKey } : {}),\n\t\t\tenv: context.env,\n\t\t\tstdout: context.stdout,\n\t\t\tstderr: context.stderr,\n\t\t\toutputMode: context.output.mode,\n\t\t\tinteractive,\n\t\t\tinlineAuth,\n\t\t\tcreateClient: (apiKey: string) =>\n\t\t\t\tcontext.createClient(apiKey) as unknown as Parameters<\n\t\t\t\t\ttypeof runPublish\n\t\t\t\t>[2][\"client\"],\n\t\t},\n\t};\n}\n\nfunction isInteractive(\n\tstdinIsTTY: boolean,\n\tenv: Record<string, string | undefined>,\n\tglobal: GlobalOptions,\n): boolean {\n\treturn (\n\t\tstdinIsTTY &&\n\t\t!env.CI &&\n\t\t!env.DROPTHIS_NON_INTERACTIVE &&\n\t\tglobal.interactive !== false\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\t...(opts.interactive !== undefined\n\t\t\t? { interactive: opts.interactive }\n\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\n\t\t\t? { visibility: options.visibility as \"public\" | \"unlisted\" }\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\tconst n = Number.parseInt(value, 10);\n\tif (Number.isNaN(n)) throw new InvalidArgumentError(\"Expected an integer.\");\n\treturn n;\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 | 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\tif (inputs.includes(\"-\")) {\n\t\tthrow new Error(\n\t\t\t\"Cannot read stdin (-) alongside multiple file arguments. Pass file paths only.\",\n\t\t);\n\t}\n\treturn inputs;\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 async function requireCredential(input: {\n\tapiKey?: string;\n\tenv: Record<string, string | undefined>;\n\tstore: CredentialStore;\n}): Promise<ResolvedCredential> {\n\tconst credential = await resolveCredential(input);\n\tif (!credential) {\n\t\tthrow Object.assign(new Error(\"No API key found.\"), {\n\t\t\tcode: \"auth_error\" as const,\n\t\t});\n\t}\n\treturn credential;\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","import pc from \"picocolors\";\nimport type { ApiErrorDetails } from \"./output.js\";\nimport {\n\tapiErrorEnvelope,\n\ttype CliErrorCode,\n\terrorEnvelope,\n\texitCodeFor,\n\tnextActionForApiError,\n} from \"./output.js\";\nimport { error, hint, kvLines, success, url } from \"./ui.js\";\n\ntype WriterDeps = {\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\toutputMode?: \"human\" | \"json\";\n};\n\nexport function writeSuccess(\n\tdeps: WriterDeps,\n\tmessage: string,\n\tlink?: string,\n): void {\n\tif (deps.outputMode === \"human\") {\n\t\tconst text = link ? `${message} ${url(link)}` : message;\n\t\tdeps.stdout(`${success(text)}\\n`);\n\t}\n}\n\nexport function writeUrl(deps: WriterDeps, link: string): void {\n\tdeps.stdout(`${url(link)}\\n`);\n}\n\nexport function writeResult(\n\tdeps: WriterDeps,\n\tlink: string,\n\tverb: string,\n\tdata: Record<string, unknown>,\n): void {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stdout(`${success(`${verb} ${url(link)}`)}\\n`);\n\t\tconst details = formatDropDetails(data);\n\t\tif (details) deps.stdout(`${details}\\n`);\n\t} else {\n\t\tdeps.stdout(`${JSON.stringify({ ok: true, drop: data })}\\n`);\n\t}\n}\n\nfunction formatDropDetails(data: Record<string, unknown>): string {\n\tconst parts: string[] = [];\n\tconst size = data.sizeBytes;\n\tif (typeof size === \"number\") parts.push(formatBytes(size));\n\tconst ct = data.contentType;\n\tif (typeof ct === \"string\") parts.push(ct.split(\";\")[0]!);\n\tconst vis = data.visibility;\n\tif (vis === \"unlisted\") parts.push(\"unlisted\");\n\tconst exp = data.expiresAt;\n\tif (typeof exp === \"string\") parts.push(`expires ${exp.split(\"T\")[0]}`);\n\tif (parts.length === 0) return \"\";\n\treturn ` ${pc.dim(parts.join(\" · \"))}`;\n}\n\nfunction formatBytes(bytes: number): string {\n\tif (bytes < 1024) return `${bytes} B`;\n\tif (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n\treturn `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nexport function writeJson(\n\tdeps: WriterDeps,\n\tenvelope: Record<string, unknown>,\n): void {\n\tdeps.stdout(`${JSON.stringify(envelope)}\\n`);\n}\n\nexport function writeKv(\n\tdeps: WriterDeps,\n\tpairs: Array<[string, string]>,\n\tjson: Record<string, unknown>,\n): void {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stdout(`${kvLines(pairs)}\\n`);\n\t} else {\n\t\tdeps.stdout(`${JSON.stringify(json)}\\n`);\n\t}\n}\n\nexport function writeHumanOrJson(\n\tdeps: WriterDeps,\n\thumanText: string,\n\tjson: Record<string, unknown>,\n): void {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stdout(`${humanText}\\n`);\n\t} else {\n\t\tdeps.stdout(`${JSON.stringify(json)}\\n`);\n\t}\n}\n\nexport function writeError(\n\tdeps: WriterDeps,\n\tcode: CliErrorCode,\n\tmessage: string,\n\tnextAction?: string,\n): { exitCode: number } {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stderr(`${error(message)}\\n`);\n\t\tif (nextAction) deps.stderr(`${hint(nextAction)}\\n`);\n\t} else {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(code, message, nextAction))}\\n`,\n\t\t);\n\t}\n\treturn { exitCode: exitCodeFor(code) };\n}\n\nexport function writeApiError(\n\tdeps: WriterDeps,\n\tdetails: ApiErrorDetails,\n): { exitCode: number } {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stderr(`${error(details.message)}\\n`);\n\t\tconst nextAction = nextActionForApiError(details);\n\t\tif (nextAction) deps.stderr(`${hint(nextAction)}\\n`);\n\t\tif (details.requestId)\n\t\t\tdeps.stderr(`${pc.dim(`Request ID: ${details.requestId}`)}\\n`);\n\t} else {\n\t\tdeps.stderr(`${JSON.stringify(apiErrorEnvelope(details))}\\n`);\n\t}\n\treturn { exitCode: exitCodeFor(\"api_error\") };\n}\n\nexport function writeApiErrorSimple(\n\tdeps: WriterDeps,\n\tmessage: string,\n): { exitCode: number } {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stderr(`${error(message)}\\n`);\n\t} else {\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"api_error\", message))}\\n`);\n\t}\n\treturn { exitCode: exitCodeFor(\"api_error\") };\n}\n\nexport function writeAuthError(deps: WriterDeps): { exitCode: number } {\n\treturn writeError(\n\t\tdeps,\n\t\t\"auth_error\",\n\t\t\"No API key found.\",\n\t\t\"Set DROPTHIS_API_KEY or run dropthis login.\",\n\t);\n}\n\nexport function writeEmpty(\n\tdeps: WriterDeps,\n\tmessage: string,\n\tjson: Record<string, unknown>,\n): void {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stdout(`${message}\\n`);\n\t} else {\n\t\tdeps.stdout(`${JSON.stringify(json)}\\n`);\n\t}\n}\n","import pc from \"picocolors\";\n\nexport const symbols = {\n\tsuccess: \"✓\",\n\terror: \"✗\",\n\twarning: \"!\",\n} as const;\n\nexport function success(msg: string): string {\n\treturn `${pc.green(symbols.success)} ${msg}`;\n}\n\nexport function error(msg: string): string {\n\treturn `${pc.red(symbols.error)} ${msg}`;\n}\n\nexport function warn(msg: string): string {\n\treturn `${pc.yellow(symbols.warning)} ${msg}`;\n}\n\nexport function hint(msg: string): string {\n\treturn ` ${pc.dim(msg)}`;\n}\n\nexport function url(u: string): string {\n\treturn pc.cyan(u);\n}\n\nexport function label(key: string, value: string): string {\n\treturn `${pc.dim(`${key}:`)} ${value}`;\n}\n\nexport function kvLines(pairs: Array<[key: string, value: string]>): string {\n\tif (pairs.length === 0) return \"\";\n\tconst maxKey = Math.max(...pairs.map(([k]) => k.length));\n\treturn pairs\n\t\t.map(([k, v]) => ` ${pc.dim(`${k.padEnd(maxKey)}:`)} ${v}`)\n\t\t.join(\"\\n\");\n}\n","import { requireCredential } from \"../auth.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteError,\n\twriteHumanOrJson,\n\twriteKv,\n} from \"../fmt.js\";\nimport type { CommandDeps, SdkResult } from \"../types.js\";\nimport { success } from \"../ui.js\";\n\ntype AccountClient = {\n\taccount: { get(): Promise<SdkResult<unknown>> };\n};\n\ntype AccountUpdateClient = {\n\taccount: {\n\t\tupdate(input: { displayName: string | null }): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype AccountDeleteClient = {\n\taccount: { delete(): Promise<SdkResult<null>> };\n};\n\nexport async function runAccountGet(\n\t_input: { json?: boolean },\n\tdeps: CommandDeps<AccountClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.account.get();\n\tif (result.error) {\n\t\treturn writeApiError(deps, result.error);\n\t}\n\tconst data = result.data as Record<string, unknown> | null;\n\tconst pairs: Array<[string, string]> = [];\n\tif (data?.id) pairs.push([\"ID\", String(data.id)]);\n\tif (data?.email) pairs.push([\"Email\", String(data.email)]);\n\tif (data?.plan) pairs.push([\"Plan\", String(data.plan)]);\n\tif (data?.displayName) pairs.push([\"Name\", String(data.displayName)]);\n\tif (data?.status) pairs.push([\"Status\", String(data.status)]);\n\tif (data?.createdAt)\n\t\tpairs.push([\"Created\", String(data.createdAt).split(\"T\")[0]!]);\n\n\twriteKv(deps, pairs, { ok: true, account: result.data });\n\treturn { exitCode: 0 };\n}\n\nexport async function runAccountUpdate(\n\tinput: { displayName: string | null; json?: boolean },\n\tdeps: CommandDeps<AccountUpdateClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.account.update({\n\t\tdisplayName: input.displayName,\n\t});\n\tif (result.error) return writeApiError(deps, result.error);\n\tconst data = result.data as Record<string, unknown> | null;\n\tconst pairs: Array<[string, string]> = [];\n\tif (data?.id) pairs.push([\"ID\", String(data.id)]);\n\tif (data?.displayName) pairs.push([\"Name\", String(data.displayName)]);\n\twriteKv(deps, pairs, { ok: true, account: result.data });\n\treturn { exitCode: 0 };\n}\n\nexport async function runAccountDelete(\n\tinput: { yes?: boolean; json?: boolean; interactive?: boolean },\n\tdeps: CommandDeps<AccountDeleteClient>,\n): Promise<{ exitCode: number }> {\n\tif (!input.yes && input.interactive === false) {\n\t\treturn writeError(\n\t\t\tdeps,\n\t\t\t\"invalid_usage\",\n\t\t\t\"Pass --yes to delete the account in non-interactive mode.\",\n\t\t);\n\t}\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.account.delete();\n\tif (result.error) return writeApiError(deps, result.error);\n\twriteHumanOrJson(deps, success(\"Account deleted\"), {\n\t\tok: true,\n\t\tdeleted: true,\n\t});\n\treturn { exitCode: 0 };\n}\n","import * as prompts from \"@clack/prompts\";\nimport { requireCredential } from \"../auth.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteEmpty,\n\twriteError,\n\twriteHumanOrJson,\n\twriteJson,\n\twriteKv,\n} from \"../fmt.js\";\nimport { type CommandDeps, type SdkResult, unwrapListData } from \"../types.js\";\nimport { success } from \"../ui.js\";\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<{ ok: true }>> | SdkResult<{ ok: true }> | undefined;\n\t};\n};\n\nexport async function runApiKeysCreate(\n\tinput: { label: string; json?: boolean },\n\tdeps: CommandDeps<ApiKeysCreateClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.apiKeys.create({ label: input.label });\n\tif (result.error) return writeApiError(deps, result.error);\n\tconst data = result.data;\n\tconst pairs: Array<[string, string]> = [];\n\tif (data.id) pairs.push([\"ID\", String(data.id)]);\n\tif (data.key) pairs.push([\"Key\", String(data.key)]);\n\tif (data.keyLast4) pairs.push([\"Last 4\", String(data.keyLast4)]);\n\twriteKv(deps, pairs, { ok: true, api_key: result.data });\n\treturn { exitCode: 0 };\n}\n\nexport async function runApiKeysList(\n\t_input: { json?: boolean },\n\tdeps: CommandDeps<ApiKeysListClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.apiKeys.list();\n\tif (result.error) return writeApiError(deps, result.error);\n\tconst raw = unwrapListData(result.data);\n\tconst items = Array.isArray(raw)\n\t\t? (raw as Array<Record<string, unknown>>)\n\t\t: undefined;\n\tif (deps.outputMode === \"human\") {\n\t\tif (!items || items.length === 0) {\n\t\t\twriteEmpty(deps, \"No API keys found.\", { ok: true, api_keys: [] });\n\t\t} else {\n\t\t\tfor (const item of items) {\n\t\t\t\tdeps.stdout(\n\t\t\t\t\t`${item.id ?? \"\"} ${item.label ?? \"\"} ...${item.keyLast4 ?? \"\"}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} else {\n\t\twriteJson(deps, { ok: true, api_keys: items ?? raw });\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 writeError(\n\t\t\tdeps,\n\t\t\t\"invalid_usage\",\n\t\t\t\"Pass --yes to delete in non-interactive mode.\",\n\t\t);\n\t}\n\tif (!input.yes && input.interactive !== false) {\n\t\tconst confirmed = await prompts.confirm({\n\t\t\tmessage: `Delete API key ${keyId}?`,\n\t\t});\n\t\tif (prompts.isCancel(confirmed) || !confirmed) {\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\t}\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.apiKeys.delete(keyId);\n\tif (result?.error) return writeApiError(deps, result.error);\n\twriteHumanOrJson(deps, success(`Deleted ${keyId}`), {\n\t\tok: true,\n\t\tdeleted: true,\n\t\tid: keyId,\n\t});\n\treturn { exitCode: 0 };\n}\n","import type { ApiErrorDetails } from \"./output.js\";\nimport type { CredentialStore } from \"./storage.js\";\n\nexport type SdkErrorMessage = { message: string };\n\nexport type SdkResult<T, E extends SdkErrorMessage = ApiErrorDetails> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| { data: null; error: E; headers?: Record<string, string> };\n\nexport type CommandDeps<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\nexport function unwrapListData(\n\tdata: unknown,\n\t...fallbackKeys: string[]\n): unknown {\n\tif (data && typeof data === \"object\") {\n\t\tif (\"data\" in data) {\n\t\t\treturn (data as Record<string, unknown>).data;\n\t\t}\n\t\tfor (const key of fallbackKeys) {\n\t\t\tif (key in data) {\n\t\t\t\treturn (data as Record<string, unknown>)[key];\n\t\t\t}\n\t\t}\n\t}\n\treturn data;\n}\n","import type { Command } from \"commander\";\n\nexport type CommandEntry = {\n\tname: string;\n\tdescription: string;\n\targuments?: string[];\n\toptions?: string[];\n\tauth?: \"required\";\n\texamples?: string[];\n\tsubcommands?: CommandEntry[];\n};\n\ntype CommandAnnotation = {\n\tauth?: \"required\";\n\texamples?: string[];\n};\n\n// Agent-helpful metadata the commander tree does not carry. Keyed by the\n// space-joined command path (e.g. \"publish\", \"account update\"). Structure\n// (name/description/arguments/options/subcommands) is generated from the live\n// program, so this map only supplies auth + examples and cannot drift it.\nconst COMMAND_ANNOTATIONS: Record<string, CommandAnnotation> = {\n\tpublish: {\n\t\tauth: \"required\",\n\t\texamples: [\n\t\t\t\"dropthis ./file.html\",\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\tdrops: {\n\t\tauth: \"required\",\n\t\texamples: [\n\t\t\t\"dropthis drops list --json\",\n\t\t\t\"dropthis drops update drop_abc ./site --json\",\n\t\t\t\"dropthis drops update drop_abc --title 'New Title' --dry-run\",\n\t\t],\n\t},\n\tdeployments: { auth: \"required\" },\n\t\"deployments list\": {\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis deployments list drop_abc --json\"],\n\t},\n\t\"deployments get\": {\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis deployments get drop_abc dep_abc --json\"],\n\t},\n\t\"api-keys\": {\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis api-keys create --label CI --json\"],\n\t},\n\tlogin: {\n\t\texamples: [\n\t\t\t\"dropthis login verify --email user@example.com --otp 123456 --json\",\n\t\t],\n\t},\n\tlogout: { examples: [\"dropthis logout --json\"] },\n\twhoami: { auth: \"required\", examples: [\"dropthis whoami --json\"] },\n\taccount: { auth: \"required\", examples: [\"dropthis account --json\"] },\n\t\"account get\": { auth: \"required\" },\n\t\"account update\": {\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis account update --display-name 'Ada' --json\"],\n\t},\n\t\"account delete\": {\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis account delete --yes --json\"],\n\t},\n\tdoctor: { examples: [\"dropthis doctor --json\"] },\n\tcommands: { examples: [\"dropthis commands --json\"] },\n};\n\nfunction describeArgs(cmd: Command): string[] {\n\treturn cmd.registeredArguments.map((a) => a.name());\n}\n\nfunction describeOptions(cmd: Command): string[] {\n\treturn cmd.options.map((o) => o.long ?? o.short ?? o.flags);\n}\n\nfunction toEntry(cmd: Command, path: string[]): CommandEntry {\n\tconst fullPath = [...path, cmd.name()];\n\tconst annotation = COMMAND_ANNOTATIONS[fullPath.join(\" \")];\n\tconst subs = cmd.commands.map((sub) => toEntry(sub, fullPath));\n\treturn {\n\t\tname: cmd.name(),\n\t\tdescription: cmd.description(),\n\t\t...(describeArgs(cmd).length ? { arguments: describeArgs(cmd) } : {}),\n\t\t...(describeOptions(cmd).length ? { options: describeOptions(cmd) } : {}),\n\t\t...(annotation?.auth ? { auth: annotation.auth } : {}),\n\t\t...(annotation?.examples ? { examples: annotation.examples } : {}),\n\t\t...(subs.length ? { subcommands: subs } : {}),\n\t};\n}\n\nexport function buildCatalog(program: Command): CommandEntry[] {\n\treturn program.commands.map((cmd) => toEntry(cmd, []));\n}\n","import type { Command } from \"commander\";\nimport { buildCatalog } from \"../catalog.js\";\n\nexport async function runCommands(\n\t_input: { json?: boolean },\n\tdeps: { stdout: (value: string) => void; program: Command },\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: buildCatalog(deps.program),\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n","import { requireCredential } from \"../auth.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteEmpty,\n\twriteJson,\n\twriteKv,\n} from \"../fmt.js\";\nimport type { CommandDeps, SdkResult } from \"../types.js\";\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\nexport async function runDeploymentsList(\n\tdropId: string,\n\tinput: { limit?: number; cursor?: string; json?: boolean },\n\tdeps: CommandDeps<DeploymentsClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\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\treturn writeApiError(deps, result.error);\n\t}\n\tconst spread = spreadData(result.data);\n\tconst items = (spread.deployments ?? spread.data ?? result.data) as\n\t\t| Array<Record<string, unknown>>\n\t\t| undefined;\n\tif (deps.outputMode === \"human\") {\n\t\tif (!items || (Array.isArray(items) && items.length === 0)) {\n\t\t\twriteEmpty(deps, \"No deployments found.\", {\n\t\t\t\tok: true,\n\t\t\t\t...spread,\n\t\t\t});\n\t\t} else if (Array.isArray(items)) {\n\t\t\tfor (const item of items) {\n\t\t\t\tdeps.stdout(\n\t\t\t\t\t`${item.id ?? \"\"} rev ${item.revision ?? \"?\"} ${item.createdAt ?? \"\"}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\twriteJson(deps, { ok: true, ...spread });\n\t\t}\n\t} else {\n\t\twriteJson(deps, { ok: true, ...spread });\n\t}\n\treturn { exitCode: 0 };\n}\n\nexport async function runDeploymentsGet(\n\tdropId: string,\n\tdeploymentId: string,\n\t_input: { json?: boolean },\n\tdeps: CommandDeps<DeploymentsClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.deployments.get(dropId, deploymentId);\n\tif (result.error) {\n\t\treturn writeApiError(deps, result.error);\n\t}\n\tconst data = result.data as Record<string, unknown>;\n\tconst pairs: Array<[string, string]> = [];\n\tif (data.id) pairs.push([\"ID\", String(data.id)]);\n\tif (data.revision !== undefined)\n\t\tpairs.push([\"Revision\", String(data.revision)]);\n\tif (data.createdAt) pairs.push([\"Created\", String(data.createdAt)]);\n\twriteKv(deps, pairs, { ok: true, deployment: result.data });\n\treturn { exitCode: 0 };\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 { writeKv } from \"../fmt.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\toutputMode?: \"human\" | \"json\";\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\tconst authSource = credential?.source ?? \"missing\";\n\tconst storageBackend = stored?.storage ?? \"none\";\n\n\tconst pairs: Array<[string, string]> = [\n\t\t[\"Version\", PKG_VERSION],\n\t\t[\"Auth\", authSource],\n\t\t[\"Storage\", storageBackend],\n\t];\n\n\twriteKv(deps, pairs, {\n\t\tok: true,\n\t\tversion: PKG_VERSION,\n\t\tauth: { source: authSource },\n\t\tstorage: { backend: storageBackend },\n\t});\n\treturn { exitCode: 0 };\n}\n","import * as prompts from \"@clack/prompts\";\nimport { requireCredential } from \"../auth.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteEmpty,\n\twriteError,\n\twriteHumanOrJson,\n\twriteJson,\n\twriteKv,\n} from \"../fmt.js\";\nimport { type CommandDeps, type SdkResult, unwrapListData } from \"../types.js\";\nimport { url as fmtUrl, success } from \"../ui.js\";\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 DropsDeleteClient = {\n\tdrops: {\n\t\tdelete(\n\t\t\tdropId: string,\n\t\t): Promise<SdkResult<null>> | SdkResult<null> | undefined;\n\t};\n};\n\nexport async function runDropsList(\n\tinput: { limit?: number; cursor?: string; json?: boolean },\n\tdeps: CommandDeps<DropsListClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\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 writeApiError(deps, result.error);\n\tconst raw = unwrapListData(result.data, \"drops\");\n\tconst items = Array.isArray(raw)\n\t\t? (raw as Array<Record<string, unknown>>)\n\t\t: undefined;\n\tif (deps.outputMode === \"human\") {\n\t\tif (!items || items.length === 0) {\n\t\t\twriteEmpty(deps, \"No drops found.\", { ok: true, drops: [] });\n\t\t} else {\n\t\t\tfor (const item of items) {\n\t\t\t\tdeps.stdout(\n\t\t\t\t\t`${item.id ?? \"\"} ${item.title ?? \"\"} ${item.url ? fmtUrl(String(item.url)) : \"\"}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} else {\n\t\twriteJson(deps, { ok: true, drops: items ?? raw });\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\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.drops.get(dropId);\n\tif (result.error) return writeApiError(deps, result.error);\n\tconst data = result.data as Record<string, unknown>;\n\tconst pairs: Array<[string, string]> = [];\n\tif (data.id) pairs.push([\"ID\", String(data.id)]);\n\tif (data.url) pairs.push([\"URL\", fmtUrl(String(data.url))]);\n\tif (data.title) pairs.push([\"Title\", String(data.title)]);\n\tif (data.visibility) pairs.push([\"Visibility\", String(data.visibility)]);\n\tif (data.revision !== undefined)\n\t\tpairs.push([\"Revision\", String(data.revision)]);\n\tif (data.createdAt) pairs.push([\"Created\", String(data.createdAt)]);\n\tif (data.accessible !== undefined)\n\t\tpairs.push([\"Accessible\", String(data.accessible)]);\n\tif (data.persistent !== undefined)\n\t\tpairs.push([\"Persistent\", String(data.persistent)]);\n\tconst tier = data.tier as Record<string, unknown> | undefined;\n\tif (tier?.name) pairs.push([\"Tier\", String(tier.name)]);\n\twriteKv(deps, pairs, { ok: true, drop: result.data });\n\treturn { exitCode: 0 };\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 writeError(\n\t\t\tdeps,\n\t\t\t\"invalid_usage\",\n\t\t\t\"Pass --yes to delete in non-interactive mode.\",\n\t\t);\n\t}\n\tif (!input.yes && input.interactive !== false) {\n\t\tconst confirmed = await prompts.confirm({\n\t\t\tmessage: `Delete ${dropId}?`,\n\t\t});\n\t\tif (prompts.isCancel(confirmed) || !confirmed) {\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\t}\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.drops.delete(dropId);\n\tif (result?.error) return writeApiError(deps, result.error);\n\twriteHumanOrJson(deps, success(`Deleted ${dropId}`), {\n\t\tok: true,\n\t\tdeleted: true,\n\t\tid: dropId,\n\t});\n\treturn { exitCode: 0 };\n}\n","import * as prompts from \"@clack/prompts\";\nimport { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport type { SdkErrorMessage, SdkResult } from \"../types.js\";\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, SdkErrorMessage>>;\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, SdkErrorMessage>>;\n\t};\n\tapiKeys: {\n\t\tcreate(input: {\n\t\t\tlabel: string;\n\t\t}): Promise<SdkResult<ApiKeyData, SdkErrorMessage>>;\n\t};\n};\n\ntype LoginInteractiveClient = LoginRequestClient & LoginClient;\n\nexport async function runLoginInteractive(deps: {\n\tclient: LoginInteractiveClient;\n\tcreateClient: (apiKey: string) => LoginInteractiveClient;\n\tstore: CredentialStore;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n}): Promise<{ exitCode: number }> {\n\tprompts.intro(\"dropthis login\");\n\n\tconst email = await prompts.text({\n\t\tmessage: \"Email address\",\n\t\tvalidate: (v) => (v?.includes(\"@\") ? undefined : \"Enter a valid email\"),\n\t});\n\tif (prompts.isCancel(email)) {\n\t\tprompts.cancel(\"Login cancelled.\");\n\t\treturn { exitCode: 0 };\n\t}\n\n\tconst requestResult = await deps.client.auth.requestEmailOtp({ email });\n\tif (requestResult.error) {\n\t\tprompts.cancel(requestResult.error.message);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\n\tconst maxAttempts = 3;\n\tlet session: { data: SessionData; error: null } | undefined;\n\tfor (let attempt = 1; attempt <= maxAttempts; attempt++) {\n\t\tconst otp = await prompts.text({\n\t\t\tmessage:\n\t\t\t\tattempt === 1\n\t\t\t\t\t? \"Paste the code from your email\"\n\t\t\t\t\t: \"Try again — paste the code from your email\",\n\t\t\tvalidate: (v) =>\n\t\t\t\tv && v.length >= 4 && v.length <= 8\n\t\t\t\t\t? undefined\n\t\t\t\t\t: \"Code must be 4–8 characters.\",\n\t\t});\n\t\tif (prompts.isCancel(otp)) {\n\t\t\tprompts.cancel(\"Login cancelled.\");\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\n\t\tconst result = await deps.client.auth.verifyEmailOtp({\n\t\t\temail,\n\t\t\tcode: otp,\n\t\t});\n\t\tif (!result.error) {\n\t\t\tsession = result as { data: SessionData; error: null };\n\t\t\tbreak;\n\t\t}\n\t\tif (attempt < maxAttempts) {\n\t\t\tprompts.log.warning(result.error.message);\n\t\t} else {\n\t\t\tprompts.cancel(result.error.message);\n\t\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t\t}\n\t}\n\tif (!session) {\n\t\tprompts.cancel(\"Login failed.\");\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\n\tconst authedClient = deps.createClient(session.data.token);\n\tconst apiKey = await authedClient.apiKeys.create({ label: \"CLI\" });\n\tif (apiKey.error) {\n\t\tprompts.cancel(apiKey.error.message);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\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,\n\t\tstorage: \"secure\",\n\t});\n\n\tprompts.outro(\"Logged in successfully.\");\n\treturn { exitCode: 0 };\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\tcreateClient: (apiKey: string) => 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 authedClient = deps.createClient(session.data.token);\n\tconst apiKey = await authedClient.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 { writeApiErrorSimple, writeHumanOrJson } from \"../fmt.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport type { SdkErrorMessage, SdkResult } from \"../types.js\";\nimport { success } from \"../ui.js\";\n\ntype LogoutClient = {\n\tapiKeys: {\n\t\tdelete(\n\t\t\tkeyId: string,\n\t\t):\n\t\t\t| SdkResult<null, SdkErrorMessage>\n\t\t\t| Promise<SdkResult<null, SdkErrorMessage>>\n\t\t\t| undefined\n\t\t\t| 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\toutputMode?: \"human\" | \"json\";\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\tif (revokeError) {\n\t\treturn writeApiErrorSimple(deps, revokeError);\n\t}\n\tawait deps.store.clear();\n\twriteHumanOrJson(deps, success(\"Logged out.\"), { ok: true });\n\treturn { exitCode: 0 };\n}\n","import { randomUUID } from \"node:crypto\";\n\nexport type DropData = { url: string; [key: string]: unknown };\n\nexport type ManifestFile = {\n\tpath: string;\n\tcontentType: string;\n\tsizeBytes: number;\n};\n\nexport type PreparedStagedResult = {\n\tkind: \"staged\";\n\tmanifest: { files: ManifestFile[]; entry?: string | null };\n\toptions: Record<string, unknown>;\n\tmetadata?: Record<string, unknown>;\n};\n\nexport type PreparedSourceResult = {\n\tkind: \"source\";\n\tsourceUrl: string;\n\toptions: Record<string, unknown>;\n\tmetadata?: Record<string, unknown>;\n};\n\nexport type PreparedResult = PreparedStagedResult | PreparedSourceResult;\n\nexport const MAX_BUNDLE_FILE_COUNT = 200;\n\nexport function isFileSystemError(error: unknown): boolean {\n\tif (!(error instanceof Error)) return false;\n\tconst code = (error as NodeJS.ErrnoException).code;\n\treturn (\n\t\tcode === \"ENOENT\" ||\n\t\tcode === \"ENOTDIR\" ||\n\t\tcode === \"EACCES\" ||\n\t\tcode === \"ELIMIT\"\n\t);\n}\n\nexport function withIdempotencyKey<T extends { idempotencyKey?: string }>(\n\toptions: T,\n\t_prefix: \"pub\" | \"upd\",\n): T & { idempotencyKey: string } {\n\treturn options.idempotencyKey\n\t\t? (options as T & { idempotencyKey: string })\n\t\t: { ...options, idempotencyKey: randomUUID() };\n}\n\nexport function validateManifestFileCount(count: number): void {\n\tif (count > MAX_BUNDLE_FILE_COUNT) {\n\t\tthrow Object.assign(\n\t\t\tnew Error(\n\t\t\t\t`Bundle contains ${count} 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\nexport function formatDryRunManifest(\n\tprepared: PreparedResult,\n\textra?: Record<string, unknown>,\n): Record<string, unknown> {\n\tif (prepared.kind === \"source\") {\n\t\treturn {\n\t\t\tok: true,\n\t\t\tdryRun: true,\n\t\t\tkind: \"source\",\n\t\t\t...extra,\n\t\t\tsourceUrl: prepared.sourceUrl,\n\t\t\toptions: prepared.options,\n\t\t\t...(prepared.metadata ? { metadata: prepared.metadata } : {}),\n\t\t};\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\tok: true,\n\t\tdryRun: true,\n\t\tkind: \"staged\",\n\t\t...extra,\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","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\tif (\n\t\traw.visibility &&\n\t\traw.visibility !== \"public\" &&\n\t\traw.visibility !== \"unlisted\"\n\t) {\n\t\tthrow new Error(\n\t\t\t`Invalid visibility \"${raw.visibility}\". Use \"public\" or \"unlisted\".`,\n\t\t);\n\t}\n\tif (raw.expiresAt) {\n\t\tconst d = new Date(raw.expiresAt);\n\t\tif (Number.isNaN(d.getTime())) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid date \"${raw.expiresAt}\". Use ISO 8601 format, e.g. 2025-12-31T23:59:59Z.`,\n\t\t\t);\n\t\t}\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 pc from \"picocolors\";\n\nconst frames = [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"];\n\nexport type Spinner = {\n\tstop(): void;\n\tfail(): void;\n};\n\nexport function createSpinner(\n\tmessage: string,\n\tstderr: (value: string) => void,\n): Spinner {\n\tlet i = 0;\n\tconst timer = setInterval(() => {\n\t\tstderr(`\\r\\x1B[2K${pc.cyan(frames[i % frames.length])} ${message}`);\n\t\ti++;\n\t}, 80);\n\n\treturn {\n\t\tstop() {\n\t\t\tclearInterval(timer);\n\t\t\tstderr(\"\\r\\x1B[2K\");\n\t\t},\n\t\tfail() {\n\t\t\tclearInterval(timer);\n\t\t\tstderr(\"\\r\\x1B[2K\");\n\t\t},\n\t};\n}\n\nexport function shouldSpin(outputMode?: \"human\" | \"json\"): boolean {\n\treturn (\n\t\toutputMode === \"human\" && process.stderr.isTTY === true && !process.env.CI\n\t);\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 type { PublishInput } from \"@dropthis/node\";\nimport { type ResolvedCredential, resolveCredential } from \"../auth.js\";\nimport {\n\ttype DropData,\n\tformatDryRunManifest,\n\tisFileSystemError,\n\ttype PreparedResult,\n\tvalidateManifestFileCount,\n\twithIdempotencyKey,\n} from \"../drop-operations.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteError,\n\twriteResult,\n} from \"../fmt.js\";\nimport {\n\ttype ParsedDropOptions,\n\tparseDropOptions,\n\ttype RawDropOptions,\n} from \"../options.js\";\nimport { createSpinner, shouldSpin } from \"../spinner.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport type { SdkResult } from \"../types.js\";\nimport { readJsonObjectFile } from \"./json_body.js\";\n\ntype PublishClient = {\n\tpublish(\n\t\tinput: PublishInput,\n\t\toptions: ParsedDropOptions,\n\t): Promise<SdkResult<DropData>>;\n\tprepare?(\n\t\tinput: PublishInput,\n\t\toptions: ParsedDropOptions,\n\t): 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\tapiKey?: string;\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\tinteractive?: boolean;\n\tinlineAuth?: () => Promise<ResolvedCredential | null>;\n\tcreateClient?: (apiKey: string) => PublishClient;\n};\n\nexport async function runPublish(\n\tinput: string | string[] | undefined,\n\traw: PublishOptions,\n\tdeps: PublishDeps,\n): Promise<{ exitCode: number }> {\n\tlet credential: ResolvedCredential | null;\n\ttry {\n\t\tcredential = await resolveCredential({\n\t\t\t...((raw.apiKey ?? deps.apiKey)\n\t\t\t\t? { apiKey: raw.apiKey ?? deps.apiKey }\n\t\t\t\t: {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\n\tlet didInlineAuth = false;\n\tif (!credential) {\n\t\tif (deps.interactive && deps.inlineAuth) {\n\t\t\ttry {\n\t\t\t\tcredential = await deps.inlineAuth();\n\t\t\t} catch {\n\t\t\t\treturn writeAuthError(deps);\n\t\t\t}\n\t\t\tif (!credential) return writeAuthError(deps);\n\t\t\tdidInlineAuth = true;\n\t\t} else {\n\t\t\treturn writeAuthError(deps);\n\t\t}\n\t}\n\n\tlet client = deps.client;\n\tif (didInlineAuth && deps.createClient) {\n\t\tclient = deps.createClient(credential.apiKey);\n\t}\n\n\tif (raw.dryRun) {\n\t\treturn handlePublishDryRun(input, raw, deps, client);\n\t}\n\n\tconst hasInput = Array.isArray(input)\n\t\t? input.length > 0\n\t\t: input !== undefined;\n\tconst spin = shouldSpin(deps.outputMode)\n\t\t? createSpinner(\"Publishing…\", deps.stderr)\n\t\t: undefined;\n\ttry {\n\t\tif (raw.fromJson && hasInput) {\n\t\t\tthrow new Error(\"Use either <input> or --from-json, not both.\");\n\t\t}\n\t\tconst options = withIdempotencyKey(await parseDropOptions(raw), \"pub\");\n\t\tconst jsonBody = raw.fromJson\n\t\t\t? await (deps.readJsonObject ?? readJsonObjectFile)(raw.fromJson)\n\t\t\t: undefined;\n\t\tconst idempotencyOpt = options.idempotencyKey\n\t\t\t? { idempotencyKey: options.idempotencyKey }\n\t\t\t: {};\n\t\tconst doPublish = (c: PublishClient) =>\n\t\t\tjsonBody\n\t\t\t\t? c.drops.createRaw(jsonBody, idempotencyOpt)\n\t\t\t\t: hasInput\n\t\t\t\t\t? c.publish(input as PublishInput, options)\n\t\t\t\t\t: (() => {\n\t\t\t\t\t\t\tthrow new Error(\"Publish requires <input> or --from-json.\");\n\t\t\t\t\t\t})();\n\t\tconst result = await doPublish(client);\n\t\tif (result.error) {\n\t\t\tif (\n\t\t\t\tresult.error.statusCode === 401 &&\n\t\t\t\tdeps.interactive &&\n\t\t\t\tdeps.inlineAuth &&\n\t\t\t\t!didInlineAuth\n\t\t\t) {\n\t\t\t\tspin?.stop();\n\t\t\t\tconst newCredential = await deps.inlineAuth();\n\t\t\t\tif (newCredential && deps.createClient) {\n\t\t\t\t\tclient = deps.createClient(newCredential.apiKey);\n\t\t\t\t\tconst retrySpin = shouldSpin(deps.outputMode)\n\t\t\t\t\t\t? createSpinner(\"Publishing…\", deps.stderr)\n\t\t\t\t\t\t: undefined;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst retryResult = await doPublish(client);\n\t\t\t\t\t\tif (retryResult.error) {\n\t\t\t\t\t\t\tretrySpin?.fail();\n\t\t\t\t\t\t\treturn writeApiError(deps, retryResult.error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tretrySpin?.stop();\n\t\t\t\t\t\tif (raw.url) deps.stdout(`${retryResult.data.url}\\n`);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\twriteResult(\n\t\t\t\t\t\t\t\tdeps,\n\t\t\t\t\t\t\t\tretryResult.data.url,\n\t\t\t\t\t\t\t\t\"Published\",\n\t\t\t\t\t\t\t\tretryResult.data,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\treturn { exitCode: 0 };\n\t\t\t\t\t} catch (retryError) {\n\t\t\t\t\t\tretrySpin?.fail();\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\tretryError instanceof Error\n\t\t\t\t\t\t\t\t? retryError.message\n\t\t\t\t\t\t\t\t: \"Publish failed.\";\n\t\t\t\t\t\tconst code = isFileSystemError(retryError)\n\t\t\t\t\t\t\t? \"local_input_error\"\n\t\t\t\t\t\t\t: \"invalid_usage\";\n\t\t\t\t\t\treturn writeError(deps, code, message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tspin?.fail();\n\t\t\treturn writeApiError(deps, result.error);\n\t\t}\n\t\tspin?.stop();\n\t\tif (raw.url) deps.stdout(`${result.data.url}\\n`);\n\t\telse writeResult(deps, result.data.url, \"Published\", result.data);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"Publish failed.\";\n\t\tconst code = isFileSystemError(error)\n\t\t\t? \"local_input_error\"\n\t\t\t: \"invalid_usage\";\n\t\tspin?.fail();\n\t\treturn writeError(deps, code, message);\n\t}\n}\n\nasync function handlePublishDryRun(\n\tinput: string | string[] | undefined,\n\traw: PublishOptions,\n\tdeps: PublishDeps,\n\tclient: PublishClient,\n): Promise<{ exitCode: number }> {\n\tif (raw.url) {\n\t\treturn writeError(\n\t\t\tdeps,\n\t\t\t\"invalid_usage\",\n\t\t\t\"--url and --dry-run cannot be combined.\",\n\t\t\t\"Remove --url; dry-run outputs JSON describing what would be published.\",\n\t\t);\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({ ok: true, 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 (!client.prepare) {\n\t\t\tthrow new Error(\"Client does not support dry-run.\");\n\t\t}\n\t\tconst prepared = await client.prepare(input as PublishInput, options);\n\t\tconst output = formatDryRunManifest(prepared);\n\t\tif (prepared.kind === \"staged\") {\n\t\t\tvalidateManifestFileCount(prepared.manifest.files.length);\n\t\t}\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\treturn writeError(deps, code, message);\n\t}\n}\n","import * as prompts from \"@clack/prompts\";\nimport type { PublishInput } from \"@dropthis/node\";\nimport { requireCredential } from \"../auth.js\";\nimport {\n\ttype DropData,\n\tformatDryRunManifest,\n\tisFileSystemError,\n\ttype PreparedResult,\n\tvalidateManifestFileCount,\n\twithIdempotencyKey,\n} from \"../drop-operations.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteError,\n\twriteResult,\n} from \"../fmt.js\";\nimport {\n\ttype ParsedDropOptions,\n\tparseDropOptions,\n\ttype RawDropOptions,\n} from \"../options.js\";\nimport { createSpinner, shouldSpin } from \"../spinner.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport type { SdkResult } from \"../types.js\";\nimport { readJsonObjectFile } from \"./json_body.js\";\n\ntype UpdateOptions = ParsedDropOptions & { ifRevision?: number };\n\ntype UpdateClient = {\n\tupdate(dropId: string, options: UpdateOptions): Promise<SdkResult<DropData>>;\n\tdeploy(\n\t\tdropId: string,\n\t\tinput: PublishInput,\n\t\toptions: UpdateOptions,\n\t): Promise<SdkResult<DropData>>;\n\tprepare?(\n\t\tinput: PublishInput,\n\t\toptions: ParsedDropOptions,\n\t): 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\tapiKey?: string;\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\tinteractive?: boolean;\n\tprompts?: UpdatePromptApi;\n};\n\ntype UpdatePromptApi = {\n\tintro: typeof prompts.intro;\n\tcancel: typeof prompts.cancel;\n\tmultiselect: typeof prompts.multiselect;\n\tselect: typeof prompts.select;\n\ttext: typeof prompts.text;\n\tpassword: typeof prompts.password;\n\tisCancel: typeof prompts.isCancel;\n};\n\ntype InteractiveUpdateField =\n\t| \"content\"\n\t| \"title\"\n\t| \"slug\"\n\t| \"visibility\"\n\t| \"password\"\n\t| \"indexing\"\n\t| \"expiresAt\"\n\t| \"metadata\";\n\nconst NO_UPDATE_MESSAGE =\n\t\"Nothing to update. Provide an input path or at least one update option.\";\n\nconst NO_UPDATE_NEXT_ACTION =\n\t\"Run dropthis drops update --help, or retry with an input path \" +\n\t\"(for example, dropthis drops update <dropId> ./dist) or one of: \" +\n\t\"--title, --slug, --visibility, --password, --no-password, --noindex, \" +\n\t\"--index, --expires-at, or --metadata.\";\n\nexport async function runUpdate(\n\ttarget: string,\n\tinput: string | undefined,\n\traw: RawUpdateOptions,\n\tdeps: UpdateDeps,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...((raw.apiKey ?? deps.apiKey)\n\t\t\t\t? { apiKey: raw.apiKey ?? deps.apiKey }\n\t\t\t\t: {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\n\tif (raw.dryRun) {\n\t\treturn handleUpdateDryRun(target, input, raw, deps);\n\t}\n\n\tlet spin: ReturnType<typeof createSpinner> | undefined;\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\tlet updateInput = input;\n\t\tlet parsed = await parseDropOptions(raw);\n\t\tif (!updateInput && !raw.fromJson && !hasUpdateFields(parsed)) {\n\t\t\tif (shouldPromptForUpdate(deps)) {\n\t\t\t\tconst prompted = await promptForUpdate(target, deps.prompts ?? prompts);\n\t\t\t\tif (!prompted) return { exitCode: 0 };\n\t\t\t\tupdateInput = prompted.input;\n\t\t\t\tparsed = { ...parsed, ...prompted.options };\n\t\t\t} else {\n\t\t\t\treturn writeError(\n\t\t\t\t\tdeps,\n\t\t\t\t\t\"invalid_usage\",\n\t\t\t\t\tNO_UPDATE_MESSAGE,\n\t\t\t\t\tNO_UPDATE_NEXT_ACTION,\n\t\t\t\t);\n\t\t\t}\n\t\t}\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\tspin = shouldSpin(deps.outputMode)\n\t\t\t? createSpinner(\"Updating…\", deps.stderr)\n\t\t\t: undefined;\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\twithIdempotencyKey(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...revisionOptions,\n\t\t\t\t\t\t\t...(parsed.idempotencyKey\n\t\t\t\t\t\t\t\t? { idempotencyKey: parsed.idempotencyKey }\n\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"upd\",\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t: updateInput\n\t\t\t\t? await deps.client.deploy(\n\t\t\t\t\t\ttarget,\n\t\t\t\t\t\tupdateInput as PublishInput,\n\t\t\t\t\t\twithIdempotencyKey({ ...parsed, ...revisionOptions }, \"upd\"),\n\t\t\t\t\t)\n\t\t\t\t: await deps.client.update(\n\t\t\t\t\t\ttarget,\n\t\t\t\t\t\twithIdempotencyKey({ ...parsed, ...revisionOptions }, \"upd\"),\n\t\t\t\t\t);\n\t\tif (result.error) {\n\t\t\tspin?.fail();\n\t\t\treturn writeApiError(deps, result.error);\n\t\t}\n\t\tspin?.stop();\n\t\tif (raw.url) deps.stdout(`${result.data.url}\\n`);\n\t\telse writeResult(deps, result.data.url, \"Updated\", result.data);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"Update failed.\";\n\t\tconst code = isFileSystemError(error)\n\t\t\t? \"local_input_error\"\n\t\t\t: \"invalid_usage\";\n\t\tspin?.fail();\n\t\treturn writeError(deps, code, message);\n\t}\n}\n\nfunction hasUpdateFields(options: ParsedDropOptions): boolean {\n\tconst { idempotencyKey: _, ...fields } = options;\n\treturn Object.keys(fields).length > 0;\n}\n\nfunction shouldPromptForUpdate(deps: UpdateDeps): boolean {\n\treturn deps.outputMode === \"human\" && deps.interactive === true;\n}\n\nasync function promptForUpdate(\n\ttarget: string,\n\tprompt: UpdatePromptApi,\n): Promise<{ input?: string; options: ParsedDropOptions } | undefined> {\n\tprompt.intro(`Update ${target}`);\n\tconst fields = await prompt.multiselect<InteractiveUpdateField>({\n\t\tmessage: \"What do you want to update?\",\n\t\trequired: true,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tvalue: \"content\",\n\t\t\t\tlabel: \"Content\",\n\t\t\t\thint: \"replace files, folder, URL, or text\",\n\t\t\t},\n\t\t\t{ value: \"title\", label: \"Title\", hint: \"--title\" },\n\t\t\t{ value: \"slug\", label: \"Slug\", hint: \"--slug\" },\n\t\t\t{ value: \"visibility\", label: \"Visibility\", hint: \"--visibility\" },\n\t\t\t{\n\t\t\t\tvalue: \"password\",\n\t\t\t\tlabel: \"Password\",\n\t\t\t\thint: \"--password or --no-password\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"indexing\",\n\t\t\t\tlabel: \"Search indexing\",\n\t\t\t\thint: \"--noindex or --index\",\n\t\t\t},\n\t\t\t{ value: \"expiresAt\", label: \"Expiration\", hint: \"--expires-at\" },\n\t\t\t{ value: \"metadata\", label: \"Metadata\", hint: \"--metadata\" },\n\t\t],\n\t});\n\tif (prompt.isCancel(fields)) {\n\t\tprompt.cancel(\"Update cancelled.\");\n\t\treturn undefined;\n\t}\n\n\tconst selected = new Set(fields);\n\tconst options: ParsedDropOptions = {};\n\tlet input: string | undefined;\n\n\tif (selected.has(\"content\")) {\n\t\tconst value = await prompt.text({\n\t\t\tmessage: \"Content path, URL, or text\",\n\t\t\tvalidate: requireNonEmpty(\"Enter content or a path.\"),\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\tinput = value.trim();\n\t}\n\n\tif (selected.has(\"title\")) {\n\t\tconst value = await prompt.text({\n\t\t\tmessage: \"Title\",\n\t\t\tvalidate: requireNonEmpty(\"Enter a title.\"),\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.title = value.trim();\n\t}\n\n\tif (selected.has(\"slug\")) {\n\t\tconst value = await prompt.text({\n\t\t\tmessage: \"Slug\",\n\t\t\tvalidate: requireNonEmpty(\"Enter a slug.\"),\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.slug = value.trim();\n\t}\n\n\tif (selected.has(\"visibility\")) {\n\t\tconst value = await prompt.select<\"public\" | \"unlisted\">({\n\t\t\tmessage: \"Visibility\",\n\t\t\toptions: [\n\t\t\t\t{ value: \"public\", label: \"Public\" },\n\t\t\t\t{ value: \"unlisted\", label: \"Unlisted\" },\n\t\t\t],\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.visibility = value;\n\t}\n\n\tif (selected.has(\"password\")) {\n\t\tconst action = await prompt.select<\"set\" | \"remove\">({\n\t\t\tmessage: \"Password\",\n\t\t\toptions: [\n\t\t\t\t{ value: \"set\", label: \"Set password\" },\n\t\t\t\t{ value: \"remove\", label: \"Remove password\" },\n\t\t\t],\n\t\t});\n\t\tif (prompt.isCancel(action)) return cancelUpdate(prompt);\n\t\tif (action === \"set\") {\n\t\t\tconst value = await prompt.password({\n\t\t\t\tmessage: \"Password\",\n\t\t\t\tvalidate: requireNonEmpty(\"Enter a password.\"),\n\t\t\t});\n\t\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\t\toptions.password = value;\n\t\t} else {\n\t\t\toptions.password = null;\n\t\t}\n\t}\n\n\tif (selected.has(\"indexing\")) {\n\t\tconst value = await prompt.select<\"noindex\" | \"index\">({\n\t\t\tmessage: \"Search indexing\",\n\t\t\toptions: [\n\t\t\t\t{ value: \"noindex\", label: \"Prevent indexing\" },\n\t\t\t\t{ value: \"index\", label: \"Allow indexing\" },\n\t\t\t],\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.noindex = value === \"noindex\";\n\t}\n\n\tif (selected.has(\"expiresAt\")) {\n\t\tconst value = await prompt.text({\n\t\t\tmessage: \"Expiration date\",\n\t\t\tplaceholder: \"2025-12-31T23:59:59Z\",\n\t\t\tvalidate: validateIsoDate,\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.expiresAt = value.trim();\n\t}\n\n\tif (selected.has(\"metadata\")) {\n\t\tconst value = await prompt.text({\n\t\t\tmessage: \"Metadata JSON object\",\n\t\t\tplaceholder: '{\"source\":\"cli\"}',\n\t\t\tvalidate: validateJsonObject,\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.metadata = parseJsonObject(value);\n\t}\n\n\treturn { ...(input ? { input } : {}), options };\n}\n\nfunction cancelUpdate(\n\tprompt: UpdatePromptApi,\n): { input?: string; options: ParsedDropOptions } | undefined {\n\tprompt.cancel(\"Update cancelled.\");\n\treturn undefined;\n}\n\nfunction requireNonEmpty(message: string) {\n\treturn (value: string | undefined): string | undefined =>\n\t\tvalue?.trim() ? undefined : message;\n}\n\nfunction validateIsoDate(value: string | undefined): string | undefined {\n\tif (!value?.trim()) return \"Enter an ISO 8601 date.\";\n\tconst d = new Date(value);\n\treturn Number.isNaN(d.getTime()) ? \"Enter a valid ISO 8601 date.\" : undefined;\n}\n\nfunction validateJsonObject(value: string | undefined): string | undefined {\n\tif (!value?.trim()) return \"Enter a JSON object.\";\n\ttry {\n\t\tparseJsonObject(value);\n\t\treturn undefined;\n\t} catch {\n\t\treturn \"Enter a valid JSON object.\";\n\t}\n}\n\nfunction parseJsonObject(value: string): 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(\"Metadata must be a JSON object.\");\n\t}\n\treturn parsed as Record<string, unknown>;\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\treturn writeError(\n\t\t\tdeps,\n\t\t\t\"invalid_usage\",\n\t\t\t\"--url and --dry-run cannot be combined.\",\n\t\t\t\"Remove --url; dry-run outputs JSON describing what would be published.\",\n\t\t);\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({ ok: true, 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({ ok: true, 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 as PublishInput, options);\n\t\tconst output = formatDryRunManifest(prepared, { target });\n\t\tif (prepared.kind === \"staged\") {\n\t\t\tvalidateManifestFileCount(prepared.manifest.files.length);\n\t\t}\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\treturn writeError(deps, code, message);\n\t}\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 { writeHumanOrJson, writeKv } from \"../fmt.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport type { SdkErrorMessage, SdkResult } from \"../types.js\";\n\ntype WhoamiClient = {\n\taccount: { get(): Promise<SdkResult<unknown, SdkErrorMessage>> };\n};\n\nexport async function runWhoami(\n\t_input: { json?: boolean },\n\tdeps: {\n\t\tstore: CredentialStore;\n\t\tclient: WhoamiClient;\n\t\tapiKey?: string;\n\t\tenv: Record<string, string | undefined>;\n\t\tstdout: (value: string) => void;\n\t\tstderr: (value: string) => void;\n\t\toutputMode?: \"human\" | \"json\";\n\t},\n): Promise<{ exitCode: number }> {\n\tconst credential = await resolveCredential({\n\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\tenv: deps.env,\n\t\tstore: deps.store,\n\t});\n\tif (!credential) {\n\t\twriteHumanOrJson(deps, \"Not authenticated. Run dropthis login.\", {\n\t\t\tok: true,\n\t\t\tauthenticated: false,\n\t\t});\n\t\treturn { exitCode: 0 };\n\t}\n\n\tconst result = await deps.client.account.get();\n\tif (result.error) {\n\t\twriteHumanOrJson(\n\t\t\tdeps,\n\t\t\t`Not authenticated: ${result.error.message}. Run dropthis login.`,\n\t\t\t{ ok: true, authenticated: false, reason: result.error.message },\n\t\t);\n\t\treturn { exitCode: 0 };\n\t}\n\n\tconst account = (result.data ?? {}) as Record<string, unknown>;\n\tconst masked = maskKey(credential.apiKey);\n\tconst last4 = credential.keyLast4 ?? credential.apiKey.slice(-4);\n\tconst pairs: Array<[string, string]> = [];\n\tif (credential.email ?? account.email)\n\t\tpairs.push([\"Email\", String(credential.email ?? account.email)]);\n\tpairs.push([\"Key\", masked]);\n\tpairs.push([\"Source\", credential.source]);\n\tif (credential.accountId ?? account.id)\n\t\tpairs.push([\"Account\", String(credential.accountId ?? account.id)]);\n\n\tconst jsonEnvelope = {\n\t\tok: true,\n\t\tauthenticated: true,\n\t\tsource: credential.source,\n\t\tmasked_key: masked,\n\t\t...(credential.keyId ? { key_id: credential.keyId } : {}),\n\t\t...(last4 ? { key_last4: last4 } : {}),\n\t\t...((credential.accountId ?? account.id)\n\t\t\t? { account_id: String(credential.accountId ?? account.id) }\n\t\t\t: {}),\n\t\t...((credential.email ?? account.email)\n\t\t\t? { email: String(credential.email ?? account.email) }\n\t\t\t: {}),\n\t};\n\twriteKv(deps, pairs, jsonEnvelope);\n\treturn { exitCode: 0 };\n}\n","import { Dropthis } from \"@dropthis/node\";\nimport { createOutput, type Output } from \"./output.js\";\n\nexport type GlobalOptions = {\n\tapiKey?: string;\n\tapiUrl?: string;\n\tjson?: boolean;\n\tquiet?: boolean;\n\tinteractive?: 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 {\n\tchmod,\n\tmkdir,\n\treadFile,\n\trename,\n\trm,\n\twriteFile,\n} 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\tif (!value) return null;\n\t\tif (typeof value.apiKey !== \"string\" || !value.apiKey) return null;\n\t\treturn { ...value, storage: \"insecure\" } as StoredCredential;\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 (typeof apiKey !== \"string\" || !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\tconst tmpPath = `${path}.${process.pid}.tmp`;\n\tawait writeFile(tmpPath, `${JSON.stringify(credential, null, 2)}\\n`, {\n\t\tmode: 0o600,\n\t});\n\tawait chmod(tmpPath, 0o600);\n\tawait rename(tmpPath, path);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAsDA,eAAsB,cACrB,MACqC;AACrC,MAAI;AACH,UAAM,SAAS,KAAK,UAAU,eAAe;AAE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,GAAG,KAAK,UAAU,cAAc,eAAe,MAAM,OAAO,CAAC,CAAC;AAAA;AAAA,IAC/D;AAAA,EACD,OAAO;AACN,UAAM,OAAO,GAAG,MAAM,OAAO;AAAA,CAAI;AAAA,EAClC;AACA,SAAO;AACR;AAEA,SAAS,iBACR,KAC6D;AAC7D,SACC,OAAO,QAAQ,YACf,QAAQ,QACR,OAAQ,IAA2B,SAAS,YAC3C,IAAyB,KAAK,WAAW,YAAY;AAExD;AAEA,SAAS,UAAU,MAAyB;AAC3C,SACC,KAAK,SAAS,QAAQ,KACtB,KAAK,SAAS,SAAS,KACvB,KAAK,SAAS,IAAI,KAClB,QAAQ,IAAI,OAAO,UACnB,QAAQ,OAAO,UAAU;AAE3B;AAEA,aAAa,EAAE,OAAO,sBAAsB,EAAE,CAAC,EAC7C,WAAW,QAAQ,IAAI,EACvB,MAAM,CAACC,WAAmB;AAC1B,MAAI,iBAAiBA,MAAK,GAAG;AAG5B,QACCA,OAAM,SAAS,oBACfA,OAAM,SAAS,6BACfA,OAAM,SAAS,qBACd;AACD,cAAQ,WAAW;AACnB;AAAA,IACD;AACA,YAAQ,WAAW,wBAAwB;AAAA,MAC1C,SAASA,OAAM;AAAA,MACf,MAAM,UAAU,QAAQ,KAAK,MAAM,CAAC,CAAC;AAAA,MACrC,QAAQ,CAAC,UAAU,QAAQ,OAAO,MAAM,KAAK;AAAA,IAC9C,CAAC;AACD;AAAA,EACD;AACA,UAAQ,MAAMA,MAAK;AACnB,UAAQ,WAAW;AACpB,CAAC;","names":["osHostname","import_node_os","error","import_picocolors","import_picocolors","pc","pc","pc","pc","prompts","prompts","error","import_picocolors","pc","import_promises","error","error","prompts","prompts","error","parseJsonObject","import_promises","error","pc","deps","global","result","runInlineAuth","error"]}
|
|
1
|
+
{"version":3,"sources":["../src/inline-auth.ts","../src/cli.ts","../src/output.ts","../src/program.ts","../src/auth.ts","../src/fmt.ts","../src/ui.ts","../src/commands/account.ts","../src/commands/api-keys.ts","../src/types.ts","../src/catalog.ts","../src/commands/commands.ts","../src/commands/deployments.ts","../src/commands/doctor.ts","../src/commands/drops.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/drop-operations.ts","../src/options.ts","../src/spinner.ts","../src/commands/publish.ts","../src/commands/update.ts","../src/commands/whoami.ts","../src/context.ts","../src/storage.ts"],"sourcesContent":["import { hostname as osHostname } from \"node:os\";\nimport { createInterface } from \"node:readline\";\nimport type { ResolvedCredential } from \"./auth.js\";\nimport type { CredentialStore } from \"./storage.js\";\nimport type { SdkErrorMessage, SdkResult } from \"./types.js\";\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\nexport type InlineAuthClient = {\n\tauth: {\n\t\trequestEmailOtp(input: {\n\t\t\temail: string;\n\t\t}): Promise<SdkResult<OtpRequestData, SdkErrorMessage>>;\n\t\tverifyEmailOtp(input: {\n\t\t\temail: string;\n\t\t\tcode: string;\n\t\t}): Promise<SdkResult<SessionData, SdkErrorMessage>>;\n\t};\n\tapiKeys: {\n\t\tcreate(input: {\n\t\t\tlabel: string;\n\t\t}): Promise<SdkResult<ApiKeyData, SdkErrorMessage>>;\n\t};\n};\n\ntype InlineAuthDeps = {\n\tclient: InlineAuthClient;\n\tcreateClient: (apiKey: string) => InlineAuthClient;\n\tstore: CredentialStore;\n\tstderr: (value: string) => void;\n\thostname?: string;\n\tprompt?: {\n\t\temail: () => Promise<string | symbol>;\n\t\tcode: (attempt: number, maxAttempts: number) => Promise<string | symbol>;\n\t};\n};\n\nexport async function runInlineAuth(\n\tdeps: InlineAuthDeps,\n): Promise<ResolvedCredential | null> {\n\ttry {\n\t\tconst prompt = deps.prompt ?? defaultPrompts();\n\n\t\tdeps.stderr(\"\\nNot logged in. Let's fix that:\\n\");\n\n\t\tconst emailResult = await prompt.email();\n\t\tif (typeof emailResult === \"symbol\") {\n\t\t\treturn null;\n\t\t}\n\t\tconst email = emailResult;\n\n\t\tconst otpRequest = await deps.client.auth.requestEmailOtp({ email });\n\t\tif (otpRequest.error) {\n\t\t\tdeps.stderr(`${otpRequest.error.message}\\n`);\n\t\t\treturn null;\n\t\t}\n\n\t\tdeps.stderr(\"Code sent! Check your inbox.\\n\");\n\n\t\tconst maxAttempts = 3;\n\t\tlet session: SessionData | null = null;\n\n\t\tfor (let attempt = 1; attempt <= maxAttempts; attempt++) {\n\t\t\tconst codeResult = await prompt.code(attempt, maxAttempts);\n\t\t\tif (typeof codeResult === \"symbol\") {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst code = codeResult;\n\n\t\t\tconst verifyResult = await deps.client.auth.verifyEmailOtp({\n\t\t\t\temail,\n\t\t\t\tcode,\n\t\t\t});\n\t\t\tif (!verifyResult.error) {\n\t\t\t\tsession = verifyResult.data;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (attempt < maxAttempts) {\n\t\t\t\tdeps.stderr(`${verifyResult.error.message}\\n`);\n\t\t\t} else {\n\t\t\t\tdeps.stderr(\n\t\t\t\t\t\"Too many attempts. Run `dropthis login` to request a new code.\\n\",\n\t\t\t\t);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (!session) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst authedClient = deps.createClient(session.token);\n\t\tconst apiKeyResult = await authedClient.apiKeys.create({\n\t\t\tlabel: `CLI on ${deps.hostname ?? osHostname()}`,\n\t\t});\n\t\tif (apiKeyResult.error) {\n\t\t\tdeps.stderr(`${apiKeyResult.error.message}\\n`);\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { id: keyId, key: apiKey, keyLast4, accountId } = apiKeyResult.data;\n\n\t\ttry {\n\t\t\tawait deps.store.save({\n\t\t\t\tapiKey,\n\t\t\t\tkeyId,\n\t\t\t\tkeyLast4,\n\t\t\t\taccountId: accountId ?? session.accountId,\n\t\t\t\temail,\n\t\t\t\tstorage: \"secure\",\n\t\t\t});\n\t\t} catch (err) {\n\t\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\t\tdeps.stderr(`Failed to save credentials: ${message}\\n`);\n\t\t\treturn null;\n\t\t}\n\n\t\tdeps.stderr(\"✓ Logged in\\n\\n\");\n\n\t\treturn {\n\t\t\tapiKey,\n\t\t\tsource: \"storage\",\n\t\t\tkeyId,\n\t\t\tkeyLast4,\n\t\t\taccountId: accountId ?? session.accountId,\n\t\t\temail,\n\t\t};\n\t} catch (err) {\n\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\tdeps.stderr(`Login failed: ${message}\\n`);\n\t\treturn null;\n\t}\n}\n\nfunction defaultPrompts(): NonNullable<InlineAuthDeps[\"prompt\"]> {\n\treturn {\n\t\temail: () => readlineQuestion(\"Email: \"),\n\t\tcode: (attempt) =>\n\t\t\treadlineQuestion(\n\t\t\t\tattempt === 1 ? \"Code: \" : \"Try again — enter the code: \",\n\t\t\t),\n\t};\n}\n\nfunction readlineQuestion(question: string): Promise<string> {\n\tconst rl = createInterface({\n\t\tinput: process.stdin,\n\t\toutput: process.stderr,\n\t});\n\treturn new Promise((resolve) => {\n\t\trl.question(question, (answer) => {\n\t\t\trl.close();\n\t\t\tresolve(answer);\n\t\t});\n\t});\n}\n","#!/usr/bin/env node\nimport { errorEnvelope } from \"./output.js\";\nimport { buildProgram } from \"./program.js\";\nimport { createCredentialStore } from \"./storage.js\";\n\nexport function writeUsageErrorEnvelope(input: {\n\tmessage: string;\n\tjson: boolean;\n\tstderr: (value: string) => void;\n}): number {\n\tif (input.json) {\n\t\tinput.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(\"usage_error\", input.message))}\\n`,\n\t\t);\n\t} else {\n\t\tinput.stderr(`${input.message}\\n`);\n\t}\n\treturn 2;\n}\n\nfunction isCommanderError(\n\terr: unknown,\n): err is { code: string; message: string; exitCode: number } {\n\treturn (\n\t\ttypeof err === \"object\" &&\n\t\terr !== null &&\n\t\ttypeof (err as { code?: unknown }).code === \"string\" &&\n\t\t(err as { code: string }).code.startsWith(\"commander.\")\n\t);\n}\n\nfunction wantsJson(argv: string[]): boolean {\n\treturn (\n\t\targv.includes(\"--json\") ||\n\t\targv.includes(\"--quiet\") ||\n\t\targv.includes(\"-q\") ||\n\t\tprocess.env.CI === \"true\" ||\n\t\tprocess.stdout.isTTY !== true\n\t);\n}\n\nbuildProgram({ store: createCredentialStore() })\n\t.parseAsync(process.argv)\n\t.catch((error: unknown) => {\n\t\tif (isCommanderError(error)) {\n\t\t\t// commander.help / commander.helpDisplayed / commander.version are\n\t\t\t// non-error exits — render nothing and exit 0.\n\t\t\tif (\n\t\t\t\terror.code === \"commander.help\" ||\n\t\t\t\terror.code === \"commander.helpDisplayed\" ||\n\t\t\t\terror.code === \"commander.version\"\n\t\t\t) {\n\t\t\t\tprocess.exitCode = 0;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprocess.exitCode = writeUsageErrorEnvelope({\n\t\t\t\tmessage: error.message,\n\t\t\t\tjson: wantsJson(process.argv.slice(2)),\n\t\t\t\tstderr: (value) => process.stderr.write(value),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconsole.error(error);\n\t\tprocess.exitCode = 1;\n\t});\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\t| \"usage_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\tsuggestion?: string | null;\n\tretryable?: boolean | 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: normalizeApiErrorCode(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\t...(error.suggestion ? { suggestion: error.suggestion } : {}),\n\t\t\t...(error.retryable !== undefined && error.retryable !== null\n\t\t\t\t? { retryable: error.retryable }\n\t\t\t\t: {}),\n\t\t\tnext_action: nextActionForApiError(error),\n\t\t},\n\t};\n}\n\nexport function normalizeApiErrorCode(error: ApiErrorDetails): string {\n\tif (error.code) return error.code;\n\tif (error.statusCode === 404) return \"not_found\";\n\treturn \"api_error\";\n}\n\nexport function nextActionForApiError(error: ApiErrorDetails): string {\n\tif (error.suggestion) return error.suggestion;\n\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 === 404 || error.code === \"not_found\") {\n\t\treturn \"Check the drop id or slug and retry; list your drops with dropthis drops list.\";\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 === \"usage_error\") return 2;\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 { Command, InvalidArgumentError } from \"commander\";\nimport pc from \"picocolors\";\nimport { type ResolvedCredential, resolveCredential } from \"./auth.js\";\nimport {\n\trunAccountDelete,\n\trunAccountGet,\n\trunAccountUpdate,\n} 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 { runDropsDelete, runDropsGet, runDropsList } from \"./commands/drops.js\";\nimport {\n\trunLoginInteractive,\n\trunLoginRequest,\n\trunLoginVerify,\n} 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 { writeError } from \"./fmt.js\";\nimport type { InlineAuthClient } from \"./inline-auth.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\tconst writeErr =\n\t\toptions.stderr ?? ((value: string) => process.stderr.write(value));\n\tconst jsonModeForOutput = (): boolean => {\n\t\tconst argv =\n\t\t\t(program as Command & { rawArgs?: string[] }).rawArgs ?? process.argv;\n\t\treturn (\n\t\t\targv.includes(\"--json\") ||\n\t\t\targv.includes(\"--quiet\") ||\n\t\t\targv.includes(\"-q\") ||\n\t\t\toptions.env?.CI === \"true\" ||\n\t\t\t(options.env === undefined && process.env.CI === \"true\") ||\n\t\t\toptions.stdoutIsTTY === false ||\n\t\t\t(options.stdoutIsTTY === undefined && process.stdout.isTTY !== true)\n\t\t);\n\t};\n\tprogram.exitOverride();\n\tprogram.configureOutput({\n\t\twriteErr,\n\t\t// In JSON mode, suppress commander's default plain-text error so the\n\t\t// single JSON envelope written by cli.ts's catch is the only output.\n\t\toutputError: (str, write) => {\n\t\t\tif (!jsonModeForOutput()) write(str);\n\t\t},\n\t});\n\tprogram\n\t\t.name(\"dropthis\")\n\t\t.description(\n\t\t\t[\n\t\t\t\tpc.dim(\"Publish anything online and get a URL back.\"),\n\t\t\t\t\"\",\n\t\t\t\t`${pc.bold(\"Quick start:\")}`,\n\t\t\t\t` ${pc.cyan(\"dropthis login\")}`,\n\t\t\t\t` ${pc.cyan(\"dropthis publish ./dist\")}`,\n\t\t\t].join(\"\\n\"),\n\t\t)\n\t\t.version(PKG_VERSION)\n\t\t.configureHelp({\n\t\t\tsubcommandTerm(cmd) {\n\t\t\t\tconst args = cmd.registeredArguments\n\t\t\t\t\t.map((a) => {\n\t\t\t\t\t\tconst name = a.name();\n\t\t\t\t\t\tconst variadic = a.variadic ? \"...\" : \"\";\n\t\t\t\t\t\treturn a.required ? `<${name}${variadic}>` : `[${name}${variadic}]`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\" \");\n\t\t\t\treturn args ? `${cmd.name()} ${args}` : cmd.name();\n\t\t\t},\n\t\t\tstyleTitle: (title) => pc.bold(title),\n\t\t\tstyleCommandText: (str) => pc.cyan(str),\n\t\t\tstyleSubcommandText: (str) => pc.cyan(str),\n\t\t\tstyleOptionText: (str) => pc.yellow(str),\n\t\t});\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\tprogram.option(\"--no-interactive\", \"Disable interactive prompts\");\n\n\tprogram\n\t\t.command(\"publish [input...]\", { isDefault: true })\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(\"--title <title>\", \"Drop title\")\n\t\t.option(\"--visibility <v>\", \"public or unlisted (default: public)\")\n\t\t.option(\"--password <password>\", \"Require password to view\")\n\t\t.option(\"--noindex\", \"Prevent search-engine indexing\")\n\t\t.option(\"--expires-at <datetime>\", \"Auto-delete after this ISO 8601 date\")\n\t\t.option(\n\t\t\t\"--content-type <mime>\",\n\t\t\t\"Override MIME type (auto-detected from extension)\",\n\t\t)\n\t\t.option(\n\t\t\t\"--entry <path>\",\n\t\t\t\"Entry file for multi-file bundles (default: index.html)\",\n\t\t)\n\t\t.option(\n\t\t\t\"--metadata <json>\",\n\t\t\t'Attach JSON key-value pairs, e.g. \\'{\"source\":\"ci\"}\\'',\n\t\t)\n\t\t.option(\"--metadata-file <path>\", \"Read metadata JSON from a file\")\n\t\t.option(\"--path <name>\", \"Set filename when publishing from stdin\")\n\t\t.option(\"--url\", \"Print only the published URL (no JSON envelope)\")\n\t\t.option(\n\t\t\t\"--dry-run\",\n\t\t\t\"Show what would be published without publishing (JSON; cannot combine with --url)\",\n\t\t)\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.option(\n\t\t\t\"--idempotency-key <key>\",\n\t\t\t\"Prevent duplicate publishes on retry (auto-generated)\",\n\t\t)\n\t\t.action(async (inputs: string[], commandOptions: RawCommandOptions) => {\n\t\t\tconst stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\tif (inputs.length === 0 && stdinIsTTY) {\n\t\t\t\tprogram.outputHelp();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { deps } = await buildPublishDeps(\n\t\t\t\tprogram,\n\t\t\t\toptions,\n\t\t\t\tstore,\n\t\t\t\tcommandOptions,\n\t\t\t\tstdinIsTTY,\n\t\t\t);\n\n\t\t\tlet publishInput: string | string[] | undefined;\n\t\t\ttry {\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} catch (err) {\n\t\t\t\tconst msg = err instanceof Error ? err.message : \"Invalid input.\";\n\t\t\t\tprocess.exitCode = writeError(deps, \"local_input_error\", msg).exitCode;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet dropOpts: ReturnType<typeof toDropOptions>;\n\t\t\ttry {\n\t\t\t\tdropOpts = toDropOptions(commandOptions);\n\t\t\t} catch (err) {\n\t\t\t\tconst msg = err instanceof Error ? err.message : \"Invalid option.\";\n\t\t\t\tprocess.exitCode = writeError(deps, \"invalid_usage\", msg).exitCode;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst result = await runPublish(publishInput, dropOpts, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tconst drops = program.command(\"drops\").description(\"Manage published drops\");\n\tdrops\n\t\t.command(\"list\")\n\t\t.description(\"List your drops\")\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.description(\"Show drop details\")\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> [input]\")\n\t\t.description(\"Update content or metadata\")\n\t\t.option(\"--slug <slug>\", \"Change the vanity slug\")\n\t\t.option(\"--title <title>\", \"Change title\")\n\t\t.option(\"--visibility <v>\", \"Set to public or unlisted\")\n\t\t.option(\"--password <password>\", \"Require password to view\")\n\t\t.option(\"--no-password\", \"Remove password protection\")\n\t\t.option(\"--noindex\", \"Prevent search-engine indexing\")\n\t\t.option(\"--index\", \"Allow search-engine indexing\")\n\t\t.option(\"--expires-at <datetime>\", \"Auto-delete after this ISO 8601 date\")\n\t\t.option(\n\t\t\t\"--content-type <mime>\",\n\t\t\t\"Override MIME type (auto-detected from extension)\",\n\t\t)\n\t\t.option(\n\t\t\t\"--entry <path>\",\n\t\t\t\"Entry file for multi-file bundles (default: index.html)\",\n\t\t)\n\t\t.option(\n\t\t\t\"--metadata <json>\",\n\t\t\t'Attach JSON key-value pairs, e.g. \\'{\"source\":\"ci\"}\\'',\n\t\t)\n\t\t.option(\"--metadata-file <path>\", \"Read metadata JSON from a file\")\n\t\t.option(\"--path <name>\", \"Set filename for stdin content\")\n\t\t.option(\n\t\t\t\"--if-revision <n>\",\n\t\t\t\"Fail if current revision doesn't match (optimistic lock)\",\n\t\t\tparseInteger,\n\t\t)\n\t\t.option(\"--url\", \"Print only the published URL (no JSON envelope)\")\n\t\t.option(\n\t\t\t\"--dry-run\",\n\t\t\t\"Show what would be updated without updating (JSON; cannot combine with --url)\",\n\t\t)\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.option(\n\t\t\t\"--idempotency-key <key>\",\n\t\t\t\"Prevent duplicate updates on retry (auto-generated)\",\n\t\t)\n\t\t.action(\n\t\t\tasync (\n\t\t\t\tdropId: 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 stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\t\tconst global = globalOptions(program, commandOptions);\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\tlet updateInput: string | undefined;\n\t\t\t\ttry {\n\t\t\t\t\tupdateInput = input\n\t\t\t\t\t\t? await resolveCommandInput(input, options.stdin)\n\t\t\t\t\t\t: undefined;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst msg = err instanceof Error ? err.message : \"Invalid input.\";\n\t\t\t\t\tprocess.exitCode = writeError(\n\t\t\t\t\t\tdeps,\n\t\t\t\t\t\t\"local_input_error\",\n\t\t\t\t\t\tmsg,\n\t\t\t\t\t).exitCode;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet dropOpts: ReturnType<typeof toDropOptions>;\n\t\t\t\ttry {\n\t\t\t\t\tdropOpts = toDropOptions(commandOptions);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst msg = err instanceof Error ? err.message : \"Invalid option.\";\n\t\t\t\t\tprocess.exitCode = writeError(deps, \"invalid_usage\", msg).exitCode;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst result = await runUpdate(dropId, updateInput, dropOpts, {\n\t\t\t\t\t...deps,\n\t\t\t\t\tinteractive: isInteractive(stdinIsTTY, deps.env, global),\n\t\t\t\t});\n\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t},\n\t\t);\n\tdrops\n\t\t.command(\"delete <dropId>\")\n\t\t.description(\"Delete a drop\")\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 stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\t\tconst global = globalOptions(program, commandOptions);\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{\n\t\t\t\t\t\t...commandOptions,\n\t\t\t\t\t\tinteractive: isInteractive(stdinIsTTY, deps.env, global),\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 apiKeys = program.command(\"api-keys\").description(\"Manage API keys\");\n\tapiKeys\n\t\t.command(\"create\")\n\t\t.description(\"Create an API key\")\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.description(\"List API keys\")\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.description(\"Delete an API key\")\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 stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\t\tconst global = globalOptions(program, commandOptions);\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{\n\t\t\t\t\t\t...commandOptions,\n\t\t\t\t\t\tinteractive: isInteractive(stdinIsTTY, deps.env, global),\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 deployments = program\n\t\t.command(\"deployments\")\n\t\t.description(\"View deployment history\");\n\tdeployments\n\t\t.command(\"list <dropId>\")\n\t\t.description(\"List deployments for a drop\")\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.description(\"Show deployment details\")\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\t// --- Auth commands ---\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) {\n\t\t\t\t\tconst deps = await commandDeps<\n\t\t\t\t\t\tParameters<typeof runLoginInteractive>[0][\"client\"]\n\t\t\t\t\t>(program, options, store, commandOptions);\n\t\t\t\t\tconst global = globalOptions(program, commandOptions);\n\t\t\t\t\tconst context = createContext({ global });\n\t\t\t\t\tconst result = await runLoginInteractive({\n\t\t\t\t\t\t...deps,\n\t\t\t\t\t\tcreateClient: (apiKey) =>\n\t\t\t\t\t\t\tcontext.createClient(apiKey) as Parameters<\n\t\t\t\t\t\t\t\ttypeof runLoginInteractive\n\t\t\t\t\t\t\t>[0][\"client\"],\n\t\t\t\t\t});\n\t\t\t\t\tprocess.exitCode = result.exitCode;\n\t\t\t\t\treturn;\n\t\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 global = globalOptions(program, commandOptions);\n\t\t\t\tconst verifyContext = createContext({ global });\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\t{\n\t\t\t\t\t\t...deps,\n\t\t\t\t\t\tcreateClient: (apiKey) =>\n\t\t\t\t\t\t\tverifyContext.createClient(apiKey) as Parameters<\n\t\t\t\t\t\t\t\ttypeof runLoginVerify\n\t\t\t\t\t\t\t>[1][\"client\"],\n\t\t\t\t\t},\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 global = globalOptions(program, commandOptions);\n\t\t\t\tconst verifySubContext = createContext({ global });\n\t\t\t\tconst result = await runLoginVerify(commandOptions, {\n\t\t\t\t\t...deps,\n\t\t\t\t\tcreateClient: (apiKey) =>\n\t\t\t\t\t\tverifySubContext.createClient(apiKey) as Parameters<\n\t\t\t\t\t\t\ttypeof runLoginVerify\n\t\t\t\t\t\t>[1][\"client\"],\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(\"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<Parameters<typeof runWhoami>[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 runWhoami(commandOptions, deps);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\tconst account = program\n\t\t.command(\"account\")\n\t\t.description(\"Show or manage your account\");\n\taccount\n\t\t.command(\"get\", { isDefault: true })\n\t\t.description(\"Show 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\taccount\n\t\t.command(\"update\")\n\t\t.description(\"Update account display name\")\n\t\t.requiredOption(\"--display-name <name>\", \"Set the display name\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { displayName: string; json?: boolean }) => {\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runAccountUpdate>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runAccountUpdate(\n\t\t\t\t{\n\t\t\t\t\tdisplayName: commandOptions.displayName,\n\t\t\t\t\t...(commandOptions.json !== undefined\n\t\t\t\t\t\t? { json: commandOptions.json }\n\t\t\t\t\t\t: {}),\n\t\t\t\t},\n\t\t\t\tdeps,\n\t\t\t);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\taccount\n\t\t.command(\"delete\")\n\t\t.description(\"Delete your account\")\n\t\t.option(\"--yes\", \"Confirm deletion\")\n\t\t.option(\"--json\", \"Force JSON output\")\n\t\t.action(async (commandOptions: { yes?: boolean; json?: boolean }) => {\n\t\t\tconst stdinIsTTY = options.stdinIsTTY ?? process.stdin.isTTY ?? false;\n\t\t\tconst global = globalOptions(program, commandOptions);\n\t\t\tconst deps = await commandDeps<\n\t\t\t\tParameters<typeof runAccountDelete>[1][\"client\"]\n\t\t\t>(program, options, store, commandOptions);\n\t\t\tconst result = await runAccountDelete(\n\t\t\t\t{\n\t\t\t\t\t...commandOptions,\n\t\t\t\t\tinteractive: isInteractive(stdinIsTTY, deps.env, global),\n\t\t\t\t},\n\t\t\t\tdeps,\n\t\t\t);\n\t\t\tprocess.exitCode = result.exitCode;\n\t\t});\n\n\t// --- Diagnostics ---\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, program });\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\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\nasync function buildPublishDeps(\n\tprogram: Command,\n\toptions: BuildProgramOptions,\n\tstore: CredentialStore,\n\tcommandOptions: { json?: boolean; quiet?: boolean },\n\tstdinIsTTY: boolean,\n): Promise<{\n\tdeps: RunnerDeps<Parameters<typeof runPublish>[2][\"client\"]> & {\n\t\tinteractive: boolean;\n\t\tinlineAuth: () => Promise<ResolvedCredential | null>;\n\t\tcreateClient: (\n\t\t\tapiKey: string,\n\t\t) => Parameters<typeof runPublish>[2][\"client\"];\n\t};\n}> {\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\tconst interactive = isInteractive(stdinIsTTY, context.env, global);\n\n\tconst inlineAuth = async () => {\n\t\tconst { runInlineAuth } = await import(\"./inline-auth.js\");\n\t\treturn runInlineAuth({\n\t\t\tclient: context.createClient() as unknown as InlineAuthClient,\n\t\t\tcreateClient: (apiKey: string) =>\n\t\t\t\tcontext.createClient(apiKey) as unknown as InlineAuthClient,\n\t\t\tstore,\n\t\t\tstderr: context.stderr,\n\t\t});\n\t};\n\n\treturn {\n\t\tdeps: {\n\t\t\tstore,\n\t\t\tclient: (options.client ??\n\t\t\t\tcontext.createClient(credential?.apiKey)) as Parameters<\n\t\t\t\ttypeof runPublish\n\t\t\t>[2][\"client\"],\n\t\t\t...(global.apiKey ? { apiKey: global.apiKey } : {}),\n\t\t\tenv: context.env,\n\t\t\tstdout: context.stdout,\n\t\t\tstderr: context.stderr,\n\t\t\toutputMode: context.output.mode,\n\t\t\tinteractive,\n\t\t\tinlineAuth,\n\t\t\tcreateClient: (apiKey: string) =>\n\t\t\t\tcontext.createClient(apiKey) as unknown as Parameters<\n\t\t\t\t\ttypeof runPublish\n\t\t\t\t>[2][\"client\"],\n\t\t},\n\t};\n}\n\nfunction isInteractive(\n\tstdinIsTTY: boolean,\n\tenv: Record<string, string | undefined>,\n\tglobal: GlobalOptions,\n): boolean {\n\treturn (\n\t\tstdinIsTTY &&\n\t\t!env.CI &&\n\t\t!env.DROPTHIS_NON_INTERACTIVE &&\n\t\tglobal.interactive !== false\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\t...(opts.interactive !== undefined\n\t\t\t? { interactive: opts.interactive }\n\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\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\n\t\t\t? { visibility: options.visibility as \"public\" | \"unlisted\" }\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.dryRun ? { dryRun: options.dryRun } : {}),\n\t};\n}\n\nfunction parseInteger(value: string): number {\n\tconst n = Number.parseInt(value, 10);\n\tif (Number.isNaN(n)) throw new InvalidArgumentError(\"Expected an integer.\");\n\treturn n;\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 | 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\tif (inputs.includes(\"-\")) {\n\t\tthrow new Error(\n\t\t\t\"Cannot read stdin (-) alongside multiple file arguments. Pass file paths only.\",\n\t\t);\n\t}\n\treturn inputs;\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 async function requireCredential(input: {\n\tapiKey?: string;\n\tenv: Record<string, string | undefined>;\n\tstore: CredentialStore;\n}): Promise<ResolvedCredential> {\n\tconst credential = await resolveCredential(input);\n\tif (!credential) {\n\t\tthrow Object.assign(new Error(\"No API key found.\"), {\n\t\t\tcode: \"auth_error\" as const,\n\t\t});\n\t}\n\treturn credential;\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","import pc from \"picocolors\";\nimport type { ApiErrorDetails } from \"./output.js\";\nimport {\n\tapiErrorEnvelope,\n\ttype CliErrorCode,\n\terrorEnvelope,\n\texitCodeFor,\n\tnextActionForApiError,\n} from \"./output.js\";\nimport { error, hint, kvLines, success, url } from \"./ui.js\";\n\ntype WriterDeps = {\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\toutputMode?: \"human\" | \"json\";\n};\n\nexport function writeSuccess(\n\tdeps: WriterDeps,\n\tmessage: string,\n\tlink?: string,\n): void {\n\tif (deps.outputMode === \"human\") {\n\t\tconst text = link ? `${message} ${url(link)}` : message;\n\t\tdeps.stdout(`${success(text)}\\n`);\n\t}\n}\n\nexport function writeUrl(deps: WriterDeps, link: string): void {\n\tdeps.stdout(`${url(link)}\\n`);\n}\n\nexport function writeResult(\n\tdeps: WriterDeps,\n\tlink: string,\n\tverb: string,\n\tdata: Record<string, unknown>,\n): void {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stdout(`${success(`${verb} ${url(link)}`)}\\n`);\n\t\tconst details = formatDropDetails(data);\n\t\tif (details) deps.stdout(`${details}\\n`);\n\t} else {\n\t\tdeps.stdout(`${JSON.stringify({ ok: true, drop: data })}\\n`);\n\t}\n}\n\nfunction formatDropDetails(data: Record<string, unknown>): string {\n\tconst parts: string[] = [];\n\tconst size = data.sizeBytes;\n\tif (typeof size === \"number\") parts.push(formatBytes(size));\n\tconst ct = data.contentType;\n\tif (typeof ct === \"string\") parts.push(ct.split(\";\")[0]!);\n\tconst vis = data.visibility;\n\tif (vis === \"unlisted\") parts.push(\"unlisted\");\n\tconst exp = data.expiresAt;\n\tif (typeof exp === \"string\") parts.push(`expires ${exp.split(\"T\")[0]}`);\n\tif (parts.length === 0) return \"\";\n\treturn ` ${pc.dim(parts.join(\" · \"))}`;\n}\n\nfunction formatBytes(bytes: number): string {\n\tif (bytes < 1024) return `${bytes} B`;\n\tif (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n\treturn `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nexport function writeJson(\n\tdeps: WriterDeps,\n\tenvelope: Record<string, unknown>,\n): void {\n\tdeps.stdout(`${JSON.stringify(envelope)}\\n`);\n}\n\nexport function writeKv(\n\tdeps: WriterDeps,\n\tpairs: Array<[string, string]>,\n\tjson: Record<string, unknown>,\n): void {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stdout(`${kvLines(pairs)}\\n`);\n\t} else {\n\t\tdeps.stdout(`${JSON.stringify(json)}\\n`);\n\t}\n}\n\nexport function writeHumanOrJson(\n\tdeps: WriterDeps,\n\thumanText: string,\n\tjson: Record<string, unknown>,\n): void {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stdout(`${humanText}\\n`);\n\t} else {\n\t\tdeps.stdout(`${JSON.stringify(json)}\\n`);\n\t}\n}\n\nexport function writeError(\n\tdeps: WriterDeps,\n\tcode: CliErrorCode,\n\tmessage: string,\n\tnextAction?: string,\n): { exitCode: number } {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stderr(`${error(message)}\\n`);\n\t\tif (nextAction) deps.stderr(`${hint(nextAction)}\\n`);\n\t} else {\n\t\tdeps.stderr(\n\t\t\t`${JSON.stringify(errorEnvelope(code, message, nextAction))}\\n`,\n\t\t);\n\t}\n\treturn { exitCode: exitCodeFor(code) };\n}\n\nexport function writeApiError(\n\tdeps: WriterDeps,\n\tdetails: ApiErrorDetails,\n): { exitCode: number } {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stderr(`${error(details.message)}\\n`);\n\t\tconst nextAction = nextActionForApiError(details);\n\t\tif (nextAction) deps.stderr(`${hint(nextAction)}\\n`);\n\t\tif (details.requestId)\n\t\t\tdeps.stderr(`${pc.dim(`Request ID: ${details.requestId}`)}\\n`);\n\t} else {\n\t\tdeps.stderr(`${JSON.stringify(apiErrorEnvelope(details))}\\n`);\n\t}\n\treturn { exitCode: exitCodeFor(\"api_error\") };\n}\n\nexport function writeApiErrorSimple(\n\tdeps: WriterDeps,\n\tmessage: string,\n): { exitCode: number } {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stderr(`${error(message)}\\n`);\n\t} else {\n\t\tdeps.stderr(`${JSON.stringify(errorEnvelope(\"api_error\", message))}\\n`);\n\t}\n\treturn { exitCode: exitCodeFor(\"api_error\") };\n}\n\nexport function writeAuthError(deps: WriterDeps): { exitCode: number } {\n\treturn writeError(\n\t\tdeps,\n\t\t\"auth_error\",\n\t\t\"No API key found.\",\n\t\t\"Set DROPTHIS_API_KEY or run dropthis login.\",\n\t);\n}\n\nexport function writeEmpty(\n\tdeps: WriterDeps,\n\tmessage: string,\n\tjson: Record<string, unknown>,\n): void {\n\tif (deps.outputMode === \"human\") {\n\t\tdeps.stdout(`${message}\\n`);\n\t} else {\n\t\tdeps.stdout(`${JSON.stringify(json)}\\n`);\n\t}\n}\n","import pc from \"picocolors\";\n\nexport const symbols = {\n\tsuccess: \"✓\",\n\terror: \"✗\",\n\twarning: \"!\",\n} as const;\n\nexport function success(msg: string): string {\n\treturn `${pc.green(symbols.success)} ${msg}`;\n}\n\nexport function error(msg: string): string {\n\treturn `${pc.red(symbols.error)} ${msg}`;\n}\n\nexport function warn(msg: string): string {\n\treturn `${pc.yellow(symbols.warning)} ${msg}`;\n}\n\nexport function hint(msg: string): string {\n\treturn ` ${pc.dim(msg)}`;\n}\n\nexport function url(u: string): string {\n\treturn pc.cyan(u);\n}\n\nexport function label(key: string, value: string): string {\n\treturn `${pc.dim(`${key}:`)} ${value}`;\n}\n\nexport function kvLines(pairs: Array<[key: string, value: string]>): string {\n\tif (pairs.length === 0) return \"\";\n\tconst maxKey = Math.max(...pairs.map(([k]) => k.length));\n\treturn pairs\n\t\t.map(([k, v]) => ` ${pc.dim(`${k.padEnd(maxKey)}:`)} ${v}`)\n\t\t.join(\"\\n\");\n}\n","import { requireCredential } from \"../auth.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteError,\n\twriteHumanOrJson,\n\twriteKv,\n} from \"../fmt.js\";\nimport type { CommandDeps, SdkResult } from \"../types.js\";\nimport { success } from \"../ui.js\";\n\ntype AccountClient = {\n\taccount: { get(): Promise<SdkResult<unknown>> };\n};\n\ntype AccountUpdateClient = {\n\taccount: {\n\t\tupdate(input: { displayName: string | null }): Promise<SdkResult<unknown>>;\n\t};\n};\n\ntype AccountDeleteClient = {\n\taccount: { delete(): Promise<SdkResult<null>> };\n};\n\nexport async function runAccountGet(\n\t_input: { json?: boolean },\n\tdeps: CommandDeps<AccountClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.account.get();\n\tif (result.error) {\n\t\treturn writeApiError(deps, result.error);\n\t}\n\tconst data = result.data as Record<string, unknown> | null;\n\tconst pairs: Array<[string, string]> = [];\n\tif (data?.id) pairs.push([\"ID\", String(data.id)]);\n\tif (data?.email) pairs.push([\"Email\", String(data.email)]);\n\tif (data?.plan) pairs.push([\"Plan\", String(data.plan)]);\n\tif (data?.displayName) pairs.push([\"Name\", String(data.displayName)]);\n\tif (data?.status) pairs.push([\"Status\", String(data.status)]);\n\tif (data?.createdAt)\n\t\tpairs.push([\"Created\", String(data.createdAt).split(\"T\")[0]!]);\n\n\twriteKv(deps, pairs, { ok: true, account: result.data });\n\treturn { exitCode: 0 };\n}\n\nexport async function runAccountUpdate(\n\tinput: { displayName: string | null; json?: boolean },\n\tdeps: CommandDeps<AccountUpdateClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.account.update({\n\t\tdisplayName: input.displayName,\n\t});\n\tif (result.error) return writeApiError(deps, result.error);\n\tconst data = result.data as Record<string, unknown> | null;\n\tconst pairs: Array<[string, string]> = [];\n\tif (data?.id) pairs.push([\"ID\", String(data.id)]);\n\tif (data?.displayName) pairs.push([\"Name\", String(data.displayName)]);\n\twriteKv(deps, pairs, { ok: true, account: result.data });\n\treturn { exitCode: 0 };\n}\n\nexport async function runAccountDelete(\n\tinput: { yes?: boolean; json?: boolean; interactive?: boolean },\n\tdeps: CommandDeps<AccountDeleteClient>,\n): Promise<{ exitCode: number }> {\n\tif (!input.yes && input.interactive === false) {\n\t\treturn writeError(\n\t\t\tdeps,\n\t\t\t\"invalid_usage\",\n\t\t\t\"Pass --yes to delete the account in non-interactive mode.\",\n\t\t);\n\t}\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.account.delete();\n\tif (result.error) return writeApiError(deps, result.error);\n\twriteHumanOrJson(deps, success(\"Account deleted\"), {\n\t\tok: true,\n\t\tdeleted: true,\n\t});\n\treturn { exitCode: 0 };\n}\n","import * as prompts from \"@clack/prompts\";\nimport { requireCredential } from \"../auth.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteEmpty,\n\twriteError,\n\twriteHumanOrJson,\n\twriteJson,\n\twriteKv,\n} from \"../fmt.js\";\nimport { type CommandDeps, type SdkResult, unwrapListData } from \"../types.js\";\nimport { success } from \"../ui.js\";\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<{ ok: true }>> | SdkResult<{ ok: true }> | undefined;\n\t};\n};\n\nexport async function runApiKeysCreate(\n\tinput: { label: string; json?: boolean },\n\tdeps: CommandDeps<ApiKeysCreateClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.apiKeys.create({ label: input.label });\n\tif (result.error) return writeApiError(deps, result.error);\n\tconst data = result.data;\n\tconst pairs: Array<[string, string]> = [];\n\tif (data.id) pairs.push([\"ID\", String(data.id)]);\n\tif (data.key) pairs.push([\"Key\", String(data.key)]);\n\tif (data.keyLast4) pairs.push([\"Last 4\", String(data.keyLast4)]);\n\twriteKv(deps, pairs, { ok: true, api_key: result.data });\n\treturn { exitCode: 0 };\n}\n\nexport async function runApiKeysList(\n\t_input: { json?: boolean },\n\tdeps: CommandDeps<ApiKeysListClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.apiKeys.list();\n\tif (result.error) return writeApiError(deps, result.error);\n\tconst raw = unwrapListData(result.data);\n\tconst items = Array.isArray(raw)\n\t\t? (raw as Array<Record<string, unknown>>)\n\t\t: undefined;\n\tif (deps.outputMode === \"human\") {\n\t\tif (!items || items.length === 0) {\n\t\t\twriteEmpty(deps, \"No API keys found.\", { ok: true, api_keys: [] });\n\t\t} else {\n\t\t\tfor (const item of items) {\n\t\t\t\tdeps.stdout(\n\t\t\t\t\t`${item.id ?? \"\"} ${item.label ?? \"\"} ...${item.keyLast4 ?? \"\"}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} else {\n\t\twriteJson(deps, { ok: true, api_keys: items ?? raw });\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 writeError(\n\t\t\tdeps,\n\t\t\t\"invalid_usage\",\n\t\t\t\"Pass --yes to delete in non-interactive mode.\",\n\t\t);\n\t}\n\tif (!input.yes && input.interactive !== false) {\n\t\tconst confirmed = await prompts.confirm({\n\t\t\tmessage: `Delete API key ${keyId}?`,\n\t\t});\n\t\tif (prompts.isCancel(confirmed) || !confirmed) {\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\t}\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.apiKeys.delete(keyId);\n\tif (result?.error) return writeApiError(deps, result.error);\n\twriteHumanOrJson(deps, success(`Deleted ${keyId}`), {\n\t\tok: true,\n\t\tdeleted: true,\n\t\tid: keyId,\n\t});\n\treturn { exitCode: 0 };\n}\n","import type { ApiErrorDetails } from \"./output.js\";\nimport type { CredentialStore } from \"./storage.js\";\n\nexport type SdkErrorMessage = { message: string };\n\nexport type SdkResult<T, E extends SdkErrorMessage = ApiErrorDetails> =\n\t| { data: T; error: null; headers?: Record<string, string> }\n\t| { data: null; error: E; headers?: Record<string, string> };\n\nexport type CommandDeps<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\nexport function unwrapListData(\n\tdata: unknown,\n\t...fallbackKeys: string[]\n): unknown {\n\tif (data && typeof data === \"object\") {\n\t\tif (\"data\" in data) {\n\t\t\treturn (data as Record<string, unknown>).data;\n\t\t}\n\t\tfor (const key of fallbackKeys) {\n\t\t\tif (key in data) {\n\t\t\t\treturn (data as Record<string, unknown>)[key];\n\t\t\t}\n\t\t}\n\t}\n\treturn data;\n}\n","import type { Command } from \"commander\";\n\nexport type CommandEntry = {\n\tname: string;\n\tdescription: string;\n\targuments?: string[];\n\toptions?: string[];\n\tauth?: \"required\";\n\texamples?: string[];\n\tsubcommands?: CommandEntry[];\n};\n\ntype CommandAnnotation = {\n\tauth?: \"required\";\n\texamples?: string[];\n};\n\n// Agent-helpful metadata the commander tree does not carry. Keyed by the\n// space-joined command path (e.g. \"publish\", \"account update\"). Structure\n// (name/description/arguments/options/subcommands) is generated from the live\n// program, so this map only supplies auth + examples and cannot drift it.\nconst COMMAND_ANNOTATIONS: Record<string, CommandAnnotation> = {\n\tpublish: {\n\t\tauth: \"required\",\n\t\texamples: [\n\t\t\t\"dropthis ./file.html\",\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\tdrops: {\n\t\tauth: \"required\",\n\t\texamples: [\n\t\t\t\"dropthis drops list --json\",\n\t\t\t\"dropthis drops update drop_abc ./site --json\",\n\t\t\t\"dropthis drops update drop_abc --title 'New Title' --dry-run\",\n\t\t],\n\t},\n\tdeployments: { auth: \"required\" },\n\t\"deployments list\": {\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis deployments list drop_abc --json\"],\n\t},\n\t\"deployments get\": {\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis deployments get drop_abc dep_abc --json\"],\n\t},\n\t\"api-keys\": {\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis api-keys create --label CI --json\"],\n\t},\n\tlogin: {\n\t\texamples: [\n\t\t\t\"dropthis login verify --email user@example.com --otp 123456 --json\",\n\t\t],\n\t},\n\tlogout: { examples: [\"dropthis logout --json\"] },\n\twhoami: { auth: \"required\", examples: [\"dropthis whoami --json\"] },\n\taccount: { auth: \"required\", examples: [\"dropthis account --json\"] },\n\t\"account get\": { auth: \"required\" },\n\t\"account update\": {\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis account update --display-name 'Ada' --json\"],\n\t},\n\t\"account delete\": {\n\t\tauth: \"required\",\n\t\texamples: [\"dropthis account delete --yes --json\"],\n\t},\n\tdoctor: { examples: [\"dropthis doctor --json\"] },\n\tcommands: { examples: [\"dropthis commands --json\"] },\n};\n\nfunction describeArgs(cmd: Command): string[] {\n\treturn cmd.registeredArguments.map((a) => a.name());\n}\n\nfunction describeOptions(cmd: Command): string[] {\n\treturn cmd.options.map((o) => o.long ?? o.short ?? o.flags);\n}\n\nfunction toEntry(cmd: Command, path: string[]): CommandEntry {\n\tconst fullPath = [...path, cmd.name()];\n\tconst annotation = COMMAND_ANNOTATIONS[fullPath.join(\" \")];\n\tconst subs = cmd.commands.map((sub) => toEntry(sub, fullPath));\n\treturn {\n\t\tname: cmd.name(),\n\t\tdescription: cmd.description(),\n\t\t...(describeArgs(cmd).length ? { arguments: describeArgs(cmd) } : {}),\n\t\t...(describeOptions(cmd).length ? { options: describeOptions(cmd) } : {}),\n\t\t...(annotation?.auth ? { auth: annotation.auth } : {}),\n\t\t...(annotation?.examples ? { examples: annotation.examples } : {}),\n\t\t...(subs.length ? { subcommands: subs } : {}),\n\t};\n}\n\nexport function buildCatalog(program: Command): CommandEntry[] {\n\treturn program.commands.map((cmd) => toEntry(cmd, []));\n}\n","import type { Command } from \"commander\";\nimport { buildCatalog } from \"../catalog.js\";\n\nexport async function runCommands(\n\t_input: { json?: boolean },\n\tdeps: { stdout: (value: string) => void; program: Command },\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: buildCatalog(deps.program),\n\t\t})}\\n`,\n\t);\n\treturn { exitCode: 0 };\n}\n","import { requireCredential } from \"../auth.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteEmpty,\n\twriteJson,\n\twriteKv,\n} from \"../fmt.js\";\nimport type { CommandDeps, SdkResult } from \"../types.js\";\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\nexport async function runDeploymentsList(\n\tdropId: string,\n\tinput: { limit?: number; cursor?: string; json?: boolean },\n\tdeps: CommandDeps<DeploymentsClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\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\treturn writeApiError(deps, result.error);\n\t}\n\tconst spread = spreadData(result.data);\n\tconst items = (spread.deployments ?? spread.data ?? result.data) as\n\t\t| Array<Record<string, unknown>>\n\t\t| undefined;\n\tif (deps.outputMode === \"human\") {\n\t\tif (!items || (Array.isArray(items) && items.length === 0)) {\n\t\t\twriteEmpty(deps, \"No deployments found.\", {\n\t\t\t\tok: true,\n\t\t\t\t...spread,\n\t\t\t});\n\t\t} else if (Array.isArray(items)) {\n\t\t\tfor (const item of items) {\n\t\t\t\tdeps.stdout(\n\t\t\t\t\t`${item.id ?? \"\"} rev ${item.revision ?? \"?\"} ${item.createdAt ?? \"\"}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\twriteJson(deps, { ok: true, ...spread });\n\t\t}\n\t} else {\n\t\twriteJson(deps, { ok: true, ...spread });\n\t}\n\treturn { exitCode: 0 };\n}\n\nexport async function runDeploymentsGet(\n\tdropId: string,\n\tdeploymentId: string,\n\t_input: { json?: boolean },\n\tdeps: CommandDeps<DeploymentsClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.deployments.get(dropId, deploymentId);\n\tif (result.error) {\n\t\treturn writeApiError(deps, result.error);\n\t}\n\tconst data = result.data as Record<string, unknown>;\n\tconst pairs: Array<[string, string]> = [];\n\tif (data.id) pairs.push([\"ID\", String(data.id)]);\n\tif (data.revision !== undefined)\n\t\tpairs.push([\"Revision\", String(data.revision)]);\n\tif (data.createdAt) pairs.push([\"Created\", String(data.createdAt)]);\n\twriteKv(deps, pairs, { ok: true, deployment: result.data });\n\treturn { exitCode: 0 };\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 { writeKv } from \"../fmt.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\toutputMode?: \"human\" | \"json\";\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\tconst authSource = credential?.source ?? \"missing\";\n\tconst storageBackend = stored?.storage ?? \"none\";\n\n\tconst pairs: Array<[string, string]> = [\n\t\t[\"Version\", PKG_VERSION],\n\t\t[\"Auth\", authSource],\n\t\t[\"Storage\", storageBackend],\n\t];\n\n\twriteKv(deps, pairs, {\n\t\tok: true,\n\t\tversion: PKG_VERSION,\n\t\tauth: { source: authSource },\n\t\tstorage: { backend: storageBackend },\n\t});\n\treturn { exitCode: 0 };\n}\n","import * as prompts from \"@clack/prompts\";\nimport { requireCredential } from \"../auth.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteEmpty,\n\twriteError,\n\twriteHumanOrJson,\n\twriteJson,\n\twriteKv,\n} from \"../fmt.js\";\nimport { type CommandDeps, type SdkResult, unwrapListData } from \"../types.js\";\nimport { url as fmtUrl, success } from \"../ui.js\";\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 DropsDeleteClient = {\n\tdrops: {\n\t\tdelete(\n\t\t\tdropId: string,\n\t\t): Promise<SdkResult<null>> | SdkResult<null> | undefined;\n\t};\n};\n\nexport async function runDropsList(\n\tinput: { limit?: number; cursor?: string; json?: boolean },\n\tdeps: CommandDeps<DropsListClient>,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\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 writeApiError(deps, result.error);\n\tconst raw = unwrapListData(result.data, \"drops\");\n\tconst items = Array.isArray(raw)\n\t\t? (raw as Array<Record<string, unknown>>)\n\t\t: undefined;\n\tif (deps.outputMode === \"human\") {\n\t\tif (!items || items.length === 0) {\n\t\t\twriteEmpty(deps, \"No drops found.\", { ok: true, drops: [] });\n\t\t} else {\n\t\t\tfor (const item of items) {\n\t\t\t\tdeps.stdout(\n\t\t\t\t\t`${item.id ?? \"\"} ${item.title ?? \"\"} ${item.url ? fmtUrl(String(item.url)) : \"\"}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} else {\n\t\twriteJson(deps, { ok: true, drops: items ?? raw });\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\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.drops.get(dropId);\n\tif (result.error) return writeApiError(deps, result.error);\n\tconst data = result.data as Record<string, unknown>;\n\tconst pairs: Array<[string, string]> = [];\n\tif (data.id) pairs.push([\"ID\", String(data.id)]);\n\tif (data.url) pairs.push([\"URL\", fmtUrl(String(data.url))]);\n\tif (data.title) pairs.push([\"Title\", String(data.title)]);\n\tif (data.visibility) pairs.push([\"Visibility\", String(data.visibility)]);\n\tif (data.revision !== undefined)\n\t\tpairs.push([\"Revision\", String(data.revision)]);\n\tif (data.createdAt) pairs.push([\"Created\", String(data.createdAt)]);\n\tif (data.accessible !== undefined)\n\t\tpairs.push([\"Accessible\", String(data.accessible)]);\n\tif (data.persistent !== undefined)\n\t\tpairs.push([\"Persistent\", String(data.persistent)]);\n\tconst tier = data.tier as Record<string, unknown> | undefined;\n\tif (tier?.name) pairs.push([\"Tier\", String(tier.name)]);\n\twriteKv(deps, pairs, { ok: true, drop: result.data });\n\treturn { exitCode: 0 };\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 writeError(\n\t\t\tdeps,\n\t\t\t\"invalid_usage\",\n\t\t\t\"Pass --yes to delete in non-interactive mode.\",\n\t\t);\n\t}\n\tif (!input.yes && input.interactive !== false) {\n\t\tconst confirmed = await prompts.confirm({\n\t\t\tmessage: `Delete ${dropId}?`,\n\t\t});\n\t\tif (prompts.isCancel(confirmed) || !confirmed) {\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\t}\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\tconst result = await deps.client.drops.delete(dropId);\n\tif (result?.error) return writeApiError(deps, result.error);\n\twriteHumanOrJson(deps, success(`Deleted ${dropId}`), {\n\t\tok: true,\n\t\tdeleted: true,\n\t\tid: dropId,\n\t});\n\treturn { exitCode: 0 };\n}\n","import * as prompts from \"@clack/prompts\";\nimport { errorEnvelope, exitCodeFor } from \"../output.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport type { SdkErrorMessage, SdkResult } from \"../types.js\";\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, SdkErrorMessage>>;\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, SdkErrorMessage>>;\n\t};\n\tapiKeys: {\n\t\tcreate(input: {\n\t\t\tlabel: string;\n\t\t}): Promise<SdkResult<ApiKeyData, SdkErrorMessage>>;\n\t};\n};\n\ntype LoginInteractiveClient = LoginRequestClient & LoginClient;\n\nexport async function runLoginInteractive(deps: {\n\tclient: LoginInteractiveClient;\n\tcreateClient: (apiKey: string) => LoginInteractiveClient;\n\tstore: CredentialStore;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n}): Promise<{ exitCode: number }> {\n\tprompts.intro(\"dropthis login\");\n\n\tconst email = await prompts.text({\n\t\tmessage: \"Email address\",\n\t\tvalidate: (v) => (v?.includes(\"@\") ? undefined : \"Enter a valid email\"),\n\t});\n\tif (prompts.isCancel(email)) {\n\t\tprompts.cancel(\"Login cancelled.\");\n\t\treturn { exitCode: 0 };\n\t}\n\n\tconst requestResult = await deps.client.auth.requestEmailOtp({ email });\n\tif (requestResult.error) {\n\t\tprompts.cancel(requestResult.error.message);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\n\tconst maxAttempts = 3;\n\tlet session: { data: SessionData; error: null } | undefined;\n\tfor (let attempt = 1; attempt <= maxAttempts; attempt++) {\n\t\tconst otp = await prompts.text({\n\t\t\tmessage:\n\t\t\t\tattempt === 1\n\t\t\t\t\t? \"Paste the code from your email\"\n\t\t\t\t\t: \"Try again — paste the code from your email\",\n\t\t\tvalidate: (v) =>\n\t\t\t\tv && v.length >= 4 && v.length <= 8\n\t\t\t\t\t? undefined\n\t\t\t\t\t: \"Code must be 4–8 characters.\",\n\t\t});\n\t\tif (prompts.isCancel(otp)) {\n\t\t\tprompts.cancel(\"Login cancelled.\");\n\t\t\treturn { exitCode: 0 };\n\t\t}\n\n\t\tconst result = await deps.client.auth.verifyEmailOtp({\n\t\t\temail,\n\t\t\tcode: otp,\n\t\t});\n\t\tif (!result.error) {\n\t\t\tsession = result as { data: SessionData; error: null };\n\t\t\tbreak;\n\t\t}\n\t\tif (attempt < maxAttempts) {\n\t\t\tprompts.log.warning(result.error.message);\n\t\t} else {\n\t\t\tprompts.cancel(result.error.message);\n\t\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t\t}\n\t}\n\tif (!session) {\n\t\tprompts.cancel(\"Login failed.\");\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\n\tconst authedClient = deps.createClient(session.data.token);\n\tconst apiKey = await authedClient.apiKeys.create({ label: \"CLI\" });\n\tif (apiKey.error) {\n\t\tprompts.cancel(apiKey.error.message);\n\t\treturn { exitCode: exitCodeFor(\"api_error\") };\n\t}\n\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,\n\t\tstorage: \"secure\",\n\t});\n\n\tprompts.outro(\"Logged in successfully.\");\n\treturn { exitCode: 0 };\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\tcreateClient: (apiKey: string) => 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 authedClient = deps.createClient(session.data.token);\n\tconst apiKey = await authedClient.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 { writeApiErrorSimple, writeHumanOrJson } from \"../fmt.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport type { SdkErrorMessage, SdkResult } from \"../types.js\";\nimport { success } from \"../ui.js\";\n\ntype LogoutClient = {\n\tapiKeys: {\n\t\tdelete(\n\t\t\tkeyId: string,\n\t\t):\n\t\t\t| SdkResult<null, SdkErrorMessage>\n\t\t\t| Promise<SdkResult<null, SdkErrorMessage>>\n\t\t\t| undefined\n\t\t\t| 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\toutputMode?: \"human\" | \"json\";\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\tif (revokeError) {\n\t\treturn writeApiErrorSimple(deps, revokeError);\n\t}\n\tawait deps.store.clear();\n\twriteHumanOrJson(deps, success(\"Logged out.\"), { ok: true });\n\treturn { exitCode: 0 };\n}\n","import { randomUUID } from \"node:crypto\";\n\nexport type DropData = { url: string; [key: string]: unknown };\n\nexport type ManifestFile = {\n\tpath: string;\n\tcontentType: string;\n\tsizeBytes: number;\n};\n\nexport type PreparedStagedResult = {\n\tkind: \"staged\";\n\tmanifest: { files: ManifestFile[]; entry?: string | null };\n\toptions: Record<string, unknown>;\n\tmetadata?: Record<string, unknown>;\n};\n\nexport type PreparedSourceResult = {\n\tkind: \"source\";\n\tsourceUrl: string;\n\toptions: Record<string, unknown>;\n\tmetadata?: Record<string, unknown>;\n};\n\nexport type PreparedResult = PreparedStagedResult | PreparedSourceResult;\n\nexport const MAX_BUNDLE_FILE_COUNT = 200;\n\nexport function isFileSystemError(error: unknown): boolean {\n\tif (!(error instanceof Error)) return false;\n\tconst code = (error as NodeJS.ErrnoException).code;\n\treturn (\n\t\tcode === \"ENOENT\" ||\n\t\tcode === \"ENOTDIR\" ||\n\t\tcode === \"EACCES\" ||\n\t\tcode === \"ELIMIT\"\n\t);\n}\n\nexport function withIdempotencyKey<T extends { idempotencyKey?: string }>(\n\toptions: T,\n\t_prefix: \"pub\" | \"upd\",\n): T & { idempotencyKey: string } {\n\treturn options.idempotencyKey\n\t\t? (options as T & { idempotencyKey: string })\n\t\t: { ...options, idempotencyKey: randomUUID() };\n}\n\nexport function validateManifestFileCount(count: number): void {\n\tif (count > MAX_BUNDLE_FILE_COUNT) {\n\t\tthrow Object.assign(\n\t\t\tnew Error(\n\t\t\t\t`Bundle contains ${count} 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\nexport function formatDryRunManifest(\n\tprepared: PreparedResult,\n\textra?: Record<string, unknown>,\n): Record<string, unknown> {\n\tif (prepared.kind === \"source\") {\n\t\treturn {\n\t\t\tok: true,\n\t\t\tdryRun: true,\n\t\t\tkind: \"source\",\n\t\t\t...extra,\n\t\t\tsourceUrl: prepared.sourceUrl,\n\t\t\toptions: prepared.options,\n\t\t\t...(prepared.metadata ? { metadata: prepared.metadata } : {}),\n\t\t};\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\tok: true,\n\t\tdryRun: true,\n\t\tkind: \"staged\",\n\t\t...extra,\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","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\tif (\n\t\traw.visibility &&\n\t\traw.visibility !== \"public\" &&\n\t\traw.visibility !== \"unlisted\"\n\t) {\n\t\tthrow new Error(\n\t\t\t`Invalid visibility \"${raw.visibility}\". Use \"public\" or \"unlisted\".`,\n\t\t);\n\t}\n\tif (raw.expiresAt) {\n\t\tconst d = new Date(raw.expiresAt);\n\t\tif (Number.isNaN(d.getTime())) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid date \"${raw.expiresAt}\". Use ISO 8601 format, e.g. 2025-12-31T23:59:59Z.`,\n\t\t\t);\n\t\t}\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 pc from \"picocolors\";\n\nconst frames = [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"];\n\nexport type Spinner = {\n\tstop(): void;\n\tfail(): void;\n};\n\nexport function createSpinner(\n\tmessage: string,\n\tstderr: (value: string) => void,\n): Spinner {\n\tlet i = 0;\n\tconst timer = setInterval(() => {\n\t\tstderr(`\\r\\x1B[2K${pc.cyan(frames[i % frames.length])} ${message}`);\n\t\ti++;\n\t}, 80);\n\n\treturn {\n\t\tstop() {\n\t\t\tclearInterval(timer);\n\t\t\tstderr(\"\\r\\x1B[2K\");\n\t\t},\n\t\tfail() {\n\t\t\tclearInterval(timer);\n\t\t\tstderr(\"\\r\\x1B[2K\");\n\t\t},\n\t};\n}\n\nexport function shouldSpin(outputMode?: \"human\" | \"json\"): boolean {\n\treturn (\n\t\toutputMode === \"human\" && process.stderr.isTTY === true && !process.env.CI\n\t);\n}\n","import type { PublishInput } from \"@dropthis/node\";\nimport { type ResolvedCredential, resolveCredential } from \"../auth.js\";\nimport {\n\ttype DropData,\n\tformatDryRunManifest,\n\tisFileSystemError,\n\ttype PreparedResult,\n\tvalidateManifestFileCount,\n\twithIdempotencyKey,\n} from \"../drop-operations.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteError,\n\twriteResult,\n} from \"../fmt.js\";\nimport {\n\ttype ParsedDropOptions,\n\tparseDropOptions,\n\ttype RawDropOptions,\n} from \"../options.js\";\nimport { createSpinner, shouldSpin } from \"../spinner.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport type { SdkResult } from \"../types.js\";\n\ntype PublishClient = {\n\tpublish(\n\t\tinput: PublishInput,\n\t\toptions: ParsedDropOptions,\n\t): Promise<SdkResult<DropData>>;\n\tprepare?(\n\t\tinput: PublishInput,\n\t\toptions: ParsedDropOptions,\n\t): Promise<PreparedResult>;\n};\n\ntype PublishOptions = RawDropOptions & {\n\tdryRun?: boolean;\n\tjson?: boolean;\n\tquiet?: boolean;\n\turl?: boolean;\n\tapiKey?: string;\n};\n\ntype PublishDeps = {\n\tstore: CredentialStore;\n\tclient: PublishClient;\n\tapiKey?: string;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\toutputMode?: \"human\" | \"json\";\n\tinteractive?: boolean;\n\tinlineAuth?: () => Promise<ResolvedCredential | null>;\n\tcreateClient?: (apiKey: string) => PublishClient;\n};\n\nexport async function runPublish(\n\tinput: string | string[] | undefined,\n\traw: PublishOptions,\n\tdeps: PublishDeps,\n): Promise<{ exitCode: number }> {\n\tlet credential: ResolvedCredential | null;\n\ttry {\n\t\tcredential = await resolveCredential({\n\t\t\t...((raw.apiKey ?? deps.apiKey)\n\t\t\t\t? { apiKey: raw.apiKey ?? deps.apiKey }\n\t\t\t\t: {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\n\tlet didInlineAuth = false;\n\tif (!credential) {\n\t\tif (deps.interactive && deps.inlineAuth) {\n\t\t\ttry {\n\t\t\t\tcredential = await deps.inlineAuth();\n\t\t\t} catch {\n\t\t\t\treturn writeAuthError(deps);\n\t\t\t}\n\t\t\tif (!credential) return writeAuthError(deps);\n\t\t\tdidInlineAuth = true;\n\t\t} else {\n\t\t\treturn writeAuthError(deps);\n\t\t}\n\t}\n\n\tlet client = deps.client;\n\tif (didInlineAuth && deps.createClient) {\n\t\tclient = deps.createClient(credential.apiKey);\n\t}\n\n\tif (raw.dryRun) {\n\t\treturn handlePublishDryRun(input, raw, deps, client);\n\t}\n\n\tconst hasInput = Array.isArray(input)\n\t\t? input.length > 0\n\t\t: input !== undefined;\n\tconst spin = shouldSpin(deps.outputMode)\n\t\t? createSpinner(\"Publishing…\", deps.stderr)\n\t\t: undefined;\n\ttry {\n\t\tconst options = withIdempotencyKey(await parseDropOptions(raw), \"pub\");\n\t\tconst doPublish = (c: PublishClient) =>\n\t\t\thasInput\n\t\t\t\t? c.publish(input as PublishInput, options)\n\t\t\t\t: (() => {\n\t\t\t\t\t\tthrow new Error(\"Publish requires <input>.\");\n\t\t\t\t\t})();\n\t\tconst result = await doPublish(client);\n\t\tif (result.error) {\n\t\t\tif (\n\t\t\t\tresult.error.statusCode === 401 &&\n\t\t\t\tdeps.interactive &&\n\t\t\t\tdeps.inlineAuth &&\n\t\t\t\t!didInlineAuth\n\t\t\t) {\n\t\t\t\tspin?.stop();\n\t\t\t\tconst newCredential = await deps.inlineAuth();\n\t\t\t\tif (newCredential && deps.createClient) {\n\t\t\t\t\tclient = deps.createClient(newCredential.apiKey);\n\t\t\t\t\tconst retrySpin = shouldSpin(deps.outputMode)\n\t\t\t\t\t\t? createSpinner(\"Publishing…\", deps.stderr)\n\t\t\t\t\t\t: undefined;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst retryResult = await doPublish(client);\n\t\t\t\t\t\tif (retryResult.error) {\n\t\t\t\t\t\t\tretrySpin?.fail();\n\t\t\t\t\t\t\treturn writeApiError(deps, retryResult.error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tretrySpin?.stop();\n\t\t\t\t\t\tif (raw.url) deps.stdout(`${retryResult.data.url}\\n`);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\twriteResult(\n\t\t\t\t\t\t\t\tdeps,\n\t\t\t\t\t\t\t\tretryResult.data.url,\n\t\t\t\t\t\t\t\t\"Published\",\n\t\t\t\t\t\t\t\tretryResult.data,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\treturn { exitCode: 0 };\n\t\t\t\t\t} catch (retryError) {\n\t\t\t\t\t\tretrySpin?.fail();\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\tretryError instanceof Error\n\t\t\t\t\t\t\t\t? retryError.message\n\t\t\t\t\t\t\t\t: \"Publish failed.\";\n\t\t\t\t\t\tconst code = isFileSystemError(retryError)\n\t\t\t\t\t\t\t? \"local_input_error\"\n\t\t\t\t\t\t\t: \"invalid_usage\";\n\t\t\t\t\t\treturn writeError(deps, code, message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tspin?.fail();\n\t\t\treturn writeApiError(deps, result.error);\n\t\t}\n\t\tspin?.stop();\n\t\tif (raw.url) deps.stdout(`${result.data.url}\\n`);\n\t\telse writeResult(deps, result.data.url, \"Published\", result.data);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"Publish failed.\";\n\t\tconst code = isFileSystemError(error)\n\t\t\t? \"local_input_error\"\n\t\t\t: \"invalid_usage\";\n\t\tspin?.fail();\n\t\treturn writeError(deps, code, message);\n\t}\n}\n\nasync function handlePublishDryRun(\n\tinput: string | string[] | undefined,\n\traw: PublishOptions,\n\tdeps: PublishDeps,\n\tclient: PublishClient,\n): Promise<{ exitCode: number }> {\n\tif (raw.url) {\n\t\treturn writeError(\n\t\t\tdeps,\n\t\t\t\"invalid_usage\",\n\t\t\t\"--url and --dry-run cannot be combined.\",\n\t\t\t\"Remove --url; dry-run outputs JSON describing what would be published.\",\n\t\t);\n\t}\n\ttry {\n\t\tif (!input || (Array.isArray(input) && input.length === 0)) {\n\t\t\tthrow new Error(\"Publish requires <input>.\");\n\t\t}\n\n\t\tconst options = await parseDropOptions(raw);\n\n\t\tif (!client.prepare) {\n\t\t\tthrow new Error(\"Client does not support dry-run.\");\n\t\t}\n\t\tconst prepared = await client.prepare(input as PublishInput, options);\n\t\tconst output = formatDryRunManifest(prepared);\n\t\tif (prepared.kind === \"staged\") {\n\t\t\tvalidateManifestFileCount(prepared.manifest.files.length);\n\t\t}\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\treturn writeError(deps, code, message);\n\t}\n}\n","import * as prompts from \"@clack/prompts\";\nimport type { PublishInput } from \"@dropthis/node\";\nimport { requireCredential } from \"../auth.js\";\nimport {\n\ttype DropData,\n\tformatDryRunManifest,\n\tisFileSystemError,\n\ttype PreparedResult,\n\tvalidateManifestFileCount,\n\twithIdempotencyKey,\n} from \"../drop-operations.js\";\nimport {\n\twriteApiError,\n\twriteAuthError,\n\twriteError,\n\twriteResult,\n} from \"../fmt.js\";\nimport {\n\ttype ParsedDropOptions,\n\tparseDropOptions,\n\ttype RawDropOptions,\n} from \"../options.js\";\nimport { createSpinner, shouldSpin } from \"../spinner.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport type { SdkResult } from \"../types.js\";\n\ntype UpdateOptions = ParsedDropOptions & { ifRevision?: number };\n\ntype UpdateClient = {\n\tupdate(dropId: string, options: UpdateOptions): Promise<SdkResult<DropData>>;\n\tdeploy(\n\t\tdropId: string,\n\t\tinput: PublishInput,\n\t\toptions: UpdateOptions,\n\t): Promise<SdkResult<DropData>>;\n\tprepare?(\n\t\tinput: PublishInput,\n\t\toptions: ParsedDropOptions,\n\t): Promise<PreparedResult>;\n};\n\ntype RawUpdateOptions = RawDropOptions & {\n\tdryRun?: boolean;\n\tifRevision?: number;\n\tjson?: boolean;\n\tquiet?: boolean;\n\turl?: boolean;\n\tapiKey?: string;\n};\n\ntype UpdateDeps = {\n\tstore: CredentialStore;\n\tclient: UpdateClient;\n\tapiKey?: string;\n\tenv: Record<string, string | undefined>;\n\tstdout: (value: string) => void;\n\tstderr: (value: string) => void;\n\toutputMode?: \"human\" | \"json\";\n\tinteractive?: boolean;\n\tprompts?: UpdatePromptApi;\n};\n\ntype UpdatePromptApi = {\n\tintro: typeof prompts.intro;\n\tcancel: typeof prompts.cancel;\n\tmultiselect: typeof prompts.multiselect;\n\tselect: typeof prompts.select;\n\ttext: typeof prompts.text;\n\tpassword: typeof prompts.password;\n\tisCancel: typeof prompts.isCancel;\n};\n\ntype InteractiveUpdateField =\n\t| \"content\"\n\t| \"title\"\n\t| \"slug\"\n\t| \"visibility\"\n\t| \"password\"\n\t| \"indexing\"\n\t| \"expiresAt\"\n\t| \"metadata\";\n\nconst NO_UPDATE_MESSAGE =\n\t\"Nothing to update. Provide an input path or at least one update option.\";\n\nconst NO_UPDATE_NEXT_ACTION =\n\t\"Run dropthis drops update --help, or retry with an input path \" +\n\t\"(for example, dropthis drops update <dropId> ./dist) or one of: \" +\n\t\"--title, --slug, --visibility, --password, --no-password, --noindex, \" +\n\t\"--index, --expires-at, or --metadata.\";\n\nexport async function runUpdate(\n\ttarget: string,\n\tinput: string | undefined,\n\traw: RawUpdateOptions,\n\tdeps: UpdateDeps,\n): Promise<{ exitCode: number }> {\n\ttry {\n\t\tawait requireCredential({\n\t\t\t...((raw.apiKey ?? deps.apiKey)\n\t\t\t\t? { apiKey: raw.apiKey ?? deps.apiKey }\n\t\t\t\t: {}),\n\t\t\tenv: deps.env,\n\t\t\tstore: deps.store,\n\t\t});\n\t} catch {\n\t\treturn writeAuthError(deps);\n\t}\n\n\tif (raw.dryRun) {\n\t\treturn handleUpdateDryRun(target, input, raw, deps);\n\t}\n\n\tlet spin: ReturnType<typeof createSpinner> | undefined;\n\ttry {\n\t\tassertDropId(target);\n\t\tlet updateInput = input;\n\t\tlet parsed = await parseDropOptions(raw);\n\t\tif (!updateInput && !hasUpdateFields(parsed)) {\n\t\t\tif (shouldPromptForUpdate(deps)) {\n\t\t\t\tconst prompted = await promptForUpdate(target, deps.prompts ?? prompts);\n\t\t\t\tif (!prompted) return { exitCode: 0 };\n\t\t\t\tupdateInput = prompted.input;\n\t\t\t\tparsed = { ...parsed, ...prompted.options };\n\t\t\t} else {\n\t\t\t\treturn writeError(\n\t\t\t\t\tdeps,\n\t\t\t\t\t\"invalid_usage\",\n\t\t\t\t\tNO_UPDATE_MESSAGE,\n\t\t\t\t\tNO_UPDATE_NEXT_ACTION,\n\t\t\t\t);\n\t\t\t}\n\t\t}\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\tspin = shouldSpin(deps.outputMode)\n\t\t\t? createSpinner(\"Updating…\", deps.stderr)\n\t\t\t: undefined;\n\t\tconst result = updateInput\n\t\t\t? await deps.client.deploy(\n\t\t\t\t\ttarget,\n\t\t\t\t\tupdateInput as PublishInput,\n\t\t\t\t\twithIdempotencyKey({ ...parsed, ...revisionOptions }, \"upd\"),\n\t\t\t\t)\n\t\t\t: await deps.client.update(\n\t\t\t\t\ttarget,\n\t\t\t\t\twithIdempotencyKey({ ...parsed, ...revisionOptions }, \"upd\"),\n\t\t\t\t);\n\t\tif (result.error) {\n\t\t\tspin?.fail();\n\t\t\treturn writeApiError(deps, result.error);\n\t\t}\n\t\tspin?.stop();\n\t\tif (raw.url) deps.stdout(`${result.data.url}\\n`);\n\t\telse writeResult(deps, result.data.url, \"Updated\", result.data);\n\t\treturn { exitCode: 0 };\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"Update failed.\";\n\t\tconst code = isFileSystemError(error)\n\t\t\t? \"local_input_error\"\n\t\t\t: \"invalid_usage\";\n\t\tspin?.fail();\n\t\treturn writeError(deps, code, message);\n\t}\n}\n\nfunction hasUpdateFields(options: ParsedDropOptions): boolean {\n\tconst { idempotencyKey: _, ...fields } = options;\n\treturn Object.keys(fields).length > 0;\n}\n\nfunction shouldPromptForUpdate(deps: UpdateDeps): boolean {\n\treturn deps.outputMode === \"human\" && deps.interactive === true;\n}\n\nasync function promptForUpdate(\n\ttarget: string,\n\tprompt: UpdatePromptApi,\n): Promise<{ input?: string; options: ParsedDropOptions } | undefined> {\n\tprompt.intro(`Update ${target}`);\n\tconst fields = await prompt.multiselect<InteractiveUpdateField>({\n\t\tmessage: \"What do you want to update?\",\n\t\trequired: true,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tvalue: \"content\",\n\t\t\t\tlabel: \"Content\",\n\t\t\t\thint: \"replace files, folder, URL, or text\",\n\t\t\t},\n\t\t\t{ value: \"title\", label: \"Title\", hint: \"--title\" },\n\t\t\t{ value: \"slug\", label: \"Slug\", hint: \"--slug\" },\n\t\t\t{ value: \"visibility\", label: \"Visibility\", hint: \"--visibility\" },\n\t\t\t{\n\t\t\t\tvalue: \"password\",\n\t\t\t\tlabel: \"Password\",\n\t\t\t\thint: \"--password or --no-password\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"indexing\",\n\t\t\t\tlabel: \"Search indexing\",\n\t\t\t\thint: \"--noindex or --index\",\n\t\t\t},\n\t\t\t{ value: \"expiresAt\", label: \"Expiration\", hint: \"--expires-at\" },\n\t\t\t{ value: \"metadata\", label: \"Metadata\", hint: \"--metadata\" },\n\t\t],\n\t});\n\tif (prompt.isCancel(fields)) {\n\t\tprompt.cancel(\"Update cancelled.\");\n\t\treturn undefined;\n\t}\n\n\tconst selected = new Set(fields);\n\tconst options: ParsedDropOptions = {};\n\tlet input: string | undefined;\n\n\tif (selected.has(\"content\")) {\n\t\tconst value = await prompt.text({\n\t\t\tmessage: \"Content path, URL, or text\",\n\t\t\tvalidate: requireNonEmpty(\"Enter content or a path.\"),\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\tinput = value.trim();\n\t}\n\n\tif (selected.has(\"title\")) {\n\t\tconst value = await prompt.text({\n\t\t\tmessage: \"Title\",\n\t\t\tvalidate: requireNonEmpty(\"Enter a title.\"),\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.title = value.trim();\n\t}\n\n\tif (selected.has(\"slug\")) {\n\t\tconst value = await prompt.text({\n\t\t\tmessage: \"Slug\",\n\t\t\tvalidate: requireNonEmpty(\"Enter a slug.\"),\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.slug = value.trim();\n\t}\n\n\tif (selected.has(\"visibility\")) {\n\t\tconst value = await prompt.select<\"public\" | \"unlisted\">({\n\t\t\tmessage: \"Visibility\",\n\t\t\toptions: [\n\t\t\t\t{ value: \"public\", label: \"Public\" },\n\t\t\t\t{ value: \"unlisted\", label: \"Unlisted\" },\n\t\t\t],\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.visibility = value;\n\t}\n\n\tif (selected.has(\"password\")) {\n\t\tconst action = await prompt.select<\"set\" | \"remove\">({\n\t\t\tmessage: \"Password\",\n\t\t\toptions: [\n\t\t\t\t{ value: \"set\", label: \"Set password\" },\n\t\t\t\t{ value: \"remove\", label: \"Remove password\" },\n\t\t\t],\n\t\t});\n\t\tif (prompt.isCancel(action)) return cancelUpdate(prompt);\n\t\tif (action === \"set\") {\n\t\t\tconst value = await prompt.password({\n\t\t\t\tmessage: \"Password\",\n\t\t\t\tvalidate: requireNonEmpty(\"Enter a password.\"),\n\t\t\t});\n\t\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\t\toptions.password = value;\n\t\t} else {\n\t\t\toptions.password = null;\n\t\t}\n\t}\n\n\tif (selected.has(\"indexing\")) {\n\t\tconst value = await prompt.select<\"noindex\" | \"index\">({\n\t\t\tmessage: \"Search indexing\",\n\t\t\toptions: [\n\t\t\t\t{ value: \"noindex\", label: \"Prevent indexing\" },\n\t\t\t\t{ value: \"index\", label: \"Allow indexing\" },\n\t\t\t],\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.noindex = value === \"noindex\";\n\t}\n\n\tif (selected.has(\"expiresAt\")) {\n\t\tconst value = await prompt.text({\n\t\t\tmessage: \"Expiration date\",\n\t\t\tplaceholder: \"2025-12-31T23:59:59Z\",\n\t\t\tvalidate: validateIsoDate,\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.expiresAt = value.trim();\n\t}\n\n\tif (selected.has(\"metadata\")) {\n\t\tconst value = await prompt.text({\n\t\t\tmessage: \"Metadata JSON object\",\n\t\t\tplaceholder: '{\"source\":\"cli\"}',\n\t\t\tvalidate: validateJsonObject,\n\t\t});\n\t\tif (prompt.isCancel(value)) return cancelUpdate(prompt);\n\t\toptions.metadata = parseJsonObject(value);\n\t}\n\n\treturn { ...(input ? { input } : {}), options };\n}\n\nfunction cancelUpdate(\n\tprompt: UpdatePromptApi,\n): { input?: string; options: ParsedDropOptions } | undefined {\n\tprompt.cancel(\"Update cancelled.\");\n\treturn undefined;\n}\n\nfunction requireNonEmpty(message: string) {\n\treturn (value: string | undefined): string | undefined =>\n\t\tvalue?.trim() ? undefined : message;\n}\n\nfunction validateIsoDate(value: string | undefined): string | undefined {\n\tif (!value?.trim()) return \"Enter an ISO 8601 date.\";\n\tconst d = new Date(value);\n\treturn Number.isNaN(d.getTime()) ? \"Enter a valid ISO 8601 date.\" : undefined;\n}\n\nfunction validateJsonObject(value: string | undefined): string | undefined {\n\tif (!value?.trim()) return \"Enter a JSON object.\";\n\ttry {\n\t\tparseJsonObject(value);\n\t\treturn undefined;\n\t} catch {\n\t\treturn \"Enter a valid JSON object.\";\n\t}\n}\n\nfunction parseJsonObject(value: string): 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(\"Metadata must be a JSON object.\");\n\t}\n\treturn parsed as Record<string, unknown>;\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\treturn writeError(\n\t\t\tdeps,\n\t\t\t\"invalid_usage\",\n\t\t\t\"--url and --dry-run cannot be combined.\",\n\t\t\t\"Remove --url; dry-run outputs JSON describing what would be published.\",\n\t\t);\n\t}\n\ttry {\n\t\tassertDropId(target);\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({ ok: true, 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 as PublishInput, options);\n\t\tconst output = formatDryRunManifest(prepared, { target });\n\t\tif (prepared.kind === \"staged\") {\n\t\t\tvalidateManifestFileCount(prepared.manifest.files.length);\n\t\t}\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\treturn writeError(deps, code, message);\n\t}\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 { writeHumanOrJson, writeKv } from \"../fmt.js\";\nimport type { CredentialStore } from \"../storage.js\";\nimport type { SdkErrorMessage, SdkResult } from \"../types.js\";\n\ntype WhoamiClient = {\n\taccount: { get(): Promise<SdkResult<unknown, SdkErrorMessage>> };\n};\n\nexport async function runWhoami(\n\t_input: { json?: boolean },\n\tdeps: {\n\t\tstore: CredentialStore;\n\t\tclient: WhoamiClient;\n\t\tapiKey?: string;\n\t\tenv: Record<string, string | undefined>;\n\t\tstdout: (value: string) => void;\n\t\tstderr: (value: string) => void;\n\t\toutputMode?: \"human\" | \"json\";\n\t},\n): Promise<{ exitCode: number }> {\n\tconst credential = await resolveCredential({\n\t\t...(deps.apiKey ? { apiKey: deps.apiKey } : {}),\n\t\tenv: deps.env,\n\t\tstore: deps.store,\n\t});\n\tif (!credential) {\n\t\twriteHumanOrJson(deps, \"Not authenticated. Run dropthis login.\", {\n\t\t\tok: true,\n\t\t\tauthenticated: false,\n\t\t});\n\t\treturn { exitCode: 0 };\n\t}\n\n\tconst result = await deps.client.account.get();\n\tif (result.error) {\n\t\twriteHumanOrJson(\n\t\t\tdeps,\n\t\t\t`Not authenticated: ${result.error.message}. Run dropthis login.`,\n\t\t\t{ ok: true, authenticated: false, reason: result.error.message },\n\t\t);\n\t\treturn { exitCode: 0 };\n\t}\n\n\tconst account = (result.data ?? {}) as Record<string, unknown>;\n\tconst masked = maskKey(credential.apiKey);\n\tconst last4 = credential.keyLast4 ?? credential.apiKey.slice(-4);\n\tconst pairs: Array<[string, string]> = [];\n\tif (credential.email ?? account.email)\n\t\tpairs.push([\"Email\", String(credential.email ?? account.email)]);\n\tpairs.push([\"Key\", masked]);\n\tpairs.push([\"Source\", credential.source]);\n\tif (credential.accountId ?? account.id)\n\t\tpairs.push([\"Account\", String(credential.accountId ?? account.id)]);\n\n\tconst jsonEnvelope = {\n\t\tok: true,\n\t\tauthenticated: true,\n\t\tsource: credential.source,\n\t\tmasked_key: masked,\n\t\t...(credential.keyId ? { key_id: credential.keyId } : {}),\n\t\t...(last4 ? { key_last4: last4 } : {}),\n\t\t...((credential.accountId ?? account.id)\n\t\t\t? { account_id: String(credential.accountId ?? account.id) }\n\t\t\t: {}),\n\t\t...((credential.email ?? account.email)\n\t\t\t? { email: String(credential.email ?? account.email) }\n\t\t\t: {}),\n\t};\n\twriteKv(deps, pairs, jsonEnvelope);\n\treturn { exitCode: 0 };\n}\n","import { Dropthis } from \"@dropthis/node\";\nimport { createOutput, type Output } from \"./output.js\";\n\nexport type GlobalOptions = {\n\tapiKey?: string;\n\tapiUrl?: string;\n\tjson?: boolean;\n\tquiet?: boolean;\n\tinteractive?: 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 {\n\tchmod,\n\tmkdir,\n\treadFile,\n\trename,\n\trm,\n\twriteFile,\n} 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\tif (!value) return null;\n\t\tif (typeof value.apiKey !== \"string\" || !value.apiKey) return null;\n\t\treturn { ...value, storage: \"insecure\" } as StoredCredential;\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 (typeof apiKey !== \"string\" || !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\tconst tmpPath = `${path}.${process.pid}.tmp`;\n\tawait writeFile(tmpPath, `${JSON.stringify(credential, null, 2)}\\n`, {\n\t\tmode: 0o600,\n\t});\n\tawait chmod(tmpPath, 0o600);\n\tawait rename(tmpPath, path);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAsDA,eAAsB,cACrB,MACqC;AACrC,MAAI;AACH,UAAM,SAAS,KAAK,UAAU,eAAe;AAE7C,SAAK,OAAO,oCAAoC;AAEhD,UAAM,cAAc,MAAM,OAAO,MAAM;AACvC,QAAI,OAAO,gBAAgB,UAAU;AACpC,aAAO;AAAA,IACR;AACA,UAAM,QAAQ;AAEd,UAAM,aAAa,MAAM,KAAK,OAAO,KAAK,gBAAgB,EAAE,MAAM,CAAC;AACnE,QAAI,WAAW,OAAO;AACrB,WAAK,OAAO,GAAG,WAAW,MAAM,OAAO;AAAA,CAAI;AAC3C,aAAO;AAAA,IACR;AAEA,SAAK,OAAO,gCAAgC;AAE5C,UAAM,cAAc;AACpB,QAAI,UAA8B;AAElC,aAAS,UAAU,GAAG,WAAW,aAAa,WAAW;AACxD,YAAM,aAAa,MAAM,OAAO,KAAK,SAAS,WAAW;AACzD,UAAI,O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AI,OAAO,KAAK,KAAK;AAAA,IACnE;AAAA,EACD;AACA,SAAO,OAAO,OAAO,MAAM;AAC5B;;;AFt2BO,SAAS,wBAAwB,OAI7B;AACV,MAAI,MAAM,MAAM;AACf,UAAM;AAAA,MACL,GAAG,KAAK,UAAU,cAAc,eAAe,MAAM,OAAO,CAAC,CAAC;AAAA;AAAA,IAC/D;AAAA,EACD,OAAO;AACN,UAAM,OAAO,GAAG,MAAM,OAAO;AAAA,CAAI;AAAA,EAClC;AACA,SAAO;AACR;AAEA,SAAS,iBACR,KAC6D;AAC7D,SACC,OAAO,QAAQ,YACf,QAAQ,QACR,OAAQ,IAA2B,SAAS,YAC3C,IAAyB,KAAK,WAAW,YAAY;AAExD;AAEA,SAAS,UAAU,MAAyB;AAC3C,SACC,KAAK,SAAS,QAAQ,KACtB,KAAK,SAAS,SAAS,KACvB,KAAK,SAAS,IAAI,KAClB,QAAQ,IAAI,OAAO,UACnB,QAAQ,OAAO,UAAU;AAE3B;AAEA,aAAa,EAAE,OAAO,sBAAsB,EAAE,CAAC,EAC7C,WAAW,QAAQ,IAAI,EACvB,MAAM,CAACC,WAAmB;AAC1B,MAAI,iBAAiBA,MAAK,GAAG;AAG5B,QACCA,OAAM,SAAS,oBACfA,OAAM,SAAS,6BACfA,OAAM,SAAS,qBACd;AACD,cAAQ,WAAW;AACnB;AAAA,IACD;AACA,YAAQ,WAAW,wBAAwB;AAAA,MAC1C,SAASA,OAAM;AAAA,MACf,MAAM,UAAU,QAAQ,KAAK,MAAM,CAAC,CAAC;AAAA,MACrC,QAAQ,CAAC,UAAU,QAAQ,OAAO,MAAM,KAAK;AAAA,IAC9C,CAAC;AACD;AAAA,EACD;AACA,UAAQ,MAAMA,MAAK;AACnB,UAAQ,WAAW;AACpB,CAAC;","names":["osHostname","import_node_os","error","import_picocolors","import_picocolors","pc","pc","pc","pc","prompts","prompts","error","import_picocolors","pc","error","prompts","prompts","error","parseJsonObject","import_promises","error","pc","deps","global","result","runInlineAuth","error"]}
|