@glasser-ai/cli 0.1.34 → 0.1.35

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 +32 -8
  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,
@@ -64574,7 +64596,7 @@ var endpoints = HttpApiGroup_exports.make("Endpoints").add(
64574
64596
  operation(
64575
64597
  "endpoints-search",
64576
64598
  "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."
64599
+ "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
64600
  )
64579
64601
  )
64580
64602
  ).add(
@@ -65171,24 +65193,25 @@ var search = Command_exports.make(
65171
65193
  );
65172
65194
  if (json2) return yield* Console_exports.log(jsonPretty(response));
65173
65195
  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
- );
65196
+ return yield* Console_exports.log("No endpoints match \u2014 try other words.");
65177
65197
  }
65178
65198
  yield* Console_exports.log(
65179
65199
  table2(
65180
- ["Provider", "Endpoint", "Ver", "Price", "Mode", "Name"],
65200
+ ["Provider", "Endpoint", "Ver", "Score", "Price", "Mode", "Name"],
65181
65201
  response.data.map((endpoint2) => [
65182
65202
  providerLine(endpoint2),
65183
65203
  endpoint2.endpoint,
65184
65204
  String(endpoint2.endpoint_version),
65205
+ scoreLine(endpoint2.score),
65185
65206
  priceLine(endpoint2.price),
65186
65207
  modeLine(endpoint2),
65187
65208
  endpoint2.name
65188
65209
  ])
65189
65210
  )
65190
65211
  );
65191
- yield* Console_exports.error("\nInspect with: glasser inspect -p <provider> -e <endpoint>");
65212
+ yield* Console_exports.error(`
65213
+ Showing ${response.data.length} of ${response.total} matches.`);
65214
+ yield* Console_exports.error("Inspect with: glasser inspect -p <provider> -e <endpoint>");
65192
65215
  if (response.next_cursor !== null) {
65193
65216
  yield* Console_exports.error(`Next page: ${nextPageLine(query, response.next_cursor)}`);
65194
65217
  }
@@ -65198,6 +65221,7 @@ function nextPageLine(query, cursor) {
65198
65221
  const base2 = `glasser search --cursor ${cursor}`;
65199
65222
  return Option_exports.isSome(query) ? `${base2} -- ${shellQuote(query.value)}` : base2;
65200
65223
  }
65224
+ var scoreLine = (score) => score === null ? "-" : score.toFixed(2);
65201
65225
  function providerLine(endpoint2) {
65202
65226
  return endpoint2.provider_label === endpoint2.provider ? endpoint2.provider : `${endpoint2.provider} (${endpoint2.provider_label})`;
65203
65227
  }
@@ -65979,7 +66003,7 @@ var runs2 = Command_exports.make("runs").pipe(
65979
66003
  // package.json
65980
66004
  var package_default = {
65981
66005
  name: "@glasser-ai/cli",
65982
- version: "0.1.34",
66006
+ version: "0.1.35",
65983
66007
  description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
65984
66008
  license: "MIT",
65985
66009
  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.35",
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",