@elizaos/project-tee-starter 1.5.12-alpha.1 → 1.5.12
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/index.js +21 -35
- package/dist/index.js.map +3 -3
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -35176,7 +35176,7 @@ var configSchema = z.object({
|
|
|
35176
35176
|
if (!val)
|
|
35177
35177
|
return true;
|
|
35178
35178
|
return ["OFF", "LOCAL", "DOCKER", "PRODUCTION"].includes(val);
|
|
35179
|
-
},
|
|
35179
|
+
}, "TEE_MODE must be one of: OFF, LOCAL, DOCKER, PRODUCTION"),
|
|
35180
35180
|
TEE_VENDOR: z.string().optional().transform((val) => {
|
|
35181
35181
|
if (false) {}
|
|
35182
35182
|
return val;
|
|
@@ -35184,33 +35184,34 @@ var configSchema = z.object({
|
|
|
35184
35184
|
if (!val)
|
|
35185
35185
|
return true;
|
|
35186
35186
|
return val === "phala";
|
|
35187
|
-
},
|
|
35187
|
+
}, "TEE_VENDOR must be: phala"),
|
|
35188
35188
|
WALLET_SECRET_SALT: z.string().optional().transform((val) => {
|
|
35189
35189
|
if (false) {}
|
|
35190
35190
|
if (!val) {
|
|
35191
35191
|
logger.warn("Warning: Wallet secret salt is not provided");
|
|
35192
|
-
return val;
|
|
35193
35192
|
}
|
|
35194
|
-
return val
|
|
35195
|
-
}).refine((val) => {
|
|
35196
|
-
if (val === undefined)
|
|
35197
|
-
return true;
|
|
35198
|
-
if (!val || val.length === 0)
|
|
35199
|
-
return false;
|
|
35200
|
-
return val.length >= 8;
|
|
35201
|
-
}, {
|
|
35202
|
-
message: "Wallet secret salt must be at least 8 characters long for security (excluding whitespace)"
|
|
35193
|
+
return val;
|
|
35203
35194
|
}).refine((val) => {
|
|
35204
|
-
if (val
|
|
35195
|
+
if (!val)
|
|
35205
35196
|
return true;
|
|
35206
|
-
|
|
35207
|
-
|
|
35208
|
-
|
|
35209
|
-
|
|
35197
|
+
const trimmedVal = val.trim();
|
|
35198
|
+
return trimmedVal.length >= 8 && trimmedVal.length <= 128;
|
|
35199
|
+
}, (val) => {
|
|
35200
|
+
if (!val)
|
|
35201
|
+
return { message: "Wallet secret salt is required" };
|
|
35202
|
+
const trimmedVal = val.trim();
|
|
35203
|
+
if (trimmedVal.length < 8) {
|
|
35204
|
+
return { message: "Wallet secret salt must be at least 8 characters long for security" };
|
|
35205
|
+
}
|
|
35206
|
+
if (trimmedVal.length > 128) {
|
|
35207
|
+
return { message: "Wallet secret salt must not exceed 128 characters" };
|
|
35208
|
+
}
|
|
35209
|
+
return { message: "Invalid wallet secret salt" };
|
|
35210
|
+
})
|
|
35210
35211
|
});
|
|
35211
35212
|
var createTeeServiceConfig = (runtime) => ({
|
|
35212
35213
|
teeClient: new import_dstack_sdk.TappdClient,
|
|
35213
|
-
secretSalt:
|
|
35214
|
+
secretSalt: process.env.WALLET_SECRET_SALT || "secret_salt",
|
|
35214
35215
|
runtime
|
|
35215
35216
|
});
|
|
35216
35217
|
var deriveEcdsaKeypair = (deriveKeyResponse) => {
|
|
@@ -35307,22 +35308,7 @@ var teeStarterPlugin = {
|
|
|
35307
35308
|
}
|
|
35308
35309
|
} catch (error) {
|
|
35309
35310
|
if (error instanceof z.ZodError) {
|
|
35310
|
-
|
|
35311
|
-
if (hasInvalidMode) {
|
|
35312
|
-
const teeError = error.issues.find((e) => e.path[0] === "TEE_MODE");
|
|
35313
|
-
throw new Error(teeError?.message || "TEE_MODE must be one of: OFF, LOCAL, DOCKER, PRODUCTION");
|
|
35314
|
-
}
|
|
35315
|
-
const hasInvalidVendor = error.issues.some((e) => e.path[0] === "TEE_VENDOR" && e.message.includes("TEE_VENDOR must be"));
|
|
35316
|
-
if (hasInvalidVendor) {
|
|
35317
|
-
const vendorError = error.issues.find((e) => e.path[0] === "TEE_VENDOR");
|
|
35318
|
-
throw new Error(vendorError?.message || "TEE_VENDOR must be: phala");
|
|
35319
|
-
}
|
|
35320
|
-
const hasSaltError = error.issues.some((e) => e.path[0] === "WALLET_SECRET_SALT");
|
|
35321
|
-
if (hasSaltError) {
|
|
35322
|
-
const saltError = error.issues.find((e) => e.path[0] === "WALLET_SECRET_SALT");
|
|
35323
|
-
throw new Error(saltError?.message || "Invalid wallet secret salt");
|
|
35324
|
-
}
|
|
35325
|
-
throw new Error("Invalid plugin configuration");
|
|
35311
|
+
throw new Error(`Invalid plugin configuration: ${error.errors.map((e) => e.message).join(", ")}`);
|
|
35326
35312
|
}
|
|
35327
35313
|
throw error;
|
|
35328
35314
|
}
|
|
@@ -35650,5 +35636,5 @@ export {
|
|
|
35650
35636
|
StarterService
|
|
35651
35637
|
};
|
|
35652
35638
|
|
|
35653
|
-
//# debugId=
|
|
35639
|
+
//# debugId=9407D5FBB03532A064756E2164756E21
|
|
35654
35640
|
//# sourceMappingURL=index.js.map
|