aegiscode 6.8.37 → 7.0.1

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 (110) hide show
  1. package/README.md +39 -1
  2. package/bin/aegiscode.js +137 -0
  3. package/package.json +1 -1
  4. package/scripts/check.mjs +5 -0
  5. package/scripts/demo.mjs +5 -0
  6. package/scripts/predist.mjs +29 -2
  7. package/scripts/runtests.mjs +5 -0
  8. package/scripts/seal-gate.mjs +76 -0
  9. package/src/agents.js +5 -0
  10. package/src/app.js +59 -1
  11. package/src/art.js +5 -0
  12. package/src/autonomous.js +23 -0
  13. package/src/caps.js +5 -0
  14. package/src/chatflow.js +104 -31
  15. package/src/checkpoint.js +5 -0
  16. package/src/clipboard.js +5 -0
  17. package/src/cloudsync.js +5 -0
  18. package/src/commands.js +487 -4
  19. package/src/config.js +5 -0
  20. package/src/credentials.js +5 -0
  21. package/src/deps.js +5 -0
  22. package/src/devrun.js +5 -0
  23. package/src/diff.js +5 -0
  24. package/src/diffview.js +5 -0
  25. package/src/engine.js +5 -0
  26. package/src/entitlement.js +5 -0
  27. package/src/events.js +15 -0
  28. package/src/export.js +5 -0
  29. package/src/fingerprint.js +5 -0
  30. package/src/format.js +5 -0
  31. package/src/fuzzy.js +5 -0
  32. package/src/gate.js +12 -0
  33. package/src/history.js +5 -0
  34. package/src/init.js +5 -0
  35. package/src/input.js +5 -0
  36. package/src/keys.js +29 -2
  37. package/src/limits.js +192 -0
  38. package/src/markdown.js +5 -0
  39. package/src/mcp.js +13 -0
  40. package/src/models.js +5 -0
  41. package/src/naming.js +5 -0
  42. package/src/overlays.js +7 -2
  43. package/src/panels.js +5 -0
  44. package/src/permissions.js +56 -1
  45. package/src/ping.js +5 -0
  46. package/src/presence.js +5 -0
  47. package/src/provenance.js +238 -0
  48. package/src/provenance.lock.json +36 -0
  49. package/src/render.js +5 -0
  50. package/src/screen.js +5 -0
  51. package/src/screens.js +48 -37
  52. package/src/secret.js +5 -0
  53. package/src/securefs.js +5 -0
  54. package/src/settings.js +5 -0
  55. package/src/shared.js +5 -0
  56. package/src/sharedpaths.js +5 -0
  57. package/src/signup.js +5 -0
  58. package/src/summarize.js +5 -0
  59. package/src/sysdiag.js +582 -0
  60. package/src/system.js +5 -0
  61. package/src/theme.js +5 -0
  62. package/src/title.js +5 -0
  63. package/src/todos.js +5 -0
  64. package/src/tokens.js +5 -0
  65. package/src/topup.js +5 -0
  66. package/src/update.js +5 -0
  67. package/vendor/client/aegis.js +27 -0
  68. package/vendor/client/attest.js +5 -0
  69. package/vendor/client/authorship-key.js +5 -0
  70. package/vendor/client/auto-provision.js +5 -0
  71. package/vendor/client/brain-catalog.js +5 -0
  72. package/vendor/client/byok-catalog.js +48 -8
  73. package/vendor/client/credentials.js +5 -0
  74. package/vendor/client/device-fingerprint.js +5 -0
  75. package/vendor/client/env-file.js +5 -0
  76. package/vendor/client/fingerprint.js +5 -0
  77. package/vendor/client/foreign-memory.js +5 -0
  78. package/vendor/client/hooks.js +5 -0
  79. package/vendor/client/model-discovery.js +332 -0
  80. package/vendor/client/platform.js +5 -0
  81. package/vendor/client/prefs.js +5 -0
  82. package/vendor/client/presence-constants.js +5 -0
  83. package/vendor/client/presence.js +5 -0
  84. package/vendor/client/record-vault.js +5 -0
  85. package/vendor/client/session-store.js +5 -0
  86. package/vendor/client/topup.js +5 -0
  87. package/vendor/client/touch.js +5 -0
  88. package/vendor/client/update.js +5 -0
  89. package/vendor/client/user-models.js +383 -0
  90. package/vendor/desktop/lib/local/aegis-seal.mjs +5 -0
  91. package/vendor/desktop/lib/local/agents.js +5 -0
  92. package/vendor/desktop/lib/local/autonomous.js +86 -0
  93. package/vendor/desktop/lib/local/context.js +5 -0
  94. package/vendor/desktop/lib/local/covenant.js +5 -0
  95. package/vendor/desktop/lib/local/engine.js +463 -12
  96. package/vendor/desktop/lib/local/entitlement.js +5 -0
  97. package/vendor/desktop/lib/local/git-scope.js +5 -0
  98. package/vendor/desktop/lib/local/local.js +5 -0
  99. package/vendor/desktop/lib/local/prompt.js +5 -0
  100. package/vendor/desktop/lib/local/queue.js +5 -0
  101. package/vendor/desktop/lib/local/session-rounds.js +5 -0
  102. package/vendor/desktop/lib/local/shell.js +88 -9
  103. package/vendor/desktop/lib/local/tools.js +13 -6
  104. package/vendor/desktop/lib/local/turn-guard.js +5 -0
  105. package/vendor/desktop/lib/local/worktree-lock.js +5 -0
  106. package/vendor/desktop/lib/settings.js +5 -0
  107. package/vendor/desktop/renderer/usage.js +73 -1
  108. package/vendor/mcp/server.js +5 -0
  109. package/vendor/mcp/tools.js +5 -0
  110. package/vendor/tools/agent-gate.mjs +23 -0
