@realtimex/sdk 2.0.3 → 2.0.5
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": "@realtimex/sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "SDK for building Local Apps that integrate with RealtimeX",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -25,9 +25,10 @@
|
|
|
25
25
|
"sdk:generate:force": "node ../scripts/generate-v1-sdk.mjs --force",
|
|
26
26
|
"sdk:diff": "node ../scripts/generate-v1-sdk.mjs --dry-run",
|
|
27
27
|
"skill:generate": "node ../scripts/generate-skill.mjs --force",
|
|
28
|
+
"skill:local-test": "node ../scripts/local-test-realtimex-skill.mjs",
|
|
28
29
|
"pp-cli:build": "node ../scripts/build-pp-cli-packages.mjs",
|
|
29
30
|
"pp-cli:publish": "node ../scripts/publish-pp-cli-packages.mjs",
|
|
30
|
-
"prepublishOnly": "npm run build"
|
|
31
|
+
"prepublishOnly": "npm run build && npm run skill:generate"
|
|
31
32
|
},
|
|
32
33
|
"keywords": [
|
|
33
34
|
"realtimex",
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: realtimex-moderator-sdk
|
|
3
|
+
description: "Use the RealTimeX API through the generated CLI for workspace, thread, and chat operations."
|
|
4
|
+
author: ""
|
|
5
|
+
license: "Apache-2.0"
|
|
6
|
+
argument-hint: "<command> [args] | install cli"
|
|
7
|
+
allowed-tools: "Read Bash"
|
|
8
|
+
metadata:
|
|
9
|
+
openclaw:
|
|
10
|
+
requires:
|
|
11
|
+
bins:
|
|
12
|
+
- realtimex-pp-cli
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Realtimex — Printing Press CLI
|
|
16
|
+
|
|
17
|
+
## Prerequisites: Install the CLI
|
|
18
|
+
|
|
19
|
+
This skill drives the `realtimex-pp-cli` binary. Verify the CLI is installed and exactly matches this skill's SDK version before invoking any command from this skill. If it is missing or the version does not match, reinstall the pinned version first:
|
|
20
|
+
|
|
21
|
+
1. Install or reinstall the pinned version via npm:
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g @realtimex/pp-cli@2.0.5
|
|
24
|
+
```
|
|
25
|
+
2. Verify the exact version:
|
|
26
|
+
```bash
|
|
27
|
+
realtimex-pp-cli --version
|
|
28
|
+
```
|
|
29
|
+
The output must be `realtimex-pp-cli 2.0.5`.
|
|
30
|
+
|
|
31
|
+
If `--version` reports "command not found" after install, the npm global bin directory is not on `$PATH`. If it reports any version other than `2.0.5`, reinstall with the pinned npm command above. Do not proceed with skill commands until exact-version verification succeeds.
|
|
32
|
+
|
|
33
|
+
## Command Reference
|
|
34
|
+
|
|
35
|
+
**clear-workspace-default-agent** — Manage clear workspace default agent
|
|
36
|
+
|
|
37
|
+
- `realtimex-pp-cli clear-workspace-default-agent <workspaceSlug>` — Clear the default CLI agent from a workspace.
|
|
38
|
+
|
|
39
|
+
**create-thread** — Manage create thread
|
|
40
|
+
|
|
41
|
+
- `realtimex-pp-cli create-thread <workspaceSlug>` — Create a thread in one workspace. The name is optional but recommended.
|
|
42
|
+
|
|
43
|
+
**create-workspace** — Manage create workspace
|
|
44
|
+
|
|
45
|
+
- `realtimex-pp-cli create-workspace` — Create a workspace. Requires a human-readable workspace name.
|
|
46
|
+
|
|
47
|
+
**delete-thread** — Manage delete thread
|
|
48
|
+
|
|
49
|
+
- `realtimex-pp-cli delete-thread <workspaceSlug> <threadSlug>` — Delete one thread by exact workspace slug and exact thread slug.
|
|
50
|
+
|
|
51
|
+
**delete-workspace** — Manage delete workspace
|
|
52
|
+
|
|
53
|
+
- `realtimex-pp-cli delete-workspace <workspaceSlug>` — Delete one workspace by exact workspace slug.
|
|
54
|
+
|
|
55
|
+
**get-thread** — Manage get thread
|
|
56
|
+
|
|
57
|
+
- `realtimex-pp-cli get-thread <workspaceSlug> <threadSlug>` — Get one thread by exact workspace slug and exact thread slug.
|
|
58
|
+
|
|
59
|
+
**get-workspace** — Manage get workspace
|
|
60
|
+
|
|
61
|
+
- `realtimex-pp-cli get-workspace <workspaceSlug>` — Get one workspace by exact workspace slug.
|
|
62
|
+
|
|
63
|
+
**list-llm-models** — Manage list llm models
|
|
64
|
+
|
|
65
|
+
- `realtimex-pp-cli list-llm-models <provider>` — List models for one provider id. Use an exact model id from this response with send-llm-message.
|
|
66
|
+
|
|
67
|
+
**list-llm-providers** — Manage list llm providers
|
|
68
|
+
|
|
69
|
+
- `realtimex-pp-cli list-llm-providers` — List supported LLM providers. Use provider ids from this response with list-llm-models and send-llm-message.
|
|
70
|
+
|
|
71
|
+
**list-threads** — Manage list threads
|
|
72
|
+
|
|
73
|
+
- `realtimex-pp-cli list-threads <workspaceSlug>` — List threads for one exact workspace slug.
|
|
74
|
+
|
|
75
|
+
**list-workspaces** — Manage list workspaces
|
|
76
|
+
|
|
77
|
+
- `realtimex-pp-cli list-workspaces` — List all workspaces visible to the current API caller. Use this before choosing a workspace slug.
|
|
78
|
+
|
|
79
|
+
**prepare** — Manage prepare
|
|
80
|
+
|
|
81
|
+
- `realtimex-pp-cli prepare` — Return compact workspace, thread, LLM provider, model, and CLI agent context for agents before choosing arguments.
|
|
82
|
+
|
|
83
|
+
**rename-thread** — Manage rename thread
|
|
84
|
+
|
|
85
|
+
- `realtimex-pp-cli rename-thread <workspaceSlug> <threadSlug>` — Rename one thread by exact workspace slug and exact thread slug. Only the name is changed.
|
|
86
|
+
|
|
87
|
+
**rename-workspace** — Manage rename workspace
|
|
88
|
+
|
|
89
|
+
- `realtimex-pp-cli rename-workspace <workspaceSlug>` — Rename one workspace by exact workspace slug. Only the name is changed.
|
|
90
|
+
|
|
91
|
+
**send-llm-message** — Manage send llm message
|
|
92
|
+
|
|
93
|
+
- `realtimex-pp-cli send-llm-message <workspaceSlug> <threadSlug>` — Send one non-streaming LLM message to an exact thread.
|
|
94
|
+
|
|
95
|
+
**set-workspace-default-agent** — Manage set workspace default agent
|
|
96
|
+
|
|
97
|
+
- `realtimex-pp-cli set-workspace-default-agent <workspaceSlug>` — Set the default CLI agent for a workspace.
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
### Finding the right command
|
|
101
|
+
|
|
102
|
+
When you know what you want to do but not which command does it, ask the CLI directly:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
realtimex-pp-cli which "<capability in your own words>"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`which` resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code `0` means at least one match; exit code `2` means no confident match — fall back to `--help` or use a narrower query.
|
|
109
|
+
|
|
110
|
+
## Auth Setup
|
|
111
|
+
Run `realtimex-pp-cli auth setup` to print the URL and steps for getting a key (add `--launch` to open the URL). Then set:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
export REALTIMEX_APP_ID_AUTH="<your-key>"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Or persist it in `~/.config/realtimex-developer-pp-cli/config.toml`.
|
|
118
|
+
|
|
119
|
+
Run `realtimex-pp-cli doctor` to verify setup.
|
|
120
|
+
|
|
121
|
+
## Agent Mode
|
|
122
|
+
|
|
123
|
+
Add `--agent` to any command. Expands to: `--json --compact --no-input --no-color --yes`.
|
|
124
|
+
|
|
125
|
+
- **Pipeable** — JSON on stdout, errors on stderr
|
|
126
|
+
- **Filterable** — `--select` keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
realtimex-pp-cli clear-workspace-default-agent mock-value --agent --select id,name,status
|
|
130
|
+
```
|
|
131
|
+
- **Previewable** — `--dry-run` shows the request without sending
|
|
132
|
+
- **Offline-friendly** — sync/search commands can use the local SQLite store when available
|
|
133
|
+
- **Non-interactive** — never prompts, every input is a flag
|
|
134
|
+
- **Explicit retries** — use `--idempotent` only when an already-existing create should count as success, and `--ignore-missing` only when a missing delete target should count as success
|
|
135
|
+
|
|
136
|
+
### Response envelope
|
|
137
|
+
|
|
138
|
+
Commands that read from the local store or the API wrap output in a provenance envelope:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
|
|
143
|
+
"results": <data>
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Parse `.results` for data and `.meta.source` to know whether it's live or local. A human-readable `N results (live)` summary is printed to stderr only when stdout is a terminal AND no machine-format flag (`--json`, `--csv`, `--compact`, `--quiet`, `--plain`, `--select`) is set — piped/agent consumers and explicit-format runs get pure JSON on stdout.
|
|
148
|
+
|
|
149
|
+
## Agent Feedback
|
|
150
|
+
|
|
151
|
+
When you (or the agent) notice something off about this CLI, record it:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
realtimex-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
|
|
155
|
+
realtimex-pp-cli feedback --stdin < notes.txt
|
|
156
|
+
realtimex-pp-cli feedback list --json --limit 10
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Entries are stored locally at `~/.local/share/realtimex-pp-cli/feedback.jsonl`. They are never POSTed unless `REALTIMEX_FEEDBACK_ENDPOINT` is set AND either `--send` is passed or `REALTIMEX_FEEDBACK_AUTO_SEND=true`. Default behavior is local-only.
|
|
160
|
+
|
|
161
|
+
Write what *surprised* you, not a bug report. Short, specific, one line: that is the part that compounds.
|
|
162
|
+
|
|
163
|
+
## Output Delivery
|
|
164
|
+
|
|
165
|
+
Every command accepts `--deliver <sink>`. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:
|
|
166
|
+
|
|
167
|
+
| Sink | Effect |
|
|
168
|
+
|------|--------|
|
|
169
|
+
| `stdout` | Default; write to stdout only |
|
|
170
|
+
| `file:<path>` | Atomically write output to `<path>` (tmp + rename) |
|
|
171
|
+
| `webhook:<url>` | POST the output body to the URL (`application/json` or `application/x-ndjson` when `--compact`) |
|
|
172
|
+
|
|
173
|
+
Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.
|
|
174
|
+
|
|
175
|
+
## Named Profiles
|
|
176
|
+
|
|
177
|
+
A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
realtimex-pp-cli profile save briefing --json
|
|
181
|
+
realtimex-pp-cli --profile briefing clear-workspace-default-agent mock-value
|
|
182
|
+
realtimex-pp-cli profile list --json
|
|
183
|
+
realtimex-pp-cli profile show briefing
|
|
184
|
+
realtimex-pp-cli profile delete briefing --yes
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Explicit flags always win over profile values; profile values win over defaults. `agent-context` lists all available profiles under `available_profiles` so introspecting agents discover them at runtime.
|
|
188
|
+
|
|
189
|
+
## Exit Codes
|
|
190
|
+
|
|
191
|
+
| Code | Meaning |
|
|
192
|
+
|------|---------|
|
|
193
|
+
| 0 | Success |
|
|
194
|
+
| 2 | Usage error (wrong arguments) |
|
|
195
|
+
| 3 | Resource not found |
|
|
196
|
+
| 4 | Authentication required |
|
|
197
|
+
| 5 | API error (upstream issue) |
|
|
198
|
+
| 7 | Rate limited (wait and retry) |
|
|
199
|
+
| 10 | Config error |
|
|
200
|
+
|
|
201
|
+
## Argument Parsing
|
|
202
|
+
|
|
203
|
+
Parse `$ARGUMENTS`:
|
|
204
|
+
|
|
205
|
+
1. **Empty, `help`, or `--help`** → show `realtimex-pp-cli --help` output
|
|
206
|
+
2. **Starts with `install`** → ends with `mcp` → MCP installation; otherwise → see Prerequisites above
|
|
207
|
+
3. **Anything else** → Direct Use (execute as CLI command with `--agent`)
|
|
208
|
+
|
|
209
|
+
## MCP Server Installation
|
|
210
|
+
|
|
211
|
+
Install the MCP binary from this CLI's published public-library entry or pre-built release, then register it:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
claude mcp add realtimex-pp-mcp -- realtimex-pp-mcp
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Verify: `claude mcp list`
|
|
218
|
+
|
|
219
|
+
## Direct Use
|
|
220
|
+
|
|
221
|
+
1. Check whether the CLI is installed and version-matched:
|
|
222
|
+
```bash
|
|
223
|
+
realtimex-pp-cli --version
|
|
224
|
+
```
|
|
225
|
+
If the command is missing or the output is not exactly `realtimex-pp-cli 2.0.5`, reinstall the pinned version:
|
|
226
|
+
```bash
|
|
227
|
+
npm install -g @realtimex/pp-cli@2.0.5
|
|
228
|
+
```
|
|
229
|
+
Then run `realtimex-pp-cli --version` again and proceed only after exact-version verification succeeds.
|
|
230
|
+
2. Match the user query to the best command from the Unique Capabilities and Command Reference above.
|
|
231
|
+
3. Execute with the `--agent` flag:
|
|
232
|
+
```bash
|
|
233
|
+
realtimex-pp-cli <command> [subcommand] [args] --agent
|
|
234
|
+
```
|
|
235
|
+
4. If ambiguous, drill into subcommand help: `realtimex-pp-cli <command> --help`.
|
|
236
|
+
|
|
237
|
+
## Constraints
|
|
238
|
+
|
|
239
|
+
This skill intentionally exposes a small action-first command set. Prefer these generated commands over older nested resource commands.
|
|
240
|
+
|
|
241
|
+
* Use only documented `realtimex-pp-cli` commands.
|
|
242
|
+
* Never call the RealTimeX API directly with `curl`, `fetch`, raw HTTP clients, or custom scripts.
|
|
243
|
+
* If the current CLI cannot do the requested task, say the feature is not available and will be added soon.
|
|
244
|
+
* Use `--agent` on every command.
|
|
245
|
+
* Always run first:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
realtimex-pp-cli prepare --agent
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
* Use exact workspace slugs, thread slugs, provider ids, model ids, agent `canonical`, and agent `modelId` values from `prepare`.
|
|
252
|
+
* Do not guess workspace, thread, model, provider, agent, message, target, or option values.
|
|
253
|
+
* If required context is missing or ambiguous, ask a concise clarification question before running a command.
|
|
254
|
+
* Never assume a workspace or thread that the user has not referenced.
|
|
255
|
+
* If the user does not name or contextually reference a workspace for a workspace/thread/message operation, ask which workspace to use before running a command.
|
|
256
|
+
* If the user names or contextually references a thread but does not name or contextually reference its workspace, ask which workspace contains that thread before running a command.
|
|
257
|
+
* When the user explicitly uses contextual references such as "current workspace", "this thread", "the thread just created", "that workspace", or similar references, resolve them from the available conversation context only when the reference is unambiguous.
|
|
258
|
+
* If multiple plausible matches exist, ask the user to choose.
|
|
259
|
+
|
|
260
|
+
For `send-llm-message`:
|
|
261
|
+
|
|
262
|
+
* Require all four values to be explicitly named or explicitly referenced in the current request:
|
|
263
|
+
* workspace
|
|
264
|
+
* thread
|
|
265
|
+
* LLM provider
|
|
266
|
+
* LLM model
|
|
267
|
+
* If any of those four values are missing or ambiguous, ask for the missing values before running the command.
|
|
268
|
+
* Use provider/model only from:
|
|
269
|
+
* `prepare.models`
|
|
270
|
+
* `list-llm-providers`
|
|
271
|
+
* `list-llm-models`
|
|
272
|
+
* Never use `prepare.agents[].models` for `send-llm-message`.
|
|
273
|
+
* Prefer provider `realtimexai` unless the user explicitly asks for local `nodellama`.
|
|
274
|
+
* Only choose a model id that exists in the selected provider's LLM model list.
|
|
275
|
+
* If the requested model is unavailable, ask which available model to use instead.
|
|
276
|
+
|
|
277
|
+
For workspace default-agent setup:
|
|
278
|
+
|
|
279
|
+
* Use `prepare.agents` only.
|
|
280
|
+
* Use exact agent `canonical` and optional agent `modelId` values from `prepare.agents`.
|
|
281
|
+
* Never use `prepare.models` for workspace default-agent setup.
|
|
Binary file
|