@kitman-sh/cli 0.13.15 → 0.13.17
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/dist/{chunk-6z499mrc.js → chunk-0vv8cbye.js} +40 -28
- package/dist/{chunk-3syr8kyv.js → chunk-1cr225aq.js} +5 -5
- package/dist/{chunk-gq7y5v3e.js → chunk-24h0y27w.js} +1 -1
- package/dist/{chunk-ydz5ctsj.js → chunk-4yca7e7x.js} +74 -29
- package/dist/{chunk-6kz6qa2h.js → chunk-643pxp2k.js} +4 -4
- package/dist/{chunk-ga76znz9.js → chunk-67xn3yer.js} +12 -7
- package/dist/{chunk-b07c43pg.js → chunk-80f0p6s7.js} +145 -110
- package/dist/{chunk-5qeqhjxy.js → chunk-8nzsyz74.js} +4 -4
- package/dist/{chunk-fc2bhh5v.js → chunk-ahvpwkyk.js} +2 -2
- package/dist/{chunk-jattyebv.js → chunk-b5edh1jq.js} +31 -31
- package/dist/{chunk-82w8rmkc.js → chunk-cbf0q15q.js} +14 -60
- package/dist/{chunk-h0jf48ew.js → chunk-efyrm6bv.js} +1 -1
- package/dist/{chunk-zem7mg1b.js → chunk-g7ysb6ca.js} +11 -11
- package/dist/{chunk-6qdhhk6r.js → chunk-gasqek3p.js} +6 -6
- package/dist/{chunk-y1krmnbv.js → chunk-ggmwpwhf.js} +2 -2
- package/dist/{chunk-gy9rf14f.js → chunk-mmd7mjv0.js} +3 -3
- package/dist/{chunk-7cx4t4em.js → chunk-pbmadbfm.js} +4 -4
- package/dist/{chunk-rqrtf7sb.js → chunk-pjq9bf3w.js} +4 -4
- package/dist/{chunk-npnbac9a.js → chunk-pvsg1ppc.js} +4 -4
- package/dist/{chunk-q5w3v4k1.js → chunk-pxvd8w2v.js} +1 -1
- package/dist/{chunk-hn9x2jjs.js → chunk-q4ra17vf.js} +3 -3
- package/dist/{chunk-z4x9m2bv.js → chunk-syhs23yk.js} +7 -7
- package/dist/{chunk-nf9gdnsf.js → chunk-x20t7xy8.js} +17 -17
- package/dist/{chunk-my63gy4t.js → chunk-zcpnmgwb.js} +7 -7
- package/dist/{chunk-zw3gf6r5.js → chunk-zgraq2y3.js} +70 -28
- package/dist/index.js +4 -4
- package/package.json +1 -1
|
@@ -25,16 +25,16 @@ import {
|
|
|
25
25
|
isJsonObject,
|
|
26
26
|
isString2,
|
|
27
27
|
encodeUnknownJsonStringSync
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-zgraq2y3.js";
|
|
29
29
|
import {
|
|
30
|
-
|
|
30
|
+
make10,
|
|
31
31
|
runForEach,
|
|
32
32
|
compiled2
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-x20t7xy8.js";
|
|
34
34
|
import {
|
|
35
35
|
ChildProcessSpawner,
|
|
36
|
-
|
|
37
|
-
} from "./chunk-
|
|
36
|
+
make2
|
|
37
|
+
} from "./chunk-cbf0q15q.js";
|
|
38
38
|
|
|
39
39
|
// packages/agent-runtime/src/opencode-store.ts
|
|
40
40
|
import { lstatSync, readFileSync, realpathSync } from "fs";
|
|
@@ -147,6 +147,11 @@ var readings = {
|
|
|
147
147
|
const row = v2 ? db.prepare(`select ${error} as error from session_message where session_id = ? and type = 'assistant' order by seq desc limit 1`).get(sessionId) : db.prepare(`select ${error} as error from message where session_id = ? and json_extract(data, '$.role') = 'assistant' order by time_created desc, rowid desc limit 1`).get(sessionId);
|
|
148
148
|
return isString2(row?.error) ? decoded2(row.error) ?? null : null;
|
|
149
149
|
}),
|
|
150
|
+
lastModel: reading(NullOr(String4), (db, { v2 }, sessionId) => {
|
|
151
|
+
const named = (provider, model) => `case when length(cast(${model} as blob)) <= 200 and length(cast(coalesce(${provider}, '') as blob)) <= 200 then case when ${provider} is null then ${model} else ${provider} || '/' || ${model} end end`;
|
|
152
|
+
const row = v2 ? db.prepare(`select ${named("json_extract(data, '$.model.providerID')", "json_extract(data, '$.model.id')")} as model from session_message where session_id = ? and type = 'assistant' and json_type(data, '$.model.id') = 'text' order by seq desc limit 1`).get(sessionId) : db.prepare(`select ${named("json_extract(data, '$.providerID')", "json_extract(data, '$.modelID')")} as model from message where session_id = ? and json_extract(data, '$.role') = 'assistant' and json_type(data, '$.modelID') = 'text' order by time_created desc, rowid desc limit 1`).get(sessionId);
|
|
153
|
+
return isString2(row?.model) ? row.model : null;
|
|
154
|
+
}),
|
|
150
155
|
extent: reading(Finite, (db, _input, sessionId) => Number(db.prepare(`with recursive sessions(id) as (select ? union select session_v2.id from session_v2 join sessions on session_v2.parent_id = sessions.id)
|
|
151
156
|
select coalesce(max(time_updated), 0) as extent from session_message where session_id in sessions`).get(sessionId)?.extent))
|
|
152
157
|
};
|
|
@@ -167,8 +172,8 @@ var opencodeReaderCommand = () => compiled2 ? [process.execPath, "opencode-read"
|
|
|
167
172
|
var isolatedRead = (store, name, input) => gen(function* () {
|
|
168
173
|
const spawner = yield* ChildProcessSpawner;
|
|
169
174
|
const [command, ...args] = opencodeReaderCommand();
|
|
170
|
-
const handle = yield* spawner.spawn(
|
|
171
|
-
stdin:
|
|
175
|
+
const handle = yield* spawner.spawn(make2(command, args, {
|
|
176
|
+
stdin: make10(new TextEncoder().encode(encodeUnknownJsonStringSync({ store, name, input }))),
|
|
172
177
|
stderr: "ignore",
|
|
173
178
|
extendEnv: false,
|
|
174
179
|
env: {},
|