@illuminis/comprism 0.1.8 → 2.4.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 (225) hide show
  1. package/out/{graph → build/machine/codemap}/read-python.js +2 -2
  2. package/out/{executor → build/machine/executor}/diagnostics.js +1 -1
  3. package/out/{executor → build/machine/executor}/hooks.js +1 -1
  4. package/out/{executor → build/machine/executor}/sandbox.js +1 -1
  5. package/out/build/machine/line/index.js +339 -0
  6. package/out/{commands/privacy.js → build/machine/runtime/home.js} +10 -19
  7. package/out/build/machine/runtime/needs.js +89 -0
  8. package/out/{lib → build/machine/runtime}/self.js +25 -3
  9. package/out/build/machine/terminal/jobs.js +67 -0
  10. package/out/build/machine/terminal/sign-in.js +212 -0
  11. package/out/build/machine/terminal/steps.js +460 -0
  12. package/out/build/machine/terminal/voice.js +136 -0
  13. package/out/build/machine/voice/record.js +286 -0
  14. package/out/cli-start.js +130 -0
  15. package/out/machine/line/index.js +339 -0
  16. package/out/machine/runtime/self.js +22 -0
  17. package/out/machine/terminal/clipboard.js +182 -0
  18. package/out/machine/terminal/jobs.js +67 -0
  19. package/out/machine/terminal/sign-in.js +212 -0
  20. package/out/machine/terminal/steps.js +460 -0
  21. package/out/machine/terminal/voice.js +136 -0
  22. package/out/machine/voice/record.js +79 -1
  23. package/out/native/dictate +0 -0
  24. package/out/server.generated.js +6 -0
  25. package/package.json +8 -40
  26. package/README.md +0 -343
  27. package/out/agent/command.d.ts +0 -157
  28. package/out/agent/command.js +0 -454
  29. package/out/agent/render.d.ts +0 -169
  30. package/out/agent/render.js +0 -689
  31. package/out/agent/session.d.ts +0 -334
  32. package/out/agent/session.js +0 -1232
  33. package/out/commands/agents.d.ts +0 -2
  34. package/out/commands/agents.js +0 -79
  35. package/out/commands/ask.d.ts +0 -1
  36. package/out/commands/ask.js +0 -222
  37. package/out/commands/codemap.d.ts +0 -2
  38. package/out/commands/codemap.js +0 -151
  39. package/out/commands/commands-thin.d.ts +0 -39
  40. package/out/commands/commands-thin.js +0 -244
  41. package/out/commands/config.d.ts +0 -1
  42. package/out/commands/config.js +0 -138
  43. package/out/commands/cost.d.ts +0 -1
  44. package/out/commands/cost.js +0 -167
  45. package/out/commands/decisionEngine.d.ts +0 -1
  46. package/out/commands/decisionEngine.js +0 -66
  47. package/out/commands/hooks.d.ts +0 -1
  48. package/out/commands/hooks.js +0 -83
  49. package/out/commands/install.d.ts +0 -206
  50. package/out/commands/install.js +0 -738
  51. package/out/commands/instructions.d.ts +0 -1
  52. package/out/commands/instructions.js +0 -113
  53. package/out/commands/integrations.d.ts +0 -3
  54. package/out/commands/integrations.js +0 -215
  55. package/out/commands/jobs.d.ts +0 -5
  56. package/out/commands/jobs.js +0 -157
  57. package/out/commands/keys.d.ts +0 -55
  58. package/out/commands/keys.js +0 -344
  59. package/out/commands/login.d.ts +0 -9
  60. package/out/commands/login.js +0 -606
  61. package/out/commands/memory.d.ts +0 -3
  62. package/out/commands/memory.js +0 -113
  63. package/out/commands/permissions.d.ts +0 -1
  64. package/out/commands/permissions.js +0 -94
  65. package/out/commands/plugins.d.ts +0 -4
  66. package/out/commands/plugins.js +0 -192
  67. package/out/commands/privacy.d.ts +0 -1
  68. package/out/commands/providerKey.d.ts +0 -32
  69. package/out/commands/providerKey.js +0 -108
  70. package/out/commands/repl.d.ts +0 -12
  71. package/out/commands/repl.js +0 -2303
  72. package/out/commands/report.d.ts +0 -39
  73. package/out/commands/report.js +0 -115
  74. package/out/commands/review.d.ts +0 -5
  75. package/out/commands/review.js +0 -223
  76. package/out/commands/sessions.d.ts +0 -23
  77. package/out/commands/sessions.js +0 -115
  78. package/out/commands/settings.d.ts +0 -23
  79. package/out/commands/settings.js +0 -153
  80. package/out/commands/skills.d.ts +0 -21
  81. package/out/commands/skills.js +0 -207
  82. package/out/commands/unattended.d.ts +0 -7
  83. package/out/commands/unattended.js +0 -351
  84. package/out/commands/update.d.ts +0 -1
  85. package/out/commands/update.js +0 -123
  86. package/out/commands/welcome.d.ts +0 -25
  87. package/out/commands/welcome.js +0 -223
  88. package/out/commands/worktrees.d.ts +0 -5
  89. package/out/commands/worktrees.js +0 -186
  90. package/out/executor/browser.d.ts +0 -14
  91. package/out/executor/diagnostics.d.ts +0 -2
  92. package/out/executor/documents.d.ts +0 -40
  93. package/out/executor/files.d.ts +0 -2
  94. package/out/executor/git.d.ts +0 -48
  95. package/out/executor/hooks.d.ts +0 -51
  96. package/out/executor/index.d.ts +0 -45
  97. package/out/executor/notebook.d.ts +0 -2
  98. package/out/executor/paths.d.ts +0 -20
  99. package/out/executor/sandbox.d.ts +0 -40
  100. package/out/executor/shell.d.ts +0 -86
  101. package/out/executor/toolservers.d.ts +0 -20
  102. package/out/executor/worktree.d.ts +0 -9
  103. package/out/graph/build.d.ts +0 -45
  104. package/out/graph/facts.d.ts +0 -47
  105. package/out/graph/files.d.ts +0 -45
  106. package/out/graph/read-locales.d.ts +0 -29
  107. package/out/graph/read-python.d.ts +0 -11
  108. package/out/graph/read-typescript.d.ts +0 -16
  109. package/out/graph/sync.d.ts +0 -66
  110. package/out/graph/sync.js +0 -242
  111. package/out/lib/attach.d.ts +0 -106
  112. package/out/lib/attach.js +0 -396
  113. package/out/lib/clipboard.d.ts +0 -23
  114. package/out/lib/commandlist.d.ts +0 -20
  115. package/out/lib/commandlist.js +0 -58
  116. package/out/lib/config.d.ts +0 -94
  117. package/out/lib/config.js +0 -197
  118. package/out/lib/connection.d.ts +0 -73
  119. package/out/lib/connection.js +0 -188
  120. package/out/lib/decision.d.ts +0 -22
  121. package/out/lib/decision.js +0 -50
  122. package/out/lib/fingerprint.d.ts +0 -25
  123. package/out/lib/fingerprint.js +0 -58
  124. package/out/lib/gateway.d.ts +0 -427
  125. package/out/lib/gateway.js +0 -226
  126. package/out/lib/history.d.ts +0 -24
  127. package/out/lib/history.js +0 -137
  128. package/out/lib/ide.d.ts +0 -19
  129. package/out/lib/ide.js +0 -131
  130. package/out/lib/keyboard.d.ts +0 -98
  131. package/out/lib/keyboard.js +0 -390
  132. package/out/lib/lastlogin.d.ts +0 -14
  133. package/out/lib/lastlogin.js +0 -105
  134. package/out/lib/machine.d.ts +0 -21
  135. package/out/lib/machine.js +0 -91
  136. package/out/lib/notify.d.ts +0 -4
  137. package/out/lib/notify.js +0 -52
  138. package/out/lib/output.d.ts +0 -48
  139. package/out/lib/output.js +0 -108
  140. package/out/lib/picker.d.ts +0 -1
  141. package/out/lib/picker.js +0 -158
  142. package/out/lib/project-ops.d.ts +0 -19
  143. package/out/lib/project-ops.js +0 -146
  144. package/out/lib/project.d.ts +0 -28
  145. package/out/lib/prompt.d.ts +0 -37
  146. package/out/lib/prompt.js +0 -142
  147. package/out/lib/queue.d.ts +0 -13
  148. package/out/lib/queue.js +0 -116
  149. package/out/lib/readiness.d.ts +0 -22
  150. package/out/lib/readiness.js +0 -207
  151. package/out/lib/self.d.ts +0 -23
  152. package/out/lib/servicecommand.d.ts +0 -14
  153. package/out/lib/servicecommand.js +0 -74
  154. package/out/lib/sessions.d.ts +0 -19
  155. package/out/lib/sessions.js +0 -221
  156. package/out/lib/startcache.d.ts +0 -13
  157. package/out/lib/startcache.js +0 -78
  158. package/out/lib/stdin.d.ts +0 -32
  159. package/out/lib/stdin.js +0 -117
  160. package/out/lib/store.d.ts +0 -40
  161. package/out/lib/store.js +0 -138
  162. package/out/lib/sync.d.ts +0 -18
  163. package/out/lib/sync.js +0 -81
  164. package/out/lib/types.d.ts +0 -417
  165. package/out/lib/types.js +0 -21
  166. package/out/lib/ui.d.ts +0 -123
  167. package/out/lib/ui.js +0 -299
  168. package/out/lib/version.d.ts +0 -23
  169. package/out/lib/version.js +0 -46
  170. package/out/lib/voice.d.ts +0 -49
  171. package/out/lib/voice.js +0 -236
  172. package/out/lib/words.d.ts +0 -20
  173. package/out/lib/words.js +0 -27
  174. package/out/machine/codemap/build.d.ts +0 -45
  175. package/out/machine/codemap/facts.d.ts +0 -47
  176. package/out/machine/codemap/files.d.ts +0 -45
  177. package/out/machine/codemap/read-locales.d.ts +0 -29
  178. package/out/machine/codemap/read-python.d.ts +0 -11
  179. package/out/machine/codemap/read-typescript.d.ts +0 -16
  180. package/out/machine/executor/browser.d.ts +0 -14
  181. package/out/machine/executor/diagnostics.d.ts +0 -2
  182. package/out/machine/executor/documents.d.ts +0 -40
  183. package/out/machine/executor/files.d.ts +0 -2
  184. package/out/machine/executor/git.d.ts +0 -48
  185. package/out/machine/executor/hooks.d.ts +0 -51
  186. package/out/machine/executor/index.d.ts +0 -45
  187. package/out/machine/executor/notebook.d.ts +0 -2
  188. package/out/machine/executor/paths.d.ts +0 -20
  189. package/out/machine/executor/sandbox.d.ts +0 -40
  190. package/out/machine/executor/shell.d.ts +0 -86
  191. package/out/machine/executor/toolservers.d.ts +0 -20
  192. package/out/machine/executor/worktree.d.ts +0 -9
  193. package/out/machine/folder/project.d.ts +0 -28
  194. package/out/machine/runtime/home.d.ts +0 -2
  195. package/out/machine/runtime/needs.d.ts +0 -30
  196. package/out/machine/runtime/self.d.ts +0 -23
  197. package/out/machine/voice/record.d.ts +0 -38
  198. package/out/postinstall.d.ts +0 -2
  199. package/out/postinstall.js +0 -120
  200. package/out/providers/anthropic.d.ts +0 -22
  201. package/out/providers/anthropic.js +0 -80
  202. package/out/providers/index.d.ts +0 -8
  203. package/out/providers/index.js +0 -84
  204. package/out/providers/openai.d.ts +0 -11
  205. package/out/providers/openai.js +0 -57
  206. package/out/thin.d.ts +0 -2
  207. package/out/thin.js +0 -855
  208. package/scripts/read_python.py +0 -270
  209. /package/out/{graph → build/machine/codemap}/build.js +0 -0
  210. /package/out/{graph → build/machine/codemap}/facts.js +0 -0
  211. /package/out/{graph → build/machine/codemap}/files.js +0 -0
  212. /package/out/{graph → build/machine/codemap}/read-locales.js +0 -0
  213. /package/out/{graph → build/machine/codemap}/read-typescript.js +0 -0
  214. /package/out/{executor → build/machine/executor}/browser.js +0 -0
  215. /package/out/{executor → build/machine/executor}/documents.js +0 -0
  216. /package/out/{executor → build/machine/executor}/files.js +0 -0
  217. /package/out/{executor → build/machine/executor}/git.js +0 -0
  218. /package/out/{executor → build/machine/executor}/index.js +0 -0
  219. /package/out/{executor → build/machine/executor}/notebook.js +0 -0
  220. /package/out/{executor → build/machine/executor}/paths.js +0 -0
  221. /package/out/{executor → build/machine/executor}/shell.js +0 -0
  222. /package/out/{executor → build/machine/executor}/toolservers.js +0 -0
  223. /package/out/{executor → build/machine/executor}/worktree.js +0 -0
  224. /package/out/{lib → build/machine/folder}/project.js +0 -0
  225. /package/out/{lib → build/machine/terminal}/clipboard.js +0 -0
