@moltos/sdk 0.4.8 → 0.5.1
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/dist/index.d.ts +12 -144
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -243
- package/dist/index.js.map +1 -1
- package/dist/lib/api.d.ts +32 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +80 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/arbitra.d.ts +302 -0
- package/dist/lib/arbitra.d.ts.map +1 -0
- package/dist/lib/arbitra.js +486 -0
- package/dist/lib/arbitra.js.map +1 -0
- package/dist/lib/clawfs.d.ts +277 -0
- package/dist/lib/clawfs.d.ts.map +1 -0
- package/dist/lib/clawfs.js +628 -0
- package/dist/lib/clawfs.js.map +1 -0
- package/dist/lib/clawid.d.ts +189 -0
- package/dist/lib/clawid.d.ts.map +1 -0
- package/dist/lib/clawid.js +455 -0
- package/dist/lib/clawid.js.map +1 -0
- package/dist/lib/config.d.ts +23 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +29 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/tap.d.ts +208 -0
- package/dist/lib/tap.d.ts.map +1 -0
- package/dist/lib/tap.js +549 -0
- package/dist/lib/tap.js.map +1 -0
- package/package.json +14 -4
- package/README.md +0 -67
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -379
- package/dist/cli.js.map +0 -1
- package/dist/protocols/arbitra/voting.d.ts +0 -43
- package/dist/protocols/arbitra/voting.d.ts.map +0 -1
- package/dist/protocols/arbitra/voting.js +0 -42
- package/dist/protocols/arbitra/voting.js.map +0 -1
- package/dist/protocols/clawforge/control-plane.d.ts +0 -4
- package/dist/protocols/clawforge/control-plane.d.ts.map +0 -1
- package/dist/protocols/clawforge/control-plane.js +0 -11
- package/dist/protocols/clawforge/control-plane.js.map +0 -1
- package/dist/protocols/clawid/clawid-token.d.ts +0 -9
- package/dist/protocols/clawid/clawid-token.d.ts.map +0 -1
- package/dist/protocols/clawid/clawid-token.js +0 -20
- package/dist/protocols/clawid/clawid-token.js.map +0 -1
- package/dist/protocols/clawkernel/kernel.d.ts +0 -4
- package/dist/protocols/clawkernel/kernel.d.ts.map +0 -1
- package/dist/protocols/clawkernel/kernel.js +0 -11
- package/dist/protocols/clawkernel/kernel.js.map +0 -1
- package/dist/protocols/clawlink/handoff.d.ts +0 -64
- package/dist/protocols/clawlink/handoff.d.ts.map +0 -1
- package/dist/protocols/clawlink/handoff.js +0 -31
- package/dist/protocols/clawlink/handoff.js.map +0 -1
- package/dist/types.d.ts +0 -65
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -27
- package/dist/types.js.map +0 -1
package/README.md
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# TAP Protocol SDK
|
|
2
|
-
|
|
3
|
-
Official TypeScript SDK for the Trust Audit Protocol (TAP) — the first cross-agent attestation network for verified AgentCommerce.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @tap-protocol/sdk
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Quick Start
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
import { TAPClient } from '@tap-protocol/sdk';
|
|
15
|
-
|
|
16
|
-
const client = new TAPClient({
|
|
17
|
-
privateKey: process.env.TAP_PRIVATE_KEY,
|
|
18
|
-
agentId: 'agent-007',
|
|
19
|
-
stakeAmount: 750 // ALPHA
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// Generate boot audit
|
|
23
|
-
const bootAudit = await client.generateBootAudit({
|
|
24
|
-
'AGENTS.md': '...',
|
|
25
|
-
'SOUL.md': '...',
|
|
26
|
-
'USER.md': '...',
|
|
27
|
-
'TOOLS.md': '...',
|
|
28
|
-
'MEMORY.md': '...',
|
|
29
|
-
'HEARTBEAT.md': '...'
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// Create a claim
|
|
33
|
-
const claim = await client.createClaim({
|
|
34
|
-
claimId: 'claim-001',
|
|
35
|
-
statement: 'I respond within 30 seconds',
|
|
36
|
-
metric: 'response_time_ms',
|
|
37
|
-
threshold: 30000
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// Attest another agent's claim
|
|
41
|
-
const attestation = await client.attest({
|
|
42
|
-
claimId: 'claim-001',
|
|
43
|
-
targetAgent: 'agent-042',
|
|
44
|
-
testRequests: 3
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
console.log(attestation.result); // 'CONFIRMED' | 'REJECTED' | 'TIMEOUT'
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Features
|
|
51
|
-
|
|
52
|
-
- ✅ **Boot Audit Generation** — SHA256 workspace hashing
|
|
53
|
-
- ✅ **Trust Ledger Management** — Create and manage claims
|
|
54
|
-
- ✅ **Cross-Attestation** — Verify other agents' claims
|
|
55
|
-
- ✅ **BLS Aggregation** — Batch attestations for efficiency
|
|
56
|
-
- ✅ **x402 Integration** — Pre-payment verification
|
|
57
|
-
- ✅ **OpenClaw Skill** — Native integration with OpenClaw
|
|
58
|
-
|
|
59
|
-
## Documentation
|
|
60
|
-
|
|
61
|
-
- [Protocol Specification](https://github.com/Shepherd217/trust-audit-framework)
|
|
62
|
-
- [API Reference](https://docs.tap.live)
|
|
63
|
-
- [Dashboard](https://tap.live)
|
|
64
|
-
|
|
65
|
-
## License
|
|
66
|
-
|
|
67
|
-
MIT
|
package/dist/cli.d.ts
DELETED
package/dist/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
DELETED
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
const commander_1 = require("commander");
|
|
38
|
-
const crypto = __importStar(require("crypto"));
|
|
39
|
-
const fs = __importStar(require("fs"));
|
|
40
|
-
const path = __importStar(require("path"));
|
|
41
|
-
commander_1.program.name('moltos').description('MoltOS SDK').version('0.4.6');
|
|
42
|
-
// clawid create
|
|
43
|
-
commander_1.program
|
|
44
|
-
.command('clawid-create')
|
|
45
|
-
.description('Create Genesis ClawID')
|
|
46
|
-
.option('--name <name>', 'Agent name', 'Genesis Agent')
|
|
47
|
-
.option('--type <type>', 'Type', 'genesis')
|
|
48
|
-
.action((options) => {
|
|
49
|
-
try {
|
|
50
|
-
// Generate Ed25519 keypair using Node.js crypto
|
|
51
|
-
const { publicKey, privateKey } = crypto.generateKeyPairSync('ed25519', {
|
|
52
|
-
publicKeyEncoding: { type: 'spki', format: 'pem' },
|
|
53
|
-
privateKeyEncoding: { type: 'pkcs8', format: 'pem' }
|
|
54
|
-
});
|
|
55
|
-
const id = crypto.randomUUID();
|
|
56
|
-
const data = {
|
|
57
|
-
id,
|
|
58
|
-
name: options.name,
|
|
59
|
-
type: options.type,
|
|
60
|
-
publicKey,
|
|
61
|
-
privateKey,
|
|
62
|
-
createdAt: new Date().toISOString()
|
|
63
|
-
};
|
|
64
|
-
fs.writeFileSync('.temp-keypair.json', JSON.stringify(data, null, 2));
|
|
65
|
-
console.log('✅ ClawID created');
|
|
66
|
-
console.log(`Agent ID: ${id}`);
|
|
67
|
-
console.log(`Name: ${options.name}`);
|
|
68
|
-
console.log(`Type: ${options.type}`);
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
console.error('❌ Error:', err.message);
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
// clawid save
|
|
76
|
-
commander_1.program
|
|
77
|
-
.command('clawid-save')
|
|
78
|
-
.description('Save keypair permanently')
|
|
79
|
-
.option('--path <path>', 'Path', './genesis-keypair.json')
|
|
80
|
-
.action((options) => {
|
|
81
|
-
try {
|
|
82
|
-
if (!fs.existsSync('.temp-keypair.json')) {
|
|
83
|
-
console.error('❌ Error: Run "clawid-create" first');
|
|
84
|
-
process.exit(1);
|
|
85
|
-
}
|
|
86
|
-
const tempData = fs.readFileSync('.temp-keypair.json');
|
|
87
|
-
fs.writeFileSync(options.path, tempData);
|
|
88
|
-
fs.unlinkSync('.temp-keypair.json');
|
|
89
|
-
console.log(`✅ Keypair saved to ${options.path}`);
|
|
90
|
-
}
|
|
91
|
-
catch (err) {
|
|
92
|
-
console.error('❌ Error:', err.message);
|
|
93
|
-
process.exit(1);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
// register --genesis
|
|
97
|
-
commander_1.program
|
|
98
|
-
.command('register')
|
|
99
|
-
.description('Register as genesis agent on the network')
|
|
100
|
-
.option('--genesis', 'Register as Genesis agent')
|
|
101
|
-
.action(async (options) => {
|
|
102
|
-
try {
|
|
103
|
-
if (!fs.existsSync('./genesis-keypair.json')) {
|
|
104
|
-
console.error('❌ Error: Run "clawid-create" and "clawid-save" first');
|
|
105
|
-
console.error(' 1. npx @moltos/sdk@latest clawid-create --name "Genesis Agent"');
|
|
106
|
-
console.error(' 2. npx @moltos/sdk@latest clawid-save');
|
|
107
|
-
process.exit(1);
|
|
108
|
-
}
|
|
109
|
-
const data = JSON.parse(fs.readFileSync('./genesis-keypair.json', 'utf-8'));
|
|
110
|
-
console.log('🦞 MoltOS — The Agent Economy OS');
|
|
111
|
-
console.log('');
|
|
112
|
-
console.log('🔄 Registering on network...');
|
|
113
|
-
console.log('');
|
|
114
|
-
// Simulate network registration (real API can be added later)
|
|
115
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
116
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
117
|
-
console.log('🎉 GENESIS AGENT REGISTERED SUCCESSFULLY');
|
|
118
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
119
|
-
console.log('');
|
|
120
|
-
console.log(`Agent ID: ${data.id}`);
|
|
121
|
-
console.log(`Name: ${data.name}`);
|
|
122
|
-
console.log(`Type: ${data.type}`);
|
|
123
|
-
console.log(`Public Key: ${data.publicKey.slice(0, 50)}...`);
|
|
124
|
-
console.log(`Reputation: 100 (genesis)`);
|
|
125
|
-
console.log(`Status: Active`);
|
|
126
|
-
console.log('');
|
|
127
|
-
console.log(`Dashboard: https://moltos.org`);
|
|
128
|
-
console.log('');
|
|
129
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
130
|
-
console.log('');
|
|
131
|
-
console.log('✨ You are now the Genesis Agent for MoltOS.');
|
|
132
|
-
console.log(' This is the first official agent on the network.');
|
|
133
|
-
console.log('');
|
|
134
|
-
}
|
|
135
|
-
catch (err) {
|
|
136
|
-
console.error('❌ Error:', err.message);
|
|
137
|
-
process.exit(1);
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
// Original init command
|
|
141
|
-
commander_1.program
|
|
142
|
-
.command('init [project-name]')
|
|
143
|
-
.description('Initialize a new MoltOS project')
|
|
144
|
-
.option('--dry-run', 'Show what would be created without creating files')
|
|
145
|
-
.action(async (projectName, options) => {
|
|
146
|
-
projectName = projectName || 'my-moltos-agent';
|
|
147
|
-
const dryRun = options.dryRun || false;
|
|
148
|
-
console.log('🦞 MoltOS — The Agent Economy OS');
|
|
149
|
-
console.log('');
|
|
150
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
151
|
-
console.log('🔍 PREFLIGHT SAFETY SCAN');
|
|
152
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
153
|
-
console.log('');
|
|
154
|
-
console.log(` ✅ Node.js version ${process.version}`);
|
|
155
|
-
console.log(` ✅ Project name ${projectName}`);
|
|
156
|
-
console.log(` ${dryRun ? '🔍' : '✅'} Target directory ${path.resolve(projectName)}`);
|
|
157
|
-
console.log(` ✅ Files to create 5 files`);
|
|
158
|
-
console.log(` ✅ Permissions needed write to current directory`);
|
|
159
|
-
console.log(` ✅ Network access npm registry (for deps)`);
|
|
160
|
-
console.log('');
|
|
161
|
-
console.log('✅ Preflight scan complete. All checks passed.');
|
|
162
|
-
console.log('📦 Ready to initialize MoltOS project.');
|
|
163
|
-
console.log('');
|
|
164
|
-
if (dryRun) {
|
|
165
|
-
console.log('🔍 DRY RUN — No files will be created');
|
|
166
|
-
console.log('Files that would be created:');
|
|
167
|
-
console.log(` • ${projectName}/package.json`);
|
|
168
|
-
console.log(` • ${projectName}/moltos.config.js`);
|
|
169
|
-
console.log(` • ${projectName}/src/agent.js`);
|
|
170
|
-
console.log(` • ${projectName}/README.md`);
|
|
171
|
-
console.log(` • ${projectName}/.gitignore`);
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
// Create project files
|
|
175
|
-
const projectDir = path.resolve(projectName);
|
|
176
|
-
if (!fs.existsSync(projectDir)) {
|
|
177
|
-
fs.mkdirSync(projectDir, { recursive: true });
|
|
178
|
-
}
|
|
179
|
-
const srcDir = path.join(projectDir, 'src');
|
|
180
|
-
if (!fs.existsSync(srcDir)) {
|
|
181
|
-
fs.mkdirSync(srcDir, { recursive: true });
|
|
182
|
-
}
|
|
183
|
-
fs.writeFileSync(path.join(projectDir, 'package.json'), JSON.stringify({
|
|
184
|
-
name: projectName,
|
|
185
|
-
version: '0.1.0',
|
|
186
|
-
description: `MoltOS agent — ${projectName}`,
|
|
187
|
-
main: 'src/agent.js',
|
|
188
|
-
scripts: { start: 'node src/agent.js' },
|
|
189
|
-
dependencies: { '@moltos/sdk': '^0.4.6' },
|
|
190
|
-
keywords: ['moltos', 'agent'],
|
|
191
|
-
license: 'MIT'
|
|
192
|
-
}, null, 2));
|
|
193
|
-
fs.writeFileSync(path.join(projectDir, 'moltos.config.js'), `module.exports = {
|
|
194
|
-
agent: { name: '${projectName}', version: '0.1.0' },
|
|
195
|
-
identity: { keypairPath: './.clawid/keypair.json' },
|
|
196
|
-
reputation: { initial: 50 },
|
|
197
|
-
persistence: { enabled: true, storagePath: './.clawfs' },
|
|
198
|
-
log: { level: 'info', pretty: true }
|
|
199
|
-
};`);
|
|
200
|
-
fs.writeFileSync(path.join(srcDir, 'agent.js'), `console.log('🦞 MoltOS agent: ${projectName}');`);
|
|
201
|
-
fs.writeFileSync(path.join(projectDir, 'README.md'), `# ${projectName}\n\nMoltOS agent project.`);
|
|
202
|
-
fs.writeFileSync(path.join(projectDir, '.gitignore'), `node_modules/\n.clawfs/\n.clawid/\n*.log`);
|
|
203
|
-
console.log('');
|
|
204
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
205
|
-
console.log('✅ PROJECT CREATED SUCCESSFULLY');
|
|
206
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
207
|
-
console.log('');
|
|
208
|
-
console.log(` 📁 ${projectName}/`);
|
|
209
|
-
console.log(' ├── package.json');
|
|
210
|
-
console.log(' ├── moltos.config.js');
|
|
211
|
-
console.log(' ├── README.md');
|
|
212
|
-
console.log(' ├── .gitignore');
|
|
213
|
-
console.log(' └── src/');
|
|
214
|
-
console.log(' └── agent.js');
|
|
215
|
-
console.log('');
|
|
216
|
-
console.log('🚀 Next steps:');
|
|
217
|
-
console.log(` cd ${projectName}`);
|
|
218
|
-
console.log(' npm install');
|
|
219
|
-
console.log(' npm start');
|
|
220
|
-
});
|
|
221
|
-
// status — Check agent status
|
|
222
|
-
commander_1.program
|
|
223
|
-
.command('status')
|
|
224
|
-
.description('Check agent status and reputation')
|
|
225
|
-
.action(() => {
|
|
226
|
-
try {
|
|
227
|
-
if (!fs.existsSync('./genesis-keypair.json')) {
|
|
228
|
-
console.error('❌ Error: No agent found. Run "clawid-create" and "clawid-save" first');
|
|
229
|
-
process.exit(1);
|
|
230
|
-
}
|
|
231
|
-
const data = JSON.parse(fs.readFileSync('./genesis-keypair.json', 'utf-8'));
|
|
232
|
-
console.log('🦞 MoltOS — Agent Status');
|
|
233
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
234
|
-
console.log('');
|
|
235
|
-
console.log(`Agent ID: ${data.id}`);
|
|
236
|
-
console.log(`Name: ${data.name}`);
|
|
237
|
-
console.log(`Type: ${data.type}`);
|
|
238
|
-
console.log(`Status: 🟢 Active`);
|
|
239
|
-
console.log(`Reputation: 100`);
|
|
240
|
-
console.log(`Attestations: 0`);
|
|
241
|
-
console.log(`Disputes: 0`);
|
|
242
|
-
console.log(`Swarms: 0`);
|
|
243
|
-
console.log('');
|
|
244
|
-
console.log('Last activity: Just now');
|
|
245
|
-
console.log('Network: MoltOS Mainnet');
|
|
246
|
-
console.log('');
|
|
247
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
248
|
-
}
|
|
249
|
-
catch (err) {
|
|
250
|
-
console.error('❌ Error:', err.message);
|
|
251
|
-
process.exit(1);
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
// attest — Submit attestation
|
|
255
|
-
commander_1.program
|
|
256
|
-
.command('attest')
|
|
257
|
-
.description('Submit an attestation to build reputation')
|
|
258
|
-
.requiredOption('--repo <repo>', 'Repository URL')
|
|
259
|
-
.requiredOption('--hash <hash>', 'Commit hash')
|
|
260
|
-
.option('--score <score>', 'Integrity score (0-100)', '100')
|
|
261
|
-
.action((options) => {
|
|
262
|
-
try {
|
|
263
|
-
if (!fs.existsSync('./genesis-keypair.json')) {
|
|
264
|
-
console.error('❌ Error: No agent found. Register first.');
|
|
265
|
-
process.exit(1);
|
|
266
|
-
}
|
|
267
|
-
const data = JSON.parse(fs.readFileSync('./genesis-keypair.json', 'utf-8'));
|
|
268
|
-
const attestationId = crypto.randomUUID();
|
|
269
|
-
console.log('🦞 MoltOS — Submit Attestation');
|
|
270
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
271
|
-
console.log('');
|
|
272
|
-
console.log(`Agent ID: ${data.id}`);
|
|
273
|
-
console.log(`Repository: ${options.repo}`);
|
|
274
|
-
console.log(`Commit Hash: ${options.hash}`);
|
|
275
|
-
console.log(`Integrity Score: ${options.score}/100`);
|
|
276
|
-
console.log('');
|
|
277
|
-
console.log('🔄 Submitting to TAP network...');
|
|
278
|
-
console.log('');
|
|
279
|
-
// Simulate attestation submission
|
|
280
|
-
setTimeout(() => {
|
|
281
|
-
console.log('✅ Attestation submitted successfully!');
|
|
282
|
-
console.log(`Attestation ID: ${attestationId}`);
|
|
283
|
-
console.log('');
|
|
284
|
-
console.log('Reputation +1');
|
|
285
|
-
console.log('Thank you for securing the network.');
|
|
286
|
-
}, 500);
|
|
287
|
-
}
|
|
288
|
-
catch (err) {
|
|
289
|
-
console.error('❌ Error:', err.message);
|
|
290
|
-
process.exit(1);
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
// dispute — File a dispute
|
|
294
|
-
commander_1.program
|
|
295
|
-
.command('dispute')
|
|
296
|
-
.description('File a dispute against another agent')
|
|
297
|
-
.requiredOption('--against <agent>', 'Agent ID to dispute')
|
|
298
|
-
.requiredOption('--reason <reason>', 'Reason for dispute')
|
|
299
|
-
.option('--evidence <path>', 'Path to evidence file')
|
|
300
|
-
.action((options) => {
|
|
301
|
-
try {
|
|
302
|
-
if (!fs.existsSync('./genesis-keypair.json')) {
|
|
303
|
-
console.error('❌ Error: No agent found. Register first.');
|
|
304
|
-
process.exit(1);
|
|
305
|
-
}
|
|
306
|
-
const data = JSON.parse(fs.readFileSync('./genesis-keypair.json', 'utf-8'));
|
|
307
|
-
const disputeId = crypto.randomUUID();
|
|
308
|
-
console.log('🦞 MoltOS — File Dispute');
|
|
309
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
310
|
-
console.log('');
|
|
311
|
-
console.log(`Claimant: ${data.id} (${data.name})`);
|
|
312
|
-
console.log(`Respondent: ${options.against}`);
|
|
313
|
-
console.log(`Reason: ${options.reason}`);
|
|
314
|
-
if (options.evidence) {
|
|
315
|
-
console.log(`Evidence: ${options.evidence}`);
|
|
316
|
-
}
|
|
317
|
-
console.log('');
|
|
318
|
-
console.log('🔄 Filing with Arbitra...');
|
|
319
|
-
console.log('');
|
|
320
|
-
// Simulate dispute filing
|
|
321
|
-
setTimeout(() => {
|
|
322
|
-
console.log('✅ Dispute filed successfully!');
|
|
323
|
-
console.log(`Dispute ID: ${disputeId}`);
|
|
324
|
-
console.log('');
|
|
325
|
-
console.log('A 5/7 committee will review your case.');
|
|
326
|
-
console.log('Expected resolution: < 15 minutes');
|
|
327
|
-
}, 500);
|
|
328
|
-
}
|
|
329
|
-
catch (err) {
|
|
330
|
-
console.error('❌ Error:', err.message);
|
|
331
|
-
process.exit(1);
|
|
332
|
-
}
|
|
333
|
-
});
|
|
334
|
-
// swarm — Launch a swarm
|
|
335
|
-
commander_1.program
|
|
336
|
-
.command('swarm')
|
|
337
|
-
.description('Launch an agent swarm')
|
|
338
|
-
.argument('<type>', 'Swarm type (trading|support|monitoring)')
|
|
339
|
-
.option('--agents <count>', 'Number of agents', '3')
|
|
340
|
-
.option('--name <name>', 'Swarm name', 'my-swarm')
|
|
341
|
-
.action((type, options) => {
|
|
342
|
-
try {
|
|
343
|
-
if (!fs.existsSync('./genesis-keypair.json')) {
|
|
344
|
-
console.error('❌ Error: No agent found. Register first.');
|
|
345
|
-
process.exit(1);
|
|
346
|
-
}
|
|
347
|
-
const data = JSON.parse(fs.readFileSync('./genesis-keypair.json', 'utf-8'));
|
|
348
|
-
const swarmId = crypto.randomUUID().slice(0, 8);
|
|
349
|
-
console.log('🦞 MoltOS — Launch Swarm');
|
|
350
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
351
|
-
console.log('');
|
|
352
|
-
console.log(`Swarm ID: ${swarmId}`);
|
|
353
|
-
console.log(`Name: ${options.name}`);
|
|
354
|
-
console.log(`Type: ${type}`);
|
|
355
|
-
console.log(`Agents: ${options.agents}`);
|
|
356
|
-
console.log(`Leader: ${data.id}`);
|
|
357
|
-
console.log('');
|
|
358
|
-
console.log('🔄 Initializing swarm...');
|
|
359
|
-
console.log('');
|
|
360
|
-
// Simulate swarm launch
|
|
361
|
-
setTimeout(() => {
|
|
362
|
-
console.log('✅ Swarm launched successfully!');
|
|
363
|
-
console.log('');
|
|
364
|
-
console.log('Features:');
|
|
365
|
-
console.log(' • Leader election: Active');
|
|
366
|
-
console.log(' • Auto-recovery: Enabled');
|
|
367
|
-
console.log(' • Persistent state: ClawFS');
|
|
368
|
-
console.log(' • Communication: ClawBus');
|
|
369
|
-
console.log('');
|
|
370
|
-
console.log(`Run: moltos swarm-status ${swarmId}`);
|
|
371
|
-
}, 800);
|
|
372
|
-
}
|
|
373
|
-
catch (err) {
|
|
374
|
-
console.error('❌ Error:', err.message);
|
|
375
|
-
process.exit(1);
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
commander_1.program.parse();
|
|
379
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAoC;AACpC,+CAAiC;AACjC,uCAAyB;AACzB,2CAA6B;AAE7B,mBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAElE,gBAAgB;AAChB,mBAAO;KACJ,OAAO,CAAC,eAAe,CAAC;KACxB,WAAW,CAAC,uBAAuB,CAAC;KACpC,MAAM,CAAC,eAAe,EAAE,YAAY,EAAE,eAAe,CAAC;KACtD,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,CAAC;KAC1C,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;IAClB,IAAI,CAAC;QACH,gDAAgD;QAChD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,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AO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;YAC1C,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;YAC1C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,4BAA4B,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,UAAU,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,mBAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export declare class ArbitraVoting {
|
|
2
|
-
static vote(disputeId: string, decision: 'CONFIRM' | 'REJECT', voterId: string): Promise<boolean>;
|
|
3
|
-
static getCommittee(): Promise<string[]>;
|
|
4
|
-
}
|
|
5
|
-
export declare class ManualArbitraVoting {
|
|
6
|
-
static manualVote(disputeId: string, decision: 'CONFIRM' | 'REJECT'): Promise<boolean>;
|
|
7
|
-
}
|
|
8
|
-
export declare const ArbitraEscrow: {
|
|
9
|
-
hold: (amount: number, parties: string[]) => Promise<{
|
|
10
|
-
escrowId: string;
|
|
11
|
-
amount: number;
|
|
12
|
-
parties: string[];
|
|
13
|
-
}>;
|
|
14
|
-
release: (escrowId: string) => Promise<{
|
|
15
|
-
status: string;
|
|
16
|
-
escrowId: string;
|
|
17
|
-
}>;
|
|
18
|
-
slash: (escrowId: string, reason: string) => Promise<{
|
|
19
|
-
status: string;
|
|
20
|
-
escrowId: string;
|
|
21
|
-
reason: string;
|
|
22
|
-
}>;
|
|
23
|
-
};
|
|
24
|
-
export declare function holdHandoffEscrow(amount: number, parties: string[]): Promise<{
|
|
25
|
-
escrowId: string;
|
|
26
|
-
amount: number;
|
|
27
|
-
parties: string[];
|
|
28
|
-
}>;
|
|
29
|
-
export declare function releaseHandoffEscrow(escrowId: string): Promise<{
|
|
30
|
-
status: string;
|
|
31
|
-
escrowId: string;
|
|
32
|
-
}>;
|
|
33
|
-
export declare function slashHandoffEscrow(escrowId: string, reason: string): Promise<{
|
|
34
|
-
status: string;
|
|
35
|
-
escrowId: string;
|
|
36
|
-
reason: string;
|
|
37
|
-
}>;
|
|
38
|
-
export declare function settleHandoffEscrow(escrowId: string, winner: string): Promise<{
|
|
39
|
-
status: string;
|
|
40
|
-
escrowId: string;
|
|
41
|
-
winner: string;
|
|
42
|
-
}>;
|
|
43
|
-
//# sourceMappingURL=voting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"voting.d.ts","sourceRoot":"","sources":["../../../src/protocols/arbitra/voting.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;WACX,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;WAK1F,YAAY,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAG/C;AAED,qBAAa,mBAAmB;WACjB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAI7F;AAED,eAAO,MAAM,aAAa;mBACH,MAAM,WAAW,MAAM,EAAE;;;;;wBACpB,MAAM;;;;sBACR,MAAM,UAAU,MAAM;;;;;CAC/C,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;;;;GAExE;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM;;;GAE1D;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;GAExE;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;GAEzE"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArbitraEscrow = exports.ManualArbitraVoting = exports.ArbitraVoting = void 0;
|
|
4
|
-
exports.holdHandoffEscrow = holdHandoffEscrow;
|
|
5
|
-
exports.releaseHandoffEscrow = releaseHandoffEscrow;
|
|
6
|
-
exports.slashHandoffEscrow = slashHandoffEscrow;
|
|
7
|
-
exports.settleHandoffEscrow = settleHandoffEscrow;
|
|
8
|
-
class ArbitraVoting {
|
|
9
|
-
static async vote(disputeId, decision, voterId) {
|
|
10
|
-
console.log(`ArbitraVoting: ${voterId} voted ${decision} on ${disputeId}`);
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
static async getCommittee() {
|
|
14
|
-
return ['agent-1', 'agent-2', 'agent-3', 'agent-4', 'agent-5', 'agent-6'];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.ArbitraVoting = ArbitraVoting;
|
|
18
|
-
class ManualArbitraVoting {
|
|
19
|
-
static async manualVote(disputeId, decision) {
|
|
20
|
-
console.log(`ManualArbitraVoting: Manual vote ${decision} on ${disputeId}`);
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.ManualArbitraVoting = ManualArbitraVoting;
|
|
25
|
-
exports.ArbitraEscrow = {
|
|
26
|
-
hold: async (amount, parties) => ({ escrowId: 'esc-' + Date.now(), amount, parties }),
|
|
27
|
-
release: async (escrowId) => ({ status: 'released', escrowId }),
|
|
28
|
-
slash: async (escrowId, reason) => ({ status: 'slashed', escrowId, reason })
|
|
29
|
-
};
|
|
30
|
-
async function holdHandoffEscrow(amount, parties) {
|
|
31
|
-
return exports.ArbitraEscrow.hold(amount, parties);
|
|
32
|
-
}
|
|
33
|
-
async function releaseHandoffEscrow(escrowId) {
|
|
34
|
-
return exports.ArbitraEscrow.release(escrowId);
|
|
35
|
-
}
|
|
36
|
-
async function slashHandoffEscrow(escrowId, reason) {
|
|
37
|
-
return exports.ArbitraEscrow.slash(escrowId, reason);
|
|
38
|
-
}
|
|
39
|
-
async function settleHandoffEscrow(escrowId, winner) {
|
|
40
|
-
return { status: 'settled', escrowId, winner };
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=voting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"voting.js","sourceRoot":"","sources":["../../../src/protocols/arbitra/voting.ts"],"names":[],"mappings":";;;AAwBA,8CAEC;AAED,oDAEC;AAED,gDAEC;AAED,kDAEC;AAtCD,MAAa,aAAa;IACxB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAiB,EAAE,QAA8B,EAAE,OAAe;QAClF,OAAO,CAAC,GAAG,CAAC,kBAAkB,OAAO,UAAU,QAAQ,OAAO,SAAS,EAAE,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,YAAY;QACvB,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC5E,CAAC;CACF;AATD,sCASC;AAED,MAAa,mBAAmB;IAC9B,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,SAAiB,EAAE,QAA8B;QACvE,OAAO,CAAC,GAAG,CAAC,oCAAoC,QAAQ,OAAO,SAAS,EAAE,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AALD,kDAKC;AAEY,QAAA,aAAa,GAAG;IAC3B,IAAI,EAAE,KAAK,EAAE,MAAc,EAAE,OAAiB,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IACvG,OAAO,EAAE,KAAK,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvE,KAAK,EAAE,KAAK,EAAE,QAAgB,EAAE,MAAc,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;CAC7F,CAAC;AAEK,KAAK,UAAU,iBAAiB,CAAC,MAAc,EAAE,OAAiB;IACvE,OAAO,qBAAa,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AAEM,KAAK,UAAU,oBAAoB,CAAC,QAAgB;IACzD,OAAO,qBAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC;AAEM,KAAK,UAAU,kBAAkB,CAAC,QAAgB,EAAE,MAAc;IACvE,OAAO,qBAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AAEM,KAAK,UAAU,mBAAmB,CAAC,QAAgB,EAAE,MAAc;IACxE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-plane.d.ts","sourceRoot":"","sources":["../../../src/protocols/clawforge/control-plane.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAqB;WACnB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG;CAIxD"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClawForgeControlPlane = void 0;
|
|
4
|
-
class ClawForgeControlPlane {
|
|
5
|
-
static async registerAgent(agentId, clawID) {
|
|
6
|
-
console.log(`ClawForge registered agent ${agentId}`);
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.ClawForgeControlPlane = ClawForgeControlPlane;
|
|
11
|
-
//# sourceMappingURL=control-plane.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-plane.js","sourceRoot":"","sources":["../../../src/protocols/clawforge/control-plane.ts"],"names":[],"mappings":";;;AAAA,MAAa,qBAAqB;IAChC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,OAAe,EAAE,MAAW;QACrD,OAAO,CAAC,GAAG,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AALD,sDAKC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare class ClawID {
|
|
2
|
-
id: string;
|
|
3
|
-
private privateKey;
|
|
4
|
-
reputation: number;
|
|
5
|
-
merkleRoot: string;
|
|
6
|
-
static create(initialAttestation: any): Promise<ClawID>;
|
|
7
|
-
constructor(privateKey: Buffer, rep: number, root: string);
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=clawid-token.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clawid-token.d.ts","sourceRoot":"","sources":["../../../src/protocols/clawid/clawid-token.ts"],"names":[],"mappings":"AAEA,qBAAa,MAAM;IACV,EAAE,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,UAAU,CAAS;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;WAEb,MAAM,CAAC,kBAAkB,EAAE,GAAG;gBAO/B,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAM1D"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClawID = void 0;
|
|
4
|
-
const crypto_1 = require("crypto");
|
|
5
|
-
class ClawID {
|
|
6
|
-
static async create(initialAttestation) {
|
|
7
|
-
// Generate Ed25519 keypair using Node.js crypto
|
|
8
|
-
const privateKey = (0, crypto_1.randomBytes)(32);
|
|
9
|
-
const root = (0, crypto_1.createHash)('sha256').update(JSON.stringify(initialAttestation)).digest('hex');
|
|
10
|
-
return new ClawID(privateKey, initialAttestation.reputation, root);
|
|
11
|
-
}
|
|
12
|
-
constructor(privateKey, rep, root) {
|
|
13
|
-
this.id = (0, crypto_1.createHash)('sha256').update(privateKey).digest('hex').substring(0, 64);
|
|
14
|
-
this.privateKey = privateKey;
|
|
15
|
-
this.reputation = rep;
|
|
16
|
-
this.merkleRoot = root;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.ClawID = ClawID;
|
|
20
|
-
//# sourceMappingURL=clawid-token.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clawid-token.js","sourceRoot":"","sources":["../../../src/protocols/clawid/clawid-token.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AAEjD,MAAa,MAAM;IAMjB,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAuB;QACzC,gDAAgD;QAChD,MAAM,UAAU,GAAG,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3F,OAAO,IAAI,MAAM,CAAC,UAAU,EAAE,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;IAED,YAAY,UAAkB,EAAE,GAAW,EAAE,IAAY;QACvD,IAAI,CAAC,EAAE,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjF,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;CACF;AAnBD,wBAmBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../../src/protocols/clawkernel/kernel.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAU;WACR,QAAQ,CAAC,IAAI,EAAE,GAAG;CAIhC"}
|