@letterstory/cli 0.177.149 → 0.177.150
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/lib/cli.mjs +3 -2
- package/lib/commands/visits.mjs +13 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
94
94
|
|
|
95
95
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
96
|
-
export const VERSION = "0.177.
|
|
96
|
+
export const VERSION = "0.177.150";
|
|
97
97
|
|
|
98
98
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
99
99
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -102,6 +102,7 @@ export const EXIT_PAYMENT_REQUIRED = 3;
|
|
|
102
102
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
|
103
103
|
// `negate` spelling) in a command's ARGS map must be listed; boolean-flags.test.ts enforces it.
|
|
104
104
|
export const BOOLEAN_FLAGS = new Set([
|
|
105
|
+
"discover",
|
|
105
106
|
// visits transact add folder|page|connection: leave it out of the set (a connection: switch it off).
|
|
106
107
|
"uncheck",
|
|
107
108
|
"clear-choice",
|
|
@@ -2135,7 +2136,7 @@ Visits (Visitors: AI agents reading your site, and AI answers sending people to
|
|
|
2135
2136
|
Look into your product's code, events or database when the pages don't answer
|
|
2136
2137
|
visits transact pr [--repo owner/name] [--base <branch>] [--site <id>|--host <h>]
|
|
2137
2138
|
One pull request: the line for agents, and answers to what they asked
|
|
2138
|
-
visits transact source <source-id>|--folder <path> | remove <id> | test "<question>"
|
|
2139
|
+
visits transact source <source-id>|--folder <path> | remove <id> | tests | test "<question>" [--discover]
|
|
2139
2140
|
visits transact asks [--since 7d] [--limit <n>] What agents asked, answered, and asks per agent visit
|
|
2140
2141
|
|
|
2141
2142
|
Sim (Simulations: a free, simulated copy of your API for agents, and what they did with it):
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -156,7 +156,9 @@ export const ARGS = {
|
|
|
156
156
|
folder: "folder",
|
|
157
157
|
limit: { flag: "limit", type: "num" },
|
|
158
158
|
},
|
|
159
|
+
visitors_list_transact_tests: { site_id: "site" },
|
|
159
160
|
visitors_test_transact: {
|
|
161
|
+
discovery: { flag: "discover", type: "bool" },
|
|
160
162
|
site_id: "site",
|
|
161
163
|
question: { positional: 0, label: "question", required: true },
|
|
162
164
|
},
|
|
@@ -382,11 +384,22 @@ async function visitsTransact(ctx) {
|
|
|
382
384
|
printResult(io, flags, result, () => "Removed");
|
|
383
385
|
return 0;
|
|
384
386
|
}
|
|
387
|
+
if (sub === "tests") {
|
|
388
|
+
printResult(io, flags, await call(rest, "visitors_list_transact_tests"));
|
|
389
|
+
return 0;
|
|
390
|
+
}
|
|
385
391
|
if (sub === "test") {
|
|
386
392
|
const result = await call(rest, "visitors_test_transact");
|
|
387
393
|
printResult(io, flags, result, (r) =>
|
|
388
394
|
[
|
|
389
395
|
r.answer,
|
|
396
|
+
...(r.discovery
|
|
397
|
+
? [
|
|
398
|
+
`Agent answer: ${r.discovery.answer}`,
|
|
399
|
+
`Transact: ${r.discovery.transact}`,
|
|
400
|
+
...r.discovery.sources.map((s) => ` ${s.via}: ${s.url}`),
|
|
401
|
+
]
|
|
402
|
+
: []),
|
|
390
403
|
...r.citations.map((c) => ` [${c.n}] ${c.title}${c.url ? ` ${c.url}` : ""}: "${c.quote}"`),
|
|
391
404
|
].join("\n")
|
|
392
405
|
);
|