sphica 0.6.66 → 0.6.68
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/THIRD_PARTY_NOTICES.md +4 -4
- package/dist/capture.js +18 -2
- package/dist/cli.js +18 -2
- package/dist/deliver.js +18 -2
- package/dist/mcp-record.js +140 -21
- package/dist/mcp.js +122 -19
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://anthropic.com/claude-code/plugin.schema.json",
|
|
3
3
|
"name": "sphica",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.68",
|
|
5
5
|
"description": "Records Claude Code and Codex sessions on your machine and keeps past implementation and decisions, with their sources, for your agent to find.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "iroha924",
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -45,7 +45,7 @@ This file is generated by `node scripts/third-party-notices.mjs`. Do not edit it
|
|
|
45
45
|
| fast-deep-equal | 3.1.3 | MIT |
|
|
46
46
|
| fast-string-truncated-width | 3.0.3 | MIT |
|
|
47
47
|
| fast-string-width | 3.0.2 | MIT |
|
|
48
|
-
| fast-uri | 3.1.
|
|
48
|
+
| fast-uri | 3.1.9 | BSD-3-Clause |
|
|
49
49
|
| fast-wrap-ansi | 0.2.2 | MIT |
|
|
50
50
|
| finalhandler | 2.1.1 | MIT |
|
|
51
51
|
| forwarded | 0.2.0 | MIT |
|
|
@@ -108,7 +108,7 @@ This file is generated by `node scripts/third-party-notices.mjs`. Do not edit it
|
|
|
108
108
|
| vary | 1.1.2 | MIT |
|
|
109
109
|
| which | 2.0.2 | ISC |
|
|
110
110
|
| wrappy | 1.0.2 | ISC |
|
|
111
|
-
| zod | 4.6.
|
|
111
|
+
| zod | 4.6.7 | MIT |
|
|
112
112
|
| zod-to-json-schema | 3.25.2 | ISC |
|
|
113
113
|
|
|
114
114
|
## @clack/core 1.5.1
|
|
@@ -1394,7 +1394,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
1394
1394
|
DEALINGS IN THE SOFTWARE.
|
|
1395
1395
|
```
|
|
1396
1396
|
|
|
1397
|
-
## fast-uri 3.1.
|
|
1397
|
+
## fast-uri 3.1.9
|
|
1398
1398
|
|
|
1399
1399
|
SPDX: BSD-3-Clause
|
|
1400
1400
|
Source: https://github.com/fastify/fast-uri
|
|
@@ -3220,7 +3220,7 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
|
3220
3220
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
3221
3221
|
```
|
|
3222
3222
|
|
|
3223
|
-
## zod 4.6.
|
|
3223
|
+
## zod 4.6.7
|
|
3224
3224
|
|
|
3225
3225
|
SPDX: MIT
|
|
3226
3226
|
Source: https://github.com/colinhacks/zod
|
package/dist/capture.js
CHANGED
|
@@ -12026,7 +12026,7 @@ var sessionId = (projectId, host, externalId) => uuidFrom(String(projectId), hos
|
|
|
12026
12026
|
import fs5 from "node:fs";
|
|
12027
12027
|
import os3 from "node:os";
|
|
12028
12028
|
import path5 from "node:path";
|
|
12029
|
-
function
|
|
12029
|
+
function marksDir() {
|
|
12030
12030
|
const user = (() => {
|
|
12031
12031
|
try {
|
|
12032
12032
|
return os3.userInfo().username;
|
|
@@ -12034,9 +12034,25 @@ function markOnce(kind, key) {
|
|
|
12034
12034
|
return String(process.getuid?.() ?? "user");
|
|
12035
12035
|
}
|
|
12036
12036
|
})();
|
|
12037
|
-
|
|
12037
|
+
return path5.join(os3.tmpdir(), `sphica-${sha256(user).toString("hex").slice(0, 12)}`);
|
|
12038
|
+
}
|
|
12039
|
+
function ours(dir) {
|
|
12040
|
+
if (process.platform === "win32" || !process.getuid)
|
|
12041
|
+
return true;
|
|
12042
|
+
const st = fs5.lstatSync(dir);
|
|
12043
|
+
return st.isDirectory() && st.uid === process.getuid() && (st.mode & 63) === 0;
|
|
12044
|
+
}
|
|
12045
|
+
function markOnce(kind, key) {
|
|
12046
|
+
const top = marksDir();
|
|
12047
|
+
const dir = path5.join(top, kind);
|
|
12038
12048
|
try {
|
|
12039
12049
|
fs5.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
12050
|
+
if (!ours(top))
|
|
12051
|
+
return true;
|
|
12052
|
+
} catch {
|
|
12053
|
+
return true;
|
|
12054
|
+
}
|
|
12055
|
+
try {
|
|
12040
12056
|
fs5.writeFileSync(path5.join(dir, sha256(key).toString("hex").slice(0, 24)), "", { flag: "wx" });
|
|
12041
12057
|
return true;
|
|
12042
12058
|
} catch (e) {
|
package/dist/cli.js
CHANGED
|
@@ -16406,7 +16406,7 @@ var sessionId = (projectId, host, externalId) => uuidFrom(String(projectId), hos
|
|
|
16406
16406
|
import fs7 from "node:fs";
|
|
16407
16407
|
import os4 from "node:os";
|
|
16408
16408
|
import path7 from "node:path";
|
|
16409
|
-
function
|
|
16409
|
+
function marksDir() {
|
|
16410
16410
|
const user = (() => {
|
|
16411
16411
|
try {
|
|
16412
16412
|
return os4.userInfo().username;
|
|
@@ -16414,9 +16414,25 @@ function markOnce(kind, key) {
|
|
|
16414
16414
|
return String(process.getuid?.() ?? "user");
|
|
16415
16415
|
}
|
|
16416
16416
|
})();
|
|
16417
|
-
|
|
16417
|
+
return path7.join(os4.tmpdir(), `sphica-${sha2562(user).toString("hex").slice(0, 12)}`);
|
|
16418
|
+
}
|
|
16419
|
+
function ours(dir) {
|
|
16420
|
+
if (process.platform === "win32" || !process.getuid)
|
|
16421
|
+
return true;
|
|
16422
|
+
const st = fs7.lstatSync(dir);
|
|
16423
|
+
return st.isDirectory() && st.uid === process.getuid() && (st.mode & 63) === 0;
|
|
16424
|
+
}
|
|
16425
|
+
function markOnce(kind, key) {
|
|
16426
|
+
const top = marksDir();
|
|
16427
|
+
const dir = path7.join(top, kind);
|
|
16418
16428
|
try {
|
|
16419
16429
|
fs7.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
16430
|
+
if (!ours(top))
|
|
16431
|
+
return true;
|
|
16432
|
+
} catch {
|
|
16433
|
+
return true;
|
|
16434
|
+
}
|
|
16435
|
+
try {
|
|
16420
16436
|
fs7.writeFileSync(path7.join(dir, sha2562(key).toString("hex").slice(0, 24)), "", { flag: "wx" });
|
|
16421
16437
|
return true;
|
|
16422
16438
|
} catch (e) {
|
package/dist/deliver.js
CHANGED
|
@@ -12124,7 +12124,7 @@ var sessionId = (projectId, host, externalId) => uuidFrom(String(projectId), hos
|
|
|
12124
12124
|
import fs5 from "node:fs";
|
|
12125
12125
|
import os3 from "node:os";
|
|
12126
12126
|
import path6 from "node:path";
|
|
12127
|
-
function
|
|
12127
|
+
function marksDir() {
|
|
12128
12128
|
const user = (() => {
|
|
12129
12129
|
try {
|
|
12130
12130
|
return os3.userInfo().username;
|
|
@@ -12132,9 +12132,25 @@ function markOnce(kind, key) {
|
|
|
12132
12132
|
return String(process.getuid?.() ?? "user");
|
|
12133
12133
|
}
|
|
12134
12134
|
})();
|
|
12135
|
-
|
|
12135
|
+
return path6.join(os3.tmpdir(), `sphica-${sha256(user).toString("hex").slice(0, 12)}`);
|
|
12136
|
+
}
|
|
12137
|
+
function ours(dir) {
|
|
12138
|
+
if (process.platform === "win32" || !process.getuid)
|
|
12139
|
+
return true;
|
|
12140
|
+
const st = fs5.lstatSync(dir);
|
|
12141
|
+
return st.isDirectory() && st.uid === process.getuid() && (st.mode & 63) === 0;
|
|
12142
|
+
}
|
|
12143
|
+
function markOnce(kind, key) {
|
|
12144
|
+
const top = marksDir();
|
|
12145
|
+
const dir = path6.join(top, kind);
|
|
12136
12146
|
try {
|
|
12137
12147
|
fs5.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
12148
|
+
if (!ours(top))
|
|
12149
|
+
return true;
|
|
12150
|
+
} catch {
|
|
12151
|
+
return true;
|
|
12152
|
+
}
|
|
12153
|
+
try {
|
|
12138
12154
|
fs5.writeFileSync(path6.join(dir, sha256(key).toString("hex").slice(0, 24)), "", { flag: "wx" });
|
|
12139
12155
|
return true;
|
|
12140
12156
|
} catch (e) {
|
package/dist/mcp-record.js
CHANGED
|
@@ -3298,6 +3298,37 @@ var require_utils = __commonJS(function(exports, module) {
|
|
|
3298
3298
|
}
|
|
3299
3299
|
return output2.join("");
|
|
3300
3300
|
}
|
|
3301
|
+
function removeDotSegmentsRelative(path) {
|
|
3302
|
+
if (path === "" || path[0] === "/") {
|
|
3303
|
+
return removeDotSegments(path);
|
|
3304
|
+
}
|
|
3305
|
+
const segments = path.split("/");
|
|
3306
|
+
const last = segments.length - 1;
|
|
3307
|
+
const output2 = [];
|
|
3308
|
+
let trailingDirectory = false;
|
|
3309
|
+
for (let i = 0;i <= last; i++) {
|
|
3310
|
+
const segment = segments[i];
|
|
3311
|
+
if (segment === "." || segment === "..") {
|
|
3312
|
+
if (segment === "..") {
|
|
3313
|
+
if (output2.length !== 0 && output2[output2.length - 1] !== "..") {
|
|
3314
|
+
output2.pop();
|
|
3315
|
+
} else {
|
|
3316
|
+
output2.push("..");
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
trailingDirectory = i === last;
|
|
3320
|
+
} else {
|
|
3321
|
+
output2.push(segment);
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
if (trailingDirectory && output2[output2.length - 1] !== "..") {
|
|
3325
|
+
output2.push("");
|
|
3326
|
+
}
|
|
3327
|
+
if (output2.length === 0 || output2[0] === "" || output2[0].includes(":")) {
|
|
3328
|
+
output2.unshift(".");
|
|
3329
|
+
}
|
|
3330
|
+
return output2.join("/");
|
|
3331
|
+
}
|
|
3301
3332
|
var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
|
|
3302
3333
|
var HOST_DELIM_RE = /[@/?#:]/g;
|
|
3303
3334
|
var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
|
|
@@ -3558,6 +3589,7 @@ var require_utils = __commonJS(function(exports, module) {
|
|
|
3558
3589
|
encodeFragment,
|
|
3559
3590
|
escapePreservingEscapes,
|
|
3560
3591
|
removeDotSegments,
|
|
3592
|
+
removeDotSegmentsRelative,
|
|
3561
3593
|
isIPv4,
|
|
3562
3594
|
isUUID,
|
|
3563
3595
|
normalizeIPv6,
|
|
@@ -3742,16 +3774,18 @@ var require_schemes = __commonJS(function(exports, module) {
|
|
|
3742
3774
|
|
|
3743
3775
|
// server/node_modules/fast-uri/index.js
|
|
3744
3776
|
var require_fast_uri = __commonJS(function(exports, module) {
|
|
3745
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3777
|
+
var { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3746
3778
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
3747
3779
|
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
3748
3780
|
var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3781
|
+
var MALFORMED_HOST_ERROR = "URI host is malformed.";
|
|
3782
|
+
var FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;
|
|
3783
|
+
function validateScheme(scheme) {
|
|
3784
|
+
const stringScheme = String(scheme);
|
|
3785
|
+
if (!VALID_SCHEME.test(stringScheme)) {
|
|
3752
3786
|
throw new TypeError(MALFORMED_SCHEME_ERROR);
|
|
3753
3787
|
}
|
|
3754
|
-
return
|
|
3788
|
+
return stringScheme;
|
|
3755
3789
|
}
|
|
3756
3790
|
function normalize(uri, options) {
|
|
3757
3791
|
if (typeof uri === "string") {
|
|
@@ -3786,6 +3820,9 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3786
3820
|
const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
|
|
3787
3821
|
const resolvedHost = resolved.host;
|
|
3788
3822
|
const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
|
|
3823
|
+
if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {
|
|
3824
|
+
throw new Error(MALFORMED_HOST_ERROR);
|
|
3825
|
+
}
|
|
3789
3826
|
canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
|
|
3790
3827
|
const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
|
|
3791
3828
|
if (resolved.error && !encodedASCIIHost) {
|
|
@@ -3827,14 +3864,15 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3827
3864
|
if (relative.path[0] === "/") {
|
|
3828
3865
|
target.path = removeDotSegments(relative.path);
|
|
3829
3866
|
} else {
|
|
3830
|
-
|
|
3867
|
+
const baseHasAuthority = base.userinfo !== undefined || base.host !== undefined || base.port !== undefined;
|
|
3868
|
+
if (baseHasAuthority && !base.path) {
|
|
3831
3869
|
target.path = "/" + relative.path;
|
|
3832
3870
|
} else if (!base.path) {
|
|
3833
3871
|
target.path = relative.path;
|
|
3834
3872
|
} else {
|
|
3835
3873
|
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
|
|
3836
3874
|
}
|
|
3837
|
-
target.path = removeDotSegments(target.path);
|
|
3875
|
+
target.path = base.scheme === undefined && !baseHasAuthority && target.path[0] !== "/" ? removeDotSegmentsRelative(target.path) : removeDotSegments(target.path);
|
|
3838
3876
|
}
|
|
3839
3877
|
target.query = relative.query;
|
|
3840
3878
|
}
|
|
@@ -3872,13 +3910,14 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3872
3910
|
const options = Object.assign({}, opts);
|
|
3873
3911
|
const uriTokens = [];
|
|
3874
3912
|
if (component.scheme) {
|
|
3875
|
-
component.scheme =
|
|
3913
|
+
component.scheme = validateScheme(component.scheme);
|
|
3876
3914
|
}
|
|
3877
3915
|
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
3878
3916
|
if (schemeHandler && schemeHandler.serialize)
|
|
3879
3917
|
schemeHandler.serialize(component, options);
|
|
3880
3918
|
const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined;
|
|
3881
|
-
const
|
|
3919
|
+
const schemelessReference = (component.scheme === undefined || options.reference === "suffix") && !hasAuthority;
|
|
3920
|
+
const pathNoScheme = !options.skipEscape && schemelessReference;
|
|
3882
3921
|
if (component.path !== undefined) {
|
|
3883
3922
|
if (!options.skipEscape) {
|
|
3884
3923
|
component.path = serializePathEncoding(component.path, pathNoScheme);
|
|
@@ -3887,7 +3926,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3887
3926
|
}
|
|
3888
3927
|
}
|
|
3889
3928
|
if (options.reference !== "suffix" && component.scheme) {
|
|
3890
|
-
component.scheme =
|
|
3929
|
+
component.scheme = validateScheme(component.scheme);
|
|
3891
3930
|
uriTokens.push(component.scheme, ":");
|
|
3892
3931
|
}
|
|
3893
3932
|
const authority = recomposeAuthority(component);
|
|
@@ -3903,9 +3942,9 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3903
3942
|
if (component.path !== undefined) {
|
|
3904
3943
|
let s = component.path;
|
|
3905
3944
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
3906
|
-
s = removeDotSegments(s);
|
|
3945
|
+
s = schemelessReference && s[0] !== "/" ? removeDotSegmentsRelative(s) : removeDotSegments(s);
|
|
3907
3946
|
}
|
|
3908
|
-
if (
|
|
3947
|
+
if (schemelessReference) {
|
|
3909
3948
|
s = serializePathEncoding(s, true);
|
|
3910
3949
|
}
|
|
3911
3950
|
if (authority === undefined && s[0] === "/" && s[1] === "/") {
|
|
@@ -3953,16 +3992,32 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3953
3992
|
return hasMalformedPercentEncoding(matches[3]) || host !== undefined && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
|
|
3954
3993
|
}
|
|
3955
3994
|
function canonicalizeHost(parsed, options, schemeHandler, isIP) {
|
|
3995
|
+
if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {
|
|
3996
|
+
parsed.error = parsed.error || MALFORMED_HOST_ERROR;
|
|
3997
|
+
return true;
|
|
3998
|
+
}
|
|
3956
3999
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
4000
|
+
let url2;
|
|
3957
4001
|
try {
|
|
3958
|
-
|
|
4002
|
+
url2 = new URL("http://" + parsed.host);
|
|
3959
4003
|
} catch (e) {
|
|
3960
4004
|
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
3961
4005
|
return true;
|
|
3962
4006
|
}
|
|
4007
|
+
if (!isHostOnlyURL(url2)) {
|
|
4008
|
+
parsed.error = parsed.error || MALFORMED_HOST_ERROR;
|
|
4009
|
+
return true;
|
|
4010
|
+
}
|
|
4011
|
+
parsed.host = url2.hostname;
|
|
3963
4012
|
}
|
|
3964
4013
|
return false;
|
|
3965
4014
|
}
|
|
4015
|
+
function hasForbiddenDomainHost(parsed, options, schemeHandler, isIP) {
|
|
4016
|
+
return Boolean(parsed.host && isIP === false && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host));
|
|
4017
|
+
}
|
|
4018
|
+
function isHostOnlyURL(url2) {
|
|
4019
|
+
return url2.username === "" && url2.password === "" && url2.port === "" && url2.pathname === "/" && url2.search === "" && url2.hash === "" && url2.hostname !== "";
|
|
4020
|
+
}
|
|
3966
4021
|
function parseWithStatus(uri, opts) {
|
|
3967
4022
|
const options = Object.assign({}, opts);
|
|
3968
4023
|
const parsed = {
|
|
@@ -4017,9 +4072,8 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
4017
4072
|
parsed.query = matches[7];
|
|
4018
4073
|
parsed.fragment = matches[8];
|
|
4019
4074
|
if (parsed.scheme !== undefined) {
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
parsed.scheme = decodedScheme.toLowerCase();
|
|
4075
|
+
if (VALID_SCHEME.test(parsed.scheme)) {
|
|
4076
|
+
parsed.scheme = parsed.scheme.toLowerCase();
|
|
4023
4077
|
} else {
|
|
4024
4078
|
parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
|
|
4025
4079
|
malformedScheme = true;
|
|
@@ -4047,7 +4101,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
4047
4101
|
malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
|
|
4048
4102
|
parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
4049
4103
|
if (malformedIPLiteral) {
|
|
4050
|
-
parsed.error = parsed.error ||
|
|
4104
|
+
parsed.error = parsed.error || MALFORMED_HOST_ERROR;
|
|
4051
4105
|
malformedAuthorityOrPort = true;
|
|
4052
4106
|
}
|
|
4053
4107
|
} else {
|
|
@@ -4075,7 +4129,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
4075
4129
|
if (!isIP) {
|
|
4076
4130
|
host = normalizePercentEncoding(host.toLowerCase());
|
|
4077
4131
|
}
|
|
4078
|
-
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
4132
|
+
parsed.host = isIP || options.scheme !== "null" ? reescapeHostDelimiters(host, isIP) : host;
|
|
4079
4133
|
}
|
|
4080
4134
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
4081
4135
|
if (parsed.path) {
|
|
@@ -11151,6 +11205,7 @@ __export(exports_util, {
|
|
|
11151
11205
|
required: () => required,
|
|
11152
11206
|
safeExtend: () => safeExtend,
|
|
11153
11207
|
shallowClone: () => shallowClone,
|
|
11208
|
+
sizeCaps: () => sizeCaps,
|
|
11154
11209
|
slugify: () => slugify,
|
|
11155
11210
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
11156
11211
|
toZod: () => toZod,
|
|
@@ -11664,6 +11719,18 @@ function prefixIssues(path, issues) {
|
|
|
11664
11719
|
function unwrapMessage(message) {
|
|
11665
11720
|
return typeof message === "string" ? message : message?.message;
|
|
11666
11721
|
}
|
|
11722
|
+
function sizeCaps(defChecks) {
|
|
11723
|
+
const caps = [];
|
|
11724
|
+
for (const ch of defChecks ?? []) {
|
|
11725
|
+
const d = ch._zod.def;
|
|
11726
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
11727
|
+
break;
|
|
11728
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
11729
|
+
if (max >= 0)
|
|
11730
|
+
caps.push([max, ch]);
|
|
11731
|
+
}
|
|
11732
|
+
return caps;
|
|
11733
|
+
}
|
|
11667
11734
|
function attachSchema(issues, start, inst) {
|
|
11668
11735
|
var _a;
|
|
11669
11736
|
for (let i = start;i < issues.length; i++) {
|
|
@@ -13083,7 +13150,7 @@ ${content.join(`
|
|
|
13083
13150
|
var version = {
|
|
13084
13151
|
major: 4,
|
|
13085
13152
|
minor: 6,
|
|
13086
|
-
patch:
|
|
13153
|
+
patch: 7
|
|
13087
13154
|
};
|
|
13088
13155
|
|
|
13089
13156
|
// server/node_modules/zod/v4/core/schemas.js
|
|
@@ -13832,6 +13899,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
13832
13899
|
return payload;
|
|
13833
13900
|
};
|
|
13834
13901
|
});
|
|
13902
|
+
function capSize(inst, size) {
|
|
13903
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
13904
|
+
if (!caps.length)
|
|
13905
|
+
return;
|
|
13906
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
13907
|
+
const parse2 = inst._zod.parse;
|
|
13908
|
+
inst._zod.parse = (payload, ctx) => {
|
|
13909
|
+
const n = size(payload.value);
|
|
13910
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
13911
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
13912
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
13913
|
+
const start = payload.issues.length;
|
|
13914
|
+
ch._zod.check(payload);
|
|
13915
|
+
payload.issues[start].continue = false;
|
|
13916
|
+
attachSchema(payload.issues, start, inst);
|
|
13917
|
+
return payload;
|
|
13918
|
+
}
|
|
13919
|
+
}
|
|
13920
|
+
}
|
|
13921
|
+
return parse2(payload, ctx);
|
|
13922
|
+
};
|
|
13923
|
+
}
|
|
13924
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
13925
|
+
var mapSize = (input) => input instanceof Map ? input.size : -1;
|
|
13926
|
+
var setSize = (input) => input instanceof Set ? input.size : -1;
|
|
13835
13927
|
function handleArrayResult(result, final, index) {
|
|
13836
13928
|
if (result.issues.length) {
|
|
13837
13929
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -13875,6 +13967,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
13875
13967
|
}
|
|
13876
13968
|
return payload;
|
|
13877
13969
|
};
|
|
13970
|
+
capSize(inst, arraySize);
|
|
13878
13971
|
});
|
|
13879
13972
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
13880
13973
|
const isPresent = key in input;
|
|
@@ -14829,6 +14922,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
14829
14922
|
return Promise.all(proms).then(() => payload);
|
|
14830
14923
|
return payload;
|
|
14831
14924
|
};
|
|
14925
|
+
capSize(inst, mapSize);
|
|
14832
14926
|
});
|
|
14833
14927
|
function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
14834
14928
|
if (keyResult.issues.length) {
|
|
@@ -14895,6 +14989,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
14895
14989
|
return Promise.all(proms).then(() => payload);
|
|
14896
14990
|
return payload;
|
|
14897
14991
|
};
|
|
14992
|
+
capSize(inst, setSize);
|
|
14898
14993
|
});
|
|
14899
14994
|
function handleSetResult(result, final) {
|
|
14900
14995
|
if (result.issues.length) {
|
|
@@ -24344,9 +24439,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
24344
24439
|
doc.write(`}`);
|
|
24345
24440
|
return outputVar;
|
|
24346
24441
|
}
|
|
24442
|
+
function generateSizeGate(doc, schema, size) {
|
|
24443
|
+
for (const [max, check] of sizeCaps(schema._zod.def.checks)) {
|
|
24444
|
+
doc.write(`if (${size} > ${numericOperand(max, check._zod.def.check)}) return INVALID;`);
|
|
24445
|
+
}
|
|
24446
|
+
}
|
|
24347
24447
|
function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
24348
24448
|
const def = schema._zod.def;
|
|
24349
24449
|
doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
|
|
24450
|
+
generateSizeGate(doc, schema, `${accessor}.length`);
|
|
24350
24451
|
const outputVar = buildsValue ? newVar(ctx) : null;
|
|
24351
24452
|
const iVar = newVar(ctx);
|
|
24352
24453
|
const elemVar = newVar(ctx);
|
|
@@ -24746,6 +24847,7 @@ function literalPropertyKey(ctx, key) {
|
|
|
24746
24847
|
function generateMapCheck(doc, ctx, schema, accessor) {
|
|
24747
24848
|
const def = schema._zod.def;
|
|
24748
24849
|
doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
|
|
24850
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
24749
24851
|
const outputVar = newVar(ctx);
|
|
24750
24852
|
const kVar = newVar(ctx);
|
|
24751
24853
|
const valVar = newVar(ctx);
|
|
@@ -24762,6 +24864,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
|
|
|
24762
24864
|
function generateSetCheck(doc, ctx, schema, accessor) {
|
|
24763
24865
|
const def = schema._zod.def;
|
|
24764
24866
|
doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
|
|
24867
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
24765
24868
|
const outputVar = newVar(ctx);
|
|
24766
24869
|
const valVar = newVar(ctx);
|
|
24767
24870
|
doc.write(`const ${outputVar} = new Set();`);
|
|
@@ -46974,7 +47077,7 @@ var sessionId = (projectId, host, externalId) => uuidFrom(String(projectId), hos
|
|
|
46974
47077
|
import fs5 from "node:fs";
|
|
46975
47078
|
import os3 from "node:os";
|
|
46976
47079
|
import path5 from "node:path";
|
|
46977
|
-
function
|
|
47080
|
+
function marksDir() {
|
|
46978
47081
|
const user = (() => {
|
|
46979
47082
|
try {
|
|
46980
47083
|
return os3.userInfo().username;
|
|
@@ -46982,9 +47085,25 @@ function markOnce(kind, key) {
|
|
|
46982
47085
|
return String(process.getuid?.() ?? "user");
|
|
46983
47086
|
}
|
|
46984
47087
|
})();
|
|
46985
|
-
|
|
47088
|
+
return path5.join(os3.tmpdir(), `sphica-${sha256(user).toString("hex").slice(0, 12)}`);
|
|
47089
|
+
}
|
|
47090
|
+
function ours(dir) {
|
|
47091
|
+
if (process.platform === "win32" || !process.getuid)
|
|
47092
|
+
return true;
|
|
47093
|
+
const st = fs5.lstatSync(dir);
|
|
47094
|
+
return st.isDirectory() && st.uid === process.getuid() && (st.mode & 63) === 0;
|
|
47095
|
+
}
|
|
47096
|
+
function markOnce(kind, key) {
|
|
47097
|
+
const top = marksDir();
|
|
47098
|
+
const dir = path5.join(top, kind);
|
|
46986
47099
|
try {
|
|
46987
47100
|
fs5.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
47101
|
+
if (!ours(top))
|
|
47102
|
+
return true;
|
|
47103
|
+
} catch {
|
|
47104
|
+
return true;
|
|
47105
|
+
}
|
|
47106
|
+
try {
|
|
46988
47107
|
fs5.writeFileSync(path5.join(dir, sha256(key).toString("hex").slice(0, 24)), "", { flag: "wx" });
|
|
46989
47108
|
return true;
|
|
46990
47109
|
} catch (e) {
|
package/dist/mcp.js
CHANGED
|
@@ -3298,6 +3298,37 @@ var require_utils = __commonJS(function(exports, module) {
|
|
|
3298
3298
|
}
|
|
3299
3299
|
return output2.join("");
|
|
3300
3300
|
}
|
|
3301
|
+
function removeDotSegmentsRelative(path) {
|
|
3302
|
+
if (path === "" || path[0] === "/") {
|
|
3303
|
+
return removeDotSegments(path);
|
|
3304
|
+
}
|
|
3305
|
+
const segments = path.split("/");
|
|
3306
|
+
const last = segments.length - 1;
|
|
3307
|
+
const output2 = [];
|
|
3308
|
+
let trailingDirectory = false;
|
|
3309
|
+
for (let i = 0;i <= last; i++) {
|
|
3310
|
+
const segment = segments[i];
|
|
3311
|
+
if (segment === "." || segment === "..") {
|
|
3312
|
+
if (segment === "..") {
|
|
3313
|
+
if (output2.length !== 0 && output2[output2.length - 1] !== "..") {
|
|
3314
|
+
output2.pop();
|
|
3315
|
+
} else {
|
|
3316
|
+
output2.push("..");
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
trailingDirectory = i === last;
|
|
3320
|
+
} else {
|
|
3321
|
+
output2.push(segment);
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
if (trailingDirectory && output2[output2.length - 1] !== "..") {
|
|
3325
|
+
output2.push("");
|
|
3326
|
+
}
|
|
3327
|
+
if (output2.length === 0 || output2[0] === "" || output2[0].includes(":")) {
|
|
3328
|
+
output2.unshift(".");
|
|
3329
|
+
}
|
|
3330
|
+
return output2.join("/");
|
|
3331
|
+
}
|
|
3301
3332
|
var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
|
|
3302
3333
|
var HOST_DELIM_RE = /[@/?#:]/g;
|
|
3303
3334
|
var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
|
|
@@ -3558,6 +3589,7 @@ var require_utils = __commonJS(function(exports, module) {
|
|
|
3558
3589
|
encodeFragment,
|
|
3559
3590
|
escapePreservingEscapes,
|
|
3560
3591
|
removeDotSegments,
|
|
3592
|
+
removeDotSegmentsRelative,
|
|
3561
3593
|
isIPv4,
|
|
3562
3594
|
isUUID,
|
|
3563
3595
|
normalizeIPv6,
|
|
@@ -3742,16 +3774,18 @@ var require_schemes = __commonJS(function(exports, module) {
|
|
|
3742
3774
|
|
|
3743
3775
|
// server/node_modules/fast-uri/index.js
|
|
3744
3776
|
var require_fast_uri = __commonJS(function(exports, module) {
|
|
3745
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3777
|
+
var { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3746
3778
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
3747
3779
|
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
3748
3780
|
var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3781
|
+
var MALFORMED_HOST_ERROR = "URI host is malformed.";
|
|
3782
|
+
var FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;
|
|
3783
|
+
function validateScheme(scheme) {
|
|
3784
|
+
const stringScheme = String(scheme);
|
|
3785
|
+
if (!VALID_SCHEME.test(stringScheme)) {
|
|
3752
3786
|
throw new TypeError(MALFORMED_SCHEME_ERROR);
|
|
3753
3787
|
}
|
|
3754
|
-
return
|
|
3788
|
+
return stringScheme;
|
|
3755
3789
|
}
|
|
3756
3790
|
function normalize(uri, options) {
|
|
3757
3791
|
if (typeof uri === "string") {
|
|
@@ -3786,6 +3820,9 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3786
3820
|
const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
|
|
3787
3821
|
const resolvedHost = resolved.host;
|
|
3788
3822
|
const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
|
|
3823
|
+
if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {
|
|
3824
|
+
throw new Error(MALFORMED_HOST_ERROR);
|
|
3825
|
+
}
|
|
3789
3826
|
canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
|
|
3790
3827
|
const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
|
|
3791
3828
|
if (resolved.error && !encodedASCIIHost) {
|
|
@@ -3827,14 +3864,15 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3827
3864
|
if (relative.path[0] === "/") {
|
|
3828
3865
|
target.path = removeDotSegments(relative.path);
|
|
3829
3866
|
} else {
|
|
3830
|
-
|
|
3867
|
+
const baseHasAuthority = base.userinfo !== undefined || base.host !== undefined || base.port !== undefined;
|
|
3868
|
+
if (baseHasAuthority && !base.path) {
|
|
3831
3869
|
target.path = "/" + relative.path;
|
|
3832
3870
|
} else if (!base.path) {
|
|
3833
3871
|
target.path = relative.path;
|
|
3834
3872
|
} else {
|
|
3835
3873
|
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
|
|
3836
3874
|
}
|
|
3837
|
-
target.path = removeDotSegments(target.path);
|
|
3875
|
+
target.path = base.scheme === undefined && !baseHasAuthority && target.path[0] !== "/" ? removeDotSegmentsRelative(target.path) : removeDotSegments(target.path);
|
|
3838
3876
|
}
|
|
3839
3877
|
target.query = relative.query;
|
|
3840
3878
|
}
|
|
@@ -3872,13 +3910,14 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3872
3910
|
const options = Object.assign({}, opts);
|
|
3873
3911
|
const uriTokens = [];
|
|
3874
3912
|
if (component.scheme) {
|
|
3875
|
-
component.scheme =
|
|
3913
|
+
component.scheme = validateScheme(component.scheme);
|
|
3876
3914
|
}
|
|
3877
3915
|
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
3878
3916
|
if (schemeHandler && schemeHandler.serialize)
|
|
3879
3917
|
schemeHandler.serialize(component, options);
|
|
3880
3918
|
const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined;
|
|
3881
|
-
const
|
|
3919
|
+
const schemelessReference = (component.scheme === undefined || options.reference === "suffix") && !hasAuthority;
|
|
3920
|
+
const pathNoScheme = !options.skipEscape && schemelessReference;
|
|
3882
3921
|
if (component.path !== undefined) {
|
|
3883
3922
|
if (!options.skipEscape) {
|
|
3884
3923
|
component.path = serializePathEncoding(component.path, pathNoScheme);
|
|
@@ -3887,7 +3926,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3887
3926
|
}
|
|
3888
3927
|
}
|
|
3889
3928
|
if (options.reference !== "suffix" && component.scheme) {
|
|
3890
|
-
component.scheme =
|
|
3929
|
+
component.scheme = validateScheme(component.scheme);
|
|
3891
3930
|
uriTokens.push(component.scheme, ":");
|
|
3892
3931
|
}
|
|
3893
3932
|
const authority = recomposeAuthority(component);
|
|
@@ -3903,9 +3942,9 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3903
3942
|
if (component.path !== undefined) {
|
|
3904
3943
|
let s = component.path;
|
|
3905
3944
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
3906
|
-
s = removeDotSegments(s);
|
|
3945
|
+
s = schemelessReference && s[0] !== "/" ? removeDotSegmentsRelative(s) : removeDotSegments(s);
|
|
3907
3946
|
}
|
|
3908
|
-
if (
|
|
3947
|
+
if (schemelessReference) {
|
|
3909
3948
|
s = serializePathEncoding(s, true);
|
|
3910
3949
|
}
|
|
3911
3950
|
if (authority === undefined && s[0] === "/" && s[1] === "/") {
|
|
@@ -3953,16 +3992,32 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
3953
3992
|
return hasMalformedPercentEncoding(matches[3]) || host !== undefined && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
|
|
3954
3993
|
}
|
|
3955
3994
|
function canonicalizeHost(parsed, options, schemeHandler, isIP) {
|
|
3995
|
+
if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {
|
|
3996
|
+
parsed.error = parsed.error || MALFORMED_HOST_ERROR;
|
|
3997
|
+
return true;
|
|
3998
|
+
}
|
|
3956
3999
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
4000
|
+
let url2;
|
|
3957
4001
|
try {
|
|
3958
|
-
|
|
4002
|
+
url2 = new URL("http://" + parsed.host);
|
|
3959
4003
|
} catch (e) {
|
|
3960
4004
|
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
3961
4005
|
return true;
|
|
3962
4006
|
}
|
|
4007
|
+
if (!isHostOnlyURL(url2)) {
|
|
4008
|
+
parsed.error = parsed.error || MALFORMED_HOST_ERROR;
|
|
4009
|
+
return true;
|
|
4010
|
+
}
|
|
4011
|
+
parsed.host = url2.hostname;
|
|
3963
4012
|
}
|
|
3964
4013
|
return false;
|
|
3965
4014
|
}
|
|
4015
|
+
function hasForbiddenDomainHost(parsed, options, schemeHandler, isIP) {
|
|
4016
|
+
return Boolean(parsed.host && isIP === false && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host));
|
|
4017
|
+
}
|
|
4018
|
+
function isHostOnlyURL(url2) {
|
|
4019
|
+
return url2.username === "" && url2.password === "" && url2.port === "" && url2.pathname === "/" && url2.search === "" && url2.hash === "" && url2.hostname !== "";
|
|
4020
|
+
}
|
|
3966
4021
|
function parseWithStatus(uri, opts) {
|
|
3967
4022
|
const options = Object.assign({}, opts);
|
|
3968
4023
|
const parsed = {
|
|
@@ -4017,9 +4072,8 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
4017
4072
|
parsed.query = matches[7];
|
|
4018
4073
|
parsed.fragment = matches[8];
|
|
4019
4074
|
if (parsed.scheme !== undefined) {
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
parsed.scheme = decodedScheme.toLowerCase();
|
|
4075
|
+
if (VALID_SCHEME.test(parsed.scheme)) {
|
|
4076
|
+
parsed.scheme = parsed.scheme.toLowerCase();
|
|
4023
4077
|
} else {
|
|
4024
4078
|
parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
|
|
4025
4079
|
malformedScheme = true;
|
|
@@ -4047,7 +4101,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
4047
4101
|
malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
|
|
4048
4102
|
parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
4049
4103
|
if (malformedIPLiteral) {
|
|
4050
|
-
parsed.error = parsed.error ||
|
|
4104
|
+
parsed.error = parsed.error || MALFORMED_HOST_ERROR;
|
|
4051
4105
|
malformedAuthorityOrPort = true;
|
|
4052
4106
|
}
|
|
4053
4107
|
} else {
|
|
@@ -4075,7 +4129,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
|
|
|
4075
4129
|
if (!isIP) {
|
|
4076
4130
|
host = normalizePercentEncoding(host.toLowerCase());
|
|
4077
4131
|
}
|
|
4078
|
-
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
4132
|
+
parsed.host = isIP || options.scheme !== "null" ? reescapeHostDelimiters(host, isIP) : host;
|
|
4079
4133
|
}
|
|
4080
4134
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
4081
4135
|
if (parsed.path) {
|
|
@@ -11151,6 +11205,7 @@ __export(exports_util, {
|
|
|
11151
11205
|
required: () => required,
|
|
11152
11206
|
safeExtend: () => safeExtend,
|
|
11153
11207
|
shallowClone: () => shallowClone,
|
|
11208
|
+
sizeCaps: () => sizeCaps,
|
|
11154
11209
|
slugify: () => slugify,
|
|
11155
11210
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
11156
11211
|
toZod: () => toZod,
|
|
@@ -11664,6 +11719,18 @@ function prefixIssues(path, issues) {
|
|
|
11664
11719
|
function unwrapMessage(message) {
|
|
11665
11720
|
return typeof message === "string" ? message : message?.message;
|
|
11666
11721
|
}
|
|
11722
|
+
function sizeCaps(defChecks) {
|
|
11723
|
+
const caps = [];
|
|
11724
|
+
for (const ch of defChecks ?? []) {
|
|
11725
|
+
const d = ch._zod.def;
|
|
11726
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
11727
|
+
break;
|
|
11728
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
11729
|
+
if (max >= 0)
|
|
11730
|
+
caps.push([max, ch]);
|
|
11731
|
+
}
|
|
11732
|
+
return caps;
|
|
11733
|
+
}
|
|
11667
11734
|
function attachSchema(issues, start, inst) {
|
|
11668
11735
|
var _a;
|
|
11669
11736
|
for (let i = start;i < issues.length; i++) {
|
|
@@ -13083,7 +13150,7 @@ ${content.join(`
|
|
|
13083
13150
|
var version = {
|
|
13084
13151
|
major: 4,
|
|
13085
13152
|
minor: 6,
|
|
13086
|
-
patch:
|
|
13153
|
+
patch: 7
|
|
13087
13154
|
};
|
|
13088
13155
|
|
|
13089
13156
|
// server/node_modules/zod/v4/core/schemas.js
|
|
@@ -13832,6 +13899,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
13832
13899
|
return payload;
|
|
13833
13900
|
};
|
|
13834
13901
|
});
|
|
13902
|
+
function capSize(inst, size) {
|
|
13903
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
13904
|
+
if (!caps.length)
|
|
13905
|
+
return;
|
|
13906
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
13907
|
+
const parse2 = inst._zod.parse;
|
|
13908
|
+
inst._zod.parse = (payload, ctx) => {
|
|
13909
|
+
const n = size(payload.value);
|
|
13910
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
13911
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
13912
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
13913
|
+
const start = payload.issues.length;
|
|
13914
|
+
ch._zod.check(payload);
|
|
13915
|
+
payload.issues[start].continue = false;
|
|
13916
|
+
attachSchema(payload.issues, start, inst);
|
|
13917
|
+
return payload;
|
|
13918
|
+
}
|
|
13919
|
+
}
|
|
13920
|
+
}
|
|
13921
|
+
return parse2(payload, ctx);
|
|
13922
|
+
};
|
|
13923
|
+
}
|
|
13924
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
13925
|
+
var mapSize = (input) => input instanceof Map ? input.size : -1;
|
|
13926
|
+
var setSize = (input) => input instanceof Set ? input.size : -1;
|
|
13835
13927
|
function handleArrayResult(result, final, index) {
|
|
13836
13928
|
if (result.issues.length) {
|
|
13837
13929
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -13875,6 +13967,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
13875
13967
|
}
|
|
13876
13968
|
return payload;
|
|
13877
13969
|
};
|
|
13970
|
+
capSize(inst, arraySize);
|
|
13878
13971
|
});
|
|
13879
13972
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
13880
13973
|
const isPresent = key in input;
|
|
@@ -14829,6 +14922,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
14829
14922
|
return Promise.all(proms).then(() => payload);
|
|
14830
14923
|
return payload;
|
|
14831
14924
|
};
|
|
14925
|
+
capSize(inst, mapSize);
|
|
14832
14926
|
});
|
|
14833
14927
|
function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
14834
14928
|
if (keyResult.issues.length) {
|
|
@@ -14895,6 +14989,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
14895
14989
|
return Promise.all(proms).then(() => payload);
|
|
14896
14990
|
return payload;
|
|
14897
14991
|
};
|
|
14992
|
+
capSize(inst, setSize);
|
|
14898
14993
|
});
|
|
14899
14994
|
function handleSetResult(result, final) {
|
|
14900
14995
|
if (result.issues.length) {
|
|
@@ -24344,9 +24439,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
24344
24439
|
doc.write(`}`);
|
|
24345
24440
|
return outputVar;
|
|
24346
24441
|
}
|
|
24442
|
+
function generateSizeGate(doc, schema, size) {
|
|
24443
|
+
for (const [max, check] of sizeCaps(schema._zod.def.checks)) {
|
|
24444
|
+
doc.write(`if (${size} > ${numericOperand(max, check._zod.def.check)}) return INVALID;`);
|
|
24445
|
+
}
|
|
24446
|
+
}
|
|
24347
24447
|
function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
24348
24448
|
const def = schema._zod.def;
|
|
24349
24449
|
doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
|
|
24450
|
+
generateSizeGate(doc, schema, `${accessor}.length`);
|
|
24350
24451
|
const outputVar = buildsValue ? newVar(ctx) : null;
|
|
24351
24452
|
const iVar = newVar(ctx);
|
|
24352
24453
|
const elemVar = newVar(ctx);
|
|
@@ -24746,6 +24847,7 @@ function literalPropertyKey(ctx, key) {
|
|
|
24746
24847
|
function generateMapCheck(doc, ctx, schema, accessor) {
|
|
24747
24848
|
const def = schema._zod.def;
|
|
24748
24849
|
doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
|
|
24850
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
24749
24851
|
const outputVar = newVar(ctx);
|
|
24750
24852
|
const kVar = newVar(ctx);
|
|
24751
24853
|
const valVar = newVar(ctx);
|
|
@@ -24762,6 +24864,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
|
|
|
24762
24864
|
function generateSetCheck(doc, ctx, schema, accessor) {
|
|
24763
24865
|
const def = schema._zod.def;
|
|
24764
24866
|
doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
|
|
24867
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
24765
24868
|
const outputVar = newVar(ctx);
|
|
24766
24869
|
const valVar = newVar(ctx);
|
|
24767
24870
|
doc.write(`const ${outputVar} = new Set();`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sphica",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.68",
|
|
4
4
|
"description": "Records Claude Code and Codex sessions on your machine and keeps past implementation and decisions, with their sources, for your agent to find.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|