@axiom-lattice/pg-stores 5.2.0 → 5.2.2

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/pg-stores@5.2.0 build /home/runner/work/agentic/agentic/packages/pg-stores
2
+ > @axiom-lattice/pg-stores@5.2.2 build /home/runner/work/agentic/agentic/packages/pg-stores
3
3
  > tsup src/index.ts --format cjs,esm --dts --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,11 +10,11 @@
10
10
  ESM Build start
11
11
  CJS dist/index.js 585.57 KB
12
12
  CJS dist/index.js.map 1.04 MB
13
- CJS ⚡️ Build success in 1619ms
13
+ CJS ⚡️ Build success in 1523ms
14
14
  ESM dist/index.mjs 574.26 KB
15
15
  ESM dist/index.mjs.map 1.04 MB
16
- ESM ⚡️ Build success in 1620ms
16
+ ESM ⚡️ Build success in 1524ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 15871ms
18
+ DTS ⚡️ Build success in 12008ms
19
19
  DTS dist/index.d.ts 123.99 KB
20
20
  DTS dist/index.d.mts 123.99 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,132 @@
1
1
  # @axiom-lattice/pg-stores
2
2
 
3
+ ## 5.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 9bbf5ce: ## Collection batch tools and Open MCP consolidation
8
+
9
+ BREAKING (core): the collection agent tool `add_entry` is replaced by
10
+ `add_entries` without a compatibility alias, so agent prompts, skills, and
11
+ saved tool allowlists that name `add_entry` must update. `add_entries` accepts
12
+ 1-50 entries, performs one all-or-nothing vector-store call, and generates each
13
+ entry's `_id` and `_created_at`. Collection middleware, plugin metadata,
14
+ capability mapping, built-in guidance, and the React tool catalog are kept in
15
+ sync.
16
+
17
+ The collection delete agent tool `delete_entry` is also replaced by
18
+ `delete_entries` without a compatibility alias: it accepts 1-50 ids and performs
19
+ one idempotent `in` vector-store delete on pgvector/memory, with an exact-ID
20
+ fallback for unknown backends so an unsupported filter cannot wipe a collection.
21
+ `SimpleMemoryVectorStore` now supports `in`/`notIn` metadata filters. Deleting a
22
+ collection now also drops its vector store, and single-entry create/update keep
23
+ server-owned identity and attempt to restore the old entry if a rewrite fails.
24
+
25
+ Open MCP now exposes all ten collection tools under the sole `collection` domain
26
+ (`collection_<action>`) with readOnly/destructive annotations. The built-in
27
+ `kbProvider` / `kb_search` tool and `kb` domain are removed; browser/preview and
28
+ sandbox tokens now carry the read-only `collection.search_collection` grant
29
+ instead. Open credentials still need a collection grant to call the tools, and key
30
+ creation/update rejects empty-item collection grants so a destructive domain
31
+ cannot be granted wholesale by accident.
32
+
33
+ Additive surfaces: REST gains `POST /api/collections/:name/entries/batch` and
34
+ `DELETE /api/collections/:name/entries/batch`, and the client SDK gains
35
+ `client.collections.entries(name).createMany()` / `deleteMany()`, sharing the
36
+ same limit and all-or-nothing semantics. Existing single-entry endpoints,
37
+ `create()`, and `delete(id)` are unchanged.
38
+
39
+ ## OIDC public clients
40
+
41
+ Make the OIDC client secret optional so public clients can use Authorization
42
+ Code + PKCE with `token_endpoint_auth_method=none`, matching the protocol
43
+ default. `OIDC_CLIENT_SECRET` may be omitted for the env provider, Platform
44
+ Admin's provider form no longer requires a secret on create, and the gateway,
45
+ client SDK, and Platform Ops provider tools accept a secret-less configuration.
46
+ Confidential clients continue to use the existing encrypted client-secret flow.
47
+
48
+ ## Security dependency updates
49
+
50
+ Follow up the Wiz remediation with `pnpm audit`: bump the pinned transitive
51
+ dependencies to the advisories published after the scan (shell-quote 1.11 —
52
+ critical command injection — fastify 5.12.6, @fastify/busboy 3.2.2,
53
+ @hono/node-server 2.1.3, brace-expansion 1.1.21/2.1.7/5.0.12,
54
+ body-parser 1.20.9/2.4.0, decode-uri-component 0.5.1, fast-uri 3.1.9/4.2.3,
55
+ glob 10.5/11.1/14.0.4, langsmith 0.12, picomatch 2.3.2/4.0.4,
56
+ protobufjs 7.6.5/8.8.1, source-map-js 1.2.2, undici 7.30.1, sanitize-html
57
+ 2.18.1, tar 7.5.22, tmp 0.2.7, vite 6.4.5, yaml 2.9.1, ajv 6.14/8.18,
58
+ mysql2 3.23.1, uuid 11.1, and others). Overrides are scoped per major line
59
+ where different majors are both required, and none pins below a declaring
60
+ package's range. Further zero-out pass: echarts 5.5 → 6.1 in react-sdk,
61
+ katex 0.19.1 (the patched range starts at 0.18.2), glob 14.0.4 for every
62
+ affected major line (10/11/13/14; glob 7 is outside the advisory range),
63
+ minimatch 11.0.8 for every vulnerable line, rimraf 4/5 → 6.1.4 (drops the
64
+ glob 9 dependency), ibm-cloud-sdk-core 5.9.4 (pulls file-type 21.3.4), and
65
+ fast-xml-parser 5.12.0. The client-sdk build moves from tsup 6.7 to 8.5,
66
+ clearing the last GHSA-3mv9-4h5g-vhg3 finding. Drop the unused `xlsx`
67
+ dependency from `apps/web`, which has no patched npm release.
68
+
69
+ Overrides only apply to this monorepo, so also raise the published packages'
70
+ own dependency ranges to patched versions, otherwise downstream consumers
71
+ (fina_demo) resolve the old lower bounds when they reinstall: fastify
72
+ ^5.12.6 (gateway, microsandbox-service, opensandbox-gateway), react-router
73
+ ^7.18.2, vite ^6.4.5, mysql2 ^3.23.1 (core), and uuid ^11.1.1 (core, gateway,
74
+ pg-stores, react-sdk, and the cli-a2a peer range).
75
+
76
+ ## Reverse-proxy mount-prefix support
77
+
78
+ Support deploying the gateway behind a reverse-proxy path prefix (`/harness`
79
+ or any other mount point) without hardcoding it.
80
+
81
+ Gateway-rendered pages no longer emit root-absolute asset URLs: the embed chat
82
+ shell and MCP App share shell reference their bundles relative to the page, and
83
+ shared HTML gets a relative `<base href>` (plus a page-relative password-unlock
84
+ request). Client-side URL derivation now keeps the externally visible prefix
85
+ instead of reducing URLs to `location.origin`: the embed loader strips its known
86
+ `/embed/agent-chat-loader.js` suffix, the embed page recovers its base from
87
+ `<mount>/api/web-apps/:id/chat`, the MCP App share page keeps `<mount>/s/:token`,
88
+ and MCP App link resolution/sandbox loading use the gateway base derived from the
89
+ client `baseURL`. Root-path deployments resolve to the same absolute URLs as
90
+ before. Adds a deterministic `/harness` embed e2e (prefix-stripping proxy) and
91
+ random-prefix unit coverage.
92
+
93
+ - Updated dependencies [9bbf5ce]
94
+ - @axiom-lattice/core@13.0.0
95
+ - @axiom-lattice/protocols@7.4.0
96
+
97
+ ## 5.2.1
98
+
99
+ ### Patch Changes
100
+
101
+ - b928a17: Follow up the Wiz remediation with `pnpm audit`: bump the pinned transitive
102
+ dependencies to the advisories published after the scan (shell-quote 1.11 —
103
+ critical command injection — fastify 5.12.6, @fastify/busboy 3.2.2,
104
+ @hono/node-server 2.1.3, brace-expansion 1.1.21/2.1.7/5.0.12,
105
+ body-parser 1.20.9/2.4.0, decode-uri-component 0.5.1, fast-uri 3.1.9/4.2.3,
106
+ glob 10.5/11.1/14.0.4, langsmith 0.12, picomatch 2.3.2/4.0.4,
107
+ protobufjs 7.6.5/8.8.1, source-map-js 1.2.2, undici 7.30.1, sanitize-html
108
+ 2.18.1, tar 7.5.22, tmp 0.2.7, vite 6.4.5, yaml 2.9.1, ajv 6.14/8.18,
109
+ mysql2 3.23.1, uuid 11.1, and others). Overrides are scoped per major line
110
+ where different majors are both required, and none pins below a declaring
111
+ package's range. Further zero-out pass: echarts 5.5 → 6.1 in react-sdk,
112
+ katex 0.19.1 (the patched range starts at 0.18.2), glob 14.0.4 for every
113
+ affected major line (10/11/13/14; glob 7 is outside the advisory range),
114
+ minimatch 11.0.8 for every vulnerable line, rimraf 4/5 → 6.1.4 (drops the
115
+ glob 9 dependency), ibm-cloud-sdk-core 5.9.4 (pulls file-type 21.3.4), and
116
+ fast-xml-parser 5.12.0. The client-sdk build moves from tsup 6.7 to 8.5,
117
+ clearing the last GHSA-3mv9-4h5g-vhg3 finding. Drop the unused `xlsx`
118
+ dependency from `apps/web`, which has no patched npm release.
119
+
120
+ Overrides only apply to this monorepo, so also raise the published packages'
121
+ own dependency ranges to patched versions, otherwise downstream consumers
122
+ (fina_demo) resolve the old lower bounds when they reinstall: fastify
123
+ ^5.12.6 (gateway, microsandbox-service, opensandbox-gateway), react-router
124
+ ^7.18.2, vite ^6.4.5, mysql2 ^3.23.1 (core), and uuid ^11.1.1 (core, gateway,
125
+ pg-stores, react-sdk, and the cli-a2a peer range).
126
+
127
+ - Updated dependencies [b928a17]
128
+ - @axiom-lattice/core@12.3.1
129
+
3
130
  ## 5.2.0