@@ -1,2 +0,0 @@
1
- export declare function helperLines(folder: string): Promise<string[]>;
2
- export declare function cmdAgents(args: string[]): Promise<number>;
@@ -1,79 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.helperLines = helperLines;
37
- exports.cmdAgents = cmdAgents;
38
- /**
39
- * `comprism agents` (manual 5.24): the helpers available in this project and
40
- * where each came from. The service decides what counts as a helper, which one
41
- * wins a clash and what each line says; this reads the files it names, inside
42
- * the project and through the executor's own checks, and prints its lines.
43
- */
44
- const files_1 = require("../machine/executor/files");
45
- const project_1 = require("../machine/folder/project");
46
- const gateway_1 = require("../lib/gateway");
47
- const ui = __importStar(require("../lib/ui"));
48
- const ROUNDS = 6;
49
- async function helperLines(folder) {
50
- const root = (0, project_1.resolveProject)(folder).root;
51
- const files = {};
52
- const listings = {};
53
- for (let round = 0; round < ROUNDS; round += 1) {
54
- const reply = await (0, gateway_1.ask)({ intent: "agents", prompt: "", agentsPayload: { round, files, listings, project: root } });
55
- const body = reply.agents;
56
- if (!reply.ok || reply.served === false || !body) {
57
- return [ui.fail(reply.message || "The helper list could not be read from your organization.")];
58
- }
59
- if (!body.wants)
60
- return body.lines;
61
- for (const p of body.wants.read ?? []) {
62
- const r = (0, files_1.performFileAction)(root, "read_file", { path: p });
63
- files[p] = r.isError ? null : r.content.slice(0, 8000);
64
- }
65
- for (const f of body.wants.list ?? []) {
66
- const r = (0, files_1.performFileAction)(root, "list_dir", { path: f });
67
- listings[f] = r.isError ? null : (r.content === "(empty)" ? [] : r.content.split("\n").filter(Boolean));
68
- }
69
- }
70
- return [ui.fail("The helper list could not be completed.")];
71
- }
72
- async function cmdAgents(args) {
73
- const at = args.indexOf("--cwd");
74
- const folder = at >= 0 && args[at + 1] ? String(args[at + 1]) : process.cwd();
75
- const lines = await helperLines(folder);
76
- for (const line of lines)
77
- process.stdout.write(` ${line}\n`);
78
- return lines.length === 1 && /could not/.test(lines[0] ?? "") ? 1 : 0;
79
- }
@@ -1 +0,0 @@
1
- export declare function cmdAsk(args: string[]): Promise<number>;
@@ -1,222 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.cmdAsk = cmdAsk;
37
- /**
38
- * `comprism ask` — one prompt, one answer, one receipt.
39
- *
40
- * The shortest complete demonstration of the product: a person types a
41
- * question, gets an answer on whichever model finishes it for least, and sees
42
- * what that cost against what their own model would have cost.
43
- *
44
- * NOTHING HERE DECIDES ANYTHING. The prompt goes to our server, the server
45
- * chooses the model, runs it, prices both paths and returns the receipt already
46
- * worded. This file formats what came back and prints a link. That is the whole
47
- * division: a client draws, a server decides.
48
- */
49
- const gateway_1 = require("../lib/gateway");
50
- const connection_1 = require("../lib/connection");
51
- const ui = __importStar(require("../lib/ui"));
52
- const render_1 = require("../agent/render");
53
- const prompt_1 = require("../lib/prompt");
54
- const output_1 = require("../lib/output");
55
- const stdout = (s = '') => process.stdout.write(s + '\n');
56
- const stderr = (s = '') => process.stderr.write(s + '\n');
57
- async function cmdAsk(args) {
58
- // A typing mistake is refused before anything is sent (manual 10.6, exit 2).
59
- const output = (0, output_1.outputChoice)(args);
60
- const typo = (why) => {
61
- stderr(ui.fail(why) + ui.c.dim(' Nothing ran and nothing was charged.'));
62
- return 2;
63
- };
64
- if ('bad' in output)
65
- return typo(output.bad);
66
- if (output.format === 'stream')
67
- return typo('--output stream is for comprism work; ask gives one answer, so use --output json.');
68
- const stray = (0, output_1.unknownFlag)(args, ['--model', '--output'], ['--quiet']);
69
- if (stray)
70
- return typo(`${stray} is not an option of comprism ask.`);
71
- const json = output.format === 'json';
72
- // With standard output going to a script, only the answer goes there and
73
- // everything else goes to standard error (manual 10.2). `--quiet` drops the
74
- // rest altogether.
75
- const toErr = (0, output_1.progressToErr)(output);
76
- const out = output.quiet ? (_s = '') => undefined : toErr ? stderr : stdout;
77
- const ended = (reason, why, table) => {
78
- if (json)
79
- (0, output_1.printJson)((0, output_1.localResult)(reason, why));
80
- else if (output.quiet || toErr)
81
- stderr(` ${why}`);
82
- return (0, output_1.exitFor)(reason, table);
83
- };
84
- // What they are being compared against, said BEFORE they type. A saving means
85
- // nothing without knowing what it is a saving against, and asking a person to
86
- // remember what they set last week is asking them to take the figure on
87
- // trust. Shown every time, so the number that comes back is never a surprise.
88
- const flagged = args.indexOf('--model');
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
- }
96
- // Either way round: on the line for somebody who knows what they want, or
97
- // asked for when they simply typed the command.
98
- // Text piped in is read to its end first and attached as `standard input`:
99
- // material to read, never the question (manual 3.9).
100
- const { readPiped, attachPiped } = await Promise.resolve().then(() => __importStar(require('../lib/stdin')));
101
- const piped = await readPiped();
102
- const prompt = await (0, prompt_1.subject)(args, ' prompt: ', ['--model', '--output']);
103
- if (!prompt && piped?.trim()) {
104
- (0, prompt_1.closePrompt)();
105
- return typo('Piped text needs a question with it, for example: '
106
- + 'python3 -m pytest -q 2>&1 | comprism ask "why is this failing"');
107
- }
108
- if (!prompt) {
109
- (0, prompt_1.closePrompt)();
110
- // Standard input closed with nothing on it is a missing question.
111
- return typo('Nothing was asked.');
112
- }
113
- const conn = (0, connection_1.readConnection)();
114
- (0, prompt_1.closePrompt)();
115
- if (!conn?.url || !conn.workspaceKey) {
116
- out(ui.fail('This machine is not signed in.'));
117
- out(` ${ui.c.dim('$')} comprism login`);
118
- out();
119
- return ended('signed_out', 'This machine is not signed in. Run comprism login.');
120
- }
121
- // NO KEY IS READ FROM THIS MACHINE.
122
- //
123
- // This used to scan the shell and the settings file for a vendor key and
124
- // forward it with the question. It looks harmless and it is not: a person
125
- // whose account holds a key, and who also happens to have one exported in
126
- // their shell, would have the work billed to the second account without ever
127
- // being told. Two answers to "whose money is this", and the product's whole
128
- // claim is a figure on an invoice the customer can check.
129
- //
130
- // The account's keys are the only keys. They are stored on the workspace,
131
- // visible to that person's colleagues, to the portal and to the editor, and
132
- // revocable in one place. Owner's rule, 17 September 2026.
133
- // The same value shown above. Resolved once, so the line a person read and
134
- // the figure they are given can never be about different models.
135
- const callingModel = comparedTo;
136
- let attachments = [];
137
- if (piped?.trim()) {
138
- const attach = await Promise.resolve().then(() => __importStar(require('../lib/attach')));
139
- const { attached, refused } = await attachPiped(piped, conn.url, conn.workspaceKey);
140
- for (const line of attach.describe(attached))
141
- out(ui.c.dim(` ${line}`));
142
- for (const r of refused)
143
- stderr(ui.c.amber(` ${r.why}`));
144
- if (refused.length > 0)
145
- return ended('incomplete', 'The piped text could not be attached, so nothing was sent.');
146
- attachments = attached.map((a) => a.id);
147
- }
148
- const live = new ui.LiveIndicator();
149
- if (!toErr)
150
- live.start('choosing the model that finishes this for least');
151
- const reply = await (0, gateway_1.ask)({
152
- intent: 'answer',
153
- prompt,
154
- callingModel,
155
- attachments,
156
- });
157
- live.stop();
158
- if (!reply.ok) {
159
- // Never answered: no connection is 6, a refused sign in is 3 (Appendix B).
160
- const why = reply.message || 'the service could not be reached';
161
- out(ui.fail(why));
162
- out();
163
- return ended(reply.httpStatus === 401 ? 'signed_out' : reply.httpStatus ? 'incomplete' : 'unreachable', why, reply.exit_status);
164
- }
165
- if (json && reply.result) {
166
- // The object the service built, printed as it came (manual 10.3).
167
- (0, output_1.printJson)(reply.result);
168
- return (0, output_1.exitFor)(String(reply.result.status ?? 'incomplete'), reply.exit_status);
169
- }
170
- if (!reply.answer) {
171
- out(ui.fail(reply.decision.rationale || 'no answer came back'));
172
- out();
173
- return ended('incomplete', reply.decision.rationale || 'no answer came back', reply.exit_status);
174
- }
175
- if (json) {
176
- // An older service sent no result object: the answer in the same shape.
177
- (0, output_1.printJson)({ ...(0, output_1.localResult)('done', ''), error: null, exit: 0, result: reply.answer });
178
- return 0;
179
- }
180
- out();
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);
186
- out();
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) {
193
- out(ui.c.dim(' ' + reply.receipt.split('\n').join('\n ')));
194
- out();
195
- }
196
- const money = (n) => n === null || n === undefined ? null : `$${n.toFixed(4)}`;
197
- const ran = reply.ran_on || 'your own model';
198
- const ours = money(reply.cost_usd);
199
- const theirs = money(reply.would_have_cost_usd);
200
- const saved = reply.saved_usd;
201
- if (ours && theirs) {
202
- const verb = saved !== null && saved !== undefined && saved < 0 ? 'more' : 'less';
203
- const amount = money(Math.abs(saved ?? 0));
204
- out(` ran on ${ui.c.bold(ran)} ${ours} to finish`);
205
- out(` ${ui.c.dim(`on ${reply.decision.would_have_used || callingModel} it would have been ${theirs}, so ${amount} ${verb}`)}`);
206
- }
207
- else {
208
- out(` ran on ${ui.c.bold(ran)}`);
209
- }
210
- // Said plainly rather than hidden: a figure that rests on a coarse lookup is
211
- // still worth showing, and it is never shown as if it were measured.
212
- if (reply.estimated) {
213
- out(` ${ui.c.amber('these figures are estimated')}${ui.c.dim(', because this work has no close match in the corpus yet')}`);
214
- }
215
- if (reply.details_url) {
216
- out();
217
- out(` ${ui.c.dim('the full breakdown, every figure traceable:')}`);
218
- out(` ${ui.c.bold(reply.details_url)}`);
219
- }
220
- out();
221
- return 0;
222
- }
@@ -1,2 +0,0 @@
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
- export declare function cmdMap(args: string[]): Promise<number>;
@@ -1,151 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.MAP_HELP = void 0;
37
- exports.cmdMap = cmdMap;
38
- /**
39
- * `comprism map` — look at the map of this project, refresh it, or switch it
40
- * off for one job.
41
- *
42
- * The map is normally kept current on its own: every job checks the files
43
- * before it starts and reads back whatever moved. This command exists for the
44
- * two moments that happen anyway. Somebody has just had an answer they did not
45
- * believe and wants it rebuilt from scratch. And somebody wants to see what the
46
- * product actually holds about their codebase, which is a fair question to ask
47
- * of any tool that holds anything.
48
- *
49
- * Nothing here decides anything. It reads files, sends structure, and prints
50
- * what the service says back.
51
- */
52
- const ui = __importStar(require("../lib/ui"));
53
- const gateway_1 = require("../lib/gateway");
54
- const sync_1 = require("../graph/sync");
55
- const settings_1 = require("./settings");
56
- const out = (s = "") => process.stdout.write(`${s}\n`);
57
- exports.MAP_HELP = `
58
- comprism map what the map of this workspace holds
59
- comprism map refresh read every file again, now
60
- comprism map forget remove this workspace's map from the service
61
- comprism map off ask your administrator to switch it off
62
-
63
- The map is a record of what your workspace is made of: its functions, screens,
64
- endpoints and tables, and what connects to what. It is read on this machine
65
- and only its structure is sent. Your source code never leaves here.
66
-
67
- It is kept current by itself. Every job checks the files first and reads back
68
- whatever moved, so you should not normally need any of this.
69
- `;
70
- /** The project name the service holds the map under: the folder's own name,
71
- * which is what every other part of the tool sends as the workspace. */
72
- function projectName(root) {
73
- return root.split("/").filter(Boolean).pop() || root;
74
- }
75
- async function cmdMap(args) {
76
- if (args.includes("--help") || args.includes("-h")) {
77
- out(exports.MAP_HELP);
78
- return 0;
79
- }
80
- const root = (0, settings_1.currentWorkspace)().path;
81
- const workspace = projectName(root);
82
- const action = (args[0] || "status").toLowerCase();
83
- if (action === "forget") {
84
- const gone = await (0, gateway_1.ask)({
85
- intent: "graph", prompt: "", graphOp: "forget", workspace,
86
- });
87
- if (!gone.ok) {
88
- out(ui.fail("The service could not be reached, so nothing was removed."));
89
- return 1;
90
- }
91
- out(ui.ok(`The map of ${workspace} has been removed. The next job will read it again.`));
92
- return 0;
93
- }
94
- if (action === "off") {
95
- // Said rather than done. The switch is company-wide and belongs to an
96
- // administrator, and a machine credential is not the thing that should be
97
- // able to change a control every colleague is subject to. One job can still
98
- // go without a map with `comprism work --no-map`.
99
- out();
100
- out(" The code map is switched on and off for the whole company, under");
101
- out(" Administration in the web portal. An administrator can do it there.");
102
- out();
103
- out(" To run one job without it: comprism work --no-map \"...\"");
104
- out();
105
- return 0;
106
- }
107
- if (action === "refresh" || action === "rebuild") {
108
- out();
109
- out(` Reading ${workspace}...`);
110
- const done = await (0, sync_1.refresh)(root, workspace, { force: true });
111
- out();
112
- out(done.current ? ui.ok(done.message) : ui.fail(done.message));
113
- if (done.unread)
114
- out(` ${ui.c.dim((0, sync_1.readerReport)())}`);
115
- out();
116
- return done.current ? 0 : 1;
117
- }
118
- const now = await (0, sync_1.status)(root, workspace);
119
- out();
120
- if (!now.reachable) {
121
- out(ui.fail("The service could not be reached."));
122
- out();
123
- return 1;
124
- }
125
- if (!now.enabled) {
126
- out(" Your company has the code map switched off. Nothing about your code");
127
- out(" is read, sent or stored, and jobs read files the ordinary way.");
128
- out();
129
- return 0;
130
- }
131
- if (!now.hasMap) {
132
- out(` There is no map of ${workspace} yet. It will be read the first time`);
133
- out(" you run a job here, or now with: comprism map refresh");
134
- out();
135
- return 0;
136
- }
137
- const held = now.held ?? {};
138
- const counts = (held.counts ?? {});
139
- out(` ${ui.c.bold(workspace)}`);
140
- out(` ${held.files ?? 0} files, read from commit ${String(held.commit ?? "").slice(0, 8) || "none"}`);
141
- out(` ${counts.objects ?? 0} things and ${counts.links ?? 0} links between them`);
142
- out(` ${counts.endpoints ?? 0} endpoints, ${counts.data_models ?? 0} data models, `
143
- + `${counts.tables ?? 0} tables, ${counts.screens ?? 0} screens`);
144
- out(` ${now.fresh ? "Matches the files on disk." : "The code has moved since it was read. The next job will bring it up to date."}`);
145
- if (held.coverage)
146
- out(` ${ui.c.dim(String(held.coverage))}`);
147
- out();
148
- out(` ${ui.c.dim(now.autoRefresh ? "Kept current automatically." : "Only refreshed when you ask.")}`);
149
- out();
150
- return 0;
151
- }
@@ -1,39 +0,0 @@
1
- /**
2
- * Sign this machine out.
3
- *
4
- * ── Forgetting is not signing out ─────────────────────────────────────────
5
- *
6
- * This used to delete the local copy of the credential and say "disconnected".
7
- * The credential stayed live: still listed in the portal, still accepted on
8
- * every call, so anybody holding a copy of that file was still signed in and
9
- * the person who signed out had no way to know it.
10
- *
11
- * So the server is told FIRST, on the one service every client shares, and it
12
- * revokes the credential where it was minted. The local copy is then removed
13
- * whatever the server said, because a person who asked to sign out must not be
14
- * left holding a credential on a laptop they have finished with: if the server
15
- * could not be reached, the key on this machine is gone and the words say
16
- * plainly that it may still be live until it is revoked in the portal.
17
- *
18
- * `logout`, `signout` and `disconnect` are the same act under the three words
19
- * people actually type. `logout` printed "there is no command called logout",
20
- * which is the product telling somebody their own vocabulary is wrong.
21
- */
22
- export declare function cmdDisconnect(): Promise<void>;
23
- /**
24
- * Where this machine is pointed, and whether the workspace still accepts it.
25
- *
26
- * ── Why this asks the server rather than reading the file ─────────────────
27
- *
28
- * It used to report "signed in" from the presence of a local file, which is a
29
- * statement about a laptop and not about an account. A credential revoked in
30
- * the portal an hour ago still reads as signed in; so does a machine pointed at
31
- * an address that has not answered for a week. That is precisely how a
32
- * developer spent an evening on 17 September 2026 believing he was signed in to
33
- * a workspace while every call was going to a dead port on his own laptop.
34
- *
35
- * Status is the command a person runs when something is wrong, so it is the one
36
- * command that must never report a local guess as a fact. It asks the one
37
- * service and prints what came back, or says it heard nothing.
38
- */
39
- export declare function cmdStatus(): Promise<void>;