skydive-cli 0.3.0 → 0.4.0-beta.1033

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +28 -2
  3. package/dist/js/billing-blocked-CwfG1BTR.mjs +71 -0
  4. package/dist/js/billing-blocked-euid6MN9.mjs +4 -0
  5. package/dist/js/bin.mjs +247 -89
  6. package/dist/js/{boot-HAgDg_b4.mjs → boot-C6THTSAl.mjs} +312 -50
  7. package/dist/js/chat/tui/chunks/grammars/assets/bash.highlights.scm +56 -0
  8. package/dist/js/chat/tui/chunks/grammars/assets/bash.wasm +0 -0
  9. package/dist/js/chat/tui/chunks/grammars/assets/c.highlights.scm +81 -0
  10. package/dist/js/chat/tui/chunks/grammars/assets/c.wasm +0 -0
  11. package/dist/js/chat/tui/chunks/grammars/assets/cpp.highlights.scm +70 -0
  12. package/dist/js/chat/tui/chunks/grammars/assets/cpp.wasm +0 -0
  13. package/dist/js/chat/tui/chunks/grammars/assets/css.highlights.scm +76 -0
  14. package/dist/js/chat/tui/chunks/grammars/assets/css.wasm +0 -0
  15. package/dist/js/chat/tui/chunks/grammars/assets/go.highlights.scm +123 -0
  16. package/dist/js/chat/tui/chunks/grammars/assets/go.wasm +0 -0
  17. package/dist/js/chat/tui/chunks/grammars/assets/html.highlights.scm +13 -0
  18. package/dist/js/chat/tui/chunks/grammars/assets/html.wasm +0 -0
  19. package/dist/js/chat/tui/chunks/grammars/assets/java.highlights.scm +149 -0
  20. package/dist/js/chat/tui/chunks/grammars/assets/java.wasm +0 -0
  21. package/dist/js/chat/tui/chunks/grammars/assets/json.highlights.scm +16 -0
  22. package/dist/js/chat/tui/chunks/grammars/assets/json.wasm +0 -0
  23. package/dist/js/chat/tui/chunks/grammars/assets/lua.highlights.scm +201 -0
  24. package/dist/js/chat/tui/chunks/grammars/assets/lua.wasm +0 -0
  25. package/dist/js/chat/tui/chunks/grammars/assets/python.highlights.scm +137 -0
  26. package/dist/js/chat/tui/chunks/grammars/assets/python.wasm +0 -0
  27. package/dist/js/chat/tui/chunks/grammars/assets/ruby.highlights.scm +154 -0
  28. package/dist/js/chat/tui/chunks/grammars/assets/ruby.wasm +0 -0
  29. package/dist/js/chat/tui/chunks/grammars/assets/rust.highlights.scm +161 -0
  30. package/dist/js/chat/tui/chunks/grammars/assets/rust.wasm +0 -0
  31. package/dist/js/chat/tui/chunks/grammars/assets/toml.highlights.scm +53 -0
  32. package/dist/js/chat/tui/chunks/grammars/assets/toml.wasm +0 -0
  33. package/dist/js/chat/tui/chunks/grammars/assets/yaml.highlights.scm +79 -0
  34. package/dist/js/chat/tui/chunks/grammars/assets/yaml.wasm +0 -0
  35. package/dist/js/chat/tui/chunks/grammars/grammars.ts +146 -0
  36. package/dist/js/client-BpAnESuq.mjs +6 -0
  37. package/dist/js/{client-Dc7GZ3PG.mjs → client-DiaJZQG6.mjs} +1 -1
  38. package/dist/js/{daemon-Co4CtpXZ.mjs → daemon-BSSZpzto.mjs} +2 -2
  39. package/dist/js/daemon-ybnlDUgi.mjs +7 -0
  40. package/dist/js/{install-CMYBFvR2.mjs → install-DCcGbpsS.mjs} +2 -2
  41. package/dist/js/{print-Cd-bVSEJ.mjs → print-CiaU2ygh.mjs} +84 -2
  42. package/dist/js/{print-share-7qfpQtWK.mjs → print-share-DlO5RSBt.mjs} +1 -1
  43. package/dist/js/{print-CPCFci60.mjs → print-vUf9stcK.mjs} +3 -2
  44. package/dist/js/{raw-pty-BcjbTjHJ.mjs → raw-pty-DAmb8uqt.mjs} +1 -1
  45. package/dist/js/raw-pty-t5DC-e1T.mjs +5 -0
  46. package/dist/js/{rest-BlN_uWmL.mjs → rest-CG7VpQ56.mjs} +13 -2
  47. package/dist/js/rest-DfpoRJ_Q.mjs +5 -0
  48. package/package.json +1 -1
  49. package/dist/js/client-DuwxEDG4.mjs +0 -5
  50. package/dist/js/daemon-Ch_MSDmQ.mjs +0 -6
  51. package/dist/js/raw-pty-ChUHav4d.mjs +0 -5
  52. package/dist/js/rest-CDTXCmUb.mjs +0 -4
  53. /package/dist/js/{client-DfcJFEbh.mjs → client-D8s9vY4p.mjs} +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.0] - 2026-08-07