4
131
 
5
132
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiom-lattice/pg-stores",
3
- "version": "5.2.0",
3
+ "version": "5.2.2",
4
4
  "description": "PG stores implementation for Axiom Lattice framework",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -24,15 +24,14 @@
24
24
  "@langchain/langgraph-checkpoint-postgres": "1.1.2",
25
25
  "@langchain/core": "1.3.2",
26
26
  "pg": "^8.16.3",
27
- "uuid": "^9.0.1",
28
- "@axiom-lattice/core": "12.3.0",
29
- "@axiom-lattice/protocols": "7.3.0"
27
+ "uuid": "^11.1.1",
28
+ "@axiom-lattice/core": "13.0.0",
29
+ "@axiom-lattice/protocols": "7.4.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/jest": "^29.5.14",
33
33
  "@types/node": "^20.11.24",
34
34
  "@types/pg": "^8.11.10",
35
- "@types/uuid": "^9.0.8",
36
35
  "@typescript-eslint/eslint-plugin": "^7.2.0",
37
36
  "@typescript-eslint/parser": "^7.2.0",
38
37
  "eslint": "^8.57.0",
@@ -0,0 +1,90 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { Pool } from "pg";
3
+ import { PGVectorStore } from "@langchain/community/vectorstores/pgvector";
4
+ import { Embeddings } from "@langchain/core/embeddings";
5
+ import { Document } from "@langchain/core/documents";
6
+
7
+ const databaseUrl = process.env.TEST_DATABASE_URL;
8
+ const describeIfDatabase = databaseUrl ? describe : describe.skip;
9
+
10
+ class FakeEmbeddings extends Embeddings {
11
+ constructor() {
12
+ super({});
13
+ }
14
+
15
+ async embedDocuments(texts: string[]): Promise<number[][]> {
16
+ return texts.map(() => [0.1, 0.2, 0.3]);
17
+ }
18
+
19
+ async embedQuery(): Promise<number[]> {
20
+ return [0.1, 0.2, 0.3];
21
+ }
22
+ }
23
+
24
+ describeIfDatabase("PGVectorStore collection delete filter", () => {
25
+ const tableName = `collection_delete_${randomUUID().replace(/-/g, "")}`;
26
+ let store: PGVectorStore | undefined;
27
+ let pool: Pool;
28
+ let available = false;
29
+
30
+ beforeAll(async () => {
31
+ pool = new Pool({ connectionString: databaseUrl });
32
+ try {
33
+ await pool.query("CREATE EXTENSION IF NOT EXISTS vector");
34
+ store = await PGVectorStore.initialize(new FakeEmbeddings(), {
35
+ postgresConnectionOptions: { connectionString: databaseUrl },
36
+ tableName,
37
+ columns: {
38
+ idColumnName: "id",
39
+ vectorColumnName: "vector",
40
+ contentColumnName: "content",
41
+ metadataColumnName: "metadata",
42
+ },
43
+ distanceStrategy: "cosine" as never,
44
+ });
45
+ available = true;
46
+ } catch (error) {
47
+ console.warn(
48
+ "PGVectorStore delete filter integration test skipped: pgvector is unavailable",
49
+ error instanceof Error ? error.message : String(error),
50
+ );
51
+ }
52
+ });
53
+
54
+ beforeEach(async () => {
55
+ if (!available || !store) return;
56
+ await store.delete({ filter: { marker: "seed" } });
57
+ await store.addDocuments([
58
+ new Document({ pageContent: "one", metadata: { _id: "1", marker: "seed" } }),
59
+ new Document({ pageContent: "two", metadata: { _id: "2", marker: "seed" } }),
60
+ new Document({ pageContent: "three", metadata: { _id: "3", marker: "seed" } }),
61
+ ]);
62
+ });
63
+
64
+ afterAll(async () => {
65
+ if (available) {
66
+ await pool.query(`DROP TABLE IF EXISTS "${tableName}"`);
67
+ }
68
+ if (store) await store.end();
69
+ await pool.end();
70
+ });
71
+
72
+ async function remainingIds(): Promise<string[]> {
73
+ const result = await pool.query<{ id: string }>(
74
+ `SELECT metadata->>'_id' AS id FROM "${tableName}" WHERE metadata->>'marker' = 'seed' ORDER BY id`,
75
+ );
76
+ return result.rows.map((row) => row.id);
77
+ }
78
+
79
+ it("deletes only the requested ids with the in operator", async () => {
80
+ if (!available || !store) return;
81
+ await store.delete({ filter: { _id: { in: ["1", "3"] } } });
82
+ await expect(remainingIds()).resolves.toEqual(["2"]);
83
+ });
84
+
85
+ it("leaves every row intact when the in batch matches nothing", async () => {
86
+ if (!available || !store) return;
87
+ await store.delete({ filter: { _id: { in: ["missing"] } } });
88
+ await expect(remainingIds()).resolves.toEqual(["1", "2", "3"]);
89
+ });
90
+ });