@glasser-ai/cli 0.1.74 → 0.1.80
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/glasser.js +601 -470
- package/package.json +1 -1
package/dist/glasser.js
CHANGED
|
@@ -1151,14 +1151,14 @@ var require_util = __commonJS({
|
|
|
1151
1151
|
}
|
|
1152
1152
|
const port2 = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
1153
1153
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port2}`;
|
|
1154
|
-
let
|
|
1154
|
+
let path10 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
1155
1155
|
if (origin[origin.length - 1] === "/") {
|
|
1156
1156
|
origin = origin.slice(0, origin.length - 1);
|
|
1157
1157
|
}
|
|
1158
|
-
if (
|
|
1159
|
-
|
|
1158
|
+
if (path10 && path10[0] !== "/") {
|
|
1159
|
+
path10 = `/${path10}`;
|
|
1160
1160
|
}
|
|
1161
|
-
return new URL(`${origin}${
|
|
1161
|
+
return new URL(`${origin}${path10}`);
|
|
1162
1162
|
}
|
|
1163
1163
|
if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
|
|
1164
1164
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -2029,9 +2029,9 @@ var require_diagnostics = __commonJS({
|
|
|
2029
2029
|
"undici:client:sendHeaders",
|
|
2030
2030
|
(evt) => {
|
|
2031
2031
|
const {
|
|
2032
|
-
request: { method, path:
|
|
2032
|
+
request: { method, path: path10, origin }
|
|
2033
2033
|
} = evt;
|
|
2034
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
2034
|
+
debugLog("sending request to %s %s%s", method, origin, path10);
|
|
2035
2035
|
}
|
|
2036
2036
|
);
|
|
2037
2037
|
}
|
|
@@ -2049,14 +2049,14 @@ var require_diagnostics = __commonJS({
|
|
|
2049
2049
|
"undici:request:headers",
|
|
2050
2050
|
(evt) => {
|
|
2051
2051
|
const {
|
|
2052
|
-
request: { method, path:
|
|
2052
|
+
request: { method, path: path10, origin },
|
|
2053
2053
|
response: { statusCode }
|
|
2054
2054
|
} = evt;
|
|
2055
2055
|
debugLog(
|
|
2056
2056
|
"received response to %s %s%s - HTTP %d",
|
|
2057
2057
|
method,
|
|
2058
2058
|
origin,
|
|
2059
|
-
|
|
2059
|
+
path10,
|
|
2060
2060
|
statusCode
|
|
2061
2061
|
);
|
|
2062
2062
|
}
|
|
@@ -2065,23 +2065,23 @@ var require_diagnostics = __commonJS({
|
|
|
2065
2065
|
"undici:request:trailers",
|
|
2066
2066
|
(evt) => {
|
|
2067
2067
|
const {
|
|
2068
|
-
request: { method, path:
|
|
2068
|
+
request: { method, path: path10, origin }
|
|
2069
2069
|
} = evt;
|
|
2070
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
2070
|
+
debugLog("trailers received from %s %s%s", method, origin, path10);
|
|
2071
2071
|
}
|
|
2072
2072
|
);
|
|
2073
2073
|
diagnosticsChannel.subscribe(
|
|
2074
2074
|
"undici:request:error",
|
|
2075
2075
|
(evt) => {
|
|
2076
2076
|
const {
|
|
2077
|
-
request: { method, path:
|
|
2077
|
+
request: { method, path: path10, origin },
|
|
2078
2078
|
error: error2
|
|
2079
2079
|
} = evt;
|
|
2080
2080
|
debugLog(
|
|
2081
2081
|
"request to %s %s%s errored - %s",
|
|
2082
2082
|
method,
|
|
2083
2083
|
origin,
|
|
2084
|
-
|
|
2084
|
+
path10,
|
|
2085
2085
|
error2.message
|
|
2086
2086
|
);
|
|
2087
2087
|
}
|
|
@@ -2236,7 +2236,7 @@ var require_request = __commonJS({
|
|
|
2236
2236
|
};
|
|
2237
2237
|
var Request2 = class {
|
|
2238
2238
|
constructor(origin, {
|
|
2239
|
-
path:
|
|
2239
|
+
path: path10,
|
|
2240
2240
|
method,
|
|
2241
2241
|
body,
|
|
2242
2242
|
headers,
|
|
@@ -2253,11 +2253,11 @@ var require_request = __commonJS({
|
|
|
2253
2253
|
maxRedirections,
|
|
2254
2254
|
typeOfService
|
|
2255
2255
|
}, handler) {
|
|
2256
|
-
if (typeof
|
|
2256
|
+
if (typeof path10 !== "string") {
|
|
2257
2257
|
throw new InvalidArgumentError("path must be a string");
|
|
2258
|
-
} else if (
|
|
2258
|
+
} else if (path10[0] !== "/" && !(path10.startsWith("http://") || path10.startsWith("https://")) && method !== "CONNECT") {
|
|
2259
2259
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
2260
|
-
} else if (invalidPathRegex.test(
|
|
2260
|
+
} else if (invalidPathRegex.test(path10)) {
|
|
2261
2261
|
throw new InvalidArgumentError("invalid request path");
|
|
2262
2262
|
}
|
|
2263
2263
|
if (typeof method !== "string") {
|
|
@@ -2332,7 +2332,7 @@ var require_request = __commonJS({
|
|
|
2332
2332
|
this.completed = false;
|
|
2333
2333
|
this.aborted = false;
|
|
2334
2334
|
this.upgrade = upgrade || null;
|
|
2335
|
-
this.path = query ? serializePathWithQuery(
|
|
2335
|
+
this.path = query ? serializePathWithQuery(path10, query) : path10;
|
|
2336
2336
|
this.origin = origin;
|
|
2337
2337
|
this.protocol = getProtocolFromUrlString(origin);
|
|
2338
2338
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" || method === "QUERY" : idempotent;
|
|
@@ -7418,7 +7418,7 @@ var require_client_h1 = __commonJS({
|
|
|
7418
7418
|
}
|
|
7419
7419
|
}
|
|
7420
7420
|
function writeH1(client, request5) {
|
|
7421
|
-
const { method, path:
|
|
7421
|
+
const { method, path: path10, host, upgrade, blocking, reset: reset2 } = request5;
|
|
7422
7422
|
let { body, headers, contentLength } = request5;
|
|
7423
7423
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
7424
7424
|
if (util.isFormDataLike(body)) {
|
|
@@ -7494,7 +7494,7 @@ var require_client_h1 = __commonJS({
|
|
|
7494
7494
|
socket[kBlocking] = true;
|
|
7495
7495
|
}
|
|
7496
7496
|
setTypeOfService(socket, request5);
|
|
7497
|
-
let header = `${method} ${
|
|
7497
|
+
let header = `${method} ${path10} HTTP/1.1\r
|
|
7498
7498
|
`;
|
|
7499
7499
|
if (typeof host === "string") {
|
|
7500
7500
|
header += `host: ${host}\r
|
|
@@ -8575,7 +8575,7 @@ var require_client_h2 = __commonJS({
|
|
|
8575
8575
|
const headersTimeout = request5.headersTimeout ?? client[kHeadersTimeout];
|
|
8576
8576
|
const bodyTimeout = request5.bodyTimeout ?? client[kBodyTimeout];
|
|
8577
8577
|
const session = client[kHTTP2Session];
|
|
8578
|
-
const { method, path:
|
|
8578
|
+
const { method, path: path10, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request5;
|
|
8579
8579
|
if (upgrade != null && upgrade !== "websocket") {
|
|
8580
8580
|
util.errorRequest(client, request5, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
|
|
8581
8581
|
return false;
|
|
@@ -8638,7 +8638,7 @@ var require_client_h2 = __commonJS({
|
|
|
8638
8638
|
}
|
|
8639
8639
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
8640
8640
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
8641
|
-
headers[HTTP2_HEADER_PATH] =
|
|
8641
|
+
headers[HTTP2_HEADER_PATH] = path10;
|
|
8642
8642
|
if (protocol === "ws:" || protocol === "wss:") {
|
|
8643
8643
|
headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
8644
8644
|
} else {
|
|
@@ -8660,7 +8660,7 @@ var require_client_h2 = __commonJS({
|
|
|
8660
8660
|
setupUpgradeStream(stream2, state);
|
|
8661
8661
|
return true;
|
|
8662
8662
|
}
|
|
8663
|
-
headers[HTTP2_HEADER_PATH] =
|
|
8663
|
+
headers[HTTP2_HEADER_PATH] = path10;
|
|
8664
8664
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
8665
8665
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
8666
8666
|
let body = state.body;
|
|
@@ -11330,10 +11330,10 @@ var require_proxy_agent = __commonJS({
|
|
|
11330
11330
|
};
|
|
11331
11331
|
const {
|
|
11332
11332
|
origin,
|
|
11333
|
-
path:
|
|
11333
|
+
path: path10 = "/",
|
|
11334
11334
|
headers = {}
|
|
11335
11335
|
} = opts;
|
|
11336
|
-
opts.path = origin +
|
|
11336
|
+
opts.path = origin + path10;
|
|
11337
11337
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
11338
11338
|
const { host } = new URL(origin);
|
|
11339
11339
|
headers.host = host;
|
|
@@ -13598,20 +13598,20 @@ var require_mock_utils = __commonJS({
|
|
|
13598
13598
|
}
|
|
13599
13599
|
return normalizedQp;
|
|
13600
13600
|
}
|
|
13601
|
-
function safeUrl(
|
|
13602
|
-
if (typeof
|
|
13603
|
-
return
|
|
13601
|
+
function safeUrl(path10) {
|
|
13602
|
+
if (typeof path10 !== "string") {
|
|
13603
|
+
return path10;
|
|
13604
13604
|
}
|
|
13605
|
-
const pathSegments =
|
|
13605
|
+
const pathSegments = path10.split("?", 3);
|
|
13606
13606
|
if (pathSegments.length !== 2) {
|
|
13607
|
-
return
|
|
13607
|
+
return path10;
|
|
13608
13608
|
}
|
|
13609
13609
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
13610
13610
|
qp.sort();
|
|
13611
13611
|
return [...pathSegments, qp.toString()].join("?");
|
|
13612
13612
|
}
|
|
13613
|
-
function matchKey(mockDispatch2, { path:
|
|
13614
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
13613
|
+
function matchKey(mockDispatch2, { path: path10, method, body, headers }) {
|
|
13614
|
+
const pathMatch = matchValue(mockDispatch2.path, path10);
|
|
13615
13615
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
13616
13616
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
13617
13617
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -13638,8 +13638,8 @@ var require_mock_utils = __commonJS({
|
|
|
13638
13638
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
13639
13639
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
13640
13640
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash2(resolvedPath);
|
|
13641
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
13642
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash2(safeUrl(
|
|
13641
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path10, ignoreTrailingSlash }) => {
|
|
13642
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash2(safeUrl(path10)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path10), resolvedPath);
|
|
13643
13643
|
});
|
|
13644
13644
|
if (matchedMockDispatches.length === 0) {
|
|
13645
13645
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -13678,22 +13678,22 @@ var require_mock_utils = __commonJS({
|
|
|
13678
13678
|
mockDispatches.splice(index2, 1);
|
|
13679
13679
|
}
|
|
13680
13680
|
}
|
|
13681
|
-
function removeTrailingSlash2(
|
|
13682
|
-
if (typeof
|
|
13683
|
-
return
|
|
13681
|
+
function removeTrailingSlash2(path10) {
|
|
13682
|
+
if (typeof path10 !== "string") {
|
|
13683
|
+
return path10;
|
|
13684
13684
|
}
|
|
13685
|
-
while (
|
|
13686
|
-
|
|
13685
|
+
while (path10.endsWith("/")) {
|
|
13686
|
+
path10 = path10.slice(0, -1);
|
|
13687
13687
|
}
|
|
13688
|
-
if (
|
|
13689
|
-
|
|
13688
|
+
if (path10.length === 0) {
|
|
13689
|
+
path10 = "/";
|
|
13690
13690
|
}
|
|
13691
|
-
return
|
|
13691
|
+
return path10;
|
|
13692
13692
|
}
|
|
13693
13693
|
function buildKey(opts) {
|
|
13694
|
-
const { path:
|
|
13694
|
+
const { path: path10, method, body, headers, query } = opts;
|
|
13695
13695
|
return {
|
|
13696
|
-
path:
|
|
13696
|
+
path: path10,
|
|
13697
13697
|
method,
|
|
13698
13698
|
body,
|
|
13699
13699
|
headers,
|
|
@@ -14564,10 +14564,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
14564
14564
|
}
|
|
14565
14565
|
format(pendingInterceptors) {
|
|
14566
14566
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
14567
|
-
({ method, path:
|
|
14567
|
+
({ method, path: path10, data: { statusCode }, persist, times: times2, timesInvoked, origin }) => ({
|
|
14568
14568
|
Method: method,
|
|
14569
14569
|
Origin: origin,
|
|
14570
|
-
Path:
|
|
14570
|
+
Path: path10,
|
|
14571
14571
|
"Status code": statusCode,
|
|
14572
14572
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
14573
14573
|
Invocations: timesInvoked,
|
|
@@ -14649,9 +14649,9 @@ var require_mock_agent = __commonJS({
|
|
|
14649
14649
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
14650
14650
|
const dispatchOpts = { ...opts };
|
|
14651
14651
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
14652
|
-
const [
|
|
14652
|
+
const [path10, searchParams] = dispatchOpts.path.split("?");
|
|
14653
14653
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
14654
|
-
dispatchOpts.path = `${
|
|
14654
|
+
dispatchOpts.path = `${path10}?${normalizedSearchParams}`;
|
|
14655
14655
|
}
|
|
14656
14656
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
14657
14657
|
}
|
|
@@ -15067,12 +15067,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
15067
15067
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
15068
15068
|
*/
|
|
15069
15069
|
async loadSnapshots(filePath) {
|
|
15070
|
-
const
|
|
15071
|
-
if (!
|
|
15070
|
+
const path10 = filePath || this.#snapshotPath;
|
|
15071
|
+
if (!path10) {
|
|
15072
15072
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
15073
15073
|
}
|
|
15074
15074
|
try {
|
|
15075
|
-
const data = await readFile3(resolve4(
|
|
15075
|
+
const data = await readFile3(resolve4(path10), "utf8");
|
|
15076
15076
|
const parsed = JSON.parse(data);
|
|
15077
15077
|
if (Array.isArray(parsed)) {
|
|
15078
15078
|
this.#snapshots.clear();
|
|
@@ -15086,7 +15086,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
15086
15086
|
if (error2.code === "ENOENT") {
|
|
15087
15087
|
this.#snapshots.clear();
|
|
15088
15088
|
} else {
|
|
15089
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
15089
|
+
throw new UndiciError(`Failed to load snapshots from ${path10}`, { cause: error2 });
|
|
15090
15090
|
}
|
|
15091
15091
|
}
|
|
15092
15092
|
}
|
|
@@ -15097,11 +15097,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
15097
15097
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
15098
15098
|
*/
|
|
15099
15099
|
async saveSnapshots(filePath) {
|
|
15100
|
-
const
|
|
15101
|
-
if (!
|
|
15100
|
+
const path10 = filePath || this.#snapshotPath;
|
|
15101
|
+
if (!path10) {
|
|
15102
15102
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
15103
15103
|
}
|
|
15104
|
-
const resolvedPath = resolve4(
|
|
15104
|
+
const resolvedPath = resolve4(path10);
|
|
15105
15105
|
await mkdir2(dirname2(resolvedPath), { recursive: true });
|
|
15106
15106
|
const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot2]) => ({
|
|
15107
15107
|
hash: hash2,
|
|
@@ -15738,15 +15738,15 @@ var require_redirect_handler = __commonJS({
|
|
|
15738
15738
|
return;
|
|
15739
15739
|
}
|
|
15740
15740
|
const { origin, pathname, search: search2 } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
15741
|
-
const
|
|
15742
|
-
const redirectUrlString = `${origin}${
|
|
15741
|
+
const path10 = search2 ? `${pathname}${search2}` : pathname;
|
|
15742
|
+
const redirectUrlString = `${origin}${path10}`;
|
|
15743
15743
|
for (const historyUrl of this.history) {
|
|
15744
15744
|
if (historyUrl.toString() === redirectUrlString) {
|
|
15745
15745
|
throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
|
|
15746
15746
|
}
|
|
15747
15747
|
}
|
|
15748
15748
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, removeContentHeaders, this.opts.origin !== origin, this.stripHeadersOnRedirect, this.stripHeadersOnCrossOriginRedirect);
|
|
15749
|
-
this.opts.path =
|
|
15749
|
+
this.opts.path = path10;
|
|
15750
15750
|
this.opts.origin = origin;
|
|
15751
15751
|
this.opts.query = null;
|
|
15752
15752
|
}
|
|
@@ -17574,10 +17574,10 @@ var require_cache_handler = __commonJS({
|
|
|
17574
17574
|
}
|
|
17575
17575
|
return locationUrl.pathname + locationUrl.search;
|
|
17576
17576
|
}
|
|
17577
|
-
function deleteCachedUri(store, cacheKey,
|
|
17577
|
+
function deleteCachedUri(store, cacheKey, path10) {
|
|
17578
17578
|
deleteCachedValue(store, {
|
|
17579
17579
|
...cacheKey,
|
|
17580
|
-
path:
|
|
17580
|
+
path: path10
|
|
17581
17581
|
});
|
|
17582
17582
|
for (let i = 0; i < util.safeHTTPMethods.length; i++) {
|
|
17583
17583
|
const method = util.safeHTTPMethods[i];
|
|
@@ -17585,7 +17585,7 @@ var require_cache_handler = __commonJS({
|
|
|
17585
17585
|
deleteCachedValue(store, {
|
|
17586
17586
|
...cacheKey,
|
|
17587
17587
|
method,
|
|
17588
|
-
path:
|
|
17588
|
+
path: path10
|
|
17589
17589
|
});
|
|
17590
17590
|
}
|
|
17591
17591
|
}
|
|
@@ -17596,9 +17596,9 @@ var require_cache_handler = __commonJS({
|
|
|
17596
17596
|
}
|
|
17597
17597
|
const values3 = Array.isArray(headerValue) ? headerValue : [headerValue];
|
|
17598
17598
|
for (let i = 0; i < values3.length; i++) {
|
|
17599
|
-
const
|
|
17600
|
-
if (
|
|
17601
|
-
deleteCachedUri(store, cacheKey,
|
|
17599
|
+
const path10 = getSameOriginPath(cacheKey, values3[i]);
|
|
17600
|
+
if (path10 !== void 0) {
|
|
17601
|
+
deleteCachedUri(store, cacheKey, path10);
|
|
17602
17602
|
}
|
|
17603
17603
|
}
|
|
17604
17604
|
}
|
|
@@ -22595,13 +22595,13 @@ var require_fetch = __commonJS({
|
|
|
22595
22595
|
function dispatch({ body }) {
|
|
22596
22596
|
const url2 = requestCurrentURL(request5);
|
|
22597
22597
|
const agent = fetchParams.controller.dispatcher;
|
|
22598
|
-
const
|
|
22598
|
+
const path10 = url2.pathname + url2.search;
|
|
22599
22599
|
const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
|
|
22600
22600
|
return dispatchWithProtocolPreference(body);
|
|
22601
22601
|
function dispatchWithProtocolPreference(body2, allowH2) {
|
|
22602
22602
|
return new Promise((resolve4, reject) => agent.dispatch(
|
|
22603
22603
|
{
|
|
22604
|
-
path: hasTrailingQuestionMark ? `${
|
|
22604
|
+
path: hasTrailingQuestionMark ? `${path10}?` : path10,
|
|
22605
22605
|
origin: url2.origin,
|
|
22606
22606
|
method: request5.method,
|
|
22607
22607
|
body: agent.isMockActive ? request5.body && (request5.body.source || request5.body.stream) : body2,
|
|
@@ -23513,9 +23513,9 @@ var require_util4 = __commonJS({
|
|
|
23513
23513
|
}
|
|
23514
23514
|
}
|
|
23515
23515
|
}
|
|
23516
|
-
function validateCookiePath(
|
|
23517
|
-
for (let i = 0; i <
|
|
23518
|
-
const code =
|
|
23516
|
+
function validateCookiePath(path10) {
|
|
23517
|
+
for (let i = 0; i < path10.length; ++i) {
|
|
23518
|
+
const code = path10.charCodeAt(i);
|
|
23519
23519
|
if (code < 32 || // exclude CTLs (0-31)
|
|
23520
23520
|
code > 126 || // exclude non-ascii and DEL
|
|
23521
23521
|
code === 59) {
|
|
@@ -26887,11 +26887,11 @@ var require_undici = __commonJS({
|
|
|
26887
26887
|
if (typeof opts.path !== "string") {
|
|
26888
26888
|
throw new InvalidArgumentError("invalid opts.path");
|
|
26889
26889
|
}
|
|
26890
|
-
let
|
|
26890
|
+
let path10 = opts.path;
|
|
26891
26891
|
if (!opts.path.startsWith("/")) {
|
|
26892
|
-
|
|
26892
|
+
path10 = `/${path10}`;
|
|
26893
26893
|
}
|
|
26894
|
-
url2 = new URL(util.parseOrigin(url2).origin +
|
|
26894
|
+
url2 = new URL(util.parseOrigin(url2).origin + path10);
|
|
26895
26895
|
} else {
|
|
26896
26896
|
if (!opts) {
|
|
26897
26897
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -27642,8 +27642,8 @@ var CIRCULAR = "[Circular]";
|
|
|
27642
27642
|
function formatPropertyKey(name) {
|
|
27643
27643
|
return typeof name === "string" ? JSON.stringify(name) : String(name);
|
|
27644
27644
|
}
|
|
27645
|
-
function formatPath(
|
|
27646
|
-
return
|
|
27645
|
+
function formatPath(path10) {
|
|
27646
|
+
return path10.map((key) => `[${formatPropertyKey(key)}]`).join("");
|
|
27647
27647
|
}
|
|
27648
27648
|
function formatDate(date7) {
|
|
27649
27649
|
try {
|
|
@@ -36071,8 +36071,8 @@ var FileSystem = /* @__PURE__ */ Service("effect/platform/FileSystem");
|
|
|
36071
36071
|
var make14 = (impl) => FileSystem.of({
|
|
36072
36072
|
...impl,
|
|
36073
36073
|
[TypeId22]: TypeId22,
|
|
36074
|
-
exists: (
|
|
36075
|
-
readFileString: (
|
|
36074
|
+
exists: (path10) => pipe(impl.access(path10), as3(true), catchTag3("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed6(false) : fail6(e))),
|
|
36075
|
+
readFileString: (path10, encoding) => flatMap5(impl.readFile(path10), (_) => try_3({
|
|
36076
36076
|
try: () => new TextDecoder(encoding).decode(_),
|
|
36077
36077
|
catch: (cause) => badArgument({
|
|
36078
36078
|
module: "FileSystem",
|
|
@@ -36081,8 +36081,8 @@ var make14 = (impl) => FileSystem.of({
|
|
|
36081
36081
|
cause
|
|
36082
36082
|
})
|
|
36083
36083
|
})),
|
|
36084
|
-
stream: fnUntraced2(function* (
|
|
36085
|
-
const file5 = yield* impl.open(
|
|
36084
|
+
stream: fnUntraced2(function* (path10, options4) {
|
|
36085
|
+
const file5 = yield* impl.open(path10, {
|
|
36086
36086
|
flag: "r"
|
|
36087
36087
|
});
|
|
36088
36088
|
if (options4?.offset) {
|
|
@@ -36105,11 +36105,11 @@ var make14 = (impl) => FileSystem.of({
|
|
|
36105
36105
|
}
|
|
36106
36106
|
}))));
|
|
36107
36107
|
}, unwrap4),
|
|
36108
|
-
sink: (
|
|
36108
|
+
sink: (path10, options4) => pipe(impl.open(path10, {
|
|
36109
36109
|
flag: "w",
|
|
36110
36110
|
...options4
|
|
36111
36111
|
}), map7((file5) => forEach3((_) => file5.writeAll(_))), unwrap3),
|
|
36112
|
-
writeFileString: (
|
|
36112
|
+
writeFileString: (path10, data, options4) => flatMap5(try_3({
|
|
36113
36113
|
try: () => new TextEncoder().encode(data),
|
|
36114
36114
|
catch: (cause) => badArgument({
|
|
36115
36115
|
module: "FileSystem",
|
|
@@ -36117,7 +36117,7 @@ var make14 = (impl) => FileSystem.of({
|
|
|
36117
36117
|
description: "could not encode string",
|
|
36118
36118
|
cause
|
|
36119
36119
|
})
|
|
36120
|
-
}), (_) => impl.writeFile(
|
|
36120
|
+
}), (_) => impl.writeFile(path10, _, options4))
|
|
36121
36121
|
});
|
|
36122
36122
|
var FileTypeId = "~effect/platform/FileSystem/File";
|
|
36123
36123
|
var WatchBackend = class extends (/* @__PURE__ */ Service()("effect/platform/FileSystem/WatchBackend")) {
|
|
@@ -36126,15 +36126,15 @@ var WatchBackend = class extends (/* @__PURE__ */ Service()("effect/platform/Fil
|
|
|
36126
36126
|
// ../../node_modules/effect/dist/Path.js
|
|
36127
36127
|
var TypeId23 = "~effect/platform/Path";
|
|
36128
36128
|
var Path = /* @__PURE__ */ Service("effect/Path");
|
|
36129
|
-
function normalizeStringPosix(
|
|
36129
|
+
function normalizeStringPosix(path10, allowAboveRoot) {
|
|
36130
36130
|
let res = "";
|
|
36131
36131
|
let lastSegmentLength = 0;
|
|
36132
36132
|
let lastSlash = -1;
|
|
36133
36133
|
let dots = 0;
|
|
36134
36134
|
let code;
|
|
36135
|
-
for (let i = 0; i <=
|
|
36136
|
-
if (i <
|
|
36137
|
-
code =
|
|
36135
|
+
for (let i = 0; i <= path10.length; ++i) {
|
|
36136
|
+
if (i < path10.length) {
|
|
36137
|
+
code = path10.charCodeAt(i);
|
|
36138
36138
|
} else if (code === 47) {
|
|
36139
36139
|
break;
|
|
36140
36140
|
} else {
|
|
@@ -36176,9 +36176,9 @@ function normalizeStringPosix(path9, allowAboveRoot) {
|
|
|
36176
36176
|
}
|
|
36177
36177
|
} else {
|
|
36178
36178
|
if (res.length > 0) {
|
|
36179
|
-
res += "/" +
|
|
36179
|
+
res += "/" + path10.slice(lastSlash + 1, i);
|
|
36180
36180
|
} else {
|
|
36181
|
-
res =
|
|
36181
|
+
res = path10.slice(lastSlash + 1, i);
|
|
36182
36182
|
}
|
|
36183
36183
|
lastSegmentLength = i - lastSlash - 1;
|
|
36184
36184
|
}
|
|
@@ -36237,21 +36237,21 @@ var resolve = function resolve2() {
|
|
|
36237
36237
|
let resolvedAbsolute = false;
|
|
36238
36238
|
let cwd = void 0;
|
|
36239
36239
|
for (let i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
36240
|
-
let
|
|
36240
|
+
let path10;
|
|
36241
36241
|
if (i >= 0) {
|
|
36242
|
-
|
|
36242
|
+
path10 = arguments[i];
|
|
36243
36243
|
} else {
|
|
36244
36244
|
const process2 = globalThis.process;
|
|
36245
36245
|
if (cwd === void 0 && "process" in globalThis && typeof process2 === "object" && process2 !== null && typeof process2.cwd === "function") {
|
|
36246
36246
|
cwd = process2.cwd();
|
|
36247
36247
|
}
|
|
36248
|
-
|
|
36248
|
+
path10 = cwd;
|
|
36249
36249
|
}
|
|
36250
|
-
if (
|
|
36250
|
+
if (path10.length === 0) {
|
|
36251
36251
|
continue;
|
|
36252
36252
|
}
|
|
36253
|
-
resolvedPath =
|
|
36254
|
-
resolvedAbsolute =
|
|
36253
|
+
resolvedPath = path10 + "/" + resolvedPath;
|
|
36254
|
+
resolvedAbsolute = path10.charCodeAt(0) === 47;
|
|
36255
36255
|
}
|
|
36256
36256
|
resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
|
|
36257
36257
|
if (resolvedAbsolute) {
|
|
@@ -36303,18 +36303,18 @@ function encodePathChars(filepath) {
|
|
|
36303
36303
|
var posixImpl = /* @__PURE__ */ Path.of({
|
|
36304
36304
|
[TypeId23]: TypeId23,
|
|
36305
36305
|
resolve,
|
|
36306
|
-
normalize(
|
|
36307
|
-
if (
|
|
36308
|
-
const isAbsolute =
|
|
36309
|
-
const trailingSeparator =
|
|
36310
|
-
|
|
36311
|
-
if (
|
|
36312
|
-
if (
|
|
36313
|
-
if (isAbsolute) return "/" +
|
|
36314
|
-
return
|
|
36306
|
+
normalize(path10) {
|
|
36307
|
+
if (path10.length === 0) return ".";
|
|
36308
|
+
const isAbsolute = path10.charCodeAt(0) === 47;
|
|
36309
|
+
const trailingSeparator = path10.charCodeAt(path10.length - 1) === 47;
|
|
36310
|
+
path10 = normalizeStringPosix(path10, !isAbsolute);
|
|
36311
|
+
if (path10.length === 0 && !isAbsolute) path10 = ".";
|
|
36312
|
+
if (path10.length > 0 && trailingSeparator) path10 += "/";
|
|
36313
|
+
if (isAbsolute) return "/" + path10;
|
|
36314
|
+
return path10;
|
|
36315
36315
|
},
|
|
36316
|
-
isAbsolute(
|
|
36317
|
-
return
|
|
36316
|
+
isAbsolute(path10) {
|
|
36317
|
+
return path10.length > 0 && path10.charCodeAt(0) === 47;
|
|
36318
36318
|
},
|
|
36319
36319
|
join() {
|
|
36320
36320
|
if (arguments.length === 0) {
|
|
@@ -36405,14 +36405,14 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
36405
36405
|
return to.slice(toStart);
|
|
36406
36406
|
}
|
|
36407
36407
|
},
|
|
36408
|
-
dirname(
|
|
36409
|
-
if (
|
|
36410
|
-
let code =
|
|
36408
|
+
dirname(path10) {
|
|
36409
|
+
if (path10.length === 0) return ".";
|
|
36410
|
+
let code = path10.charCodeAt(0);
|
|
36411
36411
|
const hasRoot = code === 47;
|
|
36412
36412
|
let end = -1;
|
|
36413
36413
|
let matchedSlash = true;
|
|
36414
|
-
for (let i =
|
|
36415
|
-
code =
|
|
36414
|
+
for (let i = path10.length - 1; i >= 1; --i) {
|
|
36415
|
+
code = path10.charCodeAt(i);
|
|
36416
36416
|
if (code === 47) {
|
|
36417
36417
|
if (!matchedSlash) {
|
|
36418
36418
|
end = i;
|
|
@@ -36424,19 +36424,19 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
36424
36424
|
}
|
|
36425
36425
|
if (end === -1) return hasRoot ? "/" : ".";
|
|
36426
36426
|
if (hasRoot && end === 1) return "//";
|
|
36427
|
-
return
|
|
36427
|
+
return path10.slice(0, end);
|
|
36428
36428
|
},
|
|
36429
|
-
basename(
|
|
36429
|
+
basename(path10, ext) {
|
|
36430
36430
|
let start = 0;
|
|
36431
36431
|
let end = -1;
|
|
36432
36432
|
let matchedSlash = true;
|
|
36433
36433
|
let i;
|
|
36434
|
-
if (ext !== void 0 && ext.length > 0 && ext.length <=
|
|
36435
|
-
if (ext.length ===
|
|
36434
|
+
if (ext !== void 0 && ext.length > 0 && ext.length <= path10.length) {
|
|
36435
|
+
if (ext.length === path10.length && ext === path10) return "";
|
|
36436
36436
|
let extIdx = ext.length - 1;
|
|
36437
36437
|
let firstNonSlashEnd = -1;
|
|
36438
|
-
for (i =
|
|
36439
|
-
const code =
|
|
36438
|
+
for (i = path10.length - 1; i >= 0; --i) {
|
|
36439
|
+
const code = path10.charCodeAt(i);
|
|
36440
36440
|
if (code === 47) {
|
|
36441
36441
|
if (!matchedSlash) {
|
|
36442
36442
|
start = i + 1;
|
|
@@ -36460,11 +36460,11 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
36460
36460
|
}
|
|
36461
36461
|
}
|
|
36462
36462
|
if (start === end) end = firstNonSlashEnd;
|
|
36463
|
-
else if (end === -1) end =
|
|
36464
|
-
return
|
|
36463
|
+
else if (end === -1) end = path10.length;
|
|
36464
|
+
return path10.slice(start, end);
|
|
36465
36465
|
} else {
|
|
36466
|
-
for (i =
|
|
36467
|
-
if (
|
|
36466
|
+
for (i = path10.length - 1; i >= 0; --i) {
|
|
36467
|
+
if (path10.charCodeAt(i) === 47) {
|
|
36468
36468
|
if (!matchedSlash) {
|
|
36469
36469
|
start = i + 1;
|
|
36470
36470
|
break;
|
|
@@ -36475,17 +36475,17 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
36475
36475
|
}
|
|
36476
36476
|
}
|
|
36477
36477
|
if (end === -1) return "";
|
|
36478
|
-
return
|
|
36478
|
+
return path10.slice(start, end);
|
|
36479
36479
|
}
|
|
36480
36480
|
},
|
|
36481
|
-
extname(
|
|
36481
|
+
extname(path10) {
|
|
36482
36482
|
let startDot = -1;
|
|
36483
36483
|
let startPart = 0;
|
|
36484
36484
|
let end = -1;
|
|
36485
36485
|
let matchedSlash = true;
|
|
36486
36486
|
let preDotState = 0;
|
|
36487
|
-
for (let i =
|
|
36488
|
-
const code =
|
|
36487
|
+
for (let i = path10.length - 1; i >= 0; --i) {
|
|
36488
|
+
const code = path10.charCodeAt(i);
|
|
36489
36489
|
if (code === 47) {
|
|
36490
36490
|
if (!matchedSlash) {
|
|
36491
36491
|
startPart = i + 1;
|
|
@@ -36512,7 +36512,7 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
36512
36512
|
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
36513
36513
|
return "";
|
|
36514
36514
|
}
|
|
36515
|
-
return
|
|
36515
|
+
return path10.slice(startDot, end);
|
|
36516
36516
|
},
|
|
36517
36517
|
format: function format3(pathObject) {
|
|
36518
36518
|
if (pathObject === null || typeof pathObject !== "object") {
|
|
@@ -36520,7 +36520,7 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
36520
36520
|
}
|
|
36521
36521
|
return _format("/", pathObject);
|
|
36522
36522
|
},
|
|
36523
|
-
parse(
|
|
36523
|
+
parse(path10) {
|
|
36524
36524
|
const ret = {
|
|
36525
36525
|
root: "",
|
|
36526
36526
|
dir: "",
|
|
@@ -36528,8 +36528,8 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
36528
36528
|
ext: "",
|
|
36529
36529
|
name: ""
|
|
36530
36530
|
};
|
|
36531
|
-
if (
|
|
36532
|
-
let code =
|
|
36531
|
+
if (path10.length === 0) return ret;
|
|
36532
|
+
let code = path10.charCodeAt(0);
|
|
36533
36533
|
const isAbsolute = code === 47;
|
|
36534
36534
|
let start;
|
|
36535
36535
|
if (isAbsolute) {
|
|
@@ -36542,10 +36542,10 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
36542
36542
|
let startPart = 0;
|
|
36543
36543
|
let end = -1;
|
|
36544
36544
|
let matchedSlash = true;
|
|
36545
|
-
let i =
|
|
36545
|
+
let i = path10.length - 1;
|
|
36546
36546
|
let preDotState = 0;
|
|
36547
36547
|
for (; i >= start; --i) {
|
|
36548
|
-
code =
|
|
36548
|
+
code = path10.charCodeAt(i);
|
|
36549
36549
|
if (code === 47) {
|
|
36550
36550
|
if (!matchedSlash) {
|
|
36551
36551
|
startPart = i + 1;
|
|
@@ -36568,20 +36568,20 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
36568
36568
|
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
36569
36569
|
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
36570
36570
|
if (end !== -1) {
|
|
36571
|
-
if (startPart === 0 && isAbsolute) ret.base = ret.name =
|
|
36572
|
-
else ret.base = ret.name =
|
|
36571
|
+
if (startPart === 0 && isAbsolute) ret.base = ret.name = path10.slice(1, end);
|
|
36572
|
+
else ret.base = ret.name = path10.slice(startPart, end);
|
|
36573
36573
|
}
|
|
36574
36574
|
} else {
|
|
36575
36575
|
if (startPart === 0 && isAbsolute) {
|
|
36576
|
-
ret.name =
|
|
36577
|
-
ret.base =
|
|
36576
|
+
ret.name = path10.slice(1, startDot);
|
|
36577
|
+
ret.base = path10.slice(1, end);
|
|
36578
36578
|
} else {
|
|
36579
|
-
ret.name =
|
|
36580
|
-
ret.base =
|
|
36579
|
+
ret.name = path10.slice(startPart, startDot);
|
|
36580
|
+
ret.base = path10.slice(startPart, end);
|
|
36581
36581
|
}
|
|
36582
|
-
ret.ext =
|
|
36582
|
+
ret.ext = path10.slice(startDot, end);
|
|
36583
36583
|
}
|
|
36584
|
-
if (startPart > 0) ret.dir =
|
|
36584
|
+
if (startPart > 0) ret.dir = path10.slice(0, startPart - 1);
|
|
36585
36585
|
else if (isAbsolute) ret.dir = "/";
|
|
36586
36586
|
return ret;
|
|
36587
36587
|
},
|
|
@@ -36681,9 +36681,9 @@ var Pointer = class extends Base {
|
|
|
36681
36681
|
* The issue that occurred.
|
|
36682
36682
|
*/
|
|
36683
36683
|
issue;
|
|
36684
|
-
constructor(
|
|
36684
|
+
constructor(path10, issue) {
|
|
36685
36685
|
super();
|
|
36686
|
-
this.path =
|
|
36686
|
+
this.path = path10;
|
|
36687
36687
|
this.issue = issue;
|
|
36688
36688
|
}
|
|
36689
36689
|
};
|
|
@@ -36868,43 +36868,43 @@ function getExpectedMessage(expected, issue) {
|
|
|
36868
36868
|
const input = formatInput(issue);
|
|
36869
36869
|
return input === void 0 ? `Expected ${expected}` : `Expected ${expected}, got ${input}`;
|
|
36870
36870
|
}
|
|
36871
|
-
function toDefaultIssues(issue,
|
|
36871
|
+
function toDefaultIssues(issue, path10, leafHook, checkHook) {
|
|
36872
36872
|
switch (issue._tag) {
|
|
36873
36873
|
case "Filter": {
|
|
36874
36874
|
const message = checkHook(issue);
|
|
36875
36875
|
if (message !== void 0) {
|
|
36876
36876
|
return [{
|
|
36877
|
-
path:
|
|
36877
|
+
path: path10,
|
|
36878
36878
|
message
|
|
36879
36879
|
}];
|
|
36880
36880
|
}
|
|
36881
36881
|
if (issue.issue._tag !== "InvalidValue") {
|
|
36882
|
-
return toDefaultIssues(issue.issue,
|
|
36882
|
+
return toDefaultIssues(issue.issue, path10, leafHook, checkHook);
|
|
36883
36883
|
}
|
|
36884
36884
|
const expected = findExpected(issue.issue);
|
|
36885
36885
|
return [{
|
|
36886
|
-
path:
|
|
36886
|
+
path: path10,
|
|
36887
36887
|
message: expected === void 0 ? getExpectedMessage(formatCheck(issue.filter), issue) : getExpectedMessage(expected, issue.issue)
|
|
36888
36888
|
}];
|
|
36889
36889
|
}
|
|
36890
36890
|
case "Encoding":
|
|
36891
|
-
return toDefaultIssues(issue.issue,
|
|
36891
|
+
return toDefaultIssues(issue.issue, path10, leafHook, checkHook);
|
|
36892
36892
|
case "Pointer":
|
|
36893
|
-
return toDefaultIssues(issue.issue, [...
|
|
36893
|
+
return toDefaultIssues(issue.issue, [...path10, ...issue.path], leafHook, checkHook);
|
|
36894
36894
|
case "Composite":
|
|
36895
|
-
return issue.issues.flatMap((issue2) => toDefaultIssues(issue2,
|
|
36895
|
+
return issue.issues.flatMap((issue2) => toDefaultIssues(issue2, path10, leafHook, checkHook));
|
|
36896
36896
|
case "AnyOf": {
|
|
36897
36897
|
if (issue.issues.length === 0) {
|
|
36898
36898
|
return [{
|
|
36899
|
-
path:
|
|
36899
|
+
path: path10,
|
|
36900
36900
|
message: findMessage(issue) ?? getExpectedMessage(getExpected(issue.ast), issue)
|
|
36901
36901
|
}];
|
|
36902
36902
|
}
|
|
36903
|
-
return issue.issues.flatMap((issue2) => toDefaultIssues(issue2,
|
|
36903
|
+
return issue.issues.flatMap((issue2) => toDefaultIssues(issue2, path10, leafHook, checkHook));
|
|
36904
36904
|
}
|
|
36905
36905
|
default:
|
|
36906
36906
|
return [{
|
|
36907
|
-
path:
|
|
36907
|
+
path: path10,
|
|
36908
36908
|
message: leafHook(issue)
|
|
36909
36909
|
}];
|
|
36910
36910
|
}
|
|
@@ -36923,7 +36923,7 @@ function makeFormatterDefault() {
|
|
|
36923
36923
|
return (issue) => formatIssue(issue, "");
|
|
36924
36924
|
}
|
|
36925
36925
|
var defaultFormatter = /* @__PURE__ */ makeFormatterDefault();
|
|
36926
|
-
function formatIssue(issue,
|
|
36926
|
+
function formatIssue(issue, path10) {
|
|
36927
36927
|
let message;
|
|
36928
36928
|
switch (issue._tag) {
|
|
36929
36929
|
case "Filter": {
|
|
@@ -36932,7 +36932,7 @@ function formatIssue(issue, path9) {
|
|
|
36932
36932
|
message = annotated;
|
|
36933
36933
|
} else {
|
|
36934
36934
|
if (issue.issue._tag !== "InvalidValue") {
|
|
36935
|
-
return formatIssue(issue.issue,
|
|
36935
|
+
return formatIssue(issue.issue, path10);
|
|
36936
36936
|
}
|
|
36937
36937
|
const expected = findExpected(issue.issue);
|
|
36938
36938
|
message = expected === void 0 ? getExpectedMessage(formatCheck(issue.filter), issue) : getExpectedMessage(expected, issue.issue);
|
|
@@ -36940,13 +36940,13 @@ function formatIssue(issue, path9) {
|
|
|
36940
36940
|
break;
|
|
36941
36941
|
}
|
|
36942
36942
|
case "Encoding":
|
|
36943
|
-
return formatIssue(issue.issue,
|
|
36943
|
+
return formatIssue(issue.issue, path10);
|
|
36944
36944
|
case "Pointer":
|
|
36945
|
-
return formatIssue(issue.issue,
|
|
36945
|
+
return formatIssue(issue.issue, path10 + formatPath(issue.path));
|
|
36946
36946
|
case "Composite":
|
|
36947
36947
|
case "AnyOf": {
|
|
36948
36948
|
if (issue._tag === "Composite" || issue.issues.length > 0) {
|
|
36949
|
-
return issue.issues.map((issue2) => formatIssue(issue2,
|
|
36949
|
+
return issue.issues.map((issue2) => formatIssue(issue2, path10)).join("\n");
|
|
36950
36950
|
}
|
|
36951
36951
|
message = findMessage(issue) ?? getExpectedMessage(getExpected(issue.ast), issue);
|
|
36952
36952
|
break;
|
|
@@ -36955,8 +36955,8 @@ function formatIssue(issue, path9) {
|
|
|
36955
36955
|
message = defaultLeafHook(issue);
|
|
36956
36956
|
break;
|
|
36957
36957
|
}
|
|
36958
|
-
return
|
|
36959
|
-
at ${
|
|
36958
|
+
return path10 ? `${message}
|
|
36959
|
+
at ${path10}` : message;
|
|
36960
36960
|
}
|
|
36961
36961
|
function findMessage(issue) {
|
|
36962
36962
|
if (issue._tag === "Pointer") return;
|
|
@@ -40132,7 +40132,7 @@ var buildSpawnOptions = (options4, base2, platform) => {
|
|
|
40132
40132
|
};
|
|
40133
40133
|
|
|
40134
40134
|
// ../../node_modules/@effect/platform-node-shared/dist/internal/utils.js
|
|
40135
|
-
var handleErrnoException = (module, method) => (err, [
|
|
40135
|
+
var handleErrnoException = (module, method) => (err, [path10]) => {
|
|
40136
40136
|
let reason = "Unknown";
|
|
40137
40137
|
switch (err.code) {
|
|
40138
40138
|
case "ENOENT":
|
|
@@ -40161,7 +40161,7 @@ var handleErrnoException = (module, method) => (err, [path9]) => {
|
|
|
40161
40161
|
_tag: reason,
|
|
40162
40162
|
module,
|
|
40163
40163
|
method,
|
|
40164
|
-
pathOrDescriptor:
|
|
40164
|
+
pathOrDescriptor: path10,
|
|
40165
40165
|
syscall: err.syscall,
|
|
40166
40166
|
cause: err
|
|
40167
40167
|
});
|
|
@@ -40396,11 +40396,11 @@ var taskkill = (childProcess, onExit4 = () => {
|
|
|
40396
40396
|
}, onExit4);
|
|
40397
40397
|
var make21 = /* @__PURE__ */ gen3(function* () {
|
|
40398
40398
|
const fs = yield* FileSystem;
|
|
40399
|
-
const
|
|
40399
|
+
const path10 = yield* Path;
|
|
40400
40400
|
const resolveWorkingDirectory = fnUntraced2(function* (options4) {
|
|
40401
40401
|
if (isUndefined(options4.cwd)) return void 0;
|
|
40402
40402
|
yield* fs.access(options4.cwd);
|
|
40403
|
-
return
|
|
40403
|
+
return path10.resolve(options4.cwd);
|
|
40404
40404
|
});
|
|
40405
40405
|
const resolveEnvironment = (options4) => {
|
|
40406
40406
|
return options4.extendEnv ? {
|
|
@@ -42538,10 +42538,10 @@ function makeReducer2(combiner2) {
|
|
|
42538
42538
|
}
|
|
42539
42539
|
|
|
42540
42540
|
// ../../node_modules/effect/dist/internal/errors.js
|
|
42541
|
-
function errorWithPath(message,
|
|
42542
|
-
if (
|
|
42541
|
+
function errorWithPath(message, path10) {
|
|
42542
|
+
if (path10.length > 0) {
|
|
42543
42543
|
message += `
|
|
42544
|
-
at ${formatPath(
|
|
42544
|
+
at ${formatPath(path10)}`;
|
|
42545
42545
|
}
|
|
42546
42546
|
return new Error(message);
|
|
42547
42547
|
}
|
|
@@ -42882,26 +42882,26 @@ function filterLayer(ast, checks, normalBase, terminalBase) {
|
|
|
42882
42882
|
});
|
|
42883
42883
|
}
|
|
42884
42884
|
var memoized = /* @__PURE__ */ memoize((ast) => recur(ast, []));
|
|
42885
|
-
function recur(ast,
|
|
42885
|
+
function recur(ast, path10) {
|
|
42886
42886
|
const annotation = resolve3(ast)?.toArbitrary;
|
|
42887
42887
|
if (annotation) {
|
|
42888
|
-
const typeParameters = isDeclaration(ast) ? ast.typeParameters.map((tp) => recur(tp,
|
|
42888
|
+
const typeParameters = isDeclaration(ast) ? ast.typeParameters.map((tp) => recur(tp, path10)) : [];
|
|
42889
42889
|
const checks = collectChecks(ast.checks);
|
|
42890
42890
|
const derive = (lazyNormal) => (fc, ctx, nextCtx, recursionStack) => normalizeDerivation(annotation(makeTypeParameters(typeParameters, fc, resetContext(ctx), recursionStack, lazyNormal))(fc, nextCtx), typeParameters.length > 0)[lazyNormal ? "terminal" : "arbitrary"];
|
|
42891
42891
|
return filterLayer(ast, checks, derive(false), derive(true));
|
|
42892
42892
|
}
|
|
42893
42893
|
if (ast.checks) {
|
|
42894
42894
|
const checks = collectChecks(ast.checks);
|
|
42895
|
-
const lawc = recur(replaceChecks(ast, void 0),
|
|
42895
|
+
const lawc = recur(replaceChecks(ast, void 0), path10);
|
|
42896
42896
|
return filterLayer(ast, checks, (fc, _ctx, nextCtx, recursionStack) => lawc(fc, nextCtx, recursionStack), (fc, _ctx, nextCtx, recursionStack) => lawc.terminal(fc, nextCtx, recursionStack));
|
|
42897
42897
|
}
|
|
42898
|
-
return base(ast,
|
|
42898
|
+
return base(ast, path10);
|
|
42899
42899
|
}
|
|
42900
|
-
function base(ast,
|
|
42900
|
+
function base(ast, path10) {
|
|
42901
42901
|
switch (ast._tag) {
|
|
42902
42902
|
case "Never":
|
|
42903
42903
|
case "Declaration":
|
|
42904
|
-
throw errorWithPath(`Unsupported AST ${ast._tag}`,
|
|
42904
|
+
throw errorWithPath(`Unsupported AST ${ast._tag}`, path10);
|
|
42905
42905
|
case "Null":
|
|
42906
42906
|
return same((fc) => fc.constant(null));
|
|
42907
42907
|
case "Void":
|
|
@@ -42938,20 +42938,20 @@ function base(ast, path9) {
|
|
|
42938
42938
|
case "ObjectKeyword":
|
|
42939
42939
|
return same((fc) => fc.oneof(fc.object(), fc.array(fc.anything())));
|
|
42940
42940
|
case "Enum":
|
|
42941
|
-
return recur(enumsToLiterals(ast),
|
|
42941
|
+
return recur(enumsToLiterals(ast), path10);
|
|
42942
42942
|
case "TemplateLiteral": {
|
|
42943
|
-
const parts2 = ast.parts.map((part, i) => recur(toEncoded(part), [...
|
|
42943
|
+
const parts2 = ast.parts.map((part, i) => recur(toEncoded(part), [...path10, i]));
|
|
42944
42944
|
return same((fc, ctx, recursionStack) => fc.tuple(...parts2.map((part) => part(fc, finiteNumberContext(ctx), recursionStack))).map((segments) => segments.map((segment) => globalThis.String(segment)).join("")));
|
|
42945
42945
|
}
|
|
42946
42946
|
case "Arrays": {
|
|
42947
42947
|
const elements = ast.elements.map((ast2, i) => ({
|
|
42948
42948
|
ast: ast2,
|
|
42949
|
-
arbitrary: recur(ast2, [...
|
|
42949
|
+
arbitrary: recur(ast2, [...path10, i])
|
|
42950
42950
|
}));
|
|
42951
42951
|
const len = ast.elements.length;
|
|
42952
42952
|
const rest = ast.rest.map((ast2, i) => ({
|
|
42953
42953
|
ast: ast2,
|
|
42954
|
-
arbitrary: recur(ast2, [...
|
|
42954
|
+
arbitrary: recur(ast2, [...path10, len + i])
|
|
42955
42955
|
}));
|
|
42956
42956
|
const terminal = (fc, ctx, recursionStack) => {
|
|
42957
42957
|
const reset2 = resetContext(ctx);
|
|
@@ -43051,12 +43051,12 @@ function base(ast, path9) {
|
|
|
43051
43051
|
case "Objects": {
|
|
43052
43052
|
const propertySignatures = ast.propertySignatures.map((ps) => ({
|
|
43053
43053
|
ps,
|
|
43054
|
-
arbitrary: recur(ps.type, [...
|
|
43054
|
+
arbitrary: recur(ps.type, [...path10, ps.name])
|
|
43055
43055
|
}));
|
|
43056
43056
|
const indexSignatures = ast.indexSignatures.map((is3) => ({
|
|
43057
43057
|
is: is3,
|
|
43058
|
-
parameter: recur(is3.parameter,
|
|
43059
|
-
type: recur(is3.type,
|
|
43058
|
+
parameter: recur(is3.parameter, path10),
|
|
43059
|
+
type: recur(is3.type, path10)
|
|
43060
43060
|
}));
|
|
43061
43061
|
const terminal = (fc, ctx, recursionStack) => {
|
|
43062
43062
|
const reset2 = resetContext(ctx);
|
|
@@ -43159,7 +43159,7 @@ function base(ast, path9) {
|
|
|
43159
43159
|
}, terminal);
|
|
43160
43160
|
}
|
|
43161
43161
|
case "Union": {
|
|
43162
|
-
const types = ast.types.map((ast2) => recur(ast2,
|
|
43162
|
+
const types = ast.types.map((ast2) => recur(ast2, path10));
|
|
43163
43163
|
const terminal = (fc, ctx, recursionStack) => oneOf(fc, types.map((type) => type.terminal(fc, ctx, recursionStack)).filter(isNotUndefined));
|
|
43164
43164
|
return makeLazy((fc, ctx, recursionStack) => {
|
|
43165
43165
|
const arbitraries = types.map((type) => type(fc, ctx, recursionStack));
|
|
@@ -43179,7 +43179,7 @@ function base(ast, path9) {
|
|
|
43179
43179
|
case "Suspend": {
|
|
43180
43180
|
const memo = arbitraryMemoMap.get(ast);
|
|
43181
43181
|
if (memo) return memo;
|
|
43182
|
-
const get11 = memoizeThunk(() => recur(ast.thunk(),
|
|
43182
|
+
const get11 = memoizeThunk(() => recur(ast.thunk(), path10));
|
|
43183
43183
|
const out = makeLazy((fc, ctx, recursionStack) => {
|
|
43184
43184
|
const recursion = getSuspendRecursion(fc, ast);
|
|
43185
43185
|
const nextCtx = {
|
|
@@ -43189,7 +43189,7 @@ function base(ast, path9) {
|
|
|
43189
43189
|
const nextStack = recursionStack.includes(ast) ? recursionStack : [...recursionStack, ast];
|
|
43190
43190
|
const terminal = get11().terminal(fc, nextCtx, nextStack);
|
|
43191
43191
|
if (terminal === void 0) {
|
|
43192
|
-
throw errorWithPath("Unable to derive an arbitrary for a recursive schema without a finite generation path",
|
|
43192
|
+
throw errorWithPath("Unable to derive an arbitrary for a recursive schema without a finite generation path", path10);
|
|
43193
43193
|
}
|
|
43194
43194
|
return fc.oneof(recursion, terminal, fc.constant(null).chain(() => get11()(fc, nextCtx, nextStack)));
|
|
43195
43195
|
}, (fc, ctx, recursionStack) => {
|
|
@@ -43212,10 +43212,10 @@ function base(ast, path9) {
|
|
|
43212
43212
|
var toEquivalence = /* @__PURE__ */ memoize((ast) => {
|
|
43213
43213
|
return recur2(ast, []);
|
|
43214
43214
|
});
|
|
43215
|
-
function recur2(ast,
|
|
43215
|
+
function recur2(ast, path10) {
|
|
43216
43216
|
const annotation = resolve3(ast)?.["toEquivalence"];
|
|
43217
43217
|
if (annotation) {
|
|
43218
|
-
return annotation(isDeclaration(ast) ? ast.typeParameters.map((tp) => recur2(tp,
|
|
43218
|
+
return annotation(isDeclaration(ast) ? ast.typeParameters.map((tp) => recur2(tp, path10)) : []);
|
|
43219
43219
|
}
|
|
43220
43220
|
switch (ast._tag) {
|
|
43221
43221
|
case "Never":
|
|
@@ -43238,9 +43238,9 @@ function recur2(ast, path9) {
|
|
|
43238
43238
|
case "TemplateLiteral":
|
|
43239
43239
|
return equals;
|
|
43240
43240
|
case "Arrays": {
|
|
43241
|
-
const elements = ast.elements.map((e, i) => recur2(e, [...
|
|
43241
|
+
const elements = ast.elements.map((e, i) => recur2(e, [...path10, i]));
|
|
43242
43242
|
const len = ast.elements.length;
|
|
43243
|
-
const rest = ast.rest.map((r, i) => recur2(r, [...
|
|
43243
|
+
const rest = ast.rest.map((r, i) => recur2(r, [...path10, len + i]));
|
|
43244
43244
|
return make2((a, b) => {
|
|
43245
43245
|
if (!Array.isArray(a) || !Array.isArray(b)) {
|
|
43246
43246
|
return false;
|
|
@@ -43275,8 +43275,8 @@ function recur2(ast, path9) {
|
|
|
43275
43275
|
if (ast.propertySignatures.length === 0 && ast.indexSignatures.length === 0) {
|
|
43276
43276
|
return equals;
|
|
43277
43277
|
}
|
|
43278
|
-
const propertySignatures = ast.propertySignatures.map((ps) => recur2(ps.type, [...
|
|
43279
|
-
const indexSignatures = ast.indexSignatures.map((is3) => recur2(is3.type,
|
|
43278
|
+
const propertySignatures = ast.propertySignatures.map((ps) => recur2(ps.type, [...path10, ps.name]));
|
|
43279
|
+
const indexSignatures = ast.indexSignatures.map((is3) => recur2(is3.type, path10));
|
|
43280
43280
|
return make2((a, b) => {
|
|
43281
43281
|
if (!isObject(a) || !isObject(b)) {
|
|
43282
43282
|
return false;
|
|
@@ -43312,7 +43312,7 @@ function recur2(ast, path9) {
|
|
|
43312
43312
|
}
|
|
43313
43313
|
case "Union": {
|
|
43314
43314
|
const types = toType(ast).types;
|
|
43315
|
-
const compiled = new Map(types.map((candidate, i) => [candidate, [_is(candidate), recur2(ast.types[i],
|
|
43315
|
+
const compiled = new Map(types.map((candidate, i) => [candidate, [_is(candidate), recur2(ast.types[i], path10)]]));
|
|
43316
43316
|
return make2((a, b) => {
|
|
43317
43317
|
const candidates = getCandidates(a, types);
|
|
43318
43318
|
for (let i = 0; i < candidates.length; i++) {
|
|
@@ -43325,7 +43325,7 @@ function recur2(ast, path9) {
|
|
|
43325
43325
|
});
|
|
43326
43326
|
}
|
|
43327
43327
|
case "Suspend": {
|
|
43328
|
-
const get11 = memoizeThunk(() => recur2(ast.thunk(),
|
|
43328
|
+
const get11 = memoizeThunk(() => recur2(ast.thunk(), path10));
|
|
43329
43329
|
return make2((a, b) => get11()(a, b));
|
|
43330
43330
|
}
|
|
43331
43331
|
}
|
|
@@ -43378,16 +43378,16 @@ function toMultiDocumentOpenApi3_1(multiDocument) {
|
|
|
43378
43378
|
return transformSchema(schema2, (schema3, inEmbeddedResource) => {
|
|
43379
43379
|
rejectKeywordCollisions(schema3, OPEN_API_31_TARGET_COLLISIONS, "OpenAPI 3.1", "Draft 2020-12");
|
|
43380
43380
|
rewriteSchemaRef(schema3, (reference, keyword) => {
|
|
43381
|
-
const
|
|
43382
|
-
if (
|
|
43383
|
-
const key =
|
|
43381
|
+
const path10 = reference.startsWith("#") ? parsePointerFragment(reference) : void 0;
|
|
43382
|
+
if (path10 === void 0 || path10[0] !== "$defs" || path10.length < 2) return reference;
|
|
43383
|
+
const key = path10[1];
|
|
43384
43384
|
if (isRootResource) {
|
|
43385
43385
|
if (rejectSharedDefinitionRefs && !inEmbeddedResource && Object.hasOwn(multiDocument.definitions, key) && (localDefinitions === void 0 || !Object.hasOwn(localDefinitions, key))) {
|
|
43386
43386
|
unsupported(keyword, "OpenAPI 3.1", "a schema resource cannot reference the shared definitions pool");
|
|
43387
43387
|
}
|
|
43388
43388
|
return reference;
|
|
43389
43389
|
}
|
|
43390
|
-
return inEmbeddedResource ? reference : formatPointerFragment(["components", "schemas", keyMap2.get(key) ?? key, ...
|
|
43390
|
+
return inEmbeddedResource ? reference : formatPointerFragment(["components", "schemas", keyMap2.get(key) ?? key, ...path10.slice(2)]);
|
|
43391
43391
|
});
|
|
43392
43392
|
});
|
|
43393
43393
|
}
|
|
@@ -43583,8 +43583,8 @@ function relocateReference(reference, targetPath) {
|
|
|
43583
43583
|
const uri = index2 === -1 ? reference : reference.slice(0, index2);
|
|
43584
43584
|
return `${uri}${formatPointerFragment(targetPath)}`;
|
|
43585
43585
|
}
|
|
43586
|
-
function formatPointerFragment(
|
|
43587
|
-
return
|
|
43586
|
+
function formatPointerFragment(path10) {
|
|
43587
|
+
return path10.length === 0 ? "#" : `#/${path10.map((token) => encodeURI(escapeToken(token)).replace(/#/g, "%23")).join("/")}`;
|
|
43588
43588
|
}
|
|
43589
43589
|
function locationKey(resource, pointer) {
|
|
43590
43590
|
return `${resource}\0${JSON.stringify(pointer)}`;
|
|
@@ -43925,11 +43925,11 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
43925
43925
|
schemas,
|
|
43926
43926
|
definitions
|
|
43927
43927
|
};
|
|
43928
|
-
function compileDefinition(key,
|
|
43928
|
+
function compileDefinition(key, path10) {
|
|
43929
43929
|
const compiled = definitionStates.get(key);
|
|
43930
43930
|
if (compiled !== void 0) return typeof compiled === "string" ? compiled : key;
|
|
43931
43931
|
if (!Object.hasOwn(references, key)) {
|
|
43932
|
-
throw errorWithPath(`Invalid reference ${key}`, [...
|
|
43932
|
+
throw errorWithPath(`Invalid reference ${key}`, [...path10, "$ref"]);
|
|
43933
43933
|
}
|
|
43934
43934
|
definitionStates.set(key, null);
|
|
43935
43935
|
const representation = references[key];
|
|
@@ -43962,14 +43962,14 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
43962
43962
|
const annotations2 = representation.checks.length === 0 ? representation.annotations : representation.checks[representation.checks.length - 1].annotations;
|
|
43963
43963
|
return typeof annotations2?.identifier !== "string" && typeof annotations2?.[IDENTIFIER_FALLBACK_KEY] === "string" ? annotations2[IDENTIFIER_FALLBACK_KEY] : void 0;
|
|
43964
43964
|
}
|
|
43965
|
-
function annotationSchemas(representation,
|
|
43966
|
-
return representation?.schemas?.map((schema2, index2) => recur3(schema2, [...
|
|
43965
|
+
function annotationSchemas(representation, path10) {
|
|
43966
|
+
return representation?.schemas?.map((schema2, index2) => recur3(schema2, [...path10, "schemas", index2])) ?? [];
|
|
43967
43967
|
}
|
|
43968
|
-
function compileCheck(check2, type,
|
|
43968
|
+
function compileCheck(check2, type, path10) {
|
|
43969
43969
|
const annotations2 = check2.annotations;
|
|
43970
43970
|
const callback4 = annotations2?.toJsonSchema;
|
|
43971
43971
|
if (callback4 !== void 0) {
|
|
43972
|
-
const schemas2 = annotationSchemas(check2.representation, [...
|
|
43972
|
+
const schemas2 = annotationSchemas(check2.representation, [...path10, "representation"]);
|
|
43973
43973
|
const fragment = callback4({
|
|
43974
43974
|
type,
|
|
43975
43975
|
schemas: schemas2
|
|
@@ -43983,7 +43983,7 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
43983
43983
|
return check2._tag === "Filter" && hasOnlyKeywords(schema2, allowed) && (ordinary2 === void 0 || hasOnlyKeywords(ordinary2, promotableAnnotationKeywords)) ? [schema2, true] : [schema2];
|
|
43984
43984
|
}
|
|
43985
43985
|
if (check2._tag === "Filter") return void 0;
|
|
43986
|
-
const children = check2.checks.map((child, index2) => compileCheck(child, type, [...
|
|
43986
|
+
const children = check2.checks.map((child, index2) => compileCheck(child, type, [...path10, "checks", index2])).filter((child) => child !== void 0);
|
|
43987
43987
|
if (children.length === 0) return void 0;
|
|
43988
43988
|
const ordinary = collectJsonSchemaAnnotations(annotations2, options4);
|
|
43989
43989
|
const allOf = children.map(([schema2]) => schema2);
|
|
@@ -43994,16 +43994,16 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
43994
43994
|
...ordinary
|
|
43995
43995
|
}];
|
|
43996
43996
|
}
|
|
43997
|
-
function recur3(representation,
|
|
43997
|
+
function recur3(representation, path10) {
|
|
43998
43998
|
if (representation._tag === "Reference") {
|
|
43999
|
-
const canonical = compileDefinition(representation.$ref,
|
|
43999
|
+
const canonical = compileDefinition(representation.$ref, path10);
|
|
44000
44000
|
return {
|
|
44001
44001
|
$ref: `#/$defs/${escapeToken(canonical)}`
|
|
44002
44002
|
};
|
|
44003
44003
|
}
|
|
44004
44004
|
const cached3 = compiledRepresentations.get(representation);
|
|
44005
44005
|
if (cached3 !== void 0) return cached3;
|
|
44006
|
-
let output = on(representation,
|
|
44006
|
+
let output = on(representation, path10);
|
|
44007
44007
|
const ordinary = collectJsonSchemaAnnotations(representation.annotations, options4);
|
|
44008
44008
|
if (ordinary !== void 0) {
|
|
44009
44009
|
output = {
|
|
@@ -44013,7 +44013,7 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44013
44013
|
}
|
|
44014
44014
|
for (let index2 = 0; index2 < representation.checks.length; index2++) {
|
|
44015
44015
|
const type = typeof output.type === "string" && isJsonSchemaType(output.type) ? output.type : void 0;
|
|
44016
|
-
const check2 = compileCheck(representation.checks[index2], type, [...
|
|
44016
|
+
const check2 = compileCheck(representation.checks[index2], type, [...path10, "checks", index2]);
|
|
44017
44017
|
if (check2 !== void 0) {
|
|
44018
44018
|
output = appendJsonSchema(output, ...check2);
|
|
44019
44019
|
}
|
|
@@ -44021,7 +44021,7 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44021
44021
|
compiledRepresentations.set(representation, output);
|
|
44022
44022
|
return output;
|
|
44023
44023
|
}
|
|
44024
|
-
function on(representation,
|
|
44024
|
+
function on(representation, path10) {
|
|
44025
44025
|
switch (representation._tag) {
|
|
44026
44026
|
case "Any":
|
|
44027
44027
|
case "Unknown":
|
|
@@ -44059,7 +44059,7 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44059
44059
|
return {};
|
|
44060
44060
|
}
|
|
44061
44061
|
case "Suspend":
|
|
44062
|
-
return recur3(representation.thunk, [...
|
|
44062
|
+
return recur3(representation.thunk, [...path10, "thunk"]);
|
|
44063
44063
|
case "Never":
|
|
44064
44064
|
return {
|
|
44065
44065
|
not: {}
|
|
@@ -44120,7 +44120,7 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44120
44120
|
};
|
|
44121
44121
|
case "Arrays": {
|
|
44122
44122
|
if (representation.rest.length > 1) {
|
|
44123
|
-
throw errorWithPath("Invalid schema representation document", [...
|
|
44123
|
+
throw errorWithPath("Invalid schema representation document", [...path10, "rest"]);
|
|
44124
44124
|
}
|
|
44125
44125
|
const out = {
|
|
44126
44126
|
type: "array"
|
|
@@ -44128,7 +44128,7 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44128
44128
|
let minItems = representation.elements.length;
|
|
44129
44129
|
const prefixItems = representation.elements.map((element, index2) => {
|
|
44130
44130
|
if (element.isOptional) minItems--;
|
|
44131
|
-
const compiled = recur3(element.type, [...
|
|
44131
|
+
const compiled = recur3(element.type, [...path10, "elements", index2, "type"]);
|
|
44132
44132
|
const annotations2 = collectJsonSchemaAnnotations(element.annotations, options4);
|
|
44133
44133
|
return annotations2 === void 0 ? compiled : appendJsonSchema(compiled, annotations2);
|
|
44134
44134
|
});
|
|
@@ -44141,7 +44141,7 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44141
44141
|
}
|
|
44142
44142
|
if (representation.rest.length === 1) {
|
|
44143
44143
|
delete out.maxItems;
|
|
44144
|
-
const rest = recur3(representation.rest[0], [...
|
|
44144
|
+
const rest = recur3(representation.rest[0], [...path10, "rest", 0]);
|
|
44145
44145
|
if (Object.keys(rest).length > 0) out.items = rest;
|
|
44146
44146
|
else delete out.items;
|
|
44147
44147
|
}
|
|
@@ -44165,10 +44165,10 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44165
44165
|
for (let index2 = 0; index2 < representation.propertySignatures.length; index2++) {
|
|
44166
44166
|
const property = representation.propertySignatures[index2];
|
|
44167
44167
|
if (typeof property.name !== "string") {
|
|
44168
|
-
throw errorWithPath("Invalid schema representation document", [...
|
|
44168
|
+
throw errorWithPath("Invalid schema representation document", [...path10, "propertySignatures", index2, "name"]);
|
|
44169
44169
|
}
|
|
44170
44170
|
const name = property.name;
|
|
44171
|
-
const compiled = recur3(property.type, [...
|
|
44171
|
+
const compiled = recur3(property.type, [...path10, "propertySignatures", index2, "type"]);
|
|
44172
44172
|
const annotations2 = collectJsonSchemaAnnotations(property.annotations, options4);
|
|
44173
44173
|
assignProperty(properties, name, annotations2 === void 0 ? compiled : appendJsonSchema(compiled, annotations2));
|
|
44174
44174
|
if (!property.isOptional) required3.push(name);
|
|
@@ -44179,9 +44179,9 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44179
44179
|
const additionalProperties = [];
|
|
44180
44180
|
for (let index2 = 0; index2 < representation.indexSignatures.length; index2++) {
|
|
44181
44181
|
const signature = representation.indexSignatures[index2];
|
|
44182
|
-
let type = recur3(signature.type, [...
|
|
44182
|
+
let type = recur3(signature.type, [...path10, "indexSignatures", index2, "type"]);
|
|
44183
44183
|
if (Object.keys(type).length === 1 && "not" in type) type = false;
|
|
44184
|
-
const patterns = getParameterPatterns(signature.parameter, [...
|
|
44184
|
+
const patterns = getParameterPatterns(signature.parameter, [...path10, "indexSignatures", index2, "parameter"], /* @__PURE__ */ new Set());
|
|
44185
44185
|
if (patterns.length === 0) {
|
|
44186
44186
|
additionalProperties.push(type);
|
|
44187
44187
|
} else {
|
|
@@ -44211,7 +44211,7 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44211
44211
|
return out;
|
|
44212
44212
|
}
|
|
44213
44213
|
case "Union": {
|
|
44214
|
-
const types = representation.types.map((type, index2) => recur3(type, [...
|
|
44214
|
+
const types = representation.types.map((type, index2) => recur3(type, [...path10, "types", index2]));
|
|
44215
44215
|
if (types.length === 0) return {
|
|
44216
44216
|
not: {}
|
|
44217
44217
|
};
|
|
@@ -44227,25 +44227,25 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44227
44227
|
}
|
|
44228
44228
|
}
|
|
44229
44229
|
}
|
|
44230
|
-
function getParameterPatterns(parameter,
|
|
44230
|
+
function getParameterPatterns(parameter, path10, seenReferences) {
|
|
44231
44231
|
switch (parameter._tag) {
|
|
44232
44232
|
case "Reference": {
|
|
44233
44233
|
if (!Object.hasOwn(references, parameter.$ref)) {
|
|
44234
|
-
throw errorWithPath(`Invalid reference ${parameter.$ref}`, [...
|
|
44234
|
+
throw errorWithPath(`Invalid reference ${parameter.$ref}`, [...path10, "$ref"]);
|
|
44235
44235
|
}
|
|
44236
|
-
compileDefinition(parameter.$ref,
|
|
44236
|
+
compileDefinition(parameter.$ref, path10);
|
|
44237
44237
|
if (seenReferences.has(parameter.$ref)) return [];
|
|
44238
44238
|
const next = new Set(seenReferences).add(parameter.$ref);
|
|
44239
44239
|
return getParameterPatterns(references[parameter.$ref], ["references", parameter.$ref], next);
|
|
44240
44240
|
}
|
|
44241
44241
|
case "String":
|
|
44242
|
-
return collectPatterns(recur3(parameter,
|
|
44242
|
+
return collectPatterns(recur3(parameter, path10));
|
|
44243
44243
|
case "TemplateLiteral":
|
|
44244
44244
|
return [`^${parameter.parts.map(getPartPattern).join("")}$`];
|
|
44245
44245
|
case "Union":
|
|
44246
|
-
return parameter.types.flatMap((type, index2) => getParameterPatterns(type, [...
|
|
44246
|
+
return parameter.types.flatMap((type, index2) => getParameterPatterns(type, [...path10, "types", index2], seenReferences));
|
|
44247
44247
|
default:
|
|
44248
|
-
throw errorWithPath("Invalid schema representation document",
|
|
44248
|
+
throw errorWithPath("Invalid schema representation document", path10);
|
|
44249
44249
|
}
|
|
44250
44250
|
}
|
|
44251
44251
|
}
|
|
@@ -44633,25 +44633,25 @@ function get6(oldValue, newValue) {
|
|
|
44633
44633
|
getLoop(oldValue, newValue, "", patches);
|
|
44634
44634
|
return patches;
|
|
44635
44635
|
}
|
|
44636
|
-
function getLoop(oldValue, newValue,
|
|
44636
|
+
function getLoop(oldValue, newValue, path10, patches) {
|
|
44637
44637
|
if (Object.is(oldValue, newValue)) return;
|
|
44638
44638
|
if (Array.isArray(oldValue) && Array.isArray(newValue)) {
|
|
44639
44639
|
const len1 = oldValue.length;
|
|
44640
44640
|
const len2 = newValue.length;
|
|
44641
44641
|
const shared = Math.min(len1, len2);
|
|
44642
44642
|
for (let i = 0; i < shared; i++) {
|
|
44643
|
-
getLoop(oldValue[i], newValue[i], `${
|
|
44643
|
+
getLoop(oldValue[i], newValue[i], `${path10}/${i}`, patches);
|
|
44644
44644
|
}
|
|
44645
44645
|
for (let i = len1 - 1; i >= len2; i--) {
|
|
44646
44646
|
patches.push({
|
|
44647
44647
|
op: "remove",
|
|
44648
|
-
path: `${
|
|
44648
|
+
path: `${path10}/${i}`
|
|
44649
44649
|
});
|
|
44650
44650
|
}
|
|
44651
44651
|
for (let i = len1; i < len2; i++) {
|
|
44652
44652
|
patches.push({
|
|
44653
44653
|
op: "add",
|
|
44654
|
-
path: `${
|
|
44654
|
+
path: `${path10}/${i}`,
|
|
44655
44655
|
value: newValue[i]
|
|
44656
44656
|
});
|
|
44657
44657
|
}
|
|
@@ -44662,7 +44662,7 @@ function getLoop(oldValue, newValue, path9, patches) {
|
|
|
44662
44662
|
const keys22 = Object.keys(newValue);
|
|
44663
44663
|
const allKeys = Array.from(/* @__PURE__ */ new Set([...keys1, ...keys22])).sort();
|
|
44664
44664
|
for (const key of allKeys) {
|
|
44665
|
-
const keyPath = `${
|
|
44665
|
+
const keyPath = `${path10}/${escapeToken(key)}`;
|
|
44666
44666
|
const hasKey1 = Object.hasOwn(oldValue, key);
|
|
44667
44667
|
const hasKey2 = Object.hasOwn(newValue, key);
|
|
44668
44668
|
if (hasKey1 && hasKey2) {
|
|
@@ -44684,7 +44684,7 @@ function getLoop(oldValue, newValue, path9, patches) {
|
|
|
44684
44684
|
}
|
|
44685
44685
|
patches.push({
|
|
44686
44686
|
op: "replace",
|
|
44687
|
-
path:
|
|
44687
|
+
path: path10,
|
|
44688
44688
|
value: newValue
|
|
44689
44689
|
});
|
|
44690
44690
|
}
|
|
@@ -44834,12 +44834,12 @@ var PathNode = class {
|
|
|
44834
44834
|
path;
|
|
44835
44835
|
get;
|
|
44836
44836
|
set;
|
|
44837
|
-
constructor(
|
|
44838
|
-
this.path =
|
|
44837
|
+
constructor(path10) {
|
|
44838
|
+
this.path = path10;
|
|
44839
44839
|
this.get = (s) => {
|
|
44840
44840
|
let out = s;
|
|
44841
|
-
for (let i = 0; i <
|
|
44842
|
-
out = out[
|
|
44841
|
+
for (let i = 0; i < path10.length; i++) {
|
|
44842
|
+
out = out[path10[i]];
|
|
44843
44843
|
}
|
|
44844
44844
|
return out;
|
|
44845
44845
|
};
|
|
@@ -44847,12 +44847,12 @@ var PathNode = class {
|
|
|
44847
44847
|
const out = cloneShallow(s);
|
|
44848
44848
|
let current = out;
|
|
44849
44849
|
let i = 0;
|
|
44850
|
-
for (; i <
|
|
44851
|
-
const key =
|
|
44850
|
+
for (; i < path10.length - 1; i++) {
|
|
44851
|
+
const key = path10[i];
|
|
44852
44852
|
assignProperty(current, key, cloneShallow(current[key]));
|
|
44853
44853
|
current = current[key];
|
|
44854
44854
|
}
|
|
44855
|
-
assignProperty(current,
|
|
44855
|
+
assignProperty(current, path10[i], a);
|
|
44856
44856
|
return out;
|
|
44857
44857
|
};
|
|
44858
44858
|
}
|
|
@@ -50274,8 +50274,8 @@ var fileContentLength = (size6, options4) => {
|
|
|
50274
50274
|
const available = Math.max(0, Number(size6) - Number(options4?.offset ?? 0));
|
|
50275
50275
|
return options4?.bytesToRead === void 0 ? available : Math.min(available, Math.max(0, Number(options4.bytesToRead)));
|
|
50276
50276
|
};
|
|
50277
|
-
var file = (
|
|
50278
|
-
var fileFromInfo = (
|
|
50277
|
+
var file = (path10, options4) => flatMap5(FileSystem, (fs) => map7(fs.stat(path10), (info2) => stream(fs.stream(path10, options4), options4?.contentType, fileContentLength(info2.size, options4))));
|
|
50278
|
+
var fileFromInfo = (path10, info2, options4) => map7(FileSystem, (fs) => stream(fs.stream(path10, options4), options4?.contentType, fileContentLength(info2.size, options4)));
|
|
50279
50279
|
|
|
50280
50280
|
// ../../node_modules/effect/dist/unstable/http/HttpClientError.js
|
|
50281
50281
|
var TypeId39 = "~effect/http/HttpClientError";
|
|
@@ -50617,13 +50617,13 @@ var setUrl = /* @__PURE__ */ dual(2, (self, url2) => {
|
|
|
50617
50617
|
clone2.hash = "";
|
|
50618
50618
|
return makeWith(self.method, clone2.toString(), urlParams2, hash2, self.headers, self.body);
|
|
50619
50619
|
});
|
|
50620
|
-
var prependUrl = /* @__PURE__ */ dual(2, (self,
|
|
50621
|
-
if (
|
|
50622
|
-
return makeWith(self.method, joinSegments(
|
|
50620
|
+
var prependUrl = /* @__PURE__ */ dual(2, (self, path10) => {
|
|
50621
|
+
if (path10 === "") return self;
|
|
50622
|
+
return makeWith(self.method, joinSegments(path10, self.url), self.urlParams, self.hash, self.headers, self.body);
|
|
50623
50623
|
});
|
|
50624
|
-
var appendUrl = /* @__PURE__ */ dual(2, (self,
|
|
50625
|
-
if (
|
|
50626
|
-
return makeWith(self.method, joinSegments(self.url,
|
|
50624
|
+
var appendUrl = /* @__PURE__ */ dual(2, (self, path10) => {
|
|
50625
|
+
if (path10 === "") return self;
|
|
50626
|
+
return makeWith(self.method, joinSegments(self.url, path10), self.urlParams, self.hash, self.headers, self.body);
|
|
50627
50627
|
});
|
|
50628
50628
|
var joinSegments = (first, second) => {
|
|
50629
50629
|
const endsWithSlash = first.endsWith("/");
|
|
@@ -50654,7 +50654,7 @@ var bodyUrlParams = /* @__PURE__ */ dual(2, (self, input) => setBody(self, urlPa
|
|
|
50654
50654
|
var bodyFormData = /* @__PURE__ */ dual(2, (self, body) => setBody(self, formData(body)));
|
|
50655
50655
|
var bodyFormDataRecord = /* @__PURE__ */ dual(2, (self, entries3) => setBody(self, formDataRecord(entries3)));
|
|
50656
50656
|
var bodyStream = /* @__PURE__ */ dual((args2) => isHttpClientRequest(args2[0]), (self, body, options4) => setBody(self, stream(body, options4?.contentType, options4?.contentLength)));
|
|
50657
|
-
var bodyFile = /* @__PURE__ */ dual((args2) => isHttpClientRequest(args2[0]), (self,
|
|
50657
|
+
var bodyFile = /* @__PURE__ */ dual((args2) => isHttpClientRequest(args2[0]), (self, path10, options4) => map7(file(path10, options4), (body) => setBody(self, body)));
|
|
50658
50658
|
function toUrl(self) {
|
|
50659
50659
|
const r = make32(self.url, self.urlParams, getOrUndefined(self.hash));
|
|
50660
50660
|
if (isSuccess2(r)) {
|
|
@@ -52571,7 +52571,7 @@ var FileImpl = class extends PartBase {
|
|
|
52571
52571
|
};
|
|
52572
52572
|
}
|
|
52573
52573
|
};
|
|
52574
|
-
var defaultWriteFile = (
|
|
52574
|
+
var defaultWriteFile = (path10, file5) => flatMap5(FileSystem, (fs) => mapError3(run(file5.content, fs.sink(path10)), (cause) => MultipartError.fromReason("InternalError", cause)));
|
|
52575
52575
|
var toPersisted = (stream2, writeFile3 = defaultWriteFile) => gen3(function* () {
|
|
52576
52576
|
const fs = yield* FileSystem;
|
|
52577
52577
|
const path_ = yield* Path;
|
|
@@ -52595,19 +52595,19 @@ var toPersisted = (stream2, writeFile3 = defaultWriteFile) => gen3(function* ()
|
|
|
52595
52595
|
}
|
|
52596
52596
|
const file5 = part;
|
|
52597
52597
|
const fileName = path_.basename(file5.name).slice(-128);
|
|
52598
|
-
let
|
|
52599
|
-
while (usedPaths.has(
|
|
52600
|
-
|
|
52598
|
+
let path10 = path_.join(dir2, fileName);
|
|
52599
|
+
while (usedPaths.has(path10)) {
|
|
52600
|
+
path10 = path_.join(dir2, `${fileIndex++}-${fileName}`);
|
|
52601
52601
|
}
|
|
52602
|
-
usedPaths.add(
|
|
52603
|
-
const filePart = new PersistedFileImpl(file5.key, file5.name, file5.contentType,
|
|
52602
|
+
usedPaths.add(path10);
|
|
52603
|
+
const filePart = new PersistedFileImpl(file5.key, file5.name, file5.contentType, path10);
|
|
52604
52604
|
if (Array.isArray(persisted[part.key])) {
|
|
52605
52605
|
;
|
|
52606
52606
|
persisted[part.key].push(filePart);
|
|
52607
52607
|
} else {
|
|
52608
52608
|
persisted[part.key] = [filePart];
|
|
52609
52609
|
}
|
|
52610
|
-
return writeFile3(
|
|
52610
|
+
return writeFile3(path10, file5);
|
|
52611
52611
|
});
|
|
52612
52612
|
return persisted;
|
|
52613
52613
|
}).pipe(catchTag3("PlatformError", (cause) => fail6(MultipartError.fromReason("InternalError", cause))));
|
|
@@ -52617,12 +52617,12 @@ var PersistedFileImpl = class extends PartBase {
|
|
|
52617
52617
|
name;
|
|
52618
52618
|
contentType;
|
|
52619
52619
|
path;
|
|
52620
|
-
constructor(key, name, contentType,
|
|
52620
|
+
constructor(key, name, contentType, path10) {
|
|
52621
52621
|
super();
|
|
52622
52622
|
this.key = key;
|
|
52623
52623
|
this.name = name;
|
|
52624
52624
|
this.contentType = contentType;
|
|
52625
|
-
this.path =
|
|
52625
|
+
this.path = path10;
|
|
52626
52626
|
}
|
|
52627
52627
|
toJSON() {
|
|
52628
52628
|
return {
|
|
@@ -53050,7 +53050,7 @@ var withLoggerDisabled = (self) => withFiber2((fiber3) => {
|
|
|
53050
53050
|
|
|
53051
53051
|
// ../../node_modules/effect/dist/unstable/http/HttpRouter.js
|
|
53052
53052
|
var HttpRouter = /* @__PURE__ */ Service("effect/http/HttpRouter");
|
|
53053
|
-
var removeTrailingSlash = (
|
|
53053
|
+
var removeTrailingSlash = (path10) => path10.endsWith("/") ? path10.slice(0, -1) : path10;
|
|
53054
53054
|
var prefixPath = /* @__PURE__ */ dual(2, (self, prefix) => {
|
|
53055
53055
|
prefix = removeTrailingSlash(prefix);
|
|
53056
53056
|
if (self === "*") return `${prefix}/*`;
|
|
@@ -53234,7 +53234,7 @@ var Proto13 = {
|
|
|
53234
53234
|
};
|
|
53235
53235
|
}
|
|
53236
53236
|
};
|
|
53237
|
-
var identityPath = (
|
|
53237
|
+
var identityPath = (path10) => path10;
|
|
53238
53238
|
function makeProvider(load, mapInput3) {
|
|
53239
53239
|
const self = Object.create(Proto13);
|
|
53240
53240
|
self.load = load;
|
|
@@ -53242,20 +53242,20 @@ function makeProvider(load, mapInput3) {
|
|
|
53242
53242
|
return self;
|
|
53243
53243
|
}
|
|
53244
53244
|
function makeSource(get11, transform6) {
|
|
53245
|
-
return makeProvider((
|
|
53245
|
+
return makeProvider((path10) => get11(transform6(path10)), (f) => makeSource(get11, flow(transform6, f)));
|
|
53246
53246
|
}
|
|
53247
53247
|
function makeOrElse(first, second) {
|
|
53248
|
-
return makeProvider((
|
|
53248
|
+
return makeProvider((path10) => flatMap5(first.load(path10), (node) => node !== void 0 ? succeed6(node) : second.load(path10)), (f) => makeOrElse(first.mapInput(f), second.mapInput(f)));
|
|
53249
53249
|
}
|
|
53250
53250
|
function make40(get11) {
|
|
53251
53251
|
return makeSource(get11, identityPath);
|
|
53252
53252
|
}
|
|
53253
53253
|
var orElse2 = /* @__PURE__ */ dual(2, (self, that) => makeOrElse(self, that));
|
|
53254
53254
|
var mapInput2 = /* @__PURE__ */ dual(2, (self, f) => self.mapInput(f));
|
|
53255
|
-
var constantCase = /* @__PURE__ */ mapInput2((
|
|
53255
|
+
var constantCase = /* @__PURE__ */ mapInput2((path10) => path10.map((seg) => typeof seg === "number" ? seg : configCase(seg)));
|
|
53256
53256
|
var nested = /* @__PURE__ */ dual(2, (self, prefix) => {
|
|
53257
|
-
const
|
|
53258
|
-
return mapInput2(self, (input) => [...
|
|
53257
|
+
const path10 = typeof prefix === "string" ? [prefix] : prefix;
|
|
53258
|
+
return mapInput2(self, (input) => [...path10, ...input]);
|
|
53259
53259
|
});
|
|
53260
53260
|
var layer2 = (self) => isEffect2(self) ? effect(ConfigProvider)(self) : succeed5(ConfigProvider)(self);
|
|
53261
53261
|
var layerAdd = (self, options4) => effect(ConfigProvider)(gen3(function* () {
|
|
@@ -53265,11 +53265,11 @@ var layerAdd = (self, options4) => effect(ConfigProvider)(gen3(function* () {
|
|
|
53265
53265
|
}));
|
|
53266
53266
|
function fromUnknown(root2, options4) {
|
|
53267
53267
|
const preserveEmptyStrings = options4?.preserveEmptyStrings === true;
|
|
53268
|
-
return make40((
|
|
53268
|
+
return make40((path10) => succeed6(nodeAtJson(root2, path10, preserveEmptyStrings)));
|
|
53269
53269
|
}
|
|
53270
|
-
function nodeAtJson(root2,
|
|
53270
|
+
function nodeAtJson(root2, path10, preserveEmptyStrings) {
|
|
53271
53271
|
let cur = root2;
|
|
53272
|
-
for (const seg of
|
|
53272
|
+
for (const seg of path10) {
|
|
53273
53273
|
if (cur === null || cur === void 0) return void 0;
|
|
53274
53274
|
if (Array.isArray(cur)) {
|
|
53275
53275
|
if (typeof seg !== "number" || !Number.isInteger(seg) || seg < 0 || seg >= cur.length) return void 0;
|
|
@@ -53308,7 +53308,7 @@ function emptyStringAsMissing(value3, preserveEmptyStrings) {
|
|
|
53308
53308
|
function fromEnvRecord(env, options4) {
|
|
53309
53309
|
const preserveEmptyStrings = options4?.preserveEmptyStrings === true;
|
|
53310
53310
|
const trie = buildEnvTrie(env);
|
|
53311
|
-
return make40((
|
|
53311
|
+
return make40((path10) => succeed6(nodeAtEnv(trie, env, path10, preserveEmptyStrings)));
|
|
53312
53312
|
}
|
|
53313
53313
|
function fromEnv(options4) {
|
|
53314
53314
|
const env = options4?.env ?? {
|
|
@@ -53333,10 +53333,10 @@ function buildEnvTrie(env) {
|
|
|
53333
53333
|
return trie;
|
|
53334
53334
|
}
|
|
53335
53335
|
var NUMERIC_INDEX = /^(0|[1-9][0-9]*)$/;
|
|
53336
|
-
function nodeAtEnv(trie, env,
|
|
53337
|
-
const key =
|
|
53336
|
+
function nodeAtEnv(trie, env, path10, preserveEmptyStrings) {
|
|
53337
|
+
const key = path10.map(String).join("_");
|
|
53338
53338
|
const leafValue = emptyStringAsMissing(Object.hasOwn(env, key) ? env[key] : void 0, preserveEmptyStrings);
|
|
53339
|
-
const trieNode = trieNodeAt(trie,
|
|
53339
|
+
const trieNode = trieNodeAt(trie, path10);
|
|
53340
53340
|
const children = trieNode?.children ? Object.keys(trieNode.children) : [];
|
|
53341
53341
|
if (children.length === 0) {
|
|
53342
53342
|
return leafValue === void 0 ? void 0 : makeValue(leafValue);
|
|
@@ -53348,10 +53348,10 @@ function nodeAtEnv(trie, env, path9, preserveEmptyStrings) {
|
|
|
53348
53348
|
}
|
|
53349
53349
|
return makeRecord(new Set(children), leafValue);
|
|
53350
53350
|
}
|
|
53351
|
-
function trieNodeAt(root2,
|
|
53352
|
-
if (
|
|
53351
|
+
function trieNodeAt(root2, path10) {
|
|
53352
|
+
if (path10.length === 0) return root2;
|
|
53353
53353
|
let node = root2;
|
|
53354
|
-
for (const seg of
|
|
53354
|
+
for (const seg of path10) {
|
|
53355
53355
|
node = node?.children?.[String(seg)];
|
|
53356
53356
|
if (!node) return void 0;
|
|
53357
53357
|
}
|
|
@@ -53419,12 +53419,12 @@ var fromDir = /* @__PURE__ */ fnUntraced2(function* (options4) {
|
|
|
53419
53419
|
const fs = yield* FileSystem;
|
|
53420
53420
|
const rootPath = options4?.rootPath ?? "/";
|
|
53421
53421
|
const preserveEmptyStrings = options4?.preserveEmptyStrings === true;
|
|
53422
|
-
return make40((
|
|
53423
|
-
const fullPath = platformPath.join(rootPath, ...
|
|
53422
|
+
return make40((path10) => {
|
|
53423
|
+
const fullPath = platformPath.join(rootPath, ...path10.map(String));
|
|
53424
53424
|
const asFile = fs.readFileString(fullPath).pipe(map7((content) => stringNode(content.trim(), preserveEmptyStrings)));
|
|
53425
53425
|
const asDirectory = fs.readDirectory(fullPath).pipe(map7((entries3) => makeRecord(new Set(entries3.map((entry) => platformPath.basename(entry))))));
|
|
53426
53426
|
return asFile.pipe(catch_3((fileCause) => asDirectory.pipe(catch_3((dirCause) => isNotFound(fileCause) && isNotFound(dirCause) ? succeed6(void 0) : fail6(isNotFound(fileCause) ? dirCause : fileCause)))), mapError3((cause) => new SourceError({
|
|
53427
|
-
message: `Failed to read file at ${platformPath.join(rootPath, ...
|
|
53427
|
+
message: `Failed to read file at ${platformPath.join(rootPath, ...path10.map(String))}`,
|
|
53428
53428
|
cause
|
|
53429
53429
|
})));
|
|
53430
53430
|
});
|
|
@@ -53572,9 +53572,9 @@ var unwrap5 = (wrapped) => {
|
|
|
53572
53572
|
return all4(map3(wrapped, (config) => unwrap5(config)));
|
|
53573
53573
|
};
|
|
53574
53574
|
var cursorToString = () => "<configuration>";
|
|
53575
|
-
var loadCursor = (provider,
|
|
53575
|
+
var loadCursor = (provider, path10) => provider.load(path10).pipe(orDie3, mapEager2((node) => ({
|
|
53576
53576
|
provider,
|
|
53577
|
-
path:
|
|
53577
|
+
path: path10,
|
|
53578
53578
|
node,
|
|
53579
53579
|
toString: cursorToString
|
|
53580
53580
|
})));
|
|
@@ -53671,11 +53671,11 @@ var toConfigCursorAST = /* @__PURE__ */ memoize((root2) => {
|
|
|
53671
53671
|
});
|
|
53672
53672
|
return recur3(root2);
|
|
53673
53673
|
});
|
|
53674
|
-
function schema(codec,
|
|
53674
|
+
function schema(codec, path10) {
|
|
53675
53675
|
const codecStringTree = toCodecStringTree(codec);
|
|
53676
53676
|
const encodedAst = toEncoded(codecStringTree.ast);
|
|
53677
53677
|
const decodeCursor = decodeUnknownEffect(make29(toConfigCursorAST(codecStringTree.ast)));
|
|
53678
|
-
const localPath = typeof
|
|
53678
|
+
const localPath = typeof path10 === "string" ? [path10] : path10 ?? [];
|
|
53679
53679
|
return make41((provider, pathPrefix) => {
|
|
53680
53680
|
const fullPath = [...pathPrefix, ...localPath];
|
|
53681
53681
|
return catchSourceError(loadCursor(provider, fullPath), false).pipe(flatMapEager2((cursor) => {
|
|
@@ -53901,7 +53901,7 @@ var handleBadArgument = (method) => (err) => badArgument({
|
|
|
53901
53901
|
});
|
|
53902
53902
|
var access2 = /* @__PURE__ */ (() => {
|
|
53903
53903
|
const nodeAccess = /* @__PURE__ */ effectify(NFS.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
|
|
53904
|
-
return (
|
|
53904
|
+
return (path10, options4) => {
|
|
53905
53905
|
let mode = NFS.constants.F_OK;
|
|
53906
53906
|
if (options4?.readable) {
|
|
53907
53907
|
mode |= NFS.constants.R_OK;
|
|
@@ -53909,7 +53909,7 @@ var access2 = /* @__PURE__ */ (() => {
|
|
|
53909
53909
|
if (options4?.writable) {
|
|
53910
53910
|
mode |= NFS.constants.W_OK;
|
|
53911
53911
|
}
|
|
53912
|
-
return nodeAccess(
|
|
53912
|
+
return nodeAccess(path10, mode);
|
|
53913
53913
|
};
|
|
53914
53914
|
})();
|
|
53915
53915
|
var copy2 = /* @__PURE__ */ (() => {
|
|
@@ -53926,11 +53926,11 @@ var copyFile2 = /* @__PURE__ */ (() => {
|
|
|
53926
53926
|
})();
|
|
53927
53927
|
var chmod2 = /* @__PURE__ */ (() => {
|
|
53928
53928
|
const nodeChmod = /* @__PURE__ */ effectify(NFS.chmod, /* @__PURE__ */ handleErrnoException("FileSystem", "chmod"), /* @__PURE__ */ handleBadArgument("chmod"));
|
|
53929
|
-
return (
|
|
53929
|
+
return (path10, mode) => nodeChmod(path10, mode);
|
|
53930
53930
|
})();
|
|
53931
53931
|
var chown2 = /* @__PURE__ */ (() => {
|
|
53932
53932
|
const nodeChown = /* @__PURE__ */ effectify(NFS.chown, /* @__PURE__ */ handleErrnoException("FileSystem", "chown"), /* @__PURE__ */ handleBadArgument("chown"));
|
|
53933
|
-
return (
|
|
53933
|
+
return (path10, uid, gid) => nodeChown(path10, uid, gid);
|
|
53934
53934
|
})();
|
|
53935
53935
|
var glob2 = /* @__PURE__ */ (() => {
|
|
53936
53936
|
const nodeGlob = /* @__PURE__ */ effectify(NFS.glob, /* @__PURE__ */ handleErrnoException("FileSystem", "glob"), /* @__PURE__ */ handleBadArgument("glob"));
|
|
@@ -53945,7 +53945,7 @@ var link3 = /* @__PURE__ */ (() => {
|
|
|
53945
53945
|
})();
|
|
53946
53946
|
var makeDirectory = /* @__PURE__ */ (() => {
|
|
53947
53947
|
const nodeMkdir = /* @__PURE__ */ effectify(NFS.mkdir, /* @__PURE__ */ handleErrnoException("FileSystem", "makeDirectory"), /* @__PURE__ */ handleBadArgument("makeDirectory"));
|
|
53948
|
-
return (
|
|
53948
|
+
return (path10, options4) => nodeMkdir(path10, {
|
|
53949
53949
|
recursive: options4?.recursive ?? false,
|
|
53950
53950
|
mode: options4?.mode
|
|
53951
53951
|
});
|
|
@@ -53961,7 +53961,7 @@ var makeTempDirectoryFactory = (method) => {
|
|
|
53961
53961
|
var makeTempDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectory");
|
|
53962
53962
|
var removeFactory = (method) => {
|
|
53963
53963
|
const nodeRm = effectify(NFS.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
53964
|
-
return (
|
|
53964
|
+
return (path10, options4) => nodeRm(path10, {
|
|
53965
53965
|
recursive: options4?.recursive ?? false,
|
|
53966
53966
|
force: options4?.force ?? false
|
|
53967
53967
|
});
|
|
@@ -53977,7 +53977,7 @@ var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
|
|
|
53977
53977
|
var openFactory = (method) => {
|
|
53978
53978
|
const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
53979
53979
|
const nodeClose = effectify(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
53980
|
-
return (
|
|
53980
|
+
return (path10, options4) => pipe(acquireRelease2(nodeOpen(path10, options4?.flag ?? "r", options4?.mode), (fd) => orDie3(nodeClose(fd))), map7((fd) => makeFile(fd, options4?.flag?.startsWith("a") ?? false)));
|
|
53981
53981
|
};
|
|
53982
53982
|
var open2 = /* @__PURE__ */ openFactory("open");
|
|
53983
53983
|
var makeFile = /* @__PURE__ */ (() => {
|
|
@@ -54118,17 +54118,17 @@ var makeTempFileScoped = /* @__PURE__ */ (() => {
|
|
|
54118
54118
|
recursive: true
|
|
54119
54119
|
})));
|
|
54120
54120
|
})();
|
|
54121
|
-
var readDirectory = (
|
|
54122
|
-
try: () => NFS.promises.readdir(
|
|
54123
|
-
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [
|
|
54121
|
+
var readDirectory = (path10, options4) => tryPromise2({
|
|
54122
|
+
try: () => NFS.promises.readdir(path10, options4),
|
|
54123
|
+
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path10])
|
|
54124
54124
|
});
|
|
54125
|
-
var readFile2 = (
|
|
54125
|
+
var readFile2 = (path10) => callback2((resume, signal) => {
|
|
54126
54126
|
try {
|
|
54127
|
-
NFS.readFile(
|
|
54127
|
+
NFS.readFile(path10, {
|
|
54128
54128
|
signal
|
|
54129
54129
|
}, (err, data) => {
|
|
54130
54130
|
if (err) {
|
|
54131
|
-
resume(fail6(handleErrnoException("FileSystem", "readFile")(err, [
|
|
54131
|
+
resume(fail6(handleErrnoException("FileSystem", "readFile")(err, [path10])));
|
|
54132
54132
|
} else {
|
|
54133
54133
|
resume(succeed6(data));
|
|
54134
54134
|
}
|
|
@@ -54139,11 +54139,11 @@ var readFile2 = (path9) => callback2((resume, signal) => {
|
|
|
54139
54139
|
});
|
|
54140
54140
|
var readLink = /* @__PURE__ */ (() => {
|
|
54141
54141
|
const nodeReadLink = /* @__PURE__ */ effectify(NFS.readlink, /* @__PURE__ */ handleErrnoException("FileSystem", "readLink"), /* @__PURE__ */ handleBadArgument("readLink"));
|
|
54142
|
-
return (
|
|
54142
|
+
return (path10) => nodeReadLink(path10);
|
|
54143
54143
|
})();
|
|
54144
54144
|
var realPath = /* @__PURE__ */ (() => {
|
|
54145
54145
|
const nodeRealPath = /* @__PURE__ */ effectify(NFS.realpath, /* @__PURE__ */ handleErrnoException("FileSystem", "realPath"), /* @__PURE__ */ handleBadArgument("realPath"));
|
|
54146
|
-
return (
|
|
54146
|
+
return (path10) => nodeRealPath(path10);
|
|
54147
54147
|
})();
|
|
54148
54148
|
var rename2 = /* @__PURE__ */ (() => {
|
|
54149
54149
|
const nodeRename = /* @__PURE__ */ effectify(NFS.rename, /* @__PURE__ */ handleErrnoException("FileSystem", "rename"), /* @__PURE__ */ handleBadArgument("rename"));
|
|
@@ -54167,35 +54167,35 @@ var makeFileInfo = (stat3) => ({
|
|
|
54167
54167
|
});
|
|
54168
54168
|
var stat2 = /* @__PURE__ */ (() => {
|
|
54169
54169
|
const nodeStat = /* @__PURE__ */ effectify(NFS.stat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
|
|
54170
|
-
return (
|
|
54170
|
+
return (path10) => map7(nodeStat(path10), makeFileInfo);
|
|
54171
54171
|
})();
|
|
54172
54172
|
var symlink2 = /* @__PURE__ */ (() => {
|
|
54173
54173
|
const nodeSymlink = /* @__PURE__ */ effectify(NFS.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
|
|
54174
|
-
return (target,
|
|
54174
|
+
return (target, path10) => nodeSymlink(target, path10);
|
|
54175
54175
|
})();
|
|
54176
54176
|
var truncate3 = /* @__PURE__ */ (() => {
|
|
54177
54177
|
const nodeTruncate = /* @__PURE__ */ effectify(NFS.truncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
|
|
54178
|
-
return (
|
|
54178
|
+
return (path10, length) => nodeTruncate(path10, length !== void 0 ? Number(length) : void 0);
|
|
54179
54179
|
})();
|
|
54180
54180
|
var utimes2 = /* @__PURE__ */ (() => {
|
|
54181
54181
|
const nodeUtimes = /* @__PURE__ */ effectify(NFS.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
|
|
54182
|
-
return (
|
|
54182
|
+
return (path10, atime, mtime) => nodeUtimes(path10, atime, mtime);
|
|
54183
54183
|
})();
|
|
54184
|
-
var watchNode = (
|
|
54185
|
-
const watcher = NFS.watch(
|
|
54184
|
+
var watchNode = (path10, options4) => callback3((queue) => acquireRelease2(sync3(() => {
|
|
54185
|
+
const watcher = NFS.watch(path10, {
|
|
54186
54186
|
recursive: options4?.recursive ?? false
|
|
54187
|
-
}, (event,
|
|
54188
|
-
if (!
|
|
54187
|
+
}, (event, path11) => {
|
|
54188
|
+
if (!path11) return;
|
|
54189
54189
|
switch (event) {
|
|
54190
54190
|
case "rename": {
|
|
54191
|
-
runFork2(matchEffect3(stat2(
|
|
54191
|
+
runFork2(matchEffect3(stat2(path11), {
|
|
54192
54192
|
onSuccess: (_) => offer(queue, {
|
|
54193
54193
|
_tag: "Create",
|
|
54194
|
-
path:
|
|
54194
|
+
path: path11
|
|
54195
54195
|
}),
|
|
54196
54196
|
onFailure: (_) => offer(queue, {
|
|
54197
54197
|
_tag: "Remove",
|
|
54198
|
-
path:
|
|
54198
|
+
path: path11
|
|
54199
54199
|
})
|
|
54200
54200
|
}));
|
|
54201
54201
|
return;
|
|
@@ -54203,7 +54203,7 @@ var watchNode = (path9, options4) => callback3((queue) => acquireRelease2(sync3(
|
|
|
54203
54203
|
case "change": {
|
|
54204
54204
|
offerUnsafe(queue, {
|
|
54205
54205
|
_tag: "Update",
|
|
54206
|
-
path:
|
|
54206
|
+
path: path11
|
|
54207
54207
|
});
|
|
54208
54208
|
return;
|
|
54209
54209
|
}
|
|
@@ -54214,7 +54214,7 @@ var watchNode = (path9, options4) => callback3((queue) => acquireRelease2(sync3(
|
|
|
54214
54214
|
module: "FileSystem",
|
|
54215
54215
|
_tag: "Unknown",
|
|
54216
54216
|
method: "watch",
|
|
54217
|
-
pathOrDescriptor:
|
|
54217
|
+
pathOrDescriptor: path10,
|
|
54218
54218
|
cause: error2
|
|
54219
54219
|
})));
|
|
54220
54220
|
});
|
|
@@ -54223,16 +54223,16 @@ var watchNode = (path9, options4) => callback3((queue) => acquireRelease2(sync3(
|
|
|
54223
54223
|
});
|
|
54224
54224
|
return watcher;
|
|
54225
54225
|
}), (watcher) => sync3(() => watcher.close())));
|
|
54226
|
-
var watch2 = (backend,
|
|
54227
|
-
var writeFile2 = (
|
|
54226
|
+
var watch2 = (backend, path10, options4) => stat2(path10).pipe(map7((stat3) => backend.pipe(flatMap((_) => _.register(path10, stat3, options4)), getOrElse(() => watchNode(path10, options4)))), unwrap4);
|
|
54227
|
+
var writeFile2 = (path10, data, options4) => callback2((resume, signal) => {
|
|
54228
54228
|
try {
|
|
54229
|
-
NFS.writeFile(
|
|
54229
|
+
NFS.writeFile(path10, data, {
|
|
54230
54230
|
signal,
|
|
54231
54231
|
flag: options4?.flag,
|
|
54232
54232
|
mode: options4?.mode
|
|
54233
54233
|
}, (err) => {
|
|
54234
54234
|
if (err) {
|
|
54235
|
-
resume(fail6(handleErrnoException("FileSystem", "writeFile")(err, [
|
|
54235
|
+
resume(fail6(handleErrnoException("FileSystem", "writeFile")(err, [path10])));
|
|
54236
54236
|
} else {
|
|
54237
54237
|
resume(void_4);
|
|
54238
54238
|
}
|
|
@@ -54265,8 +54265,8 @@ var makeFileSystem = /* @__PURE__ */ map7(/* @__PURE__ */ serviceOption2(WatchBa
|
|
|
54265
54265
|
symlink: symlink2,
|
|
54266
54266
|
truncate: truncate3,
|
|
54267
54267
|
utimes: utimes2,
|
|
54268
|
-
watch(
|
|
54269
|
-
return watch2(backend,
|
|
54268
|
+
watch(path10, options4) {
|
|
54269
|
+
return watch2(backend, path10, options4);
|
|
54270
54270
|
},
|
|
54271
54271
|
writeFile: writeFile2
|
|
54272
54272
|
}));
|
|
@@ -54801,8 +54801,8 @@ var fileUrlOps = (windows) => ({
|
|
|
54801
54801
|
cause
|
|
54802
54802
|
})
|
|
54803
54803
|
}),
|
|
54804
|
-
toFileUrl: (
|
|
54805
|
-
try: () => NodeUrl.pathToFileURL(
|
|
54804
|
+
toFileUrl: (path10) => try_3({
|
|
54805
|
+
try: () => NodeUrl.pathToFileURL(path10, {
|
|
54806
54806
|
windows
|
|
54807
54807
|
}),
|
|
54808
54808
|
catch: (cause) => new BadArgument({
|
|
@@ -55622,27 +55622,27 @@ var TomlParser = class {
|
|
|
55622
55622
|
this.advance();
|
|
55623
55623
|
}
|
|
55624
55624
|
this.skipInlineWhitespace();
|
|
55625
|
-
const
|
|
55625
|
+
const path10 = this.parseKeyPath("]");
|
|
55626
55626
|
this.skipInlineWhitespace();
|
|
55627
55627
|
this.expect("]");
|
|
55628
55628
|
if (array3) {
|
|
55629
55629
|
this.expect("]");
|
|
55630
55630
|
}
|
|
55631
55631
|
this.finishStatement();
|
|
55632
|
-
const pathKey = JSON.stringify(
|
|
55632
|
+
const pathKey = JSON.stringify(path10);
|
|
55633
55633
|
if (!array3 && this.explicitTables.has(pathKey)) {
|
|
55634
|
-
this.fail(`Cannot redefine table '${
|
|
55634
|
+
this.fail(`Cannot redefine table '${path10.join(".")}'`);
|
|
55635
55635
|
}
|
|
55636
55636
|
if (!array3) {
|
|
55637
55637
|
this.explicitTables.add(pathKey);
|
|
55638
55638
|
}
|
|
55639
|
-
this.current = this.resolveTable(
|
|
55639
|
+
this.current = this.resolveTable(path10, array3);
|
|
55640
55640
|
}
|
|
55641
|
-
resolveTable(
|
|
55641
|
+
resolveTable(path10, array3) {
|
|
55642
55642
|
let table3 = this.root;
|
|
55643
|
-
for (let index2 = 0; index2 <
|
|
55644
|
-
const key =
|
|
55645
|
-
const last = index2 ===
|
|
55643
|
+
for (let index2 = 0; index2 < path10.length; index2++) {
|
|
55644
|
+
const key = path10[index2];
|
|
55645
|
+
const last = index2 === path10.length - 1;
|
|
55646
55646
|
let value3 = table3[key];
|
|
55647
55647
|
if (last && array3) {
|
|
55648
55648
|
if (value3 === void 0) {
|
|
@@ -55650,7 +55650,7 @@ var TomlParser = class {
|
|
|
55650
55650
|
table3[key] = value3;
|
|
55651
55651
|
}
|
|
55652
55652
|
if (!Array.isArray(value3)) {
|
|
55653
|
-
this.fail(`Cannot redefine existing key '${
|
|
55653
|
+
this.fail(`Cannot redefine existing key '${path10.slice(0, index2 + 1).join(".")}'`);
|
|
55654
55654
|
}
|
|
55655
55655
|
const next = makeTable();
|
|
55656
55656
|
value3.push(next);
|
|
@@ -55664,7 +55664,7 @@ var TomlParser = class {
|
|
|
55664
55664
|
value3 = value3[value3.length - 1];
|
|
55665
55665
|
}
|
|
55666
55666
|
if (!isTable(value3)) {
|
|
55667
|
-
this.fail(`Cannot redefine existing key '${
|
|
55667
|
+
this.fail(`Cannot redefine existing key '${path10.slice(0, index2 + 1).join(".")}'`);
|
|
55668
55668
|
}
|
|
55669
55669
|
table3 = value3;
|
|
55670
55670
|
}
|
|
@@ -56493,8 +56493,8 @@ var choice = (choices) => {
|
|
|
56493
56493
|
var path = (pathType, mustExist) => {
|
|
56494
56494
|
const primitive = makePrimitive2("Path", fnUntraced2(function* (value3) {
|
|
56495
56495
|
const fs = yield* FileSystem;
|
|
56496
|
-
const
|
|
56497
|
-
const absolutePath =
|
|
56496
|
+
const path10 = yield* Path;
|
|
56497
|
+
const absolutePath = path10.isAbsolute(value3) ? value3 : path10.resolve(value3);
|
|
56498
56498
|
const exists2 = yield* mapError3(fs.exists(absolutePath), (error2) => `Failed to check path existence: ${error2.message}`);
|
|
56499
56499
|
if (mustExist === true && !exists2) {
|
|
56500
56500
|
return yield* fail6(`Path does not exist: ${absolutePath}`);
|
|
@@ -56517,8 +56517,8 @@ var path = (pathType, mustExist) => {
|
|
|
56517
56517
|
var redacted2 = /* @__PURE__ */ makePrimitive2("Redacted", (value3) => succeed6(make28(value3)));
|
|
56518
56518
|
var fileText = /* @__PURE__ */ makePrimitive2("FileText", /* @__PURE__ */ fnUntraced2(function* (filePath) {
|
|
56519
56519
|
const fs = yield* FileSystem;
|
|
56520
|
-
const
|
|
56521
|
-
const absolutePath =
|
|
56520
|
+
const path10 = yield* Path;
|
|
56521
|
+
const absolutePath = path10.isAbsolute(filePath) ? filePath : path10.resolve(filePath);
|
|
56522
56522
|
const exists2 = yield* mapError3(fs.exists(absolutePath), (error2) => `Failed to check file existence: ${error2.message}`);
|
|
56523
56523
|
if (!exists2) {
|
|
56524
56524
|
return yield* fail6(`File does not exist: ${absolutePath}`);
|
|
@@ -61239,20 +61239,20 @@ var withSubcommands = /* @__PURE__ */ dual(2, (self, subcommands) => {
|
|
|
61239
61239
|
}
|
|
61240
61240
|
};
|
|
61241
61241
|
});
|
|
61242
|
-
const handle = fnUntraced2(function* (input,
|
|
61242
|
+
const handle = fnUntraced2(function* (input, path10) {
|
|
61243
61243
|
const internal = input;
|
|
61244
61244
|
const selectedSubcommand = internal[SubcommandStateSymbol];
|
|
61245
61245
|
if (selectedSubcommand) {
|
|
61246
61246
|
const child = byName.get(selectedSubcommand.name);
|
|
61247
61247
|
if (!child) {
|
|
61248
61248
|
return yield* new ShowHelp({
|
|
61249
|
-
commandPath:
|
|
61249
|
+
commandPath: path10,
|
|
61250
61250
|
errors: []
|
|
61251
61251
|
});
|
|
61252
61252
|
}
|
|
61253
|
-
return yield* child.handle(selectedSubcommand.result, [...
|
|
61253
|
+
return yield* child.handle(selectedSubcommand.result, [...path10, child.name]).pipe(provideService2(impl.service, input));
|
|
61254
61254
|
}
|
|
61255
|
-
return yield* impl.handle(input,
|
|
61255
|
+
return yield* impl.handle(input, path10);
|
|
61256
61256
|
});
|
|
61257
61257
|
return makeCommand({
|
|
61258
61258
|
name: impl.name,
|
|
@@ -61367,7 +61367,7 @@ var mapHandler = (self, f) => {
|
|
|
61367
61367
|
const impl = toImpl2(self);
|
|
61368
61368
|
return makeCommand({
|
|
61369
61369
|
...impl,
|
|
61370
|
-
handle: (input,
|
|
61370
|
+
handle: (input, path10) => f(impl.handle(input, path10), input)
|
|
61371
61371
|
});
|
|
61372
61372
|
};
|
|
61373
61373
|
var provide6 = /* @__PURE__ */ dual((args2) => isCommand(args2[0]), (self, layer16, options4) => mapHandler(self, (handler, input) => provide4(handler, typeof layer16 === "function" ? layer16(input) : layer16, options4)));
|
|
@@ -61571,14 +61571,24 @@ var ErrorResponse = Schema_exports.Struct({
|
|
|
61571
61571
|
request_id: Schema_exports.String
|
|
61572
61572
|
});
|
|
61573
61573
|
var PaginationQuery = Schema_exports.Struct({
|
|
61574
|
-
limit: Schema_exports.optionalKey(
|
|
61575
|
-
|
|
61574
|
+
limit: Schema_exports.optionalKey(
|
|
61575
|
+
Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maximum: 100 })).annotate({
|
|
61576
|
+
description: "Page size, from 1 to 100. Default: 20."
|
|
61577
|
+
})
|
|
61578
|
+
),
|
|
61579
|
+
cursor: Schema_exports.optional(
|
|
61580
|
+
Schema_exports.String.annotate({
|
|
61581
|
+
description: "Pass next_cursor from the previous response to read the next page."
|
|
61582
|
+
})
|
|
61583
|
+
)
|
|
61576
61584
|
});
|
|
61577
61585
|
function Paginated(item) {
|
|
61578
61586
|
return Schema_exports.Struct({
|
|
61579
61587
|
data: Schema_exports.Array(item),
|
|
61580
61588
|
/** null 表示没有下一页。省略与 null 语义不同,这里恒定返回该字段。 */
|
|
61581
|
-
next_cursor: Schema_exports.NullOr(Schema_exports.String)
|
|
61589
|
+
next_cursor: Schema_exports.NullOr(Schema_exports.String).annotate({
|
|
61590
|
+
description: "Cursor for the next page. Null when there are no more entries."
|
|
61591
|
+
})
|
|
61582
61592
|
});
|
|
61583
61593
|
}
|
|
61584
61594
|
var METADATA_MAX_KEYS = 20;
|
|
@@ -61602,10 +61612,20 @@ var MetadataShape = Schema_exports.Record(Schema_exports.String, Schema_exports.
|
|
|
61602
61612
|
Schema_exports.isPropertyNames(Schema_exports.String.check(Schema_exports.isPattern(METADATA_KEY_PATTERN)))
|
|
61603
61613
|
);
|
|
61604
61614
|
var Metadata = MetadataShape.annotate({
|
|
61605
|
-
description: `Your
|
|
61615
|
+
description: `Your stored tracking fields. Use them to filter Runs. They never go to the Provider or affect routing, Price, or idempotency.
|
|
61616
|
+
|
|
61617
|
+
- Up to ${METADATA_MAX_KEYS} keys: lowercase letters, digits, and underscores; start with a letter; at most 40 characters.
|
|
61618
|
+
- Values: strings of 1\u2013${METADATA_VALUE_MAX_LENGTH} characters.
|
|
61619
|
+
- user_id: your End user's opaque ID, never their email address or name.`
|
|
61606
61620
|
});
|
|
61607
61621
|
var MetadataInput = Schema_exports.Union([MetadataShape, Schema_exports.Unknown]).annotate({
|
|
61608
|
-
description: `
|
|
61622
|
+
description: `Optional tracking fields, returned on the Run and available as filters. They never go to the Provider or affect routing, Price, or idempotency.
|
|
61623
|
+
|
|
61624
|
+
- Up to ${METADATA_MAX_KEYS} keys: lowercase letters, digits, and underscores; start with a letter; at most 40 characters.
|
|
61625
|
+
- Values: strings of 1\u2013${METADATA_VALUE_MAX_LENGTH} characters.
|
|
61626
|
+
- user_id: your End user's opaque ID, never their email address or name.
|
|
61627
|
+
|
|
61628
|
+
Invalid entries are dropped whole, not truncated. The request continues, and the Run returns the fields that were stored.`
|
|
61609
61629
|
});
|
|
61610
61630
|
var MetadataQuery = Schema_exports.String.annotate({
|
|
61611
61631
|
contentMediaType: "application/json",
|
|
@@ -61643,9 +61663,15 @@ var ERROR_CODES = {
|
|
|
61643
61663
|
|
|
61644
61664
|
// ../../packages/contract/src/balance.ts
|
|
61645
61665
|
var BalanceResponse = Schema_exports.Struct({
|
|
61646
|
-
balance_usd: UsdAmount
|
|
61647
|
-
|
|
61648
|
-
|
|
61666
|
+
balance_usd: UsdAmount.annotate({
|
|
61667
|
+
description: "Settled funds in the Workspace, including funds currently held for Runs."
|
|
61668
|
+
}),
|
|
61669
|
+
held_usd: UsdAmount.annotate({
|
|
61670
|
+
description: "Funds reserved for unfinished Runs. A Hold is not a charge."
|
|
61671
|
+
}),
|
|
61672
|
+
available_usd: UsdAmount.annotate({
|
|
61673
|
+
description: "Funds available for new Runs: balance_usd minus held_usd."
|
|
61674
|
+
}),
|
|
61649
61675
|
...clientUpgradeNoticeField
|
|
61650
61676
|
});
|
|
61651
61677
|
var BalanceEntryKind = Schema_exports.Literals([
|
|
@@ -61658,10 +61684,14 @@ var BalanceEntryKind = Schema_exports.Literals([
|
|
|
61658
61684
|
var BalanceEntry = Schema_exports.Struct({
|
|
61659
61685
|
id: Schema_exports.String,
|
|
61660
61686
|
kind: BalanceEntryKind,
|
|
61661
|
-
amount_usd: UsdSigned
|
|
61662
|
-
|
|
61687
|
+
amount_usd: UsdSigned.annotate({
|
|
61688
|
+
description: "Signed USD amount. Charges are negative. Use decimal arithmetic, not floating-point arithmetic, to total entries."
|
|
61689
|
+
}),
|
|
61690
|
+
balance_after_usd: UsdAmount.annotate({ description: "Workspace balance after this entry." }),
|
|
61663
61691
|
/** charge / refund 指向触发它的 run。 */
|
|
61664
|
-
run_id: Schema_exports.NullOr(Schema_exports.String)
|
|
61692
|
+
run_id: Schema_exports.NullOr(Schema_exports.String).annotate({
|
|
61693
|
+
description: "Related Run for a charge or refund; null when no Run is associated."
|
|
61694
|
+
}),
|
|
61665
61695
|
description: Schema_exports.String,
|
|
61666
61696
|
created_at: Timestamp
|
|
61667
61697
|
});
|
|
@@ -62129,12 +62159,12 @@ function makeProto2(options4) {
|
|
|
62129
62159
|
Object.setPrototypeOf(HttpApiEndpoint, Proto18);
|
|
62130
62160
|
return Object.assign(HttpApiEndpoint, options4);
|
|
62131
62161
|
}
|
|
62132
|
-
var make48 = (method) => (identifier2,
|
|
62162
|
+
var make48 = (method) => (identifier2, path10, options4) => {
|
|
62133
62163
|
const disableCodecs = options4?.disableCodecs ?? false;
|
|
62134
62164
|
const transformStringTree = disableCodecs ? identity : toCodecStringTree;
|
|
62135
62165
|
return makeProto2({
|
|
62136
62166
|
identifier: identifier2,
|
|
62137
|
-
path:
|
|
62167
|
+
path: path10,
|
|
62138
62168
|
method,
|
|
62139
62169
|
params: ensureStruct(options4?.params, transformStringTree),
|
|
62140
62170
|
query: ensureStruct(options4?.query, transformStringTree),
|
|
@@ -63139,7 +63169,7 @@ function makeOpenApi(api2, options4) {
|
|
|
63139
63169
|
security: [],
|
|
63140
63170
|
responses: {}
|
|
63141
63171
|
};
|
|
63142
|
-
const
|
|
63172
|
+
const path10 = endpoint2.path.replace(/:(\w+)\??/g, "{$1}");
|
|
63143
63173
|
const method = endpoint2.method.toLowerCase();
|
|
63144
63174
|
function processResponseBodies(bodies, defaultDescription) {
|
|
63145
63175
|
for (const [status2, {
|
|
@@ -63166,7 +63196,7 @@ function makeOpenApi(api2, options4) {
|
|
|
63166
63196
|
pathOps.push({
|
|
63167
63197
|
_tag: "parameter",
|
|
63168
63198
|
ast: ps.type,
|
|
63169
|
-
path: ["paths",
|
|
63199
|
+
path: ["paths", path10, method, "responses", String(status2), "headers", name, "schema"]
|
|
63170
63200
|
});
|
|
63171
63201
|
}
|
|
63172
63202
|
}
|
|
@@ -63179,7 +63209,7 @@ function makeOpenApi(api2, options4) {
|
|
|
63179
63209
|
pathOps.push({
|
|
63180
63210
|
_tag: "schema",
|
|
63181
63211
|
ast: toEncodingAST(ast, encoding),
|
|
63182
|
-
path: ["paths",
|
|
63212
|
+
path: ["paths", path10, method, "responses", String(status2), "content", contentType, "schema"]
|
|
63183
63213
|
});
|
|
63184
63214
|
op.responses[status2].content ??= {};
|
|
63185
63215
|
assignProperty(op.responses[status2].content, contentType, {
|
|
@@ -63195,17 +63225,17 @@ function makeOpenApi(api2, options4) {
|
|
|
63195
63225
|
pathOps.push({
|
|
63196
63226
|
_tag: "schema",
|
|
63197
63227
|
ast: getAST(stream2.events),
|
|
63198
|
-
path: ["paths",
|
|
63228
|
+
path: ["paths", path10, method, "responses", String(status2), "content", contentType, "schema"]
|
|
63199
63229
|
});
|
|
63200
63230
|
pathOps.push({
|
|
63201
63231
|
_tag: "schema",
|
|
63202
63232
|
ast: getAST(toCodecJson(Cause(stream2.error, Defect()))),
|
|
63203
|
-
path: ["paths",
|
|
63233
|
+
path: ["paths", path10, method, "responses", String(status2), "content", contentType, "x-effect-stream", "causeSchema"]
|
|
63204
63234
|
});
|
|
63205
63235
|
pathOps.push({
|
|
63206
63236
|
_tag: "schema",
|
|
63207
63237
|
ast: getAST(stream2.error),
|
|
63208
|
-
path: ["paths",
|
|
63238
|
+
path: ["paths", path10, method, "responses", String(status2), "content", contentType, "x-effect-stream", "errorSchema"]
|
|
63209
63239
|
});
|
|
63210
63240
|
assignProperty(op.responses[status2].content, contentType, {
|
|
63211
63241
|
schema: {},
|
|
@@ -63245,7 +63275,7 @@ function makeOpenApi(api2, options4) {
|
|
|
63245
63275
|
pathOps.push({
|
|
63246
63276
|
_tag: "parameter",
|
|
63247
63277
|
ast: ps.type,
|
|
63248
|
-
path: ["paths",
|
|
63278
|
+
path: ["paths", path10, method, "parameters", String(op.parameters.length - 1), "schema"]
|
|
63249
63279
|
});
|
|
63250
63280
|
}
|
|
63251
63281
|
}
|
|
@@ -63311,7 +63341,7 @@ function makeOpenApi(api2, options4) {
|
|
|
63311
63341
|
pathOps.push({
|
|
63312
63342
|
_tag: "schema",
|
|
63313
63343
|
ast: toEncodingAST(ast, encoding._tag),
|
|
63314
|
-
path: ["paths",
|
|
63344
|
+
path: ["paths", path10, method, "requestBody", "content", contentType, "schema"]
|
|
63315
63345
|
});
|
|
63316
63346
|
assignProperty(content, contentType, {
|
|
63317
63347
|
schema: {}
|
|
@@ -63340,9 +63370,9 @@ function makeOpenApi(api2, options4) {
|
|
|
63340
63370
|
processAnnotation(endpoint2.annotations, Transform, (transformFn) => {
|
|
63341
63371
|
op = transformFn(op);
|
|
63342
63372
|
});
|
|
63343
|
-
const pathOperation = `${method} ${
|
|
63373
|
+
const pathOperation = `${method} ${path10.replace(/\{[^}]+\}/g, "{}")}`;
|
|
63344
63374
|
if (pathOperations.has(pathOperation)) {
|
|
63345
|
-
throw new globalThis.Error(`Duplicate OpenAPI operation for ${endpoint2.method} ${
|
|
63375
|
+
throw new globalThis.Error(`Duplicate OpenAPI operation for ${endpoint2.method} ${path10}`);
|
|
63346
63376
|
}
|
|
63347
63377
|
const operationId = op.operationId;
|
|
63348
63378
|
if (operationId !== void 0) {
|
|
@@ -63352,10 +63382,10 @@ function makeOpenApi(api2, options4) {
|
|
|
63352
63382
|
operationIds.add(operationId);
|
|
63353
63383
|
}
|
|
63354
63384
|
pathOperations.add(pathOperation);
|
|
63355
|
-
if (!Object.hasOwn(spec.paths,
|
|
63356
|
-
assignProperty(spec.paths,
|
|
63385
|
+
if (!Object.hasOwn(spec.paths, path10)) {
|
|
63386
|
+
assignProperty(spec.paths, path10, {});
|
|
63357
63387
|
}
|
|
63358
|
-
spec.paths[
|
|
63388
|
+
spec.paths[path10][method] = op;
|
|
63359
63389
|
}
|
|
63360
63390
|
});
|
|
63361
63391
|
processAnnotation(api2.annotations, AdditionalSchemas, (componentSchemas) => {
|
|
@@ -63374,8 +63404,8 @@ function makeOpenApi(api2, options4) {
|
|
|
63374
63404
|
}
|
|
63375
63405
|
});
|
|
63376
63406
|
});
|
|
63377
|
-
function escapePath(
|
|
63378
|
-
return "/" +
|
|
63407
|
+
function escapePath(path10) {
|
|
63408
|
+
return "/" + path10.map(escapeToken).join("/");
|
|
63379
63409
|
}
|
|
63380
63410
|
if (isArrayNonEmpty2(pathOps)) {
|
|
63381
63411
|
const jsonSchemaMultiDocument = toMultiDocumentOpenApi3_1(toJsonSchemaMultiDocument(toRepresentations(map4(pathOps, (op) => toCodecJsonAST(op.ast)), options4)));
|
|
@@ -63780,10 +63810,10 @@ var urlBuilder = (api2, options4) => {
|
|
|
63780
63810
|
const encodeQuery = endpoint2.query === void 0 ? void 0 : encodeSync2(endpoint2.query);
|
|
63781
63811
|
const endpointBuilder = (request5) => {
|
|
63782
63812
|
const params = request5?.params;
|
|
63783
|
-
const
|
|
63813
|
+
const path10 = params === void 0 ? endpoint2.path : makeUrl(encodeParams === void 0 ? params : encodeParams(params));
|
|
63784
63814
|
const queryInput = request5?.query === void 0 ? void 0 : encodeQuery === void 0 ? request5.query : encodeQuery(request5.query);
|
|
63785
63815
|
const query = queryInput === void 0 ? "" : toString2(fromInput3(queryInput));
|
|
63786
|
-
const url2 = query === "" ?
|
|
63816
|
+
const url2 = query === "" ? path10 : `${path10}?${query}`;
|
|
63787
63817
|
return options4?.baseUrl === void 0 ? url2 : new URL(url2, options4.baseUrl.toString()).toString();
|
|
63788
63818
|
};
|
|
63789
63819
|
assignProperty(group3.topLevel ? builder : builder[group3.identifier], endpoint2.identifier, endpointBuilder);
|
|
@@ -63792,14 +63822,14 @@ var urlBuilder = (api2, options4) => {
|
|
|
63792
63822
|
return builder;
|
|
63793
63823
|
};
|
|
63794
63824
|
var paramsRegExp = /(\/?):(\w+)(\?)?/g;
|
|
63795
|
-
var compilePath = (
|
|
63796
|
-
if (!paramsRegExp.test(
|
|
63797
|
-
return (_) =>
|
|
63825
|
+
var compilePath = (path10) => {
|
|
63826
|
+
if (!paramsRegExp.test(path10)) {
|
|
63827
|
+
return (_) => path10;
|
|
63798
63828
|
}
|
|
63799
63829
|
paramsRegExp.lastIndex = 0;
|
|
63800
63830
|
return (params) => {
|
|
63801
63831
|
paramsRegExp.lastIndex = 0;
|
|
63802
|
-
return
|
|
63832
|
+
return path10.replace(paramsRegExp, (_, slash, key, optional6) => {
|
|
63803
63833
|
const value3 = params[key];
|
|
63804
63834
|
if (value3 === void 0) {
|
|
63805
63835
|
if (optional6 !== void 0) {
|
|
@@ -64529,19 +64559,27 @@ var endpointFields = {
|
|
|
64529
64559
|
}),
|
|
64530
64560
|
/** 不透明稳定的操作 key,如 /v5/person/enrich。 */
|
|
64531
64561
|
endpoint: EndpointKey,
|
|
64532
|
-
endpoint_version: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
64562
|
+
endpoint_version: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)).annotate({
|
|
64563
|
+
description: "Supported Endpoint version. Compatible updates keep this version."
|
|
64564
|
+
}),
|
|
64533
64565
|
/** 人写的名字与描述 —— 检索质量靠它们,不靠 Provider 文档原文(design §5)。 */
|
|
64534
64566
|
name: Schema_exports.String,
|
|
64535
64567
|
description: Schema_exports.String,
|
|
64536
64568
|
tags: Schema_exports.Array(Schema_exports.String),
|
|
64537
|
-
price: Price
|
|
64569
|
+
price: Price.annotate({
|
|
64570
|
+
description: "Current Price and charging rules. Price can change without an Endpoint version change. New Runs use the Price at admission; accepted Runs keep that Price."
|
|
64571
|
+
}),
|
|
64538
64572
|
run_mode: RunMode,
|
|
64539
64573
|
/**
|
|
64540
64574
|
* 从请求到终态响应的**外部**上限。只有 sync Endpoint 有:async 的 Run 同样
|
|
64541
64575
|
* 有界(QUEUED 的执行 deadline),但没有任何数字能界定一次**同步 HTTP 响应**
|
|
64542
64576
|
* —— 那正是这个字段承诺的东西。缺席表示不适用,不是默认值。
|
|
64543
64577
|
*/
|
|
64544
|
-
timeout_ms: Schema_exports.optional(
|
|
64578
|
+
timeout_ms: Schema_exports.optional(
|
|
64579
|
+
Schema_exports.Int.check(Schema_exports.isGreaterThan(0)).annotate({
|
|
64580
|
+
description: "For sync Endpoints, the maximum time in milliseconds from a Run request to its terminal response. Set your HTTP client timeout above this value."
|
|
64581
|
+
})
|
|
64582
|
+
)
|
|
64545
64583
|
};
|
|
64546
64584
|
var runModePairing = Schema_exports.makeFilter(
|
|
64547
64585
|
(value3) => {
|
|
@@ -64576,11 +64614,21 @@ var EndpointDetail = Schema_exports.Struct({
|
|
|
64576
64614
|
// 在决定跑不跑之前必经的一跳,所以升级信号挂在这里最省事。
|
|
64577
64615
|
...clientUpgradeNoticeField,
|
|
64578
64616
|
method: HttpMethod,
|
|
64579
|
-
input_schema: Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown)
|
|
64580
|
-
|
|
64581
|
-
|
|
64582
|
-
|
|
64583
|
-
|
|
64617
|
+
input_schema: Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown).annotate({
|
|
64618
|
+
description: "Provider-native JSON Schema for Run input."
|
|
64619
|
+
}),
|
|
64620
|
+
output_schema: Schema_exports.NullOr(Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown)).annotate({
|
|
64621
|
+
description: "JSON Schema for successful output. Null when no reliable schema is available; sample responses do not define a schema."
|
|
64622
|
+
}),
|
|
64623
|
+
output_schema_source: Schema_exports.NullOr(Schema_exports.Literals(["provider", "glasser"])).annotate({
|
|
64624
|
+
description: "Who defines the output schema: the Provider or Glasser. Null when output_schema is null."
|
|
64625
|
+
}),
|
|
64626
|
+
sample_input: Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown).annotate({
|
|
64627
|
+
description: "Example input. Adjust it to your request and validate it against input_schema."
|
|
64628
|
+
}),
|
|
64629
|
+
doc_url: Schema_exports.NullOr(Schema_exports.String).annotate({
|
|
64630
|
+
description: "Link to the Provider's documentation, when available."
|
|
64631
|
+
})
|
|
64584
64632
|
}).check(runModePairing).check(outputSchemaPairing);
|
|
64585
64633
|
var SEARCH_PAGE_DEFAULT = 5;
|
|
64586
64634
|
var SEARCH_PAGE_MAX = 20;
|
|
@@ -64596,12 +64644,22 @@ var InspectTaskIdField = optionalRequestField(
|
|
|
64596
64644
|
);
|
|
64597
64645
|
var SearchEndpointsRequest = Schema_exports.Struct({
|
|
64598
64646
|
/** 关键词。缺省或空串返回全部(仍受 Policy 裁剪)。 */
|
|
64599
|
-
query: optionalRequestField(
|
|
64647
|
+
query: optionalRequestField(
|
|
64648
|
+
Schema_exports.String.annotate({
|
|
64649
|
+
description: "Keywords that describe the data you need. Omit or leave empty to browse all Endpoints allowed by your Key's Policy."
|
|
64650
|
+
})
|
|
64651
|
+
),
|
|
64600
64652
|
limit: optionalRequestField(
|
|
64601
|
-
Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maximum: SEARCH_PAGE_MAX }))
|
|
64653
|
+
Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maximum: SEARCH_PAGE_MAX })).annotate({
|
|
64654
|
+
description: `Maximum results per page. Default: ${SEARCH_PAGE_DEFAULT}; maximum: ${SEARCH_PAGE_MAX}.`
|
|
64655
|
+
})
|
|
64602
64656
|
),
|
|
64603
64657
|
/** 上一页响应的 next_cursor。绑定于 query:拿别的查询的游标来翻是 400,不是从头开始。 */
|
|
64604
|
-
cursor: optionalRequestField(
|
|
64658
|
+
cursor: optionalRequestField(
|
|
64659
|
+
Schema_exports.String.annotate({
|
|
64660
|
+
description: "The next_cursor from the previous response. Use the same query; a cursor from a different query returns 400."
|
|
64661
|
+
})
|
|
64662
|
+
),
|
|
64605
64663
|
task_id: SearchTaskIdField,
|
|
64606
64664
|
/** 调用方自己的键值(ADR-0028)。不参与检索,只落进 catalog_searches.metadata。 */
|
|
64607
64665
|
metadata: Schema_exports.optional(MetadataInput),
|
|
@@ -64673,9 +64731,13 @@ var SearchHit = Schema_exports.Struct({
|
|
|
64673
64731
|
})
|
|
64674
64732
|
}).check(runModePairing);
|
|
64675
64733
|
var SearchEndpointsResponse = Schema_exports.Struct({
|
|
64676
|
-
data: Schema_exports.Array(SearchHit)
|
|
64734
|
+
data: Schema_exports.Array(SearchHit).annotate({
|
|
64735
|
+
description: "Endpoint summaries ranked by relevance and filtered by your Key's Policy. Price does not affect ranking."
|
|
64736
|
+
}),
|
|
64677
64737
|
...clientUpgradeNoticeField,
|
|
64678
|
-
next_cursor: Schema_exports.NullOr(Schema_exports.String)
|
|
64738
|
+
next_cursor: Schema_exports.NullOr(Schema_exports.String).annotate({
|
|
64739
|
+
description: "Pass this value as cursor to get the next page. Null means there are no more pages."
|
|
64740
|
+
}),
|
|
64679
64741
|
total: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0)).annotate({
|
|
64680
64742
|
description: "Total number of ranked candidates across all pages."
|
|
64681
64743
|
}),
|
|
@@ -64695,7 +64757,7 @@ var InspectEndpointRequest = Schema_exports.Struct({
|
|
|
64695
64757
|
endpoint: EndpointKey,
|
|
64696
64758
|
endpoint_version: optionalRequestField(
|
|
64697
64759
|
Schema_exports.Int.check(Schema_exports.isGreaterThan(0)).annotate({
|
|
64698
|
-
description: "Select a supported Endpoint version, or omit for the default.
|
|
64760
|
+
description: "Select a supported Endpoint version, including an older one, or omit for the default. Unavailable or retired versions return 409."
|
|
64699
64761
|
})
|
|
64700
64762
|
),
|
|
64701
64763
|
task_id: InspectTaskIdField,
|
|
@@ -64724,7 +64786,9 @@ var RunFailure = Schema_exports.Struct({
|
|
|
64724
64786
|
message: Schema_exports.String
|
|
64725
64787
|
});
|
|
64726
64788
|
var ProviderOutcome = Schema_exports.Struct({
|
|
64727
|
-
http_status: Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 }))
|
|
64789
|
+
http_status: Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 })).annotate({
|
|
64790
|
+
description: "HTTP status returned by the Provider. Check this even when the Run is COMPLETED."
|
|
64791
|
+
})
|
|
64728
64792
|
});
|
|
64729
64793
|
var ProviderResponse = Schema_exports.Struct({
|
|
64730
64794
|
...ProviderOutcome.fields,
|
|
@@ -64749,13 +64813,19 @@ var Run = Schema_exports.Struct({
|
|
|
64749
64813
|
* 像报告末尾的一条脚注;也是这笔付费数据的备份所在。只有 Workspace 成员
|
|
64750
64814
|
* 打得开;里面的 Records 永远不公开。
|
|
64751
64815
|
*/
|
|
64752
|
-
run_url: Schema_exports.String
|
|
64816
|
+
run_url: Schema_exports.String.annotate({
|
|
64817
|
+
description: "Open this Run in the console. Requires Workspace membership."
|
|
64818
|
+
}),
|
|
64753
64819
|
provider: ProviderSlug,
|
|
64754
64820
|
endpoint: EndpointKey,
|
|
64755
64821
|
endpoint_version: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
64756
|
-
status: RunStatus
|
|
64822
|
+
status: RunStatus.annotate({
|
|
64823
|
+
description: "QUEUED or RUNNING: still in progress. COMPLETED: a Provider response is available, including non-2xx responses. FAILED: read failure. STOPPED: stopped before dispatch. Read charge_usd separately from status."
|
|
64824
|
+
}),
|
|
64757
64825
|
/** 仅 FAILED 非 null。 */
|
|
64758
|
-
failure: Schema_exports.NullOr(RunFailure)
|
|
64826
|
+
failure: Schema_exports.NullOr(RunFailure).annotate({
|
|
64827
|
+
description: "Why the Run failed. Non-null only when status is FAILED."
|
|
64828
|
+
}),
|
|
64759
64829
|
input: Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown),
|
|
64760
64830
|
/**
|
|
64761
64831
|
* Provider 的 2xx body,经结构保持的净化(只删敏感字段,不重排业务数据)。
|
|
@@ -64764,14 +64834,24 @@ var Run = Schema_exports.Struct({
|
|
|
64764
64834
|
*/
|
|
64765
64835
|
output: JsonValue,
|
|
64766
64836
|
/** COMPLETED ⇔ 非 null。 */
|
|
64767
|
-
provider_response: Schema_exports.NullOr(ProviderResponse)
|
|
64837
|
+
provider_response: Schema_exports.NullOr(ProviderResponse).annotate({
|
|
64838
|
+
description: "Non-null only when status is COMPLETED.\n\n- For 2xx responses, output contains Provider-native JSON (any shape), or null for an empty body.\n- For non-2xx responses, error contains the Provider's error body and output is null.\n\nSensitive fields are removed from both bodies."
|
|
64839
|
+
}),
|
|
64768
64840
|
/** 实收 Charge(精确 USD 串)。未结算(QUEUED/RUNNING)时为 null,不是 "0.00"。 */
|
|
64769
|
-
charge_usd: Schema_exports.NullOr(UsdAmount)
|
|
64841
|
+
charge_usd: Schema_exports.NullOr(UsdAmount).annotate({
|
|
64842
|
+
description: "Final charge as an exact USD decimal string. Null while QUEUED or RUNNING. A FAILED Run can have a non-zero charge under the Endpoint's Price."
|
|
64843
|
+
}),
|
|
64770
64844
|
/** 产生 charge_usd 的条款。null = 零 Attempt 总则把 Charge 置 0。 */
|
|
64771
|
-
charge_basis: Schema_exports.NullOr(ChargeBasis)
|
|
64845
|
+
charge_basis: Schema_exports.NullOr(ChargeBasis).annotate({
|
|
64846
|
+
description: "Price clause used to calculate the charge. Null before settlement or when no Provider attempt was made."
|
|
64847
|
+
}),
|
|
64772
64848
|
/** stop 请求现在能否被接受。从「派发赢得竞争」这条规则推导,不是从状态猜。 */
|
|
64773
|
-
stoppable: Schema_exports.Boolean
|
|
64774
|
-
|
|
64849
|
+
stoppable: Schema_exports.Boolean.annotate({
|
|
64850
|
+
description: "Whether a stop request can currently be accepted. This does not guarantee that the Run can stop before dispatch."
|
|
64851
|
+
}),
|
|
64852
|
+
stop_requested_at: Schema_exports.NullOr(Timestamp).annotate({
|
|
64853
|
+
description: "When a stop was requested. The Run can still continue if dispatch had already started."
|
|
64854
|
+
}),
|
|
64775
64855
|
created_at: Timestamp,
|
|
64776
64856
|
started_at: Schema_exports.NullOr(Timestamp),
|
|
64777
64857
|
completed_at: Schema_exports.NullOr(Timestamp),
|
|
@@ -64800,11 +64880,15 @@ var RunRequest = Schema_exports.Struct({
|
|
|
64800
64880
|
provider: ProviderSlug,
|
|
64801
64881
|
endpoint: EndpointKey,
|
|
64802
64882
|
/** Provider 原生输入 —— Adapter 只注入凭证与传输,不改字段名。 */
|
|
64803
|
-
input: Schema_exports.optionalKey(
|
|
64883
|
+
input: Schema_exports.optionalKey(
|
|
64884
|
+
Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown).annotate({
|
|
64885
|
+
description: "Provider-native input. Build it from the input_schema returned by Inspect."
|
|
64886
|
+
})
|
|
64887
|
+
),
|
|
64804
64888
|
/** 支持的兼容契约号,不固定 Price;新 Run 按受理时的 Price,已受理 Run 保持原条款。 */
|
|
64805
64889
|
endpoint_version: optionalRequestField(
|
|
64806
64890
|
Schema_exports.Int.check(Schema_exports.isGreaterThan(0)).annotate({
|
|
64807
|
-
description: "Select a supported
|
|
64891
|
+
description: "Select a supported version, or omit for the default. Compatible updates keep the version; unavailable or retired versions return 409. A version does not lock Price: new Runs use the Price at admission, and accepted Runs keep it through settlement."
|
|
64808
64892
|
})
|
|
64809
64893
|
),
|
|
64810
64894
|
/**
|
|
@@ -64887,7 +64971,7 @@ var Limit = Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maxi
|
|
|
64887
64971
|
});
|
|
64888
64972
|
var providerField = (providers) => Schema_exports.optional(
|
|
64889
64973
|
Schema_exports.Literals(["auto", ...providers]).annotate({
|
|
64890
|
-
description:
|
|
64974
|
+
description: "Default auto: select the first eligible Provider in Glasser's preference order. A named Provider must support the request and be allowed by your Key; it does not fall back to another Provider. Available values are listed below."
|
|
64891
64975
|
})
|
|
64892
64976
|
);
|
|
64893
64977
|
var commonFields = {
|
|
@@ -64901,7 +64985,7 @@ var commonFields = {
|
|
|
64901
64985
|
*/
|
|
64902
64986
|
task_id: optionalRequestField(
|
|
64903
64987
|
Schema_exports.String.annotate({
|
|
64904
|
-
description: "
|
|
64988
|
+
description: "Group related Runs, including automatic fallback, under one Task. Reuse a stable string and filter the Runs list by task to retrieve them."
|
|
64905
64989
|
})
|
|
64906
64990
|
),
|
|
64907
64991
|
/**
|
|
@@ -64926,7 +65010,7 @@ var WEB_RESEARCH_PROVIDERS = ["serper", "serpapi", "exa", "dataforseo"];
|
|
|
64926
65010
|
var WebResearchRequest = Schema_exports.Struct({
|
|
64927
65011
|
action: Schema_exports.optional(
|
|
64928
65012
|
Schema_exports.Literals(WEB_RESEARCH_ACTIONS).annotate({
|
|
64929
|
-
description: "Default search
|
|
65013
|
+
description: "Default: search.\n\n- Supply query for search, news, places, scholar, shopping, images, videos, or answer.\n- Supply url for scrape or similar."
|
|
64930
65014
|
})
|
|
64931
65015
|
),
|
|
64932
65016
|
provider: providerField(WEB_RESEARCH_PROVIDERS),
|
|
@@ -64974,7 +65058,7 @@ var COMPANY_INTELLIGENCE_PROVIDERS = [
|
|
|
64974
65058
|
var CompanyIntelligenceRequest = Schema_exports.Struct({
|
|
64975
65059
|
action: Schema_exports.optional(
|
|
64976
65060
|
Schema_exports.Literals(COMPANY_INTELLIGENCE_ACTIONS).annotate({
|
|
64977
|
-
description: "Default enrich. enrich: profile and firmographics
|
|
65061
|
+
description: "Default: enrich. All actions require domain.\n\n- enrich: company profile and firmographics.\n- tech_stack, traffic, funding, news: the corresponding company data.\n- competitors: similar businesses. For competing domains in Google results, use SEO research with organic_competitors."
|
|
64978
65062
|
})
|
|
64979
65063
|
),
|
|
64980
65064
|
provider: providerField(COMPANY_INTELLIGENCE_PROVIDERS),
|
|
@@ -65014,7 +65098,7 @@ var PEOPLE_SEARCH_PROVIDERS = [
|
|
|
65014
65098
|
var PeopleSearchRequest = Schema_exports.Struct({
|
|
65015
65099
|
action: Schema_exports.optional(
|
|
65016
65100
|
Schema_exports.Literals(PEOPLE_SEARCH_ACTIONS).annotate({
|
|
65017
|
-
description: "Default search
|
|
65101
|
+
description: "Default: search.\n\n- search: supply at least one of job_titles, seniorities, locations, company_domain, or keywords.\n- enrich: supply linkedin_url, email, or full_name plus company_domain.\n- find_email: supply full_name and company_domain.\n\nFilters are never silently dropped. With auto, Providers that cannot apply them are skipped; a named Provider that cannot apply them returns 400."
|
|
65018
65102
|
})
|
|
65019
65103
|
),
|
|
65020
65104
|
provider: providerField(PEOPLE_SEARCH_PROVIDERS),
|
|
@@ -65069,7 +65153,7 @@ var SEO_RESEARCH_PROVIDERS = [
|
|
|
65069
65153
|
var SeoResearchRequest = Schema_exports.Struct({
|
|
65070
65154
|
action: Schema_exports.optional(
|
|
65071
65155
|
Schema_exports.Literals(SEO_RESEARCH_ACTIONS).annotate({
|
|
65072
|
-
description: "Default keyword_overview
|
|
65156
|
+
description: "Default: keyword_overview.\n\n- keyword_overview: supply one or more keywords.\n- keyword_ideas or serp: supply exactly one keyword in keywords.\n- All other actions: supply domain. organic_competitors finds domains ranking for the same keywords."
|
|
65073
65157
|
})
|
|
65074
65158
|
),
|
|
65075
65159
|
provider: providerField(SEO_RESEARCH_PROVIDERS),
|
|
@@ -65092,7 +65176,7 @@ var SocialResearchRequest = Schema_exports.Struct({
|
|
|
65092
65176
|
platform: Schema_exports.Literals(SOCIAL_PLATFORMS),
|
|
65093
65177
|
mode: Schema_exports.optional(
|
|
65094
65178
|
Schema_exports.Literals(SOCIAL_MODES).annotate({
|
|
65095
|
-
description: "Default search. search: posts matching query
|
|
65179
|
+
description: "Default: search. Every platform supports each mode.\n\n- search: posts matching query.\n- profile: account details from handle (Reddit: subreddit). For LinkedIn, supply a person or company url.\n- feed: recent posts or videos from handle. For LinkedIn, supply a company url.\n- post: one post or video from url.\n- find: other social profiles from handle. For LinkedIn, supply a person's profile url; for Reddit, supply query to find subreddits."
|
|
65096
65180
|
})
|
|
65097
65181
|
),
|
|
65098
65182
|
provider: providerField(SOCIAL_RESEARCH_PROVIDERS),
|
|
@@ -65119,7 +65203,7 @@ var MARKET_DATA_ACTIONS = [
|
|
|
65119
65203
|
var MARKET_DATA_PROVIDERS = ["rentcast", "serpapi"];
|
|
65120
65204
|
var MarketDataRequest = Schema_exports.Struct({
|
|
65121
65205
|
action: Schema_exports.Literals(MARKET_DATA_ACTIONS).annotate({
|
|
65122
|
-
description: "property_value
|
|
65206
|
+
description: "Choose the data to retrieve:\n\n- property_value or property_rent: supply address.\n- property_search, listings_sale, or listings_rental: supply address, city plus state, or zip.\n- market_stats: supply zip.\n- stock_quote: supply symbol."
|
|
65123
65207
|
}),
|
|
65124
65208
|
provider: providerField(MARKET_DATA_PROVIDERS),
|
|
65125
65209
|
/** 美国街道地址,如 "5500 Grand Lake Dr, San Antonio, TX 78244"。 */
|
|
@@ -65146,7 +65230,7 @@ var RunInFlight = Run.check(
|
|
|
65146
65230
|
).pipe(HttpApiSchema_exports.status(202));
|
|
65147
65231
|
var IdempotencyKeyHeaders = Schema_exports.Struct({
|
|
65148
65232
|
"idempotency-key": Schema_exports.String.check(Schema_exports.isMinLength(1)).annotate({
|
|
65149
|
-
description: "
|
|
65233
|
+
description: "Generate a unique value for each intended execution (a UUID is recommended). Retry with the same key and execution parameters to retrieve the original Run without a second charge. Changing execution parameters with the same key returns 409; changing task_id or metadata does not update the original Run."
|
|
65150
65234
|
})
|
|
65151
65235
|
});
|
|
65152
65236
|
var operation = (id2, summary, description) => OpenApi_exports.annotations({ identifier: id2, summary, description });
|
|
@@ -65159,7 +65243,7 @@ var endpoints = HttpApiGroup_exports.make("Endpoints").add(
|
|
|
65159
65243
|
operation(
|
|
65160
65244
|
"endpoints-search",
|
|
65161
65245
|
"Search runnable endpoints",
|
|
65162
|
-
"
|
|
65246
|
+
"Find runnable Endpoints by keyword; this returns Endpoint candidates, not business data. Results are ranked by relevance, filtered by your Key's Policy, and include Provider, Endpoint version, Price, and run mode. Compare candidates and Inspect before running.\n\nUse next_cursor for more results. Low scores or the last page do not prove that a capability is absent; try different keywords. Reuse the returned task_id for later calls on the same task."
|
|
65163
65247
|
)
|
|
65164
65248
|
)
|
|
65165
65249
|
).add(
|
|
@@ -65170,8 +65254,8 @@ var endpoints = HttpApiGroup_exports.make("Endpoints").add(
|
|
|
65170
65254
|
}).annotateMerge(
|
|
65171
65255
|
operation(
|
|
65172
65256
|
"endpoints-inspect",
|
|
65173
|
-
"Inspect
|
|
65174
|
-
"
|
|
65257
|
+
"Inspect an Endpoint",
|
|
65258
|
+
"Get an Endpoint's input schema, available output schema, Price, example input, version, run mode, and timeout. Inspect before the first Run and use the returned input_schema and endpoint_version.\n\nAn output_schema of null means no reliable schema is available. Endpoint versions do not lock Price: new Runs use the Price at admission. For sync Endpoints, set your HTTP client timeout above timeout_ms."
|
|
65175
65259
|
)
|
|
65176
65260
|
)
|
|
65177
65261
|
);
|
|
@@ -65193,8 +65277,8 @@ var runs = HttpApiGroup_exports.make("Runs").add(
|
|
|
65193
65277
|
}).annotateMerge(
|
|
65194
65278
|
operation(
|
|
65195
65279
|
"runs-create",
|
|
65196
|
-
"Run an
|
|
65197
|
-
"
|
|
65280
|
+
"Run an Endpoint",
|
|
65281
|
+
"Execute an Endpoint with Provider-native input prepared from Inspect. Glasser checks your Key's Policy and reserves the maximum charge before creating a Run. A refusal creates no Run and no charge. Reuse the same Idempotency-Key and execution parameters to retry without a second execution.\n\n- **200:** the Run has finished. Check its status, Provider response, and charge.\n- **202:** an async Run is still in progress. Use Get Run to read its result. Sync Endpoints always return a finished Run within their published timeout_ms.\n\nCOMPLETED can include a Provider error; check provider_response. Status and charge are independent: a FAILED Run can have a charge."
|
|
65198
65282
|
)
|
|
65199
65283
|
)
|
|
65200
65284
|
).add(
|
|
@@ -65205,8 +65289,10 @@ var runs = HttpApiGroup_exports.make("Runs").add(
|
|
|
65205
65289
|
}).annotateMerge(
|
|
65206
65290
|
operation(
|
|
65207
65291
|
"runs-list",
|
|
65208
|
-
"List
|
|
65209
|
-
|
|
65292
|
+
"List Runs",
|
|
65293
|
+
`Review Runs, newest first. Filter by status, Provider, Endpoint, Task, or metadata, and use next_cursor to read the next page. Only Runs permitted by your Key's Policy are visible.
|
|
65294
|
+
|
|
65295
|
+
Each row is a summary: input and output contain {"omitted": true}, and Provider error bodies are excluded. Use Get a Run for the full input, output, and error details.`
|
|
65210
65296
|
)
|
|
65211
65297
|
)
|
|
65212
65298
|
).add(
|
|
@@ -65217,8 +65303,8 @@ var runs = HttpApiGroup_exports.make("Runs").add(
|
|
|
65217
65303
|
}).annotateMerge(
|
|
65218
65304
|
operation(
|
|
65219
65305
|
"runs-get",
|
|
65220
|
-
"Get
|
|
65221
|
-
"
|
|
65306
|
+
"Get a Run",
|
|
65307
|
+
"Read a Run's current status, result, and charge. Use this to check an unfinished Run or retrieve a previous result.\n\nCheck status and provider_response before using output. A COMPLETED Run can include a Provider error; a FAILED Run can still have a charge."
|
|
65222
65308
|
)
|
|
65223
65309
|
)
|
|
65224
65310
|
).add(
|
|
@@ -65229,8 +65315,8 @@ var runs = HttpApiGroup_exports.make("Runs").add(
|
|
|
65229
65315
|
}).annotateMerge(
|
|
65230
65316
|
operation(
|
|
65231
65317
|
"runs-stop",
|
|
65232
|
-
"Stop a
|
|
65233
|
-
|
|
65318
|
+
"Stop a Run",
|
|
65319
|
+
"Request a stop and check the returned status. Accepting the request does not guarantee that execution stopped.\n\n- **Before dispatch:** the Run becomes STOPPED with no charge. An expired sync deadline takes precedence and produces FAILED with TIMED_OUT.\n- **After dispatch:** the Run continues; stop_requested_at records your request. Its Price determines the final charge.\n- **Already finished:** returns 409."
|
|
65234
65320
|
)
|
|
65235
65321
|
)
|
|
65236
65322
|
);
|
|
@@ -65242,7 +65328,7 @@ var solutionRunErrors = [
|
|
|
65242
65328
|
ERROR_WIRE.InsufficientBalance,
|
|
65243
65329
|
ERROR_WIRE.ServiceUnavailable
|
|
65244
65330
|
];
|
|
65245
|
-
var SOLUTION_RUN_TAIL = "
|
|
65331
|
+
var SOLUTION_RUN_TAIL = "\n\nMaps Glasser fields to a Provider Endpoint and returns a Run with Provider-native output.\n- provider=auto selects the first eligible Provider and tries the next only on PROVIDER_ERROR, TIMED_OUT, or a 503 at admission. No-result and in-flight Runs do not trigger fallback. A named Provider never falls back.\n- Each admitted fallback creates a separate Run with its own charge; the response contains the last Run. Use task_id to find related Runs.\n- Reuse the same Idempotency-Key and execution parameters when retrying. For a QUEUED or RUNNING result, poll Get Run. Check status, provider_response, and charge_usd independently.";
|
|
65246
65332
|
var solutions = HttpApiGroup_exports.make("Solutions").add(
|
|
65247
65333
|
HttpApiEndpoint_exports.post("gtm-web-research", "/v1/solutions/gtm/web_research", {
|
|
65248
65334
|
payload: WebResearchRequest,
|
|
@@ -65253,7 +65339,7 @@ var solutions = HttpApiGroup_exports.make("Solutions").add(
|
|
|
65253
65339
|
operation(
|
|
65254
65340
|
"gtm-web-research",
|
|
65255
65341
|
"Web research",
|
|
65256
|
-
`Search the web, news and
|
|
65342
|
+
`Search the web, news, places, and other public content, retrieve a page, or get an answer with sources. Choose an action and supply a query or URL as described below.${SOLUTION_RUN_TAIL}`
|
|
65257
65343
|
)
|
|
65258
65344
|
)
|
|
65259
65345
|
).add(
|
|
@@ -65266,7 +65352,7 @@ var solutions = HttpApiGroup_exports.make("Solutions").add(
|
|
|
65266
65352
|
operation(
|
|
65267
65353
|
"gtm-company-intelligence",
|
|
65268
65354
|
"Company intelligence",
|
|
65269
|
-
`
|
|
65355
|
+
`Look up a company by domain. Get its profile, technology, traffic, competitors, funding, or news. Omit action for a company profile.${SOLUTION_RUN_TAIL}`
|
|
65270
65356
|
)
|
|
65271
65357
|
)
|
|
65272
65358
|
).add(
|
|
@@ -65278,8 +65364,8 @@ var solutions = HttpApiGroup_exports.make("Solutions").add(
|
|
|
65278
65364
|
}).annotateMerge(
|
|
65279
65365
|
operation(
|
|
65280
65366
|
"gtm-people-search",
|
|
65281
|
-
"
|
|
65282
|
-
`Find
|
|
65367
|
+
"People search",
|
|
65368
|
+
`Find people by job title, seniority, location, or employer. You can also enrich a known person's profile or find their work email. Choose an action and supply its required fields below.${SOLUTION_RUN_TAIL}`
|
|
65283
65369
|
)
|
|
65284
65370
|
)
|
|
65285
65371
|
).add(
|
|
@@ -65291,8 +65377,8 @@ var solutions = HttpApiGroup_exports.make("Solutions").add(
|
|
|
65291
65377
|
}).annotateMerge(
|
|
65292
65378
|
operation(
|
|
65293
65379
|
"gtm-seo-research",
|
|
65294
|
-
"
|
|
65295
|
-
`
|
|
65380
|
+
"SEO research",
|
|
65381
|
+
`Research keyword volume and difficulty, search rankings, and backlinks. Choose an action and supply keywords or a domain.${SOLUTION_RUN_TAIL}`
|
|
65296
65382
|
)
|
|
65297
65383
|
)
|
|
65298
65384
|
).add(
|
|
@@ -65304,8 +65390,8 @@ var solutions = HttpApiGroup_exports.make("Solutions").add(
|
|
|
65304
65390
|
}).annotateMerge(
|
|
65305
65391
|
operation(
|
|
65306
65392
|
"gtm-social-research",
|
|
65307
|
-
"Social
|
|
65308
|
-
`Search
|
|
65393
|
+
"Social research",
|
|
65394
|
+
`Search social content or retrieve profiles and posts. Choose a platform and mode, then supply a query, handle, or URL. This Capability only reads data; it does not publish or change content.${SOLUTION_RUN_TAIL}`
|
|
65309
65395
|
)
|
|
65310
65396
|
)
|
|
65311
65397
|
).add(
|
|
@@ -65318,7 +65404,7 @@ var solutions = HttpApiGroup_exports.make("Solutions").add(
|
|
|
65318
65404
|
operation(
|
|
65319
65405
|
"gtm-market-data",
|
|
65320
65406
|
"Market data",
|
|
65321
|
-
`US property
|
|
65407
|
+
`Get US property records, value and rent estimates, listings, or local market statistics. You can also request stock quotes. Choose an action and supply a location or stock symbol.${SOLUTION_RUN_TAIL}`
|
|
65322
65408
|
)
|
|
65323
65409
|
)
|
|
65324
65410
|
);
|
|
@@ -65328,8 +65414,8 @@ var balance = HttpApiGroup_exports.make("Balance").add(
|
|
|
65328
65414
|
}).annotateMerge(
|
|
65329
65415
|
operation(
|
|
65330
65416
|
"balance",
|
|
65331
|
-
"Get balance
|
|
65332
|
-
"
|
|
65417
|
+
"Get balance",
|
|
65418
|
+
"Check your Workspace's funds and how much is available for new Runs. This free request also confirms that your Key works."
|
|
65333
65419
|
)
|
|
65334
65420
|
)
|
|
65335
65421
|
).add(
|
|
@@ -65340,8 +65426,8 @@ var balance = HttpApiGroup_exports.make("Balance").add(
|
|
|
65340
65426
|
}).annotateMerge(
|
|
65341
65427
|
operation(
|
|
65342
65428
|
"balance-history",
|
|
65343
|
-
"List
|
|
65344
|
-
"
|
|
65429
|
+
"List balance history",
|
|
65430
|
+
"Review charges, refunds, top-ups, Grants, and adjustments, newest first. Each entry shows the amount and the balance after it. Filter by kind and use next_cursor to read the next page."
|
|
65345
65431
|
)
|
|
65346
65432
|
)
|
|
65347
65433
|
);
|
|
@@ -66219,6 +66305,42 @@ function openInBrowser(url2) {
|
|
|
66219
66305
|
}
|
|
66220
66306
|
}
|
|
66221
66307
|
|
|
66308
|
+
// src/channel-store.ts
|
|
66309
|
+
import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, renameSync as renameSync2, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
66310
|
+
import path7 from "node:path";
|
|
66311
|
+
var FILE = "channel.json";
|
|
66312
|
+
function readChannel(dir2) {
|
|
66313
|
+
try {
|
|
66314
|
+
const raw2 = JSON.parse(readFileSync2(path7.join(dir2, FILE), "utf8"));
|
|
66315
|
+
if (typeof raw2 !== "object" || raw2 === null) return void 0;
|
|
66316
|
+
const { utm_source, utm_medium } = raw2;
|
|
66317
|
+
if (typeof utm_source !== "string" || utm_source === "") return void 0;
|
|
66318
|
+
return typeof utm_medium === "string" && utm_medium !== "" ? { utm_source, utm_medium } : { utm_source };
|
|
66319
|
+
} catch {
|
|
66320
|
+
return void 0;
|
|
66321
|
+
}
|
|
66322
|
+
}
|
|
66323
|
+
function writeChannel(dir2, channel) {
|
|
66324
|
+
if (channel.utm_source === void 0) return;
|
|
66325
|
+
const file5 = path7.join(dir2, FILE);
|
|
66326
|
+
const tmp = `${file5}.tmp-${process.pid}`;
|
|
66327
|
+
try {
|
|
66328
|
+
mkdirSync2(dir2, { recursive: true, mode: 448 });
|
|
66329
|
+
writeFileSync2(tmp, `${JSON.stringify(channel)}
|
|
66330
|
+
`);
|
|
66331
|
+
renameSync2(tmp, file5);
|
|
66332
|
+
} catch {
|
|
66333
|
+
} finally {
|
|
66334
|
+
rmSync2(tmp, { force: true });
|
|
66335
|
+
}
|
|
66336
|
+
}
|
|
66337
|
+
function channelHeader(channel) {
|
|
66338
|
+
if (channel?.utm_source === void 0) return void 0;
|
|
66339
|
+
return new URLSearchParams(
|
|
66340
|
+
channel.utm_medium === void 0 ? { utm_source: channel.utm_source } : { utm_source: channel.utm_source, utm_medium: channel.utm_medium }
|
|
66341
|
+
).toString();
|
|
66342
|
+
}
|
|
66343
|
+
|
|
66222
66344
|
// src/login-flow.ts
|
|
66223
66345
|
var REPLAY_GRACE_SECONDS = 30;
|
|
66224
66346
|
var CreateResponse = Schema_exports.Struct({
|
|
@@ -66380,7 +66502,8 @@ var login = Command_exports.make(
|
|
|
66380
66502
|
}
|
|
66381
66503
|
const baseUrl2 = yield* apiBaseUrl;
|
|
66382
66504
|
const created = yield* createAuthorization(baseUrl2);
|
|
66383
|
-
const
|
|
66505
|
+
const campaign = yield* loginCampaignFromEnv;
|
|
66506
|
+
const verificationUri = withCampaign(created.verification_uri, campaign);
|
|
66384
66507
|
yield* Console_exports.error(
|
|
66385
66508
|
`First, confirm this code matches the browser:
|
|
66386
66509
|
|
|
@@ -66413,6 +66536,7 @@ Save it now (shown once): ${outcome.key.token}
|
|
|
66413
66536
|
Store it with \`glasser keys add\`, or revoke '${sanitizeText(outcome.key.name)}' in the console.`
|
|
66414
66537
|
})
|
|
66415
66538
|
});
|
|
66539
|
+
if (campaign !== void 0) writeChannel(dir2, campaign);
|
|
66416
66540
|
yield* Console_exports.log(
|
|
66417
66541
|
`Key saved as '${installed.label}' (${outcome.key.token_prefix}****) and activated for workspace ${workspaceSlug} (${workspaceName}).`
|
|
66418
66542
|
);
|
|
@@ -66440,7 +66564,7 @@ ${kvBlock([
|
|
|
66440
66564
|
).pipe(Command_exports.withDescription("Log in through the browser and store a Key"));
|
|
66441
66565
|
|
|
66442
66566
|
// src/input.ts
|
|
66443
|
-
import { readFileSync as
|
|
66567
|
+
import { readFileSync as readFileSync3 } from "node:fs";
|
|
66444
66568
|
function parseRunInput(raw2) {
|
|
66445
66569
|
const text3 = raw2.startsWith("@") ? readInputFile(raw2.slice(1)) : raw2;
|
|
66446
66570
|
let parsed;
|
|
@@ -66454,11 +66578,11 @@ function parseRunInput(raw2) {
|
|
|
66454
66578
|
}
|
|
66455
66579
|
return parsed;
|
|
66456
66580
|
}
|
|
66457
|
-
function readInputFile(
|
|
66581
|
+
function readInputFile(path10) {
|
|
66458
66582
|
try {
|
|
66459
|
-
return
|
|
66583
|
+
return readFileSync3(path10, "utf8");
|
|
66460
66584
|
} catch (error2) {
|
|
66461
|
-
throw new Error(`Cannot read input file ${
|
|
66585
|
+
throw new Error(`Cannot read input file ${path10}: ${error2.message}`);
|
|
66462
66586
|
}
|
|
66463
66587
|
}
|
|
66464
66588
|
|
|
@@ -66487,7 +66611,7 @@ function waitForTerminal(getRun2, options4) {
|
|
|
66487
66611
|
}
|
|
66488
66612
|
|
|
66489
66613
|
// src/commands/run-shared.ts
|
|
66490
|
-
import { writeFileSync as
|
|
66614
|
+
import { writeFileSync as writeFileSync3 } from "node:fs";
|
|
66491
66615
|
|
|
66492
66616
|
// src/render/run.ts
|
|
66493
66617
|
function renderRun(run7) {
|
|
@@ -66582,7 +66706,7 @@ function presentRun(run7, options4) {
|
|
|
66582
66706
|
}
|
|
66583
66707
|
} else {
|
|
66584
66708
|
yield* Effect_exports.try({
|
|
66585
|
-
try: () =>
|
|
66709
|
+
try: () => writeFileSync3(target, body),
|
|
66586
66710
|
catch: (error2) => new LocalIoError({ message: `Cannot write ${target}: ${error2.message}` })
|
|
66587
66711
|
});
|
|
66588
66712
|
if (!options4.json) yield* Console_exports.error(`Output saved to ${target}`);
|
|
@@ -66819,58 +66943,58 @@ var runs2 = Command_exports.make("runs").pipe(
|
|
|
66819
66943
|
import os3 from "node:os";
|
|
66820
66944
|
|
|
66821
66945
|
// src/skill.ts
|
|
66822
|
-
import { existsSync as existsSync2, mkdirSync as
|
|
66946
|
+
import { existsSync as existsSync2, mkdirSync as mkdirSync3, writeFileSync as writeFileSync4 } from "node:fs";
|
|
66823
66947
|
import os2 from "node:os";
|
|
66824
|
-
import
|
|
66825
|
-
var SKILL_MARKDOWN = true ? "---\nname: glasser\nversion: 0.1.74\ndescription: >\n Reach for this when a task needs external or paid data \u2014 person or company\n enrichment, person/company search, web, news, image, video, maps, places,\n scholar or shopping search, US property and rental data, SEC filings,\n company financials and stock prices, webpage scraping, lead lookup, or any\n other paid data API \u2014 and check the data sources before writing a scraper or\n telling the user something is inaccessible. 1,500+ paid,\n high-quality endpoints across many providers behind one Key: search, inspect\n the price, run, pay per call, no signup at each vendor. Works through the\n glasser CLI, or through the Glasser MCP server where the runtime cannot\n shell out. If the user already has their own key or integration for a\n specific provider, use that first.\n---\n\n# Glasser\n\nGlasser is a broker: it sells runnable third-party API operations\n(\"Endpoints\") under a single Key. You search the data sources, inspect an\nEndpoint's contract and Price, and run it \u2014 the response is the provider's\nown output, nothing renamed or reshaped.\n\n## Identify your surface FIRST\n\nDecide by the actual execution environment, not the product name and not\nwhether a terminal exists. The wrong setup cannot work.\n\n- **`glasser` MCP tools already loaded** (`search`, `inspect`, `run`,\n `runs_get`, `runs_list`, `runs_stop`, `balance`): nothing to install. The\n verbs map one to one onto the CLI commands below; only `run` differs, in\n that it needs an `idempotency_key` you generate (a UUID). Call `balance`;\n if it succeeds, skip to **First run**. The rules in this file apply either\n way.\n\n- **Hosted assistant** (claude.ai, Claude Desktop chat, Cowork, ChatGPT,\n Gemini \u2014 even with a code sandbox: it runs in the provider's cloud, not on\n the human's machine, and resets between tasks): do NOT install anything.\n Tell the human to add Glasser as a custom MCP connector, then stop. In\n Claude, give them this link; it opens the Add custom connector dialog\n with the name and URL filled in:\n https://api.glasser.ai/connect/claude\n Then Continue \u2192 Add \u2192 sign in to Glasser, choose the Workspace, Allow.\n Glasser is on in the next chat. Other products: the server URL is\n `https://api.glasser.ai/mcp`; steps per client at\n https://glasser.ai/docs/mcp-server.md. If the product has no custom\n connectors, say so and point to the same account's coding agent\n (ChatGPT \u2192 Codex, Gemini \u2192 Gemini CLI, Claude \u2192 Claude Code).\n\n- **Local coding agent** (Claude Code, Codex, Cursor, Copilot, Gemini CLI,\n OpenClaw, Hermes on the user's machine): the human authorized the whole\n flow by pasting this. If your runtime asks permission for shell commands,\n request it ONCE and work straight through. Continue to **Setup**.\n\n- **Sandboxed agent** (cloud container, restricted egress): run\n `curl -sI https://api.glasser.ai/health` first. A proxy 403, DNS failure\n or timeout means an egress allowlist. Do not retry, do not try other\n hosts. Tell the human `api.glasser.ai` is blocked by the environment's\n network policy, offer the MCP connector or an allowlist for `glasser.ai`\n and `api.glasser.ai` on 443, then stop.\n\nNever ask the human to paste a Key into chat.\n\n## Setup\n\n```sh\nglasser --version 2>/dev/null || npm install -g @glasser-ai/cli@latest\n```\n\nOne command when the CLI is missing, and it installs the current version.\nWithout npm, `curl -fsSL https://glasser.ai/install.sh | sh` does the same\njob. A fresh install selects the latest version, so no separate registry\nversion check is needed. The installer reports what it needs and where it\nwrote the binary \u2014 read its output rather than guessing. If the CLI was\nalready installed, the server tells you when to upgrade (see **Upgrading**).\n\nFor agents with persistent skills, run `glasser skill install`. It saves\nthis file for every coding agent it finds (Claude Code, Codex, Cursor, Gemini\nCLI, Copilot and others), so future sessions load it; the installer already\nran it. For any other agent, save the complete file from\nhttps://glasser.ai/SKILL.md in your user-level skill directory and enable it\nfor future sessions. Do this only during setup or CLI upgrades.\n\n## Authentication\n\nRun `glasser balance`. Exit 0 means authentication works; continue to\n**First run**. A missing or rejected Key needs one. Handle other failures\nfrom the error message instead of starting another login.\n\n**Where a Key comes from.** Two sources, and the environment takes precedence\nover the local store. `GLASSER_API_KEY` needs no file on disk, so it is what\nCI, scripts and scheduled jobs use, and it is the source that still works on a\nmachine whose own store will not outlive the session \u2014 a cloud session, a\ncontainer. Mint that Key in the console. The local store is what `glasser\nlogin` writes and what `glasser keys add --label <l> --key <k>` fills by hand;\nit lives on the machine the CLI ran on, and lasts as long as that machine does.\n\n**With a user present**, in this order:\n\n1. Run `glasser login` with your shell tool's background execution support.\n The CLI opens the sign-in page when possible and prints a fallback URL and\n a matching code.\n2. Relay that URL and code exactly as printed \u2014 a plain URL, readable in a\n terminal \u2014 with a brief explanation of the next step. Nothing else starts\n until this message is out.\n3. Wait for that same command to finish, using the shell tool's wait or output\n operation with short waits. A pending result means wait again, not return\n a final reply. Browser approval needs no further chat message. Give brief\n progress updates during the wait; the CLI polls for up to 15 minutes.\n Stop waiting when login succeeds, fails, expires, or the user cancels.\n\nOnce login succeeds, use the available balance in its output and continue to\n**First run**, unless login warns that `GLASSER_API_KEY` overrides the saved\nKey or the summary has no available balance. In either case, run\n`glasser balance` in the environment subsequent commands will use. Login's\nsummary uses the new Key directly; it does not verify an environment Key.\n\nIf that check rejects an environment Key, another login will not fix it.\nPreserve runtime-managed authentication: changing the variable or bypassing\nit for a command needs the user's authorization. When the user requires it\nto stay unchanged, report the blocker and the runtime correction needed.\nFor other failures, report the actual error; a network failure does not show\nthat a Key is invalid. If authorization expires, a new login needs a new\nURL and code relayed before waiting again.\nNever ask the user to paste a Key. `glasser login --json` is a usage error by\ndesign \u2014 that flow needs a human.\n\n## First run\n\nSetup is finished when login succeeds and reports the available balance\nwithout an environment Key override, or `glasser balance` exits 0 in the\nenvironment subsequent commands will use \u2014 with the MCP tools, when\n`balance` succeeds.\nIf setup is blocked, give a brief status, the confirmed cause, and the next\nstep needed to resolve it. You may state which steps succeeded, but do not\nclaim readiness or offer task prompts while authentication is blocked.\nLogin's balance is not usable evidence for commands that use a rejected Key.\n\nOnce setup is finished, if the user already gave you a task, continue it.\nFor a setup-only request, reply briefly in the user's language: confirm\nGlasser is ready, report the available balance from login or the balance\ncheck, then offer three ready-to-send task prompts, one per bullet.\nUse a conversational lead-in that explains how the suggestions can help\nthe user, rather than a generic list heading. Connect it to their goals\nwhen known, or briefly describe what they could accomplish with Glasser.\n\nBase the prompts on the user's project, interests or goals when that context\nis available. Otherwise, choose three varied examples from Glasser's\ncapabilities. Give each prompt a concrete subject and a clear result the\nuser can ask for.\n\nFor both completed and blocked setup, omit Workspace names/slugs, Key\nlabels/values/prefixes, and installation details such as versions, paths or\npackage-manager output. Name a configuration variable when it explains the\nblocker. Report useful status, not a transcript of the setup commands.\nSetup is not approval to spend: wait for the user to choose before starting\na paid Run.\n\n## Upgrading\n\nThe server tells you when to upgrade \u2014 you do not have to compare versions\nby hand. Upgrade when any of these appears:\n\n- a response carries a `client` block. It is present only when this CLI is\n behind, and it says everything needed to act: `client_version`,\n `minimum_version`, `latest_version`, a runnable `upgrade_command`, and a\n `reason`. It rides in the response body,\n so it reaches `-j` output like any other field;\n- a command fails with `control: \"client.version_unsupported\"`. This CLI is\n too old to read part of the catalog, and `search` and `inspect` are refused\n rather than answered with a shortened list \u2014 a missing row would be\n invisible to you. Run the `upgrade_command` from `details`, then retry;\n- a command printed an `Update available` notice \u2014 the CLI asks the npm\n registry at most once every three hours and prints this on stderr. This one\n never\n appears in `-j` mode, because both streams stay machine-clean; the `client`\n block above is the `-j` signal.\n\nAfter upgrading, refresh the installed Skill as described in **Setup**.\nThe Skill and the CLI update together. Never downgrade. An available update\nnever interrupts work: finish the task at hand, then upgrade before the\nnext one. If the registry is unreachable, proceed with the installed\nversion \u2014 do not block the task on an upgrade check.\n\n## When to use\n\n- The task needs a capability (enrich a person or company, search the web,\n etc.) and no key or integration for it exists in the environment.\n- Workflow, in order:\n 0. Every search needs `--use-case \"<what they asked for>\"`, a browse with no\n query included: the user's own request, in their words, with the subject\n in it. Search refuses to run without it. One piece of the user's work is\n one **task**. Search prints a task id; pass it back\n with `--task <id>` on every later search, inspect and run for that same\n piece of work. Run that first search on its own and wait for the id:\n searches started in parallel before you have it each open a separate\n task. After that, search in parallel as much as you like, each with\n `--task <id>`. Every command that prints a follow-up command already\n carries the id in it, so working from what you are given keeps a task\n together with no bookkeeping.\n\n The use case and the task id cost nothing. The task id lets you list one\n task's Runs together with `glasser runs list --task <id>`.\n 1. `glasser search \"<capability>\" --use-case \"<what they asked for>\"` \u2014 find candidate Endpoints. The\n Provider column reads `pdl (People Data Labs)`: the first word is the\n slug every `-p` flag takes, the name in parentheses is who the data\n comes from \u2014 use it when the user names a vendor, and when you report\n the source back. Several Providers may sell the same capability: the\n list is ranked by relevance only, the Price sits beside each row, and\n the choice is yours.\n - A page holds 5 rows and the footer says how many matches there are in\n total. Pass the printed cursor with `--cursor` to see the rest.\n - The Score column is the cosine similarity between your words and that\n Endpoint's description, in [-1, 1], shown as `-` when semantic scoring\n did not run. It is a similarity signal for comparing rows on one page,\n not a verdict: the row order comes from fusing a keyword and a semantic\n ranking, and the ranking always returns its nearest candidates.\n - **Neither a page of low scores nor reaching the last page shows that\n the catalog lacks a capability.** Before you tell the user something is\n unavailable: read the total, page through with `--cursor`, search again\n with different words (the catalog is indexed on how each Endpoint\n describes itself, which may not be your phrasing), and inspect every\n candidate whose name is close to the task \u2014 `inspect` is free.\n 2. `glasser inspect -p <provider> -e <endpoint>` \u2014 **read the Price and\n the charge clauses BEFORE running.** The Price is what a normal\n COMPLETED call costs; the charge clauses list the exceptions (e.g.\n `NO_RESULT $0.00` means an empty answer is free). For any given\n endpoint the clauses are authoritative. Also identify which input\n fields control result volume (`num`, `size`, `limit`, arrays of\n queries) \u2014 the charge rule may read the input, so volume parameters\n can change what a call costs. Start small; raise only when the user\n needs more.\n 3. `glasser run -p <provider> -e <endpoint> -i '<json>'` \u2014 execute.\n 4. Report the result AND the charge to the user (run output includes the\n charged amount). Every Run also prints a `Run URL` (the `run_url` field\n in `-j`; absent from the `-o` file): the Workspace console page holding\n that Run's records exactly as the Provider returned them, private to\n Workspace members. When your answer relies on a Run, cite that URL as\n its source \u2014 the Run id alone opens nothing for the user.\n\n## When NOT to use\n\n- **Precedence: an explicit user instruction > the user's own integrations\n and keys > Glasser.** If the user has their own key, client, or\n integration for the capability, use that instead.\n- **Runs spend the Workspace balance.** Do not run Endpoints speculatively,\n in loops, or for bulk operations without telling the user the per-call\n Price and getting their go-ahead.\n- Do not use it for capabilities the environment already provides for free.\n- **The catalog changes often** \u2014 Endpoints and Providers are added weekly.\n Search every time you need one; never cache or reuse a listing from an\n earlier session, and never answer \"what can Glasser do\" from memory.\n\n## Adding funds\n\nOnly the user can add funds, in the console at https://app.glasser.ai/balance \u2014\nno command or tool does it. Raise this only when a Run fails with\n`insufficient balance` or the user asks.\n\n- **Top up** on the Balance page.\n- **Grants** are free balance; users often call them \"credits\". The Balance\n page lists the Grants a Workspace can receive and their terms. Send the\n user there.\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `glasser login` | Browser device authorization; stores a Key |\n| `glasser search [\"<query>\"] --use-case \"<sentence>\" [--limit N] [--cursor C] [--task T]` | Search Endpoints, 5 per page (max 20); `--use-case` is required on every search; `-q`/`--query` takes the same query; use `--query=<query>` when it starts with `-`; the footer prints the match total, the task id, the next-page cursor for `--cursor`, and a search-again command that carries the task and the use case |\n| `glasser inspect -p <provider> -e <endpoint> [--endpoint-version N] [--task T]` | Schemas, current Price, charge clauses, supported version |\n| `glasser run -p <provider> -e <endpoint> [-i '<json>' \\| -f <file>] [--idempotency-key K] [--task T] [--wait] [--wait-timeout s] [-o file]` | Execute an Endpoint |\n| `glasser runs list [--limit --cursor --status --provider --endpoint --task]` | List past Runs; `--task` is an exact match |\n| `glasser runs get -r <runId> [--wait] [-o file]` | Fetch one Run |\n| `glasser runs stop -r <runId>` | Stop a queued/running Run |\n| `glasser balance` | Balance, held and available; doubles as the auth probe |\n| `glasser balance history [--limit --cursor --kind]` | Ledger of charges, refunds, top-ups and Grants |\n| `glasser keys add/list/activate/remove` | Manage Keys stored on this machine |\n\nGlobal flags: `-j/--json` (raw JSON to stdout, errors as a single JSON\nobject on stderr), `--help`, `--version`.\n\nFacts that matter when scripting:\n\n- Exit codes: `0` success, `1` runtime failure, `2` usage error, `130`\n interrupted.\n- In `-j` mode, stdout is data only; parse stderr for the error object.\n- For large outputs, prefer `-o <file>` and read the file selectively \u2014\n dumping a full provider payload into your context wastes it.\n- Money is always an **exact decimal string** (e.g. `\"0.0125\"`), never a\n float. Do not do float arithmetic on it.\n- Env: `GLASSER_API_KEY`, `GLASSER_API_BASE_URL` (default\n `https://api.glasser.ai`; point it elsewhere and that stack's Workspace\n is what gets billed), `NO_COLOR`.\n\n## Run statuses and waiting\n\n| Status | Meaning |\n|---|---|\n| `QUEUED` | Accepted, not yet dispatched to the provider |\n| `RUNNING` | Dispatched, provider has not answered yet |\n| `COMPLETED` | Terminal \u2014 the provider answered (its answer may still be a \"not found\") |\n| `FAILED` | Terminal \u2014 no usable provider answer; the failure block says why |\n| `STOPPED` | Terminal \u2014 stopped via `runs stop`. Dispatch wins the race: a Run already sent to the provider completes and is charged |\n\nInspect shows each Endpoint's run mode: a `sync` Endpoint returns the\nfinished Run in the same response (its timeout is printed next to the\nmode) \u2014 `--wait` on those adds nothing. For anything still `QUEUED` or\n`RUNNING`, either pass `--wait` up front or poll with\n`glasser runs get -r <runId> --wait`; interactive sessions that want to\nkeep talking can fire without `--wait` and poll between replies.\n\n## Troubleshooting\n\n| Symptom | Meaning / action |\n|---|---|\n| `Invalid or missing API key` | Check the Key source. If `GLASSER_API_KEY` is set, correct it through its owner; login does not replace it. With no environment Key, use `glasser login` to replace a missing or rejected local Key |\n| Exit `2` | Your command line is wrong \u2014 fix it from the message; nothing reached the API and nothing was charged |\n| `Input does not match the endpoint's input schema` | Read the `issues:` lines under the error \u2014 they name the exact field and constraint. No Run was created and nothing was charged; fix the input and run again |\n| `insufficient balance` | The Workspace cannot cover the Price. Tell the user to add funds in the console (see **Adding funds**) \u2014 do not retry |\n| `rate_limited` | The Workspace or the endpoint is at its limit. Wait `retry_after_ms` (the error carries it; the hint prints it), then retry the same command once \u2014 do not loop |\n| Transport error / timeout with a retry hint | Outcome unknown \u2014 a Run may exist. Retry with the SAME Idempotency-Key exactly as the hint prints it |\n| `FAILED` with a charge shown | Legitimate when the charge clauses say so \u2014 report both the failure and the charge |\n| `Update available` notice | Finish the current task, re-run the installer, then update the installed skill as described in **Upgrading** |\n\n## Running safely\n\n- `run` prints `Charge: $X (rule)` \u2014 the amount billed under the\n endpoint's charge rule. Report that number to the user.\n- `run` prints the Idempotency-Key it used (auto-generated when omitted;\n `--json` mode requires an explicit `--idempotency-key`). On an ambiguous\n failure \u2014 timeout, dropped connection, nonzero exit with no clear answer \u2014\n **retry with the SAME key**: it returns the original Run instead of\n charging again.\n- **Two indicators, not one.** A Run's status and the provider's response\n are separate. `COMPLETED` means the provider answered \u2014 a `COMPLETED` Run\n whose payload is a provider 404 (\"person not found\") is a normal outcome,\n not an error. Whether it is charged follows the endpoint's charge clauses\n from inspect. Report both the Run status and what the provider actually\n said.\n- Use `--wait` to block until the Run settles; without it, poll with\n `glasser runs get -r <runId> --wait`.\n\n## Rules for agents\n\n1. The user's own keys, integrations and explicit instructions outrank\n Glasser \u2014 it fills gaps, never routes around what the user has.\n2. Always inspect before running; never guess input parameters \u2014 the input\n schema and charge clauses from `inspect` are the source of truth.\n3. Runs spend the Workspace balance: no speculative, looped, or bulk runs\n without naming the per-call Price and getting the user's go-ahead.\n4. Start with small volume parameters; raise them only on request.\n5. Interactive auth is `glasser login` \u2014 never ask the user to paste a Key.\n6. On an ambiguous failure, retry with the SAME Idempotency-Key.\n7. Carry the SAME `--task` through one piece of work, the way you carry that\n key \u2014 search prints it, inspect and run take it.\n8. Report two indicators after every run \u2014 the Run status and what the\n provider said \u2014 plus the printed `Charge:` amount; cite the `Run URL`,\n never the bare Run id, as the source of what your answer used.\n9. Money is an exact decimal string; never do float arithmetic on it.\n10. Prefer `-o <file>` for large outputs; `-j` when you parse.\n11. When any command prints an `Update available` notice: finish the task,\n re-run the installer, then update the installed skill as described in\n **Upgrading**.\n12. The CLI is the source of truth for flags \u2014 run `glasser <command>\n --help` when unsure.\n13. `rate_limited` means back off: wait `retry_after_ms`, then retry the\n same command once; never loop on it.\n\n`--endpoint-version` selects a supported compatible contract. It does not lock Price.\nCompatible updates keep the version; older versions work until explicitly retired.\nNew Runs use the selected version's Price at admission. Accepted Runs keep their original Price.\n" : readFileSync3(new URL("../../api/src/http/skill/SKILL.md", import.meta.url), "utf8");
|
|
66948
|
+
import path8 from "node:path";
|
|
66949
|
+
var SKILL_MARKDOWN = true ? "---\nname: glasser\nversion: 0.1.80\ndescription: >\n Reach for this when a task needs external or paid data \u2014 person or company\n enrichment, person/company search, job-posting search, contact unlock, web,\n news, image, video, maps, places, scholar or shopping search, US property\n and rental data, SEC filings, company financials and stock prices, webpage\n scraping, lead lookup, or any\n other paid data API \u2014 and check the data sources before writing a scraper or\n telling the user something is inaccessible. 1,500+ paid,\n high-quality endpoints across many providers behind one Key: search, inspect\n the price, run, pay per call, no signup at each vendor. Works through the\n glasser CLI, or through the Glasser MCP server where the runtime cannot\n shell out. If the user already has their own key or integration for a\n specific provider, use that first.\n---\n\n# Glasser\n\nGlasser is a broker: it sells runnable third-party API operations\n(\"Endpoints\") under a single Key. You search the data sources, inspect an\nEndpoint's contract and Price, and run it \u2014 the response is the provider's\nown output, nothing renamed or reshaped.\n\n## Identify your surface FIRST\n\nDecide by the actual execution environment, not the product name and not\nwhether a terminal exists. The wrong setup cannot work.\n\n- **`glasser` MCP tools already loaded** (`search`, `inspect`, `run`,\n `runs_get`, `runs_list`, `runs_stop`, `balance`): nothing to install. The\n verbs map one to one onto the CLI commands below; only `run` differs, in\n that it needs an `idempotency_key` you generate (a UUID). Call `balance`;\n if it succeeds, skip to **First run**. The rules in this file apply either\n way.\n\n- **Hosted assistant** (claude.ai, Claude Desktop chat, Cowork, ChatGPT,\n Gemini \u2014 even with a code sandbox: it runs in the provider's cloud, not on\n the human's machine, and resets between tasks): do NOT install anything.\n Tell the human to add Glasser as a custom MCP connector, then stop. In\n Claude, give them this link; it opens the Add custom connector dialog\n with the name and URL filled in:\n https://api.glasser.ai/connect/claude\n Then Continue \u2192 Add \u2192 sign in to Glasser, choose the Workspace, Allow.\n Glasser is on in the next chat. Other products: the server URL is\n `https://api.glasser.ai/mcp`; steps per client at\n https://glasser.ai/docs/mcp-server.md. If the product has no custom\n connectors, say so and point to the same account's coding agent\n (ChatGPT \u2192 Codex, Gemini \u2192 Gemini CLI, Claude \u2192 Claude Code).\n\n- **Local coding agent** (Claude Code, Codex, Cursor, Copilot, Gemini CLI,\n OpenClaw, Hermes on the user's machine): the human authorized the whole\n flow by pasting this. If your runtime asks permission for shell commands,\n request it ONCE and work straight through. Continue to **Setup**.\n\n- **Sandboxed agent** (cloud container, restricted egress): run\n `curl -sI https://api.glasser.ai/health` first. A proxy 403, DNS failure\n or timeout means an egress allowlist. Do not retry, do not try other\n hosts. Tell the human `api.glasser.ai` is blocked by the environment's\n network policy, offer the MCP connector or an allowlist for `glasser.ai`\n and `api.glasser.ai` on 443, then stop.\n\nNever ask the human to paste a Key into chat.\n\n## Setup\n\n```sh\nglasser --version 2>/dev/null || npm install -g @glasser-ai/cli@latest\n```\n\nOne command when the CLI is missing, and it installs the current version.\nWithout npm, `curl -fsSL https://glasser.ai/install.sh | sh` does the same\njob. A fresh install selects the latest version, so no separate registry\nversion check is needed. The installer reports what it needs and where it\nwrote the binary \u2014 read its output rather than guessing. If the CLI was\nalready installed, the server tells you when to upgrade (see **Upgrading**).\n\nFor agents with persistent skills, run `glasser skill install`. It saves\nthis file for every coding agent it finds (Claude Code, Codex, Cursor, Gemini\nCLI, Copilot and others), so future sessions load it; the installer already\nran it. For any other agent, save the complete file from\nhttps://glasser.ai/SKILL.md in your user-level skill directory and enable it\nfor future sessions. Do this only during setup or CLI upgrades.\n\n## Authentication\n\nRun `glasser balance`. Exit 0 means authentication works; continue to\n**First run**. A missing or rejected Key needs one. Handle other failures\nfrom the error message instead of starting another login.\n\n**Where a Key comes from.** Two sources, and the environment takes precedence\nover the local store. `GLASSER_API_KEY` needs no file on disk, so it is what\nCI, scripts and scheduled jobs use, and it is the source that still works on a\nmachine whose own store will not outlive the session \u2014 a cloud session, a\ncontainer. Mint that Key in the console. The local store is what `glasser\nlogin` writes and what `glasser keys add --label <l> --key <k>` fills by hand;\nit lives on the machine the CLI ran on, and lasts as long as that machine does.\n\n**With a user present**, in this order:\n\n1. Run `glasser login` with your shell tool's background execution support.\n The CLI opens the sign-in page when possible and prints a fallback URL and\n a matching code.\n2. Relay that URL and code exactly as printed \u2014 a plain URL, readable in a\n terminal \u2014 with a brief explanation of the next step. Nothing else starts\n until this message is out.\n3. Wait for that same command to finish, using the shell tool's wait or output\n operation with short waits. A pending result means wait again, not return\n a final reply. Browser approval needs no further chat message. Give brief\n progress updates during the wait; the CLI polls for up to 15 minutes.\n Stop waiting when login succeeds, fails, expires, or the user cancels.\n\nOnce login succeeds, use the available balance in its output and continue to\n**First run**, unless login warns that `GLASSER_API_KEY` overrides the saved\nKey or the summary has no available balance. In either case, run\n`glasser balance` in the environment subsequent commands will use. Login's\nsummary uses the new Key directly; it does not verify an environment Key.\n\nIf that check rejects an environment Key, another login will not fix it.\nPreserve runtime-managed authentication: changing the variable or bypassing\nit for a command needs the user's authorization. When the user requires it\nto stay unchanged, report the blocker and the runtime correction needed.\nFor other failures, report the actual error; a network failure does not show\nthat a Key is invalid. If authorization expires, a new login needs a new\nURL and code relayed before waiting again.\nNever ask the user to paste a Key. `glasser login --json` is a usage error by\ndesign \u2014 that flow needs a human.\n\n## First run\n\nSetup is finished when login succeeds and reports the available balance\nwithout an environment Key override, or `glasser balance` exits 0 in the\nenvironment subsequent commands will use \u2014 with the MCP tools, when\n`balance` succeeds.\nIf setup is blocked, give a brief status, the confirmed cause, and the next\nstep needed to resolve it. You may state which steps succeeded, but do not\nclaim readiness or offer task prompts while authentication is blocked.\nLogin's balance is not usable evidence for commands that use a rejected Key.\n\nOnce setup is finished, if the user already gave you a task, continue it.\nFor a setup-only request, reply briefly in the user's language: confirm\nGlasser is ready, report the available balance from login or the balance\ncheck, then offer three ready-to-send task prompts, one per bullet.\nUse a conversational lead-in that explains how the suggestions can help\nthe user, rather than a generic list heading. Connect it to their goals\nwhen known, or briefly describe what they could accomplish with Glasser.\n\nBase the prompts on the user's project, interests or goals when that context\nis available. Otherwise, choose three varied examples from Glasser's\ncapabilities. Give each prompt a concrete subject and a clear result the\nuser can ask for.\n\nFor both completed and blocked setup, omit Workspace names/slugs, Key\nlabels/values/prefixes, and installation details such as versions, paths or\npackage-manager output. Name a configuration variable when it explains the\nblocker. Report useful status, not a transcript of the setup commands.\nSetup is not approval to spend: wait for the user to choose before starting\na paid Run.\n\n## Upgrading\n\nThe server tells you when to upgrade \u2014 you do not have to compare versions\nby hand. Upgrade when any of these appears:\n\n- a response carries a `client` block. It is present only when this CLI is\n behind, and it says everything needed to act: `client_version`,\n `minimum_version`, `latest_version`, a runnable `upgrade_command`, and a\n `reason`. It rides in the response body,\n so it reaches `-j` output like any other field;\n- a command fails with `control: \"client.version_unsupported\"`. This CLI is\n too old to read part of the catalog, and `search` and `inspect` are refused\n rather than answered with a shortened list \u2014 a missing row would be\n invisible to you. Run the `upgrade_command` from `details`, then retry;\n- a command printed an `Update available` notice \u2014 the CLI asks the npm\n registry at most once every three hours and prints this on stderr. This one\n never\n appears in `-j` mode, because both streams stay machine-clean; the `client`\n block above is the `-j` signal.\n\nAfter upgrading, refresh the installed Skill as described in **Setup**.\nThe Skill and the CLI update together. Never downgrade. An available update\nnever interrupts work: finish the task at hand, then upgrade before the\nnext one. If the registry is unreachable, proceed with the installed\nversion \u2014 do not block the task on an upgrade check.\n\n## When to use\n\n- The task needs a capability (enrich a person or company, search the web,\n etc.) and no key or integration for it exists in the environment.\n- Workflow, in order:\n 0. Every search needs `--use-case \"<what they asked for>\"`, a browse with no\n query included: the user's own request, in their words, with the subject\n in it. Search refuses to run without it. One piece of the user's work is\n one **task**. Search prints a task id; pass it back\n with `--task <id>` on every later search, inspect and run for that same\n piece of work. Run that first search on its own and wait for the id:\n searches started in parallel before you have it each open a separate\n task. After that, search in parallel as much as you like, each with\n `--task <id>`. Every command that prints a follow-up command already\n carries the id in it, so working from what you are given keeps a task\n together with no bookkeeping.\n\n The use case and the task id cost nothing. The task id lets you list one\n task's Runs together with `glasser runs list --task <id>`.\n 1. `glasser search \"<capability>\" --use-case \"<what they asked for>\"` \u2014 find candidate Endpoints. The\n Provider column reads `pdl (People Data Labs)`: the first word is the\n slug every `-p` flag takes, the name in parentheses is who the data\n comes from \u2014 use it when the user names a vendor, and when you report\n the source back. Several Providers may sell the same capability: the\n list is ranked by relevance only, the Price sits beside each row, and\n the choice is yours.\n - A page holds 5 rows and the footer says how many matches there are in\n total. Pass the printed cursor with `--cursor` to see the rest.\n - The Score column is the cosine similarity between your words and that\n Endpoint's description, in [-1, 1], shown as `-` when semantic scoring\n did not run. It is a similarity signal for comparing rows on one page,\n not a verdict: the row order comes from fusing a keyword and a semantic\n ranking, and the ranking always returns its nearest candidates.\n - **Neither a page of low scores nor reaching the last page shows that\n the catalog lacks a capability.** Before you tell the user something is\n unavailable: read the total, page through with `--cursor`, search again\n with different words (the catalog is indexed on how each Endpoint\n describes itself, which may not be your phrasing), and inspect every\n candidate whose name is close to the task \u2014 `inspect` is free.\n 2. `glasser inspect -p <provider> -e <endpoint>` \u2014 **read the Price and\n the charge clauses BEFORE running.** The Price is what a normal\n COMPLETED call costs; the charge clauses list the exceptions (e.g.\n `NO_RESULT $0.00` means an empty answer is free). For any given\n endpoint the clauses are authoritative. Also identify which input\n fields control result volume (`num`, `size`, `limit`, arrays of\n queries) \u2014 the charge rule may read the input, so volume parameters\n can change what a call costs. Start small; raise only when the user\n needs more.\n 3. `glasser run -p <provider> -e <endpoint> -i '<json>'` \u2014 execute.\n 4. Report the result AND the charge to the user (run output includes the\n charged amount). Every Run also prints a `Run URL` (the `run_url` field\n in `-j`; absent from the `-o` file): the Workspace console page holding\n that Run's records exactly as the Provider returned them, private to\n Workspace members. When your answer relies on a Run, cite that URL as\n its source \u2014 the Run id alone opens nothing for the user.\n\n## When NOT to use\n\n- **Precedence: an explicit user instruction > the user's own integrations\n and keys > Glasser.** If the user has their own key, client, or\n integration for the capability, use that instead.\n- **Runs spend the Workspace balance.** Do not run Endpoints speculatively,\n in loops, or for bulk operations without telling the user the per-call\n Price and getting their go-ahead.\n- Do not use it for capabilities the environment already provides for free.\n- **The catalog changes often** \u2014 Endpoints and Providers are added weekly.\n Search every time you need one; never cache or reuse a listing from an\n earlier session, and never answer \"what can Glasser do\" from memory.\n\n## Adding funds\n\nOnly the user can add funds, in the console at https://app.glasser.ai/balance \u2014\nno command or tool does it. Raise this only when a Run fails with\n`insufficient balance` or the user asks.\n\n- **Top up** on the Balance page.\n- **Grants** are free balance; users often call them \"credits\". The Balance\n page lists the Grants a Workspace can receive and their terms. Send the\n user there.\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `glasser login` | Browser device authorization; stores a Key |\n| `glasser search [\"<query>\"] --use-case \"<sentence>\" [--limit N] [--cursor C] [--task T]` | Search Endpoints, 5 per page (max 20); `--use-case` is required on every search; `-q`/`--query` takes the same query; use `--query=<query>` when it starts with `-`; the footer prints the match total, the task id, the next-page cursor for `--cursor`, and a search-again command that carries the task and the use case |\n| `glasser inspect -p <provider> -e <endpoint> [--endpoint-version N] [--task T]` | Schemas, current Price, charge clauses, supported version |\n| `glasser run -p <provider> -e <endpoint> [-i '<json>' \\| -f <file>] [--idempotency-key K] [--task T] [--wait] [--wait-timeout s] [-o file]` | Execute an Endpoint |\n| `glasser runs list [--limit --cursor --status --provider --endpoint --task]` | List past Runs; `--task` is an exact match |\n| `glasser runs get -r <runId> [--wait] [-o file]` | Fetch one Run |\n| `glasser runs stop -r <runId>` | Stop a queued/running Run |\n| `glasser balance` | Balance, held and available; doubles as the auth probe |\n| `glasser balance history [--limit --cursor --kind]` | Ledger of charges, refunds, top-ups and Grants |\n| `glasser keys add/list/activate/remove` | Manage Keys stored on this machine |\n\nGlobal flags: `-j/--json` (raw JSON to stdout, errors as a single JSON\nobject on stderr), `--help`, `--version`.\n\nFacts that matter when scripting:\n\n- Exit codes: `0` success, `1` runtime failure, `2` usage error, `130`\n interrupted.\n- In `-j` mode, stdout is data only; parse stderr for the error object.\n- For large outputs, prefer `-o <file>` and read the file selectively \u2014\n dumping a full provider payload into your context wastes it.\n- Money is always an **exact decimal string** (e.g. `\"0.0125\"`), never a\n float. Do not do float arithmetic on it.\n- Env: `GLASSER_API_KEY`, `GLASSER_API_BASE_URL` (default\n `https://api.glasser.ai`; point it elsewhere and that stack's Workspace\n is what gets billed), `NO_COLOR`.\n\n## Run statuses and waiting\n\n| Status | Meaning |\n|---|---|\n| `QUEUED` | Accepted, not yet dispatched to the provider |\n| `RUNNING` | Dispatched, provider has not answered yet |\n| `COMPLETED` | Terminal \u2014 the provider answered (its answer may still be a \"not found\") |\n| `FAILED` | Terminal \u2014 no usable provider answer; the failure block says why |\n| `STOPPED` | Terminal \u2014 stopped via `runs stop`. Dispatch wins the race: a Run already sent to the provider completes and is charged |\n\nInspect shows each Endpoint's run mode: a `sync` Endpoint returns the\nfinished Run in the same response (its timeout is printed next to the\nmode) \u2014 `--wait` on those adds nothing. For anything still `QUEUED` or\n`RUNNING`, either pass `--wait` up front or poll with\n`glasser runs get -r <runId> --wait`; interactive sessions that want to\nkeep talking can fire without `--wait` and poll between replies.\n\n## Troubleshooting\n\n| Symptom | Meaning / action |\n|---|---|\n| `Invalid or missing API key` | Check the Key source. If `GLASSER_API_KEY` is set, correct it through its owner; login does not replace it. With no environment Key, use `glasser login` to replace a missing or rejected local Key |\n| Exit `2` | Your command line is wrong \u2014 fix it from the message; nothing reached the API and nothing was charged |\n| `Input does not match the endpoint's input schema` | Read the `issues:` lines under the error \u2014 they name the exact field and constraint. No Run was created and nothing was charged; fix the input and run again |\n| `insufficient balance` | The Workspace cannot cover the Price. Tell the user to add funds in the console (see **Adding funds**) \u2014 do not retry |\n| `rate_limited` | The Workspace or the endpoint is at its limit. Wait `retry_after_ms` (the error carries it; the hint prints it), then retry the same command once \u2014 do not loop |\n| Transport error / timeout with a retry hint | Outcome unknown \u2014 a Run may exist. Retry with the SAME Idempotency-Key exactly as the hint prints it |\n| `FAILED` with a charge shown | Legitimate when the charge clauses say so \u2014 report both the failure and the charge |\n| `Update available` notice | Finish the current task, re-run the installer, then update the installed skill as described in **Upgrading** |\n\n## Running safely\n\n- `run` prints `Charge: $X (rule)` \u2014 the amount billed under the\n endpoint's charge rule. Report that number to the user.\n- `run` prints the Idempotency-Key it used (auto-generated when omitted;\n `--json` mode requires an explicit `--idempotency-key`). On an ambiguous\n failure \u2014 timeout, dropped connection, nonzero exit with no clear answer \u2014\n **retry with the SAME key**: it returns the original Run instead of\n charging again.\n- **Two indicators, not one.** A Run's status and the provider's response\n are separate. `COMPLETED` means the provider answered \u2014 a `COMPLETED` Run\n whose payload is a provider 404 (\"person not found\") is a normal outcome,\n not an error. Whether it is charged follows the endpoint's charge clauses\n from inspect. Report both the Run status and what the provider actually\n said.\n- Use `--wait` to block until the Run settles; without it, poll with\n `glasser runs get -r <runId> --wait`.\n\n## Rules for agents\n\n1. The user's own keys, integrations and explicit instructions outrank\n Glasser \u2014 it fills gaps, never routes around what the user has.\n2. Always inspect before running; never guess input parameters \u2014 the input\n schema and charge clauses from `inspect` are the source of truth.\n3. Runs spend the Workspace balance: no speculative, looped, or bulk runs\n without naming the per-call Price and getting the user's go-ahead.\n4. Start with small volume parameters; raise them only on request.\n5. Interactive auth is `glasser login` \u2014 never ask the user to paste a Key.\n6. On an ambiguous failure, retry with the SAME Idempotency-Key.\n7. Carry the SAME `--task` through one piece of work, the way you carry that\n key \u2014 search prints it, inspect and run take it.\n8. Report two indicators after every run \u2014 the Run status and what the\n provider said \u2014 plus the printed `Charge:` amount; cite the `Run URL`,\n never the bare Run id, as the source of what your answer used.\n9. Money is an exact decimal string; never do float arithmetic on it.\n10. Prefer `-o <file>` for large outputs; `-j` when you parse.\n11. When any command prints an `Update available` notice: finish the task,\n re-run the installer, then update the installed skill as described in\n **Upgrading**.\n12. The CLI is the source of truth for flags \u2014 run `glasser <command>\n --help` when unsure.\n13. `rate_limited` means back off: wait `retry_after_ms`, then retry the\n same command once; never loop on it.\n\n`--endpoint-version` selects a supported compatible contract. It does not lock Price.\nCompatible updates keep the version; older versions work until explicitly retired.\nNew Runs use the selected version's Price at admission. Accepted Runs keep their original Price.\n" : readFileSync4(new URL("../../api/src/http/skill/SKILL.md", import.meta.url), "utf8");
|
|
66826
66950
|
var SKILL_NAME = "glasser";
|
|
66827
|
-
var absolute = (value3, fallback) => value3 !== void 0 &&
|
|
66951
|
+
var absolute = (value3, fallback) => value3 !== void 0 && path8.isAbsolute(value3) ? value3 : fallback;
|
|
66828
66952
|
function agents(env) {
|
|
66829
66953
|
const { home } = env;
|
|
66830
|
-
const claude = absolute(env.claudeConfigDir,
|
|
66831
|
-
const codex = absolute(env.codexHome,
|
|
66832
|
-
const gemini =
|
|
66833
|
-
const config = absolute(env.xdgConfigHome,
|
|
66834
|
-
const shared =
|
|
66954
|
+
const claude = absolute(env.claudeConfigDir, path8.join(home, ".claude"));
|
|
66955
|
+
const codex = absolute(env.codexHome, path8.join(home, ".codex"));
|
|
66956
|
+
const gemini = path8.join(absolute(env.geminiCliHome, home), ".gemini");
|
|
66957
|
+
const config = absolute(env.xdgConfigHome, path8.join(home, ".config"));
|
|
66958
|
+
const shared = path8.join(home, ".agents/skills");
|
|
66835
66959
|
return {
|
|
66836
|
-
"claude-code": { skills:
|
|
66960
|
+
"claude-code": { skills: path8.join(claude, "skills"), markers: [claude] },
|
|
66837
66961
|
codex: { skills: shared, markers: [codex] },
|
|
66838
|
-
cursor: { skills:
|
|
66839
|
-
"gemini-cli": { skills:
|
|
66962
|
+
cursor: { skills: path8.join(home, ".cursor/skills"), markers: [path8.join(home, ".cursor")] },
|
|
66963
|
+
"gemini-cli": { skills: path8.join(gemini, "skills"), markers: [gemini] },
|
|
66840
66964
|
"github-copilot": {
|
|
66841
|
-
skills:
|
|
66842
|
-
markers: [
|
|
66965
|
+
skills: path8.join(home, ".copilot/skills"),
|
|
66966
|
+
markers: [path8.join(home, ".copilot")]
|
|
66843
66967
|
},
|
|
66844
66968
|
opencode: {
|
|
66845
|
-
skills:
|
|
66846
|
-
markers: [
|
|
66969
|
+
skills: path8.join(config, "opencode/skills"),
|
|
66970
|
+
markers: [path8.join(config, "opencode")]
|
|
66847
66971
|
},
|
|
66848
|
-
amp: { skills:
|
|
66849
|
-
cline: { skills: shared, markers: [
|
|
66850
|
-
warp: { skills: shared, markers: [
|
|
66851
|
-
zed: { skills: shared, markers: [
|
|
66972
|
+
amp: { skills: path8.join(config, "agents/skills"), markers: [path8.join(config, "amp")] },
|
|
66973
|
+
cline: { skills: shared, markers: [path8.join(home, ".cline")] },
|
|
66974
|
+
warp: { skills: shared, markers: [path8.join(home, ".warp")] },
|
|
66975
|
+
zed: { skills: shared, markers: [path8.join(config, "zed")] },
|
|
66852
66976
|
windsurf: {
|
|
66853
|
-
skills:
|
|
66854
|
-
markers: [
|
|
66977
|
+
skills: path8.join(home, ".codeium/windsurf/skills"),
|
|
66978
|
+
markers: [path8.join(home, ".codeium/windsurf")]
|
|
66855
66979
|
},
|
|
66856
|
-
roo: { skills:
|
|
66980
|
+
roo: { skills: path8.join(home, ".roo/skills"), markers: [path8.join(home, ".roo")] },
|
|
66857
66981
|
continue: {
|
|
66858
|
-
skills:
|
|
66859
|
-
markers: [
|
|
66982
|
+
skills: path8.join(home, ".continue/skills"),
|
|
66983
|
+
markers: [path8.join(home, ".continue")]
|
|
66860
66984
|
},
|
|
66861
|
-
"qwen-code": { skills:
|
|
66985
|
+
"qwen-code": { skills: path8.join(home, ".qwen/skills"), markers: [path8.join(home, ".qwen")] },
|
|
66862
66986
|
kilo: {
|
|
66863
|
-
skills:
|
|
66864
|
-
markers: [
|
|
66987
|
+
skills: path8.join(home, ".kilo/skills"),
|
|
66988
|
+
markers: [path8.join(home, ".kilo"), path8.join(home, ".kilocode")]
|
|
66865
66989
|
},
|
|
66866
|
-
goose: { skills:
|
|
66990
|
+
goose: { skills: path8.join(config, "goose/skills"), markers: [path8.join(config, "goose")] }
|
|
66867
66991
|
};
|
|
66868
66992
|
}
|
|
66869
66993
|
var SKILL_TARGET_NAMES = Object.keys(
|
|
66870
66994
|
agents({ home: os2.homedir() })
|
|
66871
66995
|
);
|
|
66872
66996
|
function skillFile(target, env) {
|
|
66873
|
-
return
|
|
66997
|
+
return path8.join(agents(env)[target].skills, SKILL_NAME, "SKILL.md");
|
|
66874
66998
|
}
|
|
66875
66999
|
function detectTargets(env) {
|
|
66876
67000
|
const table3 = agents(env);
|
|
@@ -66880,8 +67004,8 @@ function detectTargets(env) {
|
|
|
66880
67004
|
function writeSkill(targets, env) {
|
|
66881
67005
|
const files = [...new Set(targets.map((target) => skillFile(target, env)))];
|
|
66882
67006
|
for (const file5 of files) {
|
|
66883
|
-
|
|
66884
|
-
|
|
67007
|
+
mkdirSync3(path8.dirname(file5), { recursive: true });
|
|
67008
|
+
writeFileSync4(file5, SKILL_MARKDOWN);
|
|
66885
67009
|
}
|
|
66886
67010
|
return files;
|
|
66887
67011
|
}
|
|
@@ -66932,7 +67056,7 @@ var skill = Command_exports.make("skill").pipe(
|
|
|
66932
67056
|
// package.json
|
|
66933
67057
|
var package_default = {
|
|
66934
67058
|
name: "@glasser-ai/cli",
|
|
66935
|
-
version: "0.1.
|
|
67059
|
+
version: "0.1.80",
|
|
66936
67060
|
description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
|
|
66937
67061
|
license: "MIT",
|
|
66938
67062
|
type: "module",
|
|
@@ -67001,12 +67125,19 @@ var CLI_VERSION = package_default.version;
|
|
|
67001
67125
|
// src/http.ts
|
|
67002
67126
|
var USER_AGENT = `@glasser-ai/cli/${CLI_VERSION}`;
|
|
67003
67127
|
var userAgentFor = (agent) => agent === void 0 ? USER_AGENT : `${USER_AGENT} AIAgent/${agent}`;
|
|
67004
|
-
var withClientIdentity = (client, userAgent = USER_AGENT) => client.pipe(
|
|
67128
|
+
var withClientIdentity = (client, userAgent = USER_AGENT, channel) => client.pipe(
|
|
67129
|
+
HttpClient_exports.mapRequest((request5) => {
|
|
67130
|
+
const identified = HttpClientRequest_exports.setHeader(request5, "user-agent", userAgent);
|
|
67131
|
+
return channel === void 0 ? identified : HttpClientRequest_exports.setHeader(identified, CHANNEL_HEADER, channel);
|
|
67132
|
+
})
|
|
67133
|
+
);
|
|
67134
|
+
var CHANNEL_HEADER = "x-glasser-channel";
|
|
67005
67135
|
var HttpClientLayer = HttpClient_exports.layerMergedContext(
|
|
67006
67136
|
Effect_exports.gen(function* () {
|
|
67007
67137
|
const client = yield* HttpClient_exports.HttpClient;
|
|
67008
67138
|
const agent = yield* codingAgent;
|
|
67009
|
-
|
|
67139
|
+
const dir2 = yield* configDir;
|
|
67140
|
+
return withClientIdentity(client, userAgentFor(agent), channelHeader(readChannel(dir2)));
|
|
67010
67141
|
})
|
|
67011
67142
|
).pipe(Layer_exports.provide(NodeHttpClient_exports.layerUndici));
|
|
67012
67143
|
|
|
@@ -67208,17 +67339,17 @@ function asEnvelope(cause) {
|
|
|
67208
67339
|
}
|
|
67209
67340
|
|
|
67210
67341
|
// src/update-check.ts
|
|
67211
|
-
import { mkdirSync as
|
|
67212
|
-
import
|
|
67342
|
+
import { mkdirSync as mkdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "node:fs";
|
|
67343
|
+
import path9 from "node:path";
|
|
67213
67344
|
var UPDATE_CHECK_INTERVAL_MS = 3 * 60 * 60 * 1e3;
|
|
67214
67345
|
var REGISTRY_LATEST_URL = "https://registry.npmjs.org/@glasser-ai/cli/latest";
|
|
67215
67346
|
var FETCH_TIMEOUT_MS = 2e3;
|
|
67216
67347
|
function updateCheckPath(dir2) {
|
|
67217
|
-
return
|
|
67348
|
+
return path9.join(dir2, "update-check.json");
|
|
67218
67349
|
}
|
|
67219
67350
|
function readState(dir2) {
|
|
67220
67351
|
try {
|
|
67221
|
-
const parsed = JSON.parse(
|
|
67352
|
+
const parsed = JSON.parse(readFileSync5(updateCheckPath(dir2), "utf8"));
|
|
67222
67353
|
if (typeof parsed !== "object" || parsed === null) return null;
|
|
67223
67354
|
return parsed;
|
|
67224
67355
|
} catch {
|
|
@@ -67279,7 +67410,7 @@ async function refreshLatestVersion(options4) {
|
|
|
67279
67410
|
} catch {
|
|
67280
67411
|
}
|
|
67281
67412
|
try {
|
|
67282
|
-
|
|
67413
|
+
mkdirSync4(options4.dir, { recursive: true });
|
|
67283
67414
|
const previous = readState(options4.dir);
|
|
67284
67415
|
const state = {
|
|
67285
67416
|
last_checked_at: new Date(now2()).toISOString(),
|
|
@@ -67287,7 +67418,7 @@ async function refreshLatestVersion(options4) {
|
|
|
67287
67418
|
// connection must not erase a known notice.
|
|
67288
67419
|
...latest !== void 0 ? { latest_version: latest } : previous?.latest_version !== void 0 ? { latest_version: previous.latest_version } : {}
|
|
67289
67420
|
};
|
|
67290
|
-
|
|
67421
|
+
writeFileSync5(updateCheckPath(options4.dir), `${JSON.stringify(state, null, 2)}
|
|
67291
67422
|
`);
|
|
67292
67423
|
} catch {
|
|
67293
67424
|
}
|