aegiscode 7.0.1 → 7.0.3

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.1",
4
+ "version": "7.0.3",
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
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
4
+ // Conveying a modified copy, or running one as a network service, owes the
5
+ // corresponding source under this licence (§5/§13) — see LICENSING.md.
1
6
  'use strict';
2
7
 
3
8
  /**
@@ -2165,14 +2170,25 @@ async function runSession(host) {
2165
2170
  }
2166
2171
  return;
2167
2172
  }
2168
- if (key.name === KEY.UP) {
2169
- overlay.sel = Math.max(0, (overlay.sel || 0) - 1);
2170
- render();
2171
- return;
2172
- }
2173
- if (key.name === KEY.DOWN) {
2173
+ if (key.name === KEY.UP || key.name === KEY.DOWN) {
2174
+ // The model picker pins on a plain arrow too, not just the shift chord:
2175
+ // shift+arrow depends on the terminal sending CSI modifier 2, which not
2176
+ // every terminal/multiplexer does, and a user on one that doesn't gets a
2177
+ // picker that only ever points, never pins, with no way to tell why.
2178
+ // Plain arrow already moves the highlight everywhere else, so routing it
2179
+ // through the same apply path shift uses makes "it changes the model"
2180
+ // true regardless of what the terminal does with the shift modifier.
2181
+ const step = key.name === KEY.UP ? -1 : 1;
2174
2182
  const max = Math.max(0, overlayRowCount() - 1);
2175
- overlay.sel = Math.min(max, (overlay.sel || 0) + 1);
2183
+ overlay.sel = Math.min(max, Math.max(0, (overlay.sel || 0) + step));
2184
+ if (type === 'model') {
2185
+ const chosen = (overlay.items || [])[overlay.sel || 0];
2186
+ overlay = null;
2187
+ render();
2188
+ await applyModelRow(chosen);
2189
+ render();
2190
+ return;
2191
+ }
2176
2192
  render();
2177
2193
  return;
2178
2194
  }
@@ -2184,6 +2200,24 @@ async function runSession(host) {
2184
2200
  return;
2185
2201
  }
2186
2202
  if (type === 'model') {
2203
+ // Shift+W / Shift+S arrive as the plain chars 'W'/'S' — unlike a bare
2204
+ // Shift press, shift+letter is a real, universally-sent terminal
2205
+ // signal (the terminal just sends the uppercase letter), so this is
2206
+ // the one "shift + something" chord that works everywhere arrow keys
2207
+ // might not (e.g. over some remote links/multiplexers that eat CSI
2208
+ // arrow sequences but pass plain chars through fine). Routes through
2209
+ // the same move-and-pin step the arrow keys use.
2210
+ if (key.ch === 'W' || key.ch === 'S') {
2211
+ const step = key.ch === 'W' ? -1 : 1;
2212
+ const max = Math.max(0, overlayRowCount() - 1);
2213
+ overlay.sel = Math.min(max, Math.max(0, (overlay.sel || 0) + step));
2214
+ const chosen = (overlay.items || [])[overlay.sel || 0];
2215
+ overlay = null;
2216
+ render();
2217
+ await applyModelRow(chosen);
2218
+ render();
2219
+ return;
2220
+ }
2187
2221
  const idx = parseInt(key.ch, 10);
2188
2222
  const items = overlay.items || [];
2189
2223
  if (Number.isFinite(idx) && idx >= 1 && idx <= items.length) {
package/src/keys.js CHANGED
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
4
+ // Conveying a modified copy, or running one as a network service, owes the
5
+ // corresponding source under this licence (§5/§13) — see LICENSING.md.
1
6
  'use strict';
2
7
 
3
8
  /**
package/src/overlays.js CHANGED
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
4
+ // Conveying a modified copy, or running one as a network service, owes the
5
+ // corresponding source under this licence (§5/§13) — see LICENSING.md.
1
6
  'use strict';
2
7
 
3
8
  /**
@@ -209,12 +214,12 @@ function renderModelPicker(models, sel = 0, width = 80, height = 24, current = n
209
214
  }
210
215
  if (end < count) lines.push([span('', ' '), span(C.gray, `↓ ${count - end} more below`)]);
211
216
  lines.push(blank(width));
212
- // The shift chord is advertised only because it is handled now (chatflow's
213
- // handleOverlayKey): shift+↑/↓ moves the highlight and pins that row in one
214
- // keystroke, and shift+enter commits the row the highlight is on. The
215
- // reference picker asked for a separate Enter every time and this hint said
216
- // nothing about a way around it.
217
- lines.push([span('', ' '), span(C.gray, `↑↓ navigate ${GLYPH.bullet} shift+↑↓ pins as it moves ${GLYPH.bullet} enter pins ${GLYPH.bullet} esc cancels`)]);
217
+ // Plain ↑/↓ pins as it moves (chatflow's handleOverlayKey), the same apply
218
+ // path shift+↑/↓ and enter use — shift is no longer required because not
219
+ // every terminal sends the shift+arrow chord. shift+w/shift+s is the same
220
+ // move-and-pin step again, spelled as plain chars ('W'/'S') for links or
221
+ // multiplexers that eat CSI arrow sequences but pass letters through fine.
222
+ lines.push([span('', ' '), span(C.gray, `↑↓ or shift+w/s pins as it moves ${GLYPH.bullet} enter pins ${GLYPH.bullet} esc cancels`)]);
218
223
  return fit(lines, width);
219
224
  }
220
225
 
package/src/screens.js CHANGED
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
4
+ // Conveying a modified copy, or running one as a network service, owes the
5
+ // corresponding source under this licence (§5/§13) — see LICENSING.md.
1
6
  'use strict';
2
7
 
3
8
  /**
package/src/sysdiag.js CHANGED
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
4
+ // Conveying a modified copy, or running one as a network service, owes the
5
+ // corresponding source under this licence (§5/§13) — see LICENSING.md.
1
6
  'use strict';
2
7
 
3
8
  /**