@glasser-ai/cli 0.1.34 → 0.1.40

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 +36 -10
  2. package/package.json +1 -1
package/dist/glasser.js CHANGED
@@ -64449,7 +64449,29 @@ var SearchEndpointsRequest = Schema_exports.Struct({
64449
64449
  /** 上一页响应的 next_cursor。绑定于 query:拿别的查询的游标来翻是 400,不是从头开始。 */
64450
64450
  cursor: Schema_exports.optional(Schema_exports.String)
64451
64451
  });
64452
- var SearchEndpointsResponse = Paginated(EndpointSummary);
64452
+ var SearchHit = Schema_exports.Struct({
64453
+ ...endpointFields,
64454
+ /**
64455
+ * 查询与这支检索文本的余弦相似度,向量召回没跑时为 null。
64456
+ *
64457
+ * **它是相似度信号,不是判决。** 名次来自关键词与向量两路的融合,不是这个数;
64458
+ * 而「目录里有没有这个能力」这件事,分数回答不了 —— 一页分数都低不代表没有。
64459
+ * 2026-09-12 有一个 agent 看了五行就告诉用户「Glasser 没有这个能力」,而那支
64460
+ * 免费的端点排在第六行。契约因此不提供任何「判定不存在」的办法。
64461
+ *
64462
+ * 范围是 [-1, 1]:向量是预归一化的,点积不做截断,所以负值合法。
64463
+ */
64464
+ score: Schema_exports.NullOr(Schema_exports.Number).annotate({
64465
+ description: "Cosine similarity between the query and this endpoint's searchable text, in [-1, 1]; null when semantic scoring did not run. A similarity signal for comparing rows, not a verdict: ranking fuses two arms, and neither a low score nor the end of the results shows that a capability is absent."
64466
+ })
64467
+ }).check(runModePairing);
64468
+ var SearchEndpointsResponse = Schema_exports.Struct({
64469
+ data: Schema_exports.Array(SearchHit),
64470
+ next_cursor: Schema_exports.NullOr(Schema_exports.String),
64471
+ total: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0)).annotate({
64472
+ description: "Total number of ranked candidates across all pages."
64473
+ })
64474
+ });
64453
64475
  var InspectEndpointRequest = Schema_exports.Struct({
64454
64476
  provider: ProviderSlug,
64455
64477
  endpoint: EndpointKey,
@@ -64549,8 +64571,9 @@ var ListRunsQuery = Schema_exports.Struct({
64549
64571
  endpoint: Schema_exports.optional(Schema_exports.String)
64550
64572
  });
64551
64573
  var ListRunsResponse = Paginated(Run);
64574
+ var RunId = Schema_exports.String.check(Schema_exports.isUUID());
64552
64575
  var RunIdParam = Schema_exports.Struct({
64553
- runId: Schema_exports.String.check(Schema_exports.isMinLength(1))
64576
+ runId: RunId
64554
64577
  });
64555
64578
 
64556
64579
  // ../../packages/contract/src/api.ts
@@ -64574,7 +64597,7 @@ var endpoints = HttpApiGroup_exports.make("Endpoints").add(
64574
64597
  operation(
64575
64598
  "endpoints-search",
64576
64599
  "Search runnable endpoints",
64577
- "Searches the data sources by keyword and returns ranked endpoint summaries, each identified by provider, endpoint, and endpoint_version, with its price and run mode. Several providers may sell the same capability; the ranking is relevance-only and the price is shown alongside so the caller chooses. Pages are short by default (5, up to 20): pass next_cursor back as cursor for the next page; the cursor is bound to the query. The list is already scoped to the calling key's effective policy: every endpoint in it is one this key can run. An empty list is a valid answer \u2014 when no data source matches, the endpoint says so instead of returning the nearest wrong operation."
64600
+ "Searches the data sources by keyword and returns ranked endpoint summaries, each identified by provider, endpoint, and endpoint_version, with its price and run mode. Several providers may sell the same capability; the ranking is relevance-only and the price is shown alongside so the caller chooses. Pages are short by default (5, up to 20): read `total` for how many candidates exist, then pass next_cursor back as cursor for the next page; the cursor is bound to the query. The list is already scoped to the calling key's effective policy: every endpoint in it is one this key can run. Each hit carries a `score`, the cosine similarity between the query and that endpoint's description: use it to compare rows, and inspect an endpoint before running it. The ranking returns its nearest candidates rather than withholding them, so neither a page of low scores nor reaching the last page shows that a capability is absent \u2014 try other words before concluding that."
64578
64601
  )
64579
64602
  )
64580
64603
  ).add(
@@ -65171,24 +65194,25 @@ var search = Command_exports.make(
65171
65194
  );
65172
65195
  if (json2) return yield* Console_exports.log(jsonPretty(response));
65173
65196
  if (response.data.length === 0) {
65174
- return yield* Console_exports.log(
65175
- "No endpoints match. An empty list is a real answer \u2014 try a broader query."
65176
- );
65197
+ return yield* Console_exports.log("No endpoints match \u2014 try other words.");
65177
65198
  }
65178
65199
  yield* Console_exports.log(
65179
65200
  table2(
65180
- ["Provider", "Endpoint", "Ver", "Price", "Mode", "Name"],
65201
+ ["Provider", "Endpoint", "Ver", "Score", "Price", "Mode", "Name"],
65181
65202
  response.data.map((endpoint2) => [
65182
65203
  providerLine(endpoint2),
65183
65204
  endpoint2.endpoint,
65184
65205
  String(endpoint2.endpoint_version),
65206
+ scoreLine(endpoint2.score),
65185
65207
  priceLine(endpoint2.price),
65186
65208
  modeLine(endpoint2),
65187
65209
  endpoint2.name
65188
65210
  ])
65189
65211
  )
65190
65212
  );
65191
- yield* Console_exports.error("\nInspect with: glasser inspect -p <provider> -e <endpoint>");
65213
+ yield* Console_exports.error(`
65214
+ Showing ${response.data.length} of ${response.total} matches.`);
65215
+ yield* Console_exports.error("Inspect with: glasser inspect -p <provider> -e <endpoint>");
65192
65216
  if (response.next_cursor !== null) {
65193
65217
  yield* Console_exports.error(`Next page: ${nextPageLine(query, response.next_cursor)}`);
65194
65218
  }
@@ -65198,6 +65222,7 @@ function nextPageLine(query, cursor) {
65198
65222
  const base2 = `glasser search --cursor ${cursor}`;
65199
65223
  return Option_exports.isSome(query) ? `${base2} -- ${shellQuote(query.value)}` : base2;
65200
65224
  }
65225
+ var scoreLine = (score) => score === null ? "-" : score.toFixed(2);
65201
65226
  function providerLine(endpoint2) {
65202
65227
  return endpoint2.provider_label === endpoint2.provider ? endpoint2.provider : `${endpoint2.provider} (${endpoint2.provider_label})`;
65203
65228
  }
@@ -65885,7 +65910,8 @@ function withRetryGuidance(failure, retryCommand) {
65885
65910
  // src/commands/runs.ts
65886
65911
  var runIdFlag = Flag_exports.string("run-id").pipe(
65887
65912
  Flag_exports.withAlias("r"),
65888
- Flag_exports.withDescription("The Run id")
65913
+ Flag_exports.withDescription("The Run id"),
65914
+ Flag_exports.withSchema(RunId)
65889
65915
  );
65890
65916
  var runsList = Command_exports.make(
65891
65917
  "list",
@@ -65979,7 +66005,7 @@ var runs2 = Command_exports.make("runs").pipe(
65979
66005
  // package.json
65980
66006
  var package_default = {
65981
66007
  name: "@glasser-ai/cli",
65982
- version: "0.1.34",
66008
+ version: "0.1.40",
65983
66009
  description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
65984
66010
  license: "MIT",
65985
66011
  type: "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glasser-ai/cli",
3
- "version": "0.1.34",
3
+ "version": "0.1.40",
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",