@cryer/star-cli 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.
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ AgentLoop,
4
+ PLAN_MODE_PROMPT,
5
+ attachTurnContext
6
+ } from "./chunk-OHLA2DP7.js";
7
+ export {
8
+ AgentLoop,
9
+ PLAN_MODE_PROMPT,
10
+ attachTurnContext
11
+ };
12
+ //# sourceMappingURL=loop-2MOFLXTG.js.map
package/dist/main.js CHANGED
@@ -5,7 +5,6 @@ import {
5
5
  SessionStore,
6
6
  VERSION,
7
7
  clearSessions,
8
- createModel,
9
8
  findLatestSession,
10
9
  formatSessionEntries,
11
10
  formatStreamError,
@@ -15,24 +14,25 @@ import {
15
14
  loadEnvFile,
16
15
  loadSessionSnapshots,
17
16
  readImageInput,
18
- reasoningEffortMetadata,
19
17
  resolveMentions,
20
- resolveModelConfig,
21
18
  resolveSessionId
22
- } from "./chunk-4X25DNTF.js";
19
+ } from "./chunk-IYWYSFSF.js";
23
20
  import {
24
21
  AgentLoop,
25
22
  ConfigSchema,
26
23
  contextWindowTokens,
27
24
  createDefaultRegistry,
25
+ createModel,
28
26
  defaultAgentTasks,
29
27
  defaultTaskManager,
30
28
  globalConfigPath,
31
29
  hydrateSnapshots,
32
30
  loadTodos,
33
31
  projectConfigPath,
34
- reconcileToolCalls
35
- } from "./chunk-OOOW7FC4.js";
32
+ reasoningEffortMetadata,
33
+ reconcileToolCalls,
34
+ resolveModelConfig
35
+ } from "./chunk-OHLA2DP7.js";
36
36
 
37
37
  // src/main.tsx
38
38
  import { Command } from "commander";
@@ -481,7 +481,7 @@ program.name("star").description("Star CLI \u2014 an AI agent command-line inter
481
481
  );
482
482
  return;
483
483
  }
