@glasser-ai/cli 0.1.19 → 0.1.20
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 +81 -76
- package/package.json +1 -1
package/dist/glasser.js
CHANGED
|
@@ -64824,78 +64824,7 @@ function sleepMs(ms) {
|
|
|
64824
64824
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
64825
64825
|
}
|
|
64826
64826
|
|
|
64827
|
-
// package.json
|
|
64828
|
-
var package_default = {
|
|
64829
|
-
name: "@glasser-ai/cli",
|
|
64830
|
-
version: "0.1.19",
|
|
64831
|
-
description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
|
|
64832
|
-
license: "MIT",
|
|
64833
|
-
type: "module",
|
|
64834
|
-
bin: {
|
|
64835
|
-
glasser: "./dist/glasser.js"
|
|
64836
|
-
},
|
|
64837
|
-
files: [
|
|
64838
|
-
"dist",
|
|
64839
|
-
"!dist/metafile.json",
|
|
64840
|
-
"README.md",
|
|
64841
|
-
"LICENSE",
|
|
64842
|
-
"THIRD_PARTY_NOTICES"
|
|
64843
|
-
],
|
|
64844
|
-
repository: {
|
|
64845
|
-
type: "git",
|
|
64846
|
-
url: "git+https://github.com/Surething-io/glasser.git",
|
|
64847
|
-
directory: "apps/cli"
|
|
64848
|
-
},
|
|
64849
|
-
homepage: "https://glasser.ai/docs/cli",
|
|
64850
|
-
keywords: [
|
|
64851
|
-
"glasser",
|
|
64852
|
-
"cli",
|
|
64853
|
-
"api",
|
|
64854
|
-
"endpoints",
|
|
64855
|
-
"agents"
|
|
64856
|
-
],
|
|
64857
|
-
publishConfig: {
|
|
64858
|
-
access: "public",
|
|
64859
|
-
provenance: false
|
|
64860
|
-
},
|
|
64861
|
-
scripts: {
|
|
64862
|
-
dev: "tsx src/main.ts",
|
|
64863
|
-
build: "node build.mjs",
|
|
64864
|
-
prepack: "node build.mjs && node ../../scripts/generate-third-party-notices.mjs",
|
|
64865
|
-
lint: "biome lint .",
|
|
64866
|
-
"lint:fix": "biome lint --write .",
|
|
64867
|
-
format: "biome format --write .",
|
|
64868
|
-
"format:check": "biome format .",
|
|
64869
|
-
check: "biome check --write .",
|
|
64870
|
-
"check-types": "tsc --noEmit",
|
|
64871
|
-
test: "vitest run",
|
|
64872
|
-
"test:watch": "vitest",
|
|
64873
|
-
"test:p0": "vitest run .p0. --passWithNoTests",
|
|
64874
|
-
"test:p1": "vitest run .p1. --passWithNoTests",
|
|
64875
|
-
"test:integration": "vitest run --config vitest.integration.config.ts"
|
|
64876
|
-
},
|
|
64877
|
-
devDependencies: {
|
|
64878
|
-
"@effect/platform-node": "4.0.0-rc.112",
|
|
64879
|
-
"@repo/contract": "workspace:*",
|
|
64880
|
-
"@repo/lib": "workspace:*",
|
|
64881
|
-
"@repo/typescript-config": "workspace:*",
|
|
64882
|
-
"@types/node": "^22.15.3",
|
|
64883
|
-
effect: "4.0.0-rc.112",
|
|
64884
|
-
esbuild: "^0.26.0",
|
|
64885
|
-
tsx: "^4.21.0",
|
|
64886
|
-
typescript: "catalog:",
|
|
64887
|
-
vitest: "^4.1.5"
|
|
64888
|
-
},
|
|
64889
|
-
engines: {
|
|
64890
|
-
node: ">=22"
|
|
64891
|
-
}
|
|
64892
|
-
};
|
|
64893
|
-
|
|
64894
|
-
// src/version.ts
|
|
64895
|
-
var CLI_VERSION = package_default.version;
|
|
64896
|
-
|
|
64897
64827
|
// src/client.ts
|
|
64898
|
-
var USER_AGENT = `@glasser-ai/cli/${CLI_VERSION}`;
|
|
64899
64828
|
var NO_KEY_MESSAGE = "No Key configured. Run `glasser keys add --label <label> --key <key>` or set GLASSER_API_KEY.";
|
|
64900
64829
|
var ApiFailure = class extends Data_exports.TaggedError("ApiFailure") {
|
|
64901
64830
|
};
|
|
@@ -64917,10 +64846,8 @@ var buildApiWith = (key) => Effect_exports.gen(function* () {
|
|
|
64917
64846
|
baseUrl: baseUrl2,
|
|
64918
64847
|
transformClient: (http2) => http2.pipe(
|
|
64919
64848
|
HttpClient_exports.mapRequest(HttpClientRequest_exports.bearerToken(key)),
|
|
64920
|
-
//
|
|
64921
|
-
//
|
|
64922
|
-
// 三者打的是同一批端点。它不携带任何机器或用户信息。
|
|
64923
|
-
HttpClient_exports.mapRequest(HttpClientRequest_exports.setHeader("user-agent", USER_AGENT)),
|
|
64849
|
+
// User-Agent 不在这里加:身份属于**传输层**(http.ts),这样登录流那样
|
|
64850
|
+
// 用不了本客户端的路径也一样报得上名。
|
|
64924
64851
|
HttpClient_exports.transform(
|
|
64925
64852
|
(effect2) => Effect_exports.suspend(() => {
|
|
64926
64853
|
box.current = null;
|
|
@@ -65965,6 +65892,83 @@ var runs2 = Command_exports.make("runs").pipe(
|
|
|
65965
65892
|
Command_exports.withSubcommands([runsList, runsGet, runsStop])
|
|
65966
65893
|
);
|
|
65967
65894
|
|
|
65895
|
+
// package.json
|
|
65896
|
+
var package_default = {
|
|
65897
|
+
name: "@glasser-ai/cli",
|
|
65898
|
+
version: "0.1.20",
|
|
65899
|
+
description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
|
|
65900
|
+
license: "MIT",
|
|
65901
|
+
type: "module",
|
|
65902
|
+
bin: {
|
|
65903
|
+
glasser: "./dist/glasser.js"
|
|
65904
|
+
},
|
|
65905
|
+
files: [
|
|
65906
|
+
"dist",
|
|
65907
|
+
"!dist/metafile.json",
|
|
65908
|
+
"README.md",
|
|
65909
|
+
"LICENSE",
|
|
65910
|
+
"THIRD_PARTY_NOTICES"
|
|
65911
|
+
],
|
|
65912
|
+
repository: {
|
|
65913
|
+
type: "git",
|
|
65914
|
+
url: "git+https://github.com/Surething-io/glasser.git",
|
|
65915
|
+
directory: "apps/cli"
|
|
65916
|
+
},
|
|
65917
|
+
homepage: "https://glasser.ai/docs/cli",
|
|
65918
|
+
keywords: [
|
|
65919
|
+
"glasser",
|
|
65920
|
+
"cli",
|
|
65921
|
+
"api",
|
|
65922
|
+
"endpoints",
|
|
65923
|
+
"agents"
|
|
65924
|
+
],
|
|
65925
|
+
publishConfig: {
|
|
65926
|
+
access: "public",
|
|
65927
|
+
provenance: false
|
|
65928
|
+
},
|
|
65929
|
+
scripts: {
|
|
65930
|
+
dev: "tsx src/main.ts",
|
|
65931
|
+
build: "node build.mjs",
|
|
65932
|
+
prepack: "node build.mjs && node ../../scripts/generate-third-party-notices.mjs",
|
|
65933
|
+
lint: "biome lint .",
|
|
65934
|
+
"lint:fix": "biome lint --write .",
|
|
65935
|
+
format: "biome format --write .",
|
|
65936
|
+
"format:check": "biome format .",
|
|
65937
|
+
check: "biome check --write .",
|
|
65938
|
+
"check-types": "tsc --noEmit",
|
|
65939
|
+
test: "vitest run",
|
|
65940
|
+
"test:watch": "vitest",
|
|
65941
|
+
"test:p0": "vitest run .p0. --passWithNoTests",
|
|
65942
|
+
"test:p1": "vitest run .p1. --passWithNoTests",
|
|
65943
|
+
"test:integration": "vitest run --config vitest.integration.config.ts"
|
|
65944
|
+
},
|
|
65945
|
+
devDependencies: {
|
|
65946
|
+
"@effect/platform-node": "4.0.0-rc.112",
|
|
65947
|
+
"@repo/contract": "workspace:*",
|
|
65948
|
+
"@repo/lib": "workspace:*",
|
|
65949
|
+
"@repo/typescript-config": "workspace:*",
|
|
65950
|
+
"@types/node": "^22.15.3",
|
|
65951
|
+
effect: "4.0.0-rc.112",
|
|
65952
|
+
esbuild: "^0.26.0",
|
|
65953
|
+
tsx: "^4.21.0",
|
|
65954
|
+
typescript: "catalog:",
|
|
65955
|
+
vitest: "^4.1.5"
|
|
65956
|
+
},
|
|
65957
|
+
engines: {
|
|
65958
|
+
node: ">=22"
|
|
65959
|
+
}
|
|
65960
|
+
};
|
|
65961
|
+
|
|
65962
|
+
// src/version.ts
|
|
65963
|
+
var CLI_VERSION = package_default.version;
|
|
65964
|
+
|
|
65965
|
+
// src/http.ts
|
|
65966
|
+
var USER_AGENT = `@glasser-ai/cli/${CLI_VERSION}`;
|
|
65967
|
+
var withClientIdentity = (client) => client.pipe(HttpClient_exports.mapRequest(HttpClientRequest_exports.setHeader("user-agent", USER_AGENT)));
|
|
65968
|
+
var HttpClientLayer = HttpClient_exports.layerMergedContext(
|
|
65969
|
+
Effect_exports.map(HttpClient_exports.HttpClient, withClientIdentity)
|
|
65970
|
+
).pipe(Layer_exports.provide(NodeHttpClient_exports.layerUndici));
|
|
65971
|
+
|
|
65968
65972
|
// src/render/errors.ts
|
|
65969
65973
|
function describeFailure(error2, extraHint) {
|
|
65970
65974
|
const base2 = describe(error2);
|
|
@@ -66193,7 +66197,8 @@ var StrictEnvLayer = Layer_exports.succeed(
|
|
|
66193
66197
|
);
|
|
66194
66198
|
var MainLayer = Layer_exports.mergeAll(
|
|
66195
66199
|
NodeServices_exports.layer,
|
|
66196
|
-
|
|
66200
|
+
// 出网只有这一个客户端,身份由它保证(http.ts)。
|
|
66201
|
+
HttpClientLayer,
|
|
66197
66202
|
CliConfigLayer,
|
|
66198
66203
|
StrictEnvLayer
|
|
66199
66204
|
);
|