@indigoai-us/hq-cli 5.69.0 → 5.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,43 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.71.0]
6
+
7
+ ### Added
8
+
9
+ - **Async Outpost exec.** `hq outposts` gained three verbs for running commands
10
+ that exceed the synchronous `exec` limits (long-running turns, large payloads
11
+ and outputs), backed by the `mode` flag on `POST /outpost/exec`:
12
+ - `hq outposts exec-stage --file <path>` — upload an input payload to a
13
+ short-lived presigned URL and print `{ key, getUrl }`.
14
+ - `hq outposts exec-submit -- <command>` — submit an asynchronous command and
15
+ print `{ commandId }` immediately (no blocking).
16
+ - `hq outposts exec-result --command-id <id> [--wait]` — fetch the result;
17
+ non-terminal returns `{ done: false }`, `--wait` polls to completion.
18
+
19
+ ### Fixed
20
+
21
+ - `outposts exec` / `exec-submit` now shell-quote multi-argument commands before
22
+ joining, so `-- bash -c "$script" a b` survives instead of collapsing on a
23
+ naive space-join. A single command string still passes through verbatim.
24
+
25
+ ## [5.70.0]
26
+
27
+ ### Added
28
+
29
+ - **Read DMs from the CLI.** `hq dm` gained a receive side, wired to the notify
30
+ read endpoints that already back the HQ Sync menubar:
31
+ - `hq dm inbox` — list your incoming direct messages, with `--unread`,
32
+ `--limit`, `--json`, and `--mark-read`.
33
+ - `hq dm thread <person>` (alias `read`) — the two-way 1:1 conversation with a
34
+ person by email, personUid, or agentUid, read oldest-first. Marks their
35
+ messages read unless `--no-ack`. Reading by email uses the notify thread
36
+ endpoint's new `withEmail` resolution (requires the matching hq-pro deploy).
37
+ - `hq dm channel <name|#name|id>` (alias `history`) — channel and group-DM
38
+ message history, with `--mark-read` to advance your read cursor.
39
+ - **`hq channels` now shows each group DM's channel id**, so unnamed group DMs
40
+ are addressable for reading with `hq dm channel <id>`.
41
+
5
42
  ## [5.69.0]
6
43
 
7
44
  ### Added
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="891a3265-c9ff-53d8-8a3c-2a964f5a74b6")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fe48059a-56b5-5f50-8ebf-b5fbbe1aa432")}catch(e){}}();
3
3
  import chalk from "chalk";
4
4
  import { ensureCognitoToken } from "../utils/cognito-session.js";
5
5
  import { vaultApiFetch } from "../utils/vault-api.js";
@@ -18,7 +18,10 @@ export function describeChannel(c) {
18
18
  const who = names.length > 0
19
19
  ? names.join(", ")
20
20
  : `${c.memberCount ?? "?"}-person group`;
21
- return `${who} ${chalk.dim("(group DM)")}`;
21
+ // Group DMs are unnamed, so their channel id is the only way to address them
22
+ // for reading (`hq dm channel <id>`). Surface it so it can be copied.
23
+ const readHint = chalk.dim(`— hq dm channel ${c.channelId}`);
24
+ return `${who} ${chalk.dim("(group DM)")} ${readHint}`;
22
25
  }
23
26
  const slug = c.slug ?? (c.name ? channelSlug(c.name) : "");
24
27
  const scopeTag = c.scope ? chalk.dim(`(${c.scope})`) : "";
@@ -75,4 +78,4 @@ export function registerChannelsCommand(program) {
75
78
  });
76
79
  }
77
80
  //# sourceMappingURL=channels.js.map
78
- //# debugId=891a3265-c9ff-53d8-8a3c-2a964f5a74b6
81
+ //# debugId=fe48059a-56b5-5f50-8ebf-b5fbbe1aa432
@@ -119,5 +119,81 @@ export declare function buildConnectionActionBody(identifier: string, matched: C
119
119
  } | {
120
120
  withEmail: string;
121
121
  };
