@emseepea/create-multi-instance-postgres-server 0.0.5 → 0.0.9
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/README.md
CHANGED
|
@@ -117,6 +117,13 @@ to the shared database continues to serve the same state.
|
|
|
117
117
|
- No claim of exactly-once external effects, latency, throughput, or unlimited
|
|
118
118
|
scale.
|
|
119
119
|
|
|
120
|
+
## Add Feedback
|
|
121
|
+
|
|
122
|
+
Install `@emseepea/feedback` when this server needs a detailed one-way
|
|
123
|
+
observation or a durable support conversation. Pass its tools through the
|
|
124
|
+
application factory's `additionalTools` option. Choose PostgreSQL, Firestore,
|
|
125
|
+
GitHub Issues, or Zendesk in the [feedback guide](../../packages/feedback/README.md).
|
|
126
|
+
|
|
120
127
|
## Check This Project
|
|
121
128
|
|
|
122
129
|
[Ordinary tests](test/) prove cross-process state, complete-state replacement,
|
|
@@ -90,6 +90,13 @@ to the shared database continues to serve the same state.
|
|
|
90
90
|
- No claim of exactly-once external effects, latency, throughput, or unlimited
|
|
91
91
|
scale.
|
|
92
92
|
|
|
93
|
+
## Add Feedback
|
|
94
|
+
|
|
95
|
+
Install `@emseepea/feedback` when this server needs a detailed one-way
|
|
96
|
+
observation or a durable support conversation. Pass its tools through the
|
|
97
|
+
application factory's `additionalTools` option. Choose PostgreSQL, Firestore,
|
|
98
|
+
GitHub Issues, or Zendesk in the [feedback guide](../../packages/feedback/README.md).
|
|
99
|
+
|
|
93
100
|
## Check This Project
|
|
94
101
|
|
|
95
102
|
[Ordinary tests](test/) prove cross-process state, complete-state replacement,
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import test from "node:test";
|
|
2
2
|
import {
|
|
3
|
+
assertNoNegativeFeedback,
|
|
3
4
|
assertResponseContains,
|
|
4
5
|
assertResponseMeaning,
|
|
5
|
-
|
|
6
|
+
assertToolCallsWithOptionalFeedback,
|
|
6
7
|
createConversation,
|
|
7
8
|
} from "@emseepea/testing/semantic";
|
|
8
9
|
|
|
10
|
+
const server = new URL(import.meta.resolve("@emseepea/feedback/testing-server"));
|
|
11
|
+
|
|
9
12
|
const databaseUrl = process.env.DATABASE_URL;
|
|
10
13
|
if (!databaseUrl) throw new Error("DATABASE_URL is required for the PostgreSQL semantic test");
|
|
11
14
|
|
|
12
15
|
test("saves and retrieves a harvest report without exposing server instances", async (t) => {
|
|
13
16
|
const chat = await createConversation(t, {
|
|
14
|
-
server
|
|
15
|
-
environment: {
|
|
17
|
+
server,
|
|
18
|
+
environment: {
|
|
19
|
+
DATABASE_URL: databaseUrl,
|
|
20
|
+
EMSEEPEA_EVAL_APP_MODULE: new URL("../dist/app.js", import.meta.url).href,
|
|
21
|
+
EMSEEPEA_EVAL_APP_FACTORY: "createMultiInstanceExample",
|
|
22
|
+
EMSEEPEA_EVAL_APP_KIND: "postgres",
|
|
23
|
+
},
|
|
16
24
|
});
|
|
17
25
|
|
|
18
26
|
// Two natural turns cover write and read tool selection at low model cost.
|
|
@@ -22,7 +30,7 @@ test("saves and retrieves a harvest report without exposing server instances", a
|
|
|
22
30
|
"Save a harvest report for North Bed on 2026-09-08 with 12 shelling pea " +
|
|
23
31
|
"plants and 8 snap pea plants.",
|
|
24
32
|
);
|
|
25
|
-
|
|
33
|
+
await assertToolCallsWithOptionalFeedback(saved, [
|
|
26
34
|
{
|
|
27
35
|
name: "save-harvest-report",
|
|
28
36
|
arguments: {
|
|
@@ -38,7 +46,7 @@ test("saves and retrieves a harvest report without exposing server instances", a
|
|
|
38
46
|
const retrieved = await chat.send(
|
|
39
47
|
"What harvest report do we have for that garden bed and date?",
|
|
40
48
|
);
|
|
41
|
-
|
|
49
|
+
await assertToolCallsWithOptionalFeedback(retrieved, [
|
|
42
50
|
{
|
|
43
51
|
name: "get-harvest-report",
|
|
44
52
|
arguments: { gardenBed: "North Bed", harvestDate: "2026-09-08" },
|
|
@@ -49,4 +57,5 @@ test("saves and retrieves a harvest report without exposing server instances", a
|
|
|
49
57
|
"The saved report for North Bed on 2026-09-08 has 12 shelling pea plants, " +
|
|
50
58
|
"8 snap pea plants, and 20 plants in total.",
|
|
51
59
|
});
|
|
60
|
+
assertNoNegativeFeedback(saved, retrieved);
|
|
52
61
|
});
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"lint": "oxlint src test eval"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@emseepea/
|
|
20
|
+
"@emseepea/feedback": "0.2.1",
|
|
21
|
+
"@emseepea/testing": "0.9.4",
|
|
21
22
|
"@modelcontextprotocol/client": "2.0.0",
|
|
22
23
|
"@types/node": "24.13.3",
|
|
23
24
|
"@types/pg": "8.23.1",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
},
|
|
30
31
|
"private": true,
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@emseepea/server": "0.
|
|
33
|
+
"@emseepea/server": "0.7.0",
|
|
33
34
|
"pg": "8.23.0",
|
|
34
35
|
"zod": "4.4.3"
|
|
35
36
|
}
|
|
@@ -13,11 +13,11 @@ export interface MultiInstanceExampleOptions extends EmseepeaExtensions {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export async function createMultiInstanceExample(options: MultiInstanceExampleOptions) {
|
|
16
|
-
const { access = { access: "public" },
|
|
16
|
+
const { databaseUrl: databaseUrlOption, access = { access: "public" }, ...extensions } = options;
|
|
17
17
|
const databaseUrl = z.string().url().refine(
|
|
18
18
|
(value) => ["postgres:", "postgresql:"].includes(new URL(value).protocol),
|
|
19
19
|
"databaseUrl must use PostgreSQL",
|
|
20
|
-
).parse(
|
|
20
|
+
).parse(databaseUrlOption);
|
|
21
21
|
let database: Pool | undefined = new Pool({
|
|
22
22
|
connectionString: databaseUrl,
|
|
23
23
|
connectionTimeoutMillis: 2_000,
|
|
@@ -50,8 +50,7 @@ export async function createMultiInstanceExample(options: MultiInstanceExampleOp
|
|
|
50
50
|
database: () => database,
|
|
51
51
|
access,
|
|
52
52
|
}),
|
|
53
|
-
|
|
54
|
-
observability,
|
|
53
|
+
...extensions,
|
|
55
54
|
});
|
|
56
55
|
const closeProvider = async () => {
|
|
57
56
|
const activeDatabase = database;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emseepea/create-multi-instance-postgres-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Create interchangeable Em See Pea server instances sharing PostgreSQL state.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"prepack": "npm run build:initializer"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@emseepea/
|
|
24
|
+
"@emseepea/feedback": "0.2.1",
|
|
25
|
+
"@emseepea/server": "0.7.0",
|
|
25
26
|
"pg": "8.23.0",
|
|
26
27
|
"zod": "4.4.3",
|
|
27
|
-
"@emseepea/testing": "0.
|
|
28
|
+
"@emseepea/testing": "0.9.4",
|
|
28
29
|
"@modelcontextprotocol/client": "2.0.0",
|
|
29
30
|
"@types/node": "24.13.3",
|
|
30
31
|
"@types/pg": "8.23.1",
|