@automagik/omni 2.260731.3 → 2.260803.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/db/drizzle/0046_whatsapp_flow_keys.sql +39 -0
- package/db/drizzle/meta/_journal.json +7 -0
- package/dist/index.js +274 -7
- package/dist/sdk/flow-builder.d.ts +125 -0
- package/dist/sdk/flow-builder.d.ts.map +1 -0
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +205 -1
- package/dist/sdk/types.generated.d.ts +975 -0
- package/dist/sdk/types.generated.d.ts.map +1 -1
- package/dist/server/index.js +4320 -2289
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
-- WhatsApp Flows data-endpoint encryption keys (whatsapp-flows feature).
|
|
2
|
+
--
|
|
3
|
+
-- One active RSA keypair per instance: the public key is registered with Meta
|
|
4
|
+
-- (POST /{phone_number_id}/whatsapp_business_encryption) and the private key
|
|
5
|
+
-- decrypts inbound flow data-exchange requests. `private_key_pem` is sealed
|
|
6
|
+
-- at rest via sealCredentialField when tenancy + master key are configured
|
|
7
|
+
-- (legacy plaintext otherwise — same codec as instance credential columns).
|
|
8
|
+
-- Rotation replaces the row (unique on instance_id).
|
|
9
|
+
--
|
|
10
|
+
-- Tenancy derives via instance_id (the whatsapp_templates precedent) — no
|
|
11
|
+
-- denormalized tenant_id column, so the table stays outside the RLS
|
|
12
|
+
-- tenant-table manifest by construction.
|
|
13
|
+
--
|
|
14
|
+
-- Hand-written following the 0044/0045 precedent (snapshot drift keeps
|
|
15
|
+
-- drizzle-kit generate interactive). Additive + idempotent statements.
|
|
16
|
+
|
|
17
|
+
-- NOTE: no explicit BEGIN/COMMIT — the boot migrator executes this file on a
|
|
18
|
+
-- pooled postgres-js connection, which rejects raw transaction control
|
|
19
|
+
-- (UNSAFE_TRANSACTION).
|
|
20
|
+
|
|
21
|
+
CREATE TABLE IF NOT EXISTS "whatsapp_flow_keys" (
|
|
22
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
23
|
+
"instance_id" uuid NOT NULL,
|
|
24
|
+
"private_key_pem" text NOT NULL,
|
|
25
|
+
"public_key_pem" text NOT NULL,
|
|
26
|
+
"uploaded_at" timestamp with time zone,
|
|
27
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
28
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
DO $$ BEGIN
|
|
32
|
+
ALTER TABLE "whatsapp_flow_keys"
|
|
33
|
+
ADD CONSTRAINT "whatsapp_flow_keys_instance_id_instances_id_fk"
|
|
34
|
+
FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE cascade;
|
|
35
|
+
EXCEPTION WHEN duplicate_object THEN NULL;
|
|
36
|
+
END $$;
|
|
37
|
+
|
|
38
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "idx_wa_flow_keys_instance"
|
|
39
|
+
ON "whatsapp_flow_keys" ("instance_id");
|
|
@@ -323,6 +323,13 @@
|
|
|
323
323
|
"when": 1784500000000,
|
|
324
324
|
"tag": "0045_agent_error_messages_list",
|
|
325
325
|
"breakpoints": true
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"idx": 46,
|
|
329
|
+
"version": "7",
|
|
330
|
+
"when": 1784600000000,
|
|
331
|
+
"tag": "0046_whatsapp_flow_keys",
|
|
332
|
+
"breakpoints": true
|
|
326
333
|
}
|
|
327
334
|
]
|
|
328
335
|
}
|
package/dist/index.js
CHANGED
|
@@ -12340,7 +12340,8 @@ var init_types3 = __esm(() => {
|
|
|
12340
12340
|
"voice.user_joined_channel",
|
|
12341
12341
|
"voice.user_left_channel",
|
|
12342
12342
|
"template.status_changed",
|
|
12343
|
-
"channel.alert"
|
|
12343
|
+
"channel.alert",
|
|
12344
|
+
"flow.data_exchange"
|
|
12344
12345
|
];
|
|
12345
12346
|
});
|
|
12346
12347
|
// ../core/src/events/envelope.ts
|
|
@@ -30386,6 +30387,9 @@ function getStreamForEventType(eventType) {
|
|
|
30386
30387
|
presence: STREAM_NAMES.SYSTEM,
|
|
30387
30388
|
chat: STREAM_NAMES.SYSTEM,
|
|
30388
30389
|
follow_up: STREAM_NAMES.SYSTEM,
|
|
30390
|
+
flow: STREAM_NAMES.SYSTEM,
|
|
30391
|
+
template: STREAM_NAMES.SYSTEM,
|
|
30392
|
+
channel: STREAM_NAMES.SYSTEM,
|
|
30389
30393
|
agent: STREAM_NAMES.AGENT
|
|
30390
30394
|
};
|
|
30391
30395
|
return prefixToStream[prefix] ?? STREAM_NAMES.CUSTOM;
|
|
@@ -30525,11 +30529,21 @@ var init_streams = __esm(() => {
|
|
|
30525
30529
|
},
|
|
30526
30530
|
[STREAM_NAMES.SYSTEM]: {
|
|
30527
30531
|
name: STREAM_NAMES.SYSTEM,
|
|
30528
|
-
subjects: [
|
|
30532
|
+
subjects: [
|
|
30533
|
+
"system.>",
|
|
30534
|
+
"sync.>",
|
|
30535
|
+
"batch-job.>",
|
|
30536
|
+
"presence.>",
|
|
30537
|
+
"chat.>",
|
|
30538
|
+
"follow_up.>",
|
|
30539
|
+
"flow.>",
|
|
30540
|
+
"template.>",
|
|
30541
|
+
"channel.>"
|
|
30542
|
+
],
|
|
30529
30543
|
max_age: daysToNs(7),
|
|
30530
30544
|
storage: NATS_STORAGE_FILE,
|
|
30531
30545
|
retention: NATS_RETENTION_LIMITS,
|
|
30532
|
-
description: "Internal system events (dead_letter, replay, health, sync, batch-job, presence, chat, follow_up)"
|
|
30546
|
+
description: "Internal system events (dead_letter, replay, health, sync, batch-job, presence, chat, follow_up, flow, template, channel)"
|
|
30533
30547
|
},
|
|
30534
30548
|
[STREAM_NAMES.AGENT]: {
|
|
30535
30549
|
name: STREAM_NAMES.AGENT,
|
|
@@ -32332,8 +32346,14 @@ var init_message = __esm(() => {
|
|
|
32332
32346
|
buttons: exports_external.array(exports_external.object({
|
|
32333
32347
|
text: exports_external.string(),
|
|
32334
32348
|
data: exports_external.string().optional(),
|
|
32335
|
-
url: exports_external.string().url().optional()
|
|
32349
|
+
url: exports_external.string().url().optional(),
|
|
32350
|
+
description: exports_external.string().optional()
|
|
32336
32351
|
})).optional(),
|
|
32352
|
+
list: exports_external.object({
|
|
32353
|
+
sectionTitle: exports_external.string().optional(),
|
|
32354
|
+
buttonLabel: exports_external.string().optional(),
|
|
32355
|
+
forceList: exports_external.boolean().optional()
|
|
32356
|
+
}).optional(),
|
|
32337
32357
|
poll: exports_external.object({
|
|
32338
32358
|
question: exports_external.string(),
|
|
32339
32359
|
options: exports_external.array(exports_external.string()).min(2),
|
|
@@ -32683,7 +32703,8 @@ var init_whatsapp_cloud = __esm(() => {
|
|
|
32683
32703
|
screen: exports_external.string().optional(),
|
|
32684
32704
|
data: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
32685
32705
|
flowToken: exports_external.string().optional(),
|
|
32686
|
-
draft: exports_external.boolean().optional()
|
|
32706
|
+
draft: exports_external.boolean().optional(),
|
|
32707
|
+
flowAction: exports_external.enum(["navigate", "data_exchange"]).optional()
|
|
32687
32708
|
}).refine((v) => Boolean(v.flowId) !== Boolean(v.flowName), {
|
|
32688
32709
|
message: "Provide exactly one of flowId or flowName",
|
|
32689
32710
|
path: ["flowId"]
|
|
@@ -32704,6 +32725,179 @@ var init_whatsapp_cloud = __esm(() => {
|
|
|
32704
32725
|
});
|
|
32705
32726
|
});
|
|
32706
32727
|
|
|
32728
|
+
// ../core/src/schemas/whatsapp-flows.ts
|
|
32729
|
+
function addIssue(ctx, path, message) {
|
|
32730
|
+
ctx.addIssue({ code: exports_external.ZodIssueCode.custom, path, message });
|
|
32731
|
+
}
|
|
32732
|
+
function checkScreenIdentity(flow, idSet, ctx) {
|
|
32733
|
+
if (idSet.size !== flow.screens.length) {
|
|
32734
|
+
addIssue(ctx, ["screens"], "screen ids must be unique");
|
|
32735
|
+
}
|
|
32736
|
+
if (!flow.screens.some((s) => s.terminal === true)) {
|
|
32737
|
+
addIssue(ctx, ["screens"], "at least one screen must set terminal: true");
|
|
32738
|
+
}
|
|
32739
|
+
}
|
|
32740
|
+
function checkRoutingModel(flow, idSet, ctx) {
|
|
32741
|
+
for (const [from, targets] of Object.entries(flow.routing_model ?? {})) {
|
|
32742
|
+
if (!idSet.has(from)) {
|
|
32743
|
+
addIssue(ctx, ["routing_model", from], `routing_model references unknown screen '${from}'`);
|
|
32744
|
+
}
|
|
32745
|
+
for (const target of targets) {
|
|
32746
|
+
if (!idSet.has(target)) {
|
|
32747
|
+
addIssue(ctx, ["routing_model", from], `routing_model routes '${from}' to unknown screen '${target}'`);
|
|
32748
|
+
}
|
|
32749
|
+
}
|
|
32750
|
+
}
|
|
32751
|
+
}
|
|
32752
|
+
function checkRichTextIsolation(screen, screenIdx, ctx) {
|
|
32753
|
+
const children = screen.layout.children;
|
|
32754
|
+
const hasRichText = children.some((c2) => c2.type === "RichText");
|
|
32755
|
+
if (hasRichText && children.some((c2) => c2.type !== "RichText" && c2.type !== "Footer")) {
|
|
32756
|
+
addIssue(ctx, ["screens", screenIdx, "layout", "children"], `screen '${screen.id}': RichText must be the only component on the screen (Footer excepted)`);
|
|
32757
|
+
}
|
|
32758
|
+
}
|
|
32759
|
+
function checkNavigateTargets(node, path, screen, screenIdx, idSet, ctx) {
|
|
32760
|
+
if (Array.isArray(node)) {
|
|
32761
|
+
node.forEach((child, i) => checkNavigateTargets(child, [...path, i], screen, screenIdx, idSet, ctx));
|
|
32762
|
+
return;
|
|
32763
|
+
}
|
|
32764
|
+
if (node === null || typeof node !== "object")
|
|
32765
|
+
return;
|
|
32766
|
+
const obj = node;
|
|
32767
|
+
const action = obj["on-click-action"];
|
|
32768
|
+
if (action?.name === "navigate") {
|
|
32769
|
+
const next = action.next;
|
|
32770
|
+
if (next?.type === "screen" && typeof next.name === "string" && !idSet.has(next.name)) {
|
|
32771
|
+
addIssue(ctx, ["screens", screenIdx, ...path], `screen '${screen.id}': navigate targets unknown screen '${next.name}'`);
|
|
32772
|
+
}
|
|
32773
|
+
}
|
|
32774
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
32775
|
+
if (typeof value === "object" && value !== null) {
|
|
32776
|
+
checkNavigateTargets(value, [...path, key], screen, screenIdx, idSet, ctx);
|
|
32777
|
+
}
|
|
32778
|
+
}
|
|
32779
|
+
}
|
|
32780
|
+
function validateFlowJson(flowJson, opts = {}) {
|
|
32781
|
+
let doc = flowJson;
|
|
32782
|
+
if (typeof flowJson === "string") {
|
|
32783
|
+
try {
|
|
32784
|
+
doc = JSON.parse(flowJson);
|
|
32785
|
+
} catch {
|
|
32786
|
+
return { valid: false, issues: [{ path: "", message: "flowJson is not valid JSON" }] };
|
|
32787
|
+
}
|
|
32788
|
+
}
|
|
32789
|
+
const parsed = FlowJsonSchema.safeParse(doc);
|
|
32790
|
+
const issues = parsed.success ? [] : parsed.error.issues.map((issue) => ({ path: issue.path.join("."), message: issue.message }));
|
|
32791
|
+
const hasDataApiVersion = typeof doc === "object" && doc !== null && "data_api_version" in doc;
|
|
32792
|
+
if (opts.dynamic && !hasDataApiVersion) {
|
|
32793
|
+
issues.push({
|
|
32794
|
+
path: "data_api_version",
|
|
32795
|
+
message: "dynamic (endpoint-backed) flows must set data_api_version: '3.0'"
|
|
32796
|
+
});
|
|
32797
|
+
}
|
|
32798
|
+
if (!opts.dynamic && hasDataApiVersion) {
|
|
32799
|
+
issues.push({
|
|
32800
|
+
path: "data_api_version",
|
|
32801
|
+
message: "data_api_version is set but the flow is not dynamic \u2014 without a registered endpoint_uri the flow fails on open ('an error occurred'). Remove it or create/update the flow with dynamic: true"
|
|
32802
|
+
});
|
|
32803
|
+
}
|
|
32804
|
+
return { valid: issues.length === 0, issues };
|
|
32805
|
+
}
|
|
32806
|
+
var FlowActionSchema, dataSourceEntry, FlowComponentSchema, FlowScreenSchema, FlowJsonSchema;
|
|
32807
|
+
var init_whatsapp_flows = __esm(() => {
|
|
32808
|
+
init_zod();
|
|
32809
|
+
FlowActionSchema = exports_external.object({
|
|
32810
|
+
name: exports_external.enum(["navigate", "complete", "data_exchange", "open_url", "update_data"]),
|
|
32811
|
+
next: exports_external.object({
|
|
32812
|
+
type: exports_external.enum(["screen", "plugin"]),
|
|
32813
|
+
name: exports_external.string().min(1)
|
|
32814
|
+
}).optional(),
|
|
32815
|
+
payload: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
32816
|
+
url: exports_external.string().optional()
|
|
32817
|
+
}).passthrough();
|
|
32818
|
+
dataSourceEntry = exports_external.object({
|
|
32819
|
+
id: exports_external.string().min(1),
|
|
32820
|
+
title: exports_external.string().min(1)
|
|
32821
|
+
}).passthrough();
|
|
32822
|
+
FlowComponentSchema = exports_external.lazy(() => exports_external.union([
|
|
32823
|
+
exports_external.object({
|
|
32824
|
+
type: exports_external.literal("RichText"),
|
|
32825
|
+
text: exports_external.string().min(1)
|
|
32826
|
+
}).passthrough(),
|
|
32827
|
+
exports_external.object({
|
|
32828
|
+
type: exports_external.literal("Image"),
|
|
32829
|
+
src: exports_external.string().min(1),
|
|
32830
|
+
height: exports_external.number().int().positive().optional()
|
|
32831
|
+
}).passthrough(),
|
|
32832
|
+
exports_external.object({
|
|
32833
|
+
type: exports_external.literal("Footer"),
|
|
32834
|
+
label: exports_external.string().min(1),
|
|
32835
|
+
"on-click-action": FlowActionSchema
|
|
32836
|
+
}).passthrough(),
|
|
32837
|
+
exports_external.object({
|
|
32838
|
+
type: exports_external.literal("Form"),
|
|
32839
|
+
name: exports_external.string().min(1),
|
|
32840
|
+
children: exports_external.array(FlowComponentSchema)
|
|
32841
|
+
}).passthrough(),
|
|
32842
|
+
exports_external.object({
|
|
32843
|
+
type: exports_external.enum(["Dropdown", "RadioButtonsGroup", "CheckboxGroup", "ChipsSelector"]),
|
|
32844
|
+
name: exports_external.string().min(1),
|
|
32845
|
+
"data-source": exports_external.array(dataSourceEntry).min(1)
|
|
32846
|
+
}).passthrough(),
|
|
32847
|
+
exports_external.object({
|
|
32848
|
+
type: exports_external.enum(["TextInput", "TextArea", "DatePicker", "OptIn"]),
|
|
32849
|
+
name: exports_external.string().min(1)
|
|
32850
|
+
}).passthrough(),
|
|
32851
|
+
exports_external.object({
|
|
32852
|
+
type: exports_external.enum(["TextHeading", "TextSubheading", "TextBody", "TextCaption"]),
|
|
32853
|
+
text: exports_external.string().min(1)
|
|
32854
|
+
}).passthrough(),
|
|
32855
|
+
exports_external.object({ type: exports_external.string().min(1) }).passthrough().refine((c2) => ![
|
|
32856
|
+
"RichText",
|
|
32857
|
+
"Image",
|
|
32858
|
+
"Footer",
|
|
32859
|
+
"Form",
|
|
32860
|
+
"Dropdown",
|
|
32861
|
+
"RadioButtonsGroup",
|
|
32862
|
+
"CheckboxGroup",
|
|
32863
|
+
"ChipsSelector",
|
|
32864
|
+
"TextInput",
|
|
32865
|
+
"TextArea",
|
|
32866
|
+
"DatePicker",
|
|
32867
|
+
"OptIn",
|
|
32868
|
+
"TextHeading",
|
|
32869
|
+
"TextSubheading",
|
|
32870
|
+
"TextBody",
|
|
32871
|
+
"TextCaption"
|
|
32872
|
+
].includes(c2.type), { message: "known component failed its specific shape" })
|
|
32873
|
+
]));
|
|
32874
|
+
FlowScreenSchema = exports_external.object({
|
|
32875
|
+
id: exports_external.string().min(1),
|
|
32876
|
+
title: exports_external.string().optional(),
|
|
32877
|
+
terminal: exports_external.boolean().optional(),
|
|
32878
|
+
data: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
32879
|
+
refresh_on_back: exports_external.boolean().optional(),
|
|
32880
|
+
layout: exports_external.object({
|
|
32881
|
+
type: exports_external.literal("SingleColumnLayout"),
|
|
32882
|
+
children: exports_external.array(FlowComponentSchema)
|
|
32883
|
+
}).passthrough()
|
|
32884
|
+
}).passthrough();
|
|
32885
|
+
FlowJsonSchema = exports_external.object({
|
|
32886
|
+
version: exports_external.string().min(1),
|
|
32887
|
+
data_api_version: exports_external.literal("3.0").optional(),
|
|
32888
|
+
routing_model: exports_external.record(exports_external.string(), exports_external.array(exports_external.string())).optional(),
|
|
32889
|
+
screens: exports_external.array(FlowScreenSchema).min(1)
|
|
32890
|
+
}).passthrough().superRefine((flow, ctx) => {
|
|
32891
|
+
const idSet = new Set(flow.screens.map((s) => s.id));
|
|
32892
|
+
checkScreenIdentity(flow, idSet, ctx);
|
|
32893
|
+
checkRoutingModel(flow, idSet, ctx);
|
|
32894
|
+
flow.screens.forEach((screen, screenIdx) => {
|
|
32895
|
+
checkRichTextIsolation(screen, screenIdx, ctx);
|
|
32896
|
+
checkNavigateTargets(screen.layout.children, ["layout", "children"], screen, screenIdx, idSet, ctx);
|
|
32897
|
+
});
|
|
32898
|
+
});
|
|
32899
|
+
});
|
|
32900
|
+
|
|
32707
32901
|
// ../core/src/schemas/hermes.ts
|
|
32708
32902
|
var HermesContactSchema, HermesWebhookPayloadSchema;
|
|
32709
32903
|
var init_hermes = __esm(() => {
|
|
@@ -32736,6 +32930,7 @@ var init_schemas = __esm(() => {
|
|
|
32736
32930
|
init_message();
|
|
32737
32931
|
init_person();
|
|
32738
32932
|
init_whatsapp_cloud();
|
|
32933
|
+
init_whatsapp_flows();
|
|
32739
32934
|
init_hermes();
|
|
32740
32935
|
});
|
|
32741
32936
|
|
|
@@ -67155,12 +67350,67 @@ var init_hooks = __esm(() => {
|
|
|
67155
67350
|
init_executor();
|
|
67156
67351
|
});
|
|
67157
67352
|
|
|
67353
|
+
// ../core/src/markdown-to-whatsapp.ts
|
|
67354
|
+
function replaceWithTokens(input, regex2, formatter2, tokenPrefix) {
|
|
67355
|
+
const tokens = [];
|
|
67356
|
+
const text = input.replace(regex2, (match, ...rest) => {
|
|
67357
|
+
const token = `${tokenPrefix}${tokens.length}__`;
|
|
67358
|
+
const execMatch = Object.assign([match], {
|
|
67359
|
+
0: match,
|
|
67360
|
+
index: 0,
|
|
67361
|
+
input,
|
|
67362
|
+
groups: undefined
|
|
67363
|
+
});
|
|
67364
|
+
for (let g11 = 0;g11 < rest.length - 2; g11++) {
|
|
67365
|
+
execMatch[g11 + 1] = rest[g11];
|
|
67366
|
+
}
|
|
67367
|
+
tokens.push(formatter2(execMatch, tokens.length));
|
|
67368
|
+
return token;
|
|
67369
|
+
});
|
|
67370
|
+
return { text, tokens };
|
|
67371
|
+
}
|
|
67372
|
+
function restoreTokens(input, tokens, tokenPrefix) {
|
|
67373
|
+
let result = input;
|
|
67374
|
+
for (let i6 = 0;i6 < tokens.length; i6 += 1) {
|
|
67375
|
+
result = result.replace(`${tokenPrefix}${i6}__`, tokens[i6] ?? "");
|
|
67376
|
+
}
|
|
67377
|
+
return result;
|
|
67378
|
+
}
|
|
67379
|
+
function convertHeaders(input) {
|
|
67380
|
+
return input.replace(/^(#{1,6})\s+(.+)$/gm, (_full, _hashes, content) => `**${content.trim()}**`);
|
|
67381
|
+
}
|
|
67382
|
+
function convertLinks(input) {
|
|
67383
|
+
return input.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, "$1: $2");
|
|
67384
|
+
}
|
|
67385
|
+
function convertEmphasis(input) {
|
|
67386
|
+
const boldTokenPrefix = "__WA_BOLD_";
|
|
67387
|
+
const tripleTokenPrefix = "__WA_TRIPLE_";
|
|
67388
|
+
const triple = replaceWithTokens(input, /\*\*\*([^*\n]+?)\*\*\*/g, (match) => `*_${match[1]}_*`, tripleTokenPrefix);
|
|
67389
|
+
const bold = replaceWithTokens(triple.text, /\*\*([^*\n]+?)\*\*/g, (match) => `*${match[1]}*`, boldTokenPrefix);
|
|
67390
|
+
const converted = bold.text.replace(/~~~([\s\S]+?)~~~/g, "~$1~").replace(/~~([\s\S]+?)~~/g, "~$1~").replace(/(^|[^*])\*([^*\n]+?)\*(?!\*)/g, "$1_$2_");
|
|
67391
|
+
const withBold = restoreTokens(converted, bold.tokens, boldTokenPrefix);
|
|
67392
|
+
return restoreTokens(withBold, triple.tokens, tripleTokenPrefix);
|
|
67393
|
+
}
|
|
67394
|
+
function markdownToWhatsApp(markdown) {
|
|
67395
|
+
const fenced = replaceWithTokens(markdown, /```([^\n`]*)\n([\s\S]*?)```/g, (match) => {
|
|
67396
|
+
const code = match[2] ?? "";
|
|
67397
|
+
return `\`\`\`
|
|
67398
|
+
${code}\`\`\``;
|
|
67399
|
+
}, CODE_BLOCK_TOKEN_PREFIX);
|
|
67400
|
+
const inline = replaceWithTokens(fenced.text, /`([^`\n]+?)`/g, (match) => `\`${match[1]}\``, INLINE_CODE_TOKEN_PREFIX);
|
|
67401
|
+
const converted = convertEmphasis(convertLinks(convertHeaders(inline.text)));
|
|
67402
|
+
const withInline = restoreTokens(converted, inline.tokens, INLINE_CODE_TOKEN_PREFIX);
|
|
67403
|
+
return restoreTokens(withInline, fenced.tokens, CODE_BLOCK_TOKEN_PREFIX);
|
|
67404
|
+
}
|
|
67405
|
+
var CODE_BLOCK_TOKEN_PREFIX = "__WA_CODE_BLOCK_", INLINE_CODE_TOKEN_PREFIX = "__WA_INLINE_CODE_";
|
|
67406
|
+
|
|
67158
67407
|
// ../core/src/index.ts
|
|
67159
67408
|
var exports_src = {};
|
|
67160
67409
|
__export(exports_src, {
|
|
67161
67410
|
wrapError: () => wrapError,
|
|
67162
67411
|
withTiming: () => withTiming,
|
|
67163
67412
|
validateReplayOptions: () => validateReplayOptions,
|
|
67413
|
+
validateFlowJson: () => validateFlowJson,
|
|
67164
67414
|
updateSystemMetrics: () => updateSystemMetrics,
|
|
67165
67415
|
updateOpenClawWsState: () => updateOpenClawWsState,
|
|
67166
67416
|
updateOpenClawCircuitBreaker: () => updateOpenClawCircuitBreaker,
|
|
@@ -67231,6 +67481,7 @@ __export(exports_src, {
|
|
|
67231
67481
|
natsMessagesPublished: () => natsMessagesPublished,
|
|
67232
67482
|
natsConnectionStatus: () => natsConnectionStatus,
|
|
67233
67483
|
matchesPattern: () => matchesPattern,
|
|
67484
|
+
markdownToWhatsApp: () => markdownToWhatsApp,
|
|
67234
67485
|
isValidUuid: () => isValidUuid,
|
|
67235
67486
|
isTenantSecretSealingEnabled: () => isTenantSecretSealingEnabled,
|
|
67236
67487
|
isSystemEvent: () => isSystemEvent,
|
|
@@ -67450,6 +67701,10 @@ __export(exports_src, {
|
|
|
67450
67701
|
GuildConfigAuditEntrySchema: () => GuildConfigAuditEntrySchema,
|
|
67451
67702
|
FollowUpSequenceConfigSchema: () => FollowUpSequenceConfigSchema,
|
|
67452
67703
|
FollowUpScheduleSchema: () => FollowUpScheduleSchema,
|
|
67704
|
+
FlowScreenSchema: () => FlowScreenSchema,
|
|
67705
|
+
FlowJsonSchema: () => FlowJsonSchema,
|
|
67706
|
+
FlowComponentSchema: () => FlowComponentSchema,
|
|
67707
|
+
FlowActionSchema: () => FlowActionSchema,
|
|
67453
67708
|
FixedScheduleSchema: () => FixedScheduleSchema,
|
|
67454
67709
|
ExponentialScheduleSchema: () => ExponentialScheduleSchema,
|
|
67455
67710
|
EventValidationError: () => ValidationError,
|
|
@@ -72822,6 +73077,7 @@ var init_pg_core = __esm(() => {
|
|
|
72822
73077
|
var exports_schema = {};
|
|
72823
73078
|
__export(exports_schema, {
|
|
72824
73079
|
whatsappTemplates: () => whatsappTemplates,
|
|
73080
|
+
whatsappFlowKeys: () => whatsappFlowKeys,
|
|
72825
73081
|
webhookSources: () => webhookSources,
|
|
72826
73082
|
turnsRelations: () => turnsRelations,
|
|
72827
73083
|
turns: () => turns,
|
|
@@ -72951,7 +73207,7 @@ __export(exports_schema, {
|
|
|
72951
73207
|
accessRules: () => accessRules,
|
|
72952
73208
|
accessModes: () => accessModes
|
|
72953
73209
|
});
|
|
72954
|
-
var channelTypes, agentTypes, agentSystems, agentEntityTypes, debounceMode, splitDelayMode, supersedeMode, replyFilterMode, agentSessionStrategies, ruleTypes, accessModes, settingValueTypes, apiKeyStatuses, apiKeyProfiles, eventTypes, contentTypes, chatTypes, messageSources, messageTypes, messageStatuses, deliveryStatuses, jobStatuses, providerSchemas, agentProviders, agents, agentRoutes, agentSessions, apiKeys, apiKeyAuditLogs, apiKeysRelations, apiKeyAuditLogsRelations, instances, whatsappTemplates, persons, platformIdentities, conversations, chats, chatParticipants, omniGroups, messages2, omniEvents, handoffLogs, closeContactOutcomes, closeContactLogs, accessRules, globalSettings, settingChangeHistory, batchJobs, syncJobTypes, syncJobs, mediaContent, chatIdMappings, pluginStorage, agentProvidersRelations, agentsRelations, instancesRelations, syncJobsRelations, personsRelations, platformIdentitiesRelations, conversationsRelations, chatsRelations, chatParticipantsRelations, messagesRelations, omniEventsRelations, accessRulesRelations, globalSettingsRelations, settingChangeHistoryRelations, batchJobsRelations, mediaContentRelations, chatIdMappingsRelations, deadLetterStatuses, deadLetterEvents, payloadStorageConfig, payloadStages, eventPayloads, webhookSources, conditionOperators, actionTypes, automationDebounceModes, automations2, automationLogStatuses, automationLogs, consumerOffsets, automationsRelations, automationLogsRelations, triggerLogs, triggerLogsRelations, agentRoutesRelations, agentTaskStatuses, agentTasks, agentTasksRelations, turnStatuses, turnActions, turns, turnsRelations, followUpDisarmReasons, chatFollowUpState, chatFollowUpStateRelations, processedEvents, genieHosts, tenantStatuses, principalTypes, principalStatuses, tenantRoles, membershipStatuses, credentialClasses, authCredentialStatuses, platformApiKeyStatuses, tenants, principals, tenantMemberships, tenantRolePolicies, platformApiKeys, tenantKeyLineage, authCredentials, tenantAuditLogs, platformAuditLogs, platformProviderCatalog, tenantProviderConfig, platformSettings, tenantSettings, platformSettingChangeHistory, tenantSettingChangeHistory, platformPluginStorage, tenantPluginStorage, platformPayloadStorageConfig, tenantPayloadStorageOverrides, tenantMigrationLedger, tenantMigrationLedgerHistory;
|
|
73210
|
+
var channelTypes, agentTypes, agentSystems, agentEntityTypes, debounceMode, splitDelayMode, supersedeMode, replyFilterMode, agentSessionStrategies, ruleTypes, accessModes, settingValueTypes, apiKeyStatuses, apiKeyProfiles, eventTypes, contentTypes, chatTypes, messageSources, messageTypes, messageStatuses, deliveryStatuses, jobStatuses, providerSchemas, agentProviders, agents, agentRoutes, agentSessions, apiKeys, apiKeyAuditLogs, apiKeysRelations, apiKeyAuditLogsRelations, instances, whatsappTemplates, whatsappFlowKeys, persons, platformIdentities, conversations, chats, chatParticipants, omniGroups, messages2, omniEvents, handoffLogs, closeContactOutcomes, closeContactLogs, accessRules, globalSettings, settingChangeHistory, batchJobs, syncJobTypes, syncJobs, mediaContent, chatIdMappings, pluginStorage, agentProvidersRelations, agentsRelations, instancesRelations, syncJobsRelations, personsRelations, platformIdentitiesRelations, conversationsRelations, chatsRelations, chatParticipantsRelations, messagesRelations, omniEventsRelations, accessRulesRelations, globalSettingsRelations, settingChangeHistoryRelations, batchJobsRelations, mediaContentRelations, chatIdMappingsRelations, deadLetterStatuses, deadLetterEvents, payloadStorageConfig, payloadStages, eventPayloads, webhookSources, conditionOperators, actionTypes, automationDebounceModes, automations2, automationLogStatuses, automationLogs, consumerOffsets, automationsRelations, automationLogsRelations, triggerLogs, triggerLogsRelations, agentRoutesRelations, agentTaskStatuses, agentTasks, agentTasksRelations, turnStatuses, turnActions, turns, turnsRelations, followUpDisarmReasons, chatFollowUpState, chatFollowUpStateRelations, processedEvents, genieHosts, tenantStatuses, principalTypes, principalStatuses, tenantRoles, membershipStatuses, credentialClasses, authCredentialStatuses, platformApiKeyStatuses, tenants, principals, tenantMemberships, tenantRolePolicies, platformApiKeys, tenantKeyLineage, authCredentials, tenantAuditLogs, platformAuditLogs, platformProviderCatalog, tenantProviderConfig, platformSettings, tenantSettings, platformSettingChangeHistory, tenantSettingChangeHistory, platformPluginStorage, tenantPluginStorage, platformPayloadStorageConfig, tenantPayloadStorageOverrides, tenantMigrationLedger, tenantMigrationLedgerHistory;
|
|
72955
73211
|
var init_schema2 = __esm(() => {
|
|
72956
73212
|
init_events();
|
|
72957
73213
|
init_types5();
|
|
@@ -73361,6 +73617,17 @@ var init_schema2 = __esm(() => {
|
|
|
73361
73617
|
instanceNameLangUnique: uniqueIndex("idx_wa_tpl_instance_name_lang").on(t.instanceId, t.name, t.language),
|
|
73362
73618
|
statusIdx: index("idx_wa_tpl_status").on(t.status)
|
|
73363
73619
|
}));
|
|
73620
|
+
whatsappFlowKeys = pgTable("whatsapp_flow_keys", {
|
|
73621
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
73622
|
+
instanceId: uuid("instance_id").notNull().references(() => instances.id, { onDelete: "cascade" }),
|
|
73623
|
+
privateKeyPem: text("private_key_pem").notNull(),
|
|
73624
|
+
publicKeyPem: text("public_key_pem").notNull(),
|
|
73625
|
+
uploadedAt: timestamp("uploaded_at", { withTimezone: true }),
|
|
73626
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
73627
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
73628
|
+
}, (t) => ({
|
|
73629
|
+
instanceUnique: uniqueIndex("idx_wa_flow_keys_instance").on(t.instanceId)
|
|
73630
|
+
}));
|
|
73364
73631
|
persons = pgTable("persons", {
|
|
73365
73632
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
73366
73633
|
displayName: varchar("display_name", { length: 255 }),
|
|
@@ -127882,7 +128149,7 @@ import { fileURLToPath } from "url";
|
|
|
127882
128149
|
// package.json
|
|
127883
128150
|
var package_default = {
|
|
127884
128151
|
name: "@automagik/omni",
|
|
127885
|
-
version: "2.
|
|
128152
|
+
version: "2.260803.2",
|
|
127886
128153
|
description: "LLM-optimized CLI for Omni",
|
|
127887
128154
|
type: "module",
|
|
127888
128155
|
bin: {
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fluent WhatsApp Flow JSON builder.
|
|
3
|
+
*
|
|
4
|
+
* Hand-authored (not generated): produces Meta Flow JSON v6.x for the
|
|
5
|
+
* whatsapp-flows routes (`POST /instances/{id}/whatsapp-flows` with the
|
|
6
|
+
* built `flowJson`). `build()` enforces the structural rules Meta reports
|
|
7
|
+
* late (or not at all) so mistakes fail at authoring time:
|
|
8
|
+
*
|
|
9
|
+
* - RichText must be alone on its screen (Footer excepted)
|
|
10
|
+
* - navigate targets must be declared screens
|
|
11
|
+
* - at least one terminal screen
|
|
12
|
+
* - `dynamic` flows get `data_api_version: '3.0'`; static flows must not
|
|
13
|
+
* carry it (an endpoint-less data_api_version flow errors on open)
|
|
14
|
+
*
|
|
15
|
+
* The API re-validates server-side with the authoritative schema — this
|
|
16
|
+
* builder exists so you rarely get that far with an invalid document.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const { flowJson } = flow({ version: '6.3' })
|
|
21
|
+
* .screen('INTRO', { title: 'Welcome' }, (s) => {
|
|
22
|
+
* s.image(base64Png, { height: 240 });
|
|
23
|
+
* s.heading('Hello!');
|
|
24
|
+
* s.footerNavigate('Start', 'FORM');
|
|
25
|
+
* })
|
|
26
|
+
* .screen('FORM', { title: 'About you', terminal: true }, (s) => {
|
|
27
|
+
* s.form('form', (f) => {
|
|
28
|
+
* f.textInput('name', 'Your name', { required: true });
|
|
29
|
+
* f.dropdown('channel', 'Favorite channel', [{ id: 'wa', title: 'WhatsApp' }]);
|
|
30
|
+
* f.footerComplete('Submit', { name: '${form.name}', channel: '${form.channel}' });
|
|
31
|
+
* });
|
|
32
|
+
* })
|
|
33
|
+
* .build();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export type FlowComponent = Record<string, unknown>;
|
|
37
|
+
export interface DataSourceItem {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ScreenOptions {
|
|
42
|
+
title?: string;
|
|
43
|
+
terminal?: boolean;
|
|
44
|
+
/** Dynamic-flow screens: declared data contract for endpoint-provided values. */
|
|
45
|
+
data?: Record<string, unknown>;
|
|
46
|
+
/** Call the data endpoint with BACK when the user navigates back here. */
|
|
47
|
+
refreshOnBack?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface FlowOptions {
|
|
50
|
+
/** Flow JSON version. Default '6.3'. */
|
|
51
|
+
version?: string;
|
|
52
|
+
/** Endpoint-backed flow: emits data_api_version '3.0'. Pair with the route's `dynamic: true`. */
|
|
53
|
+
dynamic?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export declare class FlowBuilderError extends Error {
|
|
56
|
+
constructor(message: string);
|
|
57
|
+
}
|
|
58
|
+
interface InputOptions {
|
|
59
|
+
required?: boolean;
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}
|
|
62
|
+
/** Builds the component list of one Form. */
|
|
63
|
+
export declare class FormBuilder {
|
|
64
|
+
readonly components: FlowComponent[];
|
|
65
|
+
private footerSet;
|
|
66
|
+
textInput(name: string, label: string, opts?: InputOptions & {
|
|
67
|
+
inputType?: string;
|
|
68
|
+
}): this;
|
|
69
|
+
textArea(name: string, label: string, opts?: InputOptions): this;
|
|
70
|
+
datePicker(name: string, label: string, opts?: InputOptions): this;
|
|
71
|
+
optIn(name: string, label: string, opts?: InputOptions): this;
|
|
72
|
+
dropdown(name: string, label: string, dataSource: DataSourceItem[], opts?: InputOptions): this;
|
|
73
|
+
radioButtons(name: string, label: string, dataSource: DataSourceItem[], opts?: InputOptions): this;
|
|
74
|
+
checkboxGroup(name: string, label: string, dataSource: DataSourceItem[], opts?: InputOptions): this;
|
|
75
|
+
/** Terminal submit: completes the flow, `payload` reaches the nfm_reply webhook. */
|
|
76
|
+
footerComplete(label: string, payload: Record<string, unknown>): this;
|
|
77
|
+
/** Submit this screen to the data endpoint (dynamic flows) — it decides what's next. */
|
|
78
|
+
footerDataExchange(label: string, payload?: Record<string, unknown>): this;
|
|
79
|
+
footerNavigate(label: string, nextScreen: string, payload?: Record<string, unknown>): this;
|
|
80
|
+
/** Escape hatch for components the builder doesn't model. */
|
|
81
|
+
raw(component: FlowComponent): this;
|
|
82
|
+
private footer;
|
|
83
|
+
}
|
|
84
|
+
export declare class ScreenBuilder {
|
|
85
|
+
readonly id: string;
|
|
86
|
+
readonly components: FlowComponent[];
|
|
87
|
+
constructor(id: string);
|
|
88
|
+
heading(text: string): this;
|
|
89
|
+
subheading(text: string): this;
|
|
90
|
+
body(text: string): this;
|
|
91
|
+
caption(text: string): this;
|
|
92
|
+
/**
|
|
93
|
+
* Markdown-ish rich text. Meta requires RichText to be ALONE on its screen
|
|
94
|
+
* (Footer excepted) and `text` to be a single string — both enforced at build.
|
|
95
|
+
*/
|
|
96
|
+
richText(text: string): this;
|
|
97
|
+
/** `src` is base64-encoded image bytes (not a URL). */
|
|
98
|
+
image(src: string, opts?: {
|
|
99
|
+
height?: number;
|
|
100
|
+
scaleType?: 'cover' | 'contain';
|
|
101
|
+
altText?: string;
|
|
102
|
+
}): this;
|
|
103
|
+
form(name: string, define: (form: FormBuilder) => void): this;
|
|
104
|
+
footerNavigate(label: string, nextScreen: string, payload?: Record<string, unknown>): this;
|
|
105
|
+
footerComplete(label: string, payload: Record<string, unknown>): this;
|
|
106
|
+
footerDataExchange(label: string, payload?: Record<string, unknown>): this;
|
|
107
|
+
/** Escape hatch for components the builder doesn't model. */
|
|
108
|
+
raw(component: FlowComponent): this;
|
|
109
|
+
}
|
|
110
|
+
export declare class FlowBuilder {
|
|
111
|
+
private readonly options;
|
|
112
|
+
private readonly screens;
|
|
113
|
+
constructor(options?: FlowOptions);
|
|
114
|
+
screen(id: string, options: ScreenOptions, define: (screen: ScreenBuilder) => void): this;
|
|
115
|
+
screen(id: string, define: (screen: ScreenBuilder) => void): this;
|
|
116
|
+
/** Validate and produce the document + its stringified form for the API. */
|
|
117
|
+
build(): {
|
|
118
|
+
json: Record<string, unknown>;
|
|
119
|
+
flowJson: string;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/** Entry point: `flow().screen(...).build()`. */
|
|
123
|
+
export declare function flow(options?: FlowOptions): FlowBuilder;
|
|
124
|
+
export {};
|
|
125
|
+
//# sourceMappingURL=flow-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-builder.d.ts","sourceRoot":"","sources":["../src/flow-builder.ts"],"names":[],"mappings":"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,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;CAsD7D;AAED,iDAAiD;AACjD,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,WAAW,CAE3D"}
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -27,5 +27,7 @@ export declare const VERSION = "0.0.1";
|
|
|
27
27
|
export { createOmniClient, type OmniClient, type OmniClientConfig, } from './client';
|
|
28
28
|
export type { Instance, Person, Event, AccessRule, Setting, Provider, HealthResponse, PaginationMeta, Channel, PaginatedResponse, ListInstancesParams, CreateInstanceBody, SendMessageBody, ListEventsParams, SearchPersonsParams, ListAccessRulesParams, CreateAccessRuleBody, ListSettingsParams, ListProvidersParams, NewAgentProvider, ProviderSchema, ProviderHealthResult, AgnoAgent, AgnoTeam, AgnoWorkflow, StartSyncBody, ListSyncsParams, SyncProfileResult, SyncJobCreated, SyncJobSummary, SyncJobStatus, AuthCredentialContext, AuthValidateResponse, A2ADiscoverableAgent, A2AJsonRpcResponse, Chat, ChatSettings, Message, ChatParticipant, ListChatsParams, CreateChatBody, UpdateChatBody, AddParticipantBody, ListChatMessagesParams, Automation, ListAutomationsParams, CreateAutomationBody, TestAutomationBody, ListAutomationLogsParams, DeadLetter, ListDeadLettersParams, ResolveDeadLetterBody, WebhookSource, ListWebhookSourcesParams, CreateWebhookSourceBody, TriggerEventBody, PayloadConfig, UpdatePayloadConfigBody, DeletePayloadsBody, ReplaySession, StartReplayBody, EventMetrics, EventAnalytics, LogEntry, ListLogsParams, SendMediaBody, SendReactionBody, SendStickerBody, SendContactBody, SendLocationBody, SendPollBody, SendEmbedBody, ConnectInstanceBody, RequestPairingCodeBody, ListContactsParams, ListGroupsParams, Contact, Group, UserProfile, SendPresenceBody, SendPresenceResult, MarkMessageReadBody, BatchMarkReadBody, MarkChatReadBody, MarkReadResult, BatchJobType, BatchJob, BatchJobStatus, BatchJobStatusResponse, ProcessableContentType, CreateBatchJobBody, ListBatchJobsParams, CostEstimate, ApiKeyRecord, ApiKeyStatus, CreateApiKeyBody, CreateApiKeyResult, UpdateApiKeyBody, RevokeApiKeyBody, ListApiKeysParams, } from './client';
|
|
29
29
|
export { OmniApiError, OmniConfigError, type ApiErrorDetails } from './errors';
|
|
30
|
+
export { flow, FlowBuilder, ScreenBuilder, FormBuilder, FlowBuilderError, } from './flow-builder';
|
|
31
|
+
export type { FlowOptions, ScreenOptions, DataSourceItem, FlowComponent } from './flow-builder';
|
|
30
32
|
export type { paths, components, operations } from './types.generated';
|
|
31
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/sdk/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EACL,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAGlB,YAAY,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,UAAU,EACV,OAAO,EACP,QAAQ,EACR,cAAc,EACd,cAAc,EACd,OAAO,EACP,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACR,YAAY,EAEZ,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EAEb,qBAAqB,EACrB,oBAAoB,EAEpB,oBAAoB,EACpB,kBAAkB,EAElB,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EAE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