neoctl 0.1.9 → 0.1.10

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.
@@ -199,30 +199,6 @@ function parseResumeFlag(value) {
199
199
  return false;
200
200
  return ["1", "true", "yes", "latest"].includes(value.toLowerCase());
201
201
  }
202
- function initialContextMetrics(model, messageCount, toolCount) {
203
- const window = resolveContextWindowTokens(model);
204
- return {
205
- model,
206
- estimatedInputTokens: 0,
207
- estimatedChars: 0,
208
- messageCount,
209
- toolCount,
210
- contextWindowTokens: window.tokens,
211
- contextWindowSource: window.source,
212
- contextUsageRatio: window.tokens ? 0 : undefined,
213
- modelMetadata: window.model
214
- ? {
215
- id: window.model.id,
216
- provider: window.model.provider,
217
- maxOutputTokens: window.model.maxOutputTokens,
218
- knowledgeCutoff: window.model.knowledgeCutoff,
219
- reasoning: window.model.reasoning,
220
- imageInput: window.model.imageInput,
221
- source: window.model.source,
222
- }
223
- : undefined,
224
- };
225
- }
226
202
  function activeBackgroundTasks(runtime) {
227
203
  return runtime.taskStore.list().filter((task) => !runtime.taskStore.isTerminal(task));
228
204
  }
@@ -975,11 +951,12 @@ function InkRepl({ runtime, initialCommandLine }) {
975
951
  setStatus((current) => ({ ...current, phase: "running", detail: "saving model settings", activityTick: current.activityTick + 1 }));
976
952
  try {
977
953
  const line = await handleModelCommand(command, runtime);
954
+ const metrics = await runtime.engine.contextMetrics();
978
955
  setStatus((current) => ({
979
956
  ...current,
980
957
  phase: "ready",
981
958
  detail: undefined,
982
- metrics: { ...initialContextMetrics(runtime.engine.getModelSettings().model, runtime.engine.snapshot().messages, runtime.initialMetrics.toolCount), messageCount: runtime.engine.snapshot().messages },
959
+ metrics,
983
960
  activityTick: current.activityTick + 1,
984
961
  }));
985
962
  append(line);
@@ -2615,9 +2592,11 @@ async function submitLoginForm(state, runtime, append, setLoginFormState, setSta
2615
2592
  reasoning: config.defaultReasoning,
2616
2593
  });
2617
2594
  runtime.defaultReasoning = config.defaultReasoning;
2595
+ const metrics = await runtime.engine.contextMetrics();
2618
2596
  setStatus((current) => ({
2619
2597
  ...current,
2620
- metrics: { ...initialContextMetrics(config.model, runtime.engine.snapshot().messages, runtime.initialMetrics.toolCount), messageCount: runtime.engine.snapshot().messages },
2598
+ metrics,
2599
+ activityTick: current.activityTick + 1,
2621
2600
  }));
2622
2601
  setLoginFormState(undefined);
2623
2602
  append(systemLine(`Saved ${state.provider} login to ${state.envPath}\n${formatModelSettings(runtime.engine.getModelSettings(), runtime.defaultReasoning)}`, EXPANDED_SUMMARY_MAX_LINES));