clawpowers 2.2.5 → 2.2.7
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/CHANGELOG.md +186 -160
- package/COMPATIBILITY.md +48 -13
- package/KNOWN_LIMITATIONS.md +20 -19
- package/LICENSE +44 -44
- package/LICENSING.md +10 -10
- package/README.md +486 -462
- package/SECURITY.md +52 -52
- package/dist/index.d.ts +17 -5
- package/dist/index.js +187 -92
- package/dist/index.js.map +1 -1
- package/native/Cargo.lock +4927 -4927
- package/native/Cargo.toml +73 -73
- package/native/crates/canonical/Cargo.toml +24 -24
- package/native/crates/canonical/src/lib.rs +677 -673
- package/native/crates/compression/Cargo.toml +20 -20
- package/native/crates/compression/benches/compression_bench.rs +42 -42
- package/native/crates/compression/src/lib.rs +393 -393
- package/native/crates/evm-eth/Cargo.toml +13 -13
- package/native/crates/evm-eth/src/lib.rs +105 -105
- package/native/crates/fee/Cargo.toml +15 -15
- package/native/crates/fee/src/lib.rs +281 -281
- package/native/crates/index/Cargo.toml +16 -16
- package/native/crates/index/src/lib.rs +277 -277
- package/native/crates/policy/Cargo.toml +17 -17
- package/native/crates/policy/src/lib.rs +614 -614
- package/native/crates/security/Cargo.toml +22 -22
- package/native/crates/security/src/lib.rs +478 -478
- package/native/crates/tokens/Cargo.toml +13 -13
- package/native/crates/tokens/src/lib.rs +534 -534
- package/native/crates/verification/Cargo.toml +23 -23
- package/native/crates/verification/src/lib.rs +333 -333
- package/native/crates/wallet/Cargo.toml +20 -20
- package/native/crates/wallet/src/lib.rs +261 -261
- package/native/crates/x402/Cargo.toml +30 -30
- package/native/crates/x402/src/lib.rs +423 -423
- package/native/ffi/Cargo.toml +34 -34
- package/native/ffi/build.rs +4 -4
- package/native/ffi/src/lib.rs +352 -352
- package/native/ffi/tests/integration.rs +354 -354
- package/native/pyo3/Cargo.toml +26 -26
- package/native/pyo3/pyproject.toml +16 -16
- package/native/pyo3/src/lib.rs +407 -407
- package/native/pyo3/tests/test_smoke.py +180 -180
- package/native/wasm/Cargo.toml +47 -44
- package/native/wasm/pkg/.gitignore +6 -6
- package/native/wasm/pkg/clawpowers_wasm.d.ts +208 -208
- package/native/wasm/pkg/clawpowers_wasm.js +872 -872
- package/native/wasm/pkg/clawpowers_wasm_bg.wasm.d.ts +40 -40
- package/native/wasm/pkg/package.json +16 -16
- package/native/wasm/pkg-node/clawpowers_wasm.d.ts +143 -143
- package/native/wasm/pkg-node/clawpowers_wasm.js +798 -798
- package/native/wasm/pkg-node/clawpowers_wasm_bg.wasm.d.ts +40 -40
- package/native/wasm/pkg-node/package.json +12 -12
- package/native/wasm/src/lib.rs +433 -433
- package/package.json +13 -8
- package/scripts/build-wasm.mjs +59 -0
- package/scripts/generate_hermes_wrappers.py +211 -0
- package/scripts/hermes_wrapper_overrides.json +184 -0
- package/scripts/run-python-script.mjs +48 -0
- package/scripts/verify-consumer-install.mjs +109 -0
- package/scripts/verify-wasm-artifacts.mjs +26 -3
- package/scripts/verify_hermes_wrappers.py +154 -0
- package/skill.json +20 -0
- package/skills/1password/SKILL.md +34 -0
- package/skills/README.md +44 -0
- package/skills/agent-nexus-2/SKILL.md +34 -0
- package/skills/apple-notes/SKILL.md +34 -0
- package/skills/apple-reminders/SKILL.md +34 -0
- package/skills/autoresearch/SKILL.md +43 -0
- package/skills/bear-notes/SKILL.md +34 -0
- package/skills/blogwatcher/SKILL.md +34 -0
- package/skills/blucli/SKILL.md +34 -0
- package/skills/bluebubbles/SKILL.md +34 -0
- package/skills/business-strategy/SKILL.md +41 -0
- package/skills/camsnap/SKILL.md +34 -0
- package/skills/canvas/SKILL.md +34 -0
- package/skills/clawhub/SKILL.md +34 -0
- package/skills/coding-agent/SKILL.md +34 -0
- package/skills/coding-discipline.skill/SKILL.md +34 -0
- package/skills/content-writer/SKILL.md +41 -0
- package/skills/discord/SKILL.md +34 -0
- package/skills/eightctl/SKILL.md +34 -0
- package/skills/execution-validation.skill/SKILL.md +34 -0
- package/skills/gemini/SKILL.md +34 -0
- package/skills/gh-issues/SKILL.md +34 -0
- package/skills/gifgrep/SKILL.md +34 -0
- package/skills/github/SKILL.md +41 -0
- package/skills/gog/SKILL.md +34 -0
- package/skills/goplaces/SKILL.md +34 -0
- package/skills/healthcheck/SKILL.md +34 -0
- package/skills/himalaya/SKILL.md +34 -0
- package/skills/humanize/SKILL.md +41 -0
- package/skills/imsg/SKILL.md +34 -0
- package/skills/itp/SKILL.md +112 -0
- package/skills/mcporter/SKILL.md +34 -0
- package/skills/model-usage/SKILL.md +34 -0
- package/skills/nano-pdf/SKILL.md +34 -0
- package/skills/node-connect/SKILL.md +34 -0
- package/skills/notion/SKILL.md +34 -0
- package/skills/obsidian/SKILL.md +34 -0
- package/skills/openai-whisper/SKILL.md +34 -0
- package/skills/openai-whisper-api/SKILL.md +34 -0
- package/skills/openhue/SKILL.md +34 -0
- package/skills/oracle/SKILL.md +34 -0
- package/skills/ordercli/SKILL.md +34 -0
- package/skills/peekaboo/SKILL.md +34 -0
- package/skills/polyclaw/SKILL.md +34 -0
- package/skills/prospector/SKILL.md +41 -0
- package/skills/rsi.skill/SKILL.md +34 -0
- package/skills/sag/SKILL.md +34 -0
- package/skills/security/SKILL.md +41 -0
- package/skills/session-logs/SKILL.md +34 -0
- package/skills/sherpa-onnx-tts/SKILL.md +34 -0
- package/skills/skill-creator/SKILL.md +34 -0
- package/skills/slack/SKILL.md +34 -0
- package/skills/songsee/SKILL.md +34 -0
- package/skills/sonoscli/SKILL.md +34 -0
- package/skills/spotify-player/SKILL.md +34 -0
- package/skills/strykr-prism/SKILL.md +41 -0
- package/skills/summarize/SKILL.md +34 -0
- package/skills/taskbridge/SKILL.md +34 -0
- package/skills/things-mac/SKILL.md +34 -0
- package/skills/tmux/SKILL.md +34 -0
- package/skills/trello/SKILL.md +34 -0
- package/skills/validator-agent/SKILL.md +41 -0
- package/skills/video-frames/SKILL.md +34 -0
- package/skills/voice-call/SKILL.md +34 -0
- package/skills/wacli/SKILL.md +34 -0
- package/skills/weather/SKILL.md +34 -0
- package/skills/webmcp-payments/SKILL.md +41 -0
- package/skills/xurl/SKILL.md +34 -0
- package/src/skills/catalog.ts +435 -435
- package/src/skills/executor.ts +56 -56
- package/src/skills/index.ts +3 -3
- package/src/skills/itp/SKILL.md +112 -112
- package/src/skills/loader.ts +262 -193
- package/native/ffi/index.node +0 -0
- package/native/wasm/pkg-node/.gitignore +0 -6
package/src/skills/executor.ts
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ClawPowers Skills — Skill Executor
|
|
3
|
-
* Execute skills and track outcomes in procedural memory.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { ProceduralMemory } from '../memory/procedural.js';
|
|
7
|
-
|
|
8
|
-
export interface SkillExecutionContext {
|
|
9
|
-
readonly taskId: string;
|
|
10
|
-
readonly input: string;
|
|
11
|
-
readonly metadata?: Record<string, unknown>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface SkillExecutionResult {
|
|
15
|
-
readonly success: boolean;
|
|
16
|
-
readonly output: string;
|
|
17
|
-
readonly durationMs: number;
|
|
18
|
-
readonly error?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export class SkillExecutor {
|
|
22
|
-
constructor(
|
|
23
|
-
private readonly skillsDir: string,
|
|
24
|
-
private readonly memory: ProceduralMemory
|
|
25
|
-
) {}
|
|
26
|
-
|
|
27
|
-
async execute(skillName: string, context: SkillExecutionContext): Promise<SkillExecutionResult> {
|
|
28
|
-
const start = Date.now();
|
|
29
|
-
try {
|
|
30
|
-
const result: SkillExecutionResult = {
|
|
31
|
-
success: true,
|
|
32
|
-
output: `Skill ${skillName} loaded from ${this.skillsDir}`,
|
|
33
|
-
durationMs: Date.now() - start,
|
|
34
|
-
};
|
|
35
|
-
await this.memory.update(skillName, {
|
|
36
|
-
succeeded: true,
|
|
37
|
-
durationMs: result.durationMs,
|
|
38
|
-
taskId: context.taskId,
|
|
39
|
-
});
|
|
40
|
-
return result;
|
|
41
|
-
} catch (err: unknown) {
|
|
42
|
-
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
43
|
-
await this.memory.update(skillName, {
|
|
44
|
-
succeeded: false,
|
|
45
|
-
durationMs: Date.now() - start,
|
|
46
|
-
taskId: context.taskId,
|
|
47
|
-
});
|
|
48
|
-
return {
|
|
49
|
-
success: false,
|
|
50
|
-
output: '',
|
|
51
|
-
durationMs: Date.now() - start,
|
|
52
|
-
error: errorMessage,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* ClawPowers Skills — Skill Executor
|
|
3
|
+
* Execute skills and track outcomes in procedural memory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ProceduralMemory } from '../memory/procedural.js';
|
|
7
|
+
|
|
8
|
+
export interface SkillExecutionContext {
|
|
9
|
+
readonly taskId: string;
|
|
10
|
+
readonly input: string;
|
|
11
|
+
readonly metadata?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface SkillExecutionResult {
|
|
15
|
+
readonly success: boolean;
|
|
16
|
+
readonly output: string;
|
|
17
|
+
readonly durationMs: number;
|
|
18
|
+
readonly error?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class SkillExecutor {
|
|
22
|
+
constructor(
|
|
23
|
+
private readonly skillsDir: string,
|
|
24
|
+
private readonly memory: ProceduralMemory
|
|
25
|
+
) {}
|
|
26
|
+
|
|
27
|
+
async execute(skillName: string, context: SkillExecutionContext): Promise<SkillExecutionResult> {
|
|
28
|
+
const start = Date.now();
|
|
29
|
+
try {
|
|
30
|
+
const result: SkillExecutionResult = {
|
|
31
|
+
success: true,
|
|
32
|
+
output: `Skill ${skillName} loaded from ${this.skillsDir}`,
|
|
33
|
+
durationMs: Date.now() - start,
|
|
34
|
+
};
|
|
35
|
+
await this.memory.update(skillName, {
|
|
36
|
+
succeeded: true,
|
|
37
|
+
durationMs: result.durationMs,
|
|
38
|
+
taskId: context.taskId,
|
|
39
|
+
});
|
|
40
|
+
return result;
|
|
41
|
+
} catch (err: unknown) {
|
|
42
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
43
|
+
await this.memory.update(skillName, {
|
|
44
|
+
succeeded: false,
|
|
45
|
+
durationMs: Date.now() - start,
|
|
46
|
+
taskId: context.taskId,
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
success: false,
|
|
50
|
+
output: '',
|
|
51
|
+
durationMs: Date.now() - start,
|
|
52
|
+
error: errorMessage,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
package/src/skills/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { discoverSkills, loadSkillManifest, getActiveSkills, parseFrontmatter, listSkillsWithStatus } from './loader.js';
|
|
2
|
-
export { SkillExecutor } from './executor.js';
|
|
3
|
-
export type { SkillExecutionContext, SkillExecutionResult } from './executor.js';
|
|
1
|
+
export { discoverSkills, loadSkillManifest, getActiveSkills, parseFrontmatter, listSkillsWithStatus } from './loader.js';
|
|
2
|
+
export { SkillExecutor } from './executor.js';
|
|
3
|
+
export type { SkillExecutionContext, SkillExecutionResult } from './executor.js';
|
package/src/skills/itp/SKILL.md
CHANGED
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: itp
|
|
3
|
-
description: "Identical Twins Protocol — compressed agent-to-agent messaging for repeated operational language. Use when sending messages between agents."
|
|
4
|
-
metadata:
|
|
5
|
-
openclaw:
|
|
6
|
-
requires:
|
|
7
|
-
bins: [python3]
|
|
8
|
-
env: []
|
|
9
|
-
config: []
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# ITP — Identical Twins Protocol
|
|
13
|
-
|
|
14
|
-
Compressed agent-to-agent messaging protocol that uses a shared codebook of common patterns, operations, and agent shorthand.
|
|
15
|
-
|
|
16
|
-
Current measured performance is workload-dependent. The live v1 corpus benchmark shows **11.9% aggregate token reduction** across 25 messages, with delegation and status traffic compressing best. Separate swarm docs also include **modeled** prompt-cache economics layered on top of those live prompt sizes. Keep those two measurement types distinct.
|
|
17
|
-
|
|
18
|
-
## Quick Start
|
|
19
|
-
|
|
20
|
-
### 1. Start the ITP Server
|
|
21
|
-
|
|
22
|
-
The ITP server runs as a FastAPI service on port 8100:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# Via LaunchAgent (recommended — auto-starts on boot)
|
|
26
|
-
launchctl load ~/Library/LaunchAgents/com.agenteconomy.itp-server.plist
|
|
27
|
-
|
|
28
|
-
# Or manually
|
|
29
|
-
cd /Users/billwilson/.openclaw/workspace/tools/itp
|
|
30
|
-
python3 -m uvicorn itp_server:app --host 127.0.0.1 --port 8100
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### 2. Verify Health
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
curl http://localhost:8100/health
|
|
37
|
-
# → {"status": "ok", "version": "1.0.0", ...}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## API Endpoints
|
|
41
|
-
|
|
42
|
-
### Encode Message
|
|
43
|
-
`POST /tools/encode`
|
|
44
|
-
```json
|
|
45
|
-
{
|
|
46
|
-
"message": "Please analyze the trading performance and provide a status update",
|
|
47
|
-
"source_agent": "max",
|
|
48
|
-
"target_agent": "trading-director"
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
Returns: `{ "encoded": "ITP:...", "was_compressed": true, "savings_pct": 45.2, ... }`
|
|
52
|
-
|
|
53
|
-
### Decode Message
|
|
54
|
-
`POST /tools/decode`
|
|
55
|
-
```json
|
|
56
|
-
{
|
|
57
|
-
"message": "ITP:ANL+TRD/PERF→STS/UPD"
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
Returns: `{ "decoded": "...", "was_itp": true, ... }`
|
|
61
|
-
|
|
62
|
-
### Health Check
|
|
63
|
-
`GET /health`
|
|
64
|
-
Returns: `{ "status": "ok", ... }`
|
|
65
|
-
|
|
66
|
-
### Statistics
|
|
67
|
-
`GET /tools/stats`
|
|
68
|
-
Returns compression analytics and savings metrics.
|
|
69
|
-
|
|
70
|
-
### Codebook
|
|
71
|
-
`GET /tools/codebook`
|
|
72
|
-
Returns current codebook contents and stats.
|
|
73
|
-
|
|
74
|
-
### History
|
|
75
|
-
`GET /tools/history?limit=20`
|
|
76
|
-
Returns recent ITP message history.
|
|
77
|
-
|
|
78
|
-
## TypeScript Client
|
|
79
|
-
|
|
80
|
-
```typescript
|
|
81
|
-
import { encode, decode, healthCheck } from 'clawpowers/itp';
|
|
82
|
-
|
|
83
|
-
// Encode a message (graceful fallback if server is down)
|
|
84
|
-
const result = await encode("Analyze trading performance");
|
|
85
|
-
// { encoded: "ITP:...", wasCompressed: true, savingsPct: 45.2 }
|
|
86
|
-
|
|
87
|
-
// Decode an ITP message
|
|
88
|
-
const decoded = await decode("ITP:ANL+TRD/PERF");
|
|
89
|
-
// { decoded: "Analyze trading performance", wasItp: true }
|
|
90
|
-
|
|
91
|
-
// Check server status
|
|
92
|
-
const alive = await healthCheck();
|
|
93
|
-
// true or false
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Swarm Integration
|
|
97
|
-
|
|
98
|
-
ITP integrates with the Parallel Swarm module to compress task descriptions before fan-out and decode results after collection:
|
|
99
|
-
|
|
100
|
-
```typescript
|
|
101
|
-
import { encodeTaskDescription, decodeSwarmResult } from 'clawpowers/itp/swarm-bridge';
|
|
102
|
-
|
|
103
|
-
// Compress task before sending to sub-agents
|
|
104
|
-
const compressedTask = await encodeTaskDescription(task);
|
|
105
|
-
|
|
106
|
-
// Decode result from sub-agent
|
|
107
|
-
const decodedResult = await decodeSwarmResult(result);
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
## Graceful Degradation
|
|
111
|
-
|
|
112
|
-
All ITP functions fail gracefully — if the ITP server is unreachable, messages pass through unchanged with no errors thrown. This ensures ITP never blocks agent operations.
|
|
1
|
+
---
|
|
2
|
+
name: itp
|
|
3
|
+
description: "Identical Twins Protocol — compressed agent-to-agent messaging for repeated operational language. Use when sending messages between agents."
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
requires:
|
|
7
|
+
bins: [python3]
|
|
8
|
+
env: []
|
|
9
|
+
config: []
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# ITP — Identical Twins Protocol
|
|
13
|
+
|
|
14
|
+
Compressed agent-to-agent messaging protocol that uses a shared codebook of common patterns, operations, and agent shorthand.
|
|
15
|
+
|
|
16
|
+
Current measured performance is workload-dependent. The live v1 corpus benchmark shows **11.9% aggregate token reduction** across 25 messages, with delegation and status traffic compressing best. Separate swarm docs also include **modeled** prompt-cache economics layered on top of those live prompt sizes. Keep those two measurement types distinct.
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
### 1. Start the ITP Server
|
|
21
|
+
|
|
22
|
+
The ITP server runs as a FastAPI service on port 8100:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Via LaunchAgent (recommended — auto-starts on boot)
|
|
26
|
+
launchctl load ~/Library/LaunchAgents/com.agenteconomy.itp-server.plist
|
|
27
|
+
|
|
28
|
+
# Or manually
|
|
29
|
+
cd /Users/billwilson/.openclaw/workspace/tools/itp
|
|
30
|
+
python3 -m uvicorn itp_server:app --host 127.0.0.1 --port 8100
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Verify Health
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
curl http://localhost:8100/health
|
|
37
|
+
# → {"status": "ok", "version": "1.0.0", ...}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## API Endpoints
|
|
41
|
+
|
|
42
|
+
### Encode Message
|
|
43
|
+
`POST /tools/encode`
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"message": "Please analyze the trading performance and provide a status update",
|
|
47
|
+
"source_agent": "max",
|
|
48
|
+
"target_agent": "trading-director"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
Returns: `{ "encoded": "ITP:...", "was_compressed": true, "savings_pct": 45.2, ... }`
|
|
52
|
+
|
|
53
|
+
### Decode Message
|
|
54
|
+
`POST /tools/decode`
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"message": "ITP:ANL+TRD/PERF→STS/UPD"
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
Returns: `{ "decoded": "...", "was_itp": true, ... }`
|
|
61
|
+
|
|
62
|
+
### Health Check
|
|
63
|
+
`GET /health`
|
|
64
|
+
Returns: `{ "status": "ok", ... }`
|
|
65
|
+
|
|
66
|
+
### Statistics
|
|
67
|
+
`GET /tools/stats`
|
|
68
|
+
Returns compression analytics and savings metrics.
|
|
69
|
+
|
|
70
|
+
### Codebook
|
|
71
|
+
`GET /tools/codebook`
|
|
72
|
+
Returns current codebook contents and stats.
|
|
73
|
+
|
|
74
|
+
### History
|
|
75
|
+
`GET /tools/history?limit=20`
|
|
76
|
+
Returns recent ITP message history.
|
|
77
|
+
|
|
78
|
+
## TypeScript Client
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import { encode, decode, healthCheck } from 'clawpowers/itp';
|
|
82
|
+
|
|
83
|
+
// Encode a message (graceful fallback if server is down)
|
|
84
|
+
const result = await encode("Analyze trading performance");
|
|
85
|
+
// { encoded: "ITP:...", wasCompressed: true, savingsPct: 45.2 }
|
|
86
|
+
|
|
87
|
+
// Decode an ITP message
|
|
88
|
+
const decoded = await decode("ITP:ANL+TRD/PERF");
|
|
89
|
+
// { decoded: "Analyze trading performance", wasItp: true }
|
|
90
|
+
|
|
91
|
+
// Check server status
|
|
92
|
+
const alive = await healthCheck();
|
|
93
|
+
// true or false
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Swarm Integration
|
|
97
|
+
|
|
98
|
+
ITP integrates with the Parallel Swarm module to compress task descriptions before fan-out and decode results after collection:
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import { encodeTaskDescription, decodeSwarmResult } from 'clawpowers/itp/swarm-bridge';
|
|
102
|
+
|
|
103
|
+
// Compress task before sending to sub-agents
|
|
104
|
+
const compressedTask = await encodeTaskDescription(task);
|
|
105
|
+
|
|
106
|
+
// Decode result from sub-agent
|
|
107
|
+
const decodedResult = await decodeSwarmResult(result);
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Graceful Degradation
|
|
111
|
+
|
|
112
|
+
All ITP functions fail gracefully — if the ITP server is unreachable, messages pass through unchanged with no errors thrown. This ensures ITP never blocks agent operations.
|