@glasser-ai/cli 0.1.18 → 0.1.19
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 +14 -5
- package/package.json +1 -1
package/dist/glasser.js
CHANGED
|
@@ -64493,7 +64493,7 @@ var endpoints = HttpApiGroup_exports.make("Endpoints").add(
|
|
|
64493
64493
|
operation(
|
|
64494
64494
|
"endpoints-search",
|
|
64495
64495
|
"Search runnable endpoints",
|
|
64496
|
-
"Searches the
|
|
64496
|
+
"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."
|
|
64497
64497
|
)
|
|
64498
64498
|
)
|
|
64499
64499
|
).add(
|
|
@@ -64827,7 +64827,7 @@ function sleepMs(ms) {
|
|
|
64827
64827
|
// package.json
|
|
64828
64828
|
var package_default = {
|
|
64829
64829
|
name: "@glasser-ai/cli",
|
|
64830
|
-
version: "0.1.
|
|
64830
|
+
version: "0.1.19",
|
|
64831
64831
|
description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
|
|
64832
64832
|
license: "MIT",
|
|
64833
64833
|
type: "module",
|
|
@@ -65115,6 +65115,16 @@ var balanceRoot = Command_exports.make(
|
|
|
65115
65115
|
).pipe(Command_exports.withDescription("Balance, held and available"));
|
|
65116
65116
|
var balance2 = balanceRoot.pipe(Command_exports.withSubcommands([history]));
|
|
65117
65117
|
|
|
65118
|
+
// ../../packages/lib/src/price-line.ts
|
|
65119
|
+
function priceRuleParts(rule) {
|
|
65120
|
+
if (rule.type === "flat") return { main: `$${rule.amount_usd}/call`, cap: null };
|
|
65121
|
+
return { main: `$${rule.per_result_usd}/result`, cap: rule.cap_usd };
|
|
65122
|
+
}
|
|
65123
|
+
function priceRuleLine(rule) {
|
|
65124
|
+
const parts2 = priceRuleParts(rule);
|
|
65125
|
+
return parts2.cap === null ? parts2.main : `${parts2.main} (cap $${parts2.cap})`;
|
|
65126
|
+
}
|
|
65127
|
+
|
|
65118
65128
|
// src/commands/search.ts
|
|
65119
65129
|
var search = Command_exports.make(
|
|
65120
65130
|
"search",
|
|
@@ -65122,7 +65132,7 @@ var search = Command_exports.make(
|
|
|
65122
65132
|
query: Flag_exports.string("query").pipe(
|
|
65123
65133
|
Flag_exports.withAlias("q"),
|
|
65124
65134
|
Flag_exports.optional,
|
|
65125
|
-
Flag_exports.withDescription("Keyword query; omit to list the
|
|
65135
|
+
Flag_exports.withDescription("Keyword query; omit to list the data sources")
|
|
65126
65136
|
),
|
|
65127
65137
|
limit: searchLimitFlag,
|
|
65128
65138
|
cursor: cursorFlag
|
|
@@ -65169,8 +65179,7 @@ function providerLine(endpoint2) {
|
|
|
65169
65179
|
return endpoint2.provider_label === endpoint2.provider ? endpoint2.provider : `${endpoint2.provider} (${endpoint2.provider_label})`;
|
|
65170
65180
|
}
|
|
65171
65181
|
function priceLine(price) {
|
|
65172
|
-
|
|
65173
|
-
return `$${price.rule.per_result_usd}/result (cap $${price.rule.cap_usd})`;
|
|
65182
|
+
return priceRuleLine(price.rule);
|
|
65174
65183
|
}
|
|
65175
65184
|
function modeLine(endpoint2) {
|
|
65176
65185
|
return endpoint2.run_mode === "sync" ? `sync ${endpoint2.timeout_ms}ms` : "async";
|