@stevezhou/sisu 0.3.7 → 0.3.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/dist/commands.js +4 -2
- package/dist/runtime/loop.js +4 -1
- package/package.json +1 -1
package/dist/commands.js
CHANGED
|
@@ -277,8 +277,10 @@ function formatDirListing(bound) {
|
|
|
277
277
|
function listLocalCommand(projectId) {
|
|
278
278
|
(0, store_1.requireAuth)();
|
|
279
279
|
const workspaces = (0, store_1.readWorkspaces)();
|
|
280
|
-
const requested = (projectId ||
|
|
281
|
-
if (requested
|
|
280
|
+
const requested = (projectId || '').trim();
|
|
281
|
+
if (requested) {
|
|
282
|
+
if (!workspaces[requested])
|
|
283
|
+
throw new Error(`unknown workspace ${requested}`);
|
|
282
284
|
return formatDirListing({ projectId: requested, path: workspaces[requested] });
|
|
283
285
|
}
|
|
284
286
|
const entries = Object.entries(workspaces);
|
package/dist/runtime/loop.js
CHANGED
|
@@ -23,7 +23,10 @@ async function* runLocalTurn(options) {
|
|
|
23
23
|
for (let round = 0; round < maxRounds; round += 1) {
|
|
24
24
|
const request = { model: options.model, messages: messages.map((row) => ({ ...row })), tools };
|
|
25
25
|
requests.push(request);
|
|
26
|
-
|
|
26
|
+
let completion = await options.client.complete(request);
|
|
27
|
+
if (!completion.text && !completion.tool_calls.length) {
|
|
28
|
+
completion = await options.client.complete(request);
|
|
29
|
+
}
|
|
27
30
|
if (completion.text) {
|
|
28
31
|
text += completion.text;
|
|
29
32
|
yield { type: 'text', text: completion.text };
|