11
+
12
+ ### Added
13
+
14
+ - `skydive chat` works with API key auth: an API key alone now opens the chat TUI (and headless `chat -p`) without a browser login, using the key's pinned workspace.
15
+ - `skydive config` command to view and set the safe, hand-editable CLI preferences (`shareMachineDefault`, `updateCheck`) without opening `config.json`. `config`/`config list` shows each key, its effective value, and whether it comes from the file or the built-in default; `config get`/`set`/`unset` read and change one key; `config path` prints the config file location. It only ever touches those preference keys, never credentials or flow-managed state.
16
+ - Billing-blocked sends and runs now surface the server-authored recovery
17
+ guidance from the typed billing outcome. The chat TUI renders it as a
18
+ warning-toned system-notice row — live when a send is refused or a run is
19
+ stopped at the billing boundary, and again when reopening a conversation
20
+ that holds a persisted billing notice — instead of a generic error.
21
+ Headless `chat -p` and `messages get` print the guidance (state, recovery
22
+ step, and manage-billing URL) on stderr, keep any partial output already
23
+ streamed on stdout, and exit with code `5` (distinct from the generic `1`)
24
+ so scripted callers can tell a billing pause from a failure.
25
+ - Syntax highlighting for 14 more languages in the chat transcript and file/review panes (python, bash, go, rust, c, cpp, java, ruby, css, html, json, yaml, and more) — previously only JavaScript/TypeScript rendered colored.
26
+
27
+ ### Changed
28
+
29
+ - `skydive agent list` lists the full agent roster by default instead of a truncated page.
30
+
31
+ ### Fixed
32
+
33
+ - Long multi-line bash tool-call commands (e.g. heredocs) are clamped with a `+N more · click to expand` tail instead of dumping their whole body into the scrollback.
34
+ - Tool error output is clipped the same way as ok output, so a failing command no longer floods the transcript.
35
+ - The TUI toast overlay has an opaque background instead of letting the transcript bleed through.
36
+
10
37
  ## [0.3.0] - 2026-08-04
11
38
 
12
39
  ### Added
package/README.md CHANGED
@@ -132,6 +132,9 @@ skydive portal grant --agent <id|name>
132
132
  skydive portal revoke --agent <id|name>
133
133
  skydive portal status
134
134
 
135
+ skydive config # list CLI preferences
136
+ skydive config set updateCheck false
137
+
135
138
  skydive completion install # set up TAB completion for your shell
136
139
  ```
137
140
 
@@ -313,6 +316,18 @@ messageId, text }` instead of streaming the raw text.
313
316
  the full reply whether it's still streaming or already finished. Message ids
314
317
  are the handle this API works in; run ids stay server-side.
315
318
 
319
+ - **Exit codes.** `0` success, `1` any failure, `5` billing-blocked: the
320
+ workspace is paused by billing — either the send was refused before anything
321
+ ran, or the run was stopped at the billing boundary (anything already
322
+ streamed stays on stdout). The guidance and recovery URL print on stderr so
323
+ a scripted caller (an agent driving `-p`) can relay them to a human.
324
+ `messages get` uses the same codes. Treat these values as frozen.
325
+
326
+ With `--json`, a billing block still exits `5` but first emits a structured
327
+ result on stdout: `{ billingBlocked: { code, message }, text, messageId }` —
328
+ `text` is whatever streamed before the block and `messageId` is the handle
329
+ to re-fetch the full reply with `messages get` after billing recovers.
330
+
316
331
  It defaults to the production API (`https://api.skydive.com`). For local
317
332
  dev, point it at your stack:
318
333
 
@@ -433,9 +448,20 @@ Persistent state lives in a per-user JSON file managed by
433
448
  `SKYDIVE_CONFIG_NAME`). Most keys are written by flows — `auth login`, the
434
449
  device-login flow, the in-TUI theme picker — but the file is plain JSON and
