@zeke-02/tinfoil 0.0.7 → 0.0.8

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.
@@ -6,7 +6,6 @@ exports.encryptedBodyRequest = encryptedBodyRequest;
6
6
  exports.createEncryptedBodyFetch = createEncryptedBodyFetch;
7
7
  exports.getTransportForOrigin = getTransportForOrigin;
8
8
  const ehbp_1 = require("@zeke-02/ehbp");
9
- const fetch_adapter_1 = require("./fetch-adapter");
10
9
  // Public API
11
10
  async function getHPKEKey(enclaveURL) {
12
11
  const url = new URL(enclaveURL);
@@ -14,8 +13,7 @@ async function getHPKEKey(enclaveURL) {
14
13
  if (keysURL.protocol !== "https:") {
15
14
  throw new Error(`HTTPS is required for remote key retrieval. Invalid protocol: ${keysURL.protocol}`);
16
15
  }
17
- const fetchFn = (0, fetch_adapter_1.getFetch)();
18
- const response = await fetchFn(keysURL.toString());
16
+ const response = await fetch(keysURL.toString());
19
17
  if (!response.ok) {
20
18
  throw new Error(`Failed to get server public key: ${response.status}`);
21
19
  }
@@ -1,5 +1,4 @@
1
1
  import { Identity, Transport, PROTOCOL } from "@zeke-02/ehbp";
2
- import { getFetch } from "./fetch-adapter.mjs";
3
2
  // Public API
4
3
  export async function getHPKEKey(enclaveURL) {
5
4
  const url = new URL(enclaveURL);
@@ -7,8 +6,7 @@ export async function getHPKEKey(enclaveURL) {
7
6
  if (keysURL.protocol !== "https:") {
8
7
  throw new Error(`HTTPS is required for remote key retrieval. Invalid protocol: ${keysURL.protocol}`);
9
8
  }
10
- const fetchFn = getFetch();
11
- const response = await fetchFn(keysURL.toString());
9
+ const response = await fetch(keysURL.toString());
12
10
  if (!response.ok) {
13
11
  throw new Error(`Failed to get server public key: ${response.status}`);
14
12
  }
@@ -65,7 +65,6 @@
65
65
  * - `suppressWasmLogs(suppress?)` → void - control WASM log output
66
66
  */
67
67
  import { TINFOIL_CONFIG } from "./config.mjs";
68
- import { getFetch } from "./fetch-adapter.mjs";
69
68
  let cachedTextEncoder = null;
70
69
  function getTextEncoder() {
71
70
  if (!cachedTextEncoder) {
@@ -119,8 +118,7 @@ export class Verifier {
119
118
  await initializeWasmGlobals();
120
119
  const goInstance = new globalThis.Go();
121
120
  // Load WASM module
122
- const fetchFn = getFetch();
123
- const wasmResponse = await fetchFn(Verifier.defaultWasmUrl);
121
+ const wasmResponse = await fetch(Verifier.defaultWasmUrl);
124
122
  if (!wasmResponse.ok) {
125
123
  throw new Error(`Failed to fetch WASM: ${wasmResponse.status} ${wasmResponse.statusText}`);
126
124
  }
package/dist/verifier.js CHANGED
@@ -102,7 +102,6 @@ exports.suppressWasmLogs = suppressWasmLogs;
102
102
  * - `suppressWasmLogs(suppress?)` → void - control WASM log output
103
103
  */
104
104
  const config_1 = require("./config");
105
- const fetch_adapter_1 = require("./fetch-adapter");
106
105
  let cachedTextEncoder = null;
107
106
  function getTextEncoder() {
108
107
  if (!cachedTextEncoder) {
@@ -156,8 +155,7 @@ class Verifier {
156
155
  await initializeWasmGlobals();
157
156
  const goInstance = new globalThis.Go();
158
157
  // Load WASM module
159
- const fetchFn = (0, fetch_adapter_1.getFetch)();
160
- const wasmResponse = await fetchFn(Verifier.defaultWasmUrl);
158
+ const wasmResponse = await fetch(Verifier.defaultWasmUrl);
161
159
  if (!wasmResponse.ok) {
162
160
  throw new Error(`Failed to fetch WASM: ${wasmResponse.status} ${wasmResponse.statusText}`);
163
161
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeke-02/tinfoil",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Tinfoil secure OpenAI client wrapper for Tauri v2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.mjs",
@@ -86,7 +86,7 @@
86
86
  "dependencies": {
87
87
  "@ai-sdk/openai-compatible": "^1.0.10",
88
88
  "@tauri-apps/plugin-http": "^2.5.2",
89
- "@zeke-02/ehbp": "^0.0.2",
89
+ "@zeke-02/ehbp": "^0.0.3",
90
90
  "ai": "^5.0.19",
91
91
  "dotenv": "^17.2.1",
92
92
  "openai": "^5.13.1",
@@ -100,4 +100,4 @@
100
100
  "jsdom": "^25.0.0",
101
101
  "typescript": "^5.9.2"
102
102
  }
103
- }
103
+ }