@cloudglue/tinycloud 0.3.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/LICENSE.md +1 -0
- package/README.md +104 -0
- package/THIRD_PARTY_NOTICES.md +41 -0
- package/bin/tinycloud.js +135 -0
- package/lib/download.js +71 -0
- package/lib/installer.js +300 -0
- package/lib/manifest.js +181 -0
- package/lib/platform.js +22 -0
- package/lib/run.js +43 -0
- package/lib/skills.js +126 -0
- package/package.json +28 -0
- package/skills/ad-analysis/SKILL.md +65 -0
- package/skills/blog-post/SKILL.md +65 -0
- package/skills/meeting-breakdown/SKILL.md +65 -0
- package/skills/sales-coaching/SKILL.md +66 -0
- package/skills/tinycloud/SKILL.md +157 -0
- package/skills/tinycloud/reference/envelope.md +73 -0
- package/skills/tinycloud/reference/glossary.md +73 -0
- package/skills/tinycloud/reference/pipelines.md +104 -0
- package/skills/tinycloud/reference/setup.md +97 -0
- package/skills/tinycloud/reference/verbs.md +180 -0
- package/skills/tinycloud/reference/workflow-authoring.md +145 -0
- package/skills/tinycloud/scripts/preflight.sh +77 -0
- package/skills/tinycloud/tinycloud-skill.json +26 -0
- package/skills/tinycloud-init/SKILL.md +89 -0
- package/skills/tinycloud-skill-creator/SKILL.md +129 -0
- package/skills/youtube-publish/SKILL.md +66 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Verbs: commands, flags, and cost classes
|
|
2
|
+
|
|
3
|
+
`tinycloud commands --json` is the machine-readable source of truth — name,
|
|
4
|
+
aliases, summary, cost class, auth requirement, flags, and subcommands for
|
|
5
|
+
every verb. Regenerate doubts from it instead of trusting prose.
|
|
6
|
+
|
|
7
|
+
| Verb | Cost | Auth | Use |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| `watch` | cloud | yes | Analyze a video → reusable context + Cloudglue-ready ref |
|
|
10
|
+
| `extract` | cloud | yes | Pull structured facts, entities, or moments |
|
|
11
|
+
| `caption` | varies | no | Subtitles and transcripts (SRT/VTT/ASS) |
|
|
12
|
+
| `search` | local | no | Local keyword search over cached context |
|
|
13
|
+
| `probe` | cloud | yes | Semantic moment/video search over a Cloudglue-ready scope |
|
|
14
|
+
| `ask` | cloud | yes | Grounded Q&A over one or more videos |
|
|
15
|
+
| `clip` | local | no | Cuts, thumbs, audio, stitch, split, transcode, burn, explore |
|
|
16
|
+
| `grab` | network | no | Download a remote video (YouTube, TikTok, Loom, direct) |
|
|
17
|
+
| `library` | varies | no | Collections, connectors, local mirrors, sync |
|
|
18
|
+
| `jobs` | network | yes | Poll/wait/forget tracked async jobs |
|
|
19
|
+
| `workflow` | varies | no | Validate/plan/run workflow recipes |
|
|
20
|
+
| `publish` | cloud | yes | Publish HTML/code artifacts as Cloudglue Sites |
|
|
21
|
+
| `setup` | local | no | Credentials and service connections |
|
|
22
|
+
|
|
23
|
+
Cloud verbs run through the configured Cloudglue API key.
|
|
24
|
+
`caption`/`library`/`workflow` vary by what they end up doing.
|
|
25
|
+
|
|
26
|
+
## Per-verb flags
|
|
27
|
+
|
|
28
|
+
Flags shared by most verbs are listed once at the bottom.
|
|
29
|
+
|
|
30
|
+
### watch — analyze a video
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
tinycloud watch <source> [--segment uniform:20|chapters|shots|segments]
|
|
34
|
+
[--profile default|light|custom] [--speech-only | --visual-only]
|
|
35
|
+
[--start <t>] [--end <t>] [--transcript] [--content] [--json-index]
|
|
36
|
+
[--background]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### extract — structured facts
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
tinycloud extract "<query>" <source> --json # free-form query
|
|
43
|
+
tinycloud extract --schema ./schema.json <source> # JSON-schema-shaped output
|
|
44
|
+
[--segment-level] [--segmentation chapters|shots|segments]
|
|
45
|
+
[--include-thumbnails] [--transcript-mode] [--background]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### caption — subtitles and transcripts
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
tinycloud caption <source> [--format srt|vtt|ass] [--transcript]
|
|
52
|
+
[--diarize] [--word-level] [-o <file-or-dir>]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### search — local keyword search (free)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
tinycloud search "<keyword>" [--in <paths|source-ids|collection-ids|all>]
|
|
59
|
+
[--field speech|visual|text|entities] [--limit 50]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### probe — semantic search (cloud)
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
tinycloud probe "<query>" --in collection:col_… [--scope file|segment] [--limit 20]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### ask — grounded Q&A (cloud)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
tinycloud ask "<question>" --in <source|collection:col_…|all>
|
|
72
|
+
[--include-citations[=false]]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Never pass `--background` to `ask`.
|
|
76
|
+
|
|
77
|
+
### clip — local derivatives (free, ffmpeg-backed)
|
|
78
|
+
|
|
79
|
+
Subcommands: `cut thumbs stitch transcode burn extract-audio split info explore`
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
tinycloud clip info <source> --json
|
|
83
|
+
tinycloud clip cut <source> --start 12 --end 28 -o out.mp4
|
|
84
|
+
tinycloud clip thumbs <source> --interval 5 -o thumbs/
|
|
85
|
+
tinycloud clip stitch <a> <b> … -o out.mp4 [--reencode]
|
|
86
|
+
tinycloud clip transcode <source> --resolution 1920x1080 [--fps 30] [--preset fast] -o out.mp4
|
|
87
|
+
tinycloud clip burn <source> --subtitle-file subs.srt [--subtitle-style <ass-style>] -o out.mp4
|
|
88
|
+
tinycloud clip extract-audio <source> --audio-format mp3 -o out.mp3
|
|
89
|
+
tinycloud clip split <source> --target-size-mb 50 [--min-chunk-seconds 30] -o chunks/
|
|
90
|
+
tinycloud clip explore <source> --title "Explorer" -o explorer.html
|
|
91
|
+
tinycloud clip cut --from-findings -o clips/ # cut timestamped findings piped from extract
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### grab — download remote video
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
tinycloud grab <url> [-o <file-or-dir>] [--audio-only] [--format <yt-dlp-selector>]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### library — collections and connectors
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
tinycloud library collections list --json
|
|
104
|
+
tinycloud library collections show <col_id> --json
|
|
105
|
+
tinycloud library collections sync <col_id> --artifacts descriptions,transcripts,thumbnails,metadata --json
|
|
106
|
+
tinycloud library connectors list --json
|
|
107
|
+
tinycloud library connectors files <connector-id> [--limit 25] [--page-token <t>] --json
|
|
108
|
+
tinycloud library connectors sync <connector-id> <uri> --json # e.g. grain://recording/<id>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`connectors files` also takes provider-specific filters: `--from`/`--to`
|
|
112
|
+
(Zoom, Grain dates), `--folder-id` (Google Drive), `--path` (Dropbox),
|
|
113
|
+
`--bucket`/`--prefix` (S3/GCS), `--title-search`/`--team`/`--meeting-type`
|
|
114
|
+
(Grain). Collection IDs (`col_…`) are stable; collection names are
|
|
115
|
+
display-only.
|
|
116
|
+
|
|
117
|
+
### jobs — async work
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
tinycloud jobs list [--status pending|running|completed|failed] [--limit N] --json
|
|
121
|
+
tinycloud jobs poll <job-id> --json
|
|
122
|
+
tinycloud jobs wait <job-id> --timeout 120s --json
|
|
123
|
+
tinycloud jobs forget <job-id> --json
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### workflow — packaged recipes
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
tinycloud workflow list --json
|
|
130
|
+
tinycloud workflow validate <name-or-path.yaml> --json
|
|
131
|
+
tinycloud workflow plan <name-or-path.yaml> <source> --json # free, no side effects
|
|
132
|
+
tinycloud workflow <name> <source> [--param k=v] [--segment <s>] [--out <dir>]
|
|
133
|
+
[--allow-command | --no-command] [--max-parallel N] [--yes] --json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`workflow status` and `workflow resume` are NOT implemented in 0.3.x.
|
|
137
|
+
|
|
138
|
+
### publish — Cloudglue Sites
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
tinycloud publish <html-file-or-dir> [--name <site-name>]
|
|
142
|
+
[--visibility public|private] --json
|
|
143
|
+
tinycloud publish list --json # sites for this account, with URLs
|
|
144
|
+
tinycloud publish unpublish <site-ref> --json # site_id, site name, or the --name label
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
`public` = anyone with the link; `private` = Cloudglue account members only
|
|
148
|
+
(same URL, edge-gated). Default keeps the site's current visibility.
|
|
149
|
+
Republishing identical content makes no network calls; flipping visibility
|
|
150
|
+
patches without re-uploading. `list`/`unpublish` are gated by the
|
|
151
|
+
`publish.manage.v1` feature id.
|
|
152
|
+
|
|
153
|
+
Note: `--name` is a label for the artifact (republishing reuses it) — the
|
|
154
|
+
site itself gets a generated name (e.g. `young-fire-2486`) shown by
|
|
155
|
+
`publish list`. `unpublish` resolves any of: the `site_id` UUID, the
|
|
156
|
+
generated site name, or your `--name` label.
|
|
157
|
+
|
|
158
|
+
### setup — credentials
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
tinycloud setup --check --json # probe configured services (exit 0 always)
|
|
162
|
+
tinycloud setup --list --json # known services
|
|
163
|
+
tinycloud setup cloudglue --api-key <key> # or --stdin
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Shared flags
|
|
167
|
+
|
|
168
|
+
Output: `--json` (force JSONL envelopes), `--pretty` (one JSON array),
|
|
169
|
+
`--text`, `--format json|text|tsv`,
|
|
170
|
+
`--view envelopes|segments|findings|citations|outputs|matches`,
|
|
171
|
+
`--data raw`, `--raw-output` (raw backend payload; disables pipe protocol),
|
|
172
|
+
`--quiet`, `--verbose`.
|
|
173
|
+
|
|
174
|
+
Cache/spend — on `watch`, `extract`, `caption`, and `workflow` only:
|
|
175
|
+
`--refresh` (recompute), `--no-cache` (no persistence), `--cached` (reuse
|
|
176
|
+
exact-match history), `--no-upload` (refuse cloud upload → `needs_upload`),
|
|
177
|
+
`--no-download` (refuse local materialization → `needs_download`).
|
|
178
|
+
`ask`/`probe` always call the cloud; use `search` for a free cached lookup.
|
|
179
|
+
|
|
180
|
+
Source reuse (`watch`/`extract`/`caption`): `--source-id <id>`, `--result-id <id>`.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Authoring workflow recipes
|
|
2
|
+
|
|
3
|
+
Workflows are YAML/JSON DAGs over the same operation verbs as the direct CLI.
|
|
4
|
+
Use one when the task is a repeatable recipe with stable inputs and declared
|
|
5
|
+
outputs. Workflow schema version: `"1"`.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
tinycloud workflow validate ./my-skill.yaml --json # check before shipping
|
|
9
|
+
tinycloud workflow plan ./my-skill.yaml demo.mp4 --json # resolve graph, no side effects, free
|
|
10
|
+
tinycloud workflow run ./my-skill.yaml demo.mp4 --allow-command --json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Recipe shape
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
name: video-report
|
|
17
|
+
version: 1
|
|
18
|
+
description: Analyze a video and render an HTML report.
|
|
19
|
+
permissions: [command] # only if the recipe has command steps
|
|
20
|
+
|
|
21
|
+
inputs:
|
|
22
|
+
source: { type: source, required: true }
|
|
23
|
+
out: { type: path, default: "${{ run.dir }}/video-report.html" }
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- id: context
|
|
27
|
+
run: watch
|
|
28
|
+
with:
|
|
29
|
+
source: "${{ inputs.source }}"
|
|
30
|
+
|
|
31
|
+
- id: fields
|
|
32
|
+
run: extract
|
|
33
|
+
from: context # pipe the prior envelope in
|
|
34
|
+
needs: [context] # ordering
|
|
35
|
+
with:
|
|
36
|
+
query: "Key topics, important moments, and takeaways."
|
|
37
|
+
|
|
38
|
+
- id: render
|
|
39
|
+
run: command
|
|
40
|
+
needs: [context, fields]
|
|
41
|
+
with:
|
|
42
|
+
command: node
|
|
43
|
+
args:
|
|
44
|
+
- ./scripts/render.js
|
|
45
|
+
- --describe-file
|
|
46
|
+
- "${{ steps.context.file }}"
|
|
47
|
+
- --extract-file
|
|
48
|
+
- "${{ steps.fields.file }}"
|
|
49
|
+
- --out
|
|
50
|
+
- "${{ inputs.out }}"
|
|
51
|
+
output: { type: file, as: html, path: "${{ inputs.out }}" }
|
|
52
|
+
|
|
53
|
+
outputs:
|
|
54
|
+
html: "${{ steps.render.path }}"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Bind inputs from the CLI positionally for `source`, or `--param k=v` for
|
|
58
|
+
named values.
|
|
59
|
+
|
|
60
|
+
## Step nodes
|
|
61
|
+
|
|
62
|
+
| Node | `run` | Purpose |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| Operation | any dispatchable verb (`watch extract caption search probe ask clip grab library jobs workflow publish setup`) | Same handler as `tinycloud <verb>` |
|
|
65
|
+
| Command | `command` | Custom local code; cwd is the recipe directory |
|
|
66
|
+
|
|
67
|
+
Operation steps take CLI flags under `with` (long names, no dashes). Known
|
|
68
|
+
positional names (`query question source url input artifact action group
|
|
69
|
+
subcommand collection connector job id`) become positionals. For subcommands
|
|
70
|
+
where order matters, use an explicit `args` array:
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
- id: thumbs
|
|
74
|
+
run: clip
|
|
75
|
+
needs: [context]
|
|
76
|
+
with:
|
|
77
|
+
args: [thumbs, "${{ inputs.source }}"]
|
|
78
|
+
interval: 5
|
|
79
|
+
out: "${{ run.dir }}/thumbs"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Booleans become `--flag` when true; arrays repeat the flag. Relative `schema`
|
|
83
|
+
and command paths resolve against the recipe directory, so a skill can bundle
|
|
84
|
+
SKILL.md, YAML, scripts, schemas, and templates together.
|
|
85
|
+
|
|
86
|
+
## Step fields
|
|
87
|
+
|
|
88
|
+
| Field | Purpose |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `id` | Unique step id |
|
|
91
|
+
| `run` | Operation verb or `command` |
|
|
92
|
+
| `needs` | Earlier step ids that must have run (ordering) |
|
|
93
|
+
| `from` | Pipe a prior step envelope into this operation |
|
|
94
|
+
| `foreach` | Run once per item of an input/prior value (`${{ inputs.item }}`) |
|
|
95
|
+
| `with` | Arguments and flags |
|
|
96
|
+
| `output` | Declare a produced file: `{ type: file\|files\|json\|text\|refs, as: html\|code\|data\|image\|file, path: … }` |
|
|
97
|
+
|
|
98
|
+
## Interpolation
|
|
99
|
+
|
|
100
|
+
| Reference | Meaning |
|
|
101
|
+
|---|---|
|
|
102
|
+
| `${{ inputs.source }}` | Top-level input |
|
|
103
|
+
| `${{ inputs.item }}` | Current `foreach` item |
|
|
104
|
+
| `${{ run.id }}` / `${{ run.dir }}` | Run id / run directory |
|
|
105
|
+
| `${{ steps.<id>.file }}` | Materialized JSON output path of a verb step (alias `path`) |
|
|
106
|
+
| `${{ steps.<id>.result_id }}` / `source_id` / `status` / `ref` / `data` | Prior step envelope fields |
|
|
107
|
+
| `${{ steps.<id>.describe_raw }}` | Raw describe JSON path for a `watch` step |
|
|
108
|
+
|
|
109
|
+
A value that is exactly one expression keeps its type; embedded expressions
|
|
110
|
+
stringify.
|
|
111
|
+
|
|
112
|
+
## Command gating
|
|
113
|
+
|
|
114
|
+
- `permissions: [command]` in the recipe allows command steps for trusted
|
|
115
|
+
skills.
|
|
116
|
+
- `--allow-command` allows them for an ad hoc run.
|
|
117
|
+
- `--no-command` always disables command execution.
|
|
118
|
+
|
|
119
|
+
## Outputs and run semantics
|
|
120
|
+
|
|
121
|
+
Top-level `outputs` declares machine-readable final values; per-step `output`
|
|
122
|
+
declares produced files. The final workflow envelope carries `data.steps`,
|
|
123
|
+
`data.artifacts[].path`, and `data.outputs` — report `data.outputs.<name>` to
|
|
124
|
+
the user. Run files live under `./tinycloud-output/runs/<run_id>/` (the
|
|
125
|
+
`--out` flag moves the output base).
|
|
126
|
+
|
|
127
|
+
`--background` is not inherited by steps; a step that returns `pending` or
|
|
128
|
+
`paused` finalizes the workflow as `partial`. `workflow status` / `resume`
|
|
129
|
+
are not implemented in 0.3.x — treat `partial`/`paused` as terminal.
|
|
130
|
+
|
|
131
|
+
## Installing a custom recipe as a tinycloud-agent skill
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
~/.tinycloud/skills/my-skill/ (or .tinycloud/skills/my-skill/ project-local)
|
|
135
|
+
SKILL.md
|
|
136
|
+
my-skill.yaml
|
|
137
|
+
scripts/render.js
|
|
138
|
+
package.json ({"type": "module"})
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The tinycloud agent picks it up on next start; from any shell it runs by
|
|
142
|
+
path: `tinycloud workflow run ~/.tinycloud/skills/my-skill/my-skill.yaml demo.mp4 --allow-command --json`.
|
|
143
|
+
|
|
144
|
+
To wrap a recipe as a skill for *this* host agent instead, see the
|
|
145
|
+
`tinycloud-skill-creator` skill in this repo.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Tinycloud skill preflight. Prints exactly ONE actionable line and exits:
|
|
3
|
+
# 0 ok — tinycloud is installed, compatible, and configured
|
|
4
|
+
# 10 tinycloud binary missing (or broken)
|
|
5
|
+
# 11 installed version outside the supported range (too old or too new)
|
|
6
|
+
# 12 installed version lacks required feature ids
|
|
7
|
+
# 13 installed and compatible but Cloudglue credentials are missing
|
|
8
|
+
set -u
|
|
9
|
+
|
|
10
|
+
# Mirror tinycloud-skill.json: min_version / supported_range upper bound
|
|
11
|
+
# (CI diffs these against the manifest).
|
|
12
|
+
MIN_VERSION="0.3.0"
|
|
13
|
+
MAX_VERSION_EXCLUSIVE="0.4.0"
|
|
14
|
+
INSTALL_CMD='curl -fsSL https://app.cloudglue.dev/tinycloud.sh | bash'
|
|
15
|
+
# Kept in sync with ../tinycloud-skill.json required_features (CI diffs them).
|
|
16
|
+
REQUIRED_FEATURES="envelope.v1 watch.v1 extract.v1 caption.v1 search.v1 probe.v1 ask.v1 clip.v1 grab.v1 jobs.v1 library.collections.v1 workflow.v1 publish.v1 publish.manage.v1 setup.v1"
|
|
17
|
+
|
|
18
|
+
# 1) Binary present and responsive?
|
|
19
|
+
if ! command -v tinycloud >/dev/null 2>&1; then
|
|
20
|
+
echo "preflight: tinycloud not installed — run: ${INSTALL_CMD}"
|
|
21
|
+
exit 10
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# </dev/null matters: pre-0.3.0 binaries open an interactive TUI on this
|
|
25
|
+
# invocation and would otherwise hang waiting for input.
|
|
26
|
+
VERSION_JSON="$(tinycloud --version --json </dev/null 2>/dev/null)" || VERSION_JSON=""
|
|
27
|
+
if [ -z "$VERSION_JSON" ]; then
|
|
28
|
+
echo "preflight: tinycloud found but 'tinycloud --version --json' failed — reinstall: ${INSTALL_CMD}"
|
|
29
|
+
exit 10
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# 2) Version >= minimum?
|
|
33
|
+
VERSION="$(printf '%s' "$VERSION_JSON" | sed -n 's/.*"version":[[:space:]]*"\([^"]*\)".*/\1/p')"
|
|
34
|
+
if [ -z "$VERSION" ]; then
|
|
35
|
+
echo "preflight: tinycloud did not report machine-readable version info (older than ${MIN_VERSION}?) — upgrade: ${INSTALL_CMD}"
|
|
36
|
+
exit 11
|
|
37
|
+
fi
|
|
38
|
+
LOWEST="$(printf '%s\n%s\n' "$VERSION" "$MIN_VERSION" | sort -t. -k1,1n -k2,2n -k3,3n | head -n1)"
|
|
39
|
+
if [ "$LOWEST" != "$MIN_VERSION" ]; then
|
|
40
|
+
echo "preflight: tinycloud ${VERSION} is below required ${MIN_VERSION} — upgrade: ${INSTALL_CMD}"
|
|
41
|
+
exit 11
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# Upper bound of the skill's supported_range: version must be < MAX_VERSION_EXCLUSIVE
|
|
45
|
+
LOWEST_MAX="$(printf '%s\n%s\n' "$VERSION" "$MAX_VERSION_EXCLUSIVE" | sort -t. -k1,1n -k2,2n -k3,3n | head -n1)"
|
|
46
|
+
if [ "$VERSION" = "$MAX_VERSION_EXCLUSIVE" ] || [ "$LOWEST_MAX" != "$VERSION" ]; then
|
|
47
|
+
echo "preflight: tinycloud ${VERSION} is newer than this skill supports (< ${MAX_VERSION_EXCLUSIVE}) — update the skill: npx @cloudglue/tinycloud skills install --force"
|
|
48
|
+
exit 11
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# 3) Required feature ids present? (feature ids are quoted JSON strings, so
|
|
52
|
+
# substring matching against the raw JSON is safe)
|
|
53
|
+
MISSING=""
|
|
54
|
+
for f in $REQUIRED_FEATURES; do
|
|
55
|
+
case "$VERSION_JSON" in
|
|
56
|
+
*"\"$f\""*) : ;;
|
|
57
|
+
*) MISSING="${MISSING}${MISSING:+,}$f" ;;
|
|
58
|
+
esac
|
|
59
|
+
done
|
|
60
|
+
if [ -n "$MISSING" ]; then
|
|
61
|
+
echo "preflight: tinycloud ${VERSION} lacks required features [${MISSING}] — upgrade: ${INSTALL_CMD}"
|
|
62
|
+
exit 12
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# 4) Credentials? setup --check --json reports data.ok (no-space JSON output;
|
|
66
|
+
# keep the spaced variant as belt-and-braces)
|
|
67
|
+
CHECK_JSON="$(tinycloud setup --check --json </dev/null 2>/dev/null)" || CHECK_JSON=""
|
|
68
|
+
case "$CHECK_JSON" in
|
|
69
|
+
*'"ok":true'*|*'"ok": true'*)
|
|
70
|
+
echo "preflight: ok — tinycloud ${VERSION} ready (all features + credentials present)"
|
|
71
|
+
exit 0
|
|
72
|
+
;;
|
|
73
|
+
*)
|
|
74
|
+
echo "preflight: tinycloud ${VERSION} installed but Cloudglue credentials missing — run: tinycloud setup cloudglue --api-key <key> (or export CLOUDGLUE_API_KEY=...)"
|
|
75
|
+
exit 13
|
|
76
|
+
;;
|
|
77
|
+
esac
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_version": "0.1.0",
|
|
3
|
+
"tinycloud": {
|
|
4
|
+
"min_version": "0.3.0",
|
|
5
|
+
"supported_range": ">=0.3.0 <0.4.0",
|
|
6
|
+
"required_features": [
|
|
7
|
+
"envelope.v1",
|
|
8
|
+
"watch.v1",
|
|
9
|
+
"extract.v1",
|
|
10
|
+
"caption.v1",
|
|
11
|
+
"search.v1",
|
|
12
|
+
"probe.v1",
|
|
13
|
+
"ask.v1",
|
|
14
|
+
"clip.v1",
|
|
15
|
+
"grab.v1",
|
|
16
|
+
"jobs.v1",
|
|
17
|
+
"library.collections.v1",
|
|
18
|
+
"workflow.v1",
|
|
19
|
+
"publish.v1",
|
|
20
|
+
"publish.manage.v1",
|
|
21
|
+
"setup.v1"
|
|
22
|
+
],
|
|
23
|
+
"envelope_schema": "1",
|
|
24
|
+
"workflow_schema": "1"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tinycloud-init
|
|
3
|
+
description: >-
|
|
4
|
+
Set up tinycloud from scratch: install the CLI, configure the Cloudglue API
|
|
5
|
+
key, verify everything works, and run a first command. Use when the user
|
|
6
|
+
wants to get started with tinycloud, set up / initialize / onboard
|
|
7
|
+
tinycloud, or when another tinycloud skill reports the CLI or credentials
|
|
8
|
+
are missing.
|
|
9
|
+
argument-hint: "[optional: a video file to test with]"
|
|
10
|
+
arguments: video
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Set up tinycloud
|
|
14
|
+
|
|
15
|
+
Walk the user from nothing to a working, verified tinycloud install. End the
|
|
16
|
+
session with one successful command, not a checklist. Work through the steps
|
|
17
|
+
in order, skipping any that already pass.
|
|
18
|
+
|
|
19
|
+
## 1. Is the CLI installed?
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
command -v tinycloud && tinycloud --version --json </dev/null
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If installed and the JSON reports `"version"` ≥ 0.3.0, go to step 2. If
|
|
26
|
+
missing (or no machine-readable version), install it — ask the user which
|
|
27
|
+
they prefer:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install -g @cloudglue/tinycloud # canonical (Node >= 18)
|
|
31
|
+
# or
|
|
32
|
+
curl -fsSL https://app.cloudglue.dev/tinycloud.sh | bash
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The first run downloads the platform distribution (~90 MB, one time). More
|
|
36
|
+
at https://tinycloud.sh. Windows is unsupported — use WSL2.
|
|
37
|
+
|
|
38
|
+
## 2. Is a Cloudglue API key configured?
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
tinycloud setup --check --json </dev/null
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If `data.ok` is `true`, go to step 3. Otherwise tell the user: cloud
|
|
45
|
+
features run through a Cloudglue account — keys live at
|
|
46
|
+
[app.cloudglue.dev](https://app.cloudglue.dev) (usage billed per the
|
|
47
|
+
[rate card](https://app.cloudglue.dev/home/billing/rate-card)). Ask them to
|
|
48
|
+
paste their API key, then configure it via stdin so the key never lands in
|
|
49
|
+
shell history or process args:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
printf '%s' "<key>" | tinycloud setup cloudglue --stdin
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Re-run `tinycloud setup --check --json` and confirm `data.ok == true`.
|
|
56
|
+
|
|
57
|
+
## 3. Prove it works (free)
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
tinycloud workflow validate summary --json # exercises the recipe engine, no cloud calls
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Expect `status: "ready"`. If the user provided a video (`$video`) or has one
|
|
64
|
+
handy, also show them something real — still free and local:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
tinycloud clip info <video> --json # duration/resolution/codecs via bundled ffprobe
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 4. Hand off
|
|
71
|
+
|
|
72
|
+
Report what's now working and point forward:
|
|
73
|
+
|
|
74
|
+
- "Analyze a video": `tinycloud watch <video> --json` (first cloud call —
|
|
75
|
+
uses the API key)
|
|
76
|
+
- One-command workflows: `tinycloud workflow list --json` (sales-coaching,
|
|
77
|
+
blog-post, ad-analysis, meeting-breakdown, youtube-publish, …)
|
|
78
|
+
- If the general `tinycloud` skill is installed alongside this one, it
|
|
79
|
+
documents the full CLI, envelope contract, and a glossary; its
|
|
80
|
+
`scripts/preflight.sh` re-checks this setup any time.
|
|
81
|
+
|
|
82
|
+
## Troubleshooting
|
|
83
|
+
|
|
84
|
+
- `tinycloud` found but `--version --json` prints a UI instead of JSON →
|
|
85
|
+
pre-0.3.0 install; upgrade via either install command above.
|
|
86
|
+
- `setup --check` reports `ok: false` after configuring → key was rejected;
|
|
87
|
+
re-paste it (watch for stray whitespace) or generate a fresh key.
|
|
88
|
+
- Corporate proxy: the npm launcher honors `HTTPS_PROXY` (falls back to
|
|
89
|
+
curl for the download).
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tinycloud-skill-creator
|
|
3
|
+
description: >-
|
|
4
|
+
Create a new tinycloud-powered skill: a SKILL.md plus optional workflow
|
|
5
|
+
recipe and render script that run tinycloud CLI commands and produce
|
|
6
|
+
deliverables (HTML reports, markdown, JSON, clips, published sites). Use
|
|
7
|
+
when the user wants to build, scaffold, or package a custom repeatable
|
|
8
|
+
video workflow as a skill — for this agent, for another agent, or for the
|
|
9
|
+
tinycloud agent itself. Requires the tinycloud CLI.
|
|
10
|
+
argument-hint: "[skill goal or name]"
|
|
11
|
+
arguments: goal
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Create a tinycloud-powered skill
|
|
15
|
+
|
|
16
|
+
Walk the user from an idea ("turn a sales call into a follow-up email page")
|
|
17
|
+
to an installed, validated skill. The skills you create run tinycloud verbs
|
|
18
|
+
and workflows, but their OUTPUT is a deliverable consumed outside the
|
|
19
|
+
conversation: an HTML page, a markdown doc, a JSON payload, clip files,
|
|
20
|
+
captions, a published site URL. Author for that external consumer.
|
|
21
|
+
|
|
22
|
+
Prerequisite: the tinycloud CLI configured with a Cloudglue API key. If the
|
|
23
|
+
general `tinycloud` skill is installed alongside this one, run its
|
|
24
|
+
`scripts/preflight.sh` first; otherwise check
|
|
25
|
+
`tinycloud setup --check --json` → `data.ok` (install:
|
|
26
|
+
`npm install -g @cloudglue/tinycloud`, see https://tinycloud.sh). For the
|
|
27
|
+
recipe YAML schema, use the `tinycloud` skill's reference/workflow-authoring.md
|
|
28
|
+
if installed, or the schema reference bundled with the binary at
|
|
29
|
+
`<install>/skills/skill-creator/references/workflow-schema.md`.
|
|
30
|
+
|
|
31
|
+
## 1. Interview
|
|
32
|
+
|
|
33
|
+
Before writing anything, establish:
|
|
34
|
+
|
|
35
|
+
- **Deliverable**: what file(s) does the skill produce, and who consumes
|
|
36
|
+
them? (HTML report, markdown summary, JSON for an API, clips, captions, a
|
|
37
|
+
published site URL.)
|
|
38
|
+
- **Inputs**: one video? a URL? a collection? several sources?
|
|
39
|
+
- **Shape**: a repeatable recipe with known steps → workflow-backed; or
|
|
40
|
+
exploratory work where the agent picks each next command → direct-verb.
|
|
41
|
+
- **Where it lives** (pick the target before scaffolding):
|
|
42
|
+
- *This host agent* (Claude Code, etc.): a skill directory in the agent's
|
|
43
|
+
skills location (e.g. `~/.claude/skills/<name>/` or the project's
|
|
44
|
+
`.claude/skills/<name>/`) whose SKILL.md runs the recipe **by path**.
|
|
45
|
+
- *The tinycloud agent*: `~/.tinycloud/skills/<name>/` (global) or
|
|
46
|
+
`.tinycloud/skills/<name>/` (project), picked up as `/skills:<name>`.
|
|
47
|
+
|
|
48
|
+
## 2. Scaffold
|
|
49
|
+
|
|
50
|
+
The tinycloud distribution bundles a scaffolder next to the binary. Locate
|
|
51
|
+
it (try in order; fall back to hand-authoring from the workflow-authoring
|
|
52
|
+
reference if absent):
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
TC_DIR="$(dirname "$(command -v tinycloud)")" # curl install
|
|
56
|
+
SCAFFOLDER="$TC_DIR/skills/skill-creator/scripts/init-skill.js"
|
|
57
|
+
# npm-wrapper installs keep versions under ~/.tinycloud/versions/<v>/
|
|
58
|
+
[ -f "$SCAFFOLDER" ] || SCAFFOLDER="$(ls -d ~/.tinycloud/versions/*/skills/skill-creator/scripts/init-skill.js 2>/dev/null | tail -1)"
|
|
59
|
+
|
|
60
|
+
node "$SCAFFOLDER" <skill-name> --description "<one-line description>" \
|
|
61
|
+
--dir <target-dir> --pattern workflow|direct
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
It creates `<target-dir>/<skill-name>/`: a SKILL.md skeleton, and for the
|
|
65
|
+
workflow pattern a `<skill-name>.yaml` recipe plus `scripts/render.js` and
|
|
66
|
+
`package.json`. It never overwrites an existing directory.
|
|
67
|
+
|
|
68
|
+
## 3. Author
|
|
69
|
+
|
|
70
|
+
Edit the scaffolded files with the user's specifics.
|
|
71
|
+
|
|
72
|
+
- **Description is the trigger.** Name the deliverable and the input ("Turn
|
|
73
|
+
a sales call into a follow-up email HTML page"), not the mechanism ("uses
|
|
74
|
+
watch and extract").
|
|
75
|
+
- **Body**: imperative instructions — the exact commands to run, how to
|
|
76
|
+
branch on envelope `status`, what to report back. Keep SKILL.md short;
|
|
77
|
+
push schemas, examples, and template detail into files next to it.
|
|
78
|
+
Relative paths in workflow YAML resolve against the recipe directory.
|
|
79
|
+
- **Generalize**: the skill will run on videos you have not seen — never
|
|
80
|
+
hard-code anything from the example video used while authoring.
|
|
81
|
+
- For a host-agent skill, the SKILL.md body invokes the recipe by path:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
tinycloud workflow run ${CLAUDE_SKILL_DIR}/<skill-name>.yaml $source --allow-command --json
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Output contract** (the "outside the agent" rules):
|
|
88
|
+
|
|
89
|
+
- Write deliverables under `./tinycloud-output/` or `${{ run.dir }}` and
|
|
90
|
+
report the absolute path; never leave outputs only in conversation text.
|
|
91
|
+
- stdout is machine output (envelopes/paths); logs and progress go to stderr.
|
|
92
|
+
- In render scripts, inject data into HTML templates via one single-token
|
|
93
|
+
placeholder (replace `DATA_JSON_HERE` with `JSON.stringify(data)`), not
|
|
94
|
+
interpolated JS object literals.
|
|
95
|
+
- If the deliverable should be a URL, finish with
|
|
96
|
+
`tinycloud publish <html-or-dir> --visibility public|private --json` and
|
|
97
|
+
ask the user public-or-private before the first publish.
|
|
98
|
+
|
|
99
|
+
## 4. Validate and dry-run
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
tinycloud workflow validate <dir>/<skill-name>/<skill-name>.yaml --json
|
|
103
|
+
tinycloud workflow plan <dir>/<skill-name>/<skill-name>.yaml <test-source> --json
|
|
104
|
+
tinycloud workflow run <dir>/<skill-name>/<skill-name>.yaml <test-source> --allow-command --json
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`validate` checks the recipe (free), `plan` resolves the graph with no side
|
|
108
|
+
effects (free), `run` executes — cloud steps run through the configured
|
|
109
|
+
Cloudglue API key. Branch on the envelope `status` — `ready` means consume
|
|
110
|
+
`data.outputs`; anything else means stop and surface the next action. Open
|
|
111
|
+
the produced deliverable and check it against the user's intent before
|
|
112
|
+
declaring success.
|
|
113
|
+
|
|
114
|
+
## 5. Gate and distribute
|
|
115
|
+
|
|
116
|
+
- Command steps are gated: keep `permissions: [command]` in the recipe for
|
|
117
|
+
trusted skills, or require `--allow-command` per run. `--no-command`
|
|
118
|
+
always wins.
|
|
119
|
+
- For skills distributed to other machines, gate on the installed binary:
|
|
120
|
+
`tinycloud --version --json` reports `version` and `features` — document a
|
|
121
|
+
`min_version` in the skill (the general `tinycloud` skill's
|
|
122
|
+
`tinycloud-skill.json` shows the manifest pattern, when installed).
|
|
123
|
+
|
|
124
|
+
## Iterating on an existing skill
|
|
125
|
+
|
|
126
|
+
Read its SKILL.md and recipe, re-run `workflow validate`/`plan` after edits,
|
|
127
|
+
and re-test with the same source the user reported the problem on. Tighten
|
|
128
|
+
the description if the skill failed to trigger; move detail out of SKILL.md
|
|
129
|
+
if it grew past ~150 lines.
|