122
+ /** One incoming DM as returned by GET /v1/notify/inbox. */
123
+ export interface DmInboxEvent {
124
+ eventId: string;
125
+ fromPersonUid?: string;
126
+ fromEmail?: string;
127
+ fromDisplayName?: string;
128
+ body: string;
129
+ createdAt: string;
130
+ details?: string;
131
+ prompt?: string;
132
+ acknowledgedAt?: string;
133
+ }
134
+ /** One message in a 1:1 thread as returned by GET /v1/notify/thread. */
135
+ export interface DmThreadMessage {
136
+ eventId: string;
137
+ fromPersonUid?: string;
138
+ fromEmail?: string;
139
+ fromDisplayName?: string;
140
+ body: string;
141
+ createdAt: string;
142
+ direction: "in" | "out";
143
+ details?: string;
144
+ prompt?: string;
145
+ }
146
+ /** One channel/group message from GET /v1/notify/channels/{id}/messages. */
147
+ export interface ChannelMessageItem {
148
+ eventId?: string;
149
+ messageId?: string;
150
+ fromPersonUid?: string;
151
+ fromEmail?: string;
152
+ fromDisplayName?: string;
153
+ body: string;
154
+ createdAt: string;
155
+ }
156
+ /**
157
+ * Human label for a message sender — display name, else email, else uid. Pure →
158
+ * unit-testable.
159
+ */
160
+ export declare function senderLabel(m: {
161
+ fromDisplayName?: string;
162
+ fromEmail?: string;
163
+ fromPersonUid?: string;
164
+ }): string;
165
+ /**
166
+ * Render an ISO timestamp as a compact relative age ("3m ago", "2h ago",
167
+ * "5d ago"), falling back to a YYYY-MM-DD date for anything older than a week or
168
+ * an unparseable input. `nowMs` is injected so the formatting is unit-testable.
169
+ * Pure.
170
+ */
171
+ export declare function formatRelativeTime(iso: string, nowMs: number): string;
172
+ /** A DM is unread until the recipient acks it. Pure. */
173
+ export declare function isUnread(e: {
174
+ acknowledgedAt?: string;
175
+ }): boolean;
176
+ /** Event ids of the unread messages in a fetched inbox page. Pure. */
177
+ export declare function unreadEventIds(events: DmInboxEvent[]): string[];
178
+ /** Keep only the unread messages. Pure. */
179
+ export declare function filterUnread(events: DmInboxEvent[]): DmInboxEvent[];
180
+ /**
181
+ * Collapse a message body to a single trimmed line for list rendering, capped
182
+ * so one row stays readable. Pure.
183
+ */
184
+ export declare function firstLine(body: string, max?: number): string;
185
+ /**
186
+ * Turn a person identifier into the query the thread endpoint expects. An email
187
+ * rides `withEmail` (server resolves it); a prs_/agt_ uid rides `withPersonUid`.
188
+ * A bare name is rejected — resolve it first with `hq people resolve`. Pure →
189
+ * unit-testable. Throws with a user-facing message on an invalid identifier.
190
+ */
191
+ export declare function buildThreadQuery(identifier: string): Record<string, string>;
192
+ /** Render one inbox row (marker · age · sender · first line of body). */
193
+ export declare function formatInboxEvent(e: DmInboxEvent, nowMs: number): string;
194
+ /** Render one 1:1 thread line, tagged by direction. */
195
+ export declare function formatThreadMessage(m: DmThreadMessage, nowMs: number): string;
196
+ /** Render one channel/group message line. */
197
+ export declare function formatChannelMessage(m: ChannelMessageItem, nowMs: number): string;
122
198
  export declare function registerDmCommand(program: Command): void;
123
199
  //# sourceMappingURL=dm.d.ts.map
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e95f345b-0e15-52b3-a851-fc97da935a99")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8ba6c13e-f0d4-58c7-a62e-eede4fb7873f")}catch(e){}}();
3
3
  import chalk from "chalk";
4
4
  import { readFileSync } from "node:fs";
5
5
  import { ensureCognitoToken } from "../utils/cognito-session.js";
@@ -497,10 +497,294 @@ async function runDmRequests() {
497
497
  process.exit(1);
498
498
  }
499
499
  }
