@glasser-ai/cli 0.1.25 → 0.1.28

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.
Files changed (2) hide show
  1. package/dist/glasser.js +19 -25
  2. package/package.json +1 -1
package/dist/glasser.js CHANGED
@@ -64382,7 +64382,11 @@ var SearchEndpointsResponse = Paginated(EndpointSummary);
64382
64382
  var InspectEndpointRequest = Schema_exports.Struct({
64383
64383
  provider: ProviderSlug,
64384
64384
  endpoint: EndpointKey,
64385
- endpoint_version: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isGreaterThan(0)))
64385
+ endpoint_version: Schema_exports.optional(
64386
+ Schema_exports.Int.check(Schema_exports.isGreaterThan(0)).annotate({
64387
+ description: "Select a supported Endpoint version, or omit for the default. Returns the current Price for that version; selecting a version does not lock its Price."
64388
+ })
64389
+ )
64386
64390
  });
64387
64391
 
64388
64392
  // ../../packages/contract/src/rate-limit.ts
@@ -64460,12 +64464,12 @@ var RunRequest = Schema_exports.Struct({
64460
64464
  endpoint: EndpointKey,
64461
64465
  /** Provider 原生输入 —— Adapter 只注入凭证与传输,不改字段名。 */
64462
64466
  input: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown)),
64463
- /**
64464
- * inspect 时看到的版本。传了它,版本在 inspect 与 run 之间变更会得到 409
64465
- * 而不是按新条款成交的意外;不传则接受当前版本,返回的 Run 总会记录实际版本。
64466
- * 建议 agent 恒传。
64467
- */
64468
- endpoint_version: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isGreaterThan(0)))
64467
+ /** 支持的兼容契约号,不固定 Price;新 Run 按受理时的 Price,已受理 Run 保持原条款。 */
64468
+ endpoint_version: Schema_exports.optional(
64469
+ Schema_exports.Int.check(Schema_exports.isGreaterThan(0)).annotate({
64470
+ description: "Select a supported Endpoint version. Compatible updates keep this version; it does not lock the Price. New Runs use the Price at admission. Omit to use the default version. Unavailable or retired versions return 409."
64471
+ })
64472
+ )
64469
64473
  });
64470
64474
  var ListRunsQuery = Schema_exports.Struct({
64471
64475
  ...PaginationQuery.fields,
@@ -64511,7 +64515,7 @@ var endpoints = HttpApiGroup_exports.make("Endpoints").add(
64511
64515
  operation(
64512
64516
  "endpoints-inspect",
64513
64517
  "Inspect one endpoint: schemas, price, version",
64514
- "Returns the full execution contract of one endpoint: the provider-native input JSON Schema, the output JSON Schema when a trustworthy one exists (null otherwise \u2014 samples never imply a contract), its source, the price with every charge clause, the current endpoint_version, the run mode, a sample input, and a link to the provider's own documentation. A sync endpoint also publishes timeout_ms, the maximum time from request to terminal response \u2014 set your HTTP client timeout above it. Passing endpoint_version pins the version you expect: anything other than the current version answers 409, the same rule run applies."
64518
+ "Returns the full execution contract of one endpoint: the provider-native input JSON Schema, the output JSON Schema when a trustworthy one exists (null otherwise \u2014 samples never imply a contract), its source, the price with every charge clause, the current endpoint_version, the run mode, a sample input, and a link to the provider's own documentation. A sync endpoint also publishes timeout_ms, the maximum time from request to terminal response \u2014 set your HTTP client timeout above it. Passing endpoint_version selects a supported version, including an older one. Compatible updates keep that version. Unavailable or retired versions answer 409. Price can change without a version change; new Runs use the Price at admission, while accepted Runs keep their original Price."
64515
64519
  )
64516
64520
  )
64517
64521
  );
@@ -64538,7 +64542,7 @@ var runs = HttpApiGroup_exports.make("Runs").add(
64538
64542
  operation(
64539
64543
  "runs-create",
64540
64544
  "Run an endpoint",
64541
- "Admits one execution: the policy is checked, a hold is reserved for the price's maximum charge, and a run is created. Input is provider-native \u2014 construct it against the inspected input_schema. A sync endpoint always answers 200 with the terminal run inside its published timeout_ms \u2014 it never returns 202, so no polling code is needed. An async endpoint answers 200 when the run is terminal within a short server budget, otherwise 202 with the in-flight run, which you can poll or stop. Status reports whether a usable provider response won settlement, never whether the provider accepted the request: a provider 404 or 500 is a COMPLETED run whose provider_response carries the received status, charged by the price's NO_RESULT or PROVIDER_ERROR clause. The Idempotency-Key header is required \u2014 a retry with the same key returns the same run and is never charged twice, while the same key with a different request body returns 409. Balance and policy refusals happen before admission and create no run."
64545
+ "Admits one execution at the selected supported Endpoint version (the default if omitted). The version does not lock Price: new Runs use its current Price, and accepted Runs keep that exact Price through settlement. The policy is checked, a hold is reserved for the price's maximum charge, and a run is created. Input is provider-native \u2014 construct it against the inspected input_schema. A sync endpoint always answers 200 with the terminal run inside its published timeout_ms \u2014 it never returns 202, so no polling code is needed. An async endpoint answers 200 when the run is terminal within a short server budget, otherwise 202 with the in-flight run, which you can poll or stop. Status reports whether a usable provider response won settlement, never whether the provider accepted the request: a provider 404 or 500 is a COMPLETED run whose provider_response carries the received status, charged by the price's NO_RESULT or PROVIDER_ERROR clause. The Idempotency-Key header is required \u2014 a retry with the same key returns the same run and is never charged twice, while the same key with a different request body returns 409. Balance and policy refusals happen before admission and create no run."
64542
64546
  )
64543
64547
  )
64544
64548
  ).add(
@@ -64933,7 +64937,9 @@ var endpointVersionFlag = Flag_exports.integer("endpoint-version").pipe(
64933
64937
  (error2) => error2.message
64934
64938
  ),
64935
64939
  Flag_exports.optional,
64936
- Flag_exports.withDescription("Pin the endpoint version you inspected (409 if it is no longer current)")
64940
+ Flag_exports.withDescription(
64941
+ "Select a supported Endpoint version (does not lock Price; 409 if unavailable or retired)"
64942
+ )
64937
64943
  );
