aegiscode 7.0.2 → 7.0.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aegiscode",
3
3
  "productName": "AEGIS Code",
4
- "version": "7.0.2",
4
+ "version": "7.0.4",
5
5
  "description": "aegiscode — the command-line version of AEGIS Desktop. The shared tool surface in your shell, over the same thin transport and tool registry as the MCP plugin and the desktop app. Ships transport + UI only; no brain.",
6
6
  "author": {
7
7
  "name": "AEGIS Code",
package/src/app.js CHANGED
@@ -1663,6 +1663,30 @@ function createApp(options = {}) {
1663
1663
  /** Non-interactive: one prompt, plain output, exit code. */
1664
1664
  async function runOnce(prompt, { json = false } = {}) {
1665
1665
  adoptLegacyKeyOnce();
1666
+ // Same self-service a fresh `aegiscode -p ...` deserves as a fresh
1667
+ // interactive session (runInteractive) or a fresh `/ask` (runPrompt):
1668
+ // this path used to skip straight to the "no key" refusal below, so
1669
+ // every headless/scripted first run (CI, docker, a README one-liner)
1670
+ // left an installed-but-never-registered machine with no account row
1671
+ // and no welcome trial, instead of the free device key auto-provision
1672
+ // was built to hand it.
1673
+ //
1674
+ // Not the shared `ensureApiKey()` helper: it reports through `emit()`,
1675
+ // which writes to `out` — the same stream `--json` puts its one machine-
1676
+ // readable line on. A notice ahead of that line would break every script
1677
+ // piping `-p ... --json` into a JSON parser, so this path's own notice
1678
+ // always goes to `err` regardless of `json`.
1679
+ if (!client.apiKey && !provisionAttempted) {
1680
+ provisionAttempted = true;
1681
+ const result = await autoProvisionApiKey(client, credentials);
1682
+ if (result.key) {
1683
+ err.write(
1684
+ `aegiscode: no AEGIS key was configured — auto-provisioned a free account` +
1685
+ (result.ok ? ` (saved to ${credentials.credentialsPath()})` : ' (could not save it — reconfigure with /key)') +
1686
+ `. Fund it at ${client.promptUrl('topup', 'device_autoprovision')} or run /byok to use your own key.\n`
1687
+ );
1688
+ }
1689
+ }
1666
1690
  if (!client.apiKey) {
1667
1691
  err.write(`aegiscode: no AEGIS account key. ${credentials.HOW_TO_SET}, or set $${credentials.KEY_ENV}.\n`);
1668
1692
  return 2;
package/src/chatflow.js CHANGED
@@ -2062,6 +2062,17 @@ async function runSession(host) {
2062
2062
  }
2063
2063
  return;
2064
2064
  }
2065
+ if (key.name === KEY.TAB && type === 'model') {
2066
+ // Reference parity (aegiscodex-dev/src/main.js's model overlay cycles on
2067
+ // Tab). It is also the one way to walk the list that survives a link
2068
+ // where arrow escapes are eaten, since Tab is a single control byte.
2069
+ const n = (overlay.items || []).length;
2070
+ if (n) {
2071
+ overlay.sel = ((overlay.sel || 0) + 1) % n;
2072
+ render();
2073
+ }
2074
+ return;
2075
+ }
2065
2076
  if (key.name === KEY.ENTER) {
2066
2077
  if (type === 'palette') {
2067
2078
  // Rank with the same function the palette rendered with, so the row
@@ -2170,14 +2181,19 @@ async function runSession(host) {
2170
2181
  }
2171
2182
  return;
2172
2183
  }
2173
- if (key.name === KEY.UP) {
2174
- overlay.sel = Math.max(0, (overlay.sel || 0) - 1);
2175
- render();
2176
- return;
2177
- }
2178
- if (key.name === KEY.DOWN) {
2179
- const max = Math.max(0, overlayRowCount() - 1);
2180
- overlay.sel = Math.min(max, (overlay.sel || 0) + 1);
2184
+ if (key.name === KEY.UP || key.name === KEY.DOWN) {
2185
+ // NAVIGATION ONLY — this is the reference's binding and it has to stay
2186
+ // that way. A plain arrow that applies the row it lands on cannot browse:
2187
+ // the overlay closes on the first press, the model is already changed,
2188
+ // and the other fifteen rows are unreachable. The reference moves the
2189
+ // highlight here and commits on Enter (aegiscodex-dev/src/main.js
2190
+ // navList + the KEY.ENTER branch of its model overlay); the one-keystroke
2191
+ // commit belongs to the shift chords below, which are additive and
2192
+ // explicit, not to the arrow every picker in the app uses to point.
2193
+ // Bounds come from the list being drawn, exactly as navList does it.
2194
+ const n = (overlay.items || []).length || overlayRowCount();
2195
+ const step = key.name === KEY.UP ? -1 : 1;
2196
+ overlay.sel = Math.min(Math.max(0, n - 1), Math.max(0, (overlay.sel || 0) + step));
2181
2197
  render();
2182
2198
  return;
2183
2199
  }
@@ -2189,6 +2205,24 @@ async function runSession(host) {
2189
2205
  return;
2190
2206
  }
2191
2207
  if (type === 'model') {
2208
+ // Shift+W / Shift+S arrive as the plain chars 'W'/'S' — unlike a bare
2209
+ // Shift press, shift+letter is a real, universally-sent terminal
2210
+ // signal (the terminal just sends the uppercase letter), so this is
2211
+ // the one "shift + something" chord that works everywhere arrow keys
2212
+ // might not (e.g. over some remote links/multiplexers that eat CSI
2213
+ // arrow sequences but pass plain chars through fine). Routes through
2214
+ // the same move-and-pin step the arrow keys use.
2215
+ if (key.ch === 'W' || key.ch === 'S') {
2216
+ const step = key.ch === 'W' ? -1 : 1;
2217
+ const max = Math.max(0, overlayRowCount() - 1);
2218
+ overlay.sel = Math.min(max, Math.max(0, (overlay.sel || 0) + step));
2219
+ const chosen = (overlay.items || [])[overlay.sel || 0];
2220
+ overlay = null;
2221
+ render();
2222
+ await applyModelRow(chosen);
2223
+ render();
2224
+ return;
2225
+ }
2192
2226
  const idx = parseInt(key.ch, 10);
2193
2227
  const items = overlay.items || [];
2194
2228
  if (Number.isFinite(idx) && idx >= 1 && idx <= items.length) {
package/src/overlays.js CHANGED
@@ -214,12 +214,12 @@ function renderModelPicker(models, sel = 0, width = 80, height = 24, current = n
214
214
  }
215
215
  if (end < count) lines.push([span('', ' '), span(C.gray, `↓ ${count - end} more below`)]);
216
216
  lines.push(blank(width));
217
- // The shift chord is advertised only because it is handled now (chatflow's
218
- // handleOverlayKey): shift+↑/↓ moves the highlight and pins that row in one
219
- // keystroke, and shift+enter commits the row the highlight is on. The
220
- // reference picker asked for a separate Enter every time and this hint said
221
- // nothing about a way around it.
222
- lines.push([span('', ' '), span(C.gray, `↑↓ navigate ${GLYPH.bullet} shift+↑↓ pins as it moves ${GLYPH.bullet} enter pins ${GLYPH.bullet} esc cancels`)]);
217
+ // ↑/↓/tab move the highlight — they do not apply. This is the reference's
218
+ // binding (aegiscodex-dev/src/main.js navList: arrows point, Enter commits),
219
+ // and the two chords that DO apply as they move are spelled out separately:
220
+ // shift+↑/↓ for terminals that send CSI modifier 2, and shift+w/shift+s as
221
+ // plain chars ('W'/'S') for links that eat arrow escapes but pass letters.
222
+ lines.push([span('', ' '), span(C.gray, `↑↓ or tab move ${GLYPH.bullet} enter pins ${GLYPH.bullet} shift+↑↓/shift+w/s pins at once ${GLYPH.bullet} esc cancels`)]);
223
223
  return fit(lines, width);
224
224
  }
225
225