@hncode/hncode 0.5.5 → 0.5.6

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/package.json +1 -1
  2. package/src/tui.js +9 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hncode/hncode",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "hncode — A cyan-blue TUI AI coding agent with zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/tui.js CHANGED
@@ -6918,6 +6918,8 @@ export function makeState({ cfg, session, opts }) {
6918
6918
  // was re-picked (setEffort is the only other writer, and it sets both).
6919
6919
  const effort = (session && session.effort) || cfg.effort || (cfg.reasoning ? 'on' : 'off');
6920
6920
  return {
6921
+ // No model chosen yet: the interface says so instead of refusing to start.
6922
+ modelMissing: !!(opts && opts.modelMissing),
6921
6923
  workspace: cwd,
6922
6924
  cfg,
6923
6925
  // The SAME session local this function already reads for `effort`, kept on the state
@@ -13728,16 +13730,20 @@ export async function startTUI(opts) {
13728
13730
  }
13729
13731
 
13730
13732
 
13733
+ // Set when the config has no model, so the interface can say so without blocking startup.
13734
+ let modelMissing = false;
13735
+
13731
13736
  // FIRST: Ensure model is initialized before restoring session
13732
13737
  if (!cfg.model || !cfg.innerModel) {
13733
13738
  // Model not set yet - use default or prompt user
13734
13739
  if (!cfg.model) {
13735
- console.log('No model configured. Please run /model to select one.');
13736
- return 1;
13740
+ // NOT a return: a fresh install has no model yet, and the advice is `/model` — which needs the
13741
+ // prompt this function is about to build. Flagged instead, and reported once the TUI is up.
13742
+ modelMissing = true;
13737
13743
  }
13738
13744
  }
13739
13745
 
13740
- const state = makeState({ cfg, session, opts });
13746
+ const state = makeState({ cfg, session, opts: { ...opts, modelMissing } });
13741
13747
  // Mirror the session on the state so `/move` can rebind ONE binding and have every
13742
13748
  // consumer follow (see `replaceSession`).
13743
13749
  state.session = session;