@illuminis/comprism 0.1.4 → 0.1.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 (116) hide show
  1. package/out/agent/command.js +5 -5
  2. package/out/agent/render.d.ts +39 -6
  3. package/out/agent/render.js +287 -28
  4. package/out/agent/session.d.ts +21 -1
  5. package/out/agent/session.js +81 -17
  6. package/out/commands/agents.js +3 -3
  7. package/out/commands/ask.js +20 -11
  8. package/out/commands/codemap.d.ts +1 -1
  9. package/out/commands/codemap.js +3 -3
  10. package/out/commands/commands-thin.js +4 -4
  11. package/out/commands/config.js +1 -1
  12. package/out/commands/cost.js +4 -4
  13. package/out/commands/hooks.js +1 -1
  14. package/out/commands/install.d.ts +1 -1
  15. package/out/commands/install.js +3 -2
  16. package/out/commands/instructions.js +1 -1
  17. package/out/commands/integrations.js +4 -4
  18. package/out/commands/keys.js +6 -6
  19. package/out/commands/login.js +97 -27
  20. package/out/commands/permissions.js +2 -2
  21. package/out/commands/plugins.js +3 -3
  22. package/out/commands/privacy.js +2 -2
  23. package/out/commands/repl.d.ts +4 -0
  24. package/out/commands/repl.js +563 -101
  25. package/out/commands/review.js +6 -6
  26. package/out/commands/settings.js +30 -123
  27. package/out/commands/skills.js +2 -2
  28. package/out/commands/unattended.js +6 -6
  29. package/out/commands/update.js +1 -1
  30. package/out/commands/welcome.d.ts +25 -1
  31. package/out/commands/welcome.js +65 -38
  32. package/out/commands/worktrees.d.ts +1 -1
  33. package/out/graph/sync.d.ts +1 -1
  34. package/out/graph/sync.js +6 -6
  35. package/out/lib/attach.js +4 -3
  36. package/out/lib/commandlist.d.ts +1 -1
  37. package/out/lib/commandlist.js +2 -2
  38. package/out/lib/config.d.ts +3 -2
  39. package/out/lib/config.js +7 -8
  40. package/out/lib/connection.js +1 -1
  41. package/out/lib/gateway.d.ts +9 -5
  42. package/out/lib/keyboard.d.ts +3 -0
  43. package/out/lib/keyboard.js +7 -0
  44. package/out/lib/lastlogin.d.ts +14 -0
  45. package/out/lib/lastlogin.js +105 -0
  46. package/out/lib/machine.js +1 -1
  47. package/out/lib/picker.d.ts +1 -0
  48. package/out/lib/picker.js +158 -0
  49. package/out/lib/project-ops.d.ts +1 -1
  50. package/out/lib/project-ops.js +4 -4
  51. package/out/lib/prompt.d.ts +3 -0
  52. package/out/lib/prompt.js +21 -0
  53. package/out/lib/queue.js +1 -1
  54. package/out/lib/readiness.d.ts +3 -30
  55. package/out/lib/readiness.js +13 -82
  56. package/out/lib/servicecommand.d.ts +14 -0
  57. package/out/lib/servicecommand.js +74 -0
  58. package/out/lib/sessions.js +3 -3
  59. package/out/lib/startcache.d.ts +13 -0
  60. package/out/lib/startcache.js +78 -0
  61. package/out/lib/ui.d.ts +11 -0
  62. package/out/lib/ui.js +28 -0
  63. package/out/lib/voice.d.ts +36 -0
  64. package/out/lib/voice.js +137 -2
  65. package/out/lib/words.d.ts +20 -0
  66. package/out/lib/words.js +27 -0
  67. package/out/machine/codemap/build.d.ts +45 -0
  68. package/out/machine/codemap/build.js +91 -0
  69. package/out/machine/codemap/facts.d.ts +47 -0
  70. package/out/machine/codemap/facts.js +12 -0
  71. package/out/machine/codemap/files.d.ts +45 -0
  72. package/out/machine/codemap/files.js +207 -0
  73. package/out/machine/codemap/read-locales.d.ts +29 -0
  74. package/out/machine/codemap/read-locales.js +246 -0
  75. package/out/machine/codemap/read-python.d.ts +11 -0
  76. package/out/machine/codemap/read-python.js +116 -0
  77. package/out/machine/codemap/read-typescript.d.ts +16 -0
  78. package/out/machine/codemap/read-typescript.js +292 -0
  79. package/out/machine/executor/browser.d.ts +14 -0
  80. package/out/machine/executor/browser.js +270 -0
  81. package/out/machine/executor/diagnostics.d.ts +2 -0
  82. package/out/machine/executor/diagnostics.js +181 -0
  83. package/out/machine/executor/documents.d.ts +40 -0
  84. package/out/machine/executor/documents.js +170 -0
  85. package/out/machine/executor/files.d.ts +2 -0
  86. package/out/machine/executor/files.js +590 -0
  87. package/out/machine/executor/git.d.ts +48 -0
  88. package/out/machine/executor/git.js +145 -0
  89. package/out/machine/executor/hooks.d.ts +51 -0
  90. package/out/machine/executor/hooks.js +154 -0
  91. package/out/machine/executor/index.d.ts +45 -0
  92. package/out/machine/executor/index.js +367 -0
  93. package/out/machine/executor/notebook.d.ts +2 -0
  94. package/out/machine/executor/notebook.js +147 -0
  95. package/out/machine/executor/paths.d.ts +20 -0
  96. package/out/machine/executor/paths.js +154 -0
  97. package/out/machine/executor/sandbox.d.ts +40 -0
  98. package/out/machine/executor/sandbox.js +299 -0
  99. package/out/machine/executor/shell.d.ts +86 -0
  100. package/out/machine/executor/shell.js +582 -0
  101. package/out/machine/executor/toolservers.d.ts +20 -0
  102. package/out/machine/executor/toolservers.js +189 -0
  103. package/out/machine/executor/worktree.d.ts +9 -0
  104. package/out/machine/executor/worktree.js +119 -0
  105. package/out/machine/folder/project.d.ts +28 -0
  106. package/out/machine/folder/project.js +114 -0
  107. package/out/machine/runtime/home.d.ts +2 -0
  108. package/out/machine/runtime/home.js +48 -0
  109. package/out/machine/runtime/needs.d.ts +30 -0
  110. package/out/machine/runtime/needs.js +89 -0
  111. package/out/machine/runtime/self.d.ts +23 -0
  112. package/out/machine/runtime/self.js +124 -0
  113. package/out/native/dictate +0 -0
  114. package/out/providers/index.js +2 -1
  115. package/out/thin.js +13 -12
  116. package/package.json +5 -4
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.TerminalSession = void 0;
36
+ exports.TerminalSession = exports.waitingNextSteps = void 0;
37
37
  /**
38
38
  * A coding job, run from a terminal.
39
39
  *
@@ -63,12 +63,15 @@ const gateway_1 = require("../lib/gateway");
63
63
  const fs = __importStar(require("fs"));
64
64
  const path = __importStar(require("path"));
65
65
  const readline = __importStar(require("readline"));
66
- const executor_1 = require("../executor");
67
- const project_1 = require("../lib/project");
66
+ const executor_1 = require("../machine/executor");
67
+ const project_1 = require("../machine/folder/project");
68
68
  const ui = __importStar(require("./render"));
69
69
  const jobs_1 = require("../commands/jobs");
70
70
  /** The actions that change a file, whose change is shown as it is made. */
