@solgridai/cli 0.1.1 → 0.2.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solgridai/cli",
3
- "version": "0.1.1",
3
+ "version": "0.2.0-beta.1",
4
4
  "description": "Command-line client for Solgrid: discover, inspect and run tools from your terminal or agent.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -77,7 +77,13 @@ Read before every first use of a tool:
77
77
 
78
78
  - `input`: JSON Schemas for `body`, `queryParams` and `pathParams`. Build the
79
79
  input from these. Never guess field names, required fields or allowed values.
80
- - `price`: what a run costs. Amounts are decimal strings in USD.
80
+ - `price`: what a run costs. Amounts are decimal strings in USD. Many tools
81
+ list `price.rates`, one rate per meter (what is counted: calls, output
82
+ images, seconds of video, tokens, …) at `unitPriceUsd` per `unitSize` units.
83
+ Different meters add up; within a meter, the rate whose `conditions` match
84
+ the request applies. These are unit prices, not the cost of a whole run:
85
+ the final charge is the run's `cost`. `price` is null when a tool has no
86
+ price yet.
81
87
  - `notes`: tool-specific caveats.
82
88
 
83
89
  ## 3. Run
@@ -96,7 +102,10 @@ solgrid run -p <provider> -e <endpoint> -i '{"screen_name":"nasa"}' --wait --jso
96
102
 
97
103
  - Without `--wait`, `run` returns as soon as the run is accepted. Some tools
98
104
  finish immediately and the result is already included; others keep running.
99
- - `--wait [seconds]` waits for the run to finish (default 300s).
105
+ - `--wait [seconds]` waits for the run to finish (default 300s). The time
106
+ covers submitting too: some tools (image models, for example) answer only
107
+ when the result is ready, which can take a minute or more. Give such runs a
108
+ generous wait, e.g. `--wait 600`.
100
109
  - `-o <file>` saves the result to a file (and implies `--wait`). Prefer it
101
110
  for large results instead of printing them into the conversation.
102
111
  - To check on a run later: `solgrid runs get -r <runId> --wait --json`.
@@ -163,9 +172,18 @@ with the same key, or look the run up first.
163
172
  | `error.key` | Meaning |
164
173
  |---|---|
165
174
  | `wallet_balance_insufficient` | Balance too low; the user can top up on the console's Wallet page |
166
- | `daily_budget_exceeded` | Daily budget reached; adjustable on the console's Budgets page |
175
+ | `daily_budget_exceeded` | Daily budget reached; adjustable on the console's Budgets page (but see below) |
167
176
  | `per_call_limit_exceeded` | The run costs more than the per-call limit; adjustable on the console's Budgets page |
168
177
 
178
+ - The daily budget counts today's spending plus what runs still in progress
179
+ hold. If `daily_budget_exceeded` comes with
180
+ `error.detail.reason: "reservation_exceeds_remaining_budget"`, those holds
181
+ are the cause: wait for the user's runs in progress to finish, then retry
182
+ with the **same** idempotency key (a refused run was never started), or
183
+ submit runs one at a time. `error.detail` also has `spent`, `held`,
184
+ `requestedReservation`, `dailyLimit` and `remaining`.
185
+ - The budget is checked when a run starts; a run's final cost can exceed what
186
+ it held, so a day's spending can end slightly over the budget.
169
187
  - Never top up the wallet or change budgets on the user's behalf.
170
188
 
171
189
  ## Using local files as input
@@ -191,6 +209,63 @@ solgrid files upload ./cat.png --json
191
209
  - `solgrid files get -i <fileAssetId> --json` shows a file's type, size and
192
210
  status; `solgrid files download -i <fileAssetId> -o <path>` saves it locally.
193
211
 
212
+ ## Publishing Skills on SkillHub
213
+
214
+ Use these only when the user asks to publish, change or remove *their* Skill on
215
+ SkillHub; finding and downloading Skills is always fine.
216
+
217
+ ```bash
218
+ solgrid skills list -q "<words>" --json # search titles and tags
219
+ solgrid skills get -s <slug> --json # details
220
+ solgrid skills download -s <slug> -o <path> # the Skill package (.zip)
221
+ ```
222
+
223
+ A downloaded Skill is someone else's code and instructions. It may include
224
+ scripts (for example in a `scripts/` directory); SkillHub does not review them.
225
+ Before using a downloaded Skill, read its `SKILL.md` and any scripts, tell the
226
+ user what it would run, and run nothing from it without the user's explicit
227
+ go-ahead.
228
+
229
+ To publish, the user needs a Skill directory with `SKILL.md` at its top,
230
+ starting with frontmatter whose `name` becomes the Skill's slug:
231
+
232
+ ```markdown
233
+ ---
234
+ name: mecha-portrait
235
+ description: What the Skill does and when to use it (up to 1024 characters).
236
+ ---
237
+ The instructions…
238
+ ```
239
+
240
+ `name` is 1–64 lowercase letters, digits or hyphens (no hyphen at either end,
241
+ no `--`). The CLI checks and packs the directory (or takes an already packed
242
+ `--zip`, which then needs `-s <slug>` equal to that name):
243
+
244
+ ```bash
245
+ solgrid skills tags --json # tag IDs for --tag (up to 3)
246
+ solgrid skills create -t "<title>" --kind <image|video|web|audio> \
247
+ -d "<one-line description>" --dir <skill-directory> --cover <image> \
248
+ --tag <tag-id> --yes --json
249
+ ```
250
+
251
+ - A Skill is **public as soon as it is created**, and its slug can never be
252
+ changed. Confirm the title, slug (the `name` in `SKILL.md`) and files with
253
+ the user before passing `--yes`.
254
+ - `--kind` is what the Skill produces. Every kind except `video` needs
255
+ `--cover`; `video` and `audio` need `--preview`.
256
+ - `-d` is a short plain-text line shown under the title; the Skill's real
257
+ instructions belong in `SKILL.md`.
258
+ - If the CLI refuses the directory, it says which rule it breaks (for example
259
+ no `SKILL.md` at the top, no frontmatter, or more than 200 files). Tell the
260
+ user; do not delete or move their files, or rewrite their `SKILL.md`,
261
+ without their go-ahead.
262
+ - `solgrid skills update -s <slug> [options] --json` changes only the options
263
+ given (`--tag` replaces all tags; `--clear-tags` removes them;
264
+ `--clear-preview` removes an image or web Skill's preview). Only the user's
265
+ own Skills can be changed.
266
+ - `solgrid skills delete -s <slug> --yes --json` removes one of the user's
267
+ Skills from SkillHub. Ask the user first.
268
+
194
269
  ## Output and errors
195
270
 
196
271
  - Success: exit code `0`, and the result as JSON on stdout.