@elizaos/project-tee-starter 1.5.11-alpha.5 → 1.5.11-alpha.7
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 +35 -21
- 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
|
-
}, "TEE_MODE must be one of: OFF, LOCAL, DOCKER, PRODUCTION"),
|
|
35179
|
+
}, { message: "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,34 +35184,33 @@ var configSchema = z.object({
|
|
|
35184
35184
|
if (!val)
|
|
35185
35185
|
return true;
|
|
35186
35186
|
return val === "phala";
|
|
35187
|
-
}, "TEE_VENDOR must be: phala"),
|
|
35187
|
+
}, { message: "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;
|
|
35192
35193
|
}
|
|
35193
|
-
return val;
|
|
35194
|
+
return val.trim();
|
|
35194
35195
|
}).refine((val) => {
|
|
35195
|
-
if (
|
|
35196
|
+
if (val === undefined)
|
|
35196
35197
|
return true;
|
|
35197
|
-
|
|
35198
|
-
|
|
35199
|
-
|
|
35200
|
-
|
|
35201
|
-
|
|
35202
|
-
|
|
35203
|
-
if (
|
|
35204
|
-
return
|
|
35205
|
-
|
|
35206
|
-
|
|
35207
|
-
|
|
35208
|
-
|
|
35209
|
-
return { message: "Invalid wallet secret salt" };
|
|
35210
|
-
})
|
|
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)"
|
|
35203
|
+
}).refine((val) => {
|
|
35204
|
+
if (val === undefined)
|
|
35205
|
+
return true;
|
|
35206
|
+
if (!val || val.length === 0)
|
|
35207
|
+
return false;
|
|
35208
|
+
return val.length <= 128;
|
|
35209
|
+
}, { message: "Wallet secret salt must not exceed 128 characters (excluding whitespace)" })
|
|
35211
35210
|
});
|
|
35212
35211
|
var createTeeServiceConfig = (runtime) => ({
|
|
35213
35212
|
teeClient: new import_dstack_sdk.TappdClient,
|
|
35214
|
-
secretSalt: process.env.WALLET_SECRET_SALT || "secret_salt",
|
|
35213
|
+
secretSalt: (process.env.WALLET_SECRET_SALT || "secret_salt").trim(),
|
|
35215
35214
|
runtime
|
|
35216
35215
|
});
|
|
35217
35216
|
var deriveEcdsaKeypair = (deriveKeyResponse) => {
|
|
@@ -35308,7 +35307,22 @@ var teeStarterPlugin = {
|
|
|
35308
35307
|
}
|
|
35309
35308
|
} catch (error) {
|
|
35310
35309
|
if (error instanceof z.ZodError) {
|
|
35311
|
-
|
|
35310
|
+
const hasInvalidMode = error.issues.some((e) => e.path[0] === "TEE_MODE" && e.message.includes("TEE_MODE must be"));
|
|
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");
|
|
35312
35326
|
}
|
|
35313
35327
|
throw error;
|
|
35314
35328
|
}
|
|
@@ -35636,5 +35650,5 @@ export {
|
|
|
35636
35650
|
StarterService
|
|
35637
35651
|
};
|
|
35638
35652
|
|
|
35639
|
-
//# debugId=
|
|
35653
|
+
//# debugId=555B8F31F0AA8E9A64756E2164756E21
|
|
35640
35654
|
//# sourceMappingURL=index.js.map
|