484
- const { renderRepl } = await import("./repl-RT6HBM5B.js");
484
+ const { renderRepl } = await import("./repl-YA23CK5R.js");
485
485
  renderRepl(loop, {
486
486
  model: modelName,
487
487
  permissionMode: config.permissionMode,
@@ -7,7 +7,6 @@ import {
7
7
  clearSessions,
8
8
  computeCostUsd,
9
9
  coreMessageText,
10
- createModel,
11
10
  estimateCost,
12
11
  formatByteCount,
13
12
  formatDollars,
@@ -15,15 +14,12 @@ import {
15
14
  formatSessionEntries,
16
15
  formatStreamError,
17
16
  formatTokens,
18
- listModels,
19
17
  listSessionEntries,
20
18
  loadSessionSnapshots,
21
19
  previewLines,
22
- reasoningEffortMetadata,
23
20
  relativeTime,
24
21
  renderMarkdown,
25
22
  resolveMentions,
26
- resolveModelConfig,
27
23
  resolveSessionId,
28
24
  sessionPreview,
29
25
  shortSessionId,
@@ -31,7 +27,7 @@ import {
31
27
  summarizeArgs,
32
28
  toTerminalSafe,
33
29
  upsertEnvContent
34
- } from "./chunk-4X25DNTF.js";
30
+ } from "./chunk-IYWYSFSF.js";
35
31
  import {
36
32
  AgentLoop,
37
33
  MAX_IMAGE_DIMENSION,
@@ -49,6 +45,7 @@ import {
49
45
  contextWindowTokens,
50
46
  createDefaultRegistry,
51
47
  createIgnorePredicate,
48
+ createModel,
52
49
  defaultAgentTasks,
53
50
  defaultTaskManager,
54
51
  diffTreeNames,
@@ -67,19 +64,22 @@ import {
67
64
  isAllowedByRules,
68
65
  isDangerousCommand,
69
66
  isGitRepo,
67
+ listModels,
70
68
  listSnapshots,
71
69
  listTurnSnapshots,
72
70
  loadTodos,
73
71
  parseTodoArgs,
72
+ reasoningEffortMetadata,
74
73
  reconcileToolCalls,
75
74
  resetTodos,
75
+ resolveModelConfig,
76
76
  resolveShell,
77
77
  resolveSnapshotContent,
78
78
  rewindToSnapshot,
79
79
  starHome,
80
80
  summarizeMessages,
81
81
  userMemoryPath
82
- } from "./chunk-OOOW7FC4.js";
82
+ } from "./chunk-OHLA2DP7.js";
83
83
 
84
84
  // src/cli/repl.tsx
85
85
  import { Box as Box13, Text as Text14, render, useApp } from "ink";
@@ -605,7 +605,7 @@ import fs2 from "fs/promises";
605
605
  import path3 from "path";
606
606
  var MIN_COMPACT_MESSAGES = 4;
607
607
  async function compactSession(opts) {
608
- const { backend, sessionStore, config, model } = opts;
608
+ const { backend, sessionStore, config } = opts;
609
609
  if (!(backend instanceof AgentLoop)) {
610
610
  return { message: "Current backend does not support compaction.", compacted: false };
611
611
  }
@@ -624,7 +624,13 @@ async function compactSession(opts) {
624
624
  compacted: false
625
625
  };
626
626
  }
627
- const next = await applyCompactionSummary(messages, compacted, config, model);
627
+ const next = await applyCompactionSummary(
628
+ messages,
629
+ compacted,
630
+ config,
631
+ backend.getAuxModel(),
632
+ backend.getAuxTemperature()
633
+ );
628
634
  await backend.loadMessages(next);
629
635
  await sessionStore?.replaceMessages(next);
630
636
  const afterTokens = estimateTokens(next);
@@ -634,14 +640,14 @@ async function compactSession(opts) {
634
640
  messages: next
635
641
  };
636
642
  }
637
- async function applyCompactionSummary(original, compacted, config, model) {
638
- if (config.contextCompaction !== "summary" || !model) {
643
+ async function applyCompactionSummary(original, compacted, config, model, temperature) {
644
+ if (config.contextCompaction !== "summary") {
639
645
  return compacted.messages;
640
646
  }
641
647
  const headCount = compacted.messages[0]?.role === "system" ? 1 : 0;
642
648
  const dropped = original.slice(headCount, headCount + compacted.droppedCount);
643
649
  try {
644
- const summary = await summarizeMessages(dropped, model);
650
+ const summary = await summarizeMessages(dropped, model, void 0, temperature);
645
651
  const messages = compacted.messages.slice();
646
652
  messages[headCount] = {
647
653
  role: "user",
@@ -3723,7 +3729,7 @@ function visibleTodoWindow(todos, max = MAX_VISIBLE_TODOS) {
3723
3729
  };
3724
3730
  }
3725
3731
  function TodoPanel({ todos }) {
3726
- if (todos.length === 0) return null;
3732
+ if (todos.length === 0 || todos.every((t) => t.status === "done")) return null;
3727
3733
  const { items, hiddenBefore, hiddenAfter } = visibleTodoWindow(todos);
3728
3734
  return /* @__PURE__ */ jsxs13(Box12, { flexDirection: "column", children: [
3729
3735
  hiddenBefore > 0 && /* @__PURE__ */ jsxs13(Text13, { dimColor: true, children: [
@@ -4981,20 +4987,14 @@ ${estimateCost(usageRef.current, modelNameRef.current, modelConfig)}`;
4981
4987
  return `Busy \u2014 /${busyCommandRef.current} is still running.`;
4982
4988
  }
4983
4989
  busyCommandRef.current = "compact";
4984
- let summaryModel = null;
4985
- try {
4986
- summaryModel = createModel(config, modelNameRef.current);
4987
- } catch {
4988
- summaryModel = null;
4989
- }
4990
+ turnStartedAtRef.current = Date.now();
4990
4991
  tickerStopRef.current = startTicker((tick) => setSpinnerTick(tick));
4991
4992
  setActivity("compacting context\u2026");
4992
4993
  try {
4993
4994
  const result = await compactSession({
4994
4995
  backend: backendRef.current,
4995
4996
  sessionStore: sessionStoreRef.current,
4996
- config,
4997
- model: summaryModel
4997
+ config
4998
4998
  });
4999
4999
  if (result.compacted && result.messages) {
5000
5000
  const display = buildDisplayMessages(result.messages);
@@ -5461,4 +5461,4 @@ export {
5461
5461
  Repl,
5462
5462
  renderRepl
5463
5463
  };
5464
- //# sourceMappingURL=repl-RT6HBM5B.js.map
5464
+ //# sourceMappingURL=repl-YA23CK5R.js.map