manychat-ai-agent 0.18.0 → 0.19.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 +29 -0
- package/README.md +13 -1
- package/db/migrations/0010_oval_prism.sql +54 -0
- package/db/migrations/meta/0010_snapshot.json +1070 -0
- package/db/migrations/meta/_journal.json +7 -0
- package/dist/agent/contact.d.ts +6 -0
- package/dist/agent/contact.js +10 -2
- package/dist/agent/registry.d.ts +1 -1
- package/dist/agent/registry.js +2 -2
- package/dist/agent/runner.d.ts +14 -0
- package/dist/agent/runner.js +20 -3
- package/dist/cli/run.js +23 -0
- package/dist/config/loader.js +7 -1
- package/dist/contracts/config.d.ts +13 -0
- package/dist/contracts/config.js +21 -0
- package/dist/contracts/learning.d.ts +28 -0
- package/dist/contracts/learning.js +15 -0
- package/dist/conversation/store.d.ts +2 -0
- package/dist/conversation/store.js +1 -0
- package/dist/db/schema.d.ts +666 -0
- package/dist/db/schema.js +89 -0
- package/dist/evals/cases.d.ts +5 -0
- package/dist/evals/cases.js +10 -0
- package/dist/evals/runner.js +46 -2
- package/dist/insights.d.ts +1 -0
- package/dist/insights.js +9 -0
- package/dist/learning/analyst.d.ts +70 -0
- package/dist/learning/analyst.js +163 -0
- package/dist/learning/cli.d.ts +42 -0
- package/dist/learning/cli.js +179 -0
- package/dist/learning/cohort.d.ts +46 -0
- package/dist/learning/cohort.js +108 -0
- package/dist/learning/commands.d.ts +14 -0
- package/dist/learning/commands.js +106 -0
- package/dist/learning/database.d.ts +7 -0
- package/dist/learning/database.js +13 -0
- package/dist/learning/gate.d.ts +23 -0
- package/dist/learning/gate.js +67 -0
- package/dist/learning/job.d.ts +55 -0
- package/dist/learning/job.js +120 -0
- package/dist/learning/playbook.d.ts +53 -0
- package/dist/learning/playbook.js +81 -0
- package/dist/learning/proposals.d.ts +22 -0
- package/dist/learning/proposals.js +62 -0
- package/dist/learning/store.d.ts +100 -0
- package/dist/learning/store.js +255 -0
- package/dist/learning/wiring.d.ts +26 -0
- package/dist/learning/wiring.js +45 -0
- package/dist/main.js +20 -0
- package/dist/nudge/worker.js +1 -0
- package/dist/routes/turn.js +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.js +1 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.19.0](https://github.com/pedronastasi/manychat-ai-agent/compare/v0.18.1...v0.19.0) (2026-10-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* learn selling tactics from paid outcomes, behind human approval (spec 031) ([9a35ce0](https://github.com/pedronastasi/manychat-ai-agent/commit/9a35ce0ad221974595d1dec59cd78a33b2d07bfd))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* record no playbook version on a fallback reply, and let a stop end a learning run ([1dadf7d](https://github.com/pedronastasi/manychat-ai-agent/commit/1dadf7d235da2ce4f6e7c1b6e741306fc67fcf8e))
|
|
14
|
+
* say that a stopped learning run forfeits its week, and warn when one does ([af1935e](https://github.com/pedronastasi/manychat-ai-agent/commit/af1935ec35031d3a34dd8f50ba459473d56cacba))
|
|
15
|
+
* say why a learning run failed, in the server's log and in the terminal of a CLI run ([0ea3783](https://github.com/pedronastasi/manychat-ai-agent/commit/0ea37839266ff87b309eeb04c75ed2f1983b163f))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Specs and Docs
|
|
19
|
+
|
|
20
|
+
* a guide to learning from outcomes: how it works, setting it up, and the weekly routine ([5c9d42f](https://github.com/pedronastasi/manychat-ai-agent/commit/5c9d42fd68944d5818cec54dc43d75cb42245616))
|
|
21
|
+
* record PR 187 in spec 031 ([79f17c0](https://github.com/pedronastasi/manychat-ai-agent/commit/79f17c042d26ca7bb32934d00e95db4704a8c86f))
|
|
22
|
+
|
|
23
|
+
## [0.18.1](https://github.com/pedronastasi/manychat-ai-agent/compare/v0.18.0...v0.18.1) (2026-10-07)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Specs and Docs
|
|
27
|
+
|
|
28
|
+
* add a getting-started guide for npm create, and point to it from the top of the README ([893e8da](https://github.com/pedronastasi/manychat-ai-agent/commit/893e8dac5a668d6e20ae2439822894a4c3aaa71d))
|
|
29
|
+
* derive a top bar, collapse the long sidebar groups, and fix badge and heading styling on the site ([2faca35](https://github.com/pedronastasi/manychat-ai-agent/commit/2faca35920a98ecbe7e8d3e4ec1e5a45372068b5))
|
|
30
|
+
* derive nav bar from sections, collapse long groups, add getting-started guide ([31a3fde](https://github.com/pedronastasi/manychat-ai-agent/commit/31a3fde37dcee03b7847f21523114335623bc036))
|
|
31
|
+
|
|
3
32
|
## [0.18.0](https://github.com/pedronastasi/manychat-ai-agent/compare/v0.17.1...v0.18.0) (2026-10-06)
|
|
4
33
|
|
|
5
34
|
|
package/README.md
CHANGED
|
@@ -29,6 +29,17 @@ and an embedded [PGlite](https://pglite.dev/) Postgres. In another terminal,
|
|
|
29
29
|
|
|
30
30
|

|
|
31
31
|
|
|
32
|
+
That clone is for trying the agent and working on it. To run one for your own
|
|
33
|
+
business, generate a project of your own instead, which depends on the published
|
|
34
|
+
package rather than a copy of this repository:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm create manychat-ai-agent@latest my-agent
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
[Starting a new agent](docs/guides/getting-started.md) walks through it,
|
|
41
|
+
from the offline first run to a deployment.
|
|
42
|
+
|
|
32
43
|
---
|
|
33
44
|
|
|
34
45
|
## The problem this solves
|
|
@@ -366,7 +377,8 @@ It writes `config/`, an offline `.env`, an eval suite, CI, Compose and
|
|
|
366
377
|
Renovate, depending on the agent and its image at the scaffolder's version.
|
|
367
378
|
Replace `config/` with your own and keep the repository private: the generated
|
|
368
379
|
CI fails when it is public
|
|
369
|
-
([specs/035](specs/035-create-scaffolds-a-tenant-project.md)).
|
|
380
|
+
([specs/035](specs/035-create-scaffolds-a-tenant-project.md)). The steps are in
|
|
381
|
+
[Starting a new agent](docs/guides/getting-started.md).
|
|
370
382
|
|
|
371
383
|
Point a ManyChat **Dynamic Block** (Dev Tools, requires a Pro plan) at
|
|
372
384
|
`POST /v1/channels/manychat/message` and add an `Authorization: Bearer <secret>`
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
CREATE TABLE "eval_records" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"tenant_id" text NOT NULL,
|
|
4
|
+
"playbook_hash" text NOT NULL,
|
|
5
|
+
"suite_hash" text NOT NULL,
|
|
6
|
+
"model" text NOT NULL,
|
|
7
|
+
"outcomes" jsonb NOT NULL,
|
|
8
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
9
|
+
);
|
|
10
|
+
--> statement-breakpoint
|
|
11
|
+
CREATE TABLE "insight_proposals" (
|
|
12
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
13
|
+
"tenant_id" text NOT NULL,
|
|
14
|
+
"run_id" uuid NOT NULL,
|
|
15
|
+
"text" text NOT NULL,
|
|
16
|
+
"rationale" text NOT NULL,
|
|
17
|
+
"enrolled_count" integer NOT NULL,
|
|
18
|
+
"not_enrolled_count" integer NOT NULL,
|
|
19
|
+
"turn_ids" jsonb NOT NULL,
|
|
20
|
+
"status" text DEFAULT 'pending' NOT NULL,
|
|
21
|
+
"reviewed_at" timestamp with time zone,
|
|
22
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
23
|
+
);
|
|
24
|
+
--> statement-breakpoint
|
|
25
|
+
CREATE TABLE "learning_runs" (
|
|
26
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
27
|
+
"tenant_id" text NOT NULL,
|
|
28
|
+
"week" text NOT NULL,
|
|
29
|
+
"forced" boolean DEFAULT false NOT NULL,
|
|
30
|
+
"status" text DEFAULT 'running' NOT NULL,
|
|
31
|
+
"enrolled_count" integer,
|
|
32
|
+
"not_enrolled_count" integer,
|
|
33
|
+
"cost_usd" numeric(12, 6),
|
|
34
|
+
"started_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
35
|
+
"finished_at" timestamp with time zone
|
|
36
|
+
);
|
|
37
|
+
--> statement-breakpoint
|
|
38
|
+
CREATE TABLE "playbook_versions" (
|
|
39
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
40
|
+
"tenant_id" text NOT NULL,
|
|
41
|
+
"content_hash" text NOT NULL,
|
|
42
|
+
"insights" jsonb NOT NULL,
|
|
43
|
+
"active" boolean DEFAULT false NOT NULL,
|
|
44
|
+
"activated_at" timestamp with time zone,
|
|
45
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
46
|
+
);
|
|
47
|
+
--> statement-breakpoint
|
|
48
|
+
ALTER TABLE "turns" ADD COLUMN "playbook_version" text;--> statement-breakpoint
|
|
49
|
+
ALTER TABLE "insight_proposals" ADD CONSTRAINT "insight_proposals_run_id_learning_runs_id_fk" FOREIGN KEY ("run_id") REFERENCES "public"."learning_runs"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
50
|
+
CREATE INDEX "eval_records_lookup_idx" ON "eval_records" USING btree ("tenant_id","playbook_hash","suite_hash");--> statement-breakpoint
|
|
51
|
+
CREATE INDEX "insight_proposals_tenant_status_idx" ON "insight_proposals" USING btree ("tenant_id","status");--> statement-breakpoint
|
|
52
|
+
CREATE UNIQUE INDEX "learning_runs_week_uq" ON "learning_runs" USING btree ("tenant_id","week") WHERE "learning_runs"."forced" = false;--> statement-breakpoint
|
|
53
|
+
CREATE UNIQUE INDEX "playbook_versions_content_uq" ON "playbook_versions" USING btree ("tenant_id","content_hash");--> statement-breakpoint
|
|
54
|
+
CREATE UNIQUE INDEX "playbook_versions_one_active_uq" ON "playbook_versions" USING btree ("tenant_id") WHERE "playbook_versions"."active" = true;
|