@letterstory/cli 0.70.1 → 0.70.2
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 +4 -0
- package/lib/cli.mjs +1 -1
- package/lib/commands/admin.mjs +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -398,6 +398,10 @@ export LETTERSTORY_STAFF_API_KEY=<your staff key with crm:read,crm:write>
|
|
|
398
398
|
letterstory admin crm signals --status new # the Inbound feed (unmatched signals)
|
|
399
399
|
letterstory admin crm record --source bookface --kind message \
|
|
400
400
|
--title "Asked about phantoms on Bookface" --name "Jane Doe" --company Acme --domain acme.com
|
|
401
|
+
# Re-running that is a no-op: with no --external-id the intake derives an idempotency key from
|
|
402
|
+
# the signal's content, so a retried agent loop cannot fill the feed with the same observation.
|
|
403
|
+
# Pass --external-id when the source has a stable id (a thread id, a tweet id), or to record that
|
|
404
|
+
# an otherwise identical signal happened AGAIN.
|
|
401
405
|
letterstory admin crm record --source twitter --kind social_engagement \
|
|
402
406
|
--title "Liked our launch tweet" --name "Pat" --linkedin https://linkedin.com/in/pat
|
|
403
407
|
letterstory admin crm signal <signal-id> qualify # link/create the account
|
package/lib/cli.mjs
CHANGED
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
} from "./commands.mjs";
|
|
57
57
|
|
|
58
58
|
// Keep in sync with cli/package.json.
|
|
59
|
-
export const VERSION = "0.70.
|
|
59
|
+
export const VERSION = "0.70.2";
|
|
60
60
|
|
|
61
61
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
62
62
|
// can't accidentally swallow the id as --json's value.
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -1795,8 +1795,15 @@ async function cmdAdminCrm(ctx) {
|
|
|
1795
1795
|
});
|
|
1796
1796
|
if (!body.title)
|
|
1797
1797
|
throw new CliError(
|
|
1798
|
-
'Usage: admin crm record --title "Liked our launch tweet" [--source twitter] [--kind social_engagement] …'
|
|
1798
|
+
'Usage: admin crm record --title "Liked our launch tweet" [--source twitter] [--kind social_engagement] [--external-id <id>] …'
|
|
1799
1799
|
);
|
|
1800
|
+
// No local default for --external-id on purpose. The intake derives one
|
|
1801
|
+
// from the signal's content when none is sent (deriveExternalId in
|
|
1802
|
+
// src/lib/crm/signals-intake.ts), so a re-run is already a no-op and the
|
|
1803
|
+
// rule lives in ONE place. Computing a second fingerprint here would be a
|
|
1804
|
+
// copy that drifts, and it would differ from what a webhook or any other
|
|
1805
|
+
// agent sends for the same observation. Pass --external-id when the source
|
|
1806
|
+
// has a stable id of its own, or to say "this happened again".
|
|
1800
1807
|
const r = await staffPost(ctx, `${CRM}/signals`, body);
|
|
1801
1808
|
return out(r, (x) => `${x.duplicate ? "already recorded" : "recorded"}: ${signalLine(x.signal)}`);
|
|
1802
1809
|
}
|