@exulu/backend 5.15.0 → 5.17.0
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/{chunk-KLPCQWM3.js → chunk-7UDWQTFZ.js} +1 -1
- package/dist/{chunk-NBDSN45T.js → chunk-NBAFO66K.js} +41 -39
- package/dist/{chunk-S4UXKMN5.js → chunk-ZNG2HEDN.js} +56 -3
- package/dist/{convert-exulu-tools-to-ai-sdk-tools-GLRM3PM6.js → convert-exulu-tools-to-ai-sdk-tools-BCHKS5CK.js} +2 -2
- package/dist/{doc_processor-SVOSOVOY.js → doc_processor-RJNG7GGH.js} +2 -2
- package/dist/index.cjs +2676 -417
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3715 -1555
- package/ee/entitlements.ts +3 -0
- package/ee/queues/queues.ts +1 -0
- package/ee/schemas.ts +43 -0
- package/ee/workers.ts +11 -0
- package/package.json +6 -1
package/ee/entitlements.ts
CHANGED
|
@@ -11,6 +11,7 @@ export const ENTITLEMENTS: {
|
|
|
11
11
|
"advanced-document-processing": boolean,
|
|
12
12
|
"rate-limits": boolean,
|
|
13
13
|
"claim-check": boolean,
|
|
14
|
+
"channels": boolean,
|
|
14
15
|
} = {
|
|
15
16
|
"rbac": false,
|
|
16
17
|
"advanced-markdown-chunker": false,
|
|
@@ -24,6 +25,7 @@ export const ENTITLEMENTS: {
|
|
|
24
25
|
"advanced-document-processing": false,
|
|
25
26
|
"rate-limits": false,
|
|
26
27
|
"claim-check": false,
|
|
28
|
+
"channels": false,
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export const checkLicense = () => {
|
|
@@ -49,6 +51,7 @@ export const checkLicense = () => {
|
|
|
49
51
|
"advanced-document-processing": true,
|
|
50
52
|
"rate-limits": true,
|
|
51
53
|
"claim-check": true,
|
|
54
|
+
"channels": true,
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
|
package/ee/queues/queues.ts
CHANGED
package/ee/schemas.ts
CHANGED
|
@@ -520,6 +520,49 @@ export const workflowTemplatesSchema: ExuluTableDefinition = {
|
|
|
520
520
|
],
|
|
521
521
|
};
|
|
522
522
|
|
|
523
|
+
// Chat channels (WhatsApp first): one row per agent and channel type.
|
|
524
|
+
// RBAC false and graphql false, same as workflow_triggers: access is checked
|
|
525
|
+
// through the parent agent in the channel routes, never through auto-CRUD.
|
|
526
|
+
// secrets and verify_token are hidden, so they never appear in a read payload.
|
|
527
|
+
export const agentChannelsSchema: ExuluTableDefinition = {
|
|
528
|
+
type: "agent_channels",
|
|
529
|
+
name: {
|
|
530
|
+
plural: "agent_channels",
|
|
531
|
+
singular: "agent_channel",
|
|
532
|
+
},
|
|
533
|
+
RBAC: false,
|
|
534
|
+
graphql: false,
|
|
535
|
+
fields: [
|
|
536
|
+
{ name: "agent", type: "uuid", required: true, index: true },
|
|
537
|
+
{ name: "type", type: "text", required: true },
|
|
538
|
+
{ name: "enabled", type: "boolean", default: false },
|
|
539
|
+
{ name: "config", type: "json" },
|
|
540
|
+
{ name: "secrets", type: "text", hidden: true },
|
|
541
|
+
{ name: "verify_token", type: "text", hidden: true },
|
|
542
|
+
],
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
// Links a channel identity (for WhatsApp the sender's phone number) to an
|
|
546
|
+
// Exulu user. Unique on (channel, identity), created in init-exulu-db.
|
|
547
|
+
export const channelLinksSchema: ExuluTableDefinition = {
|
|
548
|
+
type: "channel_links",
|
|
549
|
+
name: {
|
|
550
|
+
plural: "channel_links",
|
|
551
|
+
singular: "channel_link",
|
|
552
|
+
},
|
|
553
|
+
RBAC: false,
|
|
554
|
+
graphql: false,
|
|
555
|
+
fields: [
|
|
556
|
+
{ name: "channel", type: "uuid", required: true, index: true },
|
|
557
|
+
{ name: "identity", type: "text", required: true },
|
|
558
|
+
{ name: "user", type: "number", required: true, index: true },
|
|
559
|
+
{ name: "linked_at", type: "date" },
|
|
560
|
+
{ name: "expires_at", type: "date" },
|
|
561
|
+
{ name: "revoked_at", type: "date" },
|
|
562
|
+
{ name: "last_seen_at", type: "date" },
|
|
563
|
+
],
|
|
564
|
+
};
|
|
565
|
+
|
|
523
566
|
// Email-triggered routines (spec §3.1): one inbound trigger per routine.
|
|
524
567
|
// RBAC is false — access is checked via the parent workflow_templates row
|
|
525
568
|
// (routine read for listing, routine write + workflows:write role for CRUD),
|
package/ee/workers.ts
CHANGED
|
@@ -39,6 +39,7 @@ import { updateStatistic } from "@SRC/exulu/statistics";
|
|
|
39
39
|
import { saveChat, getAgentMessages, generateStream } from "@SRC/exulu/generate-stream";
|
|
40
40
|
import { exuluApp } from "@SRC/exulu/app/singleton";
|
|
41
41
|
import { handleEmailIntake } from "@SRC/exulu/email-inbound/intake";
|
|
42
|
+
import { createChannelWorkerEnv, runChannelMessageJob } from "@SRC/exulu/channels/worker";
|
|
42
43
|
import { markStreamActive, clearStreamActive } from "@SRC/exulu/active-streams.ts";
|
|
43
44
|
import { messageHasPendingApproval, substituteVariablesInMessage } from "@SRC/exulu/routines/flow-steps.ts";
|
|
44
45
|
import { withRunSession } from "@SRC/exulu/routines/run-session.ts";
|
|
@@ -1301,6 +1302,16 @@ export const createWorkers = async (
|
|
|
1301
1302
|
return { result, metadata: {} };
|
|
1302
1303
|
}
|
|
1303
1304
|
|
|
1305
|
+
if (data.type === "channel_message") {
|
|
1306
|
+
// WhatsApp message (channels/worker.ts). The result holds ids and the outcome
|
|
1307
|
+
// only: the completed handler logs it, so no message text belongs in it.
|
|
1308
|
+
const result = await runChannelMessageJob(
|
|
1309
|
+
data.inputs,
|
|
1310
|
+
createChannelWorkerEnv({ tools, contexts, config }),
|
|
1311
|
+
);
|
|
1312
|
+
return { result, metadata: {} };
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1304
1315
|
throw new Error(`Invalid job type: ${data.type} for job ${bullmqJob.name}.`);
|
|
1305
1316
|
} catch (error: unknown) {
|
|
1306
1317
|
console.error(
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exulu/backend",
|
|
3
3
|
"author": "Qventu B.V.",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.17.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"private": false,
|
|
7
7
|
"publishConfig": {
|
|
@@ -107,6 +107,8 @@
|
|
|
107
107
|
"@aws-sdk/client-s3": "^3.338.0",
|
|
108
108
|
"@aws-sdk/client-sts": "^3.338.0",
|
|
109
109
|
"@aws-sdk/s3-request-presigner": "^3.338.0",
|
|
110
|
+
"@chat-adapter/state-pg": "4.45.0",
|
|
111
|
+
"@chat-adapter/whatsapp": "4.45.0",
|
|
110
112
|
"@llamaindex/liteparse": "^1.0.1",
|
|
111
113
|
"@mistralai/mistralai": "^2.1.1",
|
|
112
114
|
"@modelcontextprotocol/sdk": "^1.14.0",
|
|
@@ -121,12 +123,15 @@
|
|
|
121
123
|
"@opentelemetry/winston-transport": "^0.14.1",
|
|
122
124
|
"@perplexity-ai/perplexity_ai": "^0.25.0",
|
|
123
125
|
"ai": "6.0.330",
|
|
126
|
+
"ajv": "^8.20.0",
|
|
127
|
+
"ajv-formats": "^3.0.1",
|
|
124
128
|
"bash-tool": "^1.3.16",
|
|
125
129
|
"bcryptjs": "^3.0.2",
|
|
126
130
|
"body-parser": "^2.2.0",
|
|
127
131
|
"bullmq": "^5.48.1",
|
|
128
132
|
"bullmq-otel": "^1.0.1",
|
|
129
133
|
"busboy": "^1.6.0",
|
|
134
|
+
"chat": "4.45.0",
|
|
130
135
|
"class-validator": "^0.14.2",
|
|
131
136
|
"cookie-parser": "^1.4.7",
|
|
132
137
|
"cors": "^2.8.5",
|