Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5e53757
Update app.js
priyankmodiPM Jun 25, 2026
fdd9572
Add discount image auto-reply for WhatsApp messages
Jun 26, 2026
4a26ed6
feat: replace static discount auto-reply with GPT tool-calling assist…
priyankmodiPM Jul 6, 2026
b1ed8d8
fix: regenerate lockfiles against the public npm registry (#2)
priyankmodiPM Jul 6, 2026
f5acca1
fix: regenerate yarn.lock against public npm registry (#3)
priyankmodiPM Jul 6, 2026
4fc8641
fix: declare OPENAI_API_KEY in render.yaml envVars
Jul 6, 2026
f7ee32e
fix: make OpenAI model/baseURL configurable and log request/error det…
Jul 6, 2026
272e14a
Feat/express edit flow (#4)
priyankmodiPM Jul 13, 2026
8bef9c0
Feat/real express api integration (#5)
priyankmodiPM Jul 16, 2026
4e7f47d
Cap discounts at 40%, add Hindi translation guidance, update graphic …
Jul 21, 2026
3909999
Turn allowed-edits reply into tappable quick-reply buttons (#6)
priyankmodiPM Jul 21, 2026
db1326a
Always render edit options as native reply buttons
Jul 21, 2026
15525ff
Simplify edit-options prompt and button labels
Jul 21, 2026
540a43e
Feat/edit options quick reply buttons (#7)
priyankmodiPM Jul 21, 2026
13d3bff
feat: add create_design flow for brand-new creatives (Onam) (#8)
varun6325 Jul 21, 2026
3914c13
Wire quick-reply button taps to the actual field/image being edited
Jul 22, 2026
63c00ab
Add design doc for TV product-swap quick-reply flow
Jul 22, 2026
574f193
Add implementation plan for TV product-swap quick-reply flow
Jul 22, 2026
aa16c25
Extract interactive-reply id parsing into a testable module
Jul 22, 2026
f766815
Support fully-specified multi-field edits in interactive reply ids
Jul 22, 2026
30776d6
Add actionSelectTvModel handler for the TV product-swap quick replies
Jul 22, 2026
c6fdc56
Wire select_tv_model GPT tool into the webhook handler
Jul 22, 2026
9cf20d7
fix: make Onam translate/edit routing robust for the 3-message demo flow
Jul 22, 2026
1d93e79
Merge remote-tracking branch 'origin/main' into feat/edit-options-qui…
Jul 22, 2026
ea0f765
Feat/edit options quick reply buttons (#10)
priyankmodiPM Jul 22, 2026
61a7a1a
Merge pull request #9 from priyankmodiPM/fix/onam-malayalam-translate…
varun6325 Jul 22, 2026
2d3272e
refactor: split the two edit flows into self-contained modules
Jul 22, 2026
18391a2
Merge pull request #11 from priyankmodiPM/refactor/split-express-loca…
varun6325 Jul 22, 2026
1616d3d
feat(local): guided create flow with button follow-ups and image capt…
Jul 22, 2026
fd41439
feat(local): stream "work being done" and add a realistic generation …
Jul 22, 2026
2fd4cf3
fix(local): put the follow-up in the image caption so it can't preced…
Jul 22, 2026
346f202
Merge pull request #12 from priyankmodiPM/feat/local-guided-create-flow
varun6325 Jul 22, 2026
ff7326e
Add design doc for Edit Product/Discount/Price menu with Hinglish-mir…
Jul 22, 2026
ac280c0
Generalize discount cap to price edits and return structured edit out…
Jul 22, 2026
3bad80a
Replace dynamic edit menu with fixed Edit Product/Discount/Price for …
Jul 22, 2026
939ecd8
Present TV model picker as a list with Choose product button
Jul 22, 2026
50145d0
Add WhatsApp list-message support for the product picker
Jul 22, 2026
5657a1c
Add GPT-phrased, language-mirrored edit replies and bare-field discou…
Jul 22, 2026
fbb462f
Add implementation plan; amend spec with discount-cap rounding tolerance
Jul 22, 2026
71f8c83
Merge remote-tracking branch 'origin/main' into feat/edit-options-qui…
Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
.DS_Store
.superpowers
.env
61 changes: 0 additions & 61 deletions app.js

This file was deleted.

3 changes: 3 additions & 0 deletions data/express-templates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
{ "id": "img_1", "name": "Croma Diwali offer", "docId": "urn:aaid:sc:AP:4b4b25bb-0949-588e-bd7b-76d0e9a113bd" }
]
21 changes: 21 additions & 0 deletions data/onam-design.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"_comment": "Template used by the create_design tool for brand-new (source: 'local') creatives. Swap the placeholder image URLs below with your hosted PNG URLs. See README / actions.js for how they map to edit state.",
"images": {
"base": "http://s7ap1.scene7.com/is/image/varunAEM/onam-base?cache=off",
"final": "http://s7ap1.scene7.com/is/image/varunAEM/onam-final?cache=off",
"malayalam": "http://s7ap1.scene7.com/is/image/varunAEM/onam-malyalam?cache=off"
},
"palette": [
{ "name": "Marigold", "hex": "#F4A300" },
{ "name": "Maroon", "hex": "#800020" },
{ "name": "Deep Green", "hex": "#1B5E20" }
],
"slots": {
"editable": [
{ "name": "headline", "type": "text", "aliases": ["heading", "title", "header", "banner_text", "text"] },
{ "name": "background", "type": "color", "aliases": ["background_color", "bg", "colour", "color", "background_colour"] },
{ "name": "address", "type": "text", "aliases": ["store_address", "location", "store"] }
],
"locked": ["logo", "product", "background_image"]
}
}
26 changes: 26 additions & 0 deletions docs/diagrams/flow-express-catalog-edit.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
%% Flow A — Rajesh: edit an existing catalog design (image.source = "express")
%% Backed by the real Adobe Express API, with interactive quick-reply buttons.
%% Render: https://mermaid.live or any Mermaid-capable viewer.
flowchart TD
R1["User: 'what can I change?'"] --> CAE["tool: check_allowed_edits"]
CAE --> CAEa["actionCheckAllowedEdits<br/>image.source = express"]
CAEa --> EX1["expressApi.getTaggedDocument(docId)<br/>collectTaggedElements"]
EX1 --> BTN["buildEditOptions<br/>returns {edit_options, historyText}"]
BTN --> SEND1["sendEditOptions() → reply buttons<br/>id = 'edit:img_1:heading'"]

SEND1 -.->|"user taps a button"| TAP["webhook: messageTextForInteractiveReply()<br/>parse id → I'd like to change heading on image img_1"]
TAP --> ASK["tool: ask_for_more_information<br/>what would you like to change it to?"]
ASK -.->|"user replies with a value"| EG

R2["User: 'change the offer to 7500'"] --> EG["tool: edit_graphic"]
EG --> RT{"actionEditGraphic<br/>image.source?"}
RT -->|"express"| EXE["editExpressDesign"]
EXE --> V{"field is a tagged element?<br/>discount ≤ MAX_DISCOUNT?"}
V -->|"ok"| GEN["expressApi.generateVariation<br/>→ pollJobStatus → thumbnailUrl"]
GEN --> REC["recordEdits + sendImage(thumbnail)"]
V -->|"no"| REJ["reply: can't edit that field / discount capped"]

R3["User: 'change the product to a TV'"] --> STV["tool: select_tv_model"]
STV --> STVa["actionSelectTvModel → 3 model buttons<br/>id encodes full edits (buildValueEditId)"]
STVa -.->|"user taps e.g. LG UA82 AI"| TAP2["parse id → edits JSON → sentence → GPT"]
TAP2 --> EG
24 changes: 24 additions & 0 deletions docs/diagrams/flow-local-create-design.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
%% Flow B — Anjali: create + edit a brand-new design (image.source = "local")
%% No Express calls — resolves to canned image URLs in data/onam-design.json.
%% Render: https://mermaid.live or any Mermaid-capable viewer.
flowchart TD
A1["User: 'create a new design for Onam,<br/>LG washing machine + dishwasher, 20% off'"] --> CD["tool: create_design"]
CD --> CDa["actionCreateDesign<br/>loadOnamDesign + imageStore.createDesign<br/>(source = local, id = local_1)"]
CDa --> S1["sendImage(images.base)"]

A2["User: 'add my store address Princess Street Kochi'"] --> EG2["tool: edit_graphic"]
A3["User: 'translate the banner to Malayalam'"] --> EG3["tool: edit_graphic"]
EG2 --> RT{"actionEditGraphic<br/>image.source?"}
EG3 --> RT
RT -->|"local"| EL["editLocalDesign"]

EL --> M{"Malayalam request?<br/>(Malayalam script OR the word<br/>'Malayalam' in ANY key/value)"}
M -->|"yes"| MAL["short-circuit:<br/>appliedEdits = {language: 'Malayalam'}<br/>skip locked/palette guards"]
M -->|"no"| CANON["canonicalizeEdits (aliases)"]
CANON --> GUARD{"unknown key? → 'locked by HQ'<br/>background off-palette? → reject"}
GUARD -->|"ok"| RES["resolveLocalImage:<br/>address/background set → images.final<br/>else → images.base"]
MAL --> RESM["resolveLocalImage → images.malayalam"]
RES --> S2["recordEdits + sendImage(url)"]
RESM --> S2

RT -->|"express"| EXE["editExpressDesign<br/>(Adobe Express API — see other diagram)"]
Loading