archymedes-cli 2.0.0 → 2.2.0

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.
@@ -6,7 +6,7 @@ import {
6
6
  makeParseableTextFormat,
7
7
  modelPricesFromEnvironment,
8
8
  wanderPlannerInstructions
9
- } from "./archymedes-h2x8ct7s.mjs";
9
+ } from "./archymedes-76z6n643.mjs";
10
10
  import {
11
11
  ALLOWED_GIT_SUBCOMMANDS,
12
12
  ALLOWED_SANDBOX_PROGRAMS,
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  windowStart
3
- } from "./archymedes-brkqgrxv.mjs";
3
+ } from "./archymedes-wjaqydyg.mjs";
4
4
  import {
5
- UNICODE_GLYPHS,
6
5
  joinHorizontal,
7
6
  padToWidth,
8
7
  paginator
9
- } from "./archymedes-dwvn4c51.mjs";
8
+ } from "./archymedes-r54qthg5.mjs";
10
9
  import {
11
- NO_COLOR_PALETTE
12
- } from "./archymedes-jecyxv5c.mjs";
10
+ NO_COLOR_PALETTE,
11
+ UNICODE_GLYPHS
12
+ } from "./archymedes-5zn4zp84.mjs";
13
13
  import {
14
14
  __require
15
15
  } from "./archymedes-x67v3n58.mjs";
@@ -2,19 +2,19 @@ import {
2
2
  applyViewport,
3
3
  newViewport,
4
4
  visibleLines
5
- } from "./archymedes-k1bx08z9.mjs";
6
- import"./archymedes-44c1mqas.mjs";
5
+ } from "./archymedes-npcrm9a0.mjs";
7
6
  import {
8
7
  joinHorizontal,
9
8
  padToWidth,
10
9
  scrollIndicator,
11
10
  scrollPercent,
12
- sliceToWidth,
13
- visibleWidth
14
- } from "./archymedes-dwvn4c51.mjs";
11
+ sliceToWidth
12
+ } from "./archymedes-r54qthg5.mjs";
13
+ import"./archymedes-cdgejs3p.mjs";
15
14
  import {
16
- NO_COLOR_PALETTE
17
- } from "./archymedes-jecyxv5c.mjs";
15
+ NO_COLOR_PALETTE,
16
+ visibleWidth
17
+ } from "./archymedes-5zn4zp84.mjs";
18
18
  import {
19
19
  __require
20
20
  } from "./archymedes-x67v3n58.mjs";