64938
64944
  var limitFlag = Flag_exports.integer("limit").pipe(
64939
64945
  Flag_exports.mapTryCatch(
@@ -65513,19 +65519,6 @@ ${kvBlock([
65513
65519
  ["Available", `$${balance3.available_usd}`]
65514
65520
  ])}`
65515
65521
  );
65516
- const catalog = yield* call(
65517
- client.Endpoints["endpoints-search"]({ payload: { limit: 3 } })
65518
- );
65519
- if (catalog.data.length > 0) {
65520
- yield* Console_exports.log("\nTry one of these:");
65521
- for (const endpoint2 of catalog.data) {
65522
- yield* Console_exports.log(
65523
- ` ${endpoint2.name} \u2014 ${priceLine(endpoint2.price)}, ${modeLine(endpoint2)}
65524
- glasser inspect -p ${endpoint2.provider} -e ${endpoint2.endpoint}`
65525
- );
65526
- }
65527
- }
65528
- yield* Console_exports.log("\nYou're ready.");
65529
65522
  }).pipe(
65530
65523
  Effect_exports.catch(
65531
65524
  () => Console_exports.error(
@@ -65533,6 +65526,7 @@ ${kvBlock([
65533
65526
  )
65534
65527
  )
65535
65528
  );
65529
+ yield* Console_exports.error('\nNext: glasser search -q "<what you need>"');
65536
65530
  })
65537
65531
  ).pipe(Command_exports.withDescription("Log in through the browser and store a Key"));
65538
65532
 
@@ -65901,7 +65895,7 @@ var runs2 = Command_exports.make("runs").pipe(
65901
65895
  // package.json
65902
65896
  var package_default = {
65903
65897
  name: "@glasser-ai/cli",
65904
- version: "0.1.25",
65898
+ version: "0.1.28",
65905
65899
  description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
65906
65900
  license: "MIT",
65907
65901
  type: "module",
@@ -66079,7 +66073,7 @@ function hintFor(envelope) {
66079
66073
  const current = envelope.details?.current_version;
66080
66074
  if (typeof current === "number") {
66081
66075
  return {
66082
- hint: `The current version is ${current}. Re-run inspect, or pass --endpoint-version ${current}.`
66076
+ hint: `The requested version is unavailable or retired. Run inspect with --endpoint-version ${current} and check its input schema before using it.`
66083
66077
  };
66084
66078
  }
66085
66079
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glasser-ai/cli",
3
- "version": "0.1.25",
3
+ "version": "0.1.28",
4
4
  "description": "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",