500
+ /**
501
+ * Human label for a message sender — display name, else email, else uid. Pure →
502
+ * unit-testable.
503
+ */
504
+ export function senderLabel(m) {
505
+ return (m.fromDisplayName?.trim() ||
506
+ m.fromEmail?.trim() ||
507
+ m.fromPersonUid?.trim() ||
508
+ "unknown");
509
+ }
510
+ /**
511
+ * Render an ISO timestamp as a compact relative age ("3m ago", "2h ago",
512
+ * "5d ago"), falling back to a YYYY-MM-DD date for anything older than a week or
513
+ * an unparseable input. `nowMs` is injected so the formatting is unit-testable.
514
+ * Pure.
515
+ */
516
+ export function formatRelativeTime(iso, nowMs) {
517
+ const t = new Date(iso).getTime();
518
+ if (isNaN(t))
519
+ return iso;
520
+ const diff = nowMs - t;
521
+ if (diff < 60_000)
522
+ return "just now";
523
+ const mins = Math.floor(diff / 60_000);
524
+ if (mins < 60)
525
+ return `${mins}m ago`;
526
+ const hours = Math.floor(mins / 60);
527
+ if (hours < 24)
528
+ return `${hours}h ago`;
529
+ const days = Math.floor(hours / 24);
530
+ if (days < 7)
531
+ return `${days}d ago`;
532
+ return new Date(t).toISOString().slice(0, 10);
533
+ }
534
+ /** A DM is unread until the recipient acks it. Pure. */
535
+ export function isUnread(e) {
536
+ return !e.acknowledgedAt;
537
+ }
538
+ /** Event ids of the unread messages in a fetched inbox page. Pure. */
539
+ export function unreadEventIds(events) {
540
+ return events
541
+ .filter(isUnread)
542
+ .map((e) => e.eventId)
543
+ .filter((id) => typeof id === "string" && id.length > 0);
544
+ }
545
+ /** Keep only the unread messages. Pure. */
546
+ export function filterUnread(events) {
547
+ return events.filter(isUnread);
548
+ }
549
+ /**
550
+ * Collapse a message body to a single trimmed line for list rendering, capped
551
+ * so one row stays readable. Pure.
552
+ */
553
+ export function firstLine(body, max = 240) {
554
+ const oneLine = (body ?? "").replace(/\s+/g, " ").trim();
555
+ if (oneLine.length <= max)
556
+ return oneLine;
557
+ return oneLine.slice(0, max - 1) + "…";
558
+ }
559
+ /**
560
+ * Turn a person identifier into the query the thread endpoint expects. An email
561
+ * rides `withEmail` (server resolves it); a prs_/agt_ uid rides `withPersonUid`.
562
+ * A bare name is rejected — resolve it first with `hq people resolve`. Pure →
563
+ * unit-testable. Throws with a user-facing message on an invalid identifier.
564
+ */
565
+ export function buildThreadQuery(identifier) {
566
+ const rcpt = detectRecipient(identifier);
567
+ if (!rcpt) {
568
+ throw new Error(`Invalid person '${identifier}': pass an email or a personUid/agentUid (prs_… / agt_…). Resolve a name first with \`hq people resolve\`.`);
569
+ }
570
+ if (rcpt.toEmail)
571
+ return { withEmail: rcpt.toEmail };
572
+ return { withPersonUid: rcpt.toPersonUid };
573
+ }
574
+ /** Render one inbox row (marker · age · sender · first line of body). */
575
+ export function formatInboxEvent(e, nowMs) {
576
+ const marker = isUnread(e) ? chalk.cyan("●") : " ";
577
+ const when = chalk.dim(formatRelativeTime(e.createdAt, nowMs));
578
+ const who = chalk.bold(senderLabel(e));
579
+ const email = e.fromEmail && e.fromDisplayName ? chalk.dim(` <${e.fromEmail}>`) : "";
580
+ return `${marker} ${when} ${who}${email}\n ${firstLine(e.body)}`;
581
+ }
582
+ /** Render one 1:1 thread line, tagged by direction. */
583
+ export function formatThreadMessage(m, nowMs) {
584
+ const arrow = m.direction === "out" ? chalk.dim("→") : chalk.cyan("←");
585
+ const who = m.direction === "out" ? "you" : senderLabel(m);
586
+ const when = chalk.dim(formatRelativeTime(m.createdAt, nowMs));
587
+ return `${arrow} ${chalk.bold(who)} ${when}\n ${firstLine(m.body)}`;
588
+ }
589
+ /** Render one channel/group message line. */
590
+ export function formatChannelMessage(m, nowMs) {
591
+ const who = chalk.bold(senderLabel(m));
592
+ const when = chalk.dim(formatRelativeTime(m.createdAt, nowMs));
593
+ return `${who} ${when}\n ${firstLine(m.body)}`;
594
+ }
595
+ /** POST /v1/notify/inbox/ack — idempotently mark messages read. */
596
+ async function ackEvents(token, eventIds) {
597
+ if (eventIds.length === 0)
598
+ return;
599
+ const res = await vaultApiFetch({
600
+ token,
601
+ path: "/v1/notify/inbox/ack",
602
+ method: "POST",
603
+ body: { eventIds },
604
+ });
605
+ if (!res.ok) {
606
+ const err = (await res.json().catch(() => ({})));
607
+ throw new Error(friendlyDmError(res.status, err.code, err.error ?? err.message ?? res.statusText));
608
+ }
609
+ }
610
+ async function runDmInbox(opts) {
611
+ try {
612
+ const token = await ensureCognitoToken();
613
+ const query = {};
614
+ if (opts.limit)
615
+ query.limit = opts.limit;
616
+ const res = await vaultApiFetch({ token, path: "/v1/notify/inbox", query });
617
+ if (!res.ok) {
618
+ const err = (await res.json().catch(() => ({})));
619
+ console.error(chalk.red(friendlyDmError(res.status, err.code, err.error ?? err.message ?? res.statusText)));
620
+ process.exit(1);
621
+ }
622
+ const data = (await res.json());
623
+ const all = data.events ?? [];
624
+ const shown = opts.unread ? filterUnread(all) : all;
625
+ if (opts.json) {
626
+ console.log(JSON.stringify(shown, null, 2));
627
+ }
628
+ else if (shown.length === 0) {
629
+ console.log(chalk.dim(opts.unread ? "No unread messages." : "No messages yet."));
630
+ }
631
+ else {
632
+ const unreadCount = filterUnread(all).length;
633
+ const suffix = unreadCount > 0 ? ` (${unreadCount} unread)` : "";
634
+ console.log(chalk.green(`${shown.length} message${shown.length === 1 ? "" : "s"}${suffix}:`));
635
+ const now = Date.now();
636
+ for (const e of shown)
637
+ console.log(`\n${formatInboxEvent(e, now)}`);
638
+ if (data.nextCursor) {
639
+ console.log(chalk.dim("\nMore messages available — raise --limit to see them."));
640
+ }
641
+ }
642
+ // Ack every unread message on the fetched page (not just the filtered view).
643
+ if (opts.markRead) {
644
+ const ids = unreadEventIds(all);
645
+ await ackEvents(token, ids);
646
+ if (!opts.json && ids.length > 0) {
647
+ console.log(chalk.dim(`\nMarked ${ids.length} read.`));
648
+ }
649
+ }
650
+ }
651
+ catch (err) {
652
+ console.error(chalk.red("Error:"), err instanceof Error ? err.message : String(err));
653
+ process.exit(1);
654
+ }
655
+ }
656
+ async function runDmThread(identifier, opts) {
657
+ try {
658
+ const query = buildThreadQuery(identifier);
659
+ if (opts.limit)
660
+ query.limit = opts.limit;
661
+ const token = await ensureCognitoToken();
662
+ const res = await vaultApiFetch({
663
+ token,
664
+ path: "/v1/notify/thread",
665
+ query,
666
+ });
667
+ if (!res.ok) {
668
+ const err = (await res.json().catch(() => ({})));
669
+ console.error(chalk.red(friendlyDmError(res.status, err.code, err.error ?? err.message ?? res.statusText)));
670
+ process.exit(1);
671
+ }
672
+ const data = (await res.json());
673
+ const messages = data.messages ?? [];
674
+ // The server returns newest-first; read a conversation oldest-first.
675
+ const ordered = [...messages].reverse();
676
+ if (opts.json) {
677
+ console.log(JSON.stringify(ordered, null, 2));
678
+ }
679
+ else if (ordered.length === 0) {
680
+ console.log(chalk.dim(`No messages with ${identifier} yet.`));
681
+ }
682
+ else {
683
+ console.log(chalk.green(`${ordered.length} message${ordered.length === 1 ? "" : "s"} with ${identifier}:`));
684
+ const now = Date.now();
685
+ for (const m of ordered)
686
+ console.log(`\n${formatThreadMessage(m, now)}`);
687
+ }
688
+ // Mark the incoming messages read unless the caller opted out. Best-effort:
689
+ // a read is a side effect, not the point of the command, so an ack failure
690
+ // is surfaced but does not fail the read.
691
+ if (opts.ack !== false) {
692
+ const inIds = messages
693
+ .filter((m) => m.direction === "in")
694
+ .map((m) => m.eventId)
695
+ .filter((id) => typeof id === "string" && id.length > 0);
696
+ try {
697
+ await ackEvents(token, inIds);
698
+ }
699
+ catch (ackErr) {
700
+ console.error(chalk.dim(`(could not mark read: ${ackErr instanceof Error ? ackErr.message : String(ackErr)})`));
701
+ }
702
+ }
703
+ }
704
+ catch (err) {
705
+ console.error(chalk.red("Error:"), err instanceof Error ? err.message : String(err));
706
+ process.exit(1);
707
+ }
708
+ }
709
+ /**
710
+ * Resolve a `hq dm channel <target>` argument to a channelId. Accepts a channel
711
+ * name (bare or `#name`) resolved against the caller's channels, or a raw
712
+ * channelId (the only way to address an unnamed group DM — copy it from
713
+ * `hq channels`). Throws a user-facing message when nothing matches or a name is
714
+ * ambiguous.
715
+ */
716
+ async function resolveChannelId(token, target) {
717
+ const raw = target.trim().replace(/^#/, "");
718
+ if (!raw)
719
+ throw new Error("A channel name or id is required.");
720
+ const channels = await fetchChannels(token);
721
+ const named = matchChannelsByName(channels, raw);
722
+ if (named.length === 1)
723
+ return named[0].channelId;
724
+ if (named.length > 1) {
725
+ throw new Error(`'${raw}' matches ${named.length} channels — pass the channel id instead (see \`hq channels\`).`);
726
+ }
727
+ const byId = channels.find((c) => c.channelId === raw);
728
+ if (byId)
729
+ return byId.channelId;
730
+ throw new Error(`No channel named or with id '${raw}' — run \`hq channels\` to see yours.`);
731
+ }
732
+ async function runDmChannel(target, opts) {
733
+ try {
734
+ const token = await ensureCognitoToken();
735
+ const channelId = await resolveChannelId(token, target);
736
+ const query = {};
737
+ if (opts.limit)
738
+ query.limit = opts.limit;
739
+ const res = await vaultApiFetch({
740
+ token,
741
+ path: `/v1/notify/channels/${encodeURIComponent(channelId)}/messages`,
742
+ query,
743
+ });
744
+ if (!res.ok) {
745
+ const err = (await res.json().catch(() => ({})));
746
+ console.error(chalk.red(friendlyDmError(res.status, err.code, err.error ?? err.message ?? res.statusText)));
747
+ process.exit(1);
748
+ }
749
+ const data = (await res.json());
750
+ const messages = data.messages ?? [];
751
+ const ordered = [...messages].reverse(); // oldest-first for reading
752
+ if (opts.json) {
753
+ console.log(JSON.stringify(ordered, null, 2));
754
+ }
755
+ else if (ordered.length === 0) {
756
+ console.log(chalk.dim("No messages in this channel yet."));
757
+ }
758
+ else {
759
+ console.log(chalk.green(`${ordered.length} message${ordered.length === 1 ? "" : "s"}:`));
760
+ const now = Date.now();
761
+ for (const m of ordered)
762
+ console.log(`\n${formatChannelMessage(m, now)}`);
763
+ }
764
+ if (opts.markRead) {
765
+ // messages are newest-first from the server; advance the read cursor to
766
+ // the newest one we saw.
767
+ const newest = messages[0]?.createdAt;
768
+ const readRes = await vaultApiFetch({
769
+ token,
770
+ path: `/v1/notify/channels/${encodeURIComponent(channelId)}/read`,
771
+ method: "POST",
772
+ body: newest ? { lastReadAt: newest } : {},
773
+ });
774
+ if (!opts.json && readRes.ok) {
775
+ console.log(chalk.dim("\nMarked read."));
776
+ }
777
+ }
778
+ }
779
+ catch (err) {
780
+ console.error(chalk.red("Error:"), err instanceof Error ? err.message : String(err));
781
+ process.exit(1);
782
+ }
783
+ }
500
784
  export function registerDmCommand(program) {
501
785
  const dm = program
502
786
  .command("dm")
503
- .description("Send a direct message and manage connection requests.");
787
+ .description("Send and read direct messages, and manage connection requests.");
504
788
  dm
505
789
  .command("send [recipient] [message]", { isDefault: true, hidden: true })
506
790
  .description('Send a direct message. RECIPIENT can be a person (email, personUid, or agentUid), a GROUP DM (comma-separated: "a@x.com,b@y.com"), or one of your DM CHANNELS by name — bare (hq dm vyg-dev "hi"), hash form (hq dm "#vyg-dev" "hi"), or via --channel (hq dm --channel vyg-dev "hi"). A person receives a DM as an HQ Sync notification; an agent receives it in its durable box inbox. If you aren\'t connected yet, it sends a connection request that holds your message. See your channels with `hq channels`.')
@@ -514,6 +798,36 @@ export function registerDmCommand(program) {
514
798
  .action(async (recipient, message, opts) => {
515
799
  await runDmSend(recipient, message, opts);
516
800
  });
801
+ dm
802
+ .command("inbox")
803
+ .description("List your recent incoming direct messages.")
804
+ .option("--limit <n>", "Max messages to fetch (server-capped)")
805
+ .option("--unread", "Show only unread messages")
806
+ .option("--mark-read", "Mark the fetched messages as read after listing")
807
+ .option("--json", "Output raw JSON instead of a list")
808
+ .action(async (opts) => {
809
+ await runDmInbox(opts);
810
+ });
811
+ dm
812
+ .command("thread <person>")
813
+ .alias("read")
814
+ .description("Show your two-way conversation with a person (email, personUid, or agentUid). Reads oldest-first and marks their messages read unless --no-ack.")
815
+ .option("--limit <n>", "Max messages to fetch (server-capped)")
816
+ .option("--no-ack", "Do not mark the incoming messages as read")
817
+ .option("--json", "Output raw JSON instead of a transcript")
818
+ .action(async (person, opts) => {
819
+ await runDmThread(person, opts);
820
+ });
821
+ dm
822
+ .command("channel <target>")
823
+ .alias("history")
824
+ .description("Show recent messages in a DM channel or group DM — by name, #name, or a channel id from `hq channels`.")
825
+ .option("--limit <n>", "Max messages to fetch (server-capped)")
826
+ .option("--mark-read", "Advance your read marker to the newest message")
827
+ .option("--json", "Output raw JSON instead of a transcript")
828
+ .action(async (target, opts) => {
829
+ await runDmChannel(target, opts);
830
+ });
517
831
  dm
518
832
  .command("requests")
519
833
  .description("List your pending incoming connection requests.")
@@ -540,4 +854,4 @@ export function registerDmCommand(program) {
540
854
  });
541
855
  }
542
856
  //# sourceMappingURL=dm.js.map
543
- //# debugId=e95f345b-0e15-52b3-a851-fc97da935a99
857
+ //# debugId=8ba6c13e-f0d4-58c7-a62e-eede4fb7873f
@@ -95,6 +95,42 @@ export interface OutpostExecResult {
95
95
  * `step` distinguishes not-ready / platform-unsupported / timeout / ssm.
96
96
  */
97
97
  export declare function execOutpost(token: string, command: string, outpostId?: string): Promise<OutpostExecResult>;
98
+ /** Presigned input-upload details from `mode: "stage"`. */
99
+ export interface OutpostExecStage {
100
+ ok: true;
101
+ userId: string;
102
+ outpostId: string;
103
+ key: string;
104
+ putUrl: string;
105
+ getUrl: string;
106
+ expiresInSeconds: number;
107
+ }
108
+ /** Asynchronous SSM command details from `mode: "submit"`. */
109
+ export interface OutpostExecSubmission {
110
+ ok: true;
111
+ userId: string;
112
+ outpostId: string;
113
+ instanceId: string;
114
+ commandId: string;
115
+ outputPrefix: string;
116
+ }
117
+ /** Poll response from `mode: "result"`; streams arrive only when terminal. */
118
+ export interface OutpostExecAsyncResult {
119
+ ok: true;
120
+ userId: string;
121
+ outpostId: string;
122
+ status: string;
123
+ done: boolean;
124
+ exitCode?: number | null;
125
+ stdout?: string;
126
+ stderr?: string;
127
+ truncated?: boolean;
128
+ }
129
+ export declare function stageExecInput(token: string, outpostId?: string): Promise<OutpostExecStage>;
130
+ export declare function submitExec(token: string, command: string, outpostId?: string): Promise<OutpostExecSubmission>;
131
+ export declare function fetchExecResult(token: string, commandId: string, outpostId?: string): Promise<OutpostExecAsyncResult>;
132
+ /** Preserve a single command string; safely join argv when Commander split it. */
133
+ export declare function joinCommandParts(commandParts: string[]): string;
98
134
  /**
99
135
  * Prefix that best-effort `cd`s into the box's HQ checkout before running the
100
136
  * caller's command. `exec` runs over two transports with two different default