@@ -266,18 +266,21 @@ var GUIDE_TOPICS = [
266
266
  {
267
267
  id: "look",
268
268
  title: "How it looks",
269
- summary: "Themes, symbols, and terminals that need help.",
269
+ summary: "Themes, symbols, the fixed workspace, and terminals that need help.",
270
270
  body: [
271
271
  "Archymedes ships a blueprint theme and three others, and reads themes you write yourself as .tss files in .archymedes/themes — the same format TermUI apps use, so a palette written once works in both.",
272
- "If your terminal draws question marks instead of symbols, --ascii switches to characters every terminal has. If you would rather have a status line pinned to the bottom row, --pin does that, at the cost of your terminal's scrollback."
272
+ "The fixed workspace keeps a mode rail and composer anchored while the transcript scrolls underneath. Start with --layout fixed or ARCHYMEDES_LAYOUT=fixed, switch mid-session with /layout, and use Page Up / Page Down to read retained history (Escape returns to live output). Menus open inside the transcript area so the composer never jumps.",
273
+ "If your terminal draws question marks instead of symbols, --ascii switches to characters every terminal has. If you would rather have a status line pinned to the bottom row, --pin does that, at the cost of your terminal's scrollback. ARCHYMEDES_NO_MOTION=1 keeps the opening geometry and menu focus still."
273
274
  ],
274
275
  examples: [
275
276
  { input: "/theme list", effect: "every theme available, including your own" },
276
277
  { input: "/theme chalkboard", effect: "change the colours immediately" },
277
278
  { input: "/theme where", effect: "where to put a theme file of your own" },
279
+ { input: "/layout fixed", effect: "mode rail, anchored composer, menus in the transcript" },
280
+ { input: "/layout scrollback", effect: "return to the ordinary terminal log" },
278
281
  { input: "archymedes --ascii", effect: "plain characters for terminals that mangle symbols" }
279
282
  ],
280
- covers: ["/theme"]
283
+ covers: ["/theme", "/layout"]
281
284
  },
282
285
  {
283
286
  id: "extend",
@@ -292,10 +295,11 @@ var GUIDE_TOPICS = [
292
295
  examples: [
293
296
  { input: "/tools", effect: "every tool, skill, plugin, MCP server and hook" },
294
297
  { input: "/voice", effect: "record a prompt, then edit it before sending" },
298
+ { input: "/cat README.md", effect: "read a file in the transcript, with markdown formatting or numbered code" },
295
299
  { input: "/files", effect: "browse the project tree and @mention a file" },
296
300
  { input: "/edit src/app.ts", effect: "open a file in the built-in editor" }
297
301
  ],
298
- covers: ["/tools", "/voice", "/files", "/edit"]
302
+ covers: ["/tools", "/voice", "/files", "/edit", "/cat"]
299
303
  }
300
304
  ];
301
305
  function wrapText(text, width) {
@@ -1,16 +1,17 @@
1
1
  import {
2
2
  StreamSeries,
3
3
  waveLine
4
- } from "./archymedes-2tp22t9a.mjs";
4
+ } from "./archymedes-pg3pvh9r.mjs";
5
+ import {
6
+ scrollIndicator,
7
+ scrollPercent
8
+ } from "./archymedes-r54qthg5.mjs";
5
9
  import {
6
10
  clip
7
- } from "./archymedes-44c1mqas.mjs";
11
+ } from "./archymedes-cdgejs3p.mjs";
8
12
  import {
9
- scrollIndicator,
10
- scrollPercent,
11
13
  visibleWidth
12
- } from "./archymedes-dwvn4c51.mjs";
13
- import"./archymedes-jecyxv5c.mjs";
14
+ } from "./archymedes-5zn4zp84.mjs";
14
15
  import {
15
16
  __require
16
17
  } from "./archymedes-x67v3n58.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archymedes-cli",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Archymedes CLI — a coding agent that shows its work. Runs against your working tree or an isolated remote sandbox, with guarded approvals, git checkpoints, and exact, measured cost accounting.",
