@genspark/cli 1.8.1 → 1.9.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 +39 -0
- package/dist/client.js +3 -3
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +4 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +28 -3
- package/dist/config.js.map +1 -1
- package/dist/confirm.d.ts +121 -0
- package/dist/confirm.d.ts.map +1 -0
- package/dist/confirm.js +207 -0
- package/dist/confirm.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -8
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/confirmation.md +49 -0
- package/package.json +1 -1
- package/skills/gsk-shared/SKILL.md +2 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Client-side confirmation (`--yes`, `[y/N]`)
|
|
2
|
+
|
|
3
|
+
Some tool actions have external side effects (gmail/outlook send, slack
|
|
4
|
+
send, tweet post, calendar invites, ...). When the server supports the
|
|
5
|
+
interactive-confirm contract, the CLI confirms these **locally, before the
|
|
6
|
+
single server call** — there is no pending state on the server and no
|
|
7
|
+
second call.
|
|
8
|
+
|
|
9
|
+
## How it works
|
|
10
|
+
|
|
11
|
+
1. `GET /api/tool_cli/tools` annotates confirmation-required tools/actions
|
|
12
|
+
(`requires_confirmation`, plus `interactive_only` for the schema-locked
|
|
13
|
+
actions: `slack send`/`react`/`upload`/`invite` and
|
|
14
|
+
`google_drive share`) and, when both the CLI capability
|
|
15
|
+
(`cli-confirm-v1`) and the server-side gate agree, advertises
|
|
16
|
+
`"features": {"interactive_confirm": true}`. Both are cached with the
|
|
17
|
+
tool schemas (24h TTL).
|
|
18
|
+
2. Before executing an annotated action, the CLI prints a preview of the
|
|
19
|
+
arguments you typed (attachments listed by name only) and asks
|
|
20
|
+
`About to execute <tool> <action>. Proceed? [y/N]` on **stderr**,
|
|
21
|
+
reading one line from **stdin** — so `echo y | gsk ...` works and EOF
|
|
22
|
+
declines.
|
|
23
|
+
3. On `y`/`yes` (or `--yes`), the request carries `cli_confirmed: true` and
|
|
24
|
+
the server executes directly. On anything else the CLI prints
|
|
25
|
+
`Aborted, nothing was sent.` and exits 1 with **zero server calls**.
|
|
26
|
+
|
|
27
|
+
## Flags and exit codes
|
|
28
|
+
|
|
29
|
+
| Situation | Behavior | Exit code |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| Prompt answered `y`/`yes` | one server call, executes | tool result |
|
|
32
|
+
| Prompt declined / EOF | no server call | 1 |
|
|
33
|
+
| `--yes` (or `-y`) on a normal action | no prompt, executes | tool result |
|
|
34
|
+
| explicit `--skip_confirmation true` / `auto_skip_confirmation` on a normal action | no prompt, no `cli_confirmed` — the server honors the skip param as before (existing unattended scripts keep working) | tool result |
|
|
35
|
+
| `--yes` or a skip param on an interactive-only action | warning + prompt anyway (locked skip params are server-stripped) | per answer |
|
|
36
|
+
| `--no-input` without `--yes` | error, no server call | 2 |
|
|
37
|
+
| `--args-file -` (stdin consumed) without `--yes` | error suggesting `--yes`, no server call | 2 |
|
|
38
|
+
|
|
39
|
+
## Compatibility
|
|
40
|
+
|
|
41
|
+
- Old server / feature disabled: the `features` bit is absent from the
|
|
42
|
+
cache, the CLI never prompts, and the server's own confirmation flow
|
|
43
|
+
(web confirmation card, pending envelope) applies unchanged.
|
|
44
|
+
- `--acp` mode: stdin is the JSON-RPC channel, so the ACP bridge keeps the
|
|
45
|
+
old contract (interactive confirmation over ACP is a separate track).
|
|
46
|
+
- Stale schema cache: if the server still answers
|
|
47
|
+
`data.status == "pending_confirmation"`, the CLI prints
|
|
48
|
+
`schema cache stale, run 'gsk --refresh ls' and retry` and exits 1.
|
|
49
|
+
The CLI never replays a call.
|
package/package.json
CHANGED
|
@@ -138,6 +138,8 @@ gsk download "/api/files/s/abc123" -s ./downloaded.png
|
|
|
138
138
|
|------|-------------|
|
|
139
139
|
| `-s, --save <path>` | Download and save to local file path |
|
|
140
140
|
|
|
141
|
+
Without `--save` the response carries `download_url`, a 24-hour signed URL you can hand to `curl` or an external service. With `--save` the response lists only the saved file — `file_name`, `content_type`, `local_path`, `size_bytes` — and no `download_url`/`original_url`.
|
|
142
|
+
|
|
141
143
|
### init-opencode
|
|
142
144
|
|
|
143
145
|
Generate an `.opencode.json` config file for [OpenCode](https://opencode.ai), pre-configured to use Genspark's LLM proxy.
|