435
450
  read fresh on every invocation, so preference keys can be set by editing it
436
- directly. There is deliberately no `skydive config` command.
451
+ directly.
452
+
453
+ The safe, hand-editable preference keys are also managed by `skydive config`,
454
+ which only ever touches those keys — never credentials or flow-managed state:
455
+
456
+ ```sh
457
+ skydive config # list preferences, values, and source
458
+ skydive config get updateCheck # print the effective value of one key
459
+ skydive config set updateCheck false
460
+ skydive config unset updateCheck # revert to the built-in default
461
+ skydive config path # print the config.json location
462
+ ```
437
463
 
438
- Hand-editable keys:
464
+ Editable keys:
439
465
 
440
466
  | Key | Type | Effect |
441
467
  | --------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ import { z } from "zod";
3
+
4
+ //#region src/chat/api/billing-blocked.ts
5
+ const billingBlockedOutcomeSchema = z.object({
6
+ code: z.literal("billing_blocked"),
7
+ message: z.string().min(1)
8
+ });
9
+ const billingBlockedSendResponseSchema = z.object({
10
+ error: z.literal("billing_blocked"),
11
+ outcome: billingBlockedOutcomeSchema
12
+ });
13
+ /**
14
+ * The typed billing outcome out of a failed send response, or null when the
15
+ * failure isn't a billing block. HTTP 402 + the discriminated body above is
16
+ * the whole check; anything else (a non-billing 402, an edge HTML page) is
17
+ * someone else's error and keeps its existing handling.
18
+ */
19
+ function billingBlockedOutcomeFromSendResponse({ status, body }) {
20
+ if (status !== 402) return null;
21
+ let parsed;
22
+ try {
23
+ parsed = JSON.parse(body);
24
+ } catch (_error) {
25
+ return null;
26
+ }
27
+ const response = billingBlockedSendResponseSchema.safeParse(parsed);
28
+ return response.success ? response.data.outcome : null;
29
+ }
30
+ /**
31
+ * A billing block surfaced on the headless path (`chat -p`, `messages get`).
32
+ * Distinct from a plain Error so the command layer can exit with
33
+ * {@link BILLING_BLOCKED_EXIT_CODE}; `message` is the server-authored
34
+ * guidance verbatim (state, recovery step, and manage-billing URL). The
35
+ * context preserves what the run produced before the block so `--json`
36
+ * callers get a structured result instead of losing the buffered output.
37
+ */
38
+ var BillingBlockedError = class extends Error {
39
+ constructor(outcome, context) {
40
+ super(outcome.message);
41
+ this.outcome = outcome;
42
+ this.context = context;
43
+ this.name = "BillingBlockedError";
44
+ }
45
+ };
46
+ /**
47
+ * The `--json` envelope for a billing-blocked headless invocation, emitted on
48
+ * stdout before exiting with {@link BILLING_BLOCKED_EXIT_CODE}. Additive
49
+ * contract: scripted callers get the server guidance, whatever text streamed
50
+ * before the block, and the message id to re-fetch after recovery.
51
+ */
52
+ function billingBlockedJsonResult(error, fallbackMessageId) {
53
+ return {
54
+ billingBlocked: {
55
+ code: error.outcome.code,
56
+ message: error.outcome.message
57
+ },
58
+ text: error.context.partialText ?? "",
59
+ messageId: error.context.messageId ?? fallbackMessageId
60
+ };
61
+ }
62
+ /**
63
+ * Headless exit code for a billing-blocked send or run — distinct from the
64
+ * generic `1` so scripted callers (Claude Code / Codex driving `chat -p`) can
65
+ * tell "the workspace is paused by billing, relay the recovery URL" from an
66
+ * ordinary failure. Documented in the CLI README; treat as frozen.
67
+ */
68
+ const BILLING_BLOCKED_EXIT_CODE = 5;
69
+
70
+ //#endregion
71
+ export { billingBlockedOutcomeSchema as a, billingBlockedOutcomeFromSendResponse as i, BillingBlockedError as n, billingBlockedJsonResult as r, BILLING_BLOCKED_EXIT_CODE as t };
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { a as billingBlockedOutcomeSchema, i as billingBlockedOutcomeFromSendResponse, n as BillingBlockedError, r as billingBlockedJsonResult, t as BILLING_BLOCKED_EXIT_CODE } from "./billing-blocked-CwfG1BTR.mjs";
3
+
4
+ export { BILLING_BLOCKED_EXIT_CODE, BillingBlockedError, billingBlockedJsonResult };