5
5
  "keywords": [
6
6
  "cli",
@@ -1,249 +0,0 @@
1
- // packages/archymedes-cli/src/theme.ts
2
- var BLUEPRINT = `
3
- /* Blueprint navy, chalk-white ink and an amber pencil — the original drafting table. */
4
- @theme blueprint {
5
- --primary: #7cc5ff;
6
- --secondary: #9fb4e8;
7
- --accent: #ffcf6b;
8
- --bg: #0a1524;
9
- --surface: #122135;
10
- --text: #e8eefb;
11
- --text-muted: #6f89b0;
12
- --success: #79dfa6;
13
- --warning: #ffcf6b;
14
- --error: #ff8f7a;
15
- --border: round;
16
- --border-color: #24406a;
17
- --border-focus: #7cc5ff;
18
- }
19
- `;
20
- var PARCHMENT = `
21
- /* The same drawing inked on paper, for a light terminal. */
22
- @theme parchment {
23
- --primary: #2f5fbf;
24
- --secondary: #5a4a86;
25
- --accent: #9a6a00;
26
- --bg: #faf6ec;
27
- --surface: #f1eadd;
28
- --text: #1b1a16;
29
- --text-muted: #6a6252;
30
- --success: #196a44;
31
- --warning: #8a5300;
32
- --error: #b3243b;
33
- --border: round;
34
- --border-color: #d8cfb8;
35
- --border-focus: #2f5fbf;
36
- }
37
- `;
38
- var CHALKBOARD = `
39
- /* A slate: near-black green, chalk white, chalk yellow — for terminals with contrast to spare. */
40
- @theme chalkboard {
41
- --primary: #9fe8d8;
42
- --secondary: #d8d0b0;
43
- --accent: #ffe066;
44
- --bg: #0d1a15;
45
- --surface: #16271f;
46
- --text: #f2efe4;
47
- --text-muted: #86987f;
48
- --success: #7ef2b0;
49
- --warning: #ffd166;
50
- --error: #ff7a7a;
51
- --border: single;
52
- --border-color: #2c443a;
53
- --border-focus: #ffe066;
54
- }
55
- `;
56
- var HIGH_CONTRAST = `
57
- /* Maximum separation, named colours only — for low vision and for terminals with a fixed palette. */
58
- @theme high-contrast {
59
- --primary: brightCyan;
60
- --secondary: brightMagenta;
61
- --accent: brightYellow;
62
- --bg: black;
63
- --surface: black;
64
- --text: brightWhite;
65
- --text-muted: white;
66
- --success: brightGreen;
67
- --warning: brightYellow;
68
- --error: brightRed;
69
- --border: single;
70
- --border-color: white;
71
- --border-focus: brightCyan;
72
- }
73
- `;
74
- var ARCHYMEDES = `
75
- /* Bronze instruments, limestone ink and olive accents on charcoal — Archymedes's own. */
76
- @theme archymedes {
77
- --primary: #e7bb78;
78
- --secondary: #b9c59a;
79
- --accent: #e5a58c;
80
- --bg: #191815;
81
- --surface: #25231e;
82
- --text: #f2ecdf;
83
- --text-muted: #aaa18f;
84
- --success: #b5cc96;
85
- --warning: #efc778;
86
- --error: #f29686;
87
- --border: single;
88
- --border-color: #736956;
89
- --border-focus: #e7bb78;
90
- }
91
- `;
92
- var BUILTIN_THEME_SOURCES = {
93
- archymedes: ARCHYMEDES,
94
- blueprint: BLUEPRINT,
95
- parchment: PARCHMENT,
96
- chalkboard: CHALKBOARD,
97
- "high-contrast": HIGH_CONTRAST
98
- };
99
- var DEFAULT_THEME_NAME = "archymedes";
100
- var NAMED_COLORS = {
101
- black: 0,
102
- red: 1,
103
- green: 2,
104
- yellow: 3,
105
- blue: 4,
106
- magenta: 5,
107
- cyan: 6,
108
- white: 7,
109
- brightblack: 8,
110
- brightred: 9,
111
- brightgreen: 10,
112
- brightyellow: 11,
113
- brightblue: 12,
114
- brightmagenta: 13,
115
- brightcyan: 14,
116
- brightwhite: 15,
117
- gray: 8,
118
- grey: 8
119
- };
120
- function parseColor(value) {
121
- const text = value.trim();
122
- const named = NAMED_COLORS[text.toLowerCase().replace(/[\s_-]/g, "")];
123
- if (named !== undefined)
124
- return named;
125
- const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(text);
126
- if (!hex)
127
- return;
128
- const digits = hex[1];
129
- const full = digits.length === 3 ? digits.split("").map((digit) => digit + digit).join("") : digits;
130
- return {
131
- r: Number.parseInt(full.slice(0, 2), 16),
132
- g: Number.parseInt(full.slice(2, 4), 16),
133
- b: Number.parseInt(full.slice(4, 6), 16)
134
- };
135
- }
136
- function rgbTo256({ r, g, b }) {
137
- const level = (value) => {
138
- if (value < 48)
139
- return 0;
140
- if (value < 115)
141
- return 1;
142
- return Math.min(5, Math.round((value - 35) / 40));
143
- };
144
- const cubeIndex = 16 + 36 * level(r) + 6 * level(g) + level(b);
145
- const cubeValue = (step) => step === 0 ? 0 : 55 + step * 40;
146
- const cube = { r: cubeValue(level(r)), g: cubeValue(level(g)), b: cubeValue(level(b)) };
147
- const greyAverage = (r + g + b) / 3;
148
- const greyStep = Math.max(0, Math.min(23, Math.round((greyAverage - 8) / 10)));
149
- const greyValue = 8 + greyStep * 10;
150
- const grey = { r: greyValue, g: greyValue, b: greyValue };
151
- return distance({ r, g, b }, grey) < distance({ r, g, b }, cube) ? 232 + greyStep : cubeIndex;
152
- }
153
- function distance(a, b) {
154
- return (a.r - b.r) ** 2 + (a.g - b.g) ** 2 + (a.b - b.b) ** 2;
155
- }
156
- function colorCode(value, depth) {
157
- if (depth === "none")
158
- return "";
159
- const parsed = parseColor(value);
160
- if (parsed === undefined)
161
- return "";
162
- if (typeof parsed === "number")
163
- return parsed < 8 ? `\x1B[${30 + parsed}m` : `\x1B[${90 + parsed - 8}m`;
164
- return depth === "truecolor" ? `\x1B[38;2;${parsed.r};${parsed.g};${parsed.b}m` : `\x1B[38;5;${rgbTo256(parsed)}m`;
165
- }
166
- var DEFAULT_TOKENS = {
167
- primary: "cyan",
168
- secondary: "blue",
169
- accent: "yellow",
170
- bg: "black",
171
- surface: "black",
172
- text: "white",
173
- textMuted: "brightBlack",
174
- success: "green",
175
- warning: "yellow",
176
- error: "red",
177
- border: "round",
178
- borderColor: "brightBlack",
179
- borderFocus: "cyan"
180
- };
181
- var TOKEN_NAMES = {
182
- primary: "primary",
183
- secondary: "secondary",
184
- accent: "accent",
185
- bg: "bg",
186
- background: "bg",
187
- surface: "surface",
188
- text: "text",
189
- fg: "text",
190
- "text-muted": "textMuted",
191
- muted: "textMuted",
192
- success: "success",
193
- warning: "warning",
194
- error: "error",
195
- border: "border",
196
- "border-color": "borderColor",
197
- "border-focus": "borderFocus",
198
- highlight: "secondary"
199
- };
200
- function parseThemeSource(source) {
201
- const themes = [];
202
- const withoutLineComments = source.replace(/(^|\s)\/\/[^\n]*/g, "$1");
203
- const blockPattern = /(?:\/\*([\s\S]*?)\*\/\s*)?@theme\s+([A-Za-z0-9_-]+)\s*\{([^}]*)\}/g;
204
- for (const match of withoutLineComments.matchAll(blockPattern)) {
205
- const description = (match[1] ?? "").replace(/\s+/g, " ").trim();
206
- const tokens = { ...DEFAULT_TOKENS };
207
- for (const declaration of match[3].matchAll(/(?:--|\$)([a-z0-9-]+)\s*:\s*([^;}]+)[;]?/gi)) {
208
- const key = TOKEN_NAMES[declaration[1].toLowerCase()];
209
- if (key)
210
- tokens[key] = declaration[2].trim();
211
- }
212
- themes.push({ name: match[2], description, tokens });
213
- }
214
- return themes;
215
- }
216
- function builtinThemes() {
217
- return Object.values(BUILTIN_THEME_SOURCES).flatMap((source) => parseThemeSource(source));
218
- }
219
- function findBuiltinTheme(name) {
220
- return builtinThemes().find((theme) => theme.name.toLowerCase() === name.trim().toLowerCase());
221
- }
222
- function borderStyleOf(value) {
223
- const text = value.trim().toLowerCase();
224
- return text === "single" || text === "double" || text === "none" ? text : "round";
225
- }
226
- function buildPalette(theme, depth) {
227
- const code = (value) => colorCode(value, depth);
228
- return {
229
- theme: theme.name,
230
- depth,
231
- primary: code(theme.tokens.primary),
232
- secondary: code(theme.tokens.secondary),
233
- accent: code(theme.tokens.accent),
234
- text: code(theme.tokens.text),
235
- muted: code(theme.tokens.textMuted),
236
- success: code(theme.tokens.success),
237
- warning: code(theme.tokens.warning),
238
- error: code(theme.tokens.error),
239
- border: code(theme.tokens.borderColor),
240
- borderFocus: code(theme.tokens.borderFocus),
241
- borderStyle: borderStyleOf(theme.tokens.border),
242
- bg: theme.tokens.bg,
243
- surface: theme.tokens.surface,
244
- tokens: theme.tokens
245
- };
246
- }
247
- var NO_COLOR_PALETTE = buildPalette(findBuiltinTheme(DEFAULT_THEME_NAME) ?? { name: DEFAULT_THEME_NAME, description: "", tokens: DEFAULT_TOKENS }, "none");
248
-
249
- export { BUILTIN_THEME_SOURCES, rgbTo256, parseThemeSource, NO_COLOR_PALETTE };