package/src/chatflow.js CHANGED
@@ -372,6 +372,10 @@ function shortcutsGrid(cols, ctx) {
372
372
  cell('/', 'for commands', '?', 'for shortcuts'),
373
373
  cell('ctrl + c', 'to quit', 'ctrl + o', 'for permissions'),
374
374
  cell('alt + p', 'to switch model', 'alt + t', 'to toggle thinking'),
375
+ // The shift chords the two pickers commit with. They are on the sheet for
376
+ // the same reason every other row is: `handleOverlayKey` handles them now,
377
+ // and a key a user cannot read about is a key that does not exist.
378
+ cell('shift + ↑/↓', 'pins as it moves', 'shift + enter', 'runs the row'),
375
379
  cell('esc', 'to interrupt a turn', 'ctrl + l', 'to clear the screen'),
376
380
  cell('ctrl + t', 'to show tokens', 'ctrl + r', 'to resume a session'),
377
381
  cell('↑ / ↓', 'for history', 'tab', 'to complete a command'),
@@ -901,6 +905,18 @@ async function runSession(host) {
901
905
  const lineCache = new WeakMap();
902
906
 
903
907
  let overlay = null;
908
+
909
+ /**
910
+ * The palette's rows: the ONE ranking the frame draws and the key handlers
911
+ * act on. Tab and Enter each wrote this expression out in full, which is two
912
+ * chances for the row that is completed or run to be a different row than the
913
+ * one highlighted. A function declaration so `render`'s closure can call it
914
+ * whatever order the definitions are initialised in.
915
+ */
916
+ function paletteRows(query) {
917
+ const q = paletteQuery(query == null ? (overlay && overlay.query) || '' : query);
918
+ return fuzzy.fuzzyRankWithAliases(q, host.visibleCommands(), (c) => c.name, (c) => c.aliases || []);
919
+ }
904
920
  // Automode's running tally of silent "continue" answers to the round-budget
905
921
  // dialog (see autoContinuePlan above). Cleared whenever the human is
906
922
  // actually asked (autoContinuePlan resets it once the allowance is spent),
@@ -1998,6 +2014,24 @@ async function runSession(host) {
1998
2014
  }
1999
2015
  };
2000
2016
 
2017
+ /**
2018
+ * Pin a model row — the ONE path a row is applied through, shared by Enter,
2019
+ * shift+enter and the shift+arrow chord. Written out once because applying a
2020
+ * model is not just a config write: it may have to move the class first and
2021
+ * it may have to collect the provider key the row needs. A second apply path
2022
+ * would eventually skip one of those (the reference's own picker pinned the
2023
+ * id and left the class behind), and the user would be running on a model
2024
+ * whose key this machine does not hold.
2025
+ */
2026
+ const applyModelRow = async (chosen) => {
2027
+ if (!chosen) return;
2028
+ if (chosen.cls === 'byok' && ctx.modelClass !== 'byok') await dispatch('/class byok');
2029
+ ctx.model = chosen.id;
2030
+ host.updateConfig({ model: chosen.id, currentModelId: chosen.id, modelClass: ctx.modelClass });
2031
+ note(`model: ${chosen.id}${chosen.cls === 'byok' ? ' (byok)' : ''}`);
2032
+ await collectKeyFor(chosen);
2033
+ };
2034
+
2001
2035
  const handleOverlayKey = async (key) => {
2002
2036
  const type = overlay.type;
2003
2037
  if (key.name === KEY.ESC || key.name === KEY.CTRL_C) {
@@ -2011,16 +2045,11 @@ async function runSession(host) {
2011
2045
  return;
2012
2046
  }
2013
2047
  if (key.name === KEY.TAB && type === 'palette') {
2014
- // Tab completes the query to the highlighted command, ranking with the
2015
- // same function the palette rendered with so the row completed is the
2016
- // row Enter would run. Nothing highlighted (no matches) → do nothing.
2017
- const list = fuzzy.fuzzyRankWithAliases(
2018
- paletteQuery(overlay.query),
2019
- host.visibleCommands(),
2020
- (c) => c.name,
2021
- (c) => c.aliases || []
2022
- );
2023
- const chosen = list[overlay.sel || 0];
2048
+ // Tab completes the query to the highlighted command. The ranking is
2049
+ // `paletteRows()`, the same list the frame drew and Enter runs, so the
2050
+ // row completed is the row highlighted. Nothing highlighted (no matches)
2051
+ // → do nothing.
2052
+ const chosen = paletteRows()[overlay.sel || 0];
2024
2053
  if (chosen) {
2025
2054
  overlay.query = chosen.name;
2026
2055
  overlay.sel = 0;
@@ -2032,13 +2061,7 @@ async function runSession(host) {
2032
2061
  if (type === 'palette') {
2033
2062
  // Rank with the same function the palette rendered with, so the row
2034
2063
  // highlighted is the row Enter runs.
2035
- const list = fuzzy.fuzzyRankWithAliases(
2036
- paletteQuery(overlay.query),
2037
- host.visibleCommands(),
2038
- (c) => c.name,
2039
- (c) => c.aliases || []
2040
- );
2041
- const chosen = list[overlay.sel || 0];
2064
+ const chosen = paletteRows()[overlay.sel || 0];
2042
2065
  const arg = String(overlay.query || '').trim().split(/\s+/).slice(1).join(' ');
2043
2066
  overlay = null;
2044
2067
  render();
@@ -2051,20 +2074,7 @@ async function runSession(host) {
2051
2074
  const chosen = (overlay.items || [])[overlay.sel || 0];
2052
2075
  overlay = null;
2053
2076
  render();
2054
- if (chosen) {
2055
- // A direct-provider (byok) row needs the class the id actually
2056
- // belongs to before the pin can route anywhere.
2057
- if (chosen.cls === 'byok' && ctx.modelClass !== 'byok') await dispatch('/class byok');
2058
- ctx.model = chosen.id;
2059
- host.updateConfig({ model: chosen.id, currentModelId: chosen.id, modelClass: ctx.modelClass });
2060
- note(`model: ${chosen.id}${chosen.cls === 'byok' ? ' (byok)' : ''}`);
2061
- // Then the key, if this row needs one this machine does not have —
2062
- // collected here rather than as a warning to run some command
2063
- // afterward. See collectKeyFor: the decision comes from the shared
2064
- // env-file module, so the variable a key is written to is the same
2065
- // one the desktop reads, instead of each host keeping a private copy.
2066
- await collectKeyFor(chosen);
2067
- }
2077
+ await applyModelRow(chosen);
2068
2078
  render();
2069
2079
  return;
2070
2080
  }
@@ -2092,6 +2102,69 @@ async function runSession(host) {
2092
2102
  render();
2093
2103
  return;
2094
2104
  }
2105
+ if (key.name === KEY.SHIFT_UP || key.name === KEY.SHIFT_DOWN) {
2106
+ // Shift is the one-keystroke commit in the two pickers that write a
2107
+ // setting: it moves the highlight one row in the pressed direction and
2108
+ // applies THAT row immediately, so changing the model is a single key
2109
+ // instead of point-then-Enter. It routes into the same apply paths Enter
2110
+ // uses, so the chord cannot pin a model Enter would refuse to pin, skip
2111
+ // the provider-key prompt a byok row needs, or store an effort level the
2112
+ // picker's own table does not contain.
2113
+ const step = key.name === KEY.SHIFT_UP ? -1 : 1;
2114
+ const max = Math.max(0, overlayRowCount() - 1);
2115
+ overlay.sel = Math.min(max, Math.max(0, (overlay.sel || 0) + step));
2116
+ if (type === 'model') {
2117
+ const chosen = (overlay.items || [])[overlay.sel || 0];
2118
+ overlay = null;
2119
+ render();
2120
+ await applyModelRow(chosen);
2121
+ render();
2122
+ return;
2123
+ }
2124
+ if (type === 'effort') {
2125
+ const chosen = overlays.EFFORT_VALUES[overlay.sel || 0];
2126
+ overlay = null;
2127
+ ctx.effort = chosen || 'high';
2128
+ host.updateConfig({ effort: ctx.effort });
2129
+ note(`effort: ${ctx.effort}`);
2130
+ render();
2131
+ return;
2132
+ }
2133
+ render();
2134
+ return;
2135
+ }
2136
+ if (key.name === KEY.SHIFT_ENTER) {
2137
+ // The same commit as Enter, in the spelling terminals that have no other
2138
+ // way to send it: on the palette it runs the highlighted command without
2139
+ // the user reaching for the Enter key proper, and in a picker it applies
2140
+ // the highlighted row. Both read the same sel/items every other path
2141
+ // reads, so the chord cannot run a different row than the frame drew.
2142
+ if (type === 'palette') {
2143
+ const chosen = paletteRows()[overlay.sel || 0];
2144
+ overlay = null;
2145
+ render();
2146
+ if (chosen) await dispatch(`/${chosen.name}`);
2147
+ return;
2148
+ }
2149
+ if (type === 'model') {
2150
+ const chosen = (overlay.items || [])[overlay.sel || 0];
2151
+ overlay = null;
2152
+ render();
2153
+ await applyModelRow(chosen);
2154
+ render();
2155
+ return;
2156
+ }
2157
+ if (type === 'effort') {
2158
+ const chosen = overlays.EFFORT_VALUES[overlay.sel || 0];
2159
+ overlay = null;
2160
+ ctx.effort = chosen || 'high';
2161
+ host.updateConfig({ effort: ctx.effort });
2162
+ note(`effort: ${ctx.effort}`);
2163
+ render();
2164
+ return;
2165
+ }
2166
+ return;
2167
+ }
2095
2168
  if (key.name === KEY.UP) {
2096
2169
  overlay.sel = Math.max(0, (overlay.sel || 0) - 1);
2097
2170
  render();
package/src/checkpoint.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/clipboard.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/cloudsync.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
  /**