@flowapt/flowiq-cli 0.6.6 → 0.6.7
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/README.md +16 -0
- package/TEAM-GUIDE.md +1 -0
- package/package.json +1 -1
- package/src/commands/agent-test.js +12 -2
package/README.md
CHANGED
|
@@ -1333,6 +1333,22 @@ flowiq test cleanup <organization_id> --confirm # delete the stress contact
|
|
|
1333
1333
|
`--agent <id>` targets a specific (non-active) agent. `test stress cleanup` is
|
|
1334
1334
|
destructive and requires `--confirm`.
|
|
1335
1335
|
|
|
1336
|
+
**Scenario pack shape.** `{scenarios:[{id, title, turns:[{text, expect?, expectNot?}]}]}`.
|
|
1337
|
+
`expect` / `expectNot` are case-insensitive substring checks (informational —
|
|
1338
|
+
reported and summed, never a hard fail) and accept **either a single string or an
|
|
1339
|
+
array of strings**:
|
|
1340
|
+
|
|
1341
|
+
```json
|
|
1342
|
+
{ "text": "What investment options do I have?",
|
|
1343
|
+
"expect": "depend on your fund rules",
|
|
1344
|
+
"expectNot": ["Destiny offers", "guaranteed return"] }
|
|
1345
|
+
```
|
|
1346
|
+
|
|
1347
|
+
Before v0.6.7 a bare string was iterated character by character, so
|
|
1348
|
+
`"expect": "fund rules"` reported ten single-letter checks that all trivially
|
|
1349
|
+
passed — a wrong pass/fail signal that still looked like a real result. Write
|
|
1350
|
+
either form now.
|
|
1351
|
+
|
|
1336
1352
|
### Guide — `flowiq guide`
|
|
1337
1353
|
|
|
1338
1354
|
Read the bundled docs in the terminal — no digging through node_modules.
|
package/TEAM-GUIDE.md
CHANGED
|
@@ -103,6 +103,7 @@ When you see it, run `npm i -g @flowapt/flowiq-cli` — a stale version also mea
|
|
|
103
103
|
| Agent can't quote ANY price / "I can't pull the live menu" | `flowiq agent config <org_id> --tool product_lookup=true` — name-based fuzzy lookup that works without embeddings or a live OpenAI key (semantic `get_product_info` needs both) |
|
|
104
104
|
| Talk to the live agent safely (no real WhatsApp ever sent) | `flowiq test send <org_id> "hi, do you sell X?"` |
|
|
105
105
|
| Set which contact `flowiq test` uses (use a FAKE number!) | `flowiq agent config <org_id> --test-contact-number 27000000001 --test-contact-name "QA Bot"` |
|
|
106
|
+
| Prove a batch of fixes actually landed, in one run | `flowiq test scenario <org_id> ./pack.json` — pack is `{scenarios:[{id,title,turns:[{text,expect?,expectNot?}]}]}`. `expect`/`expectNot` are case-insensitive substring checks and take **a single string OR an array**. (Before v0.6.7 a bare string was checked letter by letter, so it always "passed" — if you wrote packs on an older version, re-run them.) |
|
|
106
107
|
| **Make short links for a campaign** (with UTM tracking) | `flowiq links shorten <org_id> --url "https://shop.co.za/product/x" --campaign 13Aug_Seeds --content 13Aug_Seeds` (dry run) → `… --commit`. `utm_source`/`utm_medium` are set for you; campaign + content must be given together |
|
|
107
108
|
| Short links for every URL in a message | `flowiq links shorten <org_id> --file ./message.txt --campaign X --content X --commit` |
|
|
108
109
|
| Check which links a campaign has, and their clicks | `flowiq links list <org_id> --campaign 13Aug_Seeds` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowapt/flowiq-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "Command-line tool for FlowIQ staff: round-trip agent prompts, questionnaires, fine-tuning, pin-board tasks, webhooks, templates, agent-updates, chat exports, and live agent testing without ever touching service-role credentials.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -45,11 +45,21 @@ async function clearConv(orgId, agent) {
|
|
|
45
45
|
return http.post("agent-test", { action: "clear", organization_id: orgId, agent_id: agent });
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
// A bare string is ONE needle, not a list of characters. Iterating a string
|
|
49
|
+
// with for..of yields its characters, so a pack written as
|
|
50
|
+
// `"expect": "fund rules"` used to report ten single-letter checks that all
|
|
51
|
+
// trivially passed (and, for expectNot, all trivially failed) — a wrong
|
|
52
|
+
// pass/fail signal that still looked like a real result.
|
|
53
|
+
function needles(v) {
|
|
54
|
+
if (v == null) return [];
|
|
55
|
+
return Array.isArray(v) ? v : [v];
|
|
56
|
+
}
|
|
57
|
+
|
|
48
58
|
function checkExpectations(turn, replyText) {
|
|
49
59
|
const results = [];
|
|
50
60
|
const hay = (replyText || "").toLowerCase();
|
|
51
|
-
for (const e of turn.expect
|
|
52
|
-
for (const e of turn.expectNot
|
|
61
|
+
for (const e of needles(turn.expect)) results.push({ kind: "expect", needle: e, ok: hay.includes(String(e).toLowerCase()) });
|
|
62
|
+
for (const e of needles(turn.expectNot)) results.push({ kind: "expectNot", needle: e, ok: !hay.includes(String(e).toLowerCase()) });
|
|
53
63
|
return results;
|
|
54
64
|
}
|
|
55
65
|
|