@letterstory/cli 0.177.149 → 0.177.151
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 +5 -2
- package/lib/commands/visits.mjs +22 -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.151";
|
|
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,8 @@ 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
|
+
"as-test",
|
|
106
|
+
"discover",
|
|
105
107
|
// visits transact add folder|page|connection: leave it out of the set (a connection: switch it off).
|
|
106
108
|
"uncheck",
|
|
107
109
|
"clear-choice",
|
|
@@ -2135,7 +2137,8 @@ Visits (Visitors: AI agents reading your site, and AI answers sending people to
|
|
|
2135
2137
|
Look into your product's code, events or database when the pages don't answer
|
|
2136
2138
|
visits transact pr [--repo owner/name] [--base <branch>] [--site <id>|--host <h>]
|
|
2137
2139
|
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>"
|
|
2140
|
+
visits transact source <source-id>|--folder <path> | remove <id> | tests | test "<question>" [--discover]
|
|
2141
|
+
visits transact mark-ask <ask-id> --as-test|--as-test=false [--site <id>]
|
|
2139
2142
|
visits transact asks [--since 7d] [--limit <n>] What agents asked, answered, and asks per agent visit
|
|
2140
2143
|
|
|
2141
2144
|
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,14 @@ export const ARGS = {
|
|
|
156
156
|
folder: "folder",
|
|
157
157
|
limit: { flag: "limit", type: "num" },
|
|
158
158
|
},
|
|
159
|
+
visitors_set_transact_ask_test: {
|
|
160
|
+
site_id: "site",
|
|
161
|
+
ask_id: { positional: 0, label: "ask id", required: true },
|
|
162
|
+
is_test: { flag: "as-test", type: "bool" },
|
|
163
|
+
},
|
|
164
|
+
visitors_list_transact_tests: { site_id: "site" },
|
|
159
165
|
visitors_test_transact: {
|
|
166
|
+
discovery: { flag: "discover", type: "bool" },
|
|
160
167
|
site_id: "site",
|
|
161
168
|
question: { positional: 0, label: "question", required: true },
|
|
162
169
|
},
|
|
@@ -382,11 +389,26 @@ async function visitsTransact(ctx) {
|
|
|
382
389
|
printResult(io, flags, result, () => "Removed");
|
|
383
390
|
return 0;
|
|
384
391
|
}
|
|
392
|
+
if (sub === "mark-ask") {
|
|
393
|
+
printResult(io, flags, await call(rest, "visitors_set_transact_ask_test"));
|
|
394
|
+
return 0;
|
|
395
|
+
}
|
|
396
|
+
if (sub === "tests") {
|
|
397
|
+
printResult(io, flags, await call(rest, "visitors_list_transact_tests"));
|
|
398
|
+
return 0;
|
|
399
|
+
}
|
|
385
400
|
if (sub === "test") {
|
|
386
401
|
const result = await call(rest, "visitors_test_transact");
|
|
387
402
|
printResult(io, flags, result, (r) =>
|
|
388
403
|
[
|
|
389
404
|
r.answer,
|
|
405
|
+
...(r.discovery
|
|
406
|
+
? [
|
|
407
|
+
`Agent answer: ${r.discovery.answer}`,
|
|
408
|
+
`Transact: ${r.discovery.transact}`,
|
|
409
|
+
...r.discovery.sources.map((s) => ` ${s.via}: ${s.url}`),
|
|
410
|
+
]
|
|
411
|
+
: []),
|
|
390
412
|
...r.citations.map((c) => ` [${c.n}] ${c.title}${c.url ? ` ${c.url}` : ""}: "${c.quote}"`),
|
|
391
413
|
].join("\n")
|
|
392
414
|
);
|