@glasser-ai/cli 0.1.15 → 0.1.17
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 +28 -9
- package/package.json +1 -1
package/dist/glasser.js
CHANGED
|
@@ -64416,6 +64416,13 @@ var ChargeBasis = Schema_exports.Struct({
|
|
|
64416
64416
|
});
|
|
64417
64417
|
var Run = Schema_exports.Struct({
|
|
64418
64418
|
id: Schema_exports.String,
|
|
64419
|
+
/**
|
|
64420
|
+
* 这次 Run 在控制台里的页面:上面是获取过程的卡片,下面是 Provider 返回的
|
|
64421
|
+
* Records。它是 agent 交付答案时引用数据来源用的那条链接 —— 一次 Run 一条,
|
|
64422
|
+
* 像报告末尾的一条脚注;也是这笔付费数据的备份所在。只有 Workspace 成员
|
|
64423
|
+
* 打得开;里面的 Records 永远不公开。
|
|
64424
|
+
*/
|
|
64425
|
+
run_url: Schema_exports.String,
|
|
64419
64426
|
provider: ProviderSlug,
|
|
64420
64427
|
endpoint: EndpointKey,
|
|
64421
64428
|
endpoint_version: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
@@ -64820,7 +64827,7 @@ function sleepMs(ms) {
|
|
|
64820
64827
|
// package.json
|
|
64821
64828
|
var package_default = {
|
|
64822
64829
|
name: "@glasser-ai/cli",
|
|
64823
|
-
version: "0.1.
|
|
64830
|
+
version: "0.1.17",
|
|
64824
64831
|
description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
|
|
64825
64832
|
license: "MIT",
|
|
64826
64833
|
type: "module",
|
|
@@ -65038,6 +65045,10 @@ function literalsFlag(name, literals2, description) {
|
|
|
65038
65045
|
Flag_exports.withDescription(description)
|
|
65039
65046
|
);
|
|
65040
65047
|
}
|
|
65048
|
+
function shellQuote(value3) {
|
|
65049
|
+
if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(value3)) return value3;
|
|
65050
|
+
return `'${value3.replaceAll("'", "'\\''")}'`;
|
|
65051
|
+
}
|
|
65041
65052
|
|
|
65042
65053
|
// src/commands/balance.ts
|
|
65043
65054
|
var history = Command_exports.make(
|
|
@@ -65206,13 +65217,23 @@ Output schema: null \u2014 the output is the provider's raw body; see the docs l
|
|
|
65206
65217
|
Output schema (${detail.output_schema_source}):
|
|
65207
65218
|
${jsonPretty(detail.output_schema)}`
|
|
65208
65219
|
);
|
|
65209
|
-
yield* Console_exports.log(
|
|
65210
|
-
`
|
|
65220
|
+
yield* Console_exports.log(`
|
|
65211
65221
|
Run it:
|
|
65212
|
-
|
|
65213
|
-
);
|
|
65222
|
+
${runItLine(detail)}`);
|
|
65214
65223
|
})
|
|
65215
65224
|
).pipe(Command_exports.withDescription("Inspect one endpoint: schemas, price, version"));
|
|
65225
|
+
function runItLine(detail) {
|
|
65226
|
+
return [
|
|
65227
|
+
"glasser run -p",
|
|
65228
|
+
shellQuote(detail.provider),
|
|
65229
|
+
"-e",
|
|
65230
|
+
shellQuote(detail.endpoint),
|
|
65231
|
+
"-i",
|
|
65232
|
+
shellQuote(JSON.stringify(detail.sample_input)),
|
|
65233
|
+
"--endpoint-version",
|
|
65234
|
+
String(detail.endpoint_version)
|
|
65235
|
+
].join(" ");
|
|
65236
|
+
}
|
|
65216
65237
|
|
|
65217
65238
|
// src/commands/keys.ts
|
|
65218
65239
|
var labelFlag = Flag_exports.string("label").pipe(
|
|
@@ -65627,6 +65648,8 @@ import { writeFileSync as writeFileSync2 } from "node:fs";
|
|
|
65627
65648
|
function renderRun(run7) {
|
|
65628
65649
|
const lines2 = kvBlock([
|
|
65629
65650
|
["Run ID", run7.id],
|
|
65651
|
+
// 引用链接紧跟 id:agent 交付答案时要念给用户的就是它(SKILL.md 规则 7)。
|
|
65652
|
+
["Run URL", run7.run_url],
|
|
65630
65653
|
["Status", run7.status],
|
|
65631
65654
|
[
|
|
65632
65655
|
"Response",
|
|
@@ -65825,10 +65848,6 @@ function buildRetryCommand(context3) {
|
|
|
65825
65848
|
parts2.push("--idempotency-key", shellQuote(context3.idempotencyKey));
|
|
65826
65849
|
return parts2.join(" ");
|
|
65827
65850
|
}
|
|
65828
|
-
function shellQuote(value3) {
|
|
65829
|
-
if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(value3)) return value3;
|
|
65830
|
-
return `'${value3.replaceAll("'", "'\\''")}'`;
|
|
65831
|
-
}
|
|
65832
65851
|
function withRetryGuidance(failure, retryCommand) {
|
|
65833
65852
|
const envelope = failure.cause;
|
|
65834
65853
|
const code = typeof envelope?.code === "string" ? envelope.code : null;
|