@agentvault/agentvault 0.19.58 → 0.19.59
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/_cp.d.ts +10 -0
- package/dist/_cp.d.ts.map +1 -0
- package/dist/account-config.d.ts +20 -0
- package/dist/account-config.d.ts.map +1 -0
- package/dist/channel.d.ts +389 -0
- package/dist/channel.d.ts.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +42 -415
- package/dist/cli.js.map +2 -2
- package/dist/create-agent.d.ts +28 -0
- package/dist/create-agent.d.ts.map +1 -0
- package/dist/credential-store.d.ts +62 -0
- package/dist/credential-store.d.ts.map +1 -0
- package/dist/crypto-helpers.d.ts +2 -0
- package/dist/crypto-helpers.d.ts.map +1 -0
- package/dist/doctor.d.ts +41 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/fetch-interceptor.d.ts +32 -0
- package/dist/fetch-interceptor.d.ts.map +1 -0
- package/dist/gateway-send.d.ts +98 -0
- package/dist/gateway-send.d.ts.map +1 -0
- package/dist/http-handlers.d.ts +53 -0
- package/dist/http-handlers.d.ts.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -415
- package/dist/index.js.map +2 -2
- package/dist/mcp-handlers.d.ts +26 -0
- package/dist/mcp-handlers.d.ts.map +1 -0
- package/dist/mcp-proxy-helpers.d.ts +9 -0
- package/dist/mcp-proxy-helpers.d.ts.map +1 -0
- package/dist/mcp-server.d.ts +91 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mls-state.d.ts +16 -0
- package/dist/mls-state.d.ts.map +1 -0
- package/dist/openclaw-compat.d.ts +33 -0
- package/dist/openclaw-compat.d.ts.map +1 -0
- package/dist/openclaw-entry.d.ts +32 -0
- package/dist/openclaw-entry.d.ts.map +1 -0
- package/dist/openclaw-plugin.d.ts +102 -0
- package/dist/openclaw-plugin.d.ts.map +1 -0
- package/dist/openclaw-types.d.ts +186 -0
- package/dist/openclaw-types.d.ts.map +1 -0
- package/dist/policy-enforcer.d.ts +78 -0
- package/dist/policy-enforcer.d.ts.map +1 -0
- package/dist/setup.d.ts +27 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/skill-invoker.d.ts +30 -0
- package/dist/skill-invoker.d.ts.map +1 -0
- package/dist/skill-manifest.d.ts +30 -0
- package/dist/skill-manifest.d.ts.map +1 -0
- package/dist/skill-telemetry.d.ts +36 -0
- package/dist/skill-telemetry.d.ts.map +1 -0
- package/dist/skills-publish.d.ts +8 -0
- package/dist/skills-publish.d.ts.map +1 -0
- package/dist/state.d.ts +32 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/transport.d.ts +24 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/types.d.ts +421 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/workspace-handlers.d.ts +62 -0
- package/dist/workspace-handlers.d.ts.map +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentVault "create" command — spin up a brand new OpenClaw peer agent.
|
|
3
|
+
*
|
|
4
|
+
* Ports the logic from ~/.openclaw/workspace/scripts/create-agent.sh into
|
|
5
|
+
* TypeScript, eliminating the jq dependency.
|
|
6
|
+
*
|
|
7
|
+
* Usage: npx @agentvault/agentvault create <name> --token=av_tok_...
|
|
8
|
+
*/
|
|
9
|
+
export interface CreateAgentOptions {
|
|
10
|
+
name: string;
|
|
11
|
+
token: string;
|
|
12
|
+
port?: number;
|
|
13
|
+
apiUrl: string;
|
|
14
|
+
force?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Resolve the OpenClaw home directory (~/.openclaw) */
|
|
17
|
+
export declare function openclawHome(): string;
|
|
18
|
+
/** Parse openclaw.json and return its contents. */
|
|
19
|
+
export declare function readOpenClawConfig(home: string): any;
|
|
20
|
+
/**
|
|
21
|
+
* Scan all accounts in openclaw.json for httpPort values and return next free port.
|
|
22
|
+
* Minimum port is `startPort` (default 18790).
|
|
23
|
+
*/
|
|
24
|
+
export declare function findNextPort(config: any, startPort?: number): number;
|
|
25
|
+
/** Generate workspace template files for a new agent. */
|
|
26
|
+
export declare function generateWorkspaceFiles(name: string): Record<string, string>;
|
|
27
|
+
export declare function runCreateCommand(options: CreateAgentOptions): Promise<void>;
|
|
28
|
+
//# sourceMappingURL=create-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-agent.d.ts","sourceRoot":"","sources":["../src/create-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAID,wDAAwD;AACxD,wBAAgB,YAAY,IAAI,MAAM,CAGrC;AAED,mDAAmD;AACnD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAIpD;AA4BD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,SAAQ,GAAG,MAAM,CAInE;AAOD,yDAAyD;AACzD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8C3E;AAID,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqOjF"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory credential store for renter-provided credentials.
|
|
3
|
+
*
|
|
4
|
+
* Security design:
|
|
5
|
+
* - Never persisted to disk (agentvault.json or any file)
|
|
6
|
+
* - Scoped by room ID (each rental = one room)
|
|
7
|
+
* - Auto-purges on process exit (SIGINT, SIGTERM, exit)
|
|
8
|
+
* - Credential values stripped before any logging
|
|
9
|
+
* - Nonce tracking for replay prevention
|
|
10
|
+
*/
|
|
11
|
+
export interface RenterCredential {
|
|
12
|
+
key: string;
|
|
13
|
+
value: string;
|
|
14
|
+
type: string;
|
|
15
|
+
scope: string;
|
|
16
|
+
grantedAt: string;
|
|
17
|
+
agreementId: string;
|
|
18
|
+
roomId: string;
|
|
19
|
+
}
|
|
20
|
+
/** Redacted view of a credential (for logging / context without values). */
|
|
21
|
+
export interface CredentialInfo {
|
|
22
|
+
key: string;
|
|
23
|
+
type: string;
|
|
24
|
+
scope: string;
|
|
25
|
+
grantedAt: string;
|
|
26
|
+
}
|
|
27
|
+
export declare class CredentialStore {
|
|
28
|
+
/** Map<roomId, Map<credentialKey, RenterCredential>> */
|
|
29
|
+
private _store;
|
|
30
|
+
/** Seen nonces for replay prevention — bounded per room */
|
|
31
|
+
private _seenNonces;
|
|
32
|
+
private static readonly MAX_NONCES_PER_ROOM;
|
|
33
|
+
constructor();
|
|
34
|
+
/**
|
|
35
|
+
* Check if a nonce has been seen (replay prevention).
|
|
36
|
+
* Returns true if the nonce is new (not a replay), false if seen before.
|
|
37
|
+
*/
|
|
38
|
+
checkNonce(roomId: string, nonce: string): boolean;
|
|
39
|
+
/** Store a credential for a room. */
|
|
40
|
+
grant(roomId: string, credential: RenterCredential): void;
|
|
41
|
+
/** Revoke a specific credential. */
|
|
42
|
+
revoke(roomId: string, key: string): boolean;
|
|
43
|
+
/** Revoke all credentials for a room. */
|
|
44
|
+
revokeAll(roomId: string): void;
|
|
45
|
+
/** Get a credential value. */
|
|
46
|
+
get(roomId: string, key: string): RenterCredential | undefined;
|
|
47
|
+
/** Get all credentials for a room (values included — only for agent context injection). */
|
|
48
|
+
getAll(roomId: string): RenterCredential[];
|
|
49
|
+
/** Get credential info without values (safe for logging). */
|
|
50
|
+
getInfo(roomId: string): CredentialInfo[];
|
|
51
|
+
/** Check if a specific credential exists. */
|
|
52
|
+
has(roomId: string, key: string): boolean;
|
|
53
|
+
/** Get credential count for a room. */
|
|
54
|
+
count(roomId: string): number;
|
|
55
|
+
/** Purge all credentials for a room (rental end). */
|
|
56
|
+
purgeForRoom(roomId: string): void;
|
|
57
|
+
/** Purge everything (process exit). */
|
|
58
|
+
purgeAll(): void;
|
|
59
|
+
/** Get a map of credential key → value for context injection. */
|
|
60
|
+
getCredentialMap(roomId: string): Record<string, string>;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=credential-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-store.d.ts","sourceRoot":"","sources":["../src/credential-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,eAAe;IAC1B,wDAAwD;IACxD,OAAO,CAAC,MAAM,CAAoD;IAClE,2DAA2D;IAC3D,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAQ;;IAUnD;;;OAGG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAwBlD,qCAAqC;IACrC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI;IASzD,oCAAoC;IACpC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAM5C,yCAAyC;IACzC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B,8BAA8B;IAC9B,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAI9D,2FAA2F;IAC3F,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,EAAE;IAM1C,6DAA6D;IAC7D,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE;IAWzC,6CAA6C;IAC7C,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzC,uCAAuC;IACvC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI7B,qDAAqD;IACrD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAKlC,uCAAuC;IACvC,QAAQ,IAAI,IAAI;IAKhB,iEAAiE;IACjE,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CASzD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { hexToBytes, bytesToHex, base64ToBytes, bytesToBase64, encryptedMessageToTransport, transportToEncryptedMessage, encryptedMessageToTransportV2Full, type TransportMessage, type TransportMessageV2, } from "@agentvault/crypto";
|
|
2
|
+
//# sourceMappingURL=crypto-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto-helpers.d.ts","sourceRoot":"","sources":["../src/crypto-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,2BAA2B,EAC3B,2BAA2B,EAC3B,iCAAiC,EACjC,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC"}
|
package/dist/doctor.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentVault "doctor" command — diagnostic checks and plist fixer.
|
|
3
|
+
*
|
|
4
|
+
* Detects stale macOS LaunchAgent plist paths (common after pnpm updates)
|
|
5
|
+
* and offers to install a stable wrapper script so future updates don't
|
|
6
|
+
* break the gateway.
|
|
7
|
+
*
|
|
8
|
+
* Usage: npx @agentvault/agentvault doctor [--fix]
|
|
9
|
+
*/
|
|
10
|
+
export type CheckStatus = "pass" | "warn" | "fail" | "skip";
|
|
11
|
+
export interface CheckResult {
|
|
12
|
+
name: string;
|
|
13
|
+
status: CheckStatus;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PlistInfo {
|
|
17
|
+
plistPath: string;
|
|
18
|
+
programArgs: string[];
|
|
19
|
+
stalePaths: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface PlistValidationResult {
|
|
22
|
+
status: "ok" | "stale" | "missing" | "skip" | "already-fixed";
|
|
23
|
+
plistPath?: string;
|
|
24
|
+
stalePaths?: string[];
|
|
25
|
+
}
|
|
26
|
+
export declare function checkOpenClawInstalled(): CheckResult;
|
|
27
|
+
export declare function checkConfigExists(home: string): CheckResult;
|
|
28
|
+
export declare function checkAgentVaultChannel(config: any): CheckResult;
|
|
29
|
+
export declare function checkPluginsAllow(config: any): CheckResult;
|
|
30
|
+
export declare function checkPlist(): CheckResult;
|
|
31
|
+
export declare function checkGatewayPort(): CheckResult;
|
|
32
|
+
export declare function checkAgentDataDirs(config: any): CheckResult;
|
|
33
|
+
export declare function checkPm2Status(): CheckResult;
|
|
34
|
+
export declare function plistPath(): string;
|
|
35
|
+
export declare function parsePlist(plistFile: string): PlistInfo | null;
|
|
36
|
+
export declare function validatePlist(): PlistValidationResult;
|
|
37
|
+
export declare function applyPlistFix(info: PlistInfo): boolean;
|
|
38
|
+
export declare function runDoctorCommand(options?: {
|
|
39
|
+
fix?: bo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AG,IAAI,CA2B9D;AAED,wBAAgB,aAAa,IAAI,qBAAqB,CA2BrD;AAID,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAsEtD;AAID,wBAAsB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoGjF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface HttpCallReport {
|
|
2
|
+
method: string;
|
|
3
|
+
url: string;
|
|
4
|
+
statusCode: number;
|
|
5
|
+
latencyMs: number;
|
|
6
|
+
traceId?: string;
|
|
7
|
+
parentSpanId?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TraceContext {
|
|
10
|
+
traceId: string;
|
|
11
|
+
parentSpanId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FetchInterceptorOptions {
|
|
14
|
+
onHttpCall: (report: HttpCallReport) => void;
|
|
15
|
+
skipPatterns?: RegExp[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Install HTTP interceptor using both undici diagnostics channels and
|
|
19
|
+
* globalThis.fetch monkey-patching. Idempotent.
|
|
20
|
+
*/
|
|
21
|
+
export declare function installFetchInterceptor(opts: FetchInterceptorOptions): void;
|
|
22
|
+
/**
|
|
23
|
+
* Uninstall all interceptors. Safe to call even if not installed.
|
|
24
|
+
*/
|
|
25
|
+
export declare function uninstallFetchInterceptor(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Run an async function with trace context attached via AsyncLocalStorage.
|
|
28
|
+
* Any HTTP calls made within `fn` (via undici or fetch) will include
|
|
29
|
+
* traceId/parentSpanId in their HttpCallReport.
|
|
30
|
+
*/
|
|
31
|
+
export declare function runWithTraceContext<T>(ctx: TraceContext, fn: () => T | Promise<T>): Promise<T>;
|
|
32
|
+
//# sourceMappingURL=fetch-interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-interceptor.d.ts","sourceRoot":"","sources":["../src/fetch-interceptor.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AA0CD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAmK3E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAkBhD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,GAAG,EAAE,YAAY,EACjB,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACvB,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gateway send helper — lets agents send messages to their owner
|
|
3
|
+
* via the plugin's local HTTP server (port 18790) or OpenClaw managed routes.
|
|
4
|
+
*
|
|
5
|
+
* Delivery path: sendToOwner() → plugin HTTP /send → SecureChannel.send()
|
|
6
|
+
* → Double Ratchet encrypt → WebSocket → backend → owner's app
|
|
7
|
+
*/
|
|
8
|
+
export interface GatewaySendOptions {
|
|
9
|
+
/** Override the gateway port (default: env GATEWAY_SEND_PORT or 18790) */
|
|
10
|
+
port?: number;
|
|
11
|
+
/** Override the gateway host (default: 127.0.0.1) */
|
|
12
|
+
host?: string;
|
|
13
|
+
/** AbortSignal for cancellation */
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}
|
|
16
|
+
export interface GatewaySendResult {
|
|
17
|
+
ok: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GatewayStatusResult {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
state?: string;
|
|
23
|
+
deviceId?: string;
|
|
24
|
+
sessions?: number;
|
|
25
|
+
error?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Send a plaintext message to the agent's owner via the gateway HTTP server.
|
|
29
|
+
* Never throws — returns `{ ok: false, error }` on failure.
|
|
30
|
+
*/
|
|
31
|
+
export declare function sendToOwner(text: string, options?: GatewaySendOptions): Promise<GatewaySendResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Send a decision request to the agent's owner via the gateway HTTP server.
|
|
34
|
+
* Never throws — returns `{ ok: false, error }` on failure.
|
|
35
|
+
*/
|
|
36
|
+
export declare function sendDecisionToOwner(request: {
|
|
37
|
+
title: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
options: Array<{
|
|
40
|
+
option_id: string;
|
|
41
|
+
label: string;
|
|
42
|
+
risk_level?: string;
|
|
43
|
+
is_default?: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
context_refs?: Array<{
|
|
46
|
+
type: string;
|
|
47
|
+
uri: string;
|
|
48
|
+
label: string;
|
|
49
|
+
}>;
|
|
50
|
+
deadline?: string;
|
|
51
|
+
auto_action?: {
|
|
52
|
+
option_id: string;
|
|
53
|
+
trigger: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
};
|
|
56
|
+
}, options?: GatewaySendOptions): Promise<GatewaySendResult & {
|
|
57
|
+
decision_id?: string;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Send a plaintext message to a specific room via the gateway HTTP server.
|
|
61
|
+
* Never throws — returns `{ ok: false, error }` on failure.
|
|
62
|
+
*/
|
|
63
|
+
export declare function sendToRoom(roomId: string, text: string, options?: GatewaySendOptions): Promise<GatewaySendResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Send a plaintext message to any target via the gateway HTTP server.
|
|
66
|
+
* Accepts target strings: "owner", "room:<id>", "a2a:<addr>", "context".
|
|
67
|
+
* Never throws — returns `{ ok: false, error }` on failure.
|
|
68
|
+
*/
|
|
69
|
+
export declare function sendToTarget(target: string, text: string, options?: GatewaySendOptions): Promise<GatewaySendResult & {
|
|
70
|
+
destination?: {
|
|
71
|
+
kind: string;
|
|
72
|
+
id?: string;
|
|
73
|
+
};
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* Discover available delivery targets from the gateway.
|
|
77
|
+
* Never throws — returns `{ ok: false, error }` on failure.
|
|
78
|
+
*/
|
|
79
|
+
export declare function listTargets(options?: GatewaySendOptions): Promise<{
|
|
80
|
+
ok: boolean;
|
|
81
|
+
targets?: Array<{
|
|
82
|
+
kind: string;
|
|
83
|
+
id: string;
|
|
84
|
+
label: string;
|
|
85
|
+
available: boolean;
|
|
86
|
+
}>;
|
|
87
|
+
context?: {
|
|
88
|
+
kind: string;
|
|
89
|
+
roomId?: string;
|
|
90
|
+
};
|
|
91
|
+
error?: string;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* Check gateway health / status.
|
|
95
|
+
* Never throws — returns `{ ok: false, error }` on failure.
|
|
96
|
+
*/
|
|
97
|
+
export declare function checkGateway(options?: GatewaySendOptions): Promise<GatewayStatusResult>;
|
|
98
|
+
//# sourceMappingURL=gateway-send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-send.d.ts","sourceRoot":"","sources":["../src/gateway-send.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,C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A8BvD;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CA8B5B;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,iBAAiB,GAAG;IAAE,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,CA0C9E;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBzK;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CAoB9B"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracted HTTP handler logic for the AgentVault plugin.
|
|
3
|
+
*
|
|
4
|
+
* These handlers are shared between:
|
|
5
|
+
* 1. The self-managed HTTP server in channel.ts (legacy/fallback path)
|
|
6
|
+
* 2. OpenClaw's registerHttpRoute() managed routes (new path)
|
|
7
|
+
*
|
|
8
|
+
* Both entry points call the same handler functions, ensuring consistent
|
|
9
|
+
* behavior regardless of how the route is served.
|
|
10
|
+
*/
|
|
11
|
+
import type { SecureChannel } from "./channel.js";
|
|
12
|
+
export interface HandlerResult {
|
|
13
|
+
status: number;
|
|
14
|
+
body: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Handle POST /send — send a message (text, file, or room).
|
|
18
|
+
*
|
|
19
|
+
* Routing: explicit target fields only — no silent lastInboundRoomId fallback.
|
|
20
|
+
* - hub_address / a2a_address / channel_id → A2A
|
|
21
|
+
* - room_id → room
|
|
22
|
+
* - target: "context" → resolve from lastInboundRoomId (opt-in)
|
|
23
|
+
* - No target fields → owner (the breaking fix)
|
|
24
|
+
*/
|
|
25
|
+
export declare function handleSendRequest(parsed: Record<string, unknown>, channel: SecureChannel): Promise<HandlerResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Handle POST /action — send an action confirmation.
|
|
28
|
+
*/
|
|
29
|
+
export declare function handleActionRequest(parsed: Record<string, unknown>, channel: SecureChannel): Promise<HandlerResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Handle POST /decision — send a decision request to the owner.
|
|
32
|
+
*/
|
|
33
|
+
export declare function handleDecisionRequest(parsed: Record<string, unknown>, channel: SecureChannel): Promise<HandlerResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Handle GET /status — return channel health info.
|
|
36
|
+
*/
|
|
37
|
+
export declare function handleStatusRequest(channel: SecureChannel): HandlerResult;
|
|
38
|
+
/**
|
|
39
|
+
* Handle GET /targets — return available delivery destinations.
|
|
40
|
+
*/
|
|
41
|
+
export declare function handleTargetsRequest(channel: SecureChannel): HandlerResult;
|
|
42
|
+
/**
|
|
43
|
+
* Handle GET /trust — return the agent's current Trust Gate token state.
|
|
44
|
+
*/
|
|
45
|
+
export declare function handleTrustRequest(channel: SecureChannel): HandlerResult;
|
|
46
|
+
/**
|
|
47
|
+
* Handle GET /mcp-config — return MCP connection config for this agent.
|
|
48
|
+
*
|
|
49
|
+
* Returns JSON suitable for adding to Claude Code, Cursor, or other MCP host
|
|
50
|
+
* configuration files.
|
|
51
|
+
*/
|
|
52
|
+
export declare function handleMcpConfigRequest(agentName: string, port: number, mcpSkillCount: number): HandlerResult;
|
|
53
|
+
//# sourceMappingURL=http-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-handlers.d.ts","sourceRoot":"","sources":["../src/http-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CAqExB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CAmCxB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CA8BxB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAUzE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAW1E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,aAAa,GACrB,aAAa,CAiBf;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,GACpB,aAAa,CAkBf"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { SecureChannel } from "./channel.js";
|
|
2
|
+
export type { SecureChannelConfig, ChannelState, MessageMetadata, AttachmentData, PersistedState, LegacyPersistedState, DeviceSession, HistoryEntry, SendOptions, DecisionOption, DecisionRequest, DecisionResponse, ContextRef, HeartbeatStatus, StatusAlert, RoomInfo, RoomMemberInfo, RoomConversationInfo, RoomState, A2AChannel, A2AMessage, RoomParticipantEvent, DeliveryTarget, DeliveryContent, DeliveryOptions, DeliveryReceipt, TargetInfo, ActionConfirmation, ArtifactPayload, PolicyAlert, ApprovalRequest, ApprovalResponse, CredentialGrantPayload, CredentialRevokePayload, CredentialAckPayload, CredentialRequestPayload, } from "./types.js";
|
|
3
|
+
export { parseTarget } from "./types.js";
|
|
4
|
+
export { CredentialStore } from "./credential-store.js";
|
|
5
|
+
export type { RenterCredential, CredentialInfo } from "./credential-store.js";
|
|
6
|
+
export { listAccountIds, resolveAccount } from "./account-config.js";
|
|
7
|
+
export type { ResolvedAccount } from "./account-config.js";
|
|
8
|
+
export { agentVaultPlugin, setOcRuntime, getActiveChannel } from "./openclaw-plugin.js";
|
|
9
|
+
export { sendToOwner, sendToRoom, sendToTarget, listTargets, sendDecisionToOwner, checkGateway } from "./gateway-send.js";
|
|
10
|
+
export type { GatewaySendOptions, GatewaySendResult, GatewayStatusResult, } from "./gateway-send.js";
|
|
11
|
+
export { requestHeartbeatNow, onAgentEvent, onSessionTranscriptUpdate } from "./openclaw-compat.js";
|
|
12
|
+
export { isUsingManagedRoutes } from "./openclaw-entry.js";
|
|
13
|
+
export { handleSendRequest, handleActionRequest, handleDecisionRequest, handleStatusRequest, handleTargetsRequest } from "./http-handlers.js";
|
|
14
|
+
export type { HandlerResult } from "./http-handlers.js";
|
|
15
|
+
export { AgentVaultMcpServer } from "./mcp-server.js";
|
|
16
|
+
export type { SkillDefinition, McpServerOpts } from "./mcp-server.js";
|
|
17
|
+
export { createMcpHandler, getMcpStatus } from "./mcp-handlers.js";
|
|
18
|
+
export { parseSkillMd, loadSkillsFromDirectory, loadSkillsFromApi, mergeSkills } from "./skill-manifest.js";
|
|
19
|
+
export type { SkillManifest } from "./skill-manifest.js";
|
|
20
|
+
export { invokeSkill } from "./skill-invoker.js";
|
|
21
|
+
export type { InvocationResult, InvocationOpts } from "./skill-invoker.js";
|
|
22
|
+
export { wrapSkillExecution, reportSkillInvocation, drainSkillSpans } from "./skill-telemetry.js";
|
|
23
|
+
export { PolicyEnforcer } from "./policy-enforcer.js";
|
|
24
|
+
export type { PolicyContext, PolicyResult, PolicyViolation, PolicyMetrics } from "./policy-enforcer.js";
|
|
25
|
+
export type { OpenClawPluginApi, PluginRuntime, ChannelGatewayContext, ChannelOutboundPayloadContext, ReplyPayload, MessageSentEvent, SessionStartEvent, SessionEndEvent, AgentEventPayload, TranscriptUpdatePayload, } from "./openclaw-types.js";
|
|
26
|
+
export declare const VERSION = "0.14.1";
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,EACpB,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,eAAe,EAC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