@abyssinia-labs/sokie 0.8.1 → 0.8.2-staging.178
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/sokie.mjs +138 -121
- package/package.json +2 -2
package/dist/sokie.mjs
CHANGED
|
@@ -24033,9 +24033,9 @@ var require___dev__ = __commonJS((exports, module) => {
|
|
|
24033
24033
|
|
|
24034
24034
|
// package.json
|
|
24035
24035
|
var name = "@abyssinia-labs/sokie";
|
|
24036
|
-
var version = "0.8.
|
|
24036
|
+
var version = "0.8.2-staging.178";
|
|
24037
24037
|
var sokie = {
|
|
24038
|
-
site: "https://sokie.sh"
|
|
24038
|
+
site: "https://staging.sokie.sh"
|
|
24039
24039
|
};
|
|
24040
24040
|
|
|
24041
24041
|
// src/command.ts
|
|
@@ -24811,7 +24811,7 @@ var SERVER_KEY_ORDER = {
|
|
|
24811
24811
|
"tokens",
|
|
24812
24812
|
"identity"
|
|
24813
24813
|
],
|
|
24814
|
-
"upstream.auth.identity": ["path", "id", "email", "name"],
|
|
24814
|
+
"upstream.auth.identity": ["path", "url", "id", "email", "name"],
|
|
24815
24815
|
settings: ["discovery", "closedWorld"]
|
|
24816
24816
|
};
|
|
24817
24817
|
var SORTED_MAPS = new Set(["secrets", "upstream.headers"]);
|
|
@@ -44099,11 +44099,12 @@ var sourceConfig = exports_external.strictObject({
|
|
|
44099
44099
|
url: httpsUrl.optional()
|
|
44100
44100
|
});
|
|
44101
44101
|
var upstreamIdentity = exports_external.strictObject({
|
|
44102
|
-
path: exports_external.string().startsWith("/", "A path on the upstream, starting with /").refine((path) => !path.includes("://"), "A path, not a full address"),
|
|
44102
|
+
path: exports_external.string().startsWith("/", "A path on the upstream, starting with /").refine((path) => !path.includes("://"), "A path, not a full address").optional(),
|
|
44103
|
+
url: secureUrl.optional(),
|
|
44103
44104
|
id: exports_external.string().min(1),
|
|
44104
44105
|
email: exports_external.string().min(1).optional(),
|
|
44105
44106
|
name: exports_external.string().min(1).optional()
|
|
44106
|
-
});
|
|
44107
|
+
}).refine((identity2) => identity2.path === undefined !== (identity2.url === undefined), "Give path or url, not both");
|
|
44107
44108
|
var apiKeyAuth = exports_external.strictObject({
|
|
44108
44109
|
type: exports_external.literal("apiKey"),
|
|
44109
44110
|
in: exports_external.enum(["header", "query"]).default("header"),
|
|
@@ -44969,6 +44970,17 @@ function utf8Bytes(text3) {
|
|
|
44969
44970
|
}
|
|
44970
44971
|
return bytes;
|
|
44971
44972
|
}
|
|
44973
|
+
// ../manifest/src/who-am-i.ts
|
|
44974
|
+
var parsed = (address) => URL.canParse(address) ? new URL(address) : null;
|
|
44975
|
+
function whoAmIUrl(baseUrl, call) {
|
|
44976
|
+
if (call.url === undefined) {
|
|
44977
|
+
return call.path === undefined ? null : parsed(baseUrl.replace(/\/+$/, "") + call.path);
|
|
44978
|
+
}
|
|
44979
|
+
const url2 = parsed(call.url);
|
|
44980
|
+
if (url2?.protocol !== "https:" || url2.username || url2.password)
|
|
44981
|
+
return null;
|
|
44982
|
+
return parsed(baseUrl)?.host === url2.host ? url2 : null;
|
|
44983
|
+
}
|
|
44972
44984
|
// src/deploy.ts
|
|
44973
44985
|
var POLL_MS = 2000;
|
|
44974
44986
|
var WAIT_MS = 5 * 60 * 1000;
|
|
@@ -45181,8 +45193,8 @@ function readAll(path) {
|
|
|
45181
45193
|
if (!existsSync(path))
|
|
45182
45194
|
return {};
|
|
45183
45195
|
try {
|
|
45184
|
-
const
|
|
45185
|
-
return typeof
|
|
45196
|
+
const parsed2 = JSON.parse(readFileSync(path, "utf8"));
|
|
45197
|
+
return typeof parsed2 === "object" && parsed2 !== null ? parsed2 : {};
|
|
45186
45198
|
} catch {
|
|
45187
45199
|
return {};
|
|
45188
45200
|
}
|
|
@@ -45822,8 +45834,8 @@ function readAll2(path) {
|
|
|
45822
45834
|
if (!existsSync3(path))
|
|
45823
45835
|
return {};
|
|
45824
45836
|
try {
|
|
45825
|
-
const
|
|
45826
|
-
return typeof
|
|
45837
|
+
const parsed2 = JSON.parse(readFileSync3(path, "utf8"));
|
|
45838
|
+
return typeof parsed2 === "object" && parsed2 !== null ? parsed2 : {};
|
|
45827
45839
|
} catch {
|
|
45828
45840
|
return {};
|
|
45829
45841
|
}
|
|
@@ -46518,8 +46530,8 @@ ${indent(indent(args.selection))}
|
|
|
46518
46530
|
function loadGraphQLSchema(path, content) {
|
|
46519
46531
|
if (!path.endsWith(".json"))
|
|
46520
46532
|
return import_graphql5.buildSchema(content);
|
|
46521
|
-
const
|
|
46522
|
-
return import_graphql5.buildClientSchema(
|
|
46533
|
+
const parsed2 = JSON.parse(content);
|
|
46534
|
+
return import_graphql5.buildClientSchema(parsed2.data ?? parsed2);
|
|
46523
46535
|
}
|
|
46524
46536
|
function buildGraphQLTool(schema, file2, config2) {
|
|
46525
46537
|
const [kind = "", field = ""] = file2.operation.split(" ");
|
|
@@ -46573,10 +46585,10 @@ function text3(value) {
|
|
|
46573
46585
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
46574
46586
|
}
|
|
46575
46587
|
function parseOpenApi(path, content) {
|
|
46576
|
-
const
|
|
46577
|
-
if (!isRecord7(
|
|
46588
|
+
const parsed2 = path.endsWith(".json") ? JSON.parse(content) : $parse(content);
|
|
46589
|
+
if (!isRecord7(parsed2))
|
|
46578
46590
|
throw new Error("The spec is not an object.");
|
|
46579
|
-
return
|
|
46591
|
+
return parsed2;
|
|
46580
46592
|
}
|
|
46581
46593
|
var isSwagger2 = (doc2) => doc2.swagger === "2.0";
|
|
46582
46594
|
function findOperation(doc2, key, refs) {
|
|
@@ -47044,8 +47056,8 @@ function upstreamAuth2(config2) {
|
|
|
47044
47056
|
return { type: "none" };
|
|
47045
47057
|
}
|
|
47046
47058
|
function reusable(input2, specPath) {
|
|
47047
|
-
const
|
|
47048
|
-
return
|
|
47059
|
+
const parsed2 = input2.parsedSpec;
|
|
47060
|
+
return parsed2 && parsed2.path === specPath && parsed2.content === input2.spec ? parsed2.document : null;
|
|
47049
47061
|
}
|
|
47050
47062
|
function generateBundle(input2) {
|
|
47051
47063
|
const { definition } = input2;
|
|
@@ -47092,6 +47104,11 @@ function generateBundle(input2) {
|
|
|
47092
47104
|
if (!isUsableBaseUrl(baseUrl)) {
|
|
47093
47105
|
findings.push(finding2("error", "sokie.json", "missing-base-url", `No absolute upstream URL (the spec says ${baseUrl ?? "nothing"}); set upstream.baseUrl.`));
|
|
47094
47106
|
}
|
|
47107
|
+
const { auth } = config2.upstream;
|
|
47108
|
+
const identity2 = auth.type === "none" ? undefined : auth.identity;
|
|
47109
|
+
if (identity2?.url && isUsableBaseUrl(baseUrl) && !whoAmIUrl(baseUrl, identity2)) {
|
|
47110
|
+
findings.push(finding2("error", "sokie.json", "identity-host", `upstream.auth.identity.url carries each person's credential, so it must be https on the host of ${baseUrl}.`));
|
|
47111
|
+
}
|
|
47095
47112
|
if (findings.some((f) => f.level === "error"))
|
|
47096
47113
|
return { bundle: null, findings };
|
|
47097
47114
|
const bundle = {
|
|
@@ -49751,14 +49768,14 @@ function triState$1(schema, raw) {
|
|
|
49751
49768
|
ok: false,
|
|
49752
49769
|
reason: "not-in-era"
|
|
49753
49770
|
};
|
|
49754
|
-
const
|
|
49755
|
-
return
|
|
49771
|
+
const parsed2 = schema.safeParse(raw);
|
|
49772
|
+
return parsed2.success ? {
|
|
49756
49773
|
ok: true,
|
|
49757
|
-
value:
|
|
49774
|
+
value: parsed2.data
|
|
49758
49775
|
} : {
|
|
49759
49776
|
ok: false,
|
|
49760
49777
|
reason: "invalid",
|
|
49761
|
-
message: String(
|
|
49778
|
+
message: String(parsed2.error)
|
|
49762
49779
|
};
|
|
49763
49780
|
}
|
|
49764
49781
|
var NOT_IN_ERA$1 = {
|
|
@@ -51003,14 +51020,14 @@ function triState(schema, raw) {
|
|
|
51003
51020
|
ok: false,
|
|
51004
51021
|
reason: "not-in-era"
|
|
51005
51022
|
};
|
|
51006
|
-
const
|
|
51007
|
-
return
|
|
51023
|
+
const parsed2 = schema.safeParse(raw);
|
|
51024
|
+
return parsed2.success ? {
|
|
51008
51025
|
ok: true,
|
|
51009
|
-
value:
|
|
51026
|
+
value: parsed2.data
|
|
51010
51027
|
} : {
|
|
51011
51028
|
ok: false,
|
|
51012
51029
|
reason: "invalid",
|
|
51013
|
-
message: String(
|
|
51030
|
+
message: String(parsed2.error)
|
|
51014
51031
|
};
|
|
51015
51032
|
}
|
|
51016
51033
|
var NOT_IN_ERA = {
|
|
@@ -51072,9 +51089,9 @@ var rev2026Codec = {
|
|
|
51072
51089
|
key,
|
|
51073
51090
|
problem: "missing"
|
|
51074
51091
|
});
|
|
51075
|
-
const
|
|
51076
|
-
if (!
|
|
51077
|
-
for (const issue2 of
|
|
51092
|
+
const parsed2 = buildSchemas2026().RequestMetaEnvelopeSchema.safeParse(meta3);
|
|
51093
|
+
if (!parsed2.success)
|
|
51094
|
+
for (const issue2 of parsed2.error.issues) {
|
|
51078
51095
|
const path = issue2.path.map(String);
|
|
51079
51096
|
const key = path.length > 0 ? path.join(".") : "_meta";
|
|
51080
51097
|
if (path.length === 1 && issues.some((existing) => existing.key === key && existing.problem === "missing"))
|
|
@@ -51143,11 +51160,11 @@ var rev2026Codec = {
|
|
|
51143
51160
|
const wireResultSchemas = getWireResultSchemas();
|
|
51144
51161
|
const wireSchema = Object.hasOwn(wireResultSchemas, method) ? wireResultSchemas[method] : undefined;
|
|
51145
51162
|
if (wireSchema !== undefined) {
|
|
51146
|
-
const
|
|
51147
|
-
if (!
|
|
51163
|
+
const parsed2 = wireSchema.safeParse(raw);
|
|
51164
|
+
if (!parsed2.success)
|
|
51148
51165
|
return {
|
|
51149
51166
|
kind: "invalid",
|
|
51150
|
-
error: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: ${
|
|
51167
|
+
error: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: ${parsed2.error}`, { method })
|
|
51151
51168
|
};
|
|
51152
51169
|
}
|
|
51153
51170
|
const lifted = { ...raw };
|
|
@@ -51164,9 +51181,9 @@ var rev2026Codec = {
|
|
|
51164
51181
|
checkInboundEnvelope(material) {
|
|
51165
51182
|
if (material.envelope === undefined)
|
|
51166
51183
|
return "Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";
|
|
51167
|
-
const
|
|
51168
|
-
if (!
|
|
51169
|
-
return `Invalid _meta envelope for protocol revision 2026-07-28: ${
|
|
51184
|
+
const parsed2 = buildSchemas2026().RequestMetaEnvelopeSchema.safeParse(material.envelope);
|
|
51185
|
+
if (!parsed2.success)
|
|
51186
|
+
return `Invalid _meta envelope for protocol revision 2026-07-28: ${parsed2.error.issues.map((issue2) => issue2.message).join("; ")}`;
|
|
51170
51187
|
}
|
|
51171
51188
|
};
|
|
51172
51189
|
var wireResultSchemasMemo;
|
|
@@ -51850,16 +51867,16 @@ function describeUnsupportedProperties(pruned, fallback) {
|
|
|
51850
51867
|
const offenders = Object.entries(pruned.properties).filter(([, node2]) => !parseSchema(PrimitiveSchemaDefinitionSchema, node2).success).map(([name2]) => `properties.${name2}`);
|
|
51851
51868
|
return offenders.length > 0 ? offenders.join(", ") : fallback;
|
|
51852
51869
|
}
|
|
51853
|
-
function findDroppedConstraintPaths(original,
|
|
51854
|
-
if (Array.isArray(original) && Array.isArray(
|
|
51855
|
-
return original.flatMap((item, index) => findDroppedConstraintPaths(item,
|
|
51856
|
-
if (!isJsonObject(original) || !isJsonObject(
|
|
51870
|
+
function findDroppedConstraintPaths(original, parsed2, path = "") {
|
|
51871
|
+
if (Array.isArray(original) && Array.isArray(parsed2))
|
|
51872
|
+
return original.flatMap((item, index) => findDroppedConstraintPaths(item, parsed2[index], `${path}[${index}]`));
|
|
51873
|
+
if (!isJsonObject(original) || !isJsonObject(parsed2))
|
|
51857
51874
|
return [];
|
|
51858
51875
|
return Object.entries(original).flatMap(([key, value]) => {
|
|
51859
51876
|
const childPath = path ? `${path}.${key}` : key;
|
|
51860
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
51877
|
+
if (!Object.prototype.hasOwnProperty.call(parsed2, key))
|
|
51861
51878
|
return isAnnotationOnlyJsonSchemaKeyword(key) ? [] : [childPath];
|
|
51862
|
-
return findDroppedConstraintPaths(value,
|
|
51879
|
+
return findDroppedConstraintPaths(value, parsed2[key], childPath);
|
|
51863
51880
|
});
|
|
51864
51881
|
}
|
|
51865
51882
|
function normalizeElicitInputParams(input2) {
|
|
@@ -51871,19 +51888,19 @@ function normalizeElicitInputParams(input2) {
|
|
|
51871
51888
|
};
|
|
51872
51889
|
const vendor = input2.requestedSchema["~standard"].vendor;
|
|
51873
51890
|
const pruned = walkRequestedSchema(convertStandardElicitationSchema(input2.requestedSchema), vendor);
|
|
51874
|
-
const
|
|
51875
|
-
if (!
|
|
51876
|
-
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${describeUnsupportedProperties(pruned,
|
|
51877
|
-
const droppedConstraints = findDroppedConstraintPaths(pruned,
|
|
51891
|
+
const parsed2 = parseSchema(ElicitRequestFormParamsSchema.shape.requestedSchema, pruned);
|
|
51892
|
+
if (!parsed2.success)
|
|
51893
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${describeUnsupportedProperties(pruned, parsed2.error.message)}`);
|
|
51894
|
+
const droppedConstraints = findDroppedConstraintPaths(pruned, parsed2.data);
|
|
51878
51895
|
if (droppedConstraints.length > 0)
|
|
51879
51896
|
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${droppedConstraints.join(", ")}`);
|
|
51880
|
-
const danglingRequired = (
|
|
51897
|
+
const danglingRequired = (parsed2.data.required ?? []).filter((key) => !Object.prototype.hasOwnProperty.call(parsed2.data.properties, key));
|
|
51881
51898
|
if (danglingRequired.length > 0)
|
|
51882
51899
|
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema lists required properties that are not defined in properties: ${danglingRequired.join(", ")}`);
|
|
51883
51900
|
return {
|
|
51884
51901
|
...input2,
|
|
51885
51902
|
mode: "form",
|
|
51886
|
-
requestedSchema:
|
|
51903
|
+
requestedSchema: parsed2.data
|
|
51887
51904
|
};
|
|
51888
51905
|
}
|
|
51889
51906
|
function buildInputRequired(spec) {
|
|
@@ -52863,10 +52880,10 @@ var Protocol = class {
|
|
|
52863
52880
|
};
|
|
52864
52881
|
} else if (maybeHandler)
|
|
52865
52882
|
stored = async (request, ctx) => {
|
|
52866
|
-
const
|
|
52867
|
-
if (!
|
|
52868
|
-
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid params for ${method}: ${
|
|
52869
|
-
return maybeHandler(
|
|
52883
|
+
const parsed2 = await validateStandardSchema(schemasOrHandler.params, { ...request.params });
|
|
52884
|
+
if (!parsed2.success)
|
|
52885
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid params for ${method}: ${parsed2.error}`);
|
|
52886
|
+
return maybeHandler(parsed2.data, ctx);
|
|
52870
52887
|
};
|
|
52871
52888
|
else
|
|
52872
52889
|
throw new TypeError("setRequestHandler: handler is required");
|
|
@@ -52906,10 +52923,10 @@ var Protocol = class {
|
|
|
52906
52923
|
if (!maybeHandler)
|
|
52907
52924
|
throw new TypeError("setNotificationHandler: handler is required");
|
|
52908
52925
|
this._notificationHandlers.set(method, async (notification) => {
|
|
52909
|
-
const
|
|
52910
|
-
if (!
|
|
52911
|
-
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid params for notification ${method}: ${
|
|
52912
|
-
await maybeHandler(
|
|
52926
|
+
const parsed2 = await validateStandardSchema(schemasOrHandler.params, { ...notification.params });
|
|
52927
|
+
if (!parsed2.success)
|
|
52928
|
+
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid params for notification ${method}: ${parsed2.error}`);
|
|
52929
|
+
await maybeHandler(parsed2.data, notification);
|
|
52913
52930
|
});
|
|
52914
52931
|
}
|
|
52915
52932
|
removeNotificationHandler(method) {
|
|
@@ -56715,7 +56732,7 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
|
56715
56732
|
const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
56716
56733
|
function parse5(uri, opts) {
|
|
56717
56734
|
const options = Object.assign({}, opts);
|
|
56718
|
-
const
|
|
56735
|
+
const parsed2 = {
|
|
56719
56736
|
scheme: undefined,
|
|
56720
56737
|
userinfo: undefined,
|
|
56721
56738
|
host: "",
|
|
@@ -56732,58 +56749,58 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
|
56732
56749
|
uri = "//" + uri;
|
|
56733
56750
|
const matches2 = uri.match(URI_PARSE);
|
|
56734
56751
|
if (matches2) {
|
|
56735
|
-
|
|
56736
|
-
|
|
56737
|
-
|
|
56738
|
-
|
|
56739
|
-
|
|
56740
|
-
|
|
56741
|
-
|
|
56742
|
-
if (isNaN(
|
|
56743
|
-
|
|
56744
|
-
if (
|
|
56745
|
-
if (isIPv4(
|
|
56746
|
-
const ipv6result = normalizeIPv6(
|
|
56747
|
-
|
|
56752
|
+
parsed2.scheme = matches2[1];
|
|
56753
|
+
parsed2.userinfo = matches2[3];
|
|
56754
|
+
parsed2.host = matches2[4];
|
|
56755
|
+
parsed2.port = parseInt(matches2[5], 10);
|
|
56756
|
+
parsed2.path = matches2[6] || "";
|
|
56757
|
+
parsed2.query = matches2[7];
|
|
56758
|
+
parsed2.fragment = matches2[8];
|
|
56759
|
+
if (isNaN(parsed2.port))
|
|
56760
|
+
parsed2.port = matches2[5];
|
|
56761
|
+
if (parsed2.host)
|
|
56762
|
+
if (isIPv4(parsed2.host) === false) {
|
|
56763
|
+
const ipv6result = normalizeIPv6(parsed2.host);
|
|
56764
|
+
parsed2.host = ipv6result.host.toLowerCase();
|
|
56748
56765
|
isIP = ipv6result.isIPV6;
|
|
56749
56766
|
} else
|
|
56750
56767
|
isIP = true;
|
|
56751
|
-
if (
|
|
56752
|
-
|
|
56753
|
-
else if (
|
|
56754
|
-
|
|
56755
|
-
else if (
|
|
56756
|
-
|
|
56768
|
+
if (parsed2.scheme === undefined && parsed2.userinfo === undefined && parsed2.host === undefined && parsed2.port === undefined && parsed2.query === undefined && !parsed2.path)
|
|
56769
|
+
parsed2.reference = "same-document";
|
|
56770
|
+
else if (parsed2.scheme === undefined)
|
|
56771
|
+
parsed2.reference = "relative";
|
|
56772
|
+
else if (parsed2.fragment === undefined)
|
|
56773
|
+
parsed2.reference = "absolute";
|
|
56757
56774
|
else
|
|
56758
|
-
|
|
56759
|
-
if (options.reference && options.reference !== "suffix" && options.reference !==
|
|
56760
|
-
|
|
56761
|
-
const schemeHandler = getSchemeHandler(options.scheme ||
|
|
56775
|
+
parsed2.reference = "uri";
|
|
56776
|
+
if (options.reference && options.reference !== "suffix" && options.reference !== parsed2.reference)
|
|
56777
|
+
parsed2.error = parsed2.error || "URI is not a " + options.reference + " reference.";
|
|
56778
|
+
const schemeHandler = getSchemeHandler(options.scheme || parsed2.scheme);
|
|
56762
56779
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
56763
|
-
if (
|
|
56780
|
+
if (parsed2.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed2.host))
|
|
56764
56781
|
try {
|
|
56765
|
-
|
|
56782
|
+
parsed2.host = URL.domainToASCII(parsed2.host.toLowerCase());
|
|
56766
56783
|
} catch (e) {
|
|
56767
|
-
|
|
56784
|
+
parsed2.error = parsed2.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
56768
56785
|
}
|
|
56769
56786
|
}
|
|
56770
56787
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
56771
56788
|
if (uri.indexOf("%") !== -1) {
|
|
56772
|
-
if (
|
|
56773
|
-
|
|
56774
|
-
if (
|
|
56775
|
-
|
|
56789
|
+
if (parsed2.scheme !== undefined)
|
|
56790
|
+
parsed2.scheme = unescape(parsed2.scheme);
|
|
56791
|
+
if (parsed2.host !== undefined)
|
|
56792
|
+
parsed2.host = unescape(parsed2.host);
|
|
56776
56793
|
}
|
|
56777
|
-
if (
|
|
56778
|
-
|
|
56779
|
-
if (
|
|
56780
|
-
|
|
56794
|
+
if (parsed2.path)
|
|
56795
|
+
parsed2.path = escape(unescape(parsed2.path));
|
|
56796
|
+
if (parsed2.fragment)
|
|
56797
|
+
parsed2.fragment = encodeURI(decodeURIComponent(parsed2.fragment));
|
|
56781
56798
|
}
|
|
56782
56799
|
if (schemeHandler && schemeHandler.parse)
|
|
56783
|
-
schemeHandler.parse(
|
|
56800
|
+
schemeHandler.parse(parsed2, options);
|
|
56784
56801
|
} else
|
|
56785
|
-
|
|
56786
|
-
return
|
|
56802
|
+
parsed2.error = parsed2.error || "URI can not be parsed.";
|
|
56803
|
+
return parsed2;
|
|
56787
56804
|
}
|
|
56788
56805
|
const fastUri = {
|
|
56789
56806
|
SCHEMES,
|
|
@@ -61691,13 +61708,13 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fet
|
|
|
61691
61708
|
continue;
|
|
61692
61709
|
throw new Error(`HTTP ${response.status} trying to load ${type === "oauth" ? "OAuth" : "OpenID provider"} metadata from ${endpointUrl}`);
|
|
61693
61710
|
}
|
|
61694
|
-
const
|
|
61711
|
+
const parsed2 = type === "oauth" ? OAuthMetadataSchema.parse(await response.json()) : OpenIdProviderDiscoveryMetadataSchema.parse(await response.json());
|
|
61695
61712
|
if (!skipIssuerValidation) {
|
|
61696
61713
|
const expectedIssuer = typeof authorizationServerUrl === "string" ? authorizationServerUrl : authorizationServerUrl.href;
|
|
61697
|
-
if (!(
|
|
61698
|
-
throw new IssuerMismatchError("metadata", expectedIssuer,
|
|
61714
|
+
if (!(parsed2.issuer === expectedIssuer || expectedIssuer.endsWith("/") && parsed2.issuer === expectedIssuer.slice(0, -1)))
|
|
61715
|
+
throw new IssuerMismatchError("metadata", expectedIssuer, parsed2.issuer);
|
|
61699
61716
|
}
|
|
61700
|
-
return
|
|
61717
|
+
return parsed2;
|
|
61701
61718
|
}
|
|
61702
61719
|
}
|
|
61703
61720
|
async function discoverOAuthServerInfo(serverUrl, opts) {
|
|
@@ -62075,10 +62092,10 @@ var ClientResponseCache = class {
|
|
|
62075
62092
|
if (entry?.expiresAt === undefined || !(entry.expiresAt > this.now()))
|
|
62076
62093
|
return;
|
|
62077
62094
|
try {
|
|
62078
|
-
const
|
|
62079
|
-
if (typeof
|
|
62095
|
+
const parsed2 = JSON.parse(entry.value);
|
|
62096
|
+
if (typeof parsed2 !== "object" || parsed2 === null || Array.isArray(parsed2))
|
|
62080
62097
|
throw new TypeError("cached document is not an object");
|
|
62081
|
-
return { value:
|
|
62098
|
+
return { value: parsed2 };
|
|
62082
62099
|
} catch (error62) {
|
|
62083
62100
|
this._reportError(error62);
|
|
62084
62101
|
await this._deleteBoth(method, params ?? "");
|
|
@@ -62135,10 +62152,10 @@ var ClientResponseCache = class {
|
|
|
62135
62152
|
}
|
|
62136
62153
|
_decodeListTools(entry) {
|
|
62137
62154
|
try {
|
|
62138
|
-
const
|
|
62139
|
-
if (!Array.isArray(
|
|
62155
|
+
const parsed2 = JSON.parse(entry.value);
|
|
62156
|
+
if (!Array.isArray(parsed2?.tools) || !parsed2.tools.every((t) => t !== null && typeof t === "object"))
|
|
62140
62157
|
throw new TypeError("cached tools/list document has a malformed tools array");
|
|
62141
|
-
return
|
|
62158
|
+
return parsed2;
|
|
62142
62159
|
} catch (error62) {
|
|
62143
62160
|
this._reportError(error62);
|
|
62144
62161
|
return;
|
|
@@ -62210,16 +62227,16 @@ function classifyProbeOutcome(outcome, context) {
|
|
|
62210
62227
|
}
|
|
62211
62228
|
}
|
|
62212
62229
|
function classifyResult(result, context) {
|
|
62213
|
-
const
|
|
62214
|
-
if (!
|
|
62230
|
+
const parsed2 = codecForVersion(MODERN_WIRE_REVISION).validateResult("server/discover", result);
|
|
62231
|
+
if (!parsed2.ok)
|
|
62215
62232
|
return { kind: "legacy" };
|
|
62216
|
-
const supportedVersions =
|
|
62233
|
+
const supportedVersions = parsed2.value.supportedVersions;
|
|
62217
62234
|
const overlap = context.clientModernVersions.find((version4) => supportedVersions.includes(version4));
|
|
62218
62235
|
if (overlap !== undefined)
|
|
62219
62236
|
return {
|
|
62220
62237
|
kind: "modern",
|
|
62221
62238
|
version: overlap,
|
|
62222
|
-
discover:
|
|
62239
|
+
discover: parsed2.value
|
|
62223
62240
|
};
|
|
62224
62241
|
if (context.fallbackAvailable)
|
|
62225
62242
|
return { kind: "legacy" };
|
|
@@ -62320,15 +62337,15 @@ function parseRequested(data) {
|
|
|
62320
62337
|
function parseJsonRpcErrorBody(body) {
|
|
62321
62338
|
if (body === undefined || body === "")
|
|
62322
62339
|
return;
|
|
62323
|
-
let
|
|
62340
|
+
let parsed2;
|
|
62324
62341
|
try {
|
|
62325
|
-
|
|
62342
|
+
parsed2 = JSON.parse(body);
|
|
62326
62343
|
} catch {
|
|
62327
62344
|
return;
|
|
62328
62345
|
}
|
|
62329
|
-
if (typeof
|
|
62346
|
+
if (typeof parsed2 !== "object" || parsed2 === null)
|
|
62330
62347
|
return;
|
|
62331
|
-
const error62 =
|
|
62348
|
+
const error62 = parsed2.error;
|
|
62332
62349
|
if (typeof error62 !== "object" || error62 === null)
|
|
62333
62350
|
return;
|
|
62334
62351
|
const { code: code2, message, data } = error62;
|
|
@@ -64212,10 +64229,10 @@ var StreamableHTTPClientTransport = class {
|
|
|
64212
64229
|
}
|
|
64213
64230
|
if (response.status === 400 && typeof text5 === "string" && this._isModernEnvelopedRequest(message))
|
|
64214
64231
|
try {
|
|
64215
|
-
const
|
|
64232
|
+
const parsed2 = JSONRPCMessageSchema.parse(JSON.parse(text5));
|
|
64216
64233
|
const requests = (Array.isArray(message) ? message : [message]).filter((m) => isJSONRPCRequest(m));
|
|
64217
|
-
if (isJSONRPCErrorResponse(
|
|
64218
|
-
this.onmessage?.(
|
|
64234
|
+
if (isJSONRPCErrorResponse(parsed2) && requests.some((r) => r.id === parsed2.id)) {
|
|
64235
|
+
this.onmessage?.(parsed2);
|
|
64219
64236
|
return;
|
|
64220
64237
|
}
|
|
64221
64238
|
} catch {}
|
|
@@ -64464,10 +64481,10 @@ function readDevRunFile(root) {
|
|
|
64464
64481
|
if (!existsSync6(path))
|
|
64465
64482
|
return null;
|
|
64466
64483
|
try {
|
|
64467
|
-
const
|
|
64468
|
-
if (typeof
|
|
64484
|
+
const parsed2 = JSON.parse(readFileSync6(path, "utf8"));
|
|
64485
|
+
if (typeof parsed2 !== "object" || parsed2 === null)
|
|
64469
64486
|
return null;
|
|
64470
|
-
const { pid, serverUrl, token } =
|
|
64487
|
+
const { pid, serverUrl, token } = parsed2;
|
|
64471
64488
|
if (typeof pid !== "number" || typeof serverUrl !== "string")
|
|
64472
64489
|
return null;
|
|
64473
64490
|
return { pid, serverUrl, token: typeof token === "string" ? token : null };
|
|
@@ -64594,16 +64611,16 @@ var TERMINAL = {
|
|
|
64594
64611
|
function parseInput(raw) {
|
|
64595
64612
|
if (raw === undefined)
|
|
64596
64613
|
return {};
|
|
64597
|
-
let
|
|
64614
|
+
let parsed2;
|
|
64598
64615
|
try {
|
|
64599
|
-
|
|
64616
|
+
parsed2 = JSON.parse(raw);
|
|
64600
64617
|
} catch (error62) {
|
|
64601
64618
|
throw new UsageError(`--input isn't JSON: ${error62.message}`);
|
|
64602
64619
|
}
|
|
64603
|
-
if (typeof
|
|
64620
|
+
if (typeof parsed2 !== "object" || parsed2 === null || Array.isArray(parsed2)) {
|
|
64604
64621
|
throw new UsageError(`--input is the tool's arguments as one JSON object, like '{"id":"t_1"}'.`);
|
|
64605
64622
|
}
|
|
64606
|
-
return
|
|
64623
|
+
return parsed2;
|
|
64607
64624
|
}
|
|
64608
64625
|
function localRoute(root, name2, input2) {
|
|
64609
64626
|
return routeCall(buildFromFiles(readRepoFiles(root)).definition, name2, input2);
|
|
@@ -66869,9 +66886,9 @@ async function downloadFiles(client, serverId, number4, fetchFn = (url2) => fetc
|
|
|
66869
66886
|
if (!response.ok) {
|
|
66870
66887
|
throw new DeployError("download_failed", `The files couldn't be downloaded (${response.status}).`);
|
|
66871
66888
|
}
|
|
66872
|
-
const
|
|
66889
|
+
const parsed2 = await response.json();
|
|
66873
66890
|
const files = new Map;
|
|
66874
|
-
for (const [path, text5] of Object.entries(
|
|
66891
|
+
for (const [path, text5] of Object.entries(parsed2.files ?? {})) {
|
|
66875
66892
|
if (typeof text5 === "string" && safePath(path))
|
|
66876
66893
|
files.set(path, text5);
|
|
66877
66894
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyssinia-labs/sokie",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.2-staging.178",
|
|
5
5
|
"description": "Turn an OpenAPI or Swagger spec into an MCP server, run it on your machine, and deploy it to Sokie. The sokie command (alias sok).",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"homepage": "https://sokie.sh/docs/cli",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"author": "Abyssinia Labs <hello@sokie.sh> (https://sokie.sh)",
|
|
12
12
|
"sokie": {
|
|
13
|
-
"site": "https://sokie.sh"
|
|
13
|
+
"site": "https://staging.sokie.sh"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"mcp",
|