@formthefog/stratus 2026.2.17

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 ADDED
@@ -0,0 +1,719 @@
1
+ <div align="center">
2
+
3
+ ![Stratus X1 OpenClaw](banner.png)
4
+
5
+ # Stratus X1-AC Plugin for OpenClaw
6
+
7
+ </div>
8
+
9
+ Integrate Stratus V3 (X1-AC), a state-of-the-art action-conditioned JEPA (Joint-Embedding Predictive Architecture), into OpenClaw for autonomous agent planning and semantic state understanding.
10
+
11
+ ## Features
12
+
13
+ - **Model Provider**: Use Stratus models (GPT-4o or Claude Sonnet 4 backends) for agent conversations
14
+ - **Embeddings Tool**: Generate 768-dimensional semantic state embeddings
15
+ - **Rollout Tool**: Multi-step task planning with action sequence prediction
16
+ - **Secure**: API key authentication with automatic validation
17
+ - **Opt-in Tools**: Tools are optional and require explicit allowlisting
18
+
19
+ ## Support
20
+
21
+ - **Documentation**: [https://stratus.run/docs](https://stratus.run/docs)
22
+ - **Issues**: [https://github.com/formthefog/openclaw-stratus-x1-plugin/issues](https://github.com/formthefog/openclaw-stratus-x1-plugin/issues)
23
+ - **API Key**: [https://stratus.run](https://stratus.run)
24
+
25
+ ## Installation
26
+
27
+ ### Quick Start (3 Steps) ✨
28
+
29
+ > **Note:** This plugin does NOT have an automatic postinstall script. You must run setup manually.
30
+
31
+ ```bash
32
+ # 1. Install the plugin
33
+ npm install -g @hathbanger/stratus
34
+ # or
35
+ npx clawhub install stratus
36
+
37
+ # 2. Run setup (in any OpenClaw chat interface)
38
+ /stratus setup
39
+
40
+ # 3. Verify everything works
41
+ /stratus verify
42
+ ```
43
+
44
+ **That's it!** The `/stratus setup` command handles:
45
+ - ✅ API key configuration
46
+ - ✅ OpenClaw config updates
47
+ - ✅ Auth profile creation
48
+ - ✅ Model registration
49
+ - ✅ Gateway restart prompt
50
+
51
+ **No manual config editing required!** 🧈
52
+
53
+ > **Tip:** Once installed, you can also access Stratus models with `/model stratus` in chat.
54
+
55
+ ---
56
+
57
+ ## Available Commands
58
+
59
+ Use these slash commands in any OpenClaw chat (TUI, Telegram, Discord, etc.):
60
+
61
+ | Command | Description |
62
+ |---------|-------------|
63
+ | `/stratus` | Show help |
64
+ | `/stratus setup` | Interactive configuration wizard |
65
+ | `/stratus verify` | Verify plugin is configured correctly |
66
+
67
+ ---
68
+
69
+ ## What `/stratus setup` Does
70
+
71
+ The interactive setup command will:
72
+
73
+ 1. ✅ Prompt for your Stratus API key
74
+ 2. ✅ Update OpenClaw configuration
75
+ 3. ✅ Configure authentication profiles
76
+ 4. ✅ Add model aliases
77
+ 5. ✅ (Optional) Add environment variables to your shell config
78
+
79
+ ---
80
+
81
+ ## Testing Your Installation
82
+
83
+ After setup, verify everything works:
84
+
85
+ ```
86
+ # In chat:
87
+ /stratus verify
88
+
89
+ # Then try the model:
90
+ /model stratus
91
+ Hello from Stratus!
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Manual Installation (Alternative)
97
+
98
+ If you prefer manual setup, you can use the included script:
99
+
100
+ ```bash
101
+ npx clawhub install stratus
102
+ cd ~/.openclaw/plugins/stratus
103
+ ./install.sh
104
+ openclaw gateway restart
105
+ ```
106
+
107
+ Or run verification manually:
108
+
109
+ ```bash
110
+ ./verify.sh
111
+ ```
112
+
113
+ ---
114
+
115
+ ### From OpenClaw Monorepo
116
+
117
+ If you're developing in the OpenClaw monorepo, the plugin is already available:
118
+
119
+ ```bash
120
+ cd /path/to/openclaw
121
+ pnpm install
122
+ ```
123
+
124
+ ### Via npm (Recommended)
125
+
126
+ ```bash
127
+ npm install -g @hathbanger/stratus
128
+ ```
129
+
130
+ ### Via ClawHub
131
+
132
+ ```bash
133
+ npx clawhub install stratus
134
+ ```
135
+
136
+ ## Configuration
137
+
138
+ ### 1. Get Your API Key
139
+
140
+ Sign up at [stratus.run](https://stratus.run) to get your API key (format: `stratus_sk_...`).
141
+
142
+ ### 2. Set Environment Variable
143
+
144
+ ```bash
145
+ export STRATUS_API_KEY=stratus_sk_live_your_key_here
146
+ ```
147
+
148
+ Or add to your shell profile (`~/.bashrc`, `~/.zshrc`, etc.):
149
+
150
+ ```bash
151
+ echo 'export STRATUS_API_KEY=stratus_sk_live_your_key_here' >> ~/.zshrc
152
+ ```
153
+
154
+ ### 3. Configure OpenClaw
155
+
156
+ Run the onboarding wizard:
157
+
158
+ ```bash
159
+ openclaw onboard
160
+ ```
161
+
162
+ Select "Stratus" as a provider and enter your API key when prompted.
163
+
164
+ **Manual Configuration** (alternative):
165
+
166
+ Edit `~/.openclaw/openclaw.json`:
167
+
168
+ ```json
169
+ {
170
+ "plugins": {
171
+ "stratus": {
172
+ "enabled": true,
173
+ "apiKey": "${STRATUS_API_KEY}",
174
+ "baseUrl": "https://dev.api.stratus.run",
175
+ "provider": {
176
+ "enabled": true,
177
+ "defaultModel": "stratus-x1ac-base-claude-sonnet-4-5"
178
+ },
179
+ "tools": {
180
+ "embeddings": { "enabled": true },
181
+ "rollout": { "enabled": true }
182
+ }
183
+ }
184
+ }
185
+ }
186
+ ```
187
+
188
+ ## Usage
189
+
190
+ ### 1. Use Stratus as a Model Provider
191
+
192
+ Use Stratus models for agent conversations:
193
+
194
+ ```bash
195
+ # Use Claude Sonnet 4.5 backend (recommended)
196
+ openclaw agent --model stratus/stratus-x1ac-base-claude-sonnet-4-5 \
197
+ "Explain action-conditioned state prediction"
198
+
199
+ # Use GPT-4o backend
200
+ openclaw agent --model stratus/stratus-x1ac-base-gpt-4o \
201
+ "Help me plan a complex task"
202
+
203
+ # Use smaller model for faster responses
204
+ openclaw agent --model stratus/stratus-x1ac-small-claude-haiku-4-5 \
205
+ "Quick question: what is JEPA?"
206
+ ```
207
+
208
+ **Available Models: 75 Total**
209
+
210
+ The plugin registers all 75 Stratus chat completion models:
211
+
212
+ **Model Format:** `stratus-x1ac-{size}-{llm}`
213
+
214
+ **Sizes:** `small`, `base`, `large`, `xl`, `huge`
215
+
216
+ **OpenAI LLMs:**
217
+
218
+ - `gpt-4o` - GPT-4 Optimized (latest)
219
+ - `gpt-4o-mini` - Smaller, faster GPT-4o
220
+ - `gpt-4-turbo` - GPT-4 Turbo
221
+ - `gpt-4` - GPT-4 base
222
+ - `gpt-3.5-turbo` - GPT-3.5 Turbo
223
+
224
+ **Anthropic LLMs (Claude 4.x):**
225
+
226
+ - `claude-sonnet-4-5` - Claude 4.5 Sonnet (recommended)
227
+ - `claude-opus-4-5` - Claude 4.5 Opus
228
+ - `claude-haiku-4-5` - Claude 4.5 Haiku (fast)
229
+ - `claude-sonnet-4` - Claude 4 Sonnet
230
+ - `claude-opus-4` - Claude 4 Opus
231
+
232
+ **Anthropic LLMs (Claude 3.x - Legacy):**
233
+
234
+ - `claude-3-7-sonnet`, `claude-3-5-sonnet`, `claude-3-opus`, `claude-3-sonnet`, `claude-3-haiku`
235
+
236
+ **Examples:**
237
+
238
+ - `stratus/stratus-x1ac-base-claude-sonnet-4-5` (recommended)
239
+ - `stratus/stratus-x1ac-base-gpt-4o`
240
+ - `stratus/stratus-x1ac-large-claude-opus-4-5` (high performance)
241
+ - `stratus/stratus-x1ac-small-gpt-4o-mini` (development/testing)
242
+
243
+ ### 2. Use Stratus Tools
244
+
245
+ #### Enable Tools (Allowlist)
246
+
247
+ Tools are opt-in for security. Enable them in your config:
248
+
249
+ ```bash
250
+ # Enable both tools
251
+ openclaw config set agents.defaults.tools.allow '["stratus_embeddings", "stratus_rollout"]'
252
+
253
+ # Or enable only specific tools
254
+ openclaw config set agents.defaults.tools.allow '["stratus_rollout"]'
255
+ ```
256
+
257
+ #### Embeddings Tool
258
+
259
+ Generate semantic embeddings for state understanding:
260
+
261
+ ```bash
262
+ openclaw agent "Generate embeddings for these states: ['idle', 'working', 'completed']"
263
+ ```
264
+
265
+ The agent will invoke:
266
+
267
+ ```json
268
+ {
269
+ "tool": "stratus_embeddings",
270
+ "input": ["idle", "working", "completed"]
271
+ }
272
+ ```
273
+
274
+ **Use Cases:**
275
+
276
+ - Semantic search over states
277
+ - State similarity comparison
278
+ - Memory indexing
279
+ - Context clustering
280
+
281
+ #### Rollout Tool
282
+
283
+ Plan multi-step action sequences:
284
+
285
+ ```bash
286
+ openclaw agent "Plan the steps to book a hotel room"
287
+ ```
288
+
289
+ The agent will invoke:
290
+
291
+ ```json
292
+ {
293
+ "tool": "stratus_rollout",
294
+ "goal": "hotel room booked",
295
+ "max_steps": 10
296
+ }
297
+ ```
298
+
299
+ **Use Cases:**
300
+
301
+ - Task decomposition
302
+ - Action planning
303
+ - Goal-oriented reasoning
304
+ - Multi-step workflows
305
+
306
+ ### 3. Combined Usage
307
+
308
+ Use Stratus models WITH tools for maximum capability:
309
+
310
+ **Config:**
311
+
312
+ ```json
313
+ {
314
+ "agent": {
315
+ "model": "stratus/stratus-x1ac-base-claude-sonnet-4-5"
316
+ },
317
+ "agents": {
318
+ "defaults": {
319
+ "tools": {
320
+ "allow": ["stratus_embeddings", "stratus_rollout"]
321
+ }
322
+ }
323
+ }
324
+ }
325
+ ```
326
+
327
+ **Example Conversation:**
328
+
329
+ ```bash
330
+ openclaw agent
331
+ > I need to plan a trip to Paris. First, analyze the semantic similarity
332
+ > of these activities: ['visit Eiffel Tower', 'Seine river cruise', 'Louvre museum'].
333
+ > Then, create a step-by-step plan to book everything.
334
+
335
+ # Agent uses:
336
+ # 1. stratus_embeddings() to analyze activity similarity
337
+ # 2. stratus_rollout() to generate booking plan
338
+ # 3. Stratus X1AC model for reasoning and response
339
+ ```
340
+
341
+ ## Tool Reference
342
+
343
+ ### `stratus_embeddings`
344
+
345
+ Generate 768-dimensional semantic embeddings.
346
+
347
+ **Parameters:**
348
+
349
+ - `input` (string | string[]): Text(s) to embed
350
+ - `model` (string, optional): Model to use (default: `stratus-x1ac-base`)
351
+ - `encoding_format` (string, optional): `float` or `base64` (default: `float`)
352
+
353
+ **Returns:**
354
+
355
+ ```json
356
+ {
357
+ "content": [{ "type": "text", "text": "Generated 3 embeddings (768 dimensions each)" }],
358
+ "details": {
359
+ "data": [
360
+ { "embedding": [0.1, 0.2, ...], "index": 0 },
361
+ ...
362
+ ],
363
+ "usage": { "prompt_tokens": 10, "total_tokens": 10 }
364
+ }
365
+ }
366
+ ```
367
+
368
+ ### `stratus_rollout`
369
+
370
+ Multi-step rollout planning.
371
+
372
+ **Parameters:**
373
+
374
+ - `goal` (string): Target state to achieve
375
+ - `initial_state` (string, optional): Starting state
376
+ - `max_steps` (number, optional): Max steps (default: 10, max: 50)
377
+ - `return_intermediate` (boolean, optional): Return intermediate states (default: true)
378
+
379
+ **Returns:**
380
+
381
+ ```json
382
+ {
383
+ "content": [{
384
+ "type": "text",
385
+ "text": "Successfully planned 5 steps\nGoal: book hotel\n\nSteps:\n1. Search hotels\n2. ..."
386
+ }],
387
+ "details": {
388
+ "goal": "book hotel",
389
+ "steps": [
390
+ { "action": "search_hotels", "description": "Search for hotels" },
391
+ ...
392
+ ],
393
+ "success": true
394
+ }
395
+ }
396
+ ```
397
+
398
+ ## Security
399
+
400
+ ### API Key Protection
401
+
402
+ - **Storage**: Store in `STRATUS_API_KEY` environment variable (not in config files)
403
+ - **Validation**: Automatically validates `stratus_sk_*` format
404
+ - **Redaction**: Keys are redacted in logs (`[REDACTED]`)
405
+
406
+ ### Tool Access Control
407
+
408
+ Tools are **opt-in only**:
409
+
410
+ - Registered with `{ optional: true }`
411
+ - Must be explicitly added to `agents.defaults.tools.allow`
412
+ - Not available unless allowlisted
413
+
414
+ ### Input Validation
415
+
416
+ - All tool parameters validated via TypeBox schemas
417
+ - API responses validated before processing
418
+ - Error handling prevents information leakage
419
+
420
+ ## Troubleshooting
421
+
422
+ ### Quick Fixes
423
+
424
+ #### "Stratus API key not configured"
425
+
426
+ **Solution**:
427
+
428
+ ```bash
429
+ export STRATUS_API_KEY=stratus_sk_live_your_key_here
430
+ ```
431
+
432
+ #### "Invalid Stratus API key format"
433
+
434
+ **Solution**: Verify your API key from stratus.run starts with `stratus_sk_`.
435
+
436
+ #### "Tool not available"
437
+
438
+ **Solution**:
439
+
440
+ ```bash
441
+ openclaw config set agents.defaults.tools.allow '["stratus_embeddings", "stratus_rollout"]'
442
+ ```
443
+
444
+ #### "Stratus API error (401)"
445
+
446
+ **Solution**: Get a new API key from stratus.run and update **both** config files:
447
+ - `~/.openclaw/openclaw.json`
448
+ - `~/.openclaw/agents/main/agent/auth-profiles.json`
449
+
450
+ Then restart: `openclaw gateway restart`
451
+
452
+ #### Silent Fallback to Anthropic
453
+
454
+ If SIGBART ignores your Stratus config, see [TROUBLESHOOTING.md](./TROUBLESHOOTING.md#silent-fallback-to-anthropic-sigbart-ignores-stratus-config) for the auth cache fix.
455
+
456
+ ### Full Troubleshooting Guide
457
+
458
+ For detailed debugging steps and solutions to common issues, see **[TROUBLESHOOTING.md](./TROUBLESHOOTING.md)**.
459
+
460
+ ## Architecture
461
+
462
+ ### Hybrid Plugin Design
463
+
464
+ Stratus has dual capabilities:
465
+
466
+ 1. **Provider** (standard LLM API):
467
+ - `/v1/chat/completions`
468
+ - `/v1/messages`
469
+ - Registered via `api.registerProvider()`
470
+
471
+ 2. **Tools** (specialized capabilities):
472
+ - `/v1/embeddings` → `stratus_embeddings`
473
+ - `/v1/rollout` → `stratus_rollout`
474
+ - Registered via `api.registerTool()`
475
+
476
+ This follows UNIX philosophy: clean separation, composable interfaces, transparent behavior.
477
+
478
+ ### Configuration Schema
479
+
480
+ ```typescript
481
+ interface StratusPluginConfig {
482
+ enabled: boolean; // Enable plugin
483
+ apiKey: string; // API key (or env var)
484
+ baseUrl: string; // API base URL
485
+ provider: {
486
+ enabled: boolean; // Enable provider registration
487
+ defaultModel: string; // Default model
488
+ };
489
+ tools: {
490
+ embeddings: { enabled: boolean };
491
+ rollout: { enabled: boolean };
492
+ };
493
+ }
494
+ ```
495
+
496
+ ## Examples
497
+
498
+ ### Semantic State Search
499
+
500
+ ```bash
501
+ openclaw agent --model stratus/stratus-x1ac-base-claude-sonnet-4-5 << 'EOF'
502
+ I have these system states: ['initializing', 'loading', 'ready', 'processing', 'error'].
503
+ Use embeddings to find which states are semantically similar.
504
+ EOF
505
+ ```
506
+
507
+ ### Task Planning Workflow
508
+
509
+ ```bash
510
+ openclaw agent --model stratus/stratus-x1ac-base-claude-sonnet-4-5 << 'EOF'
511
+ I need to deploy a web application. Use rollout planning to generate the steps,
512
+ considering: code push, build, test, deploy, verify.
513
+ EOF
514
+ ```
515
+
516
+ ### Combined Planning + Embeddings
517
+
518
+ ```bash
519
+ openclaw agent --model stratus/stratus-x1ac-base-claude-sonnet-4-5 << 'EOF'
520
+ I want to organize a conference. First, generate embeddings for these tasks:
521
+ ['venue booking', 'speaker invitations', 'catering', 'registration system'].
522
+ Then use rollout to plan the optimal sequence.
523
+ EOF
524
+ ```
525
+
526
+ ## Development
527
+
528
+ ### File Structure
529
+
530
+ ```
531
+ extensions/stratus/
532
+ ├── index.ts # Plugin entry point
533
+ ├── package.json # Package metadata
534
+ ├── tsconfig.json # TypeScript config
535
+ ├── README.md # This file
536
+ └── src/
537
+ ├── client.ts # Stratus API client
538
+ ├── config.ts # Config schema
539
+ └── types.ts # TypeScript types
540
+ ```
541
+
542
+ ### Adding New Endpoints
543
+
544
+ To add a new Stratus endpoint:
545
+
546
+ 1. Add types to `src/types.ts`
547
+ 2. Add client method to `src/client.ts`
548
+ 3. Register tool in `index.ts`
549
+ 4. Update README with usage
550
+
551
+ ## Uninstallation
552
+
553
+ To completely remove the Stratus plugin from OpenClaw:
554
+
555
+ ### Quick Uninstall (Automated)
556
+
557
+ ```bash
558
+ # 1. Disable the plugin via config
559
+ openclaw config patch '{"plugins":{"entries":{"stratus":{"enabled":false}},"installs":{"stratus":null}},"models":{"providers":{"stratus":null}},"agents":{"defaults":{"models":{"stratus/stratus-x1ac-base-claude-sonnet-4-5":null,"stratus/stratus-x1ac-base-gpt-4o":null}}}}'
560
+
561
+ # 2. If your primary model was Stratus, switch back to Anthropic:
562
+ openclaw config patch '{"agents":{"defaults":{"model":{"primary":"anthropic/claude-sonnet-4-5"}}}}'
563
+
564
+ # 3. Restart gateway
565
+ openclaw gateway restart
566
+
567
+ # 4. (Optional) Clean up auth cache
568
+ rm ~/.openclaw/agents/main/agent/auth-profiles.json
569
+ openclaw gateway restart
570
+ ```
571
+
572
+ ### Manual Uninstall (Step-by-Step)
573
+
574
+ **1. Disable plugin in config:**
575
+
576
+ Edit `~/.openclaw/openclaw.json`:
577
+
578
+ ```json
579
+ {
580
+ "plugins": {
581
+ "entries": {
582
+ "stratus": {
583
+ "enabled": false
584
+ }
585
+ }
586
+ }
587
+ }
588
+ ```
589
+
590
+ **2. Remove provider and model references:**
591
+
592
+ ```json
593
+ {
594
+ "models": {
595
+ "providers": {
596
+ // Remove entire "stratus" section
597
+ }
598
+ },
599
+ "agents": {
600
+ "defaults": {
601
+ "model": {
602
+ "primary": "anthropic/claude-sonnet-4-5" // Switch back to default
603
+ },
604
+ "models": {
605
+ // Remove stratus model aliases
606
+ }
607
+ }
608
+ }
609
+ }
610
+ ```
611
+
612
+ **3. Clean auth cache:**
613
+
614
+ OpenClaw caches API keys in `~/.openclaw/agents/main/agent/auth-profiles.json`. Remove the Stratus entry:
615
+
616
+ ```json
617
+ {
618
+ "profiles": {
619
+ "stratus:default": null // Remove this entire entry
620
+ },
621
+ "lastGood": {
622
+ "stratus": null // Remove this
623
+ }
624
+ }
625
+ ```
626
+
627
+ Or delete the entire file and restart (OpenClaw will regenerate it):
628
+
629
+ ```bash
630
+ rm ~/.openclaw/agents/main/agent/auth-profiles.json
631
+ ```
632
+
633
+ **4. Restart gateway:**
634
+
635
+ ```bash
636
+ openclaw gateway restart
637
+ ```
638
+
639
+ **5. (Optional) Remove plugin files:**
640
+
641
+ If installed via ClawHub:
642
+
643
+ ```bash
644
+ rm -rf ~/.openclaw/plugins/stratus
645
+ ```
646
+
647
+ If installed from local path, the plugin files remain at their original location. Update your config to remove the path reference:
648
+
649
+ ```json
650
+ {
651
+ "plugins": {
652
+ "load": {
653
+ "paths": [
654
+ // Remove "/path/to/openclaw-stratus-x1-plugin"
655
+ ]
656
+ }
657
+ }
658
+ }
659
+ ```
660
+
661
+ **6. (Optional) Remove environment variable:**
662
+
663
+ If you added `STRATUS_API_KEY` to your shell profile:
664
+
665
+ ```bash
666
+ # Edit ~/.zshrc or ~/.bashrc and remove:
667
+ # export STRATUS_API_KEY=stratus_sk_...
668
+ ```
669
+
670
+ ### Verification
671
+
672
+ After uninstall, verify Stratus is gone:
673
+
674
+ ```bash
675
+ # Should not show Stratus models
676
+ openclaw agent --help | grep stratus
677
+
678
+ # Should not show Stratus tools
679
+ openclaw tools list | grep stratus
680
+ ```
681
+
682
+ ### Known Issues
683
+
684
+ **Issue:** After uninstall, `oc models` still shows Stratus
685
+
686
+ **Cause:** Model aliases are cached separately from provider config.
687
+
688
+ **Fix:** Use the config patch command above or manually remove from `agents.defaults.models`.
689
+
690
+ ---
691
+
692
+ **Note:** OpenClaw doesn't currently support plugin lifecycle hooks (`postuninstall`), so cleanup must be done manually. We're tracking this as a feature request: [openclaw#XXXX](https://github.com/openclaw/openclaw/issues).
693
+
694
+
695
+ ## Contributing
696
+
697
+ Contributions welcome! Please:
698
+
699
+ 1. Follow existing code style
700
+ 2. Add tests for new features
701
+ 3. Update documentation
702
+ 4. Ensure TypeScript types are complete
703
+
704
+ ## License
705
+
706
+ MIT
707
+
708
+ ## Links
709
+
710
+ - [Stratus Website](https://stratus.run)
711
+ - [OpenClaw Documentation](https://docs.openclaw.ai)
712
+ - [API Documentation](https://stratus.run/docs)
713
+ - [GitHub Issues](https://github.com/openclaw/openclaw/issues)
714
+
715
+ ## Support
716
+
717
+ - **Bug reports**: [GitHub Issues](https://github.com/openclaw/openclaw/issues)
718
+ - **Feature requests**: [GitHub Discussions](https://github.com/openclaw/openclaw/discussions)
719
+ - **Stratus API issues**: support@stratus.run