enclave-link 0.1.0 → 0.2.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 +32 -12
- package/dist/chunk-7QIF4PCL.js +6783 -0
- package/dist/{chunk-LUHJCCBX.js → chunk-RHLID3KU.js} +598 -461
- package/dist/enclave.js +48 -24
- package/dist/index.js +4 -2
- package/dist/{mcp-WPCCWEA2.js → mcp-GVB6A3NA.js} +898 -7394
- package/dist/types/answer.d.ts +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/passkey.d.ts +8 -6
- package/dist/types/proton.d.ts +21 -12
- package/dist/types/store.d.ts +2 -0
- package/dist/types/vault.d.ts +24 -12
- package/package.json +17 -13
- package/dist/chunk-U67V476Y.js +0 -35
package/dist/types/answer.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type Answer = Record<string, string>;
|
|
2
2
|
export declare function sealAnswer(publicKey: Uint8Array<ArrayBuffer>, name: string, answer: Answer): Promise<Uint8Array<ArrayBuffer>>;
|
|
3
|
-
export declare function openAnswer(privateKey: Uint8Array<ArrayBuffer>, name: string, sealed: Uint8Array<ArrayBuffer>): Promise<
|
|
3
|
+
export declare function openAnswer(privateKey: Uint8Array<ArrayBuffer>, name: string, sealed: Uint8Array<ArrayBuffer>): Promise<any>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Store, type Item } from "./store.js";
|
|
2
|
+
export { openVault, vault, type ItemStore, type Request, type Vault, type VaultOptions } from "./vault.js";
|
package/dist/types/passkey.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
1
2
|
import type { Passkey } from "./proton.js";
|
|
2
|
-
export
|
|
3
|
-
origin:
|
|
4
|
-
rpId
|
|
5
|
-
challenge:
|
|
6
|
-
allowCredentials
|
|
7
|
-
}
|
|
3
|
+
export declare const signRequest: z.ZodObject<{
|
|
4
|
+
origin: z.ZodString;
|
|
5
|
+
rpId: z.ZodOptional<z.ZodString>;
|
|
6
|
+
challenge: z.ZodString;
|
|
7
|
+
allowCredentials: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type SignRequest = z.infer<typeof signRequest>;
|
|
8
10
|
export interface Assertion {
|
|
9
11
|
id: string;
|
|
10
12
|
authenticatorData: string;
|
package/dist/types/proton.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
1
2
|
import type { Item } from "./store.js";
|
|
2
|
-
|
|
3
|
-
title:
|
|
4
|
-
content:
|
|
5
|
-
note
|
|
6
|
-
extra_fields
|
|
7
|
-
name:
|
|
8
|
-
content:
|
|
9
|
-
}
|
|
10
|
-
}
|
|
3
|
+
declare const protonItem: z.ZodObject<{
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6
|
+
note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
extra_fields: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
10
|
+
}, z.core.$strip>>>>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type ProtonItem = z.input<typeof protonItem>;
|
|
11
13
|
export interface Passkey {
|
|
12
14
|
rpId: string;
|
|
13
15
|
credentialId: string;
|
|
@@ -15,7 +17,14 @@ export interface Passkey {
|
|
|
15
17
|
userName: string;
|
|
16
18
|
privateKey: string;
|
|
17
19
|
}
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
+
export interface ProtonEntry {
|
|
21
|
+
id: string;
|
|
22
|
+
vault: string;
|
|
23
|
+
content: ProtonItem;
|
|
24
|
+
}
|
|
25
|
+
export declare function protonVaults(): Promise<string[]>;
|
|
26
|
+
export declare function readProton(vault: string): Promise<ProtonEntry[]>;
|
|
27
|
+
export declare function toItems<Entry extends ProtonItem>(proton: Iterable<Entry>, items?: Map<string, true | Item>): Generator<readonly [string, Item, Entry], void, unknown>;
|
|
20
28
|
export declare function toItem({ content, note, extra_fields }: ProtonItem): Item;
|
|
21
|
-
export declare function readPasskey(content:
|
|
29
|
+
export declare function readPasskey(content: number[]): Passkey;
|
|
30
|
+
export {};
|
package/dist/types/store.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type Item = Record<string, string>;
|
|
2
2
|
export declare class Store {
|
|
3
3
|
readonly dir: string;
|
|
4
|
+
private keys?;
|
|
4
5
|
constructor(dir: string);
|
|
5
6
|
get(name: string): Promise<Item | undefined>;
|
|
6
7
|
put(name: string, item: Item): Promise<void>;
|
|
@@ -8,5 +9,6 @@ export declare class Store {
|
|
|
8
9
|
names(): Promise<string[]>;
|
|
9
10
|
private path;
|
|
10
11
|
private key;
|
|
12
|
+
private load;
|
|
11
13
|
private temporary;
|
|
12
14
|
}
|
package/dist/types/vault.d.ts
CHANGED
|
@@ -1,45 +1,57 @@
|
|
|
1
1
|
import { type SignRequest } from "./passkey.js";
|
|
2
2
|
import { type Stdio } from "./run.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Store } from "./store.js";
|
|
4
4
|
export interface VaultOptions {
|
|
5
5
|
from?: string;
|
|
6
6
|
home?: string;
|
|
7
7
|
relay?: string;
|
|
8
|
+
store?: ItemStore;
|
|
8
9
|
}
|
|
10
|
+
export type ItemStore = Pick<Store, "get" | "put" | "remove" | "names">;
|
|
9
11
|
export interface Request {
|
|
10
12
|
url: string;
|
|
11
13
|
wait(): Promise<string[]>;
|
|
12
14
|
}
|
|
13
|
-
export declare function openVault({ from, home, relay, }?: VaultOptions): {
|
|
15
|
+
export declare function openVault({ from, home, relay, store, }?: VaultOptions): {
|
|
14
16
|
ask: (name: string, fields?: string[]) => Promise<Request>;
|
|
15
|
-
wait: (name: string) => Promise<string[]>;
|
|
17
|
+
wait: (name: string, signal?: AbortSignal) => Promise<string[]>;
|
|
16
18
|
get: (name: string, field: string) => Promise<string>;
|
|
17
|
-
|
|
19
|
+
save: (name: string, field: string, value: string) => Promise<void>;
|
|
20
|
+
list: (search?: string) => Promise<{
|
|
18
21
|
name: string;
|
|
19
22
|
fields: string[];
|
|
20
23
|
}[]>;
|
|
21
24
|
remove: (name: string) => Promise<void>;
|
|
22
25
|
run: (command: string[], secrets: Record<string, string>, stdio?: Stdio) => Promise<number>;
|
|
23
|
-
importProton: (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
importProton: (vaults?: string[]) => Promise<{
|
|
27
|
+
items: {
|
|
28
|
+
name: string;
|
|
29
|
+
fields: string[];
|
|
30
|
+
}[];
|
|
31
|
+
removed: string[];
|
|
26
32
|
}>;
|
|
33
|
+
passkey: (name: string, field?: string, timeout?: number) => Promise<void>;
|
|
27
34
|
sign: (request: SignRequest) => Promise<import("./passkey.ts").Assertion>;
|
|
28
35
|
};
|
|
29
36
|
export type Vault = ReturnType<typeof openVault>;
|
|
30
37
|
export declare const vault: {
|
|
31
38
|
ask: (name: string, fields?: string[]) => Promise<Request>;
|
|
32
|
-
wait: (name: string) => Promise<string[]>;
|
|
39
|
+
wait: (name: string, signal?: AbortSignal) => Promise<string[]>;
|
|
33
40
|
get: (name: string, field: string) => Promise<string>;
|
|
34
|
-
|
|
41
|
+
save: (name: string, field: string, value: string) => Promise<void>;
|
|
42
|
+
list: (search?: string) => Promise<{
|
|
35
43
|
name: string;
|
|
36
44
|
fields: string[];
|
|
37
45
|
}[]>;
|
|
38
46
|
remove: (name: string) => Promise<void>;
|
|
39
47
|
run: (command: string[], secrets: Record<string, string>, stdio?: Stdio) => Promise<number>;
|
|
40
|
-
importProton: (
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
importProton: (vaults?: string[]) => Promise<{
|
|
49
|
+
items: {
|
|
50
|
+
name: string;
|
|
51
|
+
fields: string[];
|
|
52
|
+
}[];
|
|
53
|
+
removed: string[];
|
|
43
54
|
}>;
|
|
55
|
+
passkey: (name: string, field?: string, timeout?: number) => Promise<void>;
|
|
44
56
|
sign: (request: SignRequest) => Promise<import("./passkey.ts").Assertion>;
|
|
45
57
|
};
|
package/package.json
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enclave-link",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A vault for your agent: ask for secrets by encrypted one-time link, use them unseen, 2FA and passkeys too",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/types/index.d.ts",
|
|
10
|
-
"default": "./dist/index.js"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"types": "./dist/types/index.d.ts",
|
|
14
6
|
"bin": {
|
|
15
7
|
"enclave": "dist/enclave.js"
|
|
16
8
|
},
|
|
17
9
|
"files": [
|
|
18
10
|
"dist"
|
|
19
11
|
],
|
|
20
|
-
"
|
|
21
|
-
|
|
12
|
+
"type": "module",
|
|
13
|
+
"types": "./dist/types/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/types/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
22
19
|
},
|
|
23
20
|
"scripts": {
|
|
24
21
|
"dev": "node scripts/page.ts && convex dev",
|
|
25
22
|
"deploy": "node scripts/page.ts && convex deploy",
|
|
26
23
|
"build": "node scripts/build.ts",
|
|
27
24
|
"prepack": "npm run build",
|
|
28
|
-
"check": "node scripts/page.ts && tsc -p . && node --test 'test/*.test.ts'"
|
|
25
|
+
"check": "node scripts/page.ts && tsc -p . && oxlint && oxfmt --check && node --test 'test/*.test.ts'",
|
|
26
|
+
"format": "oxfmt && oxlint --fix"
|
|
29
27
|
},
|
|
30
28
|
"devDependencies": {
|
|
31
29
|
"@convex-dev/rate-limiter": "^0.4.1",
|
|
32
30
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
33
31
|
"@msgpack/msgpack": "^3.1.3",
|
|
32
|
+
"@oxlint/plugins": "^1.90.0",
|
|
34
33
|
"@types/node": "^24.0.0",
|
|
35
34
|
"convex": "^1.46.0",
|
|
36
35
|
"esbuild": "0.27.0",
|
|
36
|
+
"oxfmt": "^0.75.0",
|
|
37
|
+
"oxlint": "^1.90.0",
|
|
37
38
|
"typescript": "^7.0.2",
|
|
38
39
|
"zod": "^4.6.5"
|
|
39
40
|
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=22"
|
|
43
|
+
},
|
|
40
44
|
"mcpName": "io.github.avgvstvs96/enclave"
|
|
41
45
|
}
|
package/dist/chunk-U67V476Y.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __export = (target, all) => {
|
|
11
|
-
for (var name in all)
|
|
12
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
-
};
|
|
14
|
-
var __copyProps = (to, from, except, desc) => {
|
|
15
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
-
for (let key of __getOwnPropNames(from))
|
|
17
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
-
mod
|
|
29
|
-
));
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
__commonJS,
|
|
33
|
-
__export,
|
|
34
|
-
__toESM
|
|
35
|
-
};
|