strray-ai 1.7.8 → 1.7.10
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/.opencode/AGENTS-consumer.md +622 -0
- package/.opencode/init.sh +2 -1
- package/.opencode/strray/features.json +16 -0
- package/AGENTS-consumer.md +530 -2
- package/AGENTS.md +530 -2
- package/README.md +2 -2
- package/dist/delegation/complexity-analyzer.d.ts +3 -1
- package/dist/delegation/complexity-analyzer.d.ts.map +1 -1
- package/dist/delegation/complexity-analyzer.js +6 -4
- package/dist/delegation/complexity-analyzer.js.map +1 -1
- package/dist/delegation/task-skill-router.d.ts +1 -0
- package/dist/delegation/task-skill-router.d.ts.map +1 -1
- package/dist/delegation/task-skill-router.js +75 -7
- package/dist/delegation/task-skill-router.js.map +1 -1
- package/dist/enforcement/enforcer-tools.d.ts +1 -0
- package/dist/enforcement/enforcer-tools.d.ts.map +1 -1
- package/dist/enforcement/enforcer-tools.js +225 -0
- package/dist/enforcement/enforcer-tools.js.map +1 -1
- package/dist/enforcement/rule-enforcer.d.ts.map +1 -1
- package/dist/enforcement/rule-enforcer.js +5 -4
- package/dist/enforcement/rule-enforcer.js.map +1 -1
- package/dist/mcps/knowledge-skills/skill-invocation.server.d.ts.map +1 -1
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +14 -4
- package/dist/mcps/knowledge-skills/skill-invocation.server.js.map +1 -1
- package/dist/plugin/strray-codex-injection.d.ts.map +1 -1
- package/dist/plugin/strray-codex-injection.js +15 -0
- package/dist/plugin/strray-codex-injection.js.map +1 -1
- package/dist/postprocessor/triggers/GitHookTrigger.js +1 -1
- package/dist/scripts/profiling-demo.d.ts +2 -0
- package/dist/scripts/profiling-demo.d.ts.map +1 -0
- package/dist/scripts/profiling-demo.js +78 -0
- package/dist/scripts/profiling-demo.js.map +1 -0
- package/package.json +5 -2
- package/scripts/node/release-tweet.mjs +268 -0
- package/scripts/node/version-manager.mjs +216 -38
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
# StringRay Agents
|
|
2
|
+
|
|
3
|
+
Quick reference for StringRay AI orchestration framework.
|
|
4
|
+
|
|
5
|
+
## What is StringRay?
|
|
6
|
+
|
|
7
|
+
StringRay provides intelligent multi-agent orchestration with automatic delegation and Codex compliance validation. Agents operate via OpenCode plugin injection - no manual setup needed.
|
|
8
|
+
|
|
9
|
+
## How StringRay Works
|
|
10
|
+
|
|
11
|
+
StringRay provides intelligent multi-agent orchestration with automatic delegation and Codex compliance validation. Agents operate via OpenCode plugin injection - no manual setup needed.
|
|
12
|
+
|
|
13
|
+
### Basic Operation
|
|
14
|
+
|
|
15
|
+
1. **Install**: Run `npx strray-ai install` to configure agents in your project
|
|
16
|
+
2. **Invoke**: Use `@agent-name` syntax in prompts or code comments (e.g., `@architect design this API`)
|
|
17
|
+
3. **Automatic Routing**: StringRay automatically routes tasks to the appropriate agent based on complexity
|
|
18
|
+
4. **Agent Modes**: Agents can be `primary` (main coordinator) or `subagent` (specialized helper)
|
|
19
|
+
|
|
20
|
+
### Where to Find Reflections
|
|
21
|
+
|
|
22
|
+
Deep reflection documents capture development journeys and lessons learned:
|
|
23
|
+
- **Location**: `docs/reflections/` (main) and `docs/deep-reflections/` (detailed)
|
|
24
|
+
- **Examples**: `kernel-v2.0-skill-system-fix-journey.md`, `typescript-build-fix-journey-2026-03-09.md`, `stringray-framework-deep-reflection-v1.4.21.md`
|
|
25
|
+
|
|
26
|
+
These documents capture:
|
|
27
|
+
- Technical challenges encountered and solved
|
|
28
|
+
- Architectural decisions made
|
|
29
|
+
- Lessons learned for future development
|
|
30
|
+
- Best practices established
|
|
31
|
+
|
|
32
|
+
### File Organization Guidelines
|
|
33
|
+
|
|
34
|
+
**IMPORTANT**: Save all generated files to their proper directories. Do NOT save to root.
|
|
35
|
+
|
|
36
|
+
| File Type | Save To | Example |
|
|
37
|
+
|-----------|---------|---------|
|
|
38
|
+
| **Reflections** | `docs/reflections/` or `docs/deep-reflections/` | `docs/reflections/my-fix-reflection.md` |
|
|
39
|
+
| **Logs** | `logs/` | `logs/framework/activity.log` |
|
|
40
|
+
| **Scripts** | `scripts/` or `scripts/bash/` | `scripts/bash/my-script.sh` |
|
|
41
|
+
| **Test Files** | `src/__tests__/` | `src/__tests__/unit/my-test.test.ts` |
|
|
42
|
+
| **Source Code** | `src/` | `src/my-module.ts` |
|
|
43
|
+
| **Config** | `config/` or `.opencode/strray/` | `.opencode/strray/config.json` |
|
|
44
|
+
|
|
45
|
+
**Never save to root** - Root directory is for essential files only:
|
|
46
|
+
- `README.md`, `CHANGELOG.md`, `package.json`, `tsconfig.json`
|
|
47
|
+
|
|
48
|
+
### Logging Guidelines
|
|
49
|
+
|
|
50
|
+
**IMPORTANT**: Never use `console.log`, `console.warn`, or `console.error`. Use the framework logger instead.
|
|
51
|
+
|
|
52
|
+
| Use This | Not This |
|
|
53
|
+
|----------|-----------|
|
|
54
|
+
| `frameworkLogger.log(module, event, 'info', { data })` | `console.log()` |
|
|
55
|
+
| `frameworkLogger.log(module, event, 'error', { error })` | `console.error()` |
|
|
56
|
+
| `frameworkLogger.log(module, event, 'warning', { warning })` | `console.warn()` |
|
|
57
|
+
|
|
58
|
+
**Why**: Console statements bleed through to OpenCode console and create noise. Framework logger is structured and filtered.
|
|
59
|
+
|
|
60
|
+
**Example**:
|
|
61
|
+
```typescript
|
|
62
|
+
// WRONG ❌
|
|
63
|
+
console.log("Starting process");
|
|
64
|
+
|
|
65
|
+
// CORRECT ✅
|
|
66
|
+
import { frameworkLogger } from "../core/framework-logger.js";
|
|
67
|
+
frameworkLogger.log("my-module", "process-start", "info", { message: "Starting process" });
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Reflection Template Paths
|
|
71
|
+
|
|
72
|
+
StringRay uses **two reflection folders** for different purposes:
|
|
73
|
+
|
|
74
|
+
#### Option 1: Standard Reflections (`docs/reflections/`)
|
|
75
|
+
**When to use:** Single-session work, specific bug fixes, targeted implementations
|
|
76
|
+
- **Template:** `docs/reflections/TEMPLATE.md` (442 lines)
|
|
77
|
+
- **Naming:** `{topic}-reflection.md` or `{topic}-YYYY-MM-DD.md`
|
|
78
|
+
- **Length:** 1,000-5,000 lines
|
|
79
|
+
- **Format:** 11 structured sections (Executive Summary, Dichotomy, Counterfactual, etc.)
|
|
80
|
+
|
|
81
|
+
**Examples:**
|
|
82
|
+
- `docs/reflections/deployment-crisis-v12x-reflection.md`
|
|
83
|
+
- `docs/reflections/kernel-confidence-fix.md`
|
|
84
|
+
|
|
85
|
+
#### Option 2: Deep Reflections (`docs/deep-reflections/`)
|
|
86
|
+
**When to use:** Multi-session journeys, complex investigations, architectural transformations
|
|
87
|
+
- **Template:** `docs/deep-reflections/TEMPLATE.md` (NEW - 300 lines)
|
|
88
|
+
- **Naming:** `{topic}-journey-YYYY-MM-DD.md` or `DEEP_REFLECTION_{topic}.md`
|
|
89
|
+
- **Length:** 10,000+ lines
|
|
90
|
+
- **Format:** Narrative journey with session chronology, investigation narrative, technical deep dives
|
|
91
|
+
|
|
92
|
+
**Examples:**
|
|
93
|
+
- `docs/deep-reflections/kernel-journey-2026-03-09.md`
|
|
94
|
+
- `docs/deep-reflections/AGENTS-consumer-documentation-strategy-journey-2026-03-09.md`
|
|
95
|
+
|
|
96
|
+
#### Quick Decision Guide
|
|
97
|
+
|
|
98
|
+
| Scenario | Use |
|
|
99
|
+
|----------|------|
|
|
100
|
+
| Fixed a bug in one session | `docs/reflections/` |
|
|
101
|
+
| Investigated something complex over multiple days | `docs/deep-reflections/` |
|
|
102
|
+
| Single architectural change | `docs/reflections/` |
|
|
103
|
+
| System-wide transformation | `docs/deep-reflections/` |
|
|
104
|
+
| Quick learning/insight | `docs/reflections/` |
|
|
105
|
+
| Deep investigation with many discoveries | `docs/deep-reflections/` |
|
|
106
|
+
|
|
107
|
+
## Available Agents
|
|
108
|
+
|
|
109
|
+
| Agent | Purpose | Invoke |
|
|
110
|
+
|-------|---------|--------|
|
|
111
|
+
| `@enforcer` | Codex compliance & error prevention | `@enforcer analyze this code` |
|
|
112
|
+
| `@orchestrator` | Complex multi-step task coordination | `@orchestrator implement feature` |
|
|
113
|
+
| `@architect` | System design & technical decisions | `@architect design API` |
|
|
114
|
+
| `@security-auditor` | Vulnerability detection | `@security-auditor scan` |
|
|
115
|
+
| `@code-reviewer` | Quality assessment | `@code-reviewer review PR` |
|
|
116
|
+
| `@refactorer` | Technical debt elimination | `@refactorer optimize code` |
|
|
117
|
+
| `@testing-lead` | Testing strategy | `@testing-lead plan tests` |
|
|
118
|
+
| `@bug-triage-specialist` | Error investigation | `@bug-triage-specialist debug error` |
|
|
119
|
+
| `@researcher` | Codebase exploration | `@researcher find implementation` |
|
|
120
|
+
|
|
121
|
+
## Complexity Routing
|
|
122
|
+
|
|
123
|
+
StringRay automatically routes tasks based on complexity:
|
|
124
|
+
|
|
125
|
+
- **Simple (≤20)**: Single agent
|
|
126
|
+
- **Moderate (21-35)**: Single agent with tools
|
|
127
|
+
- **Complex (36-75)**: Multi-agent coordination
|
|
128
|
+
- **Enterprise (>75)**: Orchestrator-led team
|
|
129
|
+
|
|
130
|
+
## CLI Commands
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npx strray-ai install # Install and configure
|
|
134
|
+
npx strray-ai status # Check configuration
|
|
135
|
+
npx strray-ai health # Health check
|
|
136
|
+
npx strray-ai validate # Validate installation
|
|
137
|
+
npx strray-ai capabilities # Show all features
|
|
138
|
+
npx strray-ai report # Generate reports
|
|
139
|
+
npx strray-ai analytics # Pattern analytics
|
|
140
|
+
npx strray-ai calibrate # Calibrate complexity
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Features.json Configuration
|
|
144
|
+
|
|
145
|
+
StringRay uses `.opencode/strray/features.json` for feature flags and settings:
|
|
146
|
+
|
|
147
|
+
### Location
|
|
148
|
+
- **Path**: `.opencode/strray/features.json`
|
|
149
|
+
- **Consumer Path**: When installed as npm package, loaded from `node_modules/strray-ai/.opencode/strray/features.json`
|
|
150
|
+
|
|
151
|
+
### Key Features
|
|
152
|
+
- `token_optimization` - Context token management
|
|
153
|
+
- `model_routing` - AI model routing
|
|
154
|
+
- `batch_operations` - File batch processing
|
|
155
|
+
- `multi_agent_orchestration` - Agent coordination
|
|
156
|
+
- `autonomous_reporting` - Automatic reporting
|
|
157
|
+
- `activity_logging` - Activity logging configuration
|
|
158
|
+
- `security` - Security settings
|
|
159
|
+
- `performance_monitoring` - Performance tracking
|
|
160
|
+
|
|
161
|
+
### Modifying Features
|
|
162
|
+
To modify features in consumer installations:
|
|
163
|
+
```bash
|
|
164
|
+
# View current features
|
|
165
|
+
cat .opencode/strray/features.json
|
|
166
|
+
|
|
167
|
+
# Set feature via CLI
|
|
168
|
+
npx strray-ai config set --feature token_optimization.enabled --value false
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Agent Discovery & Capabilities
|
|
172
|
+
|
|
173
|
+
### First-Time Agent Context
|
|
174
|
+
|
|
175
|
+
When agents are first spawned:
|
|
176
|
+
- **Zero Context**: Agents start with minimal initial context
|
|
177
|
+
- **Discovery Happens**: Agents discover available tools through MCP servers
|
|
178
|
+
- **State Builds**: Over time, agents build comprehensive knowledge graph
|
|
179
|
+
|
|
180
|
+
### Static vs Dynamic Discovery
|
|
181
|
+
|
|
182
|
+
**Static Discovery** (Immediate):
|
|
183
|
+
- Source: `.opencode/agents/` directory
|
|
184
|
+
- Speed: Fast - scans local directory
|
|
185
|
+
- Scope: Only locally configured agents
|
|
186
|
+
|
|
187
|
+
**Dynamic Discovery** (After Startup):
|
|
188
|
+
- Source: MCP Protocol via `mcp-client.ts`
|
|
189
|
+
- Process: Loads config → Connects to servers → Lists tools → Makes available
|
|
190
|
+
- Scope: Full agent capabilities with MCP server tools
|
|
191
|
+
|
|
192
|
+
### Access & Permissions Pipeline
|
|
193
|
+
|
|
194
|
+
**Load Priority**:
|
|
195
|
+
1. Development: `node_modules/strray-ai/dist/` (most current)
|
|
196
|
+
2. Consumer: Falls back to `dist/` directory
|
|
197
|
+
3. Configuration: `.opencode/strray/features.json`
|
|
198
|
+
|
|
199
|
+
**Spawn Authorization**:
|
|
200
|
+
- Only main orchestrator can spawn agents
|
|
201
|
+
- Subagents cannot spawn other agents
|
|
202
|
+
- Workers cannot spawn agents directly
|
|
203
|
+
|
|
204
|
+
## Activity Log & Reporting
|
|
205
|
+
|
|
206
|
+
### Activity Logging
|
|
207
|
+
|
|
208
|
+
**Location**: `.opencode/logs/` directory
|
|
209
|
+
- **File Format**: `strray-plugin-YYYY-MM-DD.log`
|
|
210
|
+
- **Enabled by**: `activity_logging` feature in features.json
|
|
211
|
+
|
|
212
|
+
### Report Generation
|
|
213
|
+
|
|
214
|
+
**CLI Command**:
|
|
215
|
+
```bash
|
|
216
|
+
# Generate daily report
|
|
217
|
+
npx strray-ai report --daily
|
|
218
|
+
|
|
219
|
+
# Generate performance report
|
|
220
|
+
npx strray-ai report --performance
|
|
221
|
+
|
|
222
|
+
# Generate compliance report
|
|
223
|
+
npx strray-ai report --compliance
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Report Types**:
|
|
227
|
+
- Daily reports: Agent invocations, task completions
|
|
228
|
+
- Performance reports: Response times, resource usage
|
|
229
|
+
- Compliance reports: Codex violations, agent performance
|
|
230
|
+
|
|
231
|
+
## Skill Scripts & Agent Registry
|
|
232
|
+
|
|
233
|
+
### Agent Registry
|
|
234
|
+
|
|
235
|
+
**Location**: `scripts/node/agent-registry.js`
|
|
236
|
+
- **Purpose**: Register new custom agents
|
|
237
|
+
- **Usage**: Add to `.opencode/agents/` and auto-discovered
|
|
238
|
+
|
|
239
|
+
### Custom Skills
|
|
240
|
+
|
|
241
|
+
**Adding Custom Agents**:
|
|
242
|
+
1. Create skill file in `.opencode/agents/`
|
|
243
|
+
2. Export handler function
|
|
244
|
+
3. Auto-available to agents
|
|
245
|
+
|
|
246
|
+
**Example**:
|
|
247
|
+
```javascript
|
|
248
|
+
// .opencode/agents/my-custom-skill.js
|
|
249
|
+
module.exports = async (context, tool) => {
|
|
250
|
+
return { result: "Skill executed", data: {} };
|
|
251
|
+
};
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## Codex
|
|
255
|
+
|
|
256
|
+
StringRay enforces Universal Development Codex (60 terms) for systematic error prevention. See [.opencode/strray/codex.json](https://github.com/htafolla/stringray/blob/master/.opencode/strray/codex.json) for full reference.
|
|
257
|
+
|
|
258
|
+
## Configuration Files Reference
|
|
259
|
+
|
|
260
|
+
StringRay uses multiple configuration files to control behavior:
|
|
261
|
+
|
|
262
|
+
### Main Configuration Files
|
|
263
|
+
|
|
264
|
+
| File | Purpose | Key Settings |
|
|
265
|
+
|------|---------|--------------|
|
|
266
|
+
| `.opencode/opencode.json` | Main framework config | mode, plugins, paths |
|
|
267
|
+
| `.opencode/strray/features.json` | Feature flags | enabled/disabled features |
|
|
268
|
+
| `.opencode/agents/` | Custom agent configs | agent-specific settings |
|
|
269
|
+
| `.opencode/strray/codex.json` | Codex terms | 60 error prevention rules |
|
|
270
|
+
|
|
271
|
+
### Configuration Hierarchy
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
1. .opencode/opencode.json # Highest priority - project overrides
|
|
275
|
+
2. .opencode/strray/features.json # Feature flags
|
|
276
|
+
3. node_modules/strray-ai/.opencode/ # Package defaults (lowest)
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Environment Variables
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Optional overrides
|
|
283
|
+
STRRAY_MODE=development # or 'consumer'
|
|
284
|
+
STRRAY_LOG_LEVEL=info # debug, info, warn, error
|
|
285
|
+
STRRAY_CONFIG_PATH=.opencode/ # Custom config directory
|
|
286
|
+
STRRAY_NO_TELEMETRY=1 # Disable analytics
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Integration Points
|
|
290
|
+
|
|
291
|
+
### Git Hooks Integration
|
|
292
|
+
|
|
293
|
+
StringRay integrates with Git hooks for automated validation:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
# Install Git hooks
|
|
297
|
+
npx strray-ai install --hooks
|
|
298
|
+
|
|
299
|
+
# Hooks available:
|
|
300
|
+
# - pre-commit: TypeScript check, linting, Codex validation
|
|
301
|
+
# - post-commit: Activity logging, analytics
|
|
302
|
+
# - pre-push: Full validation suite
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Manual Hook Setup** (if not using --hooks):
|
|
306
|
+
```bash
|
|
307
|
+
# .git/hooks/pre-commit
|
|
308
|
+
#!/bin/bash
|
|
309
|
+
npx strray-ai validate --pre-commit
|
|
310
|
+
|
|
311
|
+
# .git/hooks/post-commit
|
|
312
|
+
#!/bin/bash
|
|
313
|
+
npx strray-ai report --auto
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### CI/CD Pipeline Integration
|
|
317
|
+
|
|
318
|
+
**GitHub Actions Example**:
|
|
319
|
+
```yaml
|
|
320
|
+
- name: StringRay Validation
|
|
321
|
+
run: |
|
|
322
|
+
npx strray-ai validate
|
|
323
|
+
npx strray-ai report --ci
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
**GitLab CI Example**:
|
|
327
|
+
```yaml
|
|
328
|
+
strray-validate:
|
|
329
|
+
script:
|
|
330
|
+
- npx strray-ai validate
|
|
331
|
+
- npx strray-ai report --ci
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### MCP Server Configuration
|
|
335
|
+
|
|
336
|
+
MCP (Model Context Protocol) servers extend agent capabilities:
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
# List available MCP servers
|
|
340
|
+
npx strray-ai capabilities --mcp
|
|
341
|
+
|
|
342
|
+
# MCP server types:
|
|
343
|
+
# - knowledge-skills/ # Domain-specific skills
|
|
344
|
+
# - framework-help.server.ts # Framework utilities
|
|
345
|
+
# - orchestrator.server.ts # Task orchestration
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Marketplace Plugin Installation
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
# Search for plugins
|
|
352
|
+
npx strray-ai marketplace search <keyword>
|
|
353
|
+
|
|
354
|
+
# Install plugin
|
|
355
|
+
npx strray-ai marketplace install <plugin-name>
|
|
356
|
+
|
|
357
|
+
# List installed plugins
|
|
358
|
+
npx strray-ai marketplace list
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
## Tuning & Optimization
|
|
362
|
+
|
|
363
|
+
### Complexity Calibration
|
|
364
|
+
|
|
365
|
+
StringRay uses complexity scoring to route tasks to appropriate agents:
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
# Calibrate complexity scoring
|
|
369
|
+
npx strray-ai calibrate
|
|
370
|
+
|
|
371
|
+
# View current complexity settings
|
|
372
|
+
cat .opencode/strray/features.json | jq '.complexity'
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
**Complexity Factors**:
|
|
376
|
+
- File count and size
|
|
377
|
+
- Import dependencies
|
|
378
|
+
- Test coverage percentage
|
|
379
|
+
- Code duplication
|
|
380
|
+
- Architectural patterns
|
|
381
|
+
|
|
382
|
+
### Performance Tuning
|
|
383
|
+
|
|
384
|
+
**Memory Management**:
|
|
385
|
+
```bash
|
|
386
|
+
# View memory settings
|
|
387
|
+
cat .opencode/strray/features.json | jq '.memory'
|
|
388
|
+
|
|
389
|
+
# Key settings:
|
|
390
|
+
# - memory_threshold_mb: Emergency cleanup trigger (default: 80MB)
|
|
391
|
+
# - gc_interval_ms: Garbage collection frequency
|
|
392
|
+
# - cache_size: Agent state cache limit
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
**Token Optimization**:
|
|
396
|
+
```bash
|
|
397
|
+
# Configure token limits
|
|
398
|
+
npx strray-ai config set --feature token_optimization.max_context_tokens --value 8000
|
|
399
|
+
npx strray-ai config set --feature token_optimization.compression_enabled --value true
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### Agent Spawn Limits
|
|
403
|
+
|
|
404
|
+
Control how agents are spawned and coordinated:
|
|
405
|
+
|
|
406
|
+
```json
|
|
407
|
+
// In features.json
|
|
408
|
+
{
|
|
409
|
+
"agent_spawn": {
|
|
410
|
+
"max_concurrent": 8,
|
|
411
|
+
"max_per_type": 3,
|
|
412
|
+
"spawn_cooldown_ms": 500,
|
|
413
|
+
"rate_limit_per_minute": 20
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
## CLI Command Details
|
|
419
|
+
|
|
420
|
+
### Core Commands
|
|
421
|
+
|
|
422
|
+
| Command | Description | Common Use |
|
|
423
|
+
|---------|-------------|------------|
|
|
424
|
+
| `npx strray-ai install` | Install and configure framework | Initial setup |
|
|
425
|
+
| `npx strray-ai status` | Show current configuration status | Debug setup issues |
|
|
426
|
+
| `npx strray-ai health` | Run health check | Verify installation |
|
|
427
|
+
| `npx strray-ai validate` | Run full validation suite | Pre-commit validation |
|
|
428
|
+
| `npx strray-ai capabilities` | List all available features | Discover capabilities |
|
|
429
|
+
| `npx strray-ai calibrate` | Recalibrate complexity scoring | After major refactors |
|
|
430
|
+
| `npx strray-ai report` | Generate analytics reports | Review performance |
|
|
431
|
+
| `npx strray-ai analytics` | View pattern analytics | Understand agent behavior |
|
|
432
|
+
| `npx strray-ai config` | Manage configuration | Tune settings |
|
|
433
|
+
|
|
434
|
+
### Configuration Commands
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
# Get a specific config value
|
|
438
|
+
npx strray-ai config get --feature activity_logging.enabled
|
|
439
|
+
|
|
440
|
+
# Set a config value
|
|
441
|
+
npx strray-ai config set --feature token_optimization.enabled --value false
|
|
442
|
+
|
|
443
|
+
# Reset to defaults
|
|
444
|
+
npx strray-ai config reset
|
|
445
|
+
|
|
446
|
+
# Export current config
|
|
447
|
+
npx strray-ai config export > strray-config.json
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### Report Commands
|
|
451
|
+
|
|
452
|
+
```bash
|
|
453
|
+
# Daily summary report
|
|
454
|
+
npx strray-ai report --daily
|
|
455
|
+
|
|
456
|
+
# Performance analysis
|
|
457
|
+
npx strray-ai report --performance
|
|
458
|
+
|
|
459
|
+
# Compliance report (Codex violations)
|
|
460
|
+
npx strray-ai report --compliance
|
|
461
|
+
|
|
462
|
+
# Session report
|
|
463
|
+
npx strray-ai report --session
|
|
464
|
+
|
|
465
|
+
# Generate CI-friendly report
|
|
466
|
+
npx strray-ai report --ci --output json
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
## Common Agent Workflows
|
|
470
|
+
|
|
471
|
+
### Invoking Agents
|
|
472
|
+
|
|
473
|
+
**Basic Invocation**:
|
|
474
|
+
```bash
|
|
475
|
+
# In code comment or prompt
|
|
476
|
+
@architect design a REST API for user management
|
|
477
|
+
|
|
478
|
+
@enforcer analyze this code for security issues
|
|
479
|
+
|
|
480
|
+
@testing-lead create tests for authentication module
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
**Chaining Agents**:
|
|
484
|
+
```
|
|
485
|
+
@orchestrator implement feature:user-authentication
|
|
486
|
+
→ Spawns @architect → @testing-lead → @code-reviewer
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
### Agent Selection Guide
|
|
490
|
+
|
|
491
|
+
| Task Type | Primary Agent | Supporting Agents |
|
|
492
|
+
|-----------|---------------|-------------------|
|
|
493
|
+
| New feature | @orchestrator | @architect, @testing-lead |
|
|
494
|
+
| Bug fix | @bug-triage-specialist | @enforcer, @code-reviewer |
|
|
495
|
+
| Refactor | @refactorer | @architect, @testing-lead |
|
|
496
|
+
| Security audit | @security-auditor | @enforcer |
|
|
497
|
+
| Code review | @code-reviewer | @enforcer |
|
|
498
|
+
| Research | @researcher | @architect |
|
|
499
|
+
|
|
500
|
+
### Session Management
|
|
501
|
+
|
|
502
|
+
**Start a Session**:
|
|
503
|
+
```bash
|
|
504
|
+
# Sessions are automatic - invoke agent to start
|
|
505
|
+
@orchestrator implement login feature
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
**View Active Sessions**:
|
|
509
|
+
```bash
|
|
510
|
+
# Active sessions shown in status
|
|
511
|
+
npx strray-ai status
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
**End a Session**:
|
|
515
|
+
```bash
|
|
516
|
+
# Sessions auto-end after inactivity timeout
|
|
517
|
+
# Or manually via:
|
|
518
|
+
npx strray-ai session end <session-id>
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
### Error Recovery
|
|
522
|
+
|
|
523
|
+
**Common Error Patterns**:
|
|
524
|
+
|
|
525
|
+
1. **Agent Spawn Failure**
|
|
526
|
+
```bash
|
|
527
|
+
# Check spawn limits
|
|
528
|
+
npx strray-ai status | grep -A5 "spawn"
|
|
529
|
+
|
|
530
|
+
# Solution: Wait for cooldown or increase limit
|
|
531
|
+
npx strray-ai config set --feature agent_spawn.max_concurrent --value 10
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
2. **Memory Exhaustion**
|
|
535
|
+
```bash
|
|
536
|
+
# Check memory settings
|
|
537
|
+
npx strray-ai health
|
|
538
|
+
|
|
539
|
+
# Solution: Clear cache
|
|
540
|
+
npx strray-ai session clear-cache
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
3. **Validation Failures**
|
|
544
|
+
```bash
|
|
545
|
+
# Run detailed validation
|
|
546
|
+
npx strray-ai validate --detailed
|
|
547
|
+
|
|
548
|
+
# View specific failures
|
|
549
|
+
npx strray-ai report --compliance --detailed
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
## Troubleshooting Guide
|
|
553
|
+
|
|
554
|
+
### Quick Diagnostics
|
|
555
|
+
|
|
556
|
+
```bash
|
|
557
|
+
# Full health check
|
|
558
|
+
npx strray-ai health
|
|
559
|
+
|
|
560
|
+
# Validate installation
|
|
561
|
+
npx strray-ai validate
|
|
562
|
+
|
|
563
|
+
# View recent activity
|
|
564
|
+
ls -la .opencode/logs/
|
|
565
|
+
cat .opencode/logs/strray-plugin-$(date +%Y-%m-%d).log | tail -50
|
|
566
|
+
|
|
567
|
+
# Check configuration
|
|
568
|
+
npx strray-ai status
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
### Common Issues
|
|
572
|
+
|
|
573
|
+
| Issue | Symptom | Solution |
|
|
574
|
+
|-------|---------|----------|
|
|
575
|
+
| Agents not spawning | Timeout on @invoke | Run `npx strray-ai health` |
|
|
576
|
+
| Validation failures | Pre-commit blocks | Run `npx strray-ai validate --fix` |
|
|
577
|
+
| Memory issues | Slow performance | `npx strray-ai session clear-cache` |
|
|
578
|
+
| Config not loading | Settings ignored | Check `.opencode/opencode.json` syntax |
|
|
579
|
+
| MCP servers unavailable | Tools missing | `npx strray-ai capabilities --mcp` |
|
|
580
|
+
|
|
581
|
+
### Getting Help
|
|
582
|
+
|
|
583
|
+
```bash
|
|
584
|
+
# Framework help
|
|
585
|
+
npx strray-ai help
|
|
586
|
+
|
|
587
|
+
# View capabilities
|
|
588
|
+
npx strray-ai capabilities
|
|
589
|
+
|
|
590
|
+
# Check version
|
|
591
|
+
npx strray-ai --version
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
## Framework Configuration Limits
|
|
595
|
+
|
|
596
|
+
### Consumer Environment Limitations
|
|
597
|
+
|
|
598
|
+
- **Features.json**: Automatically loaded from package, not project root
|
|
599
|
+
- **Codex Version**: Frozen at v1.7.5 in consumer mode (stable)
|
|
600
|
+
- **Plugin Behavior**: Reduced functionality in consumer mode:
|
|
601
|
+
- No dynamic codex term enrichment
|
|
602
|
+
- Fixed codex version
|
|
603
|
+
- No MCP server discovery
|
|
604
|
+
- No real-time tool discovery
|
|
605
|
+
|
|
606
|
+
### Development vs Consumer
|
|
607
|
+
|
|
608
|
+
| Aspect | Development | Consumer |
|
|
609
|
+
|--------|-----------|----------|
|
|
610
|
+
| Features | Full (latest) | Optimized (stable) |
|
|
611
|
+
| Codex | Latest terms | v1.7.5 fallback |
|
|
612
|
+
| Discovery | Dynamic (MCP) | Static only |
|
|
613
|
+
| Hot Reload | Yes | No |
|
|
614
|
+
|
|
615
|
+
## Documentation
|
|
616
|
+
|
|
617
|
+
- [Full Documentation](https://github.com/htafolla/stringray)
|
|
618
|
+
- [Configuration Guide](https://github.com/htafolla/stringray/blob/master/docs/CONFIGURATION.md)
|
|
619
|
+
- [Troubleshooting](https://github.com/htafolla/stringray/blob/master/docs/TROUBLESHOOTING.md)
|
|
620
|
+
|
|
621
|
+
---
|
|
622
|
+
**Version**: 1.7.8 | [GitHub](https://github.com/htafolla/stringray)
|
package/.opencode/init.sh
CHANGED
|
@@ -20,7 +20,8 @@ else
|
|
|
20
20
|
fi
|
|
21
21
|
|
|
22
22
|
# StringRay Framework Version - read dynamically from framework's package.json
|
|
23
|
-
|
|
23
|
+
# Fallback to default version if loading fails
|
|
24
|
+
STRRAY_VERSION=$(node -e "try { console.log(require('$FRAMEWORK_ROOT/package.json').version) } catch(e) { console.log('1.7.8') }" 2>/dev/null || echo "1.7.8")
|
|
24
25
|
|
|
25
26
|
START_TIME=$(date +%s)
|
|
26
27
|
|
|
@@ -100,5 +100,21 @@
|
|
|
100
100
|
"search_result_cache": true,
|
|
101
101
|
"cache_ttl_seconds": 60,
|
|
102
102
|
"max_cache_size_mb": 25
|
|
103
|
+
},
|
|
104
|
+
"agent_spawn": {
|
|
105
|
+
"max_concurrent": 8,
|
|
106
|
+
"max_per_type": 3,
|
|
107
|
+
"spawn_cooldown_ms": 500,
|
|
108
|
+
"rate_limit_per_minute": 20
|
|
109
|
+
},
|
|
110
|
+
"delegation": {
|
|
111
|
+
"confidence_threshold": 0.50,
|
|
112
|
+
"enable_intelligent_routing": true
|
|
113
|
+
},
|
|
114
|
+
"complexity_thresholds": {
|
|
115
|
+
"simple": 15,
|
|
116
|
+
"moderate": 25,
|
|
117
|
+
"complex": 50,
|
|
118
|
+
"enterprise": 100
|
|
103
119
|
}
|
|
104
120
|
}
|