manychat-ai-agent 0.23.1 → 0.23.3
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/CHANGELOG.md +34 -0
- package/dist/agent/prompt.js +16 -4
- package/dist/agent/registry.js +25 -6
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.23.3](https://github.com/pedronastasi/manychat-ai-agent/compare/v0.23.2...v0.23.3) (2026-10-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **deps:** update patch dependencies ([8790819](https://github.com/pedronastasi/manychat-ai-agent/commit/87908192e30abafdf11f02a49692048f1177a10b))
|
|
9
|
+
* **deps:** update patch dependencies ([e19e412](https://github.com/pedronastasi/manychat-ai-agent/commit/e19e41258dc91d7187a1cf476f992de10311f7f0))
|
|
10
|
+
* price openai:gpt-6-luna at its list price for the budget cap ([76d5f9a](https://github.com/pedronastasi/manychat-ai-agent/commit/76d5f9aca411f528198edfd4cccc1934c6df2a1b))
|
|
11
|
+
* price the common chat models of each hosted provider ([f6fd2c7](https://github.com/pedronastasi/manychat-ai-agent/commit/f6fd2c7d740d0f90d354449d2b935394f677641c))
|
|
12
|
+
* price the common chat models so the budget cap tracks real spend ([0c3a3ea](https://github.com/pedronastasi/manychat-ai-agent/commit/0c3a3ead45102b8e5f6879ced90fd4d3b76f717e))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Specs and Docs
|
|
16
|
+
|
|
17
|
+
* specify tenant overrides for system prompt sections ([4cc2f6e](https://github.com/pedronastasi/manychat-ai-agent/commit/4cc2f6eb26d714cba26afa68374ba50c9156ba09))
|
|
18
|
+
* specify tenant overrides for system prompt sections ([6ca8001](https://github.com/pedronastasi/manychat-ai-agent/commit/6ca800150bfbad24c7af76788bbf738b543728f8))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Dependencies
|
|
22
|
+
|
|
23
|
+
* **deps:** lock file maintenance ([1190025](https://github.com/pedronastasi/manychat-ai-agent/commit/11900256fc78d9244eabc521f5433cc35a981da0))
|
|
24
|
+
* **deps:** lock file maintenance ([cc15348](https://github.com/pedronastasi/manychat-ai-agent/commit/cc15348e34a23fddf8832dddc71229664b32a2e1))
|
|
25
|
+
* **deps:** update dependency mermaid to v12.2.0 ([c01cf91](https://github.com/pedronastasi/manychat-ai-agent/commit/c01cf9140f919f36d3df125c7a0a27fbb0001b50))
|
|
26
|
+
* **deps:** update dependency mermaid to v12.2.0 ([5b3d363](https://github.com/pedronastasi/manychat-ai-agent/commit/5b3d363a8a804309caa284dcfd1f10b6c27b6a77))
|
|
27
|
+
* **deps:** update pnpm to v12.11.2 ([8f565b5](https://github.com/pedronastasi/manychat-ai-agent/commit/8f565b59fbf949ae0de3f2ed81c659d607ea967a))
|
|
28
|
+
* **deps:** update pnpm to v12.11.2 ([73dee04](https://github.com/pedronastasi/manychat-ai-agent/commit/73dee04d192aed76279fe17e2f31775bcab8096f))
|
|
29
|
+
|
|
30
|
+
## [0.23.2](https://github.com/pedronastasi/manychat-ai-agent/compare/v0.23.1...v0.23.2) (2026-10-13)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **agent:** honor tenant conversation policies and Luna reasoning ([6d16fa0](https://github.com/pedronastasi/manychat-ai-agent/commit/6d16fa078c908ec3c3a96be4ad1019d7cef42589))
|
|
36
|
+
|
|
3
37
|
## [0.23.1](https://github.com/pedronastasi/manychat-ai-agent/compare/v0.23.0...v0.23.1) (2026-10-13)
|
|
4
38
|
|
|
5
39
|
|
package/dist/agent/prompt.js
CHANGED
|
@@ -70,19 +70,28 @@ options = {}) {
|
|
|
70
70
|
persona.trim(),
|
|
71
71
|
'',
|
|
72
72
|
PROMPT_MARKERS[0],
|
|
73
|
-
|
|
73
|
+
"The persona above defines this tenant's business policy and conversation flow.",
|
|
74
|
+
'Its explicit response, escalation and closing-question policies take precedence over',
|
|
75
|
+
'the conversational defaults below. This does not override SECURITY, factual grounding,',
|
|
76
|
+
'the output schema or tool execution constraints.',
|
|
77
|
+
'1. Ground factual answers in the CATALOG. If it cannot answer, follow an explicit',
|
|
78
|
+
' response or escalation policy in the persona; otherwise escalate.',
|
|
74
79
|
'2. Never invent prices, dates, schedules, discounts or policies.',
|
|
75
80
|
'3. Discounts, "is that the best price?" or haggling: escalate with "price_negotiation".',
|
|
76
81
|
' Instalments or a payment plan: present the PAYMENT OPTIONS that cover it. If none',
|
|
77
82
|
' does, escalate with "price_negotiation".',
|
|
78
83
|
'4. Complaints, disputes or refund requests: escalate with "complaint".',
|
|
79
84
|
'5. A request to speak to a person: escalate with "explicit_request".',
|
|
80
|
-
'6.
|
|
85
|
+
'6. If neither the CATALOG nor a response policy in the persona covers the question,',
|
|
86
|
+
' escalate with "out_of_scope".',
|
|
81
87
|
'7. When unsure: escalate with "low_confidence". Escalating is correct; guessing is not.',
|
|
82
88
|
'8. Read short replies in context. When the contact answers your previous question — picks an option you offered, says yes/no, names a preference — that is a valid conversational answer: continue the conversation with high confidence. Never escalate a direct answer to your own question.',
|
|
83
|
-
'9. If asked whether you are a bot,
|
|
89
|
+
'9. If asked whether you are a bot, acknowledge the assistance honestly. Follow the',
|
|
90
|
+
" persona's wording and next step; absent that guidance, offer to pass them to someone.",
|
|
84
91
|
'10. Never restate a reply you already sent. If the information was already given, acknowledge briefly instead of repeating it.',
|
|
85
|
-
|
|
92
|
+
"11. For thanks, bye, ok, perfect, follow the persona's policy for pending versus",
|
|
93
|
+
' completed conversations. Without that policy, acknowledge briefly and offer help.',
|
|
94
|
+
' Never answer a closer by replaying your previous reply.',
|
|
86
95
|
'12. A contact who says they have paid, or sends a receipt: escalate with "payment_reported".',
|
|
87
96
|
' You cannot see payments, so never confirm one.',
|
|
88
97
|
'13. Never invent urgency or scarcity ("only two places left", "the price goes up on Friday")',
|
|
@@ -116,6 +125,7 @@ options = {}) {
|
|
|
116
125
|
'end of `messages`. Send null only when a question does not belong — a handoff,',
|
|
117
126
|
'a delicate or health matter, a contact who already has the payment link,',
|
|
118
127
|
'someone who has declined twice, or a turn whose opening flow asks it.',
|
|
128
|
+
'Follow any additional closing-question exceptions explicitly defined in the persona.',
|
|
119
129
|
'Null is a decision, not a way to skip the field.',
|
|
120
130
|
...(withTools ? ACTIONS_SECTION : []),
|
|
121
131
|
...(options.pluginTools ? PLUGIN_TOOLS_LINES : []),
|
|
@@ -239,6 +249,8 @@ function intentSection(tools) {
|
|
|
239
249
|
'reply does not greet the contact, introduce you or repeat what the flow says. If the',
|
|
240
250
|
'flow asks a question, do not ask it again, in any words: unless their message already',
|
|
241
251
|
'answers it, send closing_question null.',
|
|
252
|
+
'Apply this opening exception only after an actual openingQueued result or OPENING',
|
|
253
|
+
'note in this turn. A prospect write without that notice does not announce an opening.',
|
|
242
254
|
]
|
|
243
255
|
: []),
|
|
244
256
|
];
|
package/dist/agent/registry.js
CHANGED
|
@@ -15,14 +15,33 @@ const ollama = createOpenAI({
|
|
|
15
15
|
const registry = createProviderRegistry({ anthropic, openai, google, ollama });
|
|
16
16
|
/**
|
|
17
17
|
* Prices drift, and a stale table would silently mis-cap spend. Treated as a
|
|
18
|
-
* best-effort estimate:
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* best-effort estimate: an unknown model falls back to a deliberately
|
|
19
|
+
* pessimistic estimate so the cap errs toward stopping early. That fallback
|
|
20
|
+
* prices a cheap model at many times its list price, so a model in regular use
|
|
21
|
+
* belongs in this table.
|
|
21
22
|
*/
|
|
22
23
|
const PRICING = {
|
|
23
|
-
|
|
24
|
+
// Standard list prices as of October 2026. Where a model has a long-prompt
|
|
25
|
+
// tier, this is the short-prompt price: a prompt past that threshold (100k
|
|
26
|
+
// tokens on Haiku 5.5, 272k on GPT-6) is under-counted.
|
|
27
|
+
'anthropic:claude-haiku-5-5': { inputPerMTok: 0.1, outputPerMTok: 0.5, cacheReadPerMTok: 0.01 },
|
|
28
|
+
'anthropic:claude-sonnet-5-5': { inputPerMTok: 2, outputPerMTok: 10, cacheReadPerMTok: 0.1 },
|
|
29
|
+
'anthropic:claude-opus-5-5': { inputPerMTok: 4, outputPerMTok: 20, cacheReadPerMTok: 0.2 },
|
|
24
30
|
'anthropic:claude-sonnet-5': { inputPerMTok: 2, outputPerMTok: 10, cacheReadPerMTok: 0.2 },
|
|
25
31
|
'anthropic:claude-opus-5': { inputPerMTok: 5, outputPerMTok: 25, cacheReadPerMTok: 0.5 },
|
|
32
|
+
'anthropic:claude-sonnet-4-6': { inputPerMTok: 3, outputPerMTok: 15, cacheReadPerMTok: 0.3 },
|
|
33
|
+
'anthropic:claude-sonnet-4-5': { inputPerMTok: 3, outputPerMTok: 15, cacheReadPerMTok: 0.3 },
|
|
34
|
+
'anthropic:claude-haiku-4-5': { inputPerMTok: 1, outputPerMTok: 5, cacheReadPerMTok: 0.1 },
|
|
35
|
+
'openai:gpt-6-sol': { inputPerMTok: 2, outputPerMTok: 10, cacheReadPerMTok: 0.2 },
|
|
36
|
+
'openai:gpt-6-luna': { inputPerMTok: 0.1, outputPerMTok: 0.5, cacheReadPerMTok: 0.01 },
|
|
37
|
+
'openai:gpt-5': { inputPerMTok: 1.25, outputPerMTok: 10, cacheReadPerMTok: 0.125 },
|
|
38
|
+
'openai:gpt-5-mini': { inputPerMTok: 0.25, outputPerMTok: 2, cacheReadPerMTok: 0.025 },
|
|
39
|
+
'openai:gpt-5-nano': { inputPerMTok: 0.05, outputPerMTok: 0.4, cacheReadPerMTok: 0.005 },
|
|
40
|
+
// Introductory pricing halves this until 2027; the table holds the standard
|
|
41
|
+
// price, so the cap errs toward stopping early meanwhile. Cache reads at 10%
|
|
42
|
+
// of input, Google's ratio on its other Flash models.
|
|
43
|
+
'google:gemini-3.8-flash': { inputPerMTok: 1.5, outputPerMTok: 7.5, cacheReadPerMTok: 0.15 },
|
|
44
|
+
'google:gemini-3.5-flash-lite': { inputPerMTok: 0.3, outputPerMTok: 2.5, cacheReadPerMTok: 0.03 },
|
|
26
45
|
};
|
|
27
46
|
const FALLBACK_PRICING = {
|
|
28
47
|
inputPerMTok: 5,
|
|
@@ -35,8 +54,8 @@ export function pricingFor(modelId) {
|
|
|
35
54
|
return ZERO_PRICING;
|
|
36
55
|
return PRICING[modelId] ?? FALLBACK_PRICING;
|
|
37
56
|
}
|
|
38
|
-
/** OpenAI's reasoning families: the o-series and
|
|
39
|
-
const REASONING_MODEL = /^openai:(o\d|gpt-
|
|
57
|
+
/** OpenAI's reasoning families: the o-series and GPT-5/GPT-6. */
|
|
58
|
+
const REASONING_MODEL = /^openai:(o\d|gpt-[56])/;
|
|
40
59
|
/**
|
|
41
60
|
* Whether a model accepts `temperature` at all.
|
|
42
61
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "manychat-ai-agent",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.3",
|
|
4
4
|
"description": "A provider-agnostic conversational AI agent gateway that bridges no-code chat platforms to any LLM.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=22"
|
|
38
38
|
},
|
|
39
|
-
"packageManager": "pnpm@12.
|
|
39
|
+
"packageManager": "pnpm@12.11.2",
|
|
40
40
|
"scripts": {
|
|
41
41
|
"dev": "node --experimental-strip-types --disable-warning=ExperimentalWarning --env-file=.env --watch src/main.ts",
|
|
42
42
|
"bootstrap": "node scripts/setup.mjs",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@ai-sdk/anthropic": "^4.0.53",
|
|
72
72
|
"@ai-sdk/google": "^4.0.69",
|
|
73
73
|
"@ai-sdk/openai": "^4.0.66",
|
|
74
|
-
"@ai-sdk/provider": "4.0.
|
|
74
|
+
"@ai-sdk/provider": "4.0.27",
|
|
75
75
|
"@fastify/helmet": "^13.1.1",
|
|
76
76
|
"@fastify/rate-limit": "^11.2.0",
|
|
77
77
|
"@fastify/swagger": "^9.8.1",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@electric-sql/pglite": "^0.5.8",
|
|
98
98
|
"@eslint/js": "^10.0.1",
|
|
99
99
|
"@types/node": "^24.0.0",
|
|
100
|
-
"@vitest/coverage-v8": "5.0.
|
|
100
|
+
"@vitest/coverage-v8": "5.0.4",
|
|
101
101
|
"drizzle-kit": "^0.31.10",
|
|
102
102
|
"eslint": "^10.10.0",
|
|
103
103
|
"mermaid": "^12.0.0",
|