@poncho-ai/harness 0.59.7 → 0.59.8
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 +11 -0
- package/dist/index.js +4 -1
- package/package.json +1 -1
- package/src/storage/sql-dialect.ts +13 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.59.
|
|
2
|
+
> @poncho-ai/harness@0.59.8 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
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2022
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[32mESM[39m [1mdist/isolate-F2PPSUL6.js [22m[32m53.82 KB[39m
|
|
12
|
-
[32mESM[39m [1mdist/index.js [22m[32m558.
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m558.23 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 235ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 8463ms
|
|
16
16
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m101.66 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.59.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fb07954`](https://github.com/cesr/poncho-ai/commit/fb07954ee7edfa614bdd5ed27474f4d3be7c8f1f) Thanks [@cesr](https://github.com/cesr)! - Fix conversations.rename on Postgres: the JSONB `data` column usually
|
|
8
|
+
holds a JSON-encoded string scalar (update() binds JSON.stringify output),
|
|
9
|
+
so the 0.59.3 in-blob title update threw `cannot set path in scalar` and
|
|
10
|
+
every rename 500'd. The UPDATE now branches on jsonb_typeof(data) and
|
|
11
|
+
preserves each row's encoding (objects via jsonb_set; string scalars
|
|
12
|
+
unwrapped, set, and re-serialized).
|
|
13
|
+
|
|
3
14
|
## 0.59.7
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -3918,7 +3918,10 @@ var SqlStorageEngine = class {
|
|
|
3918
3918
|
},
|
|
3919
3919
|
rename: async (conversationId, title) => {
|
|
3920
3920
|
const normalized = normalizeTitle2(title);
|
|
3921
|
-
const dataExpr = this.dialect.tag === "sqlite" ? `json_set(data, '$.title', $2)` : `
|
|
3921
|
+
const dataExpr = this.dialect.tag === "sqlite" ? `json_set(data, '$.title', $2)` : `CASE WHEN jsonb_typeof(data) = 'object'
|
|
3922
|
+
THEN jsonb_set(data, '{title}', to_jsonb($2::text))
|
|
3923
|
+
ELSE to_jsonb(jsonb_set((data #>> '{}')::jsonb, '{title}', to_jsonb($2::text))::text)
|
|
3924
|
+
END`;
|
|
3922
3925
|
await this.executor.run(
|
|
3923
3926
|
rewrite(
|
|
3924
3927
|
`UPDATE conversations SET title = $1, data = ${dataExpr}, updated_at = $3 WHERE id = $4`,
|
package/package.json
CHANGED
|
@@ -571,9 +571,21 @@ export abstract class SqlStorageEngine implements StorageEngine {
|
|
|
571
571
|
// Distinct placeholders for the two title occurrences: rewrite()
|
|
572
572
|
// converts $N → ? positionally for sqlite, so reusing $1 would
|
|
573
573
|
// desync the param array.
|
|
574
|
+
//
|
|
575
|
+
// Postgres: the JSONB column usually holds a JSON-encoded STRING
|
|
576
|
+
// scalar, not an object — update() binds `JSON.stringify(conv)` and
|
|
577
|
+
// the driver serializes that JS string as a JSON string. A bare
|
|
578
|
+
// jsonb_set on those rows throws `cannot set path in scalar`
|
|
579
|
+
// (observed in prod 2026-06-12: every rename 500'd). Branch on the
|
|
580
|
+
// stored shape and preserve each row's encoding: objects get a plain
|
|
581
|
+
// jsonb_set; string scalars get unwrapped (#>> '{}'), parsed, set,
|
|
582
|
+
// and re-serialized back to a string scalar.
|
|
574
583
|
const dataExpr = this.dialect.tag === "sqlite"
|
|
575
584
|
? `json_set(data, '$.title', $2)`
|
|
576
|
-
: `
|
|
585
|
+
: `CASE WHEN jsonb_typeof(data) = 'object'
|
|
586
|
+
THEN jsonb_set(data, '{title}', to_jsonb($2::text))
|
|
587
|
+
ELSE to_jsonb(jsonb_set((data #>> '{}')::jsonb, '{title}', to_jsonb($2::text))::text)
|
|
588
|
+
END`;
|
|
577
589
|
await this.executor.run(
|
|
578
590
|
rewrite(
|
|
579
591
|
`UPDATE conversations SET title = $1, data = ${dataExpr}, updated_at = $3 WHERE id = $4`,
|