@glyphteck/veyl 0.61.12 → 0.63.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/LICENSE +1 -1
- package/dist/account.js +16301 -15686
- package/dist/auth.js +30 -9
- package/dist/cli.js +39718 -38564
- package/dist/index.js +39748 -38609
- package/dist/kdf-worker-thread.js +219 -289
- package/docs/agents.md +1 -1
- package/docs/api.md +3 -3
- package/docs/cli.md +1 -1
- package/examples/bot-fleet/policy.js +52 -3
- package/package.json +1 -1
- package/readme.md +1 -1
package/dist/auth.js
CHANGED
|
@@ -18,12 +18,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
18
18
|
}
|
|
19
19
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
20
20
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(mod))
|
|
23
|
+
if (!__hasOwnProp.call(to, key))
|
|
24
|
+
__defProp(to, key, {
|
|
25
|
+
get: __accessProp.bind(mod, key),
|
|
26
|
+
enumerable: true
|
|
27
|
+
});
|
|
28
|
+
}
|
|
27
29
|
if (canCache)
|
|
28
30
|
cache.set(mod, to);
|
|
29
31
|
return to;
|
|
@@ -92,6 +94,26 @@ function normalizePasskeyRegisterError(error, options = {}) {
|
|
|
92
94
|
return error;
|
|
93
95
|
}
|
|
94
96
|
|
|
97
|
+
// ../../core/agreement.js
|
|
98
|
+
var TERMS_VERSION = "2026-08-22.4";
|
|
99
|
+
var CURRENT_AGREEMENT = Object.freeze({
|
|
100
|
+
termsVersion: TERMS_VERSION
|
|
101
|
+
});
|
|
102
|
+
var TERMS_VERSION_PATTERN = /^\d{4}-\d{2}-\d{2}(?:\.\d+)?$/u;
|
|
103
|
+
function agreementContract(value = CURRENT_AGREEMENT) {
|
|
104
|
+
const termsVersion = typeof value?.termsVersion === "string" ? value.termsVersion.trim() : "";
|
|
105
|
+
if (!TERMS_VERSION_PATTERN.test(termsVersion)) {
|
|
106
|
+
throw new Error("valid Terms version required");
|
|
107
|
+
}
|
|
108
|
+
return Object.freeze({ termsVersion });
|
|
109
|
+
}
|
|
110
|
+
function isAgreementAccepted(agreement, contract = CURRENT_AGREEMENT) {
|
|
111
|
+
return agreement?.termsVersion === agreementContract(contract).termsVersion && !!agreement?.acceptedAt;
|
|
112
|
+
}
|
|
113
|
+
function hasAgreement(user, contract = CURRENT_AGREEMENT) {
|
|
114
|
+
return isAgreementAccepted(user?.agreement, contract);
|
|
115
|
+
}
|
|
116
|
+
|
|
95
117
|
// ../../core/origins.js
|
|
96
118
|
var ROOT_DOMAIN = "glyphteck.com";
|
|
97
119
|
var VEYL_DEV_WEB_PORT_MIN = 3000;
|
|
@@ -138,8 +160,7 @@ var links = Object.freeze({
|
|
|
138
160
|
veyl: origins.veyl,
|
|
139
161
|
veylDev: origins.veylDev,
|
|
140
162
|
veylDevWeb: origins.veylDevWeb,
|
|
141
|
-
terms: `${origins.veyl}/
|
|
142
|
-
communityRules: `${origins.veyl}/community-rules`,
|
|
163
|
+
terms: `${origins.veyl}/terms#terms`,
|
|
143
164
|
contact: `mailto:contact@${ROOT_DOMAIN}`,
|
|
144
165
|
regtestFaucet: "https://app.lightspark.com/regtest-faucet"
|
|
145
166
|
});
|
|
@@ -457,7 +478,7 @@ function openAuth(options = {}) {
|
|
|
457
478
|
const start = await transport.register.start({
|
|
458
479
|
label,
|
|
459
480
|
origin: operationOrigin(operation),
|
|
460
|
-
|
|
481
|
+
agreement: operation.agreement || CURRENT_AGREEMENT
|
|
461
482
|
});
|
|
462
483
|
const attestation = await createCredential(start?.opts, {
|
|
463
484
|
...operation,
|