manychat-ai-agent 0.23.3 → 0.24.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/CHANGELOG.md +36 -0
- package/dist/agent/mock-provider.js +6 -2
- package/dist/agent/prompt.d.ts +13 -11
- package/dist/agent/prompt.js +310 -175
- package/dist/agent/runner.js +2 -0
- package/dist/agent/tools.d.ts +3 -0
- package/dist/agent/tools.js +4 -2
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +1 -1
- package/dist/config/loader.d.ts +3 -1
- package/dist/config/loader.js +40 -1
- package/dist/contracts/agent.d.ts +2 -0
- package/dist/contracts/agent.js +2 -0
- package/dist/contracts/config.d.ts +27 -0
- package/dist/contracts/config.js +41 -0
- package/dist/conversation/store.d.ts +2 -2
- package/dist/conversation/store.js +4 -2
- package/dist/conversation/turns.d.ts +12 -0
- package/dist/conversation/turns.js +32 -1
- package/dist/learning/cohort.js +4 -2
- package/dist/routes/turn.d.ts +12 -0
- package/dist/routes/turn.js +97 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.24.0](https://github.com/pedronastasi/manychat-ai-agent/compare/v0.23.4...v0.24.0) (2026-10-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* answer a burst of bubbles with one reply ([5511716](https://github.com/pedronastasi/manychat-ai-agent/commit/5511716e078142a0689af7c6c88fc3262d668c3a))
|
|
9
|
+
* answer a burst of bubbles with one reply ([91034b8](https://github.com/pedronastasi/manychat-ai-agent/commit/91034b8860909f78614c5b41938cee60d6c683c3))
|
|
10
|
+
* let a tenant keep the offering open after the offer ([eb1633d](https://github.com/pedronastasi/manychat-ai-agent/commit/eb1633d5cfd34ca6b899ce57319c208fa2c4115a))
|
|
11
|
+
* let a tenant keep the offering open after the offer ([6b01e48](https://github.com/pedronastasi/manychat-ai-agent/commit/6b01e48e137c82d20cfa79e3edf41584204cf642))
|
|
12
|
+
* let a tenant replace individual system prompt sections (spec 044) ([d68aee2](https://github.com/pedronastasi/manychat-ai-agent/commit/d68aee2e24821563c5fdce6438e3c17740fbf6df))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* claim a place only on a turn that reads the contact's history ([6daa135](https://github.com/pedronastasi/manychat-ai-agent/commit/6daa1353184e6a3cbeafa9fac2292234f0b982ac))
|
|
18
|
+
* fold only a turn that reads the contact's history ([1200e0a](https://github.com/pedronastasi/manychat-ai-agent/commit/1200e0a6bd52b134d667e34449adc0308bed9b91))
|
|
19
|
+
* never supersede a reply to media ([1e87d5b](https://github.com/pedronastasi/manychat-ai-agent/commit/1e87d5bcd2522dc48fab3bcb4712edb385d18da6))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Specs and Docs
|
|
23
|
+
|
|
24
|
+
* record PR 227 in spec 045 ([412d831](https://github.com/pedronastasi/manychat-ai-agent/commit/412d831f74fa69816ce8d0512283fde72b9c6530))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* **deps:** update dependency @fastify/helmet to v13.2.0 ([8683809](https://github.com/pedronastasi/manychat-ai-agent/commit/8683809f100a4897602a4eda36bb500fd1584672))
|
|
30
|
+
* **deps:** update dependency @fastify/helmet to v13.2.0 ([74ea5e6](https://github.com/pedronastasi/manychat-ai-agent/commit/74ea5e66f6658baa509e0845df0f7ca60c4ec876))
|
|
31
|
+
|
|
32
|
+
## [0.23.4](https://github.com/pedronastasi/manychat-ai-agent/compare/v0.23.3...v0.23.4) (2026-10-14)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Dependencies
|
|
36
|
+
|
|
37
|
+
* **deps:** update patch dependencies ([ebdedc0](https://github.com/pedronastasi/manychat-ai-agent/commit/ebdedc0c53a4f097465a364ac1b3422fc4a84a07))
|
|
38
|
+
|
|
3
39
|
## [0.23.3](https://github.com/pedronastasi/manychat-ai-agent/compare/v0.23.2...v0.23.3) (2026-10-14)
|
|
4
40
|
|
|
5
41
|
|
|
@@ -256,10 +256,14 @@ function switchTo(options, lower) {
|
|
|
256
256
|
? named
|
|
257
257
|
: undefined;
|
|
258
258
|
}
|
|
259
|
-
/**
|
|
259
|
+
/**
|
|
260
|
+
* From `offered` on, a switch is a person's decision (specs/028), unless the
|
|
261
|
+
* system prompt says the offering stays open (specs/045).
|
|
262
|
+
*/
|
|
260
263
|
function courseLocked(options) {
|
|
261
264
|
const stage = contactNotes(options).stage;
|
|
262
|
-
|
|
265
|
+
const locked = options.prompt.some(entry => entry.role === 'system' && entry.content.includes('From offered on it is locked'));
|
|
266
|
+
return locked && (stage === 'offered' || stage === 'prepared' || stage === 'link_sent');
|
|
263
267
|
}
|
|
264
268
|
/** A request for course content from a contact with no course, named or recorded. */
|
|
265
269
|
function unplacedRequest(options, lower) {
|
package/dist/agent/prompt.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FENCE, FENCE_END, fenceUserText } from './fence.ts';
|
|
2
|
-
import type { Catalog, Rules, Tools } from '../contracts/config.ts';
|
|
2
|
+
import type { Catalog, PromptOverrides, PromptSection, Rules, Tools } from '../contracts/config.ts';
|
|
3
3
|
import type { ActionRecord, StagedAction } from '../contracts/agent.ts';
|
|
4
4
|
import type { ContactView } from './contact.ts';
|
|
5
5
|
import type { ReadResult } from '../plugins/reads.ts';
|
|
@@ -8,13 +8,23 @@ import type { ReadResult } from '../plugins/reads.ts';
|
|
|
8
8
|
* detector in guardrails.ts cannot drift out of sync with the prompt wording -
|
|
9
9
|
* it silently stopped matching once when the prompt was translated.
|
|
10
10
|
*/
|
|
11
|
-
export declare const PROMPT_MARKERS: readonly ["OPERATING RULES", "SECURITY", "CATALOG ("];
|
|
11
|
+
export declare const PROMPT_MARKERS: readonly ["OPERATING RULES", "SECURITY", "CATALOG (", "PRECEDENCE"];
|
|
12
12
|
export interface SystemPromptParts {
|
|
13
13
|
/** Stable across every request — the cacheable prefix. */
|
|
14
14
|
staticPrefix: string;
|
|
15
15
|
/** Changes only when config changes. Still part of the cached prefix. */
|
|
16
16
|
catalogBlock: string;
|
|
17
17
|
}
|
|
18
|
+
export interface SystemPromptOptions {
|
|
19
|
+
/** Whether the deployment's plugins add write tools of their own (specs/036). */
|
|
20
|
+
pluginTools?: boolean;
|
|
21
|
+
/** Whether they add read tools (specs/039). */
|
|
22
|
+
pluginReadTools?: boolean;
|
|
23
|
+
/** The tenant's `prompt-overrides.json` (specs/044). Absent: every default. */
|
|
24
|
+
overrides?: PromptOverrides | undefined;
|
|
25
|
+
}
|
|
26
|
+
/** The heading the framework gives each replaceable section (specs/044). */
|
|
27
|
+
export declare const SECTION_HEADINGS: Record<PromptSection, string>;
|
|
18
28
|
/**
|
|
19
29
|
* Builds the system prompt in cache-stable order: invariant instructions first,
|
|
20
30
|
* then the catalog, with all volatile content (history, current message) kept in
|
|
@@ -25,15 +35,7 @@ export interface SystemPromptParts {
|
|
|
25
35
|
*/
|
|
26
36
|
export declare function buildSystemPrompt(persona: string, catalog: Catalog, rules: Rules,
|
|
27
37
|
/** This tenant's `tools.json` (specs/012); its funnel adds the SALES rules (specs/023). */
|
|
28
|
-
tools?: Tools,
|
|
29
|
-
/**
|
|
30
|
-
* Whether the deployment's plugins add write tools of their own (specs/036),
|
|
31
|
-
* and read tools (specs/039).
|
|
32
|
-
*/
|
|
33
|
-
options?: {
|
|
34
|
-
pluginTools?: boolean;
|
|
35
|
-
pluginReadTools?: boolean;
|
|
36
|
-
}): SystemPromptParts;
|
|
38
|
+
tools?: Tools, options?: SystemPromptOptions): SystemPromptParts;
|
|
37
39
|
declare const NUDGE_NOTE_OPEN = "[no reply from the contact since";
|
|
38
40
|
/**
|
|
39
41
|
* The trigger of a nudge turn, in place of a contact message (specs/025 § A
|