@tryarcanist/cli 0.1.92 → 0.1.93
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/index.js +18 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -626,13 +626,17 @@ function buildModelProviderGroups(models) {
|
|
|
626
626
|
id: model.id,
|
|
627
627
|
name: model.name,
|
|
628
628
|
label: formatModelLabel(model, { includeProvider: true }) ?? model.name,
|
|
629
|
+
backends: model.backends,
|
|
629
630
|
reasoning: model.reasoning
|
|
630
631
|
});
|
|
631
632
|
}
|
|
632
633
|
return [...groups.values()];
|
|
633
634
|
}
|
|
635
|
+
var SESSION_START_MODEL_ID_SET_ANY_BACKEND = new Set(
|
|
636
|
+
AGENT_RUNTIME_BACKENDS.flatMap((backend) => [...SESSION_START_MODEL_IDS_BY_BACKEND[backend]])
|
|
637
|
+
);
|
|
634
638
|
var SESSION_START_MODEL_PROVIDER_GROUPS = buildModelProviderGroups(
|
|
635
|
-
MODEL_REGISTRY.filter((model) =>
|
|
639
|
+
MODEL_REGISTRY.filter((model) => SESSION_START_MODEL_ID_SET_ANY_BACKEND.has(model.id))
|
|
636
640
|
);
|
|
637
641
|
|
|
638
642
|
// ../../shared/utils/timing.ts
|
|
@@ -1175,11 +1179,15 @@ function createFlattenState() {
|
|
|
1175
1179
|
malformedSearchBlockedWithoutPrompt: false
|
|
1176
1180
|
};
|
|
1177
1181
|
}
|
|
1178
|
-
function
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
recordMalformedSearchBlock(event.data, state);
|
|
1182
|
+
function suppressMalformedSearchSegments(state) {
|
|
1183
|
+
if (state.malformedSearchBlockedPromptIds.size === 0 && !state.malformedSearchBlockedWithoutPrompt) {
|
|
1184
|
+
return state.merged;
|
|
1182
1185
|
}
|
|
1186
|
+
return state.merged.filter((event) => {
|
|
1187
|
+
if (event.type !== "text") return true;
|
|
1188
|
+
const blocked = event.promptId ? state.malformedSearchBlockedPromptIds.has(event.promptId) : state.malformedSearchBlockedWithoutPrompt;
|
|
1189
|
+
return !(blocked && containsMalformedSearchBashEof(event.text));
|
|
1190
|
+
});
|
|
1183
1191
|
}
|
|
1184
1192
|
function pushEvent(state, event) {
|
|
1185
1193
|
if (event) state.merged.push(event);
|
|
@@ -1252,6 +1260,7 @@ function projectMemoryUsage(data, index) {
|
|
|
1252
1260
|
id: `mem-${data?.timestamp ?? index}`,
|
|
1253
1261
|
activeMemoryIds,
|
|
1254
1262
|
activeMemories,
|
|
1263
|
+
usageSource: data?.usageSource === "company_bootstrap" ? "company_bootstrap" : "prompt_start",
|
|
1255
1264
|
...resolvePromptId(data) ? { promptId: resolvePromptId(data) } : {}
|
|
1256
1265
|
};
|
|
1257
1266
|
}
|
|
@@ -1269,6 +1278,7 @@ function projectMemoryRecallUsage(data, index) {
|
|
|
1269
1278
|
returnedMemoryIds,
|
|
1270
1279
|
requestedMemories,
|
|
1271
1280
|
returnedMemories,
|
|
1281
|
+
usageSource: "recall",
|
|
1272
1282
|
...typeof data?.intent === "string" && data.intent.trim() ? { intent: data.intent.trim() } : {},
|
|
1273
1283
|
...typeof data?.tool === "string" && data.tool.trim() ? { tool: data.tool.trim() } : {},
|
|
1274
1284
|
...resolvePromptId(data) ? { promptId: resolvePromptId(data) } : {}
|
|
@@ -1387,20 +1397,13 @@ function projectPatch(data, index) {
|
|
|
1387
1397
|
};
|
|
1388
1398
|
}
|
|
1389
1399
|
function projectStream(type, data, state) {
|
|
1390
|
-
const promptId = resolvePromptId(data);
|
|
1391
|
-
const text = resolveTextValue(data);
|
|
1392
|
-
const hasPromptScopedMalformedSearchBlock = promptId ? state.malformedSearchBlockedPromptIds.has(promptId) : false;
|
|
1393
|
-
const hasUnpromptedMalformedSearchBlock = !promptId && state.malformedSearchBlockedWithoutPrompt;
|
|
1394
|
-
if (type === "text" && (hasPromptScopedMalformedSearchBlock || hasUnpromptedMalformedSearchBlock && containsMalformedSearchBashEof(text))) {
|
|
1395
|
-
return;
|
|
1396
|
-
}
|
|
1397
1400
|
coalesceStreamDelta(
|
|
1398
1401
|
state.merged,
|
|
1399
1402
|
state.streams,
|
|
1400
1403
|
type,
|
|
1401
1404
|
resolveEventId(data, type, state.merged.length),
|
|
1402
|
-
|
|
1403
|
-
|
|
1405
|
+
resolveTextValue(data),
|
|
1406
|
+
resolvePromptId(data)
|
|
1404
1407
|
);
|
|
1405
1408
|
}
|
|
1406
1409
|
function projectToolCall(data, state) {
|
|
@@ -1493,7 +1496,6 @@ function applyTodoUpdate(data, state) {
|
|
|
1493
1496
|
function flattenSessionEvents(raw) {
|
|
1494
1497
|
const state = createFlattenState();
|
|
1495
1498
|
const normalizedEvents = normalizeRawSessionEvents(raw);
|
|
1496
|
-
seedMalformedSearchBlocks(state, normalizedEvents);
|
|
1497
1499
|
for (const normalized of normalizedEvents) {
|
|
1498
1500
|
const { type } = normalized;
|
|
1499
1501
|
const data = normalized.data;
|
|
@@ -1566,7 +1568,7 @@ function flattenSessionEvents(raw) {
|
|
|
1566
1568
|
break;
|
|
1567
1569
|
}
|
|
1568
1570
|
}
|
|
1569
|
-
return state
|
|
1571
|
+
return suppressMalformedSearchSegments(state);
|
|
1570
1572
|
}
|
|
1571
1573
|
function partitionEventsByPrompt(allEvents, promptIds) {
|
|
1572
1574
|
const promptSet = new Set(promptIds);
|