@agentvault/agentvault 0.12.0 → 0.13.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/__tests__/install-plugin.test.d.ts +2 -0
- package/dist/__tests__/install-plugin.test.d.ts.map +1 -0
- package/dist/channel.d.ts +0 -9
- package/dist/channel.d.ts.map +1 -1
- package/dist/cli.js +6 -98
- package/dist/cli.js.map +2 -2
- package/dist/gateway-send.d.ts +0 -14
- package/dist/gateway-send.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -98
- package/dist/index.js.map +2 -2
- package/dist/openclaw-entry.d.ts.map +1 -1
- package/dist/openclaw-entry.js +44 -1
- package/dist/openclaw-entry.js.map +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/dist/channel.js +0 -2257
- package/dist/channel.js.map +0 -1
- package/dist/crypto-helpers.js +0 -4
- package/dist/crypto-helpers.js.map +0 -1
- package/dist/openclaw-plugin.js +0 -222
- package/dist/openclaw-plugin.js.map +0 -1
- package/dist/setup.js +0 -329
- package/dist/setup.js.map +0 -1
- package/dist/state.js +0 -61
- package/dist/state.js.map +0 -1
- package/dist/transport.js +0 -43
- package/dist/transport.js.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
package/dist/gateway-send.d.ts
CHANGED
|
@@ -29,20 +29,6 @@ export interface GatewayStatusResult {
|
|
|
29
29
|
* Never throws — returns `{ ok: false, error }` on failure.
|
|
30
30
|
*/
|
|
31
31
|
export declare function sendToOwner(text: string, options?: GatewaySendOptions): Promise<GatewaySendResult>;
|
|
32
|
-
export interface ActionReport {
|
|
33
|
-
action: string;
|
|
34
|
-
status: "completed" | "failed" | "partial";
|
|
35
|
-
room_id?: string;
|
|
36
|
-
detail?: string;
|
|
37
|
-
estimated_cost?: number;
|
|
38
|
-
decision_id?: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Report an action (deploy, execute, etc.) via the gateway HTTP server.
|
|
42
|
-
* Routes to sendActionConfirmationToRoom() (if room_id) or sendActionConfirmation().
|
|
43
|
-
* Never throws — returns `{ ok: false, error }` on failure.
|
|
44
|
-
*/
|
|
45
|
-
export declare function sendAction(report: ActionReport, options?: GatewaySendOptions): Promise<GatewaySendResult>;
|
|
46
32
|
/**
|
|
47
33
|
* Check gateway health / status.
|
|
48
34
|
* Never throws — returns `{ ok: false, error }` on failure.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-send.d.ts","sourceRoot":"","sources":["../src/gateway-send.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAsBD;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAuB5B;AAED
|
|
1
|
+
{"version":3,"file":"gateway-send.d.ts","sourceRoot":"","sources":["../src/gateway-send.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAsBD;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAuB5B;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CAmB9B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { SecureChannelConfig, ChannelState, MessageMetadata, AttachmentData
|
|
|
3
3
|
export { listAccountIds, resolveAccount } from "./account-config.js";
|
|
4
4
|
export type { ResolvedAccount } from "./account-config.js";
|
|
5
5
|
export { agentVaultPlugin, setOcRuntime, getActiveChannel } from "./openclaw-plugin.js";
|
|
6
|
-
export { sendToOwner,
|
|
7
|
-
export type { GatewaySendOptions, GatewaySendResult, GatewayStatusResult,
|
|
8
|
-
export declare const VERSION = "0.
|
|
6
|
+
export { sendToOwner, checkGateway } from "./gateway-send.js";
|
|
7
|
+
export type { GatewaySendOptions, GatewaySendResult, GatewayStatusResult, } from "./gateway-send.js";
|
|
8
|
+
export declare const VERSION = "0.11.0";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,WAAW,EACX,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,UAAU,EACV,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxF,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,WAAW,EACX,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,UAAU,EACV,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,OAAO,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -45907,9 +45907,7 @@ var SecureChannel = class _SecureChannel extends EventEmitter {
|
|
|
45907
45907
|
data: {
|
|
45908
45908
|
room_id: roomId,
|
|
45909
45909
|
recipients,
|
|
45910
|
-
message_type: messageType
|
|
45911
|
-
priority: opts?.priority ?? "normal",
|
|
45912
|
-
metadata: opts?.metadata
|
|
45910
|
+
message_type: messageType
|
|
45913
45911
|
}
|
|
45914
45912
|
})
|
|
45915
45913
|
);
|
|
@@ -45923,12 +45921,7 @@ var SecureChannel = class _SecureChannel extends EventEmitter {
|
|
|
45923
45921
|
"Content-Type": "application/json",
|
|
45924
45922
|
Authorization: `Bearer ${this._deviceJwt}`
|
|
45925
45923
|
},
|
|
45926
|
-
body: JSON.stringify({
|
|
45927
|
-
recipients,
|
|
45928
|
-
message_type: messageType,
|
|
45929
|
-
priority: opts?.priority ?? "normal",
|
|
45930
|
-
metadata: opts?.metadata
|
|
45931
|
-
})
|
|
45924
|
+
body: JSON.stringify({ recipients, message_type: messageType })
|
|
45932
45925
|
}
|
|
45933
45926
|
);
|
|
45934
45927
|
if (!res.ok) {
|
|
@@ -46073,27 +46066,6 @@ var SecureChannel = class _SecureChannel extends EventEmitter {
|
|
|
46073
46066
|
}
|
|
46074
46067
|
);
|
|
46075
46068
|
}
|
|
46076
|
-
async sendActionConfirmationToRoom(roomId, confirmation) {
|
|
46077
|
-
const envelope = {
|
|
46078
|
-
type: "action_confirmation",
|
|
46079
|
-
action: confirmation.action,
|
|
46080
|
-
status: confirmation.status
|
|
46081
|
-
};
|
|
46082
|
-
if (confirmation.decisionId !== void 0) envelope.decision_id = confirmation.decisionId;
|
|
46083
|
-
if (confirmation.detail !== void 0) envelope.detail = confirmation.detail;
|
|
46084
|
-
const metadata = {
|
|
46085
|
-
action: confirmation.action,
|
|
46086
|
-
status: confirmation.status
|
|
46087
|
-
};
|
|
46088
|
-
if (confirmation.estimated_cost !== void 0) {
|
|
46089
|
-
metadata.estimated_cost = confirmation.estimated_cost;
|
|
46090
|
-
}
|
|
46091
|
-
await this.sendToRoom(roomId, JSON.stringify(envelope), {
|
|
46092
|
-
messageType: "action_confirmation",
|
|
46093
|
-
priority: "high",
|
|
46094
|
-
metadata
|
|
46095
|
-
});
|
|
46096
|
-
}
|
|
46097
46069
|
_sendHeartbeat() {
|
|
46098
46070
|
if (this._state !== "ready" || !this._heartbeatCallback) return;
|
|
46099
46071
|
const status = this._heartbeatCallback();
|
|
@@ -46168,52 +46140,10 @@ var SecureChannel = class _SecureChannel extends EventEmitter {
|
|
|
46168
46140
|
res.end(JSON.stringify({ ok: false, error: "Missing 'text' field" }));
|
|
46169
46141
|
return;
|
|
46170
46142
|
}
|
|
46171
|
-
if (parsed.
|
|
46172
|
-
await this.sendToRoom(parsed.room_id, text, {
|
|
46173
|
-
messageType: parsed.message_type,
|
|
46174
|
-
priority: parsed.priority,
|
|
46175
|
-
metadata: parsed.metadata
|
|
46176
|
-
});
|
|
46177
|
-
} else if (parsed.file_path && typeof parsed.file_path === "string") {
|
|
46143
|
+
if (parsed.file_path && typeof parsed.file_path === "string") {
|
|
46178
46144
|
await this.sendWithAttachment(text, parsed.file_path, { topicId: parsed.topicId });
|
|
46179
46145
|
} else {
|
|
46180
|
-
await this.send(text, {
|
|
46181
|
-
topicId: parsed.topicId,
|
|
46182
|
-
messageType: parsed.message_type,
|
|
46183
|
-
metadata: parsed.metadata
|
|
46184
|
-
});
|
|
46185
|
-
}
|
|
46186
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
46187
|
-
res.end(JSON.stringify({ ok: true }));
|
|
46188
|
-
} catch (err) {
|
|
46189
|
-
res.writeHead(500, { "Content-Type": "application/json" });
|
|
46190
|
-
res.end(JSON.stringify({ ok: false, error: String(err) }));
|
|
46191
|
-
}
|
|
46192
|
-
});
|
|
46193
|
-
} else if (req.method === "POST" && req.url === "/action") {
|
|
46194
|
-
let body = "";
|
|
46195
|
-
req.on("data", (chunk) => {
|
|
46196
|
-
body += chunk.toString();
|
|
46197
|
-
});
|
|
46198
|
-
req.on("end", async () => {
|
|
46199
|
-
try {
|
|
46200
|
-
const parsed = JSON.parse(body);
|
|
46201
|
-
if (!parsed.action || typeof parsed.action !== "string") {
|
|
46202
|
-
res.writeHead(400, { "Content-Type": "application/json" });
|
|
46203
|
-
res.end(JSON.stringify({ ok: false, error: "Missing 'action' field" }));
|
|
46204
|
-
return;
|
|
46205
|
-
}
|
|
46206
|
-
const confirmation = {
|
|
46207
|
-
action: parsed.action,
|
|
46208
|
-
status: parsed.status ?? "completed",
|
|
46209
|
-
decisionId: parsed.decision_id,
|
|
46210
|
-
detail: parsed.detail,
|
|
46211
|
-
estimated_cost: parsed.estimated_cost
|
|
46212
|
-
};
|
|
46213
|
-
if (parsed.room_id && typeof parsed.room_id === "string") {
|
|
46214
|
-
await this.sendActionConfirmationToRoom(parsed.room_id, confirmation);
|
|
46215
|
-
} else {
|
|
46216
|
-
await this.sendActionConfirmation(confirmation);
|
|
46146
|
+
await this.send(text, { topicId: parsed.topicId });
|
|
46217
46147
|
}
|
|
46218
46148
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
46219
46149
|
res.end(JSON.stringify({ ok: true }));
|
|
@@ -46232,7 +46162,7 @@ var SecureChannel = class _SecureChannel extends EventEmitter {
|
|
|
46232
46162
|
}));
|
|
46233
46163
|
} else {
|
|
46234
46164
|
res.writeHead(404, { "Content-Type": "application/json" });
|
|
46235
|
-
res.end(JSON.stringify({ ok: false, error: "Not found. Use POST /send
|
|
46165
|
+
res.end(JSON.stringify({ ok: false, error: "Not found. Use POST /send or GET /status" }));
|
|
46236
46166
|
}
|
|
46237
46167
|
});
|
|
46238
46168
|
this._httpServer.listen(port, "127.0.0.1", () => {
|
|
@@ -48239,27 +48169,6 @@ async function sendToOwner(text, options) {
|
|
|
48239
48169
|
return { ok: false, error: friendlyError(err) };
|
|
48240
48170
|
}
|
|
48241
48171
|
}
|
|
48242
|
-
async function sendAction(report, options) {
|
|
48243
|
-
if (typeof report.action !== "string" || report.action.trim().length === 0) {
|
|
48244
|
-
return { ok: false, error: "Action must be a non-empty string" };
|
|
48245
|
-
}
|
|
48246
|
-
try {
|
|
48247
|
-
const base = resolveBaseUrl(options);
|
|
48248
|
-
const res = await fetch(`${base}/action`, {
|
|
48249
|
-
method: "POST",
|
|
48250
|
-
headers: { "Content-Type": "application/json" },
|
|
48251
|
-
body: JSON.stringify(report),
|
|
48252
|
-
signal: options?.signal
|
|
48253
|
-
});
|
|
48254
|
-
if (!res.ok) {
|
|
48255
|
-
const body = await res.text().catch(() => "");
|
|
48256
|
-
return { ok: false, error: `HTTP ${res.status}${body ? `: ${body}` : ""}` };
|
|
48257
|
-
}
|
|
48258
|
-
return { ok: true };
|
|
48259
|
-
} catch (err) {
|
|
48260
|
-
return { ok: false, error: friendlyError(err) };
|
|
48261
|
-
}
|
|
48262
|
-
}
|
|
48263
48172
|
async function checkGateway(options) {
|
|
48264
48173
|
try {
|
|
48265
48174
|
const base = resolveBaseUrl(options);
|
|
@@ -48280,7 +48189,7 @@ async function checkGateway(options) {
|
|
|
48280
48189
|
}
|
|
48281
48190
|
|
|
48282
48191
|
// src/index.ts
|
|
48283
|
-
var VERSION = "0.
|
|
48192
|
+
var VERSION = "0.11.0";
|
|
48284
48193
|
export {
|
|
48285
48194
|
SecureChannel,
|
|
48286
48195
|
VERSION,
|
|
@@ -48289,7 +48198,6 @@ export {
|
|
|
48289
48198
|
getActiveChannel,
|
|
48290
48199
|
listAccountIds,
|
|
48291
48200
|
resolveAccount,
|
|
48292
|
-
sendAction,
|
|
48293
48201
|
sendToOwner,
|
|
48294
48202
|
setOcRuntime
|
|
48295
48203
|
};
|