@getfrontline/cli 1.0.3 → 1.0.5
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 +173 -7
- package/dist/commands/agents/builder.d.ts +10 -0
- package/dist/commands/agents/builder.d.ts.map +1 -0
- package/dist/commands/agents/builder.js +243 -0
- package/dist/commands/agents/builder.js.map +1 -0
- package/dist/commands/agents/flows.d.ts.map +1 -1
- package/dist/commands/agents/flows.js +253 -25
- package/dist/commands/agents/flows.js.map +1 -1
- package/dist/commands/agents/intents.d.ts +3 -0
- package/dist/commands/agents/intents.d.ts.map +1 -0
- package/dist/commands/agents/intents.js +137 -0
- package/dist/commands/agents/intents.js.map +1 -0
- package/dist/commands/agents/use.d.ts +3 -0
- package/dist/commands/agents/use.d.ts.map +1 -0
- package/dist/commands/agents/use.js +33 -0
- package/dist/commands/agents/use.js.map +1 -0
- package/dist/commands/agents/variables.d.ts +3 -0
- package/dist/commands/agents/variables.d.ts.map +1 -0
- package/dist/commands/agents/variables.js +111 -0
- package/dist/commands/agents/variables.js.map +1 -0
- package/dist/commands/aiModels/index.d.ts +3 -0
- package/dist/commands/aiModels/index.d.ts.map +1 -0
- package/dist/commands/aiModels/index.js +60 -0
- package/dist/commands/aiModels/index.js.map +1 -0
- package/dist/commands/incomingWebhooks/index.d.ts +3 -0
- package/dist/commands/incomingWebhooks/index.d.ts.map +1 -0
- package/dist/commands/incomingWebhooks/index.js +28 -0
- package/dist/commands/incomingWebhooks/index.js.map +1 -0
- package/dist/commands/object/activity.d.ts +3 -0
- package/dist/commands/object/activity.d.ts.map +1 -0
- package/dist/commands/object/{note.js → activity.js} +24 -19
- package/dist/commands/object/activity.js.map +1 -0
- package/dist/commands/object/export.js +3 -3
- package/dist/commands/object/field.js +5 -5
- package/dist/commands/object/index.js +10 -10
- package/dist/commands/object/index.js.map +1 -1
- package/dist/commands/object/option.js +4 -4
- package/dist/commands/object/record-type.js +4 -4
- package/dist/commands/object/record.js +8 -8
- package/dist/commands/object/relation.js +4 -4
- package/dist/commands/object/view.js +9 -9
- package/dist/commands/table/index.d.ts.map +1 -1
- package/dist/commands/table/index.js +0 -4
- package/dist/commands/table/index.js.map +1 -1
- package/dist/commands/tools/index.d.ts +3 -0
- package/dist/commands/tools/index.d.ts.map +1 -0
- package/dist/commands/tools/index.js +113 -0
- package/dist/commands/tools/index.js.map +1 -0
- package/dist/commands/util/uuid.d.ts +3 -0
- package/dist/commands/util/uuid.d.ts.map +1 -0
- package/dist/commands/util/uuid.js +15 -0
- package/dist/commands/util/uuid.js.map +1 -0
- package/dist/commands/workflows/analytics.d.ts.map +1 -1
- package/dist/commands/workflows/analytics.js +9 -3
- package/dist/commands/workflows/analytics.js.map +1 -1
- package/dist/commands/workflows/common.d.ts +39 -0
- package/dist/commands/workflows/common.d.ts.map +1 -0
- package/dist/commands/workflows/common.js +45 -0
- package/dist/commands/workflows/common.js.map +1 -0
- package/dist/commands/workflows/create.d.ts +3 -0
- package/dist/commands/workflows/create.d.ts.map +1 -0
- package/dist/commands/workflows/create.js +41 -0
- package/dist/commands/workflows/create.js.map +1 -0
- package/dist/commands/workflows/delete.d.ts +3 -0
- package/dist/commands/workflows/delete.d.ts.map +1 -0
- package/dist/commands/workflows/delete.js +20 -0
- package/dist/commands/workflows/delete.js.map +1 -0
- package/dist/commands/workflows/describe.d.ts +3 -0
- package/dist/commands/workflows/describe.d.ts.map +1 -0
- package/dist/commands/workflows/describe.js +40 -0
- package/dist/commands/workflows/describe.js.map +1 -0
- package/dist/commands/workflows/edges.d.ts +3 -0
- package/dist/commands/workflows/edges.d.ts.map +1 -0
- package/dist/commands/workflows/edges.js +50 -0
- package/dist/commands/workflows/edges.js.map +1 -0
- package/dist/commands/workflows/graph.d.ts +3 -0
- package/dist/commands/workflows/graph.d.ts.map +1 -0
- package/dist/commands/workflows/graph.js +47 -0
- package/dist/commands/workflows/graph.js.map +1 -0
- package/dist/commands/workflows/nodes.d.ts +3 -0
- package/dist/commands/workflows/nodes.d.ts.map +1 -0
- package/dist/commands/workflows/nodes.js +68 -0
- package/dist/commands/workflows/nodes.js.map +1 -0
- package/dist/commands/workflows/update.d.ts +3 -0
- package/dist/commands/workflows/update.d.ts.map +1 -0
- package/dist/commands/workflows/update.js +42 -0
- package/dist/commands/workflows/update.js.map +1 -0
- package/dist/commands/workflows/use.d.ts +3 -0
- package/dist/commands/workflows/use.d.ts.map +1 -0
- package/dist/commands/workflows/use.js +34 -0
- package/dist/commands/workflows/use.js.map +1 -0
- package/dist/commands/workflows/variables.d.ts +3 -0
- package/dist/commands/workflows/variables.d.ts.map +1 -0
- package/dist/commands/workflows/variables.js +105 -0
- package/dist/commands/workflows/variables.js.map +1 -0
- package/dist/index.js +50 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts +9 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +54 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/httpClient.d.ts +2 -1
- package/dist/lib/httpClient.d.ts.map +1 -1
- package/dist/lib/httpClient.js +5 -2
- package/dist/lib/httpClient.js.map +1 -1
- package/dist/max/ui/banner.js +15 -15
- package/dist/max.js +7 -1
- package/dist/max.js.map +1 -1
- package/dist/scripts/postinstall.d.ts.map +1 -1
- package/dist/scripts/postinstall.js +8 -0
- package/dist/scripts/postinstall.js.map +1 -1
- package/dist/skills/agent-builder/SKILL.md +88 -0
- package/dist/skills/aggregations/SKILL.md +7 -7
- package/dist/skills/ai-models/SKILL.md +43 -0
- package/dist/skills/auth-and-profiles/SKILL.md +1 -1
- package/dist/skills/crm-setup/SKILL.md +66 -48
- package/dist/skills/crud-operations/SKILL.md +2 -2
- package/dist/skills/export-and-delete/SKILL.md +5 -5
- package/dist/skills/files/SKILL.md +4 -4
- package/dist/skills/filter-and-query/SKILL.md +7 -7
- package/dist/skills/flow-builder/SKILL.md +124 -0
- package/dist/skills/frontline-agents/SKILL.md +152 -3
- package/dist/skills/frontline-internals/SKILL.md +7 -7
- package/dist/skills/frontline-workflows/SKILL.md +170 -3
- package/dist/skills/incoming-webhooks/SKILL.md +36 -0
- package/dist/skills/notes-and-tasks/SKILL.md +29 -29
- package/dist/skills/pipeline-setup/SKILL.md +13 -13
- package/dist/skills/relations/SKILL.md +15 -15
- package/dist/skills/resource-creation/SKILL.md +70 -1
- package/dist/skills/schema-design/SKILL.md +21 -14
- package/dist/skills/tools/SKILL.md +65 -0
- package/dist/skills/variables/SKILL.md +82 -0
- package/dist/skills/workflow-builder/SKILL.md +426 -0
- package/package.json +51 -51
- package/dist/commands/object/note.d.ts +0 -3
- package/dist/commands/object/note.d.ts.map +0 -1
- package/dist/commands/object/note.js.map +0 -1
- package/dist/commands/table/note.d.ts +0 -3
- package/dist/commands/table/note.d.ts.map +0 -1
- package/dist/commands/table/note.js +0 -62
- package/dist/commands/table/note.js.map +0 -1
- package/dist/commands/table/task.d.ts +0 -3
- package/dist/commands/table/task.d.ts.map +0 -1
- package/dist/commands/table/task.js +0 -88
- package/dist/commands/table/task.js.map +0 -1
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-builder
|
|
3
|
+
description: Build valid Frontline automation workflows AND agent flows from the CLI. Covers trigger types, incoming webhooks, DYNAMIC_TABLES with object schema lookup, variable interpolation, and end-to-end automation patterns. Use when creating or editing any workflow or flow graph.
|
|
4
|
+
allowed-tools: Bash(frontline:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Workflow & Flow Builder
|
|
8
|
+
|
|
9
|
+
Covers two types of graphs:
|
|
10
|
+
|
|
11
|
+
- **Automation workflows** — standalone automations triggered by events or schedules (`frontline workflows ...`)
|
|
12
|
+
- **Agent flows** — conversation flows inside an AI agent (`frontline agents flows ...`)
|
|
13
|
+
|
|
14
|
+
Both share the same node/edge model and the same `nodeId` format rules.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Critical: nodeId Format
|
|
19
|
+
|
|
20
|
+
All node IDs **must** follow this pattern:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
node_<uuid> → node_a1b2c3d4-e5f6-7890-abcd-ef1234567890
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Always generate a real UUID for every node — never use invented or sequential IDs like `node_11111111-...`. Use the built-in command:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
frontline util uuid
|
|
30
|
+
# node_a0239833-e131-4eac-8936-d7199bf2461e
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Run it once per node you're about to create. Names like `trigger_1` or `api_1` **will fail** validation with a generic "Invalid" error.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Auth Check
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
frontline auth whoami
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Automation Workflows
|
|
46
|
+
|
|
47
|
+
### Setup
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
frontline workflows create --name "My Automation"
|
|
51
|
+
# Saved as active workflow automatically
|
|
52
|
+
|
|
53
|
+
frontline workflows use <workflowId> # switch active workflow
|
|
54
|
+
frontline workflows graph --table # inspect before each change
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Trigger Node
|
|
58
|
+
|
|
59
|
+
Every automation needs exactly one trigger (type `TRIGGER` or `SCHEDULED_TRIGGER`).
|
|
60
|
+
|
|
61
|
+
**Supported `triggerType` values for `TRIGGER` nodes:**
|
|
62
|
+
|
|
63
|
+
| triggerType | Required extra fields |
|
|
64
|
+
| ----------------------- | ----------------------------------------------- |
|
|
65
|
+
| `CONTACT_CREATED` | — |
|
|
66
|
+
| `CONTACT_UPDATED` | — |
|
|
67
|
+
| `CONVERSATION_ENDED` | — |
|
|
68
|
+
| `FEEDBACK_CAPTURED` | — |
|
|
69
|
+
| `CONVERSATION_IDLE` | — |
|
|
70
|
+
| `INCOMING_WEBHOOK` | `triggerByWebhookIds` — see below |
|
|
71
|
+
| `OBJECT_RECORD_CREATED` | `triggeredByTableId`, `triggeredByRecordTypeId` |
|
|
72
|
+
|
|
73
|
+
Example — contact created trigger:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
frontline workflows nodes create --data '{"nodeId":"node_11111111-1111-1111-1111-111111111111","type":"TRIGGER","position":{"positionX":0,"positionY":0},"data":{"type":"TRIGGER","triggerType":"CONTACT_CREATED"}}'
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Incoming Webhook Trigger
|
|
80
|
+
|
|
81
|
+
**Step 1** — Create the incoming webhook resource:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
frontline incoming-webhooks create --name "CRM events" --description "Receives contacts from external CRM"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Save the returned `id` and `url`. The `accessToken` is the bearer token callers must send.
|
|
88
|
+
|
|
89
|
+
**Step 2** — Create the trigger node referencing the webhook ID:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
frontline workflows nodes create --data '{"nodeId":"node_11111111-1111-1111-1111-111111111111","type":"TRIGGER","position":{"positionX":0,"positionY":0},"data":{"type":"TRIGGER","triggerType":"INCOMING_WEBHOOK","triggerByWebhookIds":["<incoming-webhook-id>"]}}'
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
When the webhook fires, the full POST body is available in the workflow as **`{webhook_payload}`** — a built-in variable you can reference in any downstream node without creating it manually.
|
|
96
|
+
|
|
97
|
+
### Object Record Trigger
|
|
98
|
+
|
|
99
|
+
First get the object IDs:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
frontline object get people
|
|
103
|
+
# response: id (tableId) and record_types[0].id (recordTypeId)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
frontline workflows nodes create --data '{"nodeId":"node_11111111-1111-1111-1111-111111111111","type":"TRIGGER","position":{"positionX":0,"positionY":0},"data":{"type":"TRIGGER","triggerType":"OBJECT_RECORD_CREATED","triggeredByTableId":2,"triggeredByRecordTypeId":2}}'
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Scheduled Trigger
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
frontline workflows nodes create --data '{"nodeId":"node_11111111-1111-1111-1111-111111111111","type":"SCHEDULED_TRIGGER","position":{"positionX":0,"positionY":0},"data":{"type":"SCHEDULED_TRIGGER","cronExpression":"0 9 * * *","timezone":"America/Argentina/Buenos_Aires","startTime":null,"endTime":null,"frequency":"DAILY"}}'
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Variables — How They Work
|
|
119
|
+
|
|
120
|
+
**Variables are plain text substitutions.** `{my_var}` is replaced at runtime with the exact string stored in that variable. There is no dot-access, no object traversal, no computed expressions — just a string replacement.
|
|
121
|
+
|
|
122
|
+
- `{webhook_payload}` → replaced with the full raw POST body as a string (the entire JSON blob).
|
|
123
|
+
- `{first_name}` → replaced with whatever text was stored in that variable by a prior node.
|
|
124
|
+
|
|
125
|
+
You **cannot** do `{webhook_payload.firstName}` — that is not valid syntax and will not extract a sub-property.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## DYNAMIC_TABLES Node
|
|
130
|
+
|
|
131
|
+
Used to CREATE, UPDATE, DELETE, or SEARCH records in any object/table.
|
|
132
|
+
|
|
133
|
+
### Step 1 — Get the object schema
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
frontline object get <object-name>
|
|
137
|
+
# e.g.: frontline object get people
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
From the response extract:
|
|
141
|
+
|
|
142
|
+
- `id` → `tableId`
|
|
143
|
+
- `record_types[0].id` → `recordTypeId`
|
|
144
|
+
- `fields[].name` → the field name string used as the **key** in `rowData` (e.g. `"First Name"`, `"Email"`)
|
|
145
|
+
|
|
146
|
+
### Step 2 — Build the node payload
|
|
147
|
+
|
|
148
|
+
`rowData` maps each **field name** (e.g. `"First Name"`) to a value — either a static string or a `{VARIABLE_NAME}` reference.
|
|
149
|
+
|
|
150
|
+
`inputModeByField` declares how each field value is interpreted:
|
|
151
|
+
|
|
152
|
+
- `"INPUT"` — static value, used as-is
|
|
153
|
+
- `"VARIABLE"` — interpolated at runtime; the value must contain a `{VARIABLE_NAME}` reference
|
|
154
|
+
|
|
155
|
+
**Important:** every variable referenced in `rowData` must already exist and must be populated by a prior node before this node executes. Create missing variables with `frontline workflows variables create`.
|
|
156
|
+
|
|
157
|
+
Example — create a People record with values from workflow variables:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
frontline workflows nodes create --data '{
|
|
161
|
+
"nodeId": "node_22222222-2222-2222-2222-222222222222",
|
|
162
|
+
"type": "DYNAMIC_TABLES",
|
|
163
|
+
"position": {"positionX": 640, "positionY": 0},
|
|
164
|
+
"data": {
|
|
165
|
+
"type": "DYNAMIC_TABLES",
|
|
166
|
+
"tableId": 2,
|
|
167
|
+
"recordTypeId": 2,
|
|
168
|
+
"actionType": "CREATE",
|
|
169
|
+
"rowData": {
|
|
170
|
+
"First Name": "{first_name}",
|
|
171
|
+
"Last Name": "{last_name}",
|
|
172
|
+
"Email": "{email}",
|
|
173
|
+
"Phone Number": "{phone}",
|
|
174
|
+
"Role": "{role}"
|
|
175
|
+
},
|
|
176
|
+
"inputModeByField": {
|
|
177
|
+
"First Name": "VARIABLE",
|
|
178
|
+
"Last Name": "VARIABLE",
|
|
179
|
+
"Email": "VARIABLE",
|
|
180
|
+
"Phone Number": "VARIABLE",
|
|
181
|
+
"Role": "VARIABLE"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}'
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
`actionType` options: `CREATE`, `UPDATE`, `DELETE`, `SEARCH`, `SEARCH_BY_ID`.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Processing Webhook Payload into a Record
|
|
192
|
+
|
|
193
|
+
When the trigger is `INCOMING_WEBHOOK`, the full POST body is stored as-is in `{webhook_payload}` — a single string containing the raw JSON. Individual fields cannot be accessed directly from it.
|
|
194
|
+
|
|
195
|
+
### Pattern A — DATA_TRANSFORMER + DYNAMIC_TABLES (explicit)
|
|
196
|
+
|
|
197
|
+
1. Create one workflow variable per field you need:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
frontline workflows variables create --name first_name --description "First name from webhook"
|
|
201
|
+
frontline workflows variables create --name last_name --description "Last name from webhook"
|
|
202
|
+
frontline workflows variables create --name email --description "Email from webhook"
|
|
203
|
+
frontline workflows variables create --name phone --description "Phone from webhook"
|
|
204
|
+
frontline workflows variables create --name role --description "Role from webhook"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
2. Add a `DATA_TRANSFORMER` node that receives `{webhook_payload}` and extracts each field into its variable. Position it between the trigger and the DYNAMIC_TABLES node:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
frontline workflows nodes create --data '{
|
|
211
|
+
"nodeId": "node_22222222-2222-2222-2222-222222222222",
|
|
212
|
+
"type": "DATA_TRANSFORMER",
|
|
213
|
+
"position": {"positionX": 320, "positionY": 0},
|
|
214
|
+
"data": {
|
|
215
|
+
"type": "DATA_TRANSFORMER",
|
|
216
|
+
"prompt": "Given this JSON payload: {webhook_payload}\n\nExtract and return a JSON object with keys: first_name, last_name, email, phone, role. Use empty string if a field is missing.",
|
|
217
|
+
"temperature": 0.2,
|
|
218
|
+
"model": "gpt-4o-mini",
|
|
219
|
+
"aiVendor": "OPENAI",
|
|
220
|
+
"outputMode": "JSON"
|
|
221
|
+
}
|
|
222
|
+
}'
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Note: `model`, `aiVendor`, and `outputMode` must always be included; omitting them causes a validation error. Valid `aiVendor` values: `"OPENAI"`, `"ANTHROPIC"`, `"GOOGLE"`. Common models: `"gpt-4o-mini"`, `"gpt-4o"`, `"gpt-4.1"` (OPENAI); `"claude-sonnet-4-6"` (ANTHROPIC); `"gemini-3-flash-preview"` (GOOGLE).
|
|
226
|
+
|
|
227
|
+
3. Connect: `TRIGGER → DATA_TRANSFORMER → DYNAMIC_TABLES`.
|
|
228
|
+
|
|
229
|
+
4. The `DYNAMIC_TABLES` node uses `{first_name}`, `{email}` etc. — which are now populated by the transformer.
|
|
230
|
+
|
|
231
|
+
### Pattern B — TOOLS_AI agent (simpler, less setup)
|
|
232
|
+
|
|
233
|
+
Add a `TOOLS_AI` node whose agent has table tools configured. Pass the full payload as the prompt; the agent extracts fields and calls the create-record tool itself.
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
frontline workflows nodes create --data '{
|
|
237
|
+
"nodeId": "node_22222222-2222-2222-2222-222222222222",
|
|
238
|
+
"type": "TOOLS_AI",
|
|
239
|
+
"position": {"positionX": 320, "positionY": 0},
|
|
240
|
+
"data": {
|
|
241
|
+
"type": "TOOLS_AI",
|
|
242
|
+
"instructions": "You receive a webhook payload. Extract the contact fields (firstName, lastName, email, phone, role) and create a People record using your tools.",
|
|
243
|
+
"prompt": "{webhook_payload}",
|
|
244
|
+
"agentId": "<agent-id-with-table-tools>"
|
|
245
|
+
}
|
|
246
|
+
}'
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Connect: `TRIGGER → TOOLS_AI`. No variables or extra nodes needed.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Other Automation Action Nodes
|
|
254
|
+
|
|
255
|
+
### API node
|
|
256
|
+
|
|
257
|
+
The `API` node has **two outgoing handles**: `success` (HTTP 2xx) and `fail` (any error or non-2xx). Always connect both handles — never use `default`.
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
frontline workflows nodes create --data '{"nodeId":"<node-uuid>","type":"API","position":{"positionX":320,"positionY":0},"data":{"type":"API","url":"https://example.com/endpoint","method":"POST","headers":[{"key":"Content-Type","value":"application/json"}],"body":"{webhook_payload}"}}'
|
|
261
|
+
|
|
262
|
+
# Connect success path:
|
|
263
|
+
frontline workflows edges add --source <node-uuid> --source-handle success --target <next-node-uuid> --target-handle default
|
|
264
|
+
|
|
265
|
+
# Connect fail path:
|
|
266
|
+
frontline workflows edges add --source <node-uuid> --source-handle fail --target <error-node-uuid> --target-handle default
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
The node output (response body) is available downstream as `{<nodeId>}`.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
Data transformer (AI extraction/normalization):
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
frontline workflows nodes create --data '{"nodeId":"node_22222222-2222-2222-2222-222222222222","type":"DATA_TRANSFORMER","position":{"positionX":320,"positionY":0},"data":{"type":"DATA_TRANSFORMER","prompt":"Extract firstName, lastName and email from: {webhook_payload}","temperature":0.2,"model":"gpt-4o-mini","aiVendor":"OPENAI","outputMode":"JSON"}}'
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Send message:
|
|
280
|
+
|
|
281
|
+
**Restriction:** `SEND_MESSAGE` is only valid in workflows whose trigger type is `CONVERSATION_IDLE`. Do not add this node to any other workflow type.
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
frontline workflows nodes create --data '{"nodeId":"node_22222222-2222-2222-2222-222222222222","type":"SEND_MESSAGE","position":{"positionX":320,"positionY":0},"data":{"type":"SEND_MESSAGE","message":"Hello {first_name}!"}}'
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Activate:
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
frontline workflows update --status ACTIVE
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Agent Flows
|
|
296
|
+
|
|
297
|
+
Agent flows live inside an AI agent and control conversation logic.
|
|
298
|
+
|
|
299
|
+
### Setup
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
frontline agents use <agentId>
|
|
303
|
+
frontline agents flows create --name "My Flow"
|
|
304
|
+
frontline agents flows use <flowId>
|
|
305
|
+
frontline agents flows graph --table # inspect before each change
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Supported node types
|
|
309
|
+
|
|
310
|
+
`START`, `TRIGGER_INTENT`, `SAY_AI`, `RESPONSE_AI`, `TOOLS_AI`, `API`, `CONDITIONAL_ROUTING`, `DYNAMIC_TABLES`.
|
|
311
|
+
|
|
312
|
+
Use exactly one initial node: `START` or `TRIGGER_INTENT`.
|
|
313
|
+
|
|
314
|
+
### Node payloads
|
|
315
|
+
|
|
316
|
+
Start:
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
frontline agents flows nodes create --data '{"nodeId":"node_11111111-1111-1111-1111-111111111111","type":"START","position":{"positionX":0,"positionY":0}}'
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Intent trigger:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
frontline agents flows nodes create --data '{"nodeId":"node_11111111-1111-1111-1111-111111111111","type":"TRIGGER_INTENT","position":{"positionX":0,"positionY":0},"data":{"type":"TRIGGER_INTENT","intentIds":[123],"agenticRouting":null}}'
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Say AI (static or AI-generated message):
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
frontline agents flows nodes create --data '{"nodeId":"node_22222222-2222-2222-2222-222222222222","type":"SAY_AI","position":{"positionX":320,"positionY":0},"data":{"type":"SAY_AI","sayWithAi":false,"message":"Hello, how can I help?"}}'
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Conditional routing:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
frontline agents flows nodes create --data '{"nodeId":"node_22222222-2222-2222-2222-222222222222","type":"CONDITIONAL_ROUTING","position":{"positionX":320,"positionY":0},"data":{"type":"CONDITIONAL_ROUTING","routingType":"DYNAMIC","conditions":[{"handleId":"yes","expression":"{confirmed} == true"},{"handleId":"no","expression":"{confirmed} != true"}]}}'
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
`DYNAMIC_TABLES` works exactly the same as in automations — get the object schema first, then map field keys to variable references.
|
|
341
|
+
|
|
342
|
+
### Flow edges
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
frontline agents flows edges add --source node_11111111-1111-1111-1111-111111111111 --source-handle default --target node_22222222-2222-2222-2222-222222222222 --target-handle default
|
|
346
|
+
|
|
347
|
+
# Conditional routing handles:
|
|
348
|
+
frontline agents flows edges add --source node_22222222-2222-2222-2222-222222222222 --source-handle yes --target node_33333333-3333-3333-3333-333333333333 --target-handle default
|
|
349
|
+
frontline agents flows edges add --source node_22222222-2222-2222-2222-222222222222 --source-handle no --target node_44444444-4444-4444-4444-444444444444 --target-handle default
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Activate:
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
frontline agents flows update --name "My Flow" --status ACTIVE
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## Edges (both automations and flows)
|
|
361
|
+
|
|
362
|
+
Connect nodes:
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
frontline workflows edges add \
|
|
366
|
+
--source node_11111111-1111-1111-1111-111111111111 \
|
|
367
|
+
--source-handle default \
|
|
368
|
+
--target node_22222222-2222-2222-2222-222222222222 \
|
|
369
|
+
--target-handle default
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Remove an edge:
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
frontline workflows edges remove \
|
|
376
|
+
--source node_11111111-1111-1111-1111-111111111111 \
|
|
377
|
+
--source-handle default \
|
|
378
|
+
--target node_22222222-2222-2222-2222-222222222222 \
|
|
379
|
+
--target-handle default
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Rules:
|
|
383
|
+
|
|
384
|
+
- One outgoing edge per node (except `CONDITIONAL_ROUTING` and `TOOLS_AI` which support multiple handles).
|
|
385
|
+
- No self-edges, no cycles.
|
|
386
|
+
- Source and target nodes must exist.
|
|
387
|
+
- Deleting a node removes all its edges.
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## Variables
|
|
392
|
+
|
|
393
|
+
Create before referencing:
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
frontline workflows variables create --name my_var --description "..."
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
Reference in any interpolable field as `{my_var}`.
|
|
400
|
+
|
|
401
|
+
Automation workflows also expose each node's output as a runtime variable named after its `nodeId`. A node with `nodeId` `node_11111111-1111-1111-1111-111111111111` is accessible downstream as `{node_11111111-1111-1111-1111-111111111111}`.
|
|
402
|
+
|
|
403
|
+
**Critical — never invent node IDs.** When writing a prompt or expression that references another node's output, you must first retrieve the actual `nodeId` from the workflow:
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
frontline workflows graph --table # shows all nodes with their nodeIds
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Do NOT guess or hard-code a `nodeId`. Always look it up first and use the exact value.
|
|
410
|
+
|
|
411
|
+
Interpolable fields: API `url`, `headers[].value`, `parameters[].value`, `body`; Send Message `message`; Say AI `message`, `prompt`; Response AI `instructions`; Tools AI `instructions`, `prompt`; AI Capture `prompt`, `instructions`; Data Transformer `prompt`; Conditional Routing `conditions[].expression`; Dynamic Tables `rowId`, `search`, `rowData` values; Transcription `audioUrl`.
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## Validation Checklist
|
|
416
|
+
|
|
417
|
+
- [ ] Each `nodeId` matches `node_<uuid>` format.
|
|
418
|
+
- [ ] Exactly one trigger node per workflow/flow.
|
|
419
|
+
- [ ] `data.type` matches the node `type`.
|
|
420
|
+
- [ ] All variables referenced in `rowData` exist and are populated by a prior node.
|
|
421
|
+
- [ ] `tableId` and `recordTypeId` obtained from `frontline object get <name>` (not guessed).
|
|
422
|
+
- [ ] `rowData` keys are field **names** from the object schema (e.g. `"First Name"`, `"Email"`) — not UUIDs.
|
|
423
|
+
- [ ] Node output references (`{node_<uuid>}`) use the **actual** `nodeId` retrieved via `frontline workflows graph --table` — never invented.
|
|
424
|
+
- [ ] `SEND_MESSAGE` is only used when the trigger type is `CONVERSATION_IDLE`.
|
|
425
|
+
- [ ] One outgoing edge per node (unless multi-handle node type).
|
|
426
|
+
- [ ] Run `frontline workflows graph --table` after each structural change.
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@getfrontline/cli",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Frontline CLI — Public API (agents, workflows, billing, tables, objects) + Max chat/admin REST from your terminal",
|
|
5
|
-
"private": false,
|
|
6
|
-
"type": "commonjs",
|
|
7
|
-
"main": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"bin": {
|
|
10
|
-
"frontline": "dist/index.js",
|
|
11
|
-
"max": "dist/max.js"
|
|
12
|
-
},
|
|
13
|
-
"files": [
|
|
14
|
-
"dist"
|
|
15
|
-
],
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "node ./scripts/clean.mjs && tsc -p tsconfig.json && node ./scripts/addShebang.mjs && node ./scripts/copyStatic.mjs",
|
|
18
|
-
"dev:frontline": "ts-node src/index.ts",
|
|
19
|
-
"dev:max": "ts-node src/max.ts",
|
|
20
|
-
"postinstall": "node dist/scripts/postinstall.js || true",
|
|
21
|
-
"pack": "npm pack --dry-run",
|
|
22
|
-
"prepublishOnly": "npm run build"
|
|
23
|
-
},
|
|
24
|
-
"keywords": [
|
|
25
|
-
"frontline",
|
|
26
|
-
"cli",
|
|
27
|
-
"api",
|
|
28
|
-
"max",
|
|
29
|
-
"agents",
|
|
30
|
-
"getfrontline",
|
|
31
|
-
"workflows",
|
|
32
|
-
"crm"
|
|
33
|
-
],
|
|
34
|
-
"license": "MIT",
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"chalk": "^4.1.2",
|
|
37
|
-
"commander": "^13.1.0",
|
|
38
|
-
"conf": "^10.2.0",
|
|
39
|
-
"ora": "^5.4.1",
|
|
40
|
-
"terminal-image": "^3.1.1"
|
|
41
|
-
},
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"@types/js-yaml": "^4.0.9",
|
|
44
|
-
"@types/node": "^22.0.0",
|
|
45
|
-
"ts-node": "^10.9.2",
|
|
46
|
-
"typescript": "^5.7.0"
|
|
47
|
-
},
|
|
48
|
-
"engines": {
|
|
49
|
-
"node": ">=18.0.0"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@getfrontline/cli",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "Frontline CLI — Public API (agents, workflows, billing, tables, objects) + Max chat/admin REST from your terminal",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"frontline": "dist/index.js",
|
|
11
|
+
"max": "dist/max.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "node ./scripts/clean.mjs && tsc -p tsconfig.json && node ./scripts/addShebang.mjs && node ./scripts/copyStatic.mjs",
|
|
18
|
+
"dev:frontline": "ts-node src/index.ts",
|
|
19
|
+
"dev:max": "ts-node src/max.ts",
|
|
20
|
+
"postinstall": "node dist/scripts/postinstall.js || true",
|
|
21
|
+
"pack": "npm pack --dry-run",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"frontline",
|
|
26
|
+
"cli",
|
|
27
|
+
"api",
|
|
28
|
+
"max",
|
|
29
|
+
"agents",
|
|
30
|
+
"getfrontline",
|
|
31
|
+
"workflows",
|
|
32
|
+
"crm"
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"chalk": "^4.1.2",
|
|
37
|
+
"commander": "^13.1.0",
|
|
38
|
+
"conf": "^10.2.0",
|
|
39
|
+
"ora": "^5.4.1",
|
|
40
|
+
"terminal-image": "^3.1.1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/js-yaml": "^4.0.9",
|
|
44
|
+
"@types/node": "^22.0.0",
|
|
45
|
+
"ts-node": "^10.9.2",
|
|
46
|
+
"typescript": "^5.7.0"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18.0.0"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../../src/commands/object/note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+EpC,eAAO,MAAM,iBAAiB,SAMJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note.js","sourceRoot":"","sources":["../../../src/commands/object/note.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA0E;AAC1E,6CAA8D;AAE9D,MAAM,OAAO,GAAG,IAAA,uBAAU,EACtB,IAAI,mBAAO,CAAC,MAAM,CAAC;KACd,WAAW,CAAC,sBAAsB,CAAC;KACnC,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;KAC1C,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC,CACzD,CAAC,MAAM,CAAC,KAAK,EAAE,UAAkB,EAAE,KAAa,EAAE,IAAa,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAC3B,WAAW,kBAAkB,C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MAAc,EAAE,IAAa,EAAE,EAAE;IACjE,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAC9B,WAAW,kBAAkB,CAAC,UAAU,CAAC,UAAU,MAAM,EAAE,CAC9D,CAAC;IACF,IAAA,gBAAO,EAAC,MAAM,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,IAAI,mBAAO,CAAC,MAAM,CAAC;KAC/C,WAAW,CAAC,6BAA6B,CAAC;KAC1C,UAAU,CAAC,OAAO,CAAC;KACnB,UAAU,CAAC,SAAS,CAAC;KACrB,UAAU,CAAC,MAAM,CAAC;KAClB,UAAU,CAAC,SAAS,CAAC;KACrB,UAAU,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../../src/commands/table/note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+EpC,eAAO,MAAM,gBAAgB,SAMH,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tableNoteCommand = void 0;
|
|
4
|
-
const commander_1 = require("commander");
|
|
5
|
-
const globalOpts_1 = require("../../lib/globalOpts");
|
|
6
|
-
const output_1 = require("../../lib/output");
|
|
7
|
-
const listCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("list")
|
|
8
|
-
.description("List notes for a row")
|
|
9
|
-
.argument("<table>", "Table name (slug)")
|
|
10
|
-
.argument("<row-id>", "Row ID")).action(async (tableName, rowId, opts) => {
|
|
11
|
-
const client = (0, globalOpts_1.requireClient)(opts);
|
|
12
|
-
const result = await client.get(`tables/${encodeURIComponent(tableName)}/rows/${encodeURIComponent(rowId)}/notes`);
|
|
13
|
-
(0, output_1.success)(result);
|
|
14
|
-
});
|
|
15
|
-
const createCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("create")
|
|
16
|
-
.description("Create a note on a row")
|
|
17
|
-
.argument("<table>", "Table name (slug)")
|
|
18
|
-
.argument("<row-id>", "Row ID")
|
|
19
|
-
.option("--content <text>", "Note content (required)")).action(async (tableName, rowId, opts) => {
|
|
20
|
-
const client = (0, globalOpts_1.requireClient)(opts);
|
|
21
|
-
if (!opts.content) {
|
|
22
|
-
(0, output_1.error)("missing_content", "--content is required", output_1.EXIT_CODES.BAD_INPUT);
|
|
23
|
-
}
|
|
24
|
-
const result = await client.post(`tables/${encodeURIComponent(tableName)}/rows/${encodeURIComponent(rowId)}/notes`, { content: opts.content });
|
|
25
|
-
(0, output_1.success)(result);
|
|
26
|
-
});
|
|
27
|
-
const getCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("get")
|
|
28
|
-
.description("Get a specific note by ID")
|
|
29
|
-
.argument("<table>", "Table name (slug)")
|
|
30
|
-
.argument("<note-id>", "Note ID (number)")).action(async (tableName, noteId, opts) => {
|
|
31
|
-
const client = (0, globalOpts_1.requireClient)(opts);
|
|
32
|
-
const result = await client.get(`tables/${encodeURIComponent(tableName)}/notes/${noteId}`);
|
|
33
|
-
(0, output_1.success)(result);
|
|
34
|
-
});
|
|
35
|
-
const updateCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("update")
|
|
36
|
-
.description("Update a note")
|
|
37
|
-
.argument("<table>", "Table name (slug)")
|
|
38
|
-
.argument("<note-id>", "Note ID (number)")
|
|
39
|
-
.option("--content <text>", "New content")).action(async (tableName, noteId, opts) => {
|
|
40
|
-
const client = (0, globalOpts_1.requireClient)(opts);
|
|
41
|
-
if (!opts.content) {
|
|
42
|
-
(0, output_1.error)("missing_content", "--content is required", output_1.EXIT_CODES.BAD_INPUT);
|
|
43
|
-
}
|
|
44
|
-
const result = await client.patch(`tables/${encodeURIComponent(tableName)}/notes/${noteId}`, { content: opts.content });
|
|
45
|
-
(0, output_1.success)(result);
|
|
46
|
-
});
|
|
47
|
-
const deleteCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("delete")
|
|
48
|
-
.description("Delete a note")
|
|
49
|
-
.argument("<table>", "Table name (slug)")
|
|
50
|
-
.argument("<note-id>", "Note ID (number)")).action(async (tableName, noteId, opts) => {
|
|
51
|
-
const client = (0, globalOpts_1.requireClient)(opts);
|
|
52
|
-
const result = await client.delete(`tables/${encodeURIComponent(tableName)}/notes/${noteId}`);
|
|
53
|
-
(0, output_1.success)(result);
|
|
54
|
-
});
|
|
55
|
-
exports.tableNoteCommand = new commander_1.Command("note")
|
|
56
|
-
.description("Manage notes on table rows")
|
|
57
|
-
.addCommand(listCmd)
|
|
58
|
-
.addCommand(createCmd)
|
|
59
|
-
.addCommand(getCmd)
|
|
60
|
-
.addCommand(updateCmd)
|
|
61
|
-
.addCommand(deleteCmd);
|
|
62
|
-
//# sourceMappingURL=note.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note.js","sourceRoot":"","sources":["../../../src/commands/table/note.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA0E;AAC1E,6CAA8D;AAE9D,MAAM,OAAO,GAAG,IAAA,uBAAU,EACtB,IAAI,mBAAO,CAAC,MAAM,CAAC;KACd,WAAW,CAAC,sBAAsB,CAAC;KACnC,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;KACxC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CACtC,CAAC,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,KAAa,EAAE,IAAa,EAAE,EAAE;IAC/D,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAC3B,UAAU,kBAAkB,CAAC,SAAS,CAAC,SAAS,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CACpF,CA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