@mandible-ai/mandible 0.2.0 → 0.3.0
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 +80 -34
- package/dist/examples/code-pipeline/with-providers.js +1 -2
- package/dist/examples/code-pipeline/with-providers.js.map +1 -1
- package/dist/src/cloud/client.d.ts +1 -1
- package/dist/src/cloud/client.d.ts.map +1 -1
- package/dist/src/cloud/client.js +1 -1
- package/dist/src/cloud/client.js.map +1 -1
- package/dist/src/cloud/index.d.ts +1 -3
- package/dist/src/cloud/index.d.ts.map +1 -1
- package/dist/src/cloud/index.js +0 -1
- package/dist/src/cloud/index.js.map +1 -1
- package/dist/src/cloud/types.d.ts +5 -9
- package/dist/src/cloud/types.d.ts.map +1 -1
- package/dist/src/core/types.d.ts +43 -0
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/core/types.js +10 -0
- package/dist/src/core/types.js.map +1 -1
- package/dist/src/dsl/index.d.ts +1 -0
- package/dist/src/dsl/index.d.ts.map +1 -1
- package/dist/src/dsl/index.js +1 -0
- package/dist/src/dsl/index.js.map +1 -1
- package/dist/src/dsl/mandible.d.ts +62 -0
- package/dist/src/dsl/mandible.d.ts.map +1 -0
- package/dist/src/dsl/mandible.js +140 -0
- package/dist/src/dsl/mandible.js.map +1 -0
- package/dist/src/environments/filesystem/adapter.d.ts.map +1 -1
- package/dist/src/environments/filesystem/adapter.js.map +1 -1
- package/dist/src/hosts/docker.d.ts +67 -0
- package/dist/src/hosts/docker.d.ts.map +1 -0
- package/dist/src/hosts/docker.js +135 -0
- package/dist/src/hosts/docker.js.map +1 -0
- package/dist/src/hosts/index.d.ts +5 -0
- package/dist/src/hosts/index.d.ts.map +1 -0
- package/dist/src/hosts/index.js +3 -0
- package/dist/src/hosts/index.js.map +1 -0
- package/dist/src/hosts/local.d.ts +41 -0
- package/dist/src/hosts/local.d.ts.map +1 -0
- package/dist/src/hosts/local.js +84 -0
- package/dist/src/hosts/local.js.map +1 -0
- package/dist/src/index.d.ts +8 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/providers/claude-code.d.ts.map +1 -1
- package/dist/src/providers/claude-code.js +3 -5
- package/dist/src/providers/claude-code.js.map +1 -1
- package/dist/src/providers/types.d.ts +0 -9
- package/dist/src/providers/types.d.ts.map +1 -1
- package/package.json +12 -2
- package/dist/examples/docker-pipeline/index.d.ts +0 -3
- package/dist/examples/docker-pipeline/index.d.ts.map +0 -1
- package/dist/examples/docker-pipeline/index.js +0 -235
- package/dist/examples/docker-pipeline/index.js.map +0 -1
- package/dist/examples/remote-pipeline/index.d.ts +0 -3
- package/dist/examples/remote-pipeline/index.d.ts.map +0 -1
- package/dist/examples/remote-pipeline/index.js +0 -154
- package/dist/examples/remote-pipeline/index.js.map +0 -1
- package/dist/src/environments/remote/adapter.d.ts +0 -61
- package/dist/src/environments/remote/adapter.d.ts.map +0 -1
- package/dist/src/environments/remote/adapter.js +0 -392
- package/dist/src/environments/remote/adapter.js.map +0 -1
- package/dist/src/environments/remote/index.d.ts +0 -5
- package/dist/src/environments/remote/index.d.ts.map +0 -1
- package/dist/src/environments/remote/index.js +0 -3
- package/dist/src/environments/remote/index.js.map +0 -1
- package/dist/src/environments/remote/protocol.d.ts +0 -124
- package/dist/src/environments/remote/protocol.d.ts.map +0 -1
- package/dist/src/environments/remote/protocol.js +0 -24
- package/dist/src/environments/remote/protocol.js.map +0 -1
- package/dist/src/providers/agent.d.ts +0 -23
- package/dist/src/providers/agent.d.ts.map +0 -1
- package/dist/src/providers/agent.js +0 -184
- package/dist/src/providers/agent.js.map +0 -1
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Environment, Signal, SignalQuery, Subscription, DecayResult, SignalMeta } from '../../core/types.js';
|
|
2
|
-
import type { RuntimeEventData } from '../../core/events.js';
|
|
3
|
-
export interface RemoteEnvConfig {
|
|
4
|
-
url: string;
|
|
5
|
-
apiKey: string;
|
|
6
|
-
project: string;
|
|
7
|
-
colony?: string;
|
|
8
|
-
publicKey?: string;
|
|
9
|
-
name?: string;
|
|
10
|
-
/** Connection timeout in ms. Default: 10_000 */
|
|
11
|
-
connectTimeout?: number;
|
|
12
|
-
/** Request timeout in ms. Default: 30_000 */
|
|
13
|
-
requestTimeout?: number;
|
|
14
|
-
/** Whether to auto-reconnect on disconnect. Default: true */
|
|
15
|
-
autoReconnect?: boolean;
|
|
16
|
-
/** Max reconnect attempts. Default: Infinity */
|
|
17
|
-
maxReconnectAttempts?: number;
|
|
18
|
-
}
|
|
19
|
-
export declare class RemoteEnvironment implements Environment {
|
|
20
|
-
readonly name: string;
|
|
21
|
-
private config;
|
|
22
|
-
private ws;
|
|
23
|
-
private authenticated;
|
|
24
|
-
private pending;
|
|
25
|
-
private subscriptions;
|
|
26
|
-
private eventListeners;
|
|
27
|
-
private idCounter;
|
|
28
|
-
private reconnectAttempts;
|
|
29
|
-
private reconnectTimer?;
|
|
30
|
-
private connectPromise;
|
|
31
|
-
private closed;
|
|
32
|
-
constructor(config: RemoteEnvConfig);
|
|
33
|
-
private nextId;
|
|
34
|
-
connect(): Promise<void>;
|
|
35
|
-
private doConnect;
|
|
36
|
-
private authenticate;
|
|
37
|
-
private scheduleReconnect;
|
|
38
|
-
private resubscribeAll;
|
|
39
|
-
close(): Promise<void>;
|
|
40
|
-
private send;
|
|
41
|
-
private handleMessage;
|
|
42
|
-
private request;
|
|
43
|
-
private rejectAllPending;
|
|
44
|
-
private ensureConnected;
|
|
45
|
-
observe(query: SignalQuery): Promise<Signal[]>;
|
|
46
|
-
deposit(input: Omit<Signal, 'id' | 'meta'> & {
|
|
47
|
-
meta?: Partial<SignalMeta>;
|
|
48
|
-
}): Promise<Signal>;
|
|
49
|
-
withdraw(signalId: string): Promise<void>;
|
|
50
|
-
claim(signalId: string, claimant: string, leaseDuration?: number): Promise<boolean>;
|
|
51
|
-
release(signalId: string): Promise<void>;
|
|
52
|
-
watch(query: SignalQuery, callback: (signal: Signal) => void): Subscription;
|
|
53
|
-
history(query: SignalQuery & {
|
|
54
|
-
includeWithdrawn?: boolean;
|
|
55
|
-
}): Promise<Signal[]>;
|
|
56
|
-
decay(): Promise<DecayResult>;
|
|
57
|
-
snapshot(): Promise<Signal[]>;
|
|
58
|
-
onEvent(listener: (event: RuntimeEventData) => void): () => void;
|
|
59
|
-
emitEvent(event: RuntimeEventData): void;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/environments/remote/adapter.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,WAAW,EACX,MAAM,EACN,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAU7D,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gDAAgD;IAChD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAcD,qBAAa,iBAAkB,YAAW,WAAW;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,MAAM,CAEoC;IAElD,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,O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AAgB,CAAC,EAAE,OAAO,CAAA;KAAE,GAClD,OAAO,CAAC,MAAM,EAAE,CAAC;IAad,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC;IAQ7B,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAanC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,MAAM,IAAI;IAOhE,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;CAMzC"}
|
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Remote Environment Adapter
|
|
3
|
-
// ============================================================
|
|
4
|
-
// Implements the Environment interface over WebSocket.
|
|
5
|
-
// Connects to any compatible signal server (hosted or self-hosted).
|
|
6
|
-
//
|
|
7
|
-
// From a colony's perspective, this is identical to
|
|
8
|
-
// FilesystemEnvironment — it deposits, observes, claims.
|
|
9
|
-
// The network transport is invisible.
|
|
10
|
-
// ============================================================
|
|
11
|
-
import { WebSocket } from 'ws';
|
|
12
|
-
export class RemoteEnvironment {
|
|
13
|
-
name;
|
|
14
|
-
config;
|
|
15
|
-
ws = null;
|
|
16
|
-
authenticated = false;
|
|
17
|
-
pending = new Map();
|
|
18
|
-
subscriptions = new Map();
|
|
19
|
-
eventListeners = [];
|
|
20
|
-
idCounter = 0;
|
|
21
|
-
reconnectAttempts = 0;
|
|
22
|
-
reconnectTimer;
|
|
23
|
-
connectPromise = null;
|
|
24
|
-
closed = false;
|
|
25
|
-
constructor(config) {
|
|
26
|
-
this.name = config.name ?? `remote:${config.project}`;
|
|
27
|
-
this.config = {
|
|
28
|
-
url: config.url,
|
|
29
|
-
apiKey: config.apiKey,
|
|
30
|
-
project: config.project,
|
|
31
|
-
colony: config.colony,
|
|
32
|
-
publicKey: config.publicKey,
|
|
33
|
-
connectTimeout: config.connectTimeout ?? 10_000,
|
|
34
|
-
requestTimeout: config.requestTimeout ?? 30_000,
|
|
35
|
-
autoReconnect: config.autoReconnect ?? true,
|
|
36
|
-
maxReconnectAttempts: config.maxReconnectAttempts ?? Infinity,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
// ----------------------------------------------------------
|
|
40
|
-
// Connection management
|
|
41
|
-
// ----------------------------------------------------------
|
|
42
|
-
nextId() {
|
|
43
|
-
return `req_${++this.idCounter}_${Date.now().toString(36)}`;
|
|
44
|
-
}
|
|
45
|
-
async connect() {
|
|
46
|
-
if (this.ws?.readyState === WebSocket.OPEN && this.authenticated)
|
|
47
|
-
return;
|
|
48
|
-
if (this.connectPromise)
|
|
49
|
-
return this.connectPromise;
|
|
50
|
-
this.connectPromise = this.doConnect();
|
|
51
|
-
try {
|
|
52
|
-
await this.connectPromise;
|
|
53
|
-
}
|
|
54
|
-
finally {
|
|
55
|
-
this.connectPromise = null;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
doConnect() {
|
|
59
|
-
return new Promise((resolve, reject) => {
|
|
60
|
-
const timeout = setTimeout(() => {
|
|
61
|
-
reject(new Error(`Connection to ${this.config.url} timed out`));
|
|
62
|
-
this.ws?.close();
|
|
63
|
-
}, this.config.connectTimeout);
|
|
64
|
-
this.ws = new WebSocket(this.config.url);
|
|
65
|
-
this.ws.on('open', async () => {
|
|
66
|
-
clearTimeout(timeout);
|
|
67
|
-
try {
|
|
68
|
-
await this.authenticate();
|
|
69
|
-
this.reconnectAttempts = 0;
|
|
70
|
-
await this.resubscribeAll();
|
|
71
|
-
resolve();
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
reject(err);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
this.ws.on('message', (data) => {
|
|
78
|
-
this.handleMessage(data);
|
|
79
|
-
});
|
|
80
|
-
this.ws.on('close', () => {
|
|
81
|
-
this.authenticated = false;
|
|
82
|
-
this.rejectAllPending('Connection closed');
|
|
83
|
-
if (this.config.autoReconnect && !this.closed) {
|
|
84
|
-
this.scheduleReconnect();
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
this.ws.on('error', (err) => {
|
|
88
|
-
clearTimeout(timeout);
|
|
89
|
-
if (!this.authenticated) {
|
|
90
|
-
reject(err);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
async authenticate() {
|
|
96
|
-
const msg = {
|
|
97
|
-
type: 'auth',
|
|
98
|
-
apiKey: this.config.apiKey,
|
|
99
|
-
project: this.config.project,
|
|
100
|
-
colony: this.config.colony,
|
|
101
|
-
publicKey: this.config.publicKey,
|
|
102
|
-
};
|
|
103
|
-
this.send(msg);
|
|
104
|
-
return new Promise((resolve, reject) => {
|
|
105
|
-
const timeout = setTimeout(() => reject(new Error('Auth timeout')), 5_000);
|
|
106
|
-
const handler = (data) => {
|
|
107
|
-
const parsed = JSON.parse(data.toString());
|
|
108
|
-
if (parsed.type === 'authenticated') {
|
|
109
|
-
clearTimeout(timeout);
|
|
110
|
-
this.authenticated = true;
|
|
111
|
-
this.ws?.removeListener('message', handler);
|
|
112
|
-
resolve();
|
|
113
|
-
}
|
|
114
|
-
else if (parsed.type === 'error' && parsed.code === 'AUTH_FAILED') {
|
|
115
|
-
clearTimeout(timeout);
|
|
116
|
-
this.ws?.removeListener('message', handler);
|
|
117
|
-
reject(new Error(`Authentication failed: ${parsed.message}`));
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
this.ws.on('message', handler);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
scheduleReconnect() {
|
|
124
|
-
if (this.reconnectAttempts >= this.config.maxReconnectAttempts)
|
|
125
|
-
return;
|
|
126
|
-
const delay = Math.min(1000 * Math.pow(2, this.reconnectAttempts), 30_000);
|
|
127
|
-
this.reconnectAttempts++;
|
|
128
|
-
this.reconnectTimer = setTimeout(() => {
|
|
129
|
-
this.connect().catch(() => { });
|
|
130
|
-
}, delay);
|
|
131
|
-
}
|
|
132
|
-
async resubscribeAll() {
|
|
133
|
-
for (const [clientSubId, entry] of this.subscriptions) {
|
|
134
|
-
try {
|
|
135
|
-
const result = await this.request({
|
|
136
|
-
type: 'subscribe',
|
|
137
|
-
id: this.nextId(),
|
|
138
|
-
query: entry.query,
|
|
139
|
-
});
|
|
140
|
-
entry.serverSubId = result.subscriptionId;
|
|
141
|
-
}
|
|
142
|
-
catch {
|
|
143
|
-
// Subscription will be retried on next reconnect
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
async close() {
|
|
148
|
-
this.closed = true;
|
|
149
|
-
if (this.reconnectTimer)
|
|
150
|
-
clearTimeout(this.reconnectTimer);
|
|
151
|
-
this.rejectAllPending('Environment closed');
|
|
152
|
-
this.subscriptions.clear();
|
|
153
|
-
if (this.ws) {
|
|
154
|
-
this.ws.close();
|
|
155
|
-
this.ws = null;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
// ----------------------------------------------------------
|
|
159
|
-
// Message handling
|
|
160
|
-
// ----------------------------------------------------------
|
|
161
|
-
send(msg) {
|
|
162
|
-
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
|
|
163
|
-
throw new Error('Not connected to signal server');
|
|
164
|
-
}
|
|
165
|
-
this.ws.send(JSON.stringify(msg));
|
|
166
|
-
}
|
|
167
|
-
handleMessage(data) {
|
|
168
|
-
let msg;
|
|
169
|
-
try {
|
|
170
|
-
msg = JSON.parse(data.toString());
|
|
171
|
-
}
|
|
172
|
-
catch {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
if (msg.type === 'result' || msg.type === 'error') {
|
|
176
|
-
const pending = this.pending.get(msg.id);
|
|
177
|
-
if (!pending)
|
|
178
|
-
return;
|
|
179
|
-
this.pending.delete(msg.id);
|
|
180
|
-
clearTimeout(pending.timer);
|
|
181
|
-
if (msg.type === 'error') {
|
|
182
|
-
pending.reject(new Error(`[${msg.code}] ${msg.message}`));
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
pending.resolve(msg.data);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
else if (msg.type === 'event') {
|
|
189
|
-
const eventMsg = msg;
|
|
190
|
-
for (const listener of this.eventListeners) {
|
|
191
|
-
try {
|
|
192
|
-
listener(eventMsg.data);
|
|
193
|
-
}
|
|
194
|
-
catch { /* don't crash */ }
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
else if (msg.type === 'signal') {
|
|
198
|
-
const push = msg;
|
|
199
|
-
for (const entry of this.subscriptions.values()) {
|
|
200
|
-
if (entry.serverSubId === push.subscriptionId) {
|
|
201
|
-
try {
|
|
202
|
-
entry.callback(push.signal);
|
|
203
|
-
}
|
|
204
|
-
catch { /* don't crash */ }
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
request(msg) {
|
|
210
|
-
return new Promise((resolve, reject) => {
|
|
211
|
-
const timer = setTimeout(() => {
|
|
212
|
-
this.pending.delete(msg.id);
|
|
213
|
-
reject(new Error(`Request ${msg.type} timed out after ${this.config.requestTimeout}ms`));
|
|
214
|
-
}, this.config.requestTimeout);
|
|
215
|
-
this.pending.set(msg.id, {
|
|
216
|
-
resolve: resolve,
|
|
217
|
-
reject,
|
|
218
|
-
timer,
|
|
219
|
-
});
|
|
220
|
-
try {
|
|
221
|
-
this.send(msg);
|
|
222
|
-
}
|
|
223
|
-
catch (err) {
|
|
224
|
-
this.pending.delete(msg.id);
|
|
225
|
-
clearTimeout(timer);
|
|
226
|
-
reject(err);
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
rejectAllPending(reason) {
|
|
231
|
-
for (const [id, pending] of this.pending) {
|
|
232
|
-
clearTimeout(pending.timer);
|
|
233
|
-
pending.reject(new Error(reason));
|
|
234
|
-
}
|
|
235
|
-
this.pending.clear();
|
|
236
|
-
}
|
|
237
|
-
async ensureConnected() {
|
|
238
|
-
if (this.ws?.readyState === WebSocket.OPEN && this.authenticated)
|
|
239
|
-
return;
|
|
240
|
-
await this.connect();
|
|
241
|
-
}
|
|
242
|
-
// ----------------------------------------------------------
|
|
243
|
-
// Environment interface
|
|
244
|
-
// ----------------------------------------------------------
|
|
245
|
-
async observe(query) {
|
|
246
|
-
await this.ensureConnected();
|
|
247
|
-
const result = await this.request({
|
|
248
|
-
type: 'observe',
|
|
249
|
-
id: this.nextId(),
|
|
250
|
-
query: toSerializableQuery(query),
|
|
251
|
-
});
|
|
252
|
-
return result ?? [];
|
|
253
|
-
}
|
|
254
|
-
async deposit(input) {
|
|
255
|
-
await this.ensureConnected();
|
|
256
|
-
return this.request({
|
|
257
|
-
type: 'deposit',
|
|
258
|
-
id: this.nextId(),
|
|
259
|
-
signal: {
|
|
260
|
-
type: input.type,
|
|
261
|
-
payload: input.payload,
|
|
262
|
-
meta: input.meta ? {
|
|
263
|
-
deposited_by: input.meta.deposited_by,
|
|
264
|
-
concentration: input.meta.concentration,
|
|
265
|
-
ttl: input.meta.ttl,
|
|
266
|
-
tags: input.meta.tags,
|
|
267
|
-
caused_by: input.meta.caused_by,
|
|
268
|
-
signature: input.meta.signature,
|
|
269
|
-
signer: input.meta.signer,
|
|
270
|
-
} : undefined,
|
|
271
|
-
},
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
async withdraw(signalId) {
|
|
275
|
-
await this.ensureConnected();
|
|
276
|
-
await this.request({
|
|
277
|
-
type: 'withdraw',
|
|
278
|
-
id: this.nextId(),
|
|
279
|
-
signalId,
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
async claim(signalId, claimant, leaseDuration) {
|
|
283
|
-
await this.ensureConnected();
|
|
284
|
-
return this.request({
|
|
285
|
-
type: 'claim',
|
|
286
|
-
id: this.nextId(),
|
|
287
|
-
signalId,
|
|
288
|
-
claimant,
|
|
289
|
-
leaseDuration,
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
async release(signalId) {
|
|
293
|
-
await this.ensureConnected();
|
|
294
|
-
await this.request({
|
|
295
|
-
type: 'release',
|
|
296
|
-
id: this.nextId(),
|
|
297
|
-
signalId,
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
watch(query, callback) {
|
|
301
|
-
const clientSubId = `sub_${++this.idCounter}`;
|
|
302
|
-
const entry = {
|
|
303
|
-
query: toSerializableQuery(query),
|
|
304
|
-
callback,
|
|
305
|
-
};
|
|
306
|
-
this.subscriptions.set(clientSubId, entry);
|
|
307
|
-
// Send subscribe request (async, fire-and-forget from caller's perspective)
|
|
308
|
-
this.ensureConnected().then(() => {
|
|
309
|
-
return this.request({
|
|
310
|
-
type: 'subscribe',
|
|
311
|
-
id: this.nextId(),
|
|
312
|
-
query: entry.query,
|
|
313
|
-
});
|
|
314
|
-
}).then((result) => {
|
|
315
|
-
entry.serverSubId = result.subscriptionId;
|
|
316
|
-
}).catch(() => {
|
|
317
|
-
// Will be retried on reconnect
|
|
318
|
-
});
|
|
319
|
-
return {
|
|
320
|
-
unsubscribe: () => {
|
|
321
|
-
const sub = this.subscriptions.get(clientSubId);
|
|
322
|
-
this.subscriptions.delete(clientSubId);
|
|
323
|
-
if (sub?.serverSubId && this.ws?.readyState === WebSocket.OPEN) {
|
|
324
|
-
this.send({
|
|
325
|
-
type: 'unsubscribe',
|
|
326
|
-
id: this.nextId(),
|
|
327
|
-
subscriptionId: sub.serverSubId,
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
async history(query) {
|
|
334
|
-
await this.ensureConnected();
|
|
335
|
-
const result = await this.request({
|
|
336
|
-
type: 'history',
|
|
337
|
-
id: this.nextId(),
|
|
338
|
-
query: {
|
|
339
|
-
...toSerializableQuery(query),
|
|
340
|
-
includeWithdrawn: query.includeWithdrawn,
|
|
341
|
-
},
|
|
342
|
-
});
|
|
343
|
-
return result ?? [];
|
|
344
|
-
}
|
|
345
|
-
async decay() {
|
|
346
|
-
await this.ensureConnected();
|
|
347
|
-
return this.request({
|
|
348
|
-
type: 'decay',
|
|
349
|
-
id: this.nextId(),
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
async snapshot() {
|
|
353
|
-
await this.ensureConnected();
|
|
354
|
-
const result = await this.request({
|
|
355
|
-
type: 'snapshot',
|
|
356
|
-
id: this.nextId(),
|
|
357
|
-
});
|
|
358
|
-
return result ?? [];
|
|
359
|
-
}
|
|
360
|
-
// ----------------------------------------------------------
|
|
361
|
-
// Event forwarding (colony → signal server → dashboard)
|
|
362
|
-
// ----------------------------------------------------------
|
|
363
|
-
onEvent(listener) {
|
|
364
|
-
this.eventListeners.push(listener);
|
|
365
|
-
return () => {
|
|
366
|
-
this.eventListeners = this.eventListeners.filter(l => l !== listener);
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
emitEvent(event) {
|
|
370
|
-
if (this.ws?.readyState !== WebSocket.OPEN)
|
|
371
|
-
return;
|
|
372
|
-
try {
|
|
373
|
-
this.send({ type: 'event', data: event });
|
|
374
|
-
}
|
|
375
|
-
catch { /* best effort */ }
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
// ----------------------------------------------------------
|
|
379
|
-
// Helpers
|
|
380
|
-
// ----------------------------------------------------------
|
|
381
|
-
function toSerializableQuery(query) {
|
|
382
|
-
return {
|
|
383
|
-
type: query.type,
|
|
384
|
-
minConcentration: query.minConcentration,
|
|
385
|
-
unclaimed: query.unclaimed,
|
|
386
|
-
tags: query.tags,
|
|
387
|
-
after: query.after,
|
|
388
|
-
limit: query.limit,
|
|
389
|
-
// Note: query.filter (function) is dropped — cannot serialize
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
//# sourceMappingURL=adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../src/environments/remote/adapter.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,6BAA6B;AAC7B,+DAA+D;AAC/D,uDAAuD;AACvD,oEAAoE;AACpE,E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AC7D,UAAU;AACV,6DAA6D;AAE7D,SAAS,mBAAmB,CAAC,KAAkB;IAC7C,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,8DAA8D;KAC/D,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { RemoteEnvironment } from './adapter.js';
|
|
2
|
-
export type { RemoteEnvConfig } from './adapter.js';
|
|
3
|
-
export type { ClientMessage, ServerMessage, ResultMessage, ErrorMessage, SignalPush, AuthenticatedMessage, SerializableSignalQuery, SerializableSignalMeta, ObserveRequest, DepositRequest, WithdrawRequest, ClaimRequest, ReleaseRequest, SubscribeRequest, UnsubscribeRequest, SnapshotRequest, HistoryRequest, DecayRequest, AuthRequest, EventForward, } from './protocol.js';
|
|
4
|
-
export { ErrorCodes } from './protocol.js';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/environments/remote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/environments/remote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAwBjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import type { Signal } from '../../core/types.js';
|
|
2
|
-
import type { RuntimeEventData } from '../../core/events.js';
|
|
3
|
-
export type ClientMessage = ObserveRequest | DepositRequest | WithdrawRequest | ClaimRequest | ReleaseRequest | SubscribeRequest | UnsubscribeRequest | SnapshotRequest | HistoryRequest | DecayRequest | AuthRequest | EventForward;
|
|
4
|
-
export interface ObserveRequest {
|
|
5
|
-
type: 'observe';
|
|
6
|
-
id: string;
|
|
7
|
-
query: SerializableSignalQuery;
|
|
8
|
-
}
|
|
9
|
-
export interface DepositRequest {
|
|
10
|
-
type: 'deposit';
|
|
11
|
-
id: string;
|
|
12
|
-
signal: {
|
|
13
|
-
type: string;
|
|
14
|
-
payload: Record<string, unknown>;
|
|
15
|
-
meta?: Partial<SerializableSignalMeta>;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export interface WithdrawRequest {
|
|
19
|
-
type: 'withdraw';
|
|
20
|
-
id: string;
|
|
21
|
-
signalId: string;
|
|
22
|
-
}
|
|
23
|
-
export interface ClaimRequest {
|
|
24
|
-
type: 'claim';
|
|
25
|
-
id: string;
|
|
26
|
-
signalId: string;
|
|
27
|
-
claimant: string;
|
|
28
|
-
leaseDuration?: number;
|
|
29
|
-
}
|
|
30
|
-
export interface ReleaseRequest {
|
|
31
|
-
type: 'release';
|
|
32
|
-
id: string;
|
|
33
|
-
signalId: string;
|
|
34
|
-
}
|
|
35
|
-
export interface SubscribeRequest {
|
|
36
|
-
type: 'subscribe';
|
|
37
|
-
id: string;
|
|
38
|
-
query: SerializableSignalQuery;
|
|
39
|
-
}
|
|
40
|
-
export interface UnsubscribeRequest {
|
|
41
|
-
type: 'unsubscribe';
|
|
42
|
-
id: string;
|
|
43
|
-
subscriptionId: string;
|
|
44
|
-
}
|
|
45
|
-
export interface SnapshotRequest {
|
|
46
|
-
type: 'snapshot';
|
|
47
|
-
id: string;
|
|
48
|
-
}
|
|
49
|
-
export interface HistoryRequest {
|
|
50
|
-
type: 'history';
|
|
51
|
-
id: string;
|
|
52
|
-
query: SerializableSignalQuery & {
|
|
53
|
-
includeWithdrawn?: boolean;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export interface DecayRequest {
|
|
57
|
-
type: 'decay';
|
|
58
|
-
id: string;
|
|
59
|
-
}
|
|
60
|
-
export interface AuthRequest {
|
|
61
|
-
type: 'auth';
|
|
62
|
-
apiKey: string;
|
|
63
|
-
colony?: string;
|
|
64
|
-
publicKey?: string;
|
|
65
|
-
project: string;
|
|
66
|
-
}
|
|
67
|
-
export interface EventForward {
|
|
68
|
-
type: 'event';
|
|
69
|
-
data: RuntimeEventData;
|
|
70
|
-
}
|
|
71
|
-
export interface EventRelayMessage {
|
|
72
|
-
type: 'event';
|
|
73
|
-
data: import('../../core/events.js').RuntimeEventData;
|
|
74
|
-
}
|
|
75
|
-
export type ServerMessage = ResultMessage | ErrorMessage | SignalPush | AuthenticatedMessage | EventRelayMessage;
|
|
76
|
-
export interface ResultMessage {
|
|
77
|
-
type: 'result';
|
|
78
|
-
id: string;
|
|
79
|
-
data: unknown;
|
|
80
|
-
}
|
|
81
|
-
export interface ErrorMessage {
|
|
82
|
-
type: 'error';
|
|
83
|
-
id: string;
|
|
84
|
-
code: string;
|
|
85
|
-
message: string;
|
|
86
|
-
}
|
|
87
|
-
export interface SignalPush {
|
|
88
|
-
type: 'signal';
|
|
89
|
-
subscriptionId: string;
|
|
90
|
-
signal: Signal;
|
|
91
|
-
}
|
|
92
|
-
export interface AuthenticatedMessage {
|
|
93
|
-
type: 'authenticated';
|
|
94
|
-
project: string;
|
|
95
|
-
environment: string;
|
|
96
|
-
}
|
|
97
|
-
export interface SerializableSignalQuery {
|
|
98
|
-
type?: string | string[];
|
|
99
|
-
minConcentration?: number;
|
|
100
|
-
unclaimed?: boolean;
|
|
101
|
-
tags?: string[];
|
|
102
|
-
after?: number;
|
|
103
|
-
limit?: number;
|
|
104
|
-
}
|
|
105
|
-
export interface SerializableSignalMeta {
|
|
106
|
-
deposited_by: string;
|
|
107
|
-
concentration?: number;
|
|
108
|
-
ttl?: number;
|
|
109
|
-
tags?: string[];
|
|
110
|
-
caused_by?: string[];
|
|
111
|
-
signature?: string;
|
|
112
|
-
signer?: string;
|
|
113
|
-
}
|
|
114
|
-
export declare const ErrorCodes: {
|
|
115
|
-
readonly AUTH_REQUIRED: "AUTH_REQUIRED";
|
|
116
|
-
readonly AUTH_FAILED: "AUTH_FAILED";
|
|
117
|
-
readonly INVALID_MESSAGE: "INVALID_MESSAGE";
|
|
118
|
-
readonly SIGNAL_NOT_FOUND: "SIGNAL_NOT_FOUND";
|
|
119
|
-
readonly CLAIM_FAILED: "CLAIM_FAILED";
|
|
120
|
-
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
121
|
-
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
122
|
-
readonly RATE_LIMITED: "RATE_LIMITED";
|
|
123
|
-
};
|
|
124
|
-
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../src/environments/remote/protocol.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAwC,MAAM,qBAAqB,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAM7D,MAAM,MAAM,aAAa,GACrB,cAAc,GACd,cAAc,GACd,eAAe,GACf,YAAY,GACZ,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,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M,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAGhB;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD,eAAO,MAAM,UAAU;;;;;;;;;CASb,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Remote Environment — WebSocket Protocol Types
|
|
3
|
-
// ============================================================
|
|
4
|
-
// Defines the contract between the RemoteEnvironment client
|
|
5
|
-
// (open source, runs on developer machines and in colony zones)
|
|
6
|
-
// and any compatible signal server implementation.
|
|
7
|
-
//
|
|
8
|
-
// This protocol is intentionally simple: request-response with
|
|
9
|
-
// correlation IDs, plus server-pushed subscription messages.
|
|
10
|
-
// ============================================================
|
|
11
|
-
// ----------------------------------------------------------
|
|
12
|
-
// Protocol error codes
|
|
13
|
-
// ----------------------------------------------------------
|
|
14
|
-
export const ErrorCodes = {
|
|
15
|
-
AUTH_REQUIRED: 'AUTH_REQUIRED',
|
|
16
|
-
AUTH_FAILED: 'AUTH_FAILED',
|
|
17
|
-
INVALID_MESSAGE: 'INVALID_MESSAGE',
|
|
18
|
-
SIGNAL_NOT_FOUND: 'SIGNAL_NOT_FOUND',
|
|
19
|
-
CLAIM_FAILED: 'CLAIM_FAILED',
|
|
20
|
-
VALIDATION_ERROR: 'VALIDATION_ERROR',
|
|
21
|
-
INTERNAL_ERROR: 'INTERNAL_ERROR',
|
|
22
|
-
RATE_LIMITED: 'RATE_LIMITED',
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=protocol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../../src/environments/remote/protocol.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,gDAAgD;AAChD,+DAA+D;AAC/D,4DAA4D;AAC5D,gEAAgE;AAChE,mDAAmD;AACnD,EAAE;AACF,+DAA+D;AAC/D,6DAA6D;AAC7D,+DAA+D;AAsK/D,6DAA6D;AAC7D,uBAAuB;AACvB,6DAA6D;AAE7D,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,YAAY,EAAE,cAAc;IAC5B,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;CACpB,CAAC"}
|