71
71
  const CHANGES = new Set(["edit_file", "multi_edit", "write_file"]);
72
+ /** How many next steps the last job offered (web manual 13.4), so a bare number
73
+ * typed next is sent to the service to run one rather than to the agent. */
74
+ exports.waitingNextSteps = 0;
72
75
  /** Files with changes in Git as the job starts: the person's, not the agent's. */
73
76
  function dirtyFiles(root) {
74
77
  try {
@@ -97,9 +100,19 @@ class TerminalSession {
97
100
  * with nothing between the copies. */
98
101
  lastSaid = "";
99
102
  canceled = false;
103
+ /** The live "thinking 12s" line while the model works on a step. Drawn in
104
+ * place and erased before anything else prints, so it never lands in the
105
+ * answer. Without it a step is a blank screen for as long as the model takes,
106
+ * and "thinking" and "hung" look identical. */
107
+ working = null;
108
+ /** When the current wait began, kept across the line being redrawn. Cleared
109
+ * when a step finishes, so the next step counts from its own start. */
110
+ workFrom = null;
111
+ write;
100
112
  constructor(opts, write = (s) => process.stdout.write(s)) {
101
113
  this.opts = opts;
102
- this.out = write;
114
+ this.write = write;
115
+ this.out = (s) => { this.stopWorking(); write(s); };
103
116
  this.executor = new executor_1.NativeExecutor({
104
117
  root: opts.root,
105
118
  added: opts.project?.added ?? [],
@@ -148,7 +161,7 @@ class TerminalSession {
148
161
  // A real refusal, in the service's own words: a plan that does not
149
162
  // include coding and an allowance that has been spent have different
150
163
  // fixes, and a caller told only "refused" looks in the wrong place.
151
- this.refusal = reply.message || "your workspace could not be reached";
164
+ this.refusal = reply.message || "your organization could not be reached";
152
165
  // The reason word, for the exit number (Appendix B): the service's own
153
166
  // when it answered, else what the missing answer means.
154
167
  this.refusalReason = reply.reason
@@ -303,7 +316,7 @@ class TerminalSession {
303
316
  // long pause for a feature they did not ask for, to save money on a
304
317
  // job they have not started. So the job runs now, reading files the
305
318
  // ordinary way, and the second job in this project has the map.
306
- this.out(ui.dim(" reading a map of this project in the background;"
319
+ this.out(ui.dim(" reading a map of this workspace in the background;"
307
320
  + " your next job here will use it\n"));
308
321
  void refresh(this.opts.root, this.project()).catch(() => undefined);
309
322
  }
@@ -335,6 +348,13 @@ class TerminalSession {
335
348
  request += selectionText(await this.editor.context());
336
349
  }
337
350
  }
351
+ // Working from the moment the request leaves, not from the moment the
352
+ // model starts. The pass, the stream and the service's own preparation
353
+ // take several seconds before the first step, and a blank screen for that
354
+ // long reads as nothing happening. The service's words replace this as
355
+ // soon as its first step starts.
356
+ this.workFrom = null;
357
+ this.startWorking("thinking");
338
358
  const granted = await this.pass(request);
339
359
  if (this.olderWorkspace) {
340
360
  // Straight on to the stream with the credential, silently. A person does
@@ -551,7 +571,7 @@ class TerminalSession {
551
571
  if (frame.type === "event" && frame.kind === "sandbox") {
552
572
  // The service turned the sandbox on for this job: every command from
553
573
  // here runs inside it, with its allowed addresses (manual 4.12).
554
- const { Sandbox } = await Promise.resolve().then(() => __importStar(require("../executor/sandbox")));
574
+ const { Sandbox } = await Promise.resolve().then(() => __importStar(require("../machine/executor/sandbox")));
555
575
  const system = this.sandboxSystem();
556
576
  if (system) {
557
577
  const box = new Sandbox(system, this.opts.root, this.opts.project?.added ?? []);
@@ -621,6 +641,10 @@ class TerminalSession {
621
641
  // The sentence the server wrote. Everything a reader is told about
622
642
  // cost and saving comes from here.
623
643
  result.receipt = String(frame.receipt ?? "");
644
+ result.card = frame.card ?? null;
645
+ result.nextSteps = Array.isArray(frame.next_steps_lines)
646
+ ? frame.next_steps_lines.map(String) : [];
647
+ exports.waitingNextSteps = Array.isArray(frame.next_steps) ? frame.next_steps.length : 0;
624
648
  result.reusedPct = ui.reusePct(0, frame.cached_tokens, Math.max(0, Number(frame.context_tokens ?? 0) - Number(frame.cached_tokens ?? 0)));
625
649
  result.text = String(frame.text ?? "");
626
650
  result.why = this.lastWhy;
@@ -678,13 +702,14 @@ class TerminalSession {
678
702
  // is the live connection that carries the work, and the wording names
679
703
  // that instead.
680
704
  if (!ready && first) {
681
- reject(new Error("The live connection to your workspace could not be opened. "
705
+ reject(new Error("The live connection to your organization could not be opened. "
682
706
  + "You are signed in; the work stream is what failed."));
683
707
  }
684
708
  };
685
709
  socket.onclose = () => {
686
710
  if (socket !== this.socket)
687
711
  return;
712
+ this.stopWorking();
688
713
  if (finished || this.canceled || !this.jobId) {
689
714
  // One job on its own is its session, so what it started ends with it
690
715
  // and is listed (manual 5.13). Inside a session they carry on.
@@ -852,7 +877,7 @@ class TerminalSession {
852
877
  sandboxSystem() {
853
878
  if (this.sandboxChecked === undefined) {
854
879
  // eslint-disable-next-line @typescript-eslint/no-var-requires
855
- const { availability } = require("../executor/sandbox");
880
+ const { availability } = require("../machine/executor/sandbox");
856
881
  this.sandboxChecked = availability().system;
857
882
  }
858
883
  return (this.sandboxChecked ?? null);
@@ -882,8 +907,35 @@ class TerminalSession {
882
907
  : v);
883
908
  return JSON.stringify([name, sorted(input), folder]);
884
909
  }
910
+ /** Starts the working line with the service's own words. Only on a real
911
+ * terminal: a piped or unattended run gets the answer and nothing else. */
912
+ startWorking(line) {
913
+ this.stopWorking();
914
+ if (!line || this.opts.headless || !process.stdout.isTTY)
915
+ return;
916
+ // One count for one wait: the service's words taking over from the
917
+ // request's own do not start the clock again.
918
+ const started = this.workFrom ??= Date.now();
919
+ const draw = () => this.write(`\r\x1b[2K ${ui.dim(`${line} ${ui.duration(Date.now() - started)}`)}`);
920
+ draw();
921
+ const timer = setInterval(draw, 1000);
922
+ timer.unref?.();
923
+ this.working = { timer };
924
+ }
925
+ stopWorking() {
926
+ if (!this.working)
927
+ return;
928
+ clearInterval(this.working.timer);
929
+ this.working = null;
930
+ this.write("\r\x1b[2K");
931
+ }
885
932
  narrate(frame) {
886
933
  switch (frame.kind) {
934
+ // The model is working on a step. Shown at once, so the wait is visibly
935
+ // work (the web app draws the same moment as its "thinking" row).
936
+ case "step_started":
937
+ this.startWorking(String(frame.line ?? ""));
938
+ break;
887
939
  // Helpers, in the service's words (manual 5.23, 5.25).
888
940
  case "helper_started":
889
941
  this.helpers.set(String(frame.id), {
@@ -927,6 +979,8 @@ class TerminalSession {
927
979
  if (this.allowanceLine)
928
980
  this.out(this.allowanceLine);
929
981
  this.allowanceLine = "";
982
+ // Still working: the first step has not started yet.
983
+ this.startWorking("thinking");
930
984
  break;
931
985
  // Planning and plan approval, in the service's words (manual 4.1, 4.2).
932
986
  case "planning":
@@ -940,6 +994,7 @@ class TerminalSession {
940
994
  this.out(ui.dim(` ${String(frame.reason ?? "")}\n`));
941
995
  break;
942
996
  case "step_finished": {
997
+ this.workFrom = null;
943
998
  this.out(ui.step(Number(frame.index ?? 0), String(frame.model ?? ""), frame.usd, frame.latency_ms, ui.reusePct(frame.tokens_in, frame.cache_read_tokens, frame.cache_write_tokens), String(frame.reason ?? "")) + "\n");
944
999
  if (Array.isArray(frame.why_lines))
945
1000
  this.lastWhy = frame.why_lines;
@@ -947,8 +1002,8 @@ class TerminalSession {
947
1002
  // Markdown is for a browser. A terminal shows the asterisks.
948
1003
  if (said) {
949
1004
  // The plan is titled so it reads as the plan (manual 4.1).
950
- const plain = ui.plain(said).replace(/^\s*plan\s*\n/i, "");
951
- this.out(frame.plan ? ` ${ui.bold("Plan")}\n${plain}\n` : `\n${ui.plain(said)}\n`);
1005
+ const plan = ui.plain(said.replace(/^\s*(#+\s*)?\**plan\**:?\s*\n/i, ""));
1006
+ this.out(frame.plan ? ` ${ui.bold("Plan")}\n${plan}\n` : `\n${ui.plain(said)}\n`);
952
1007
  this.lastSaid = said;
953
1008
  }
954
1009
  break;
@@ -994,10 +1049,16 @@ class TerminalSession {
994
1049
  case "document_made": {
995
1050
  const saved = frame.saved_to ? String(frame.saved_to) : "";
996
1051
  const bytes = Number(frame.bytes ?? 0).toLocaleString();
997
- this.out(saved
998
- ? ui.green(` saved ${saved}`) + ui.dim(` ${bytes} bytes\n`)
999
- : ui.yellow(` made ${String(frame.filename ?? "a file")}`)
1000
- + ui.dim(` ${bytes} bytes, not saved here\n`));
1052
+ const name = String(frame.filename ?? "a file");
1053
+ if (saved) {
1054
+ this.out(ui.savedFile(saved, path.resolve(this.opts.root, saved), bytes));
1055
+ }
1056
+ else {
1057
+ // Not written here, so the stored copy is the only way to it.
1058
+ const url = frame.url ? String(frame.url) : "";
1059
+ this.out(ui.yellow(` made `) + (url ? ui.link(name, url) : name)
1060
+ + ui.dim(` ${bytes} bytes, not saved here${url ? ", click to download" : ""}\n`));
1061
+ }
1001
1062
  break;
1002
1063
  }
1003
1064
  case "compacting":
@@ -1141,14 +1202,17 @@ class TerminalSession {
1141
1202
  this.out(ui.ending(r.ending.line, r.detail));
1142
1203
  for (const line of r.ending.proof)
1143
1204
  this.out(ui.dim(` ${line}\n`));
1144
- this.out(ui.receipt(r.receipt, r.models));
1205
+ this.out(ui.receipt(r.receipt, r.models, undefined, r.card));
1145
1206
  }
1146
1207
  else {
1147
1208
  this.out(ui.outcome(r.outcome, r.detail));
1148
1209
  for (const line of r.ending?.proof ?? [])
1149
1210
  this.out(ui.dim(` ${line}\n`));
1150
- this.out(ui.receipt(r.receipt, r.models, r.ending ? undefined : r.testsPassed));
1211
+ this.out(ui.receipt(r.receipt, r.models, r.ending ? undefined : r.testsPassed, r.card));
1151
1212
  }
1213
+ // What would finish the request, worded by the service (web manual 13.4).
1214
+ for (const line of r.nextSteps ?? [])
1215
+ this.out(`${line}\n`);
1152
1216
  if (r.jobId) {
1153
1217
  // The job's own reference, so a person can quote it. The link to the
1154
1218
  // account sits in the receipt above, where the server put it.
@@ -41,8 +41,8 @@ exports.cmdAgents = cmdAgents;
41
41
  * wins a clash and what each line says; this reads the files it names, inside
42
42
  * the project and through the executor's own checks, and prints its lines.
43
43
  */
44
- const files_1 = require("../executor/files");
45
- const project_1 = require("../lib/project");
44
+ const files_1 = require("../machine/executor/files");
45
+ const project_1 = require("../machine/folder/project");
46
46
  const gateway_1 = require("../lib/gateway");
47
47
  const ui = __importStar(require("../lib/ui"));
48
48
  const ROUNDS = 6;
@@ -54,7 +54,7 @@ async function helperLines(folder) {
54
54
  const reply = await (0, gateway_1.ask)({ intent: "agents", prompt: "", agentsPayload: { round, files, listings, project: root } });
55
55
  const body = reply.agents;
56
56
  if (!reply.ok || reply.served === false || !body) {
57
- return [ui.fail(reply.message || "The helper list could not be read from your workspace.")];
57
+ return [ui.fail(reply.message || "The helper list could not be read from your organization.")];
58
58
  }
59
59
  if (!body.wants)
60
60
  return body.lines;
@@ -48,8 +48,8 @@ exports.cmdAsk = cmdAsk;
48
48
  */
49
49
  const gateway_1 = require("../lib/gateway");
50
50
  const connection_1 = require("../lib/connection");
51
- const config_1 = require("../lib/config");
52
51
  const ui = __importStar(require("../lib/ui"));
52
+ const render_1 = require("../agent/render");
53
53
  const prompt_1 = require("../lib/prompt");
54
54
  const output_1 = require("../lib/output");
55
55
  const stdout = (s = '') => process.stdout.write(s + '\n');
@@ -86,12 +86,13 @@ async function cmdAsk(args) {
86
86
  // remember what they set last week is asking them to take the figure on
87
87
  // trust. Shown every time, so the number that comes back is never a surprise.
88
88
  const flagged = args.indexOf('--model');
89
- const comparedTo = (flagged >= 0 ? args[flagged + 1] : undefined)
90
- || (0, config_1.loadConfig)().defaultModel
91
- || 'claude-sonnet-5';
92
- out(ui.c.dim(` comparing against ${ui.c.bold(comparedTo)}`)
93
- + ui.c.dim(' change it with `comprism model`'));
94
- out();
89
+ // Named on the line, or else the person's own comparison model, which the
90
+ // service fills in and names in its reply (service catalog 14).
91
+ const comparedTo = flagged >= 0 ? args[flagged + 1] : undefined;
92
+ if (comparedTo) {
93
+ out(ui.c.dim(` comparing against ${ui.c.bold(comparedTo)}`));
94
+ out();
95
+ }
95
96
  // Either way round: on the line for somebody who knows what they want, or
96
97
  // asked for when they simply typed the command.
97
98
  // Text piped in is read to its end first and attached as `standard input`:
@@ -177,10 +178,18 @@ async function cmdAsk(args) {
177
178
  return 0;
178
179
  }
179
180
  out();
180
- // The answer itself always reaches standard output (manual 10.2).
181
- stdout(toErr ? reply.answer.trim() : reply.answer.trim());
181
+ // The answer itself always reaches standard output (manual 10.2). On a
182
+ // screen it is laid out for reading (manual 6.17); piped, it stays exactly
183
+ // as the model wrote it, for the program reading it.
184
+ const answer = reply.answer.trim();
185
+ stdout(process.stdout.isTTY ? (0, render_1.plain)(answer) : answer);
182
186
  out();
183
- if (reply.receipt) {
187
+ if (reply.card) {
188
+ // The server's card, drawn as the approved look draws it.
189
+ out((0, render_1.receipt)(reply.receipt ?? '', [], undefined, reply.card).trimEnd());
190
+ out();
191
+ }
192
+ else if (reply.receipt) {
184
193
  out(ui.c.dim(' ' + reply.receipt.split('\n').join('\n ')));
185
194
  out();
186
195
  }
@@ -193,7 +202,7 @@ async function cmdAsk(args) {
193
202
  const verb = saved !== null && saved !== undefined && saved < 0 ? 'more' : 'less';
194
203
  const amount = money(Math.abs(saved ?? 0));
195
204
  out(` ran on ${ui.c.bold(ran)} ${ours} to finish`);
196
- out(` ${ui.c.dim(`on ${callingModel} it would have been ${theirs}, so ${amount} ${verb}`)}`);
205
+ out(` ${ui.c.dim(`on ${reply.decision.would_have_used || callingModel} it would have been ${theirs}, so ${amount} ${verb}`)}`);
197
206
  }
198
207
  else {
199
208
  out(` ran on ${ui.c.bold(ran)}`);
@@ -1,2 +1,2 @@
1
- export declare const MAP_HELP = "\n comprism map what the map of this project holds\n comprism map refresh read every file again, now\n comprism map forget remove this project's map from the service\n comprism map off ask your administrator to switch it off\n\n The map is a record of what your project is made of: its functions, screens,\n endpoints and tables, and what connects to what. It is read on this machine\n and only its structure is sent. Your source code never leaves here.\n\n It is kept current by itself. Every job checks the files first and reads back\n whatever moved, so you should not normally need any of this.\n";
1
+ export declare const MAP_HELP = "\n comprism map what the map of this workspace holds\n comprism map refresh read every file again, now\n comprism map forget remove this workspace's map from the service\n comprism map off ask your administrator to switch it off\n\n The map is a record of what your workspace is made of: its functions, screens,\n endpoints and tables, and what connects to what. It is read on this machine\n and only its structure is sent. Your source code never leaves here.\n\n It is kept current by itself. Every job checks the files first and reads back\n whatever moved, so you should not normally need any of this.\n";
2
2
  export declare function cmdMap(args: string[]): Promise<number>;
@@ -55,12 +55,12 @@ const sync_1 = require("../graph/sync");
55
55
  const settings_1 = require("./settings");
56
56
  const out = (s = "") => process.stdout.write(`${s}\n`);
57
57
  exports.MAP_HELP = `
58
- comprism map what the map of this project holds
58
+ comprism map what the map of this workspace holds
59
59
  comprism map refresh read every file again, now
60
- comprism map forget remove this project's map from the service
60
+ comprism map forget remove this workspace's map from the service
61
61
  comprism map off ask your administrator to switch it off
62
62
 
63
- The map is a record of what your project is made of: its functions, screens,
63
+ The map is a record of what your workspace is made of: its functions, screens,
64
64
  endpoints and tables, and what connects to what. It is read on this machine
65
65
  and only its structure is sent. Your source code never leaves here.
66
66
 
@@ -178,14 +178,14 @@ async function cmdStatus() {
178
178
  process.exitCode = 3;
179
179
  }
180
180
  else if (reply.httpStatus) {
181
- out(ui.fail('The workspace could not confirm this account.'));
181
+ out(ui.fail('The organization could not confirm this account.'));
182
182
  out(` ${ui.c.dim(reply.message || 'the service refused the request')}`);
183
183
  process.exitCode = 1;
184
184
  }
185
185
  else {
186
186
  // Only what this machine knows, and said to be only that (manual 1.4).
187
187
  out(ui.fail(`This machine is pointed at ${ui.c.bold(c.url)}, which did not answer.`));
188
- out(` ${ui.c.dim(reply.message || 'no answer from the workspace')}`);
188
+ out(` ${ui.c.dim(reply.message || 'no answer from the organization')}`);
189
189
  out(` ${ui.c.dim('on this machine only:')} ${machineLine(c)}`);
190
190
  process.exitCode = 6;
191
191
  }
@@ -194,12 +194,12 @@ async function cmdStatus() {
194
194
  }
195
195
  if (reply.served === false) {
196
196
  out(ui.warn(`${ui.c.bold(c.url)} answered, but is running a build that cannot report a session.`));
197
- out(ui.c.dim(reply.message || 'Ask your workspace administrator to update the service.'));
197
+ out(ui.c.dim(reply.message || 'Ask your organization administrator to update the service.'));
198
198
  process.exitCode = 1;
199
199
  return;
200
200
  }
201
201
  if (reply.granted === false || !me?.signed_in) {
202
- out(ui.fail(reply.message || 'The workspace did not confirm a signed in account.'));
202
+ out(ui.fail(reply.message || 'The organization did not confirm a signed in account.'));
203
203
  out(' Run comprism login to sign in.');
204
204
  process.exitCode = 3;
205
205
  return;
@@ -67,7 +67,7 @@ async function service(op, payload) {
67
67
  const out = (s = '') => process.stdout.write(s + '\n');
68
68
  function notHere(key) {
69
69
  out(ui.fail(`\`${key}\` is not a setting for this machine, so nothing was changed.`));
70
- out(ui.c.dim(` This machine keeps: ${Object.keys(machine_1.MACHINE_KEYS).join(', ')}. Project and personal settings are kept by the service (manual 2.10).`));
70
+ out(ui.c.dim(` This machine keeps: ${Object.keys(machine_1.MACHINE_KEYS).join(', ')}. Workspace and personal settings are kept by the service (manual 2.10).`));
71
71
  out();
72
72
  return 1;
73
73
  }
@@ -87,7 +87,7 @@ async function cmdCost(args) {
87
87
  // would tell somebody their work cost nothing.
88
88
  if (reply.served === false) {
89
89
  out();
90
- out(ui.warn('This workspace is running a build that cannot answer this yet.'));
90
+ out(ui.warn('This organization is running a build that cannot answer this yet.'));
91
91
  out(` ${ui.c.dim(reply.message || '')}`);
92
92
  out();
93
93
  return 1;
@@ -95,7 +95,7 @@ async function cmdCost(args) {
95
95
  const report = reply.spend;
96
96
  if (!report || !report.session) {
97
97
  out();
98
- out(ui.info(reply.message || 'No work has been recorded in this workspace yet.'));
98
+ out(ui.info(reply.message || 'No work has been recorded in this organization yet.'));
99
99
  out();
100
100
  return 0;
101
101
  }
@@ -105,8 +105,8 @@ async function cmdCost(args) {
105
105
  const p = report.presentation;
106
106
  if (!p) {
107
107
  out();
108
- out(ui.warn('This workspace answered without the breakdown this version draws.'));
109
- out(` ${ui.c.dim('Deploy the workspace, or run `comprism status` to see which one you are on.')}`);
108
+ out(ui.warn('This organization answered without the breakdown this version draws.'));
109
+ out(` ${ui.c.dim('Deploy the organization, or run `comprism status` to see which one you are on.')}`);
110
110
  out();
111
111
  return 1;
112
112
  }
@@ -43,7 +43,7 @@ exports.cmdHooks = cmdHooks;
43
43
  */
44
44
  const ui = __importStar(require("../lib/ui"));
45
45
  const project_ops_1 = require("../lib/project-ops");
46
- const hooks_1 = require("../executor/hooks");
46
+ const hooks_1 = require("../machine/executor/hooks");
47
47
  const out = (s = "") => process.stdout.write(`${s}\n`);
48
48
  async function cmdHooks(args) {
49
49
  const facts = await (0, project_ops_1.currentProject)();
@@ -1,4 +1,4 @@
1
- import { type InstallMethod } from '../lib/self';
1
+ import { type InstallMethod } from '../machine/runtime/self';
2
2
  /** The header the tenant reads to decide whether this machine may be served. */
3
3
  export declare const WORKSPACE_KEY_HEADER = "x-comprism-key";
4
4
  export declare function envScriptPath(): string;
@@ -78,7 +78,8 @@ const node_path_1 = __importDefault(require("node:path"));
78
78
  const node_child_process_1 = require("node:child_process");
79
79
  const config_1 = require("../lib/config");
80
80
  const connection_1 = require("../lib/connection");
81
- const self_1 = require("../lib/self");
81
+ const self_1 = require("../machine/runtime/self");
82
+ const words_1 = require("../lib/words");
82
83
  /** The header the tenant reads to decide whether this machine may be served. */
83
84
  exports.WORKSPACE_KEY_HEADER = 'x-comprism-key';
84
85
  const MARKER_START = '# >>> comprism >>>';
@@ -391,7 +392,7 @@ async function probeDesktopConnector(binary) {
391
392
  catch (err) {
392
393
  resolve({
393
394
  ok: false,
394
- detail: err instanceof Error ? err.message : 'the connector could not be started',
395
+ detail: err instanceof Error ? err.message : (0, words_1.word)('connectorNotStarted'),
395
396
  });
396
397
  return;
397
398
  }
@@ -80,7 +80,7 @@ async function cmdInstructions(args) {
80
80
  const facts = await (0, project_ops_1.currentProject)();
81
81
  if (args[0] === "edit") {
82
82
  if (!args.includes("--personal")) {
83
- out(ui.fail("Project instructions are files in the project; edit them there. "
83
+ out(ui.fail("Workspace instructions are files in the workspace; edit them there. "
84
84
  + "For yours: comprism instructions edit --personal"));
85
85
  return 2;
86
86
  }
@@ -41,7 +41,7 @@ exports.projectSettings = projectSettings;
41
41
  * adding one by address or by command, signing in, its tools, removing one.
42
42
  *
43
43
  * The service decides every status, tool, rule and word. This sends the
44
- * project's settings file so the project's own connections are known, writes
44
+ * project's settings file so the workspace's own connections are known, writes
45
45
  * the key the service returns for a project connection, starts an approved
46
46
  * local tool server only long enough to count its tools, opens the browser
47
47
  * for a sign in and waits for it. No token ever reaches this machine.
@@ -49,10 +49,10 @@ exports.projectSettings = projectSettings;
49
49
  const child_process_1 = require("child_process");
50
50
  const fs = __importStar(require("fs"));
51
51
  const path = __importStar(require("path"));
52
- const toolservers_1 = require("../executor/toolservers");
52
+ const toolservers_1 = require("../machine/executor/toolservers");
53
53
  const gateway_1 = require("../lib/gateway");
54
54
  const project_ops_1 = require("../lib/project-ops");
55
- const project_1 = require("../lib/project");
55
+ const project_1 = require("../machine/folder/project");
56
56
  const ui = __importStar(require("../lib/ui"));
57
57
  const SETTINGS = ".completionprism/settings.json";
58
58
  const out = (s = "") => process.stdout.write(`${s}\n`);
@@ -77,7 +77,7 @@ async function call(root, payload) {
77
77
  body = reply.integrations;
78
78
  }
79
79
  if (!reply.ok || reply.served === false || !body) {
80
- out(` ${ui.fail(reply.message || "Your connections could not be read from your workspace.")}`);
80
+ out(` ${ui.fail(reply.message || "Your connections could not be read from your organization.")}`);
81
81
  return null;
82
82
  }
83
83
  if (body.error) {
@@ -104,17 +104,17 @@ async function keyState() {
104
104
  // then this client's placeholder, and reading an empty `providers` as "no
105
105
  // keys" is precisely the fault above.
106
106
  if (!reply.ok)
107
- return { reached: false, why: reply.message || 'the workspace could not be reached' };
107
+ return { reached: false, why: reply.message || 'the organization could not be reached' };
108
108
  // An older workspace that does not serve this question has also not told us
109
109
  // there are no keys. It has told us it cannot answer.
110
110
  if (reply.served === false)
111
- return { reached: false, why: reply.message || 'this workspace is running an older build' };
111
+ return { reached: false, why: reply.message || 'this organization is running an older build' };
112
112
  // The workspace answered but could not establish part of what it answered.
113
113
  // An empty vendor list here is a list we failed to obtain, not a list of
114
114
  // nothing, and drawing it as "you have no keys" is the original fault with
115
115
  // one more layer in front of it.
116
116
  if (reply.complete === false)
117
- return { reached: false, why: reply.message || 'your workspace could not check its vendor keys' };
117
+ return { reached: false, why: reply.message || 'your organization could not check its vendor keys' };
118
118
  return { reached: true, hasKey: reply.providers.some((p) => p.has_key) };
119
119
  }
120
120
  /**
@@ -182,15 +182,15 @@ async function show() {
182
182
  if (!reply.ok || reply.served === false || reply.complete === false) {
183
183
  // NOT "you have no keys". We did not get an answer, so nothing is known
184
184
  // about this account, and saying otherwise is the 17 September fault.
185
- out(ui.fail('Your workspace could not be reached, so nothing is known about your keys.'));
186
- out(` ${ui.c.dim(reply.message || reply.decision.rationale || 'no answer from the workspace')}`);
185
+ out(ui.fail('Your organization could not be reached, so nothing is known about your keys.'));
186
+ out(` ${ui.c.dim(reply.message || reply.decision.rationale || 'no answer from the organization')}`);
187
187
  out();
188
188
  return { reached: false, stored: 0, total: 0 };
189
189
  }
190
190
  if (reply.providers.length === 0) {
191
191
  // A workspace with no vendors at all is not a workspace that told us it
192
192
  // holds no keys. Treated as unreachable so no caller offers to take one.
193
- out(ui.fail('Your workspace returned no vendors, so nothing is known about your keys.'));
193
+ out(ui.fail('Your organization returned no vendors, so nothing is known about your keys.'));
194
194
  out(` ${ui.c.dim(reply.message || 'the vendor list came back empty')}`);
195
195
  out();
196
196
  return { reached: false, stored: 0, total: 0 };