@tryarcanist/cli 0.1.91 → 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.
Files changed (2) hide show
  1. package/dist/index.js +21 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -189,6 +189,9 @@ function validateApiUrl(url) {
189
189
  } catch {
190
190
  return "Invalid URL format";
191
191
  }
192
+ if (parsed.username || parsed.password) {
193
+ return "API URL must not include embedded credentials. Use --token or ARCANIST_TOKEN to authenticate.";
194
+ }
192
195
  const host = parsed.hostname.replace(/^\[|\]$/g, "");
193
196
  const isLocal = host === "localhost" || host === "127.0.0.1" || host === "::1";
194
197
  if (parsed.protocol !== "https:" && !isLocal) {
@@ -623,13 +626,17 @@ function buildModelProviderGroups(models) {
623
626
  id: model.id,
624
627
  name: model.name,
625
628
  label: formatModelLabel(model, { includeProvider: true }) ?? model.name,
629
+ backends: model.backends,
626
630
  reasoning: model.reasoning
627
631
  });
628
632
  }
629
633
  return [...groups.values()];
630
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
+ );
631
638
  var SESSION_START_MODEL_PROVIDER_GROUPS = buildModelProviderGroups(
632
- MODEL_REGISTRY.filter((model) => VALID_SESSION_START_MODEL_IDS.has(model.id))
639
+ MODEL_REGISTRY.filter((model) => SESSION_START_MODEL_ID_SET_ANY_BACKEND.has(model.id))
633
640
  );
634
641
 
635
642
  // ../../shared/utils/timing.ts
@@ -1172,11 +1179,15 @@ function createFlattenState() {
1172
1179
  malformedSearchBlockedWithoutPrompt: false
1173
1180
  };
1174
1181
  }
1175
- function seedMalformedSearchBlocks(state, events) {
1176
- for (const event of events) {
1177
- if (event.type !== "session_error") continue;
1178
- recordMalformedSearchBlock(event.data, state);
1182
+ function suppressMalformedSearchSegments(state) {
1183
+ if (state.malformedSearchBlockedPromptIds.size === 0 && !state.malformedSearchBlockedWithoutPrompt) {
1184
+ return state.merged;
1179
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
+ });
1180
1191
  }
1181
1192
  function pushEvent(state, event) {
1182
1193
  if (event) state.merged.push(event);
@@ -1249,6 +1260,7 @@ function projectMemoryUsage(data, index) {
1249
1260
  id: `mem-${data?.timestamp ?? index}`,
1250
1261
  activeMemoryIds,
1251
1262
  activeMemories,
1263
+ usageSource: data?.usageSource === "company_bootstrap" ? "company_bootstrap" : "prompt_start",
1252
1264
  ...resolvePromptId(data) ? { promptId: resolvePromptId(data) } : {}
1253
1265
  };
1254
1266
  }
@@ -1266,6 +1278,7 @@ function projectMemoryRecallUsage(data, index) {
1266
1278
  returnedMemoryIds,
1267
1279
  requestedMemories,
1268
1280
  returnedMemories,
1281
+ usageSource: "recall",
1269
1282
  ...typeof data?.intent === "string" && data.intent.trim() ? { intent: data.intent.trim() } : {},
1270
1283
  ...typeof data?.tool === "string" && data.tool.trim() ? { tool: data.tool.trim() } : {},
1271
1284
  ...resolvePromptId(data) ? { promptId: resolvePromptId(data) } : {}
@@ -1384,20 +1397,13 @@ function projectPatch(data, index) {
1384
1397
  };
1385
1398
  }
1386
1399
  function projectStream(type, data, state) {
1387
- const promptId = resolvePromptId(data);
1388
- const text = resolveTextValue(data);
1389
- const hasPromptScopedMalformedSearchBlock = promptId ? state.malformedSearchBlockedPromptIds.has(promptId) : false;
1390
- const hasUnpromptedMalformedSearchBlock = !promptId && state.malformedSearchBlockedWithoutPrompt;
1391
- if (type === "text" && (hasPromptScopedMalformedSearchBlock || hasUnpromptedMalformedSearchBlock && containsMalformedSearchBashEof(text))) {
1392
- return;
1393
- }
1394
1400
  coalesceStreamDelta(
1395
1401
  state.merged,
1396
1402
  state.streams,
1397
1403
  type,
1398
1404
  resolveEventId(data, type, state.merged.length),
1399
- text,
1400
- promptId
1405
+ resolveTextValue(data),
1406
+ resolvePromptId(data)
1401
1407
  );
1402
1408
  }
1403
1409
  function projectToolCall(data, state) {
@@ -1490,7 +1496,6 @@ function applyTodoUpdate(data, state) {
1490
1496
  function flattenSessionEvents(raw) {
1491
1497
  const state = createFlattenState();
1492
1498
  const normalizedEvents = normalizeRawSessionEvents(raw);
1493
- seedMalformedSearchBlocks(state, normalizedEvents);
1494
1499
  for (const normalized of normalizedEvents) {
1495
1500
  const { type } = normalized;
1496
1501
  const data = normalized.data;
@@ -1563,7 +1568,7 @@ function flattenSessionEvents(raw) {
1563
1568
  break;
1564
1569
  }
1565
1570
  }
1566
- return state.merged;
1571
+ return suppressMalformedSearchSegments(state);
1567
1572
  }
1568
1573
  function partitionEventsByPrompt(allEvents, promptIds) {
1569
1574
  const promptSet = new Set(promptIds);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryarcanist/cli",
3
- "version": "0.1.91",
3
+ "version": "0.1.93",
4
4
  "description": "CLI for Arcanist — create and manage coding agent sessions",
5
5
  "type": "module",
6
6
  "bin": {