@poncho-ai/harness 0.43.0 → 0.43.1
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +16 -0
- package/dist/index.js +2 -1
- package/package.json +1 -1
- package/src/storage/sql-dialect.ts +6 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.43.
|
|
2
|
+
> @poncho-ai/harness@0.43.1 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
|
|
3
3
|
> node scripts/embed-docs.js && tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[embed-docs] Generated poncho-docs.ts with 4 topics
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
[34mCLI[39m tsup v8.5.1
|
|
9
9
|
[34mCLI[39m Target: es2022
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
+
[32mESM[39m [1mdist/index.js [22m[32m506.50 KB[39m
|
|
11
12
|
[32mESM[39m [1mdist/isolate-VY35DGLM.js [22m[32m49.43 KB[39m
|
|
12
|
-
[32mESM[39m
|
|
13
|
-
[32mESM[39m ⚡️ Build success in 222ms
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 164ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 6912ms
|
|
16
16
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m80.85 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.43.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`134fae7`](https://github.com/cesr/poncho-ai/commit/134fae7eb4f3658b8d2dc0a5e560b0bcad094679) Thanks [@cesr](https://github.com/cesr)! - fix(harness): conversations.search now works on Postgres
|
|
8
|
+
|
|
9
|
+
The SQL for `engine.conversations.search()` matched `data LIKE $3`, but
|
|
10
|
+
`data` is a `jsonb` column in Postgres — `jsonb LIKE text` raises
|
|
11
|
+
`operator does not exist: jsonb ~~ unknown` (Postgres error 42883), so
|
|
12
|
+
every search call against a Postgres-backed engine 500'd at runtime.
|
|
13
|
+
|
|
14
|
+
Cast `data` to text in the Postgres branch (`data::text LIKE $3`).
|
|
15
|
+
SQLite stores `data` as TEXT-of-JSON, so no cast there.
|
|
16
|
+
|
|
17
|
+
Discovered while wiring `GET /me/conversations/search` in PonchOS.
|
|
18
|
+
|
|
3
19
|
## 0.43.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -3701,11 +3701,12 @@ var SqlStorageEngine = class {
|
|
|
3701
3701
|
const filterTenant = tenantId !== void 0;
|
|
3702
3702
|
const pattern = `%${query}%`;
|
|
3703
3703
|
const params = [this.agentId, pattern, pattern];
|
|
3704
|
+
const dataMatch = this.dialect.tag === "postgresql" ? "data::text LIKE $3" : "data LIKE $3";
|
|
3704
3705
|
let sql = `SELECT id, title, updated_at, created_at, owner_id, tenant_id,
|
|
3705
3706
|
message_count, parent_conversation_id, parent_message_id,
|
|
3706
3707
|
has_pending_approvals, channel_meta
|
|
3707
3708
|
FROM conversations
|
|
3708
|
-
WHERE agent_id = $1 AND (title LIKE $2 OR
|
|
3709
|
+
WHERE agent_id = $1 AND (title LIKE $2 OR ${dataMatch})`;
|
|
3709
3710
|
if (filterTenant) {
|
|
3710
3711
|
sql += ` AND tenant_id = $4`;
|
|
3711
3712
|
params.push(tid);
|
package/package.json
CHANGED
|
@@ -572,11 +572,16 @@ export abstract class SqlStorageEngine implements StorageEngine {
|
|
|
572
572
|
const pattern = `%${query}%`;
|
|
573
573
|
// SQLite uses positional ? so we can't reuse $2, need separate params
|
|
574
574
|
const params: unknown[] = [this.agentId, pattern, pattern];
|
|
575
|
+
// Postgres rejects `jsonb LIKE text` — cast `data` to text in
|
|
576
|
+
// Postgres so the LIKE applies to its JSON serialization. SQLite's
|
|
577
|
+
// `data` column is TEXT (raw JSON string) so no cast needed.
|
|
578
|
+
const dataMatch =
|
|
579
|
+
this.dialect.tag === "postgresql" ? "data::text LIKE $3" : "data LIKE $3";
|
|
575
580
|
let sql = `SELECT id, title, updated_at, created_at, owner_id, tenant_id,
|
|
576
581
|
message_count, parent_conversation_id, parent_message_id,
|
|
577
582
|
has_pending_approvals, channel_meta
|
|
578
583
|
FROM conversations
|
|
579
|
-
WHERE agent_id = $1 AND (title LIKE $2 OR
|
|
584
|
+
WHERE agent_id = $1 AND (title LIKE $2 OR ${dataMatch})`;
|
|
580
585
|
if (filterTenant) {
|
|
581
586
|
sql += ` AND tenant_id = $4`;
|
|
582
587
|
params.push(tid);
|