@feastalytics/cli 0.1.9 → 0.1.10

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/cli.js CHANGED
@@ -13603,6 +13603,30 @@ var CLI_MANIFEST = {
13603
13603
  "$schema": "http://json-schema.org/draft-07/schema#"
13604
13604
  }
13605
13605
  },
13606
+ {
13607
+ "id": "getCreatorConversation",
13608
+ "domain": "creators",
13609
+ "description": "One creator's full SMS thread, newest first \u2014 what the dashboard's creator chat view renders. userId comes from listCreatorConversations, which is the queue; this is the read you make before summarizing an exchange or drafting a reply for the human to send, because the queue only carries the last message. Each row has the body, direction (from/to the creator's number), and timestamps. Returns empty when the creator has no phone number on file. Read-only: sending the reply and marking the thread read stay in the dashboard.",
13610
+ "type": "query",
13611
+ "path": [
13612
+ "api",
13613
+ "users",
13614
+ "getInfluencerMessages"
13615
+ ],
13616
+ "inputJsonSchema": {
13617
+ "type": "object",
13618
+ "properties": {
13619
+ "userId": {
13620
+ "type": "string"
13621
+ }
13622
+ },
13623
+ "required": [
13624
+ "userId"
13625
+ ],
13626
+ "additionalProperties": false,
13627
+ "$schema": "http://json-schema.org/draft-07/schema#"
13628
+ }
13629
+ },
13606
13630
  {
13607
13631
  "id": "getFunnelDraft",
13608
13632
  "domain": "funnel",
@@ -13723,6 +13747,66 @@ var CLI_MANIFEST = {
13723
13747
  "$schema": "http://json-schema.org/draft-07/schema#"
13724
13748
  }
13725
13749
  },
