@moondeck/station 1.0.10 → 1.0.11
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/lib/agent-cli.ts +27 -1
- package/package.json +1 -1
package/lib/agent-cli.ts
CHANGED
|
@@ -377,7 +377,7 @@ function opLine(op) {
|
|
|
377
377
|
if (op.state === "ready" || op.state === "ready_with_warning") {
|
|
378
378
|
return "added " + op.slug + " at " + op.path + (op.warning ? " (warning: " + op.warning + ")" : "");
|
|
379
379
|
}
|
|
380
|
-
return "adding " + op.slug + " (" + op.state + "); check again with: moondeck task project status " + op.operationId;
|
|
380
|
+
return "adding " + op.slug + " (" + op.state + ")" + (op.warning ? " (warning: " + op.warning + ")" : "") + "; check again with: moondeck task project status " + op.operationId;
|
|
381
381
|
}
|
|
382
382
|
function opProgress(op) {
|
|
383
383
|
const attempts = Number.isInteger(op.attempts) ? "; attempts: " + op.attempts : "";
|
|
@@ -803,6 +803,31 @@ const { flags, rest: pos } = parseFlags(rest);
|
|
|
803
803
|
const validateShareablePath = ${validateShareablePath.toString()};
|
|
804
804
|
const assertShareablePath = (path) => validateShareablePath(path, ${JSON.stringify(ENGINE_ACCOUNT_PATH_RULES)});
|
|
805
805
|
async function main() {
|
|
806
|
+
if (group === "support") {
|
|
807
|
+
if (action !== "submit" || !flags.category || !flags.message || Object.keys(flags).some(k => !["category", "message", "subject", "file"].includes(k))) {
|
|
808
|
+
console.error('moondeck: support submit --category bug|question|feature|account|other --message "details" [--subject "subject"] [--file path]…'); process.exit(1);
|
|
809
|
+
}
|
|
810
|
+
const form = new FormData();
|
|
811
|
+
form.set("category", flags.category);
|
|
812
|
+
form.set("message", flags.message === "-" ? stdinText("support message") : flags.message);
|
|
813
|
+
if (flags.subject) form.set("subject", flags.subject);
|
|
814
|
+
const paths = [];
|
|
815
|
+
for (let i = 0; i < rest.length; i++) if (rest[i] === "--file" && rest[i + 1]) paths.push(rest[++i]);
|
|
816
|
+
if (paths.length > 5) { console.error("moondeck: at most 5 files"); process.exit(1); }
|
|
817
|
+
for (const path of paths) {
|
|
818
|
+
const data = readFileSync(path);
|
|
819
|
+
if (!data.length || data.length > 10 * 1024 * 1024) { console.error("moondeck: files must be nonempty and at most 10MB"); process.exit(1); }
|
|
820
|
+
const ext = path.split(".").pop().toLowerCase();
|
|
821
|
+
const type = ({ png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", gif: "image/gif", webp: "image/webp", pdf: "application/pdf", json: "application/json", zip: "application/zip", txt: "text/plain", log: "text/plain", md: "text/markdown", csv: "text/csv" })[ext];
|
|
822
|
+
if (!type) { console.error("moondeck: unsupported file type"); process.exit(1); }
|
|
823
|
+
form.append("files", new Blob([data], { type }), basename(path));
|
|
824
|
+
}
|
|
825
|
+
const res = await fetch(API_URL + "/api/agent/support", { method: "POST", headers: { authorization: "Bearer " + TOKEN }, body: form });
|
|
826
|
+
let result;
|
|
827
|
+
try { result = await res.json(); } catch { console.error("moondeck: support submission returned HTTP " + res.status + " with an unreadable response; check ticket history before retrying"); process.exit(1); }
|
|
828
|
+
if (!res.ok) { console.error("moondeck: " + (result.error?.message || "support submission failed")); process.exit(1); }
|
|
829
|
+
out(result); return;
|
|
830
|
+
}
|
|
806
831
|
if (group === "secret") {
|
|
807
832
|
if (action !== "request" || pos.length !== 1 || !flags.why || Object.keys(flags).some(key => !["why", "proxy-domain", "no-wait"].includes(key))) { console.error('moondeck: secret request NAME --why "reason" [--proxy-domain host]… [--no-wait]'); process.exit(1); }
|
|
808
833
|
// Repeated domains retain order from argv; the generic flag parser intentionally keeps one value.
|
|
@@ -1463,6 +1488,7 @@ async function main() {
|
|
|
1463
1488
|
' moondeck share <path> [--title "text"] (share an immutable file with people; Files plan, workspace quota)',
|
|
1464
1489
|
' moondeck secret request NAME --why "reason" [--proxy-domain host]… [--no-wait]',
|
|
1465
1490
|
" Never paste secrets into chat. A person supplies them through the private dialog.",
|
|
1491
|
+
' moondeck support submit --category bug --message "details" [--subject "subject"] [--file path]…',
|
|
1466
1492
|
" moondeck artifacts",
|
|
1467
1493
|
" moondeck projects list",
|
|
1468
1494
|
" moondeck files ls [org|me[/prefix]] (one folder: names, sizes, mtimes, etags; defaults to org)",
|
package/package.json
CHANGED