@rosthq/cli 0.5.12 → 0.5.13

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAoB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAYrE,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAK1C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,EAAE,CAAC,EAAE,KAAK,CAAC;IACX,KAAK,CAAC,EAAE,OAAO,gBAAgB,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,mBAAmB,CAAC;IACzC,cAAc,CAAC,EAAE,OAAO,yBAAyB,CAAC;CACnD,CAAC;AAEF,wBAAsB,IAAI,CAAC,IAAI,WAAwB,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+LnG;AAwXD,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAUxF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAoB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAYrE,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAK1C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,EAAE,CAAC,EAAE,KAAK,CAAC;IACX,KAAK,CAAC,EAAE,OAAO,gBAAgB,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,mBAAmB,CAAC;IACzC,cAAc,CAAC,EAAE,OAAO,yBAAyB,CAAC;CACnD,CAAC;AAEF,wBAAsB,IAAI,CAAC,IAAI,WAAwB,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+LnG;AAoZD,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAUxF"}
package/dist/index.js CHANGED
@@ -42342,7 +42342,7 @@ External connectors are being rolled out provider by provider, conservatively (r
42342
42342
  order: 48,
42343
42343
  title: "CLI and MCP installation guide",
42344
42344
  summary: "Install the public CLI, register remote token-backed MCP clients, and find the full command and tool catalog.",
42345
- version: "2026-06-20.4",
42345
+ version: "2026-06-20.5",
42346
42346
  public: true,
42347
42347
  audiences: ["human", "cli", "mcp", "in_app_agent"],
42348
42348
  stages: ["company_setup", "staffing"],
@@ -42411,7 +42411,7 @@ The MCP server is remote and token-backed. There is no local MCP daemon to insta
42411
42411
  A headless agent cannot complete setup unattended. Two things always require a human, so plan to announce the handoff rather than stall silently:
42412
42412
 
42413
42413
  - **Device-code approval at first login.** \`{{cli}} login --device\` prints a code; a human must open the workspace URL in a browser, sign in with Google, match the code, and approve.
42414
- - **Durable gated commands.** Setting or approving a Charter, staffing a seat, and taking an agent live each open a confirmation that a human approves (an agent never approves its own request \u2014 see the confirmations-guide). The CLI surfaces the \`confirmation_id\` and an \`approveVia\` URL for the human. (\`{{cli}} mcp install\` is a partial exception: for an **interactive** operator it completes its own token-mint approval inline; in a **headless/agent** session it surfaces the confirmation and stops unless \`--skip-permissions\` / \`{{envPrefix}}_CLI_SKIP_PERMISSIONS=1\` is set \u2014 see Approving the token mint below.)
42414
+ - **Durable gated commands.** Setting or approving a Charter, staffing a seat, and taking an agent live each require a human approval boundary (an agent never approves its own request \u2014 see the confirmations-guide). In a **headless/agent** session, or over MCP, the command surfaces the \`confirmation_id\` and an \`approveVia\` URL for a human and stops. When a logged-in human runs \`{{cli}} command <id>\` from an **interactive TTY**, the official CLI completes that returned confirmation inline by calling \`confirmation.approve\` and printing the approved command output. (\`{{cli}} mcp install\` follows the same interactive rule for token minting, with \`--skip-permissions\` / \`{{envPrefix}}_CLI_SKIP_PERMISSIONS=1\` as an explicit headless loosening \u2014 see Approving the token mint below.)
42415
42415
 
42416
42416
  Treat these as blocking prerequisites: the agent prepares the request and waits for the human approver.
42417
42417
 
@@ -43360,7 +43360,7 @@ Keep agent scope tight at first. Approve more autonomy only after evidence. Use
43360
43360
  order: 71,
43361
43361
  title: "Confirmations and human gates guide",
43362
43362
  summary: "How {{brand}} routes authority-changing work through human confirmation, and why agents never approve their own requests.",
43363
- version: "2026-06-18.1",
43363
+ version: "2026-06-20.1",
43364
43364
  public: true,
43365
43365
  audiences: ["human", "cli", "mcp", "in_app_agent"],
43366
43366
  stages: ["graph_design", "charter_design", "staffing", "operating_rhythm"],
@@ -43393,7 +43393,7 @@ The \`dangerous\` confirmation **level** is rare and is not the same as the **ri
43393
43393
 
43394
43394
  ## What a gated command returns over MCP
43395
43395
 
43396
- A gated command does not mutate when an agent calls it. It returns a pending confirmation with the command id, a risk level, and an \`approveVia\` block containing a web URL and the exact \`{{cli}} command confirmation.approve --json ...\` line. The human approves through the web link or the CLI; the agent surfaces the link and stops.
43396
+ A gated command does not mutate when an agent calls it. It returns a pending confirmation with the command id, a risk level, and an \`approveVia\` block containing a web URL and the exact \`{{cli}} command confirmation.approve --json ...\` line. The human approves through the web link or the CLI; the agent surfaces the link and stops. A logged-in human at an interactive CLI can run their own gated \`{{cli}} command <id>\` without copy-pasting the approval command because the CLI completes the returned confirmation inline.
43397
43397
 
43398
43398
  \`\`\`bash
43399
43399
  # Human approves a pending confirmation
@@ -46616,9 +46616,38 @@ async function printCommandOutput(io, client, commandId, body = {}, format, opti
46616
46616
  `);
46617
46617
  return 0;
46618
46618
  } catch (error51) {
46619
+ if (io.interactive === true) {
46620
+ const pending = pendingConfirmationFromError(error51);
46621
+ if (pending && pending.commandId === commandId) {
46622
+ io.stderr.write(`Approving ${pending.commandId} confirmation ${pending.confirmationId} as the interactive CLI user.
46623
+ `);
46624
+ try {
46625
+ const approved = await client.execute("confirmation.approve", { confirmation_id: pending.confirmationId });
46626
+ const approvedOutput = asRecord2(approved.output).output ?? approved.output;
46627
+ const rendered = format ? format(approvedOutput) : JSON.stringify(approvedOutput, null, 2);
46628
+ io.stdout.write(`${rendered}
46629
+ `);
46630
+ return 0;
46631
+ } catch (approvalError) {
46632
+ return printCommandError(io, approvalError);
46633
+ }
46634
+ }
46635
+ }
46619
46636
  return printCommandError(io, error51);
46620
46637
  }
46621
46638
  }
46639
+ function pendingConfirmationFromError(error51) {
46640
+ if (!(error51 instanceof CommandClientError) || !error51.response || error51.response.ok || error51.response.error.code !== "COMMAND_CONFIRMATION_REQUIRED") {
46641
+ return null;
46642
+ }
46643
+ const details = asRecord2(error51.response.error.details);
46644
+ const confirmationId = details.confirmationId;
46645
+ const commandId = details.commandId;
46646
+ if (typeof confirmationId !== "string" || confirmationId.length === 0 || typeof commandId !== "string" || commandId.length === 0) {
46647
+ return null;
46648
+ }
46649
+ return { confirmationId, commandId };
46650
+ }
46622
46651
  function printCommandError(io, error51) {
46623
46652
  if (error51 instanceof CommandClientError && error51.response && !error51.response.ok) {
46624
46653
  const help = error51.response.error.help;