13750
+ {
13751
+ "id": "getMemberConversation",
13752
+ "domain": "membersProgram",
13753
+ "description": "One member's SMS thread and activity, newest first \u2014 what the dashboard's chat page renders, and the pair to searchUsers the way getCreatorConversation pairs with listCreatorConversations. serialNumber comes from searchUsers. eventTypes: ['sentText','receivedText'] is the conversation; adding scan, order, checkout, rewardAwarded or rewardRedeemed interleaves what happened between the messages. Unfiltered it fans out to every event source and returns the member's whole history unpaginated, so pass eventTypes unless you really want it all. Read-only: replying to a guest stays in the dashboard.",
13754
+ "type": "query",
13755
+ "path": [
13756
+ "api",
13757
+ "loyalty",
13758
+ "app",
13759
+ "listEventsForUser"
13760
+ ],
13761
+ "inputJsonSchema": {
13762
+ "type": "object",
13763
+ "properties": {
13764
+ "serialNumber": {
13765
+ "type": "string"
13766
+ },
13767
+ "eventTypes": {
13768
+ "type": "array",
13769
+ "items": {
13770
+ "type": "string",
13771
+ "enum": [
13772
+ "receivedText",
13773
+ "sentText",
13774
+ "customerInference",
13775
+ "scan",
13776
+ "passCreated",
13777
+ "passUpdated",
13778
+ "order",
13779
+ "rewardAwarded",
13780
+ "rewardRedeemed",
13781
+ "rewardExpiration",
13782
+ "offerExpired",
13783
+ "fbAttribution",
13784
+ "influencerAttribution",
13785
+ "tiktokAttribution",
13786
+ "googleAttribution",
13787
+ "miscAttribution",
13788
+ "referralAttribution",
13789
+ "passRegistered",
13790
+ "passDeleted",
13791
+ "checkout",
13792
+ "reservationCreated",
13793
+ "optOut",
13794
+ "subscriptionStarted",
13795
+ "subscriptionEnded",
13796
+ "subscriptionInvoice",
13797
+ "formSubmission",
13798
+ "autoReplyDraft"
13799
+ ]
13800
+ }
13801
+ }
13802
+ },
13803
+ "required": [
13804
+ "serialNumber"
13805
+ ],
13806
+ "additionalProperties": false,
13807
+ "$schema": "http://json-schema.org/draft-07/schema#"
13808
+ }
13809
+ },
13726
13810
  {
13727
13811
  "id": "getOnboardingForm",
13728
13812
  "domain": "core",
@@ -14142,7 +14226,7 @@ var CLI_MANIFEST = {
14142
14226
  {
14143
14227
  "id": "listCreatorConversations",
14144
14228
  "domain": "creators",
14145
- "description": "Every creator's SMS conversation with its unread state \u2014 the 'who is waiting on a reply' queue. `hasUnread` means their last message came in after ours and nobody has marked it read; those need a human. Each row carries the last message body, time and direction, the creator's handles, and `visitStatus`, a derived stage that is more reliable than reading raw columns off creatorVisitApplication. Read-only: replying to a creator and marking a conversation read both stay in the dashboard.",
14229
+ "description": "Every creator's SMS conversation with its unread state \u2014 the 'who is waiting on a reply' queue. `hasUnread` means their last message came in after ours and nobody has marked it read; those need a human. Each row carries the last message body, time and direction, the creator's handles, and `visitStatus`, a derived stage that is more reliable than reading raw columns off creatorVisitApplication. Read the full thread behind a row with getCreatorConversation and its userId. Read-only: replying to a creator and marking a conversation read both stay in the dashboard.",
14146
14230
  "type": "query",
14147
14231
  "path": [
14148
14232
  "api",
@@ -14345,46 +14429,6 @@ var CLI_MANIFEST = {
14345
14429
  "$schema": "http://json-schema.org/draft-07/schema#"
14346
14430
  }
14347
14431
  },
14348
- {
14349
- "id": "markCreativesPublished",
14350
- "domain": "creators",
14351
- "description": "Record which Meta ad a recruitment creative was published in. The linkRecruitmentOffer effect on publishAds records this as part of the publish, so after an effect-declared publish there is nothing left to mark \u2014 call this only when ads were created outside publishAds or a publish's effect reported an error. Pass every creative that went into the ad \u2014 a dynamic ad rotates several at once, so they all take the same fbAdId. Without a record the creatives keep offering to be published again.",
14352
- "type": "mutation",
14353
- "path": [
14354
- "api",
14355
- "dfy",
14356
- "markCreativesPublished"
14357
- ],
14358
- "inputJsonSchema": {
14359
- "type": "object",
14360
- "properties": {
14361
- "creatives": {
14362
- "type": "array",
14363
- "items": {
14364
- "type": "object",
14365
- "properties": {
14366
- "creativeId": {
14367
- "type": "string"
14368
- },
14369
- "fbAdId": {
14370
- "type": "string"
14371
- }
14372
- },
14373
- "required": [
14374
- "creativeId",
14375
- "fbAdId"
14376
- ],
14377
- "additionalProperties": false
14378
- }
14379
- }
14380
- },
14381
- "required": [
14382
- "creatives"
14383
- ],
14384
- "additionalProperties": false,
14385
- "$schema": "http://json-schema.org/draft-07/schema#"
14386
- }
14387
- },
14388
14432
  {
14389
14433
  "id": "planAds",
14390
14434
  "domain": "ads",
@@ -14992,7 +15036,7 @@ Example - opted-in members with more than 5 visits, newest first:
14992
15036
  {
14993
15037
  "id": "searchUsers",
14994
15038
  "domain": "membersProgram",
14995
- "description": "Search members (loyalty guests) and their activity. Returns a page of the most recent user events, one per member, each carrying the member's serialNumber plus the event type, time and related object. isUnread: true narrows the results to unread inbound texts only, overriding any broader eventTypes; progressMinBound/progressMaxBound bound the visit count. Paginate by passing the returned `cursor` back \u2014 an undefined cursor means no more pages.",
15039
+ "description": "Search members (loyalty guests) and their activity. Returns a page of the most recent user events, one per member, each carrying the member's serialNumber plus the event type, time and related object. isUnread: true narrows the results to unread inbound texts only, overriding any broader eventTypes; progressMinBound/progressMaxBound bound the visit count. Paginate by passing the returned `cursor` back \u2014 an undefined cursor means no more pages. This finds the member; getMemberConversation with their serialNumber loads their SMS thread or full timeline.",
14996
15040
  "type": "query",
14997
15041
  "path": [
14998
15042
  "api",
@@ -42,7 +42,3 @@ A template-driven publish pipeline: `listAdTemplates` → `planAds` → `publish
42
42
  ## The data catalog
43
43
 
44
44
  `describeData` / `queryData` expose a read-only, org-scoped query surface over the data model — guests, orders, menu items, texts, creator visits, payouts. When no purpose-built tool answers a read question, the catalog usually does; `describeData` with no arguments is the index.
45
-
46
- ---
47
-
48
- Maintenance note: this file is currently hand-authored. The richest source of this domain knowledge is the in-app agent's prompt files (`src/agent-core/src/prompts/` — AutomationsPrompt, CampaignsPrompt, LayoutEnginePrompt, MembersProgramPrompt, OfferPrompt). A future improvement is to generate this reference from those, so the skill and the in-app agent never drift.
@@ -29,10 +29,10 @@ For the *words* in the ads, read `facebook.md` first — copywriting is its own
29
29
 
30
30
  Bookkeeping that must happen once the ads exist travels *inside* the publish as `effects`, and the worker runs it as part of the job — because a follow-up call you're supposed to remember is a follow-up call that gets missed, silently.
31
31
 
32
- - **A recruitment publish must declare `linkRecruitmentOffer`** with its `offerId` and `creativeIds` — the server refuses the publish without it. The effect stamps the creatives as published (no separate `markCreativesPublished` call needed), stamps the offer that the monthly sourcing cap and the dashboard's spend both read, and texts the program's approver that sourcing is live.
32
+ - **A recruitment publish must declare `linkRecruitmentOffer`** with its `offerId` and `creativeIds` — the server refuses the publish without it. The effect stamps the creatives as published, stamps the offer that the monthly sourcing cap and the dashboard's spend both read, and texts the program's approver that sourcing is live.
33
33
  - **`linkFeastCampaign`** records the published Meta campaign onto a Feast campaign, which is what makes its ads panel and KPIs see the spend.
34
34
 
35
- `markCreativesPublished` is the fallback for ads created outside `publishAds`, or for repairing a publish whose effect reported `error`.
35
+ An effect that reports `error` in the job is a case for the dashboard, not for patching around — surface it to the user.
36
36
 
37
37
  ### Which template
38
38
 
@@ -59,8 +59,6 @@ The ads that bring applicants in are CLI-drivable end to end:
59
59
  3. Publish through the `recruitment` template in `ads.md`, declaring the **`linkRecruitmentOffer` effect** — the publish is refused without it. The effect stamps the creatives, links the offer (which the sourcing cap and dashboard spend read), and texts the program's approver that sourcing is live.
60
60
  4. Copy rules for the ad live in `facebook.md` (`recruitmentAdCopy` — the creator-facing half; conflating it with guest copy is the classic failure).
61
61
 
62
- `markCreativesPublished` is only the fallback for recording ads created outside `publishAds` or repairing an effect that reported `error`.
63
-
64
62
  ### The decision loop
65
63
 
66
64
  1. `listCreatorApplications` — the approval queue, newest first, across every location. Takes no arguments. Use this rather than querying the data model: it carries **`instagramFollowerCount`**, which is usually the deciding factor and isn't reachable any other way.
@@ -79,7 +77,9 @@ The ads that bring applicants in are CLI-drivable end to end:
79
77
 
80
78
  `listCreatorConversations` is the "who is waiting on a reply" queue: every creator's SMS thread with `hasUnread`, the last message body and direction, and a derived `visitStatus` chip that's more reliable than reading raw columns.
81
79
 
82
- **You cannot reply from the CLI, and you cannot clear the unread flag.** Both stay in the dashboard — texting a creator back is the highest-consequence action in this area. Surface who's waiting and what they said, then hand the user the conversation.
80
+ `getCreatorConversation` with a row's `userId` loads the full thread behind it, newest first. Read it before characterizing an exchange or drafting a reply for the human — the queue's last-message snippet is not enough context to speak for a whole conversation.
81
+
82
+ **You cannot reply from the CLI, and you cannot clear the unread flag.** Both stay in the dashboard — texting a creator back is the highest-consequence action in this area. Surface who's waiting, read the thread, propose the reply if asked, then hand the user the conversation to send it.
83
83
 
84
84
  ### Everything else: queryData
85
85
 
@@ -7,6 +7,8 @@
7
7
  - Filter with `query` (free-text name), `eventTypes` (e.g. `sentText`, `receivedText`, `scan`, `order`, `rewardAwarded`, `rewardRedeemed`, `checkout`, the `*Attribution` types), `progressMinBound`/`progressMaxBound` (visit-count range), `isUnread: true` (members with unanswered inbound texts), `orderBy` (ASC|DESC by event time).
8
8
  - Paginate with `limit` (default 100) and `cursor` (pass back the `cursor` from the previous call; an undefined cursor means no more pages).
9
9
 
10
+ `getMemberConversation` with a member's `serialNumber` loads their thread, newest first — the pair to `searchUsers` the same way `getCreatorConversation` pairs with `listCreatorConversations`. Always pass `eventTypes`: `["sentText","receivedText"]` is the SMS thread, and adding `scan`/`order`/`checkout`/`rewardAwarded`/`rewardRedeemed` interleaves what happened between the messages. Unfiltered it returns the member's entire history unpaginated.
11
+
10
12
  **Replying by SMS is NOT exposed, deliberately.** The send primitive enforces opt-out, quiet-hours, dedup, and rate limits *downstream* (not at the endpoint), and opt-in is currently gated only by a UI control. If a reply capability is ever exposed, it must run with confirmation and must not bypass those guardrails. For now, tell the user that replying to guests is done in the app.
11
13
 
12
14
  ## Everything else: the data catalog
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feastalytics/cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Command-line client for the Feastalytics platform — list, create, and update campaigns, automations, offers, and members-program rewards from the terminal.",
5
5
  "type": "module",
